|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
--- a/arch/mips/ath79/mach-ap121.c
|
|
|
|
|
+++ b/arch/mips/ath79/mach-ap121.c
|
|
|
|
|
@@ -1,19 +1,23 @@
|
|
|
|
|
@@ -1,19 +1,21 @@
|
|
|
|
|
/*
|
|
|
|
|
* Atheros AP121 board support
|
|
|
|
|
*
|
|
|
|
@ -11,8 +11,6 @@
|
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
|
* by the Free Software Foundation.
|
|
|
|
|
*/
|
|
|
|
|
+#include <linux/mtd/mtd.h>
|
|
|
|
|
+#include <linux/mtd/partitions.h>
|
|
|
|
|
|
|
|
|
|
-#include "machtypes.h"
|
|
|
|
|
+#include "dev-eth.h"
|
|
|
|
@ -26,7 +24,7 @@
|
|
|
|
|
|
|
|
|
|
#define AP121_GPIO_LED_WLAN 0
|
|
|
|
|
#define AP121_GPIO_LED_USB 1
|
|
|
|
|
@@ -24,7 +28,82 @@
|
|
|
|
|
@@ -24,7 +26,14 @@
|
|
|
|
|
#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
|
|
|
|
|
#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
|
|
|
|
|
|
|
|
|
@ -39,78 +37,10 @@
|
|
|
|
|
+#define AP121_MINI_GPIO_LED_WLAN 0
|
|
|
|
|
+#define AP121_MINI_GPIO_BTN_JUMPSTART 12
|
|
|
|
|
+#define AP121_MINI_GPIO_BTN_RESET 11
|
|
|
|
|
+
|
|
|
|
|
+static struct mtd_partition ap121_parts[] = {
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "u-boot",
|
|
|
|
|
+ .offset = 0,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "rootfs",
|
|
|
|
|
+ .offset = 0x010000,
|
|
|
|
|
+ .size = 0x130000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "uImage",
|
|
|
|
|
+ .offset = 0x140000,
|
|
|
|
|
+ .size = 0x0a0000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "NVRAM",
|
|
|
|
|
+ .offset = 0x1e0000,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "ART",
|
|
|
|
|
+ .offset = 0x1f0000,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static struct mtd_partition ap121_mini_parts[] = {
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "u-boot",
|
|
|
|
|
+ .offset = 0,
|
|
|
|
|
+ .size = 0x040000,
|
|
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "u-boot-env",
|
|
|
|
|
+ .offset = 0x040000,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "rootfs",
|
|
|
|
|
+ .offset = 0x050000,
|
|
|
|
|
+ .size = 0x2b0000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "uImage",
|
|
|
|
|
+ .offset = 0x300000,
|
|
|
|
|
+ .size = 0x0e0000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "NVRAM",
|
|
|
|
|
+ .offset = 0x3e0000,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .name = "ART",
|
|
|
|
|
+ .offset = 0x3f0000,
|
|
|
|
|
+ .size = 0x010000,
|
|
|
|
|
+ .mask_flags = MTD_WRITEABLE,
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static struct flash_platform_data ap121_flash_data;
|
|
|
|
|
|
|
|
|
|
static struct gpio_led ap121_leds_gpio[] __initdata = {
|
|
|
|
|
{
|
|
|
|
|
@@ -58,41 +137,84 @@ static struct gpio_keys_button ap121_gpi
|
|
|
|
|
@@ -58,41 +67,78 @@ static struct gpio_keys_button ap121_gpi
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -126,14 +56,13 @@
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
-static struct spi_board_info ap121_spi_info[] = {
|
|
|
|
|
- {
|
|
|
|
|
+static struct gpio_keys_button ap121_mini_gpio_keys[] __initdata = {
|
|
|
|
|
{
|
|
|
|
|
- .bus_num = 0,
|
|
|
|
|
- .chip_select = 0,
|
|
|
|
|
- .max_speed_hz = 25000000,
|
|
|
|
|
- .modalias = "mx25l1606e",
|
|
|
|
|
- .controller_data = &ap121_spi0_data,
|
|
|
|
|
+static struct gpio_keys_button ap121_mini_gpio_keys[] __initdata = {
|
|
|
|
|
+ {
|
|
|
|
|
+ .desc = "jumpstart button",
|
|
|
|
|
+ .type = EV_KEY,
|
|
|
|
|
+ .code = KEY_WPS_BUTTON,
|
|
|
|
@ -159,7 +88,7 @@
|
|
|
|
|
+{
|
|
|
|
|
+ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
|
|
|
|
|
+
|
|
|
|
|
+ ath79_register_m25p80(&ap121_flash_data);
|
|
|
|
|
+ ath79_register_m25p80(NULL);
|
|
|
|
|
+ ath79_register_wmac(art + AP121_CALDATA_OFFSET,
|
|
|
|
|
+ art + AP121_WMAC_MAC_OFFSET);
|
|
|
|
|
+
|
|
|
|
@ -178,9 +107,6 @@
|
|
|
|
|
static void __init ap121_setup(void)
|
|
|
|
|
{
|
|
|
|
|
- u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
|
|
|
|
|
+ ap121_flash_data.parts = ap121_parts;
|
|
|
|
|
+ ap121_flash_data.nr_parts = ARRAY_SIZE(ap121_parts);
|
|
|
|
|
+
|
|
|
|
|
+ ap121_common_setup();
|
|
|
|
|
|
|
|
|
|
ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
|
|
|
|
@ -200,9 +126,6 @@
|
|
|
|
|
+
|
|
|
|
|
+static void __init ap121_mini_setup(void)
|
|
|
|
|
+{
|
|
|
|
|
+ ap121_flash_data.parts = ap121_mini_parts;
|
|
|
|
|
+ ap121_flash_data.nr_parts = ARRAY_SIZE(ap121_mini_parts);
|
|
|
|
|
+
|
|
|
|
|
+ ap121_common_setup();
|
|
|
|
|
+
|
|
|
|
|
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_mini_leds_gpio),
|
|
|
|
|