Skip to content

Commit 4c81aca

Browse files
rmileckiKalle Valo
authored andcommitted
bcma: init serial console directly from ChipCommon code
UART is connected to and controlled over ChipCommon core. It doesn't have much to do with MIPS core (where we initialize it currently) except just existing on embedded systemms. There isn't point of such cross-core initialization (and we needed #ifdef anyway) so just handle it in ChipCommon. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent 36e8072 commit 4c81aca

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

drivers/bcma/bcma_private.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
4848
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
4949
void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
5050
#ifdef CONFIG_BCMA_DRIVER_MIPS
51-
void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
5251
extern struct platform_device bcma_pflash_dev;
5352
#endif /* CONFIG_BCMA_DRIVER_MIPS */
5453

drivers/bcma/driver_chipcommon.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <linux/platform_device.h>
1616
#include <linux/bcma/bcma.h>
1717

18+
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc);
19+
1820
static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
1921
u32 mask, u32 value)
2022
{
@@ -115,6 +117,8 @@ int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
115117

116118
void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
117119
{
120+
struct bcma_bus *bus = cc->core->bus;
121+
118122
if (cc->early_setup_done)
119123
return;
120124

@@ -129,6 +133,9 @@ void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
129133
if (cc->capabilities & BCMA_CC_CAP_PMU)
130134
bcma_pmu_early_init(cc);
131135

136+
if (IS_BUILTIN(CONFIG_BCM47XX) && bus->hosttype == BCMA_HOSTTYPE_SOC)
137+
bcma_chipco_serial_init(cc);
138+
132139
cc->early_setup_done = true;
133140
}
134141

@@ -314,9 +321,9 @@ u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value)
314321
return res;
315322
}
316323

317-
#ifdef CONFIG_BCMA_DRIVER_MIPS
318-
void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
324+
static void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
319325
{
326+
#if IS_BUILTIN(CONFIG_BCM47XX)
320327
unsigned int irq;
321328
u32 baud_base;
322329
u32 i;
@@ -358,5 +365,5 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
358365
ports[i].baud_base = baud_base;
359366
ports[i].reg_shift = 0;
360367
}
368+
#endif /* CONFIG_BCM47XX */
361369
}
362-
#endif /* CONFIG_BCMA_DRIVER_MIPS */

drivers/bcma/driver_mips.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,12 +337,9 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
337337

338338
void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
339339
{
340-
struct bcma_bus *bus = mcore->core->bus;
341-
342340
if (mcore->early_setup_done)
343341
return;
344342

345-
bcma_chipco_serial_init(&bus->drv_cc);
346343
bcma_core_mips_flash_detect(mcore);
347344

348345
mcore->early_setup_done = true;

0 commit comments

Comments
 (0)