bcm63xx: add 3.9 support
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 028-MIPS-BCM63XX-add-flash-detection-for-BCM6362.patch
1 From 01034e48e72783ced82a050e862f82ee3dfdb783 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Mon, 21 Nov 2011 00:48:52 +0100
4 Subject: [PATCH 7/7] MIPS: BCM63XX: add flash detection for BCM6362
5
6 BCM6362 support booting from SPI flash and NAND.
7
8 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 ---
10 arch/mips/bcm63xx/dev-flash.c | 6 ++++++
11 arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h | 1 +
12 2 files changed, 7 insertions(+)
13
14 --- a/arch/mips/bcm63xx/dev-flash.c
15 +++ b/arch/mips/bcm63xx/dev-flash.c
16 @@ -77,6 +77,12 @@ static int __init bcm63xx_detect_flash_t
17 return BCM63XX_FLASH_TYPE_PARALLEL;
18 else
19 return BCM63XX_FLASH_TYPE_SERIAL;
20 + case BCM6362_CPU_ID:
21 + val = bcm_misc_readl(MISC_STRAPBUS_6362_REG);
22 + if (val & STRAPBUS_6362_BOOT_SEL_SERIAL)
23 + return BCM63XX_FLASH_TYPE_SERIAL;
24 + else
25 + return BCM63XX_FLASH_TYPE_NAND;
26 case BCM6368_CPU_ID:
27 val = bcm_gpio_readl(GPIO_STRAPBUS_REG);
28 switch (val & STRAPBUS_6368_BOOT_SEL_MASK) {
29 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
30 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
31 @@ -1372,6 +1372,7 @@
32
33 #define MISC_STRAPBUS_6362_REG 0x14
34 #define STRAPBUS_6362_FCVO_SHIFT 1
35 +#define STRAPBUS_6362_HSSPI_CLK_FAST (1 << 13)
36 #define STRAPBUS_6362_FCVO_MASK (0x1f << STRAPBUS_6362_FCVO_SHIFT)
37 #define STRAPBUS_6362_BOOT_SEL_SERIAL (1 << 15)
38 #define STRAPBUS_6362_BOOT_SEL_NAND (0 << 15)