Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d9d8af3 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville
Browse files

bcma: use custom printing functions



Having bus number printed makes it much easier to anaylze logs on
systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses
in total, which makes standard log really messy.

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent cddec902
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -10,6 +10,15 @@

#define BCMA_CORE_SIZE		0x1000

#define bcma_err(bus, fmt, ...) \
	pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_warn(bus, fmt, ...) \
	pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_info(bus, fmt, ...) \
	pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)
#define bcma_debug(bus, fmt, ...) \
	pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__)

struct bcma_bus;

/* main.c */
+5 −5
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ void bcma_core_set_clockmode(struct bcma_device *core,
			udelay(10);
		}
		if (i)
			pr_err("HT force timeout\n");
			bcma_err(core->bus, "HT force timeout\n");
		break;
	case BCMA_CLKMODE_DYNAMIC:
		bcma_set32(core, BCMA_CLKCTLST, ~BCMA_CLKCTLST_FORCEHT);
@@ -102,9 +102,9 @@ void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status, bool on)
			udelay(10);
		}
		if (i)
			pr_err("PLL enable timeout\n");
			bcma_err(core->bus, "PLL enable timeout\n");
	} else {
		pr_warn("Disabling PLL not supported yet!\n");
		bcma_warn(core->bus, "Disabling PLL not supported yet!\n");
	}
}
EXPORT_SYMBOL_GPL(bcma_core_pll_ctl);
@@ -120,7 +120,7 @@ u32 bcma_core_dma_translation(struct bcma_device *core)
		else
			return BCMA_DMA_TRANSLATION_DMA32_CMT;
	default:
		pr_err("DMA translation unknown for host %d\n",
		bcma_err(core->bus, "DMA translation unknown for host %d\n",
			 core->bus->hosttype);
	}
	return BCMA_DMA_TRANSLATION_NONE;
+2 −3
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
	if (cc->capabilities & BCMA_CC_CAP_PMU)
		bcma_pmu_init(cc);
	if (cc->capabilities & BCMA_CC_CAP_PCTL)
		pr_err("Power control not implemented!\n");
		bcma_err(cc->core->bus, "Power control not implemented!\n");

	if (cc->core->id.rev >= 16) {
		if (cc->core->bus->sprom.leddc_on_time &&
@@ -137,8 +137,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc)
				       | BCMA_CC_CORECTL_UARTCLKEN);
		}
	} else {
		pr_err("serial not supported on this device ccrev: 0x%x\n",
		       ccrev);
		bcma_err(bus, "serial not supported on this device ccrev: 0x%x\n", ccrev);
		return;
	}

+12 −14
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
		max_msk = 0xFFFF;
		break;
	default:
		pr_debug("PMU resource config unknown or not needed for device 0x%04X\n",
		bcma_debug(bus, "PMU resource config unknown or not needed for device 0x%04X\n",
			   bus->chipinfo.id);
	}

@@ -136,7 +136,7 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
		}
		break;
	default:
		pr_debug("Workarounds unknown or not needed for device 0x%04X\n",
		bcma_debug(bus, "Workarounds unknown or not needed for device 0x%04X\n",
			   bus->chipinfo.id);
	}
}
@@ -148,8 +148,8 @@ void bcma_pmu_init(struct bcma_drv_cc *cc)
	pmucap = bcma_cc_read32(cc, BCMA_CC_PMU_CAP);
	cc->pmu.rev = (pmucap & BCMA_CC_PMU_CAP_REVISION);

	pr_debug("Found rev %u PMU (capabilities 0x%08X)\n", cc->pmu.rev,
		 pmucap);
	bcma_debug(cc->core->bus, "Found rev %u PMU (capabilities 0x%08X)\n",
		   cc->pmu.rev, pmucap);

	if (cc->pmu.rev == 1)
		bcma_cc_mask32(cc, BCMA_CC_PMU_CTL,
@@ -181,8 +181,7 @@ u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)
		/* always 25Mhz */
		return 25000 * 1000;
	default:
		pr_warn("No ALP clock specified for %04X device, "
			"pmu rev. %d, using default %d Hz\n",
		bcma_warn(bus, "No ALP clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
			  bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_ALP_CLOCK);
	}
	return BCMA_CC_PMU_ALP_CLOCK;
@@ -251,8 +250,7 @@ u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
	case BCMA_CHIP_ID_BCM53572:
		return 75000000;
	default:
		pr_warn("No backplane clock specified for %04X device, "
			"pmu rev. %d, using default %d Hz\n",
		bcma_warn(bus, "No backplane clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
			  bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK);
	}
	return BCMA_CC_PMU_HT_CLOCK;
@@ -459,7 +457,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid)
		tmp = 1 << 10;
		break;
	default:
		pr_err("unknown spuravoidance settings for chip 0x%04X, not changing PLL\n",
		bcma_err(bus, "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n",
			 bus->chipinfo.id);
		break;
	}
+8 −8
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
			     1 << irqflag);
	}

	pr_info("set_irq: core 0x%04x, irq %d => %d\n",
	bcma_info(bus, "set_irq: core 0x%04x, irq %d => %d\n",
		  dev->id.id, oldirq + 2, irq + 2);
}

@@ -173,7 +173,7 @@ u32 bcma_cpu_clock(struct bcma_drv_mips *mcore)
	if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU)
		return bcma_pmu_get_clockcpu(&bus->drv_cc);

	pr_err("No PMU available, need this to get the cpu clock\n");
	bcma_err(bus, "No PMU available, need this to get the cpu clock\n");
	return 0;
}
EXPORT_SYMBOL(bcma_cpu_clock);
@@ -185,10 +185,10 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
	switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) {
	case BCMA_CC_FLASHT_STSER:
	case BCMA_CC_FLASHT_ATSER:
		pr_err("Serial flash not supported.\n");
		bcma_err(bus, "Serial flash not supported.\n");
		break;
	case BCMA_CC_FLASHT_PARA:
		pr_info("found parallel flash.\n");
		bcma_info(bus, "found parallel flash.\n");
		bus->drv_cc.pflash.window = 0x1c000000;
		bus->drv_cc.pflash.window_size = 0x02000000;

@@ -199,7 +199,7 @@ static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
			bus->drv_cc.pflash.buswidth = 2;
		break;
	default:
		pr_err("flash not supported.\n");
		bcma_err(bus, "flash not supported.\n");
	}
}

@@ -209,7 +209,7 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore)
	struct bcma_device *core;
	bus = mcore->core->bus;

	pr_info("Initializing MIPS core...\n");
	bcma_info(bus, "Initializing MIPS core...\n");

	if (!mcore->setup_done)
		mcore->assigned_irqs = 1;
@@ -244,7 +244,7 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore)
			break;
		}
	}
	pr_info("IRQ reconfiguration done\n");
	bcma_info(bus, "IRQ reconfiguration done\n");
	bcma_core_mips_dump_irq(bus);

	if (mcore->setup_done)
Loading