X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-sa1100%2Fcerf.c;h=31afe50d7cd59746360d0dbbb642c7f87197bdcb;hb=refs%2Fheads%2Fvserver;hp=2c4c05013cc9fa1f56b242d53a2a5140137199ca;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c index 2c4c05013..31afe50d7 100644 --- a/arch/arm/mach-sa1100/cerf.c +++ b/arch/arm/mach-sa1100/cerf.c @@ -10,11 +10,13 @@ * Jan-2004 : Removed io map for flash [FB] */ -#include #include #include #include -#include +#include +#include +#include +#include #include #include @@ -22,10 +24,12 @@ #include #include +#include #include #include #include +#include #include "generic.h" static struct resource cerfuart2_resources[] = { @@ -47,6 +51,48 @@ static struct platform_device *cerf_devices[] __initdata = { &cerfuart2_device, }; +#ifdef CONFIG_SA1100_CERF_FLASH_32MB +# define CERF_FLASH_SIZE 0x02000000 +#elif defined CONFIG_SA1100_CERF_FLASH_16MB +# define CERF_FLASH_SIZE 0x01000000 +#elif defined CONFIG_SA1100_CERF_FLASH_8MB +# define CERF_FLASH_SIZE 0x00800000 +#else +# error "Undefined flash size for CERF" +#endif + +static struct mtd_partition cerf_partitions[] = { + { + .name = "Bootloader", + .size = 0x00020000, + .offset = 0x00000000, + }, { + .name = "Params", + .size = 0x00040000, + .offset = 0x00020000, + }, { + .name = "Kernel", + .size = 0x00100000, + .offset = 0x00060000, + }, { + .name = "Filesystem", + .size = CERF_FLASH_SIZE-0x00160000, + .offset = 0x00160000, + } +}; + +static struct flash_platform_data cerf_flash_data = { + .map_name = "cfi_probe", + .parts = cerf_partitions, + .nr_parts = ARRAY_SIZE(cerf_partitions), +}; + +static struct resource cerf_flash_resource = { + .start = SA1100_CS0_PHYS, + .end = SA1100_CS0_PHYS + SZ_32M - 1, + .flags = IORESOURCE_MEM, +}; + static void __init cerf_init_irq(void) { sa1100_init_irq(); @@ -54,8 +100,12 @@ static void __init cerf_init_irq(void) } static struct map_desc cerf_io_desc[] __initdata = { - /* virtual physical length type */ - { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */ + { /* Crystal Ethernet Chip */ + .virtual = 0xf0000000, + .pfn = __phys_to_pfn(0x08000000), + .length = 0x00100000, + .type = MT_DEVICE + } }; static void __init cerf_map_io(void) @@ -71,26 +121,24 @@ static void __init cerf_map_io(void) GPDR |= CERF_GPIO_CF_RESET; } -static int __init cerf_init(void) -{ - int ret; - - if (!machine_is_cerf()) - return -ENODEV; - - ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); - if (ret < 0) - return ret; +static struct mcp_plat_data cerf_mcp_data = { + .mccr0 = MCCR0_ADM, + .sclk_rate = 11981000, +}; - return 0; +static void __init cerf_init(void) +{ + platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices)); + sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1); + sa11x0_set_mcp_data(&cerf_mcp_data); } -arch_initcall(cerf_init); - MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") - MAINTAINER("support@intrinsyc.com") - BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) - MAPIO(cerf_map_io) - INITIRQ(cerf_init_irq) - INITTIME(sa1100_init_time) + /* Maintainer: support@intrinsyc.com */ + .phys_io = 0x80000000, + .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, + .map_io = cerf_map_io, + .init_irq = cerf_init_irq, + .timer = &sa1100_timer, + .init_machine = cerf_init, MACHINE_END