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 --- a/arch/mips/bcm47xx/nvram.c
24 +++ b/arch/mips/bcm47xx/nvram.c
25 @@ -121,48 +121,10 @@ int bcm47xx_nvram_init_from_mem(u32 base
29 -#ifdef CONFIG_BCM47XX_BCMA
30 -static int nvram_init_bcma(void)
32 - struct bcma_drv_cc *cc = &bcm47xx_bus.bcma.bus.drv_cc;
36 -#ifdef CONFIG_BCMA_NFLASH
37 - if (cc->nflash.boot) {
38 - base = BCMA_SOC_FLASH1;
39 - lim = BCMA_SOC_FLASH1_SZ;
42 - if (cc->pflash.present) {
43 - base = cc->pflash.window;
44 - lim = cc->pflash.window_size;
45 -#ifdef CONFIG_BCMA_SFLASH
46 - } else if (cc->sflash.present) {
47 - base = cc->sflash.window;
48 - lim = cc->sflash.size;
51 - pr_err("Couldn't find supported flash memory\n");
55 - return bcm47xx_nvram_init_from_mem(base, lim);
59 static int nvram_init(void)
61 - switch (bcm47xx_bus_type) {
62 -#ifdef CONFIG_BCM47XX_SSB
63 - case BCM47XX_BUS_TYPE_SSB:
66 -#ifdef CONFIG_BCM47XX_BCMA
67 - case BCM47XX_BUS_TYPE_BCMA:
68 - return nvram_init_bcma();
71 + /* TODO: Look for MTD "nvram" partition */
76 --- a/drivers/bcma/driver_mips.c
77 +++ b/drivers/bcma/driver_mips.c
79 #include <linux/serial_core.h>
80 #include <linux/serial_reg.h>
81 #include <linux/time.h>
82 +#ifdef CONFIG_BCM47XX
83 +#include <bcm47xx_nvram.h>
87 BCMA_BOOT_DEV_UNK = 0,
88 @@ -316,10 +319,16 @@ static void bcma_core_mips_flash_detect(
90 case BCMA_BOOT_DEV_PARALLEL:
91 case BCMA_BOOT_DEV_SERIAL:
92 - /* TODO: Init NVRAM using BCMA_SOC_FLASH2 window */
93 +#ifdef CONFIG_BCM47XX
94 + bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH2,
95 + BCMA_SOC_FLASH2_SZ);
98 case BCMA_BOOT_DEV_NAND:
99 - /* TODO: Init NVRAM using BCMA_SOC_FLASH1 window */
100 +#ifdef CONFIG_BCM47XX
101 + bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH1,
102 + BCMA_SOC_FLASH1_SZ);