X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fmips%2Fmips-boards%2Fmalta%2Fmalta_setup.c;h=b8488aab6df1cd17bfd4c2e902e4ba69daf4f2fe;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=72a16bf1f47e07db0404284b854c307d82309b82;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c index 72a16bf1f..b8488aab6 100644 --- a/arch/mips/mips-boards/malta/malta_setup.c +++ b/arch/mips/mips-boards/malta/malta_setup.c @@ -22,6 +22,13 @@ #include #include +#ifdef CONFIG_MTD +#include +#include +#include +#include +#endif + #include #include #include @@ -53,6 +60,30 @@ struct resource standard_io_resources[] = { { "dma2", 0xc0, 0xdf, IORESOURCE_BUSY }, }; +#ifdef CONFIG_MTD +static struct mtd_partition malta_mtd_partitions[] = { + { + .name = "YAMON", + .offset = 0x0, + .size = 0x100000, + .mask_flags = MTD_WRITEABLE + }, + { + .name = "User FS", + .offset = 0x100000, + .size = 0x2e0000 + }, + { + .name = "Board Config", + .offset = 0x3e0000, + .size = 0x020000, + .mask_flags = MTD_WRITEABLE + } +}; + +#define number_partitions (sizeof(malta_mtd_partitions)/sizeof(struct mtd_partition)) +#endif + const char *get_system_type(void) { return "MIPS Malta"; @@ -80,10 +111,12 @@ void __init fd_activate(void) } #endif -static int __init malta_setup(void) +void __init plat_setup(void) { unsigned int i; + mips_pcibios_init(); + /* Request I/O space for devices used on the Malta board. */ for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) request_resource(&ioport_resource, standard_io_resources+i); @@ -118,27 +151,27 @@ static int __init malta_setup(void) argptr = prom_getcmdline(); if (strstr(argptr, "iobcuncached")) { BONITO_PCICACHECTRL &= ~BONITO_PCICACHECTRL_IOBCCOH_EN; - BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & + BONITO_PCIMEMBASECFG = BONITO_PCIMEMBASECFG & ~(BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); printk("Disabled Bonito IOBC coherency\n"); } else { BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_IOBCCOH_EN; - BONITO_PCIMEMBASECFG |= - (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | + BONITO_PCIMEMBASECFG |= + (BONITO_PCIMEMBASECFG_MEMBASE0_CACHED | BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); printk("Disabled Bonito IOBC coherency\n"); } } else - panic ("Hardware DMA cache coherency not supported\n"); + panic("Hardware DMA cache coherency not supported"); #endif } #ifdef CONFIG_DMA_COHERENT else { - panic ("Hardware DMA cache coherency not supported\n"); + panic("Hardware DMA cache coherency not supported"); } #endif @@ -179,13 +212,18 @@ static int __init malta_setup(void) }; #endif #endif + +#ifdef CONFIG_MTD + /* + * Support for MTD on Malta. Use the generic physmap driver + */ + physmap_configure(0x1e000000, 0x400000, 4, NULL); + physmap_set_partitions(malta_mtd_partitions, number_partitions); +#endif + mips_reboot_setup(); board_time_init = mips_time_init; board_timer_setup = mips_timer_setup; - rtc_get_time = mips_rtc_get_time; - - return 0; + rtc_mips_get_time = mips_rtc_get_time; } - -early_initcall(malta_setup);