MIPS: BCM63XX: add flash detection for BCM6362
authorJonas Gorski <jogo@openwrt.org>
Thu, 21 Mar 2013 14:03:20 +0000 (14:03 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 7 May 2013 23:19:03 +0000 (01:19 +0200)
BCM6362 support booting from SPI flash and NAND.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/5012/
Acked-by: John Crispin <blogic@openwrt.org>
arch/mips/bcm63xx/dev-flash.c
arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h

index 58371c7..588d1ec 100644 (file)
@@ -77,6 +77,12 @@ static int __init bcm63xx_detect_flash_type(void)
                        return BCM63XX_FLASH_TYPE_PARALLEL;
                else
                        return BCM63XX_FLASH_TYPE_SERIAL;
+       case BCM6362_CPU_ID:
+               val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
+               if (val & STRAPBUS_6362_BOOT_SEL_SERIAL)
+                       return BCM63XX_FLASH_TYPE_SERIAL;
+               else
+                       return BCM63XX_FLASH_TYPE_NAND;
        case BCM6368_CPU_ID:
                val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
                switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
index 243bab9..3203fe4 100644 (file)
 
 #define MISC_STRAPBUS_6362_REG         0x14
 #define STRAPBUS_6362_FCVO_SHIFT       1
+#define STRAPBUS_6362_HSSPI_CLK_FAST   (1 << 13)
 #define STRAPBUS_6362_FCVO_MASK                (0x1f << STRAPBUS_6362_FCVO_SHIFT)
 #define STRAPBUS_6362_BOOT_SEL_SERIAL  (1 << 15)
 #define STRAPBUS_6362_BOOT_SEL_NAND    (0 << 15)