]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/mips/txx9/rbtx4938/setup.c
MIPS: RBTX4938: Add TOSHIBA_RBTX4938_MPLEX_KEEP
[linux-2.6-omap-h63xx.git] / arch / mips / txx9 / rbtx4938 / setup.c
index 9ab48dec0fe840f12f9fccdf9e2cc0a631da90bc..7aba92a123992a9c45339840efef2ea6cfd29fbc 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/mtd/physmap.h>
 
 #include <asm/reboot.h>
 #include <asm/io.h>
@@ -173,23 +174,30 @@ static void __init rbtx4938_mem_setup(void)
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61
-       printk(KERN_INFO "PIOSEL: disabling both ata and nand selection\n");
+       pr_info("PIOSEL: disabling both ATA and NAND selection\n");
        txx9_clear64(&tx4938_ccfgptr->pcfg,
                     TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL);
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND
-       printk(KERN_INFO "PIOSEL: enabling nand selection\n");
+       pr_info("PIOSEL: enabling NAND selection\n");
        txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
        txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
 #endif
 
 #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA
-       printk(KERN_INFO "PIOSEL: enabling ata selection\n");
+       pr_info("PIOSEL: enabling ATA selection\n");
        txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL);
        txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL);
 #endif
 
+#ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_KEEP
+       pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg);
+       pr_info("PIOSEL: NAND %s, ATA %s\n",
+               (pcfg & TX4938_PCFG_NDF_SEL) ? "enabled" : "disabled",
+               (pcfg & TX4938_PCFG_ATA_SEL) ? "enabled" : "disabled");
+#endif
+
        rbtx4938_spi_setup();
        pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg);    /* updated */
        /* fixup piosel */
@@ -294,6 +302,42 @@ static int __init rbtx4938_spi_init(void)
        return 0;
 }
 
+static void __init rbtx4938_mtd_init(void)
+{
+       struct physmap_flash_data pdata = {
+               .width = 4,
+       };
+
+       switch (readb(rbtx4938_bdipsw_addr) & 7) {
+       case 0:
+               /* Boot */
+               txx9_physmap_flash_init(0, 0x1fc00000, 0x400000, &pdata);
+               /* System */
+               txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
+               break;
+       case 1:
+               /* System */
+               txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
+               /* Boot */
+               txx9_physmap_flash_init(1, 0x1ec00000, 0x400000, &pdata);
+               break;
+       case 2:
+               /* Ext */
+               txx9_physmap_flash_init(0, 0x1f000000, 0x1000000, &pdata);
+               /* System */
+               txx9_physmap_flash_init(1, 0x1e000000, 0x1000000, &pdata);
+               /* Boot */
+               txx9_physmap_flash_init(2, 0x1dc00000, 0x400000, &pdata);
+               break;
+       case 3:
+               /* Boot */
+               txx9_physmap_flash_init(1, 0x1bc00000, 0x400000, &pdata);
+               /* System */
+               txx9_physmap_flash_init(2, 0x1a000000, 0x1000000, &pdata);
+               break;
+       }
+}
+
 static void __init rbtx4938_arch_init(void)
 {
        gpiochip_add(&rbtx4938_spi_gpio_chip);
@@ -306,6 +350,7 @@ static void __init rbtx4938_device_init(void)
        rbtx4938_ethaddr_init();
        rbtx4938_ne_init();
        tx4938_wdt_init();
+       rbtx4938_mtd_init();
 }
 
 struct txx9_board_vec rbtx4938_vec __initdata = {