ar71xx: remove static MTD maps from AP121/DB120 boards

SVN-Revision: 31016
This commit is contained in:
Gabor Juhos 2012-03-19 11:11:19 +00:00
parent db6e326c56
commit 6028889727
4 changed files with 22 additions and 262 deletions

View file

@ -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),

View file

@ -9,12 +9,9 @@
*
* All rights reserved.
*
@@ -37,17 +37,28 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -38,16 +38,25 @@
*/
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
@ -40,7 +37,7 @@
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
@@ -58,8 +69,50 @@
@@ -58,8 +67,10 @@
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
@ -50,50 +47,10 @@
+#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 = {
{
@@ -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,
},
@ -105,7 +62,7 @@
};
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
},
};
@ -191,7 +148,7 @@
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);

View file

@ -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),

View file

@ -9,12 +9,9 @@
*
* All rights reserved.
*
@@ -37,17 +37,28 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -38,16 +38,25 @@
*/
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
#include <linux/pci.h>
+#include <linux/phy.h>
+#include <linux/platform_device.h>
@ -40,7 +37,7 @@
#define DB120_GPIO_LED_WLAN_5G 12
#define DB120_GPIO_LED_WLAN_2G 13
#define DB120_GPIO_LED_STATUS 14
@@ -58,8 +69,50 @@
@@ -58,8 +67,10 @@
#define DB120_KEYS_POLL_INTERVAL 20 /* msecs */
#define DB120_KEYS_DEBOUNCE_INTERVAL (3 * DB120_KEYS_POLL_INTERVAL)
@ -50,50 +47,10 @@
+#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 = {
{
@@ -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,
},
@ -105,7 +62,7 @@
};
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
},
};
@ -191,7 +148,7 @@
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);