1 From 9a97177b907330971aa7bf41855fafc2602e1c18 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sun, 22 Dec 2013 12:26:57 +0100
4 Subject: [PATCH 51/56] MIPS: BCM63XX: detect flash type early and store the
7 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 arch/mips/bcm63xx/dev-flash.c | 10 +++++++---
10 arch/mips/bcm63xx/prom.c | 4 ++++
11 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h | 2 ++
12 3 files changed, 13 insertions(+), 3 deletions(-)
14 --- a/arch/mips/bcm63xx/dev-flash.c
15 +++ b/arch/mips/bcm63xx/dev-flash.c
17 #include <bcm63xx_regs.h>
18 #include <bcm63xx_io.h>
20 +static int flash_type;
22 static struct mtd_partition mtd_partitions[] = {
25 @@ -108,13 +110,15 @@ static int __init bcm63xx_detect_flash_t
29 +void __init bcm63xx_flash_detect(void)
31 + flash_type = bcm63xx_detect_flash_type();
34 int __init bcm63xx_flash_register(void)
39 - flash_type = bcm63xx_detect_flash_type();
42 case BCM63XX_FLASH_TYPE_PARALLEL:
43 /* read base address of boot chip select (0) */
44 --- a/arch/mips/bcm63xx/prom.c
45 +++ b/arch/mips/bcm63xx/prom.c
47 #include <bcm63xx_io.h>
48 #include <bcm63xx_regs.h>
49 #include <bcm63xx_gpio.h>
50 +#include <bcm63xx_dev_flash.h>
52 void __init prom_init(void)
54 @@ -56,6 +57,9 @@ void __init prom_init(void)
55 /* register gpiochip */
58 + /* detect and setup flash access */
59 + bcm63xx_flash_detect();
61 /* do low level board init */
64 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
65 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
66 @@ -7,6 +7,8 @@ enum {
67 BCM63XX_FLASH_TYPE_NAND,
70 +void bcm63xx_flash_detect(void);
72 int __init bcm63xx_flash_register(void);
74 #endif /* __BCM63XX_FLASH_H */