From 58f5a971fa36890e14b513b7884fc1df8bbe0c67 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 21 Jul 2009 16:55:49 +0200 Subject: cdev fixes for new boards Signed-off-by: Sascha Hauer --- board/a9m2410/a9m2410.c | 25 +++++-------------------- board/a9m2440/a9m2440.c | 24 ++++-------------------- board/eukrea_cpuimx27/eukrea_cpuimx27.c | 14 ++------------ 3 files changed, 11 insertions(+), 52 deletions(-) (limited to 'board') diff --git a/board/a9m2410/a9m2410.c b/board/a9m2410/a9m2410.c index 696fc7dbf0..bc10241fc6 100644 --- a/board/a9m2410/a9m2410.c +++ b/board/a9m2410/a9m2410.c @@ -37,10 +37,7 @@ static struct device_d sdram_dev = { .name = "ram", - .id = "ram0", - .map_base = CS6_BASE, - .type = DEVICE_TYPE_DRAM, }; // {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, 0}, @@ -61,10 +58,8 @@ static struct device_d nand_dev = { */ static struct device_d network_dev = { .name = "smc91c111", - .id = "eth0", .map_base = CS1_BASE + 0x300, .size = 16, - .type = DEVICE_TYPE_ETHER, }; #if 0 @@ -94,7 +89,6 @@ static struct device_d ext_serial_dev[] = { static int a9m2410_devices_init(void) { uint32_t reg; - struct device_d *nand, *dev; /* * detect the current memory size @@ -178,18 +172,11 @@ static int a9m2410_devices_init(void) #ifdef CONFIG_NAND /* ----------- add some vital partitions -------- */ - nand = get_device_by_path("/dev/nand0"); - if (nand) { - dev = dev_add_partition(nand, 0x00000, 0x40000, - PARTITION_FIXED, "self_raw"); - if (dev) { - dev_add_bb_dev(dev, "self0"); - dev = dev_add_partition(nand, 0x40000, 0x20000, - PARTITION_FIXED, "env_raw"); - if (dev) - dev_add_bb_dev(dev, "env0"); - } - } + devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw"); + dev_add_bb_dev("self_raw", "self0"); + + devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw"); + dev_add_bb_dev("env_raw", "env0"); #endif armlinux_set_bootparams((void *)sdram_dev.map_base + 0x100); @@ -214,10 +201,8 @@ void __bare_init nand_boot(void) static struct device_d a9m2410_serial_device = { .name = "s3c24x0_serial", - .id = "cs0", .map_base = UART1_BASE, .size = UART1_SIZE, - .type = DEVICE_TYPE_CONSOLE, }; static int a9m2410_console_init(void) diff --git a/board/a9m2440/a9m2440.c b/board/a9m2440/a9m2440.c index 522333764f..43ec75b932 100644 --- a/board/a9m2440/a9m2440.c +++ b/board/a9m2440/a9m2440.c @@ -37,10 +37,7 @@ static struct device_d sdram_dev = { .name = "ram", - .id = "ram0", - .map_base = CS6_BASE, - .type = DEVICE_TYPE_DRAM, }; static struct s3c24x0_nand_platform_data nand_info = { @@ -60,16 +57,13 @@ static struct device_d nand_dev = { */ static struct device_d network_dev = { .name = "smc91c111", - .id = "eth0", .map_base = CS1_BASE + 0x300, .size = 16, - .type = DEVICE_TYPE_ETHER, }; static int a9m2440_devices_init(void) { uint32_t reg; - struct device_d *nand, *dev; /* * detect the current memory size @@ -165,18 +159,10 @@ static int a9m2440_devices_init(void) #ifdef CONFIG_NAND /* ----------- add some vital partitions -------- */ - nand = get_device_by_path("/dev/nand0"); - if (nand) { - dev = dev_add_partition(nand, 0x00000, 0x40000, - PARTITION_FIXED, "self_raw"); - if (dev) { - dev_add_bb_dev(dev, "self0"); - dev = dev_add_partition(nand, 0x40000, 0x20000, - PARTITION_FIXED, "env_raw"); - if (dev) - dev_add_bb_dev(dev, "env0"); - } - } + devfs_add_partition("nand0", 0x00000, 0x40000, PARTITION_FIXED, "self_raw"); + dev_add_bb_dev("self_raw", "self0"); + + devfs_add_partition("nand0", 0x40000, 0x20000, PARTITION_FIXED, "env_raw"); #endif armlinux_set_bootparams((void *)sdram_dev.map_base + 0x100); @@ -196,10 +182,8 @@ void __bare_init nand_boot(void) static struct device_d a9m2440_serial_device = { .name = "s3c24x0_serial", - .id = "cs0", .map_base = UART1_BASE, .size = UART1_SIZE, - .type = DEVICE_TYPE_CONSOLE, }; static int a9m2440_console_init(void) diff --git a/board/eukrea_cpuimx27/eukrea_cpuimx27.c b/board/eukrea_cpuimx27/eukrea_cpuimx27.c index c87805f883..a371f2d9db 100644 --- a/board/eukrea_cpuimx27/eukrea_cpuimx27.c +++ b/board/eukrea_cpuimx27/eukrea_cpuimx27.c @@ -43,20 +43,14 @@ static struct device_d cfi_dev = { .name = "cfi_flash", - .id = "nor0", - .map_base = 0xC0000000, .size = 64 * 1024 * 1024, }; static struct device_d sdram_dev = { .name = "ram", - .id = "ram0", - .map_base = 0xa0000000, .size = 128 * 1024 * 1024, - - .type = DEVICE_TYPE_DRAM, }; static struct fec_platform_data fec_info = { @@ -66,10 +60,8 @@ static struct fec_platform_data fec_info = { static struct device_d fec_dev = { .name = "fec_imx", - .id = "eth0", .map_base = 0x1002b000, .platform_data = &fec_info, - .type = DEVICE_TYPE_ETHER, }; struct imx_nand_platform_data nand_info = { @@ -133,8 +125,8 @@ static int eukrea_cpuimx27_devices_init(void) register_device(&nand_dev); register_device(&sdram_dev); - dev_add_partition(&cfi_dev, 0x00000, 0x40000, PARTITION_FIXED, "self"); - dev_add_partition(&cfi_dev, 0x40000, 0x20000, PARTITION_FIXED, "env"); + devfs_add_partition("nor0", 0x00000, 0x40000, PARTITION_FIXED, "self0"); + devfs_add_partition("nor0", 0x40000, 0x20000, PARTITION_FIXED, "env0"); dev_protect(&cfi_dev, 0x40000, 0, 1); envdev = "NOR"; @@ -150,10 +142,8 @@ device_initcall(eukrea_cpuimx27_devices_init); static struct device_d eukrea_cpuimx27_serial_device = { .name = "imx_serial", - .id = "cs0", .map_base = IMX_UART1_BASE, .size = 4096, - .type = DEVICE_TYPE_CONSOLE, }; static int eukrea_cpuimx27_console_init(void) -- cgit v1.2.3