* [PATCH 1/2] bcma: move bus struct setup into early part of host specific code
@ 2014-09-01 21:11 Rafał Miłecki
2014-09-01 21:11 ` [PATCH 2/2] bcma: use separated function to initialize bus on SoC Rafał Miłecki
2014-09-03 19:48 ` [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Hauke Mehrtens
0 siblings, 2 replies; 7+ messages in thread
From: Rafał Miłecki @ 2014-09-01 21:11 UTC (permalink / raw)
To: linux-wireless, John W. Linville; +Cc: Hauke Mehrtens, Rafał Miłecki
This change is important for SoC host. In future we will want to know
chip ID (needed for early MIPS boot) before doing cores scanning.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/bcma/host_pci.c | 3 +++
drivers/bcma/host_soc.c | 3 +++
drivers/bcma/main.c | 2 --
drivers/bcma/scan.c | 7 -------
include/linux/bcma/bcma.h | 1 -
5 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 294a7dd..3251d52 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -208,6 +208,9 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
bus->boardinfo.type = bus->host_pci->subsystem_device;
+ /* Initialize struct, detect chip */
+ bcma_init_bus(bus);
+
/* Register */
err = bcma_bus_register(bus);
if (err)
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c
index 1edd7e0..379e0d4e 100644
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -178,6 +178,9 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
bus->hosttype = BCMA_HOSTTYPE_SOC;
bus->ops = &bcma_host_soc_ops;
+ /* Initialize struct, detect chip */
+ bcma_init_bus(bus);
+
/* Register */
err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
if (err)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 0ff8d58..9f6b0cb 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -334,8 +334,6 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
struct bcma_device *core;
struct bcma_device_id match;
- bcma_init_bus(bus);
-
match.manuf = BCMA_MANUF_BCM;
match.id = bcma_cc_core_id(bus);
match.class = BCMA_CL_SIM;
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index e9bd772..e2b9903 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -438,9 +438,6 @@ void bcma_init_bus(struct bcma_bus *bus)
s32 tmp;
struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
- if (bus->init_done)
- return;
-
INIT_LIST_HEAD(&bus->cores);
bus->nr_cores = 0;
@@ -452,8 +449,6 @@ void bcma_init_bus(struct bcma_bus *bus)
chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
chipinfo->id, chipinfo->rev, chipinfo->pkg);
-
- bus->init_done = true;
}
int bcma_bus_scan(struct bcma_bus *bus)
@@ -463,8 +458,6 @@ int bcma_bus_scan(struct bcma_bus *bus)
int err, core_num = 0;
- bcma_init_bus(bus);
-
erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM);
if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE);
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 0272e49..c1ba87d 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -332,7 +332,6 @@ struct bcma_bus {
struct bcma_device *mapped_core;
struct list_head cores;
u8 nr_cores;
- u8 init_done:1;
u8 num;
struct bcma_drv_cc drv_cc;
--
1.8.4.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] bcma: use separated function to initialize bus on SoC
2014-09-01 21:11 [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Rafał Miłecki
@ 2014-09-01 21:11 ` Rafał Miłecki
2014-09-03 19:54 ` Hauke Mehrtens
2014-09-04 17:38 ` John W. Linville
2014-09-03 19:48 ` [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Hauke Mehrtens
1 sibling, 2 replies; 7+ messages in thread
From: Rafał Miłecki @ 2014-09-01 21:11 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: Hauke Mehrtens, Rafał Miłecki, Ralf Baechle
This is required to split SoC bus init into two phases. The later one
(which includes scanning) should be called when kalloc is available.
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
John: please note this patch touches arch/mips/bcm47xx/setup.c
This patches is a first step of simplifying MIPS booting process on
Broadcom SoCs. My research described in:
> Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
e-mail thread explained how we could get rid of all these early scanning
tricks. The main idea is to postpone bus initialization a bit and use
all standard calls then. So far we were doing it so early we had to
avoid kalloc.
---
arch/mips/bcm47xx/setup.c | 4 ++++
drivers/bcma/host_soc.c | 11 +++++++++--
include/linux/bcma/bcma_soc.h | 1 +
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 2b63e7e..fff6ed4 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -202,6 +202,10 @@ static void __init bcm47xx_register_bcma(void)
err = bcma_host_soc_register(&bcm47xx_bus.bcma);
if (err)
+ panic("Failed to register BCMA bus (err %d)", err);
+
+ err = bcma_host_soc_init(&bcm47xx_bus.bcma);
+ if (err)
panic("Failed to initialize BCMA bus (err %d)", err);
bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c
index 379e0d4e..718e054 100644
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -165,7 +165,6 @@ static const struct bcma_host_ops bcma_host_soc_ops = {
int __init bcma_host_soc_register(struct bcma_soc *soc)
{
struct bcma_bus *bus = &soc->bus;
- int err;
/* iomap only first core. We have to read some register on this core
* to scan the bus.
@@ -181,7 +180,15 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
/* Initialize struct, detect chip */
bcma_init_bus(bus);
- /* Register */
+ return 0;
+}
+
+int __init bcma_host_soc_init(struct bcma_soc *soc)
+{
+ struct bcma_bus *bus = &soc->bus;
+ int err;
+
+ /* Scan bus and initialize it */
err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
if (err)
iounmap(bus->mmio);
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h
index 4203c55..f24d245 100644
--- a/include/linux/bcma/bcma_soc.h
+++ b/include/linux/bcma/bcma_soc.h
@@ -10,6 +10,7 @@ struct bcma_soc {
};
int __init bcma_host_soc_register(struct bcma_soc *soc);
+int __init bcma_host_soc_init(struct bcma_soc *soc);
int bcma_bus_register(struct bcma_bus *bus);
--
1.8.4.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] bcma: move bus struct setup into early part of host specific code
2014-09-01 21:11 [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Rafał Miłecki
2014-09-01 21:11 ` [PATCH 2/2] bcma: use separated function to initialize bus on SoC Rafał Miłecki
@ 2014-09-03 19:48 ` Hauke Mehrtens
1 sibling, 0 replies; 7+ messages in thread
From: Hauke Mehrtens @ 2014-09-03 19:48 UTC (permalink / raw)
To: Rafał Miłecki, linux-wireless, John W. Linville
On 09/01/2014 11:11 PM, Rafał Miłecki wrote:
> This change is important for SoC host. In future we will want to know
> chip ID (needed for early MIPS boot) before doing cores scanning.
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> drivers/bcma/host_pci.c | 3 +++
> drivers/bcma/host_soc.c | 3 +++
> drivers/bcma/main.c | 2 --
> drivers/bcma/scan.c | 7 -------
> include/linux/bcma/bcma.h | 1 -
> 5 files changed, 6 insertions(+), 10 deletions(-)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bcma: use separated function to initialize bus on SoC
2014-09-01 21:11 ` [PATCH 2/2] bcma: use separated function to initialize bus on SoC Rafał Miłecki
@ 2014-09-03 19:54 ` Hauke Mehrtens
2014-09-04 17:38 ` John W. Linville
1 sibling, 0 replies; 7+ messages in thread
From: Hauke Mehrtens @ 2014-09-03 19:54 UTC (permalink / raw)
To: Rafał Miłecki, linux-wireless, John W. Linville; +Cc: Ralf Baechle
On 09/01/2014 11:11 PM, Rafał Miłecki wrote:
> This is required to split SoC bus init into two phases. The later one
> (which includes scanning) should be called when kalloc is available.
>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> John: please note this patch touches arch/mips/bcm47xx/setup.c
>
> This patches is a first step of simplifying MIPS booting process on
> Broadcom SoCs. My research described in:
>> Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
> e-mail thread explained how we could get rid of all these early scanning
> tricks. The main idea is to postpone bus initialization a bit and use
> all standard calls then. So far we were doing it so early we had to
> avoid kalloc.
> ---
> arch/mips/bcm47xx/setup.c | 4 ++++
> drivers/bcma/host_soc.c | 11 +++++++++--
> include/linux/bcma/bcma_soc.h | 1 +
> 3 files changed, 14 insertions(+), 2 deletions(-)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bcma: use separated function to initialize bus on SoC
2014-09-01 21:11 ` [PATCH 2/2] bcma: use separated function to initialize bus on SoC Rafał Miłecki
2014-09-03 19:54 ` Hauke Mehrtens
@ 2014-09-04 17:38 ` John W. Linville
2014-09-04 18:04 ` Rafał Miłecki
1 sibling, 1 reply; 7+ messages in thread
From: John W. Linville @ 2014-09-04 17:38 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-wireless, Hauke Mehrtens, Ralf Baechle
On Mon, Sep 01, 2014 at 11:11:07PM +0200, Rafał Miłecki wrote:
> This is required to split SoC bus init into two phases. The later one
> (which includes scanning) should be called when kalloc is available.
>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> John: please note this patch touches arch/mips/bcm47xx/setup.c
>
> This patches is a first step of simplifying MIPS booting process on
> Broadcom SoCs. My research described in:
> > Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
> e-mail thread explained how we could get rid of all these early scanning
> tricks. The main idea is to postpone bus initialization a bit and use
> all standard calls then. So far we were doing it so early we had to
> avoid kalloc.
> ---
> arch/mips/bcm47xx/setup.c | 4 ++++
> drivers/bcma/host_soc.c | 11 +++++++++--
> include/linux/bcma/bcma_soc.h | 1 +
> 3 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
> index 2b63e7e..fff6ed4 100644
> --- a/arch/mips/bcm47xx/setup.c
> +++ b/arch/mips/bcm47xx/setup.c
> @@ -202,6 +202,10 @@ static void __init bcm47xx_register_bcma(void)
>
> err = bcma_host_soc_register(&bcm47xx_bus.bcma);
> if (err)
> + panic("Failed to register BCMA bus (err %d)", err);
> +
> + err = bcma_host_soc_init(&bcm47xx_bus.bcma);
> + if (err)
> panic("Failed to initialize BCMA bus (err %d)", err);
>
> bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
This hunk looks wrong. Is it missing indentation? Or should a line
be removed at the top?
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bcma: use separated function to initialize bus on SoC
2014-09-04 17:38 ` John W. Linville
@ 2014-09-04 18:04 ` Rafał Miłecki
2014-09-04 18:07 ` John W. Linville
0 siblings, 1 reply; 7+ messages in thread
From: Rafał Miłecki @ 2014-09-04 18:04 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless@vger.kernel.org, Hauke Mehrtens, Ralf Baechle
On 4 September 2014 19:38, John W. Linville <linville@tuxdriver.com> wrote:
> On Mon, Sep 01, 2014 at 11:11:07PM +0200, Rafał Miłecki wrote:
>> This is required to split SoC bus init into two phases. The later one
>> (which includes scanning) should be called when kalloc is available.
>>
>> Cc: Ralf Baechle <ralf@linux-mips.org>
>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>> ---
>> John: please note this patch touches arch/mips/bcm47xx/setup.c
>>
>> This patches is a first step of simplifying MIPS booting process on
>> Broadcom SoCs. My research described in:
>> > Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
>> e-mail thread explained how we could get rid of all these early scanning
>> tricks. The main idea is to postpone bus initialization a bit and use
>> all standard calls then. So far we were doing it so early we had to
>> avoid kalloc.
>> ---
>> arch/mips/bcm47xx/setup.c | 4 ++++
>> drivers/bcma/host_soc.c | 11 +++++++++--
>> include/linux/bcma/bcma_soc.h | 1 +
>> 3 files changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
>> index 2b63e7e..fff6ed4 100644
>> --- a/arch/mips/bcm47xx/setup.c
>> +++ b/arch/mips/bcm47xx/setup.c
>> @@ -202,6 +202,10 @@ static void __init bcm47xx_register_bcma(void)
>>
>> err = bcma_host_soc_register(&bcm47xx_bus.bcma);
>> if (err)
>> + panic("Failed to register BCMA bus (err %d)", err);
>> +
>> + err = bcma_host_soc_init(&bcm47xx_bus.bcma);
>> + if (err)
>> panic("Failed to initialize BCMA bus (err %d)", err);
>>
>> bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
>
> This hunk looks wrong. Is it missing indentation? Or should a line
> be removed at the top?
I've just downloaded & applied this patchset on top of wireless-next
successfully... Did you merge something extra from net-next maybe?
--
Rafał
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] bcma: use separated function to initialize bus on SoC
2014-09-04 18:04 ` Rafał Miłecki
@ 2014-09-04 18:07 ` John W. Linville
0 siblings, 0 replies; 7+ messages in thread
From: John W. Linville @ 2014-09-04 18:07 UTC (permalink / raw)
To: Rafał Miłecki
Cc: linux-wireless@vger.kernel.org, Hauke Mehrtens, Ralf Baechle
On Thu, Sep 04, 2014 at 08:04:47PM +0200, Rafał Miłecki wrote:
> On 4 September 2014 19:38, John W. Linville <linville@tuxdriver.com> wrote:
> > On Mon, Sep 01, 2014 at 11:11:07PM +0200, Rafał Miłecki wrote:
> >> This is required to split SoC bus init into two phases. The later one
> >> (which includes scanning) should be called when kalloc is available.
> >>
> >> Cc: Ralf Baechle <ralf@linux-mips.org>
> >> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> >> ---
> >> John: please note this patch touches arch/mips/bcm47xx/setup.c
> >>
> >> This patches is a first step of simplifying MIPS booting process on
> >> Broadcom SoCs. My research described in:
> >> > Booting bcm47xx (bcma & stuff), sharing code with bcm53xx
> >> e-mail thread explained how we could get rid of all these early scanning
> >> tricks. The main idea is to postpone bus initialization a bit and use
> >> all standard calls then. So far we were doing it so early we had to
> >> avoid kalloc.
> >> ---
> >> arch/mips/bcm47xx/setup.c | 4 ++++
> >> drivers/bcma/host_soc.c | 11 +++++++++--
> >> include/linux/bcma/bcma_soc.h | 1 +
> >> 3 files changed, 14 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
> >> index 2b63e7e..fff6ed4 100644
> >> --- a/arch/mips/bcm47xx/setup.c
> >> +++ b/arch/mips/bcm47xx/setup.c
> >> @@ -202,6 +202,10 @@ static void __init bcm47xx_register_bcma(void)
> >>
> >> err = bcma_host_soc_register(&bcm47xx_bus.bcma);
> >> if (err)
> >> + panic("Failed to register BCMA bus (err %d)", err);
> >> +
> >> + err = bcma_host_soc_init(&bcm47xx_bus.bcma);
> >> + if (err)
> >> panic("Failed to initialize BCMA bus (err %d)", err);
> >>
> >> bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
> >
> > This hunk looks wrong. Is it missing indentation? Or should a line
> > be removed at the top?
>
> I've just downloaded & applied this patchset on top of wireless-next
> successfully... Did you merge something extra from net-next maybe?
I'm looking at the patch itself. But I think I misread it...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-09-04 18:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-01 21:11 [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Rafał Miłecki
2014-09-01 21:11 ` [PATCH 2/2] bcma: use separated function to initialize bus on SoC Rafał Miłecki
2014-09-03 19:54 ` Hauke Mehrtens
2014-09-04 17:38 ` John W. Linville
2014-09-04 18:04 ` Rafał Miłecki
2014-09-04 18:07 ` John W. Linville
2014-09-03 19:48 ` [PATCH 1/2] bcma: move bus struct setup into early part of host specific code Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).