--- a/arch/mips/ath79/mach-ap121.c
+++ b/arch/mips/ath79/mach-ap121.c
--- a/arch/mips/ath79/mach-ap121.c
+++ b/arch/mips/ath79/mach-ap121.c
/*
* Atheros AP121 board support
*
/*
* Atheros AP121 board support
*
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
* 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"
-#include "machtypes.h"
+#include "dev-eth.h"
#define AP121_GPIO_LED_WLAN 0
#define AP121_GPIO_LED_USB 1
#define AP121_GPIO_LED_WLAN 0
#define AP121_GPIO_LED_USB 1
#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
+#define AP121_MINI_GPIO_LED_WLAN 0
+#define AP121_MINI_GPIO_BTN_JUMPSTART 12
+#define AP121_MINI_GPIO_BTN_RESET 11
+#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 = {
{
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
};
-static struct spi_board_info ap121_spi_info[] = {
};
-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,
- .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,
+ .desc = "jumpstart button",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+{
+ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+{
+ 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);
+
+ ath79_register_wmac(art + AP121_CALDATA_OFFSET,
+ art + AP121_WMAC_MAC_OFFSET);
+
static void __init ap121_setup(void)
{
- u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
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),
+ ap121_common_setup();
ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
+
+static void __init ap121_mini_setup(void)
+{
+
+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),
+ ap121_common_setup();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_mini_leds_gpio),
*
* All rights reserved.
*
*
* All rights reserved.
*
-@@ -37,17 +37,28 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/partitions.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
+#define DB120_MAC1_OFFSET 6
+#define DB120_WMAC_CALDATA_OFFSET 0x1000
+#define DB120_PCIE_CALDATA_OFFSET 0x5000
+#define DB120_MAC1_OFFSET 6
+#define DB120_WMAC_CALDATA_OFFSET 0x1000
+#define DB120_PCIE_CALDATA_OFFSET 0x5000
-+
-+static struct mtd_partition db120_partitions[] = {
-+ {
-+ .name = "u-boot",
-+ .offset = 0,
-+ .size = 0x040000,
-+ .mask_flags = MTD_WRITEABLE,
-+ },
-+ {
-+ .name = "u-boot-env",
-+ .offset = 0x040000,
-+ .size = 0x010000,
-+ },
-+ {
-+ .name = "rootfs",
-+ .offset = 0x050000,
-+ .size = 0x630000,
-+ },
-+ {
-+ .name = "uImage",
-+ .offset = 0x680000,
-+ .size = 0x160000,
-+ },
-+ {
-+ .name = "NVRAM",
-+ .offset = 0x7E0000,
-+ .size = 0x010000,
-+ },
-+ {
-+ .name = "ART",
-+ .offset = 0x7F0000,
-+ .size = 0x010000,
-+ .mask_flags = MTD_WRITEABLE,
-+ }
-+};
-+
-+static struct flash_platform_data db120_flash_data = {
-+ .parts = db120_partitions,
-+ .nr_parts = ARRAY_SIZE(db120_partitions),
-+};
static struct gpio_led db120_leds_gpio[] __initdata = {
{
static struct gpio_led db120_leds_gpio[] __initdata = {
{
-@@ -82,6 +135,11 @@ static struct gpio_led db120_leds_gpio[]
+@@ -82,6 +93,11 @@ static struct gpio_led db120_leds_gpio[]
.gpio = DB120_GPIO_LED_WLAN_2G,
.active_low = 1,
},
.gpio = DB120_GPIO_LED_WLAN_2G,
.active_low = 1,
},
};
static struct gpio_keys_button db120_gpio_keys[] __initdata = {
};
static struct gpio_keys_button db120_gpio_keys[] __initdata = {
-@@ -95,66 +153,89 @@ static struct gpio_keys_button db120_gpi
+@@ -95,66 +111,89 @@ static struct gpio_keys_button db120_gpi
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+ ath79_gpio_output_select(DB120_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+ ath79_gpio_output_select(DB120_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);
-+ ath79_register_m25p80(&db120_flash_data);
++ ath79_register_m25p80(NULL);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);
--- a/arch/mips/ath79/mach-ap121.c
+++ b/arch/mips/ath79/mach-ap121.c
--- a/arch/mips/ath79/mach-ap121.c
+++ b/arch/mips/ath79/mach-ap121.c
/*
* Atheros AP121 board support
*
/*
* Atheros AP121 board support
*
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
* 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"
-#include "machtypes.h"
+#include "dev-eth.h"
#define AP121_GPIO_LED_WLAN 0
#define AP121_GPIO_LED_USB 1
#define AP121_GPIO_LED_WLAN 0
#define AP121_GPIO_LED_USB 1
#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
#define AP121_KEYS_POLL_INTERVAL 20 /* msecs */
#define AP121_KEYS_DEBOUNCE_INTERVAL (3 * AP121_KEYS_POLL_INTERVAL)
+#define AP121_MINI_GPIO_LED_WLAN 0
+#define AP121_MINI_GPIO_BTN_JUMPSTART 12
+#define AP121_MINI_GPIO_BTN_RESET 11
+#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 = {
{
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
};
-static struct spi_board_info ap121_spi_info[] = {
};
-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,
- .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,
+ .desc = "jumpstart button",
+ .type = EV_KEY,
+ .code = KEY_WPS_BUTTON,
+{
+ u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+{
+ 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);
+
+ ath79_register_wmac(art + AP121_CALDATA_OFFSET,
+ art + AP121_WMAC_MAC_OFFSET);
+
static void __init ap121_setup(void)
{
- u8 *cal_data = (u8 *) KSEG1ADDR(AP121_CAL_DATA_ADDR);
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),
+ ap121_common_setup();
ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_leds_gpio),
+
+static void __init ap121_mini_setup(void)
+{
+
+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),
+ ap121_common_setup();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(ap121_mini_leds_gpio),
*
* All rights reserved.
*
*
* All rights reserved.
*
-@@ -37,17 +37,28 @@
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/partitions.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
+#define DB120_MAC1_OFFSET 6
+#define DB120_WMAC_CALDATA_OFFSET 0x1000
+#define DB120_PCIE_CALDATA_OFFSET 0x5000
+#define DB120_MAC1_OFFSET 6
+#define DB120_WMAC_CALDATA_OFFSET 0x1000
+#define DB120_PCIE_CALDATA_OFFSET 0x5000
-+
-+static struct mtd_partition db120_partitions[] = {
-+ {
-+ .name = "u-boot",
-+ .offset = 0,
-+ .size = 0x040000,
-+ .mask_flags = MTD_WRITEABLE,
-+ },
-+ {
-+ .name = "u-boot-env",
-+ .offset = 0x040000,
-+ .size = 0x010000,
-+ },
-+ {
-+ .name = "rootfs",
-+ .offset = 0x050000,
-+ .size = 0x630000,
-+ },
-+ {
-+ .name = "uImage",
-+ .offset = 0x680000,
-+ .size = 0x160000,
-+ },
-+ {
-+ .name = "NVRAM",
-+ .offset = 0x7E0000,
-+ .size = 0x010000,
-+ },
-+ {
-+ .name = "ART",
-+ .offset = 0x7F0000,
-+ .size = 0x010000,
-+ .mask_flags = MTD_WRITEABLE,
-+ }
-+};
-+
-+static struct flash_platform_data db120_flash_data = {
-+ .parts = db120_partitions,
-+ .nr_parts = ARRAY_SIZE(db120_partitions),
-+};
static struct gpio_led db120_leds_gpio[] __initdata = {
{
static struct gpio_led db120_leds_gpio[] __initdata = {
{
-@@ -82,6 +135,11 @@ static struct gpio_led db120_leds_gpio[]
+@@ -82,6 +93,11 @@ static struct gpio_led db120_leds_gpio[]
.gpio = DB120_GPIO_LED_WLAN_2G,
.active_low = 1,
},
.gpio = DB120_GPIO_LED_WLAN_2G,
.active_low = 1,
},
};
static struct gpio_keys_button db120_gpio_keys[] __initdata = {
};
static struct gpio_keys_button db120_gpio_keys[] __initdata = {
-@@ -95,66 +153,89 @@ static struct gpio_keys_button db120_gpi
+@@ -95,66 +111,89 @@ static struct gpio_keys_button db120_gpi
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+ ath79_gpio_output_select(DB120_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+ ath79_gpio_output_select(DB120_GPIO_LED_USB, AR934X_GPIO_OUT_GPIO);
-+ ath79_register_m25p80(&db120_flash_data);
++ ath79_register_m25p80(NULL);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);
+
ath79_register_leds_gpio(-1, ARRAY_SIZE(db120_leds_gpio),
db120_leds_gpio);