1 From 7177efc5b030012c54c2e217c9d6decc0bcc1c53 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Tue, 28 Oct 2014 13:30:23 +0100
4 Subject: [PATCH 156/158] MIPS: BCM47XX: Make bcma init NVRAM instead of
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
10 This drops ssb/bcma dependency and will allow us to make it a standalone
13 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
14 Cc: linux-mips@linux-mips.org
15 Cc: Hauke Mehrtens <hauke@hauke-m.de>
16 Patchwork: https://patchwork.linux-mips.org/patch/8233/
17 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
19 arch/mips/bcm47xx/nvram.c | 42 ++----------------------------------------
20 drivers/bcma/driver_mips.c | 13 +++++++++++--
21 2 files changed, 13 insertions(+), 42 deletions(-)
23 diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
24 index fecc5ae..21712fb 100644
25 --- a/arch/mips/bcm47xx/nvram.c
26 +++ b/arch/mips/bcm47xx/nvram.c
27 @@ -121,48 +121,10 @@ int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
31 -#ifdef CONFIG_BCM47XX_BCMA
32 -static int nvram_init_bcma(void)
34 - struct bcma_drv_cc *cc = &bcm47xx_bus.bcma.bus.drv_cc;
38 -#ifdef CONFIG_BCMA_NFLASH
39 - if (cc->nflash.boot) {
40 - base = BCMA_SOC_FLASH1;
41 - lim = BCMA_SOC_FLASH1_SZ;
44 - if (cc->pflash.present) {
45 - base = cc->pflash.window;
46 - lim = cc->pflash.window_size;
47 -#ifdef CONFIG_BCMA_SFLASH
48 - } else if (cc->sflash.present) {
49 - base = cc->sflash.window;
50 - lim = cc->sflash.size;
53 - pr_err("Couldn't find supported flash memory\n");
57 - return bcm47xx_nvram_init_from_mem(base, lim);
61 static int nvram_init(void)
63 - switch (bcm47xx_bus_type) {
64 -#ifdef CONFIG_BCM47XX_SSB
65 - case BCM47XX_BUS_TYPE_SSB:
68 -#ifdef CONFIG_BCM47XX_BCMA
69 - case BCM47XX_BUS_TYPE_BCMA:
70 - return nvram_init_bcma();
73 + /* TODO: Look for MTD "nvram" partition */
78 diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c
79 index 004d6aa..8a653dc 100644
80 --- a/drivers/bcma/driver_mips.c
81 +++ b/drivers/bcma/driver_mips.c
83 #include <linux/serial_core.h>
84 #include <linux/serial_reg.h>
85 #include <linux/time.h>
86 +#ifdef CONFIG_BCM47XX
87 +#include <bcm47xx_nvram.h>
91 BCMA_BOOT_DEV_UNK = 0,
92 @@ -316,10 +319,16 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
94 case BCMA_BOOT_DEV_PARALLEL:
95 case BCMA_BOOT_DEV_SERIAL:
96 - /* TODO: Init NVRAM using BCMA_SOC_FLASH2 window */
97 +#ifdef CONFIG_BCM47XX
98 + bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH2,
99 + BCMA_SOC_FLASH2_SZ);
102 case BCMA_BOOT_DEV_NAND:
103 - /* TODO: Init NVRAM using BCMA_SOC_FLASH1 window */
104 +#ifdef CONFIG_BCM47XX
105 + bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH1,
106 + BCMA_SOC_FLASH1_SZ);