summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-23 17:42:28 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-07-29 14:04:24 +0800
commit06c36cf09e08cfd054c2d1e61be8492c4e5dc929 (patch)
tree15b21f44075e7deeeabde516f9b55478dbcce050 /arch/arm/boards
parent3465da7aa8821252f95aec5e8bb7e6a8f4f4a4f0 (diff)
downloadbarebox-06c36cf09e08cfd054c2d1e61be8492c4e5dc929.tar.gz
barebox-06c36cf09e08cfd054c2d1e61be8492c4e5dc929.tar.xz
dm9000: introduce add_dm9000_device to register dm9000 device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/at91sam9261ek/init.c25
-rw-r--r--arch/arm/boards/mini2440/mini2440.c24
-rw-r--r--arch/arm/boards/pm9261/init.c26
-rw-r--r--arch/arm/boards/scb9328/scb9328.c25
4 files changed, 9 insertions, 91 deletions
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 812b39958b..627202f1c2 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -89,31 +89,9 @@ static void ek_add_device_nand(void)
*/
#if defined(CONFIG_DRIVER_NET_DM9000)
static struct dm9000_platform_data dm9000_data = {
- .buswidth = IORESOURCE_MEM_16BIT,
.srom = 0,
};
-static struct resource dm9000_resources[] = {
- [0] = {
- .start = AT91_CHIPSELECT_2,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = AT91_CHIPSELECT_2 + 4,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct device_d dm9000_dev = {
- .id = 0,
- .name = "dm9000",
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
- .platform_data = &dm9000_data,
-};
-
/*
* SMC timings for the DM9000.
* Note: These timings were calculated for MASTER_CLOCK = 100000000 according to the DM9000 timings.
@@ -147,7 +125,8 @@ static void __init ek_add_device_dm9000(void)
/* Configure Interrupt pin as input, no pull-up */
at91_set_gpio_input(AT91_PIN_PC11, 0);
- register_device(&dm9000_dev);
+ add_dm9000_device(0, AT91_CHIPSELECT_2, AT91_CHIPSELECT_2 + 4,
+ IORESOURCE_MEM_16BIT, &dm9000_data);
}
#else
static void __init ek_add_device_dm9000(void) {}
diff --git a/arch/arm/boards/mini2440/mini2440.c b/arch/arm/boards/mini2440/mini2440.c
index 634e0351a2..dbf75032ee 100644
--- a/arch/arm/boards/mini2440/mini2440.c
+++ b/arch/arm/boards/mini2440/mini2440.c
@@ -63,30 +63,9 @@ static struct device_d nand_dev = {
* Area 2: Offset 0x304...0x307
*/
static struct dm9000_platform_data dm9000_data = {
- .buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};
-static struct resource dm9000_resources[] = {
- [0] = {
- .start = CS4_BASE + 0x300,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = CS4_BASE + 0x304,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct device_d dm9000_dev = {
- .name = "dm9000",
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
- .platform_data = &dm9000_data,
-};
-
static struct s3c_mci_platform_data mci_data = {
.caps = MMC_MODE_4BIT | MMC_MODE_HS | MMC_MODE_HS_52MHz,
.voltages = MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -332,7 +311,8 @@ static int mini2440_devices_init(void)
IORESOURCE_MEM_WRITEABLE);
armlinux_add_dram(sdram_dev);
- register_device(&dm9000_dev);
+ add_dm9000_device(0, CS4_BASE + 0x300, CS4_BASE + 0x304,
+ IORESOURCE_MEM_16BIT, &dm9000_data);
#ifdef CONFIG_NAND
/* ----------- add some vital partitions -------- */
devfs_del_partition("self_raw");
diff --git a/arch/arm/boards/pm9261/init.c b/arch/arm/boards/pm9261/init.c
index fa21e24090..783a40497f 100644
--- a/arch/arm/boards/pm9261/init.c
+++ b/arch/arm/boards/pm9261/init.c
@@ -89,31 +89,9 @@ static void pm_add_device_nand(void)
*/
#if defined(CONFIG_DRIVER_NET_DM9000)
static struct dm9000_platform_data dm9000_data = {
- .buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};
-static struct resource dm9000_resources[] = {
- [0] = {
- .start = AT91_CHIPSELECT_2,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = AT91_CHIPSELECT_2 + 4,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct device_d dm9000_dev = {
- .id = 0,
- .name = "dm9000",
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
- .platform_data = &dm9000_data,
-};
-
/*
* SMC timings for the DM9000.
* Note: These timings were calculated for MASTER_CLOCK = 100000000 according to the DM9000 timings.
@@ -141,7 +119,8 @@ static void __init pm_add_device_dm9000(void)
/* Configure chip-select 2 (DM9000) */
sam9_smc_configure(2, &dm9000_smc_config);
- register_device(&dm9000_dev);
+ add_dm9000_device(0, AT91_CHIPSELECT_2, AT91_CHIPSELECT_2 + 4,
+ IORESOURCE_MEM_16BIT, &dm9000_data);
}
#else
static void __init ek_add_device_dm9000(void) {}
@@ -151,6 +130,7 @@ static int pm9261_devices_init(void)
{
at91_add_device_sdram(64 * 1024 * 1024);
pm_add_device_nand();
+ pm_add_device_dm9000();
add_cfi_flash_device(0, AT91_CHIPSELECT_0, 4 * 1024 * 1024, 0);
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self");
diff --git a/arch/arm/boards/scb9328/scb9328.c b/arch/arm/boards/scb9328/scb9328.c
index 4c0ed02aa3..5c52af97c5 100644
--- a/arch/arm/boards/scb9328/scb9328.c
+++ b/arch/arm/boards/scb9328/scb9328.c
@@ -35,31 +35,9 @@
#include <mach/devices-imx1.h>
static struct dm9000_platform_data dm9000_data = {
- .buswidth = IORESOURCE_MEM_16BIT,
.srom = 1,
};
-static struct resource dm9000_resources[] = {
- [0] = {
- .start = 0x16000000,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x16000004,
- .size = 4,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct device_d dm9000_dev = {
- .id = -1,
- .name = "dm9000",
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
- .platform_data = &dm9000_data,
-};
-
struct gpio_led leds[] = {
{
.gpio = 32 + 21,
@@ -107,7 +85,8 @@ static int scb9328_devices_init(void)
sdram_dev = add_mem_device("ram0", 0x08000000, 16 * 1024 * 1024,
IORESOURCE_MEM_WRITEABLE);
armlinux_add_dram(sdram_dev);
- register_device(&dm9000_dev);
+ add_dm9000_device(-1, 0x16000000, 0x16000004,
+ IORESOURCE_MEM_16BIT, &dm9000_data);
devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0");
devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0");