Skip to content

Commit dc8ecdd

Browse files
rmileckilinvjw
authored andcommitted
bcma: move bus struct setup into early part of host specific code
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 39e90c7 commit dc8ecdd

5 files changed

Lines changed: 6 additions & 10 deletions

File tree

‎drivers/bcma/host_pci.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
208208
bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
209209
bus->boardinfo.type = bus->host_pci->subsystem_device;
210210

211+
/* Initialize struct, detect chip */
212+
bcma_init_bus(bus);
213+
211214
/* Register */
212215
err = bcma_bus_register(bus);
213216
if (err)

‎drivers/bcma/host_soc.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
178178
bus->hosttype = BCMA_HOSTTYPE_SOC;
179179
bus->ops = &bcma_host_soc_ops;
180180

181+
/* Initialize struct, detect chip */
182+
bcma_init_bus(bus);
183+
181184
/* Register */
182185
err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
183186
if (err)

‎drivers/bcma/main.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,6 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
334334
struct bcma_device *core;
335335
struct bcma_device_id match;
336336

337-
bcma_init_bus(bus);
338-
339337
match.manuf = BCMA_MANUF_BCM;
340338
match.id = bcma_cc_core_id(bus);
341339
match.class = BCMA_CL_SIM;

‎drivers/bcma/scan.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,6 @@ void bcma_init_bus(struct bcma_bus *bus)
438438
s32 tmp;
439439
struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
440440

441-
if (bus->init_done)
442-
return;
443-
444441
INIT_LIST_HEAD(&bus->cores);
445442
bus->nr_cores = 0;
446443

@@ -452,8 +449,6 @@ void bcma_init_bus(struct bcma_bus *bus)
452449
chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
453450
bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
454451
chipinfo->id, chipinfo->rev, chipinfo->pkg);
455-
456-
bus->init_done = true;
457452
}
458453

459454
int bcma_bus_scan(struct bcma_bus *bus)
@@ -463,8 +458,6 @@ int bcma_bus_scan(struct bcma_bus *bus)
463458

464459
int err, core_num = 0;
465460

466-
bcma_init_bus(bus);
467-
468461
erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM);
469462
if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
470463
eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE);

‎include/linux/bcma/bcma.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ struct bcma_bus {
332332
struct bcma_device *mapped_core;
333333
struct list_head cores;
334334
u8 nr_cores;
335-
u8 init_done:1;
336335
u8 num;
337336

338337
struct bcma_drv_cc drv_cc;

0 commit comments

Comments
 (0)