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

Commit f9035cd4 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'for-davem' of...

parents 1821f7cd 41bf3711
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -4097,6 +4097,12 @@ S: Maintained
F:	drivers/net/mv643xx_eth.*
F:	include/linux/mv643xx.h

MARVELL MWIFIEX WIRELESS DRIVER
M:	Bing Zhao <bzhao@marvell.com>
L:	linux-wireless@vger.kernel.org
S:	Maintained
F:	drivers/net/wireless/mwifiex/

MARVELL MWL8K WIRELESS DRIVER
M:	Lennert Buytenhek <buytenh@wantstofly.org>
L:	linux-wireless@vger.kernel.org
@@ -6948,9 +6954,9 @@ S: Maintained
F:	drivers/input/misc/wistron_btns.c

WL1251 WIRELESS DRIVER
M:	Kalle Valo <kvalo@adurom.com>
M:	Luciano Coelho <coelho@ti.com>
L:	linux-wireless@vger.kernel.org
W:	http://wireless.kernel.org
W:	http://wireless.kernel.org/en/users/Drivers/wl1251
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
S:	Maintained
F:	drivers/net/wireless/wl1251/*
+72 −0
Original line number Diff line number Diff line
@@ -50,3 +50,75 @@ int bcma_core_enable(struct bcma_device *core, u32 flags)
	return 0;
}
EXPORT_SYMBOL_GPL(bcma_core_enable);

void bcma_core_set_clockmode(struct bcma_device *core,
			     enum bcma_clkmode clkmode)
{
	u16 i;

	WARN_ON(core->id.id != BCMA_CORE_CHIPCOMMON &&
		core->id.id != BCMA_CORE_PCIE &&
		core->id.id != BCMA_CORE_80211);

	switch (clkmode) {
	case BCMA_CLKMODE_FAST:
		bcma_set32(core, BCMA_CLKCTLST, BCMA_CLKCTLST_FORCEHT);
		udelay(64);
		for (i = 0; i < 1500; i++) {
			if (bcma_read32(core, BCMA_CLKCTLST) &
			    BCMA_CLKCTLST_HAVEHT) {
				i = 0;
				break;
			}
			udelay(10);
		}
		if (i)
			pr_err("HT force timeout\n");
		break;
	case BCMA_CLKMODE_DYNAMIC:
		pr_warn("Dynamic clockmode not supported yet!\n");
		break;
	}
}
EXPORT_SYMBOL_GPL(bcma_core_set_clockmode);

void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status, bool on)
{
	u16 i;

	WARN_ON(req & ~BCMA_CLKCTLST_EXTRESREQ);
	WARN_ON(status & ~BCMA_CLKCTLST_EXTRESST);

	if (on) {
		bcma_set32(core, BCMA_CLKCTLST, req);
		for (i = 0; i < 10000; i++) {
			if ((bcma_read32(core, BCMA_CLKCTLST) & status) ==
			    status) {
				i = 0;
				break;
			}
			udelay(10);
		}
		if (i)
			pr_err("PLL enable timeout\n");
	} else {
		pr_warn("Disabling PLL not supported yet!\n");
	}
}
EXPORT_SYMBOL_GPL(bcma_core_pll_ctl);

u32 bcma_core_dma_translation(struct bcma_device *core)
{
	switch (core->bus->hosttype) {
	case BCMA_HOSTTYPE_PCI:
		if (bcma_aread32(core, BCMA_IOST) & BCMA_IOST_DMA64)
			return BCMA_DMA_TRANSLATION_DMA64_CMT;
		else
			return BCMA_DMA_TRANSLATION_DMA32_CMT;
	default:
		pr_err("DMA translation unknown for host %d\n",
		       core->bus->hosttype);
	}
	return BCMA_DMA_TRANSLATION_NONE;
}
EXPORT_SYMBOL(bcma_core_dma_translation);
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,

void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
{
	u32 leddc_on = 10;
	u32 leddc_off = 90;

	if (cc->core->id.rev >= 11)
		cc->status = bcma_cc_read32(cc, BCMA_CC_CHIPSTAT);
	cc->capabilities = bcma_cc_read32(cc, BCMA_CC_CAP);
@@ -38,6 +41,17 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
		bcma_pmu_init(cc);
	if (cc->capabilities & BCMA_CC_CAP_PCTL)
		pr_err("Power control not implemented!\n");

	if (cc->core->id.rev >= 16) {
		if (cc->core->bus->sprom.leddc_on_time &&
		    cc->core->bus->sprom.leddc_off_time) {
			leddc_on = cc->core->bus->sprom.leddc_on_time;
			leddc_off = cc->core->bus->sprom.leddc_off_time;
		}
		bcma_cc_write32(cc, BCMA_CC_GPIOTIMER,
			((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |
			 (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
	}
}

/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
+2 −0
Original line number Diff line number Diff line
@@ -172,8 +172,10 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
	    chipid_top != 0x5300)
		return false;

#ifdef CONFIG_SSB_DRIVER_PCICORE
	if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
		return false;
#endif /* CONFIG_SSB_DRIVER_PCICORE */

#if 0
	/* TODO: on BCMA we use address from EROM instead of magic formula */
+10 −4
Original line number Diff line number Diff line
@@ -20,12 +20,12 @@
 * R/W ops.
 **************************************************/

static void bcma_sprom_read(struct bcma_bus *bus, u16 *sprom)
static void bcma_sprom_read(struct bcma_bus *bus, u16 offset, u16 *sprom)
{
	int i;
	for (i = 0; i < SSB_SPROMSIZE_WORDS_R4; i++)
		sprom[i] = bcma_read16(bus->drv_cc.core,
				       BCMA_CC_SPROM + (i * 2));
				       offset + (i * 2));
}

/**************************************************
@@ -112,7 +112,7 @@ static int bcma_sprom_valid(const u16 *sprom)
		return err;

	revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & SSB_SPROM_REVISION_REV;
	if (revision != 8) {
	if (revision != 8 && revision != 9) {
		pr_err("Unsupported SPROM revision: %d\n", revision);
		return -ENOENT;
	}
@@ -137,6 +137,7 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)

int bcma_sprom_get(struct bcma_bus *bus)
{
	u16 offset;
	u16 *sprom;
	int err = 0;

@@ -151,7 +152,12 @@ int bcma_sprom_get(struct bcma_bus *bus)
	if (!sprom)
		return -ENOMEM;

	bcma_sprom_read(bus, sprom);
	/* Most cards have SPROM moved by additional offset 0x30 (48 dwords).
	 * According to brcm80211 this applies to cards with PCIe rev >= 6
	 * TODO: understand this condition and use it */
	offset = (bus->chipinfo.id == 0x4331) ? BCMA_CC_SPROM :
		BCMA_CC_SPROM_PCIE6;
	bcma_sprom_read(bus, offset, sprom);

	err = bcma_sprom_valid(sprom);
	if (err)
Loading