* [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
@ 2014-10-28 12:30 Rafał Miłecki
2014-10-28 12:48 ` Ralf Baechle
0 siblings, 1 reply; 10+ messages in thread
From: Rafał Miłecki @ 2014-10-28 12:30 UTC (permalink / raw)
To: linux-mips, Ralf Baechle; +Cc: Hauke Mehrtens, Rafał Miłecki
This drops ssb/bcma dependency and will allow us to make it a standalone
driver.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
This patch depends on
[PATCH V2] MIPS: BCM47XX: Make ssb init NVRAM instead of bcm47xx polling it
---
arch/mips/bcm47xx/nvram.c | 42 ++----------------------------------------
drivers/bcma/driver_mips.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 42 deletions(-)
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index fecc5ae..21712fb 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -121,48 +121,10 @@ int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
return err;
}
-#ifdef CONFIG_BCM47XX_BCMA
-static int nvram_init_bcma(void)
-{
- struct bcma_drv_cc *cc = &bcm47xx_bus.bcma.bus.drv_cc;
- u32 base;
- u32 lim;
-
-#ifdef CONFIG_BCMA_NFLASH
- if (cc->nflash.boot) {
- base = BCMA_SOC_FLASH1;
- lim = BCMA_SOC_FLASH1_SZ;
- } else
-#endif
- if (cc->pflash.present) {
- base = cc->pflash.window;
- lim = cc->pflash.window_size;
-#ifdef CONFIG_BCMA_SFLASH
- } else if (cc->sflash.present) {
- base = cc->sflash.window;
- lim = cc->sflash.size;
-#endif
- } else {
- pr_err("Couldn't find supported flash memory\n");
- return -ENXIO;
- }
-
- return bcm47xx_nvram_init_from_mem(base, lim);
-}
-#endif
-
static int nvram_init(void)
{
- switch (bcm47xx_bus_type) {
-#ifdef CONFIG_BCM47XX_SSB
- case BCM47XX_BUS_TYPE_SSB:
- break;
-#endif
-#ifdef CONFIG_BCM47XX_BCMA
- case BCM47XX_BUS_TYPE_BCMA:
- return nvram_init_bcma();
-#endif
- }
+ /* TODO: Look for MTD "nvram" partition */
+
return -ENXIO;
}
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c
index 004d6aa..8a653dc 100644
--- a/drivers/bcma/driver_mips.c
+++ b/drivers/bcma/driver_mips.c
@@ -20,6 +20,9 @@
#include <linux/serial_core.h>
#include <linux/serial_reg.h>
#include <linux/time.h>
+#ifdef CONFIG_BCM47XX
+#include <bcm47xx_nvram.h>
+#endif
enum bcma_boot_dev {
BCMA_BOOT_DEV_UNK = 0,
@@ -323,10 +326,16 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
switch (boot_dev) {
case BCMA_BOOT_DEV_PARALLEL:
case BCMA_BOOT_DEV_SERIAL:
- /* TODO: Init NVRAM using BCMA_SOC_FLASH2 window */
+#ifdef CONFIG_BCM47XX
+ bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH2,
+ BCMA_SOC_FLASH2_SZ);
+#endif
break;
case BCMA_BOOT_DEV_NAND:
- /* TODO: Init NVRAM using BCMA_SOC_FLASH1 window */
+#ifdef CONFIG_BCM47XX
+ bcm47xx_nvram_init_from_mem(BCMA_SOC_FLASH1,
+ BCMA_SOC_FLASH1_SZ);
+#endif
break;
default:
break;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 12:30 [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it Rafał Miłecki
@ 2014-10-28 12:48 ` Ralf Baechle
2014-10-28 12:51 ` Rafał Miłecki
0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2014-10-28 12:48 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-mips, Hauke Mehrtens
On Tue, Oct 28, 2014 at 01:30:23PM +0100, Rafał Miłecki wrote:
> This drops ssb/bcma dependency and will allow us to make it a standalone
> driver.
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> This patch depends on
> [PATCH V2] MIPS: BCM47XX: Make ssb init NVRAM instead of bcm47xx polling it
You've even posted a V3 of that patch:
V2: https://patchwork.linux-mips.org/patch/7609/
V3: https://patchwork.linux-mips.org/patch/7612/
I assume you meant V3?
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 12:48 ` Ralf Baechle
@ 2014-10-28 12:51 ` Rafał Miłecki
2014-10-28 13:13 ` Ralf Baechle
0 siblings, 1 reply; 10+ messages in thread
From: Rafał Miłecki @ 2014-10-28 12:51 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On 28 October 2014 13:48, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Tue, Oct 28, 2014 at 01:30:23PM +0100, Rafał Miłecki wrote:
>
>> This drops ssb/bcma dependency and will allow us to make it a standalone
>> driver.
>>
>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>> ---
>> This patch depends on
>> [PATCH V2] MIPS: BCM47XX: Make ssb init NVRAM instead of bcm47xx polling it
>
> You've even posted a V3 of that patch:
>
> V2: https://patchwork.linux-mips.org/patch/7609/
> V3: https://patchwork.linux-mips.org/patch/7612/
>
> I assume you meant V3?
You're right of course :)
--
Rafał
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 12:51 ` Rafał Miłecki
@ 2014-10-28 13:13 ` Ralf Baechle
2014-10-28 13:18 ` Rafał Miłecki
0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2014-10-28 13:13 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On Tue, Oct 28, 2014 at 01:51:06PM +0100, Rafał Miłecki wrote:
> > V3: https://patchwork.linux-mips.org/patch/7612/
This patch in turn depends on
https://patchwork.linux-mips.org/patch/7605/
against which Hauke raised some objections. Wanna sort those?
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 13:13 ` Ralf Baechle
@ 2014-10-28 13:18 ` Rafał Miłecki
2014-10-28 13:26 ` Ralf Baechle
0 siblings, 1 reply; 10+ messages in thread
From: Rafał Miłecki @ 2014-10-28 13:18 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On 28 October 2014 14:13, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Tue, Oct 28, 2014 at 01:51:06PM +0100, Rafał Miłecki wrote:
>
>> > V3: https://patchwork.linux-mips.org/patch/7612/
>
> This patch in turn depends on
>
> https://patchwork.linux-mips.org/patch/7605/
>
> against which Hauke raised some objections. Wanna sort those?
7605 is V1 with mistakes pointed by Hauke
7611 is V2 which fixes things pointed by Hauke
Please use
http://patchwork.linux-mips.org/patch/7611/
--
Rafał
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 13:18 ` Rafał Miłecki
@ 2014-10-28 13:26 ` Ralf Baechle
2014-10-28 13:46 ` Rafał Miłecki
0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2014-10-28 13:26 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On Tue, Oct 28, 2014 at 02:18:33PM +0100, Rafał Miłecki wrote:
> 7605 is V1 with mistakes pointed by Hauke
> 7611 is V2 which fixes things pointed by Hauke
>
> Please use
> http://patchwork.linux-mips.org/patch/7611/
Ah, 7611 has a different subject that's why I didn't notice there was a
v2.
All three of
https://patchwork.linux-mips.org/patch/7611/
https://patchwork.linux-mips.org/patch/7612/
https://patchwork.linux-mips.org/patch/8233/
applied. Thanks!
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 13:26 ` Ralf Baechle
@ 2014-10-28 13:46 ` Rafał Miłecki
2014-10-28 13:55 ` Ralf Baechle
2014-10-28 14:13 ` Ralf Baechle
0 siblings, 2 replies; 10+ messages in thread
From: Rafał Miłecki @ 2014-10-28 13:46 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On 28 October 2014 14:26, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Tue, Oct 28, 2014 at 02:18:33PM +0100, Rafał Miłecki wrote:
>
>> 7605 is V1 with mistakes pointed by Hauke
>> 7611 is V2 which fixes things pointed by Hauke
>>
>> Please use
>> http://patchwork.linux-mips.org/patch/7611/
>
> Ah, 7611 has a different subject that's why I didn't notice there was a
> v2.
>
> All three of
>
> https://patchwork.linux-mips.org/patch/7611/
> https://patchwork.linux-mips.org/patch/7612/
> https://patchwork.linux-mips.org/patch/8233/
>
> applied. Thanks!
Thank you! To avoid similar confusion in the future, I've created
patchwork account that will allow me to mark old (superseded) patches.
In case you find time to push two more pending BCM47XX patches, it
would be great to see them in your tree.
1) [V2] MIPS: BCM47XX: Move SPROM fallback code into sprom.c
http://patchwork.linux-mips.org/patch/8232/
It's a rebased version of patch sent ~2 months ago (7617) that was
Acked-by Hauke
2) MIPS: BCM47XX: Initialize bcma bus later (with mm available)
http://patchwork.linux-mips.org/patch/8234/
It's resend-ing of RFC patch (7606) that also was Acked-by Hauke.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 13:46 ` Rafał Miłecki
@ 2014-10-28 13:55 ` Ralf Baechle
2014-10-28 14:13 ` Ralf Baechle
1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2014-10-28 13:55 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On Tue, Oct 28, 2014 at 02:46:30PM +0100, Rafał Miłecki wrote:
> On 28 October 2014 14:26, Ralf Baechle <ralf@linux-mips.org> wrote:
> > On Tue, Oct 28, 2014 at 02:18:33PM +0100, Rafał Miłecki wrote:
> >
> >> 7605 is V1 with mistakes pointed by Hauke
> >> 7611 is V2 which fixes things pointed by Hauke
> >>
> >> Please use
> >> http://patchwork.linux-mips.org/patch/7611/
> >
> > Ah, 7611 has a different subject that's why I didn't notice there was a
> > v2.
> >
> > All three of
> >
> > https://patchwork.linux-mips.org/patch/7611/
> > https://patchwork.linux-mips.org/patch/7612/
> > https://patchwork.linux-mips.org/patch/8233/
> >
> > applied. Thanks!
>
> Thank you! To avoid similar confusion in the future, I've created
> patchwork account that will allow me to mark old (superseded) patches.
>
> In case you find time to push two more pending BCM47XX patches, it
> would be great to see them in your tree.
>
> 1) [V2] MIPS: BCM47XX: Move SPROM fallback code into sprom.c
> http://patchwork.linux-mips.org/patch/8232/
> It's a rebased version of patch sent ~2 months ago (7617) that was
> Acked-by Hauke
>
> 2) MIPS: BCM47XX: Initialize bcma bus later (with mm available)
> http://patchwork.linux-mips.org/patch/8234/
> It's resend-ing of RFC patch (7606) that also was Acked-by Hauke.
I'm working my way through but with the occasional test build it's going
to take a while to work through that 7 mile deep puddle :)
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
2014-10-28 13:46 ` Rafał Miłecki
2014-10-28 13:55 ` Ralf Baechle
@ 2014-10-28 14:13 ` Ralf Baechle
1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2014-10-28 14:13 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-mips@linux-mips.org, Hauke Mehrtens
On Tue, Oct 28, 2014 at 02:46:30PM +0100, Rafał Miłecki wrote:
> Thank you! To avoid similar confusion in the future, I've created
> patchwork account that will allow me to mark old (superseded) patches.
Yes, I wish everybody would do that. Would save me from the daily heart
attack when I open patchwork and see 2.71 metric gazillion patches pending -
only to later find out that half of them were superseeded by later
revision!
It's also useful in case a submitter has multiple email addresses. It
allows to search for one address and find all submissions.
> In case you find time to push two more pending BCM47XX patches, it
> would be great to see them in your tree.
>
> 1) [V2] MIPS: BCM47XX: Move SPROM fallback code into sprom.c
> http://patchwork.linux-mips.org/patch/8232/
> It's a rebased version of patch sent ~2 months ago (7617) that was
> Acked-by Hauke
>
> 2) MIPS: BCM47XX: Initialize bcma bus later (with mm available)
> http://patchwork.linux-mips.org/patch/8234/
> It's resend-ing of RFC patch (7606) that also was Acked-by Hauke.
Both applied and pushed.
Ralf
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
@ 2014-09-03 11:32 Rafał Miłecki
0 siblings, 0 replies; 10+ messages in thread
From: Rafał Miłecki @ 2014-09-03 11:32 UTC (permalink / raw)
To: linux-mips, Ralf Baechle; +Cc: Hauke Mehrtens, Rafał Miłecki
This makes NVRAM code less bcm47xx/ssb specific allowing it to become a
standalone driver in the future. A similar patch for bcma will follow
when it's ready.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
This patch depends on
[PATCH] MIPS: BCM47XX: Get rid of calls to KSEG1ADDR in nvram
---
arch/mips/bcm47xx/nvram.c | 30 +++++++++---------------------
drivers/ssb/driver_mipscore.c | 18 +++++++++++++++++-
2 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index 2f0a646..8ea2116 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -98,7 +98,14 @@ found:
return 0;
}
-static int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
+/*
+ * On bcm47xx we need access to the NVRAM very early, so we can't use mtd
+ * subsystem to access flash. We can't even use platform device / driver to
+ * store memory offset.
+ * To handle this we provide following symbol. It's supposed to be called as
+ * soon as we get info about flash device, before any NVRAM entry is needed.
+ */
+int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
{
void __iomem *iobase;
@@ -109,25 +116,6 @@ static int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
return nvram_find_and_copy(iobase, lim);
}
-#ifdef CONFIG_BCM47XX_SSB
-static int nvram_init_ssb(void)
-{
- struct ssb_mipscore *mcore = &bcm47xx_bus.ssb.mipscore;
- u32 base;
- u32 lim;
-
- if (mcore->pflash.present) {
- base = mcore->pflash.window;
- lim = mcore->pflash.window_size;
- } else {
- pr_err("Couldn't find supported flash memory\n");
- return -ENXIO;
- }
-
- return bcm47xx_nvram_init_from_mem(base, lim);
-}
-#endif
-
#ifdef CONFIG_BCM47XX_BCMA
static int nvram_init_bcma(void)
{
@@ -163,7 +151,7 @@ static int nvram_init(void)
switch (bcm47xx_bus_type) {
#ifdef CONFIG_BCM47XX_SSB
case BCM47XX_BUS_TYPE_SSB:
- return nvram_init_ssb();
+ break;
#endif
#ifdef CONFIG_BCM47XX_BCMA
case BCM47XX_BUS_TYPE_BCMA:
diff --git a/drivers/ssb/driver_mipscore.c b/drivers/ssb/driver_mipscore.c
index 0907706..c51802f 100644
--- a/drivers/ssb/driver_mipscore.c
+++ b/drivers/ssb/driver_mipscore.c
@@ -207,9 +207,17 @@ static void ssb_mips_serial_init(struct ssb_mipscore *mcore)
mcore->nr_serial_ports = 0;
}
+/* bcm47xx_nvram isn't a separated driver yet and doesn't have its own header.
+ * Once we make it a standalone driver, remove following extern!
+ */
+#ifdef CONFIG_BCM47XX
+extern int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
+#endif
+
static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
{
struct ssb_bus *bus = mcore->dev->bus;
+ struct ssb_sflash *sflash = &mcore->sflash;
struct ssb_pflash *pflash = &mcore->pflash;
/* When there is no chipcommon on the bus there is 4MB flash */
@@ -242,7 +250,15 @@ static void ssb_mips_flash_detect(struct ssb_mipscore *mcore)
}
ssb_pflash:
- if (pflash->present) {
+ if (sflash->present) {
+#ifdef CONFIG_BCM47XX
+ bcm47xx_nvram_init_from_mem(sflash->window, sflash->size);
+#endif
+ } else if (pflash->present) {
+#ifdef CONFIG_BCM47XX
+ bcm47xx_nvram_init_from_mem(pflash->window, pflash->window_size);
+#endif
+
ssb_pflash_data.width = pflash->buswidth;
ssb_pflash_resource.start = pflash->window;
ssb_pflash_resource.end = pflash->window + pflash->window_size;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-10-28 14:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28 12:30 [PATCH] MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it Rafał Miłecki
2014-10-28 12:48 ` Ralf Baechle
2014-10-28 12:51 ` Rafał Miłecki
2014-10-28 13:13 ` Ralf Baechle
2014-10-28 13:18 ` Rafał Miłecki
2014-10-28 13:26 ` Ralf Baechle
2014-10-28 13:46 ` Rafał Miłecki
2014-10-28 13:55 ` Ralf Baechle
2014-10-28 14:13 ` Ralf Baechle
-- strict thread matches above, loose matches on Subject: below --
2014-09-03 11:32 Rafał Miłecki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.