History log of /linux-master/drivers/bcma/host_pci.c
Revision Date Author Comments
# 823c523e 04-Oct-2021 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

bcma: simplify reference to driver name

When bcma_host_pci_probe() is called, the PCI driver core has already
assigned the device's driver in local_pci_probe(). So dev->driver is always
true, and here it points to bcma_pci_bridge_driver, which has .name set to
"bcma-pci-bridge". Simplify accordingly.

Link: https://lore.kernel.org/r/20211004125935.2300113-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


# 9236c125 23-Jul-2019 Chuhong Yuan <hslester96@gmail.com>

bcma: Use dev_get_drvdata

Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 5a1c18b7 01-Jan-2019 Rafał Miłecki <rafal@milecki.pl>

bcma: keep a direct pointer to the struct device

Accessing struct device is pretty useful/common so having a direct
pointer:
1) Simplifies some code
2) Makes bcma_bus_get_host_dev() unneeded
3) Allows further improvements like using dev_* printing helpers

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 985324a1 08-Feb-2018 Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>

bcma: add HP Stream Notebook

In this laptop we have the following PCI device:
02:00.0 Network controller [0280]: Broadcom Limited BCM43142 802.11b/g/n [14e4:4365] (rev 01)
Subsystem: Hewlett-Packard Company BCM43142 802.11b/g/n [103c:804a]
[...]
Region 0: Memory at 91000000 (64-bit, non-prefetchable) [size=32K]
[...]

With this patch, we can now see its WiFi chip:
bcma: bus0: Found chip with id 43142, rev 0x01 and package 0x08
bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x28, class 0x0)
bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x21, class 0x0)
bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x16, class 0x0)
bcma: bus0: Core 3 found: UNKNOWN (manuf 0x43B, id 0x368, rev 0x00, class 0x0)
bcma: bus0: Found rev 15 PMU (capabilities 0x518C5E0F)
bcma: bus0: SPROM offset 0x840
bcma: bus0: Found SPROM revision 10
bcma: bus0: Workarounds unknown or not needed for device 0xA886
bcma: bus0: Bus registered

But it not yet supported by brcmsmac so it won't work for now:
brcmsmac bcma0:1: brcms_b_attach wl0: vendor 0x14e4 device 0x4365
brcmsmac: unknown device id 4365

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 59391a96 28-Nov-2016 Jiri Slaby <jirislaby@kernel.org>

bcma: add Dell Inspiron 3148

This is what is in the laptop:
01:00.0 Network controller [0280]: Broadcom Limited BCM43142 802.11b/g/n [14e4:4365] (rev 01)
Subsystem: Dell Device [1028:0018]
Flags: bus master, fast devsel, latency 0, IRQ 18
Memory at b0400000 (64-bit, non-prefetchable) [size=32K]
Capabilities: [40] Power Management version 3
Capabilities: [58] Vendor Specific Information: Len=78 <?>
Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [d0] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [13c] Virtual Channel
Capabilities: [160] Device Serial Number 00-00-9a-ff-ff-f3-40-b8
Capabilities: [16c] Power Budgeting <?>

With the patch, I can see:
bcma: bus0: Found chip with id 43142, rev 0x01 and package 0x08
bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x28, class 0x0)
bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x21, class 0x0)
bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x16, class 0x0)
bcma: bus0: Core 3 found: UNKNOWN (manuf 0x43B, id 0x368, rev 0x00, class 0x0)
bcma: bus0: Bus registered

The wifi is not currently supported by brcmsmac yet:
brcmsmac bcma1:1: mfg 4bf core 812 rev 33 class 0 irq 18
brcmsmac: unknown device id 4365

So don't expect a working wifi from this patch :).

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: <linux-wireless@vger.kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 1bea0512 11-Jul-2016 Rafał Miłecki <zajec5@gmail.com>

bcma: add PCI ID for Foxconn's BCM43142 device

After discovering there are 2 very different 14e4:4365 PCI devices we
made ID tables less generic. Back then we believed there are only 2 such
devices:
1) 14e4:4365 1028:0016 with SoftMAC BCM43142 chipset
2) 14e4:4365 14e4:4365 with FullMAC BCM4366 chipset

>From the recent report it appears there is also 14e4:4365 105b:e092
which should be claimed by bcma. Add back support for it.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=121881
Fixes: 515b399c9a20 ("bcma: claim only 14e4:4365 PCI Dell card with SoftMAC BCM43142")
Reported-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: Stable <stable@vger.kernel.org> [4.6+]
Tested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 515b399c 26-Jan-2016 Rafał Miłecki <zajec5@gmail.com>

bcma: claim only 14e4:4365 PCI Dell card with SoftMAC BCM43142

It seems 14e4:4365 pattern is too generic as there are two devices:
1) 14e4:4365 1028:0016 with SoftMAC BCM43142 chipset
2) 14e4:4365 14e4:4365 with FullMAC BCM4366 chipset
The later one was found in D-Link DIR-885L router and we want to let
brcmfmac handle it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 702131e2 05-Mar-2015 Rafał Miłecki <zajec5@gmail.com>

bcma: move PCI IRQ control function to host specific code

This function isn't really related to any bus core. It touches PCI
device config registers only, so move it to the (PCI) host file.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 9b6cc9a8 08-Feb-2015 Rafał Miłecki <zajec5@gmail.com>

bcma: enable support for PCIe Gen 2 host devices

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 804e27de 08-Feb-2015 Rafał Miłecki <zajec5@gmail.com>

bcma: support bringing up bus hosted on PCIe Gen 2

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 4186721d 08-Feb-2015 Rafał Miłecki <zajec5@gmail.com>

bcma: add helpers bringing PCIe hosted bus up / down

Bringing PCIe hosted bus up requires operating on host-related core.
Since we plan to support PCIe Gen 2 devices we should provide a helper
picking the correct one (PCIE or PCIE2).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 8be08a39 25-Jan-2015 Rafał Miłecki <zajec5@gmail.com>

bcma: implement host code support for PCIe Gen 2 devices

This is stil incomplete, so we don't add PCI IDs of new devices yet.
Purpose of this patch is to allow testing & adjusting rest of the code.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 34b6d429 14-Oct-2014 Rafał Miłecki <zajec5@gmail.com>

bcma: add another PCI ID of device with BCM43228

It was found attached to the BCM47081A0 SoC. Log:
bcma: bus0: Found chip with id 43228, rev 0x00 and package 0x08

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# dc8ecdd3 01-Sep-2014 Rafał Miłecki <zajec5@gmail.com>

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>


# ed96c03e 23-Aug-2014 Hauke Mehrtens <hauke@hauke-m.de>

bcma: add PCI ID for spromless BCM43217

This adds the PCI ID a BCM43217 without a sprom.
This devices was found on a Netgear R6250 attached to a BCM4708 ARM SoC.

bcma: bus1: Found chip with id 0xA8D1, rev 0x00 and package 0x08
bcma: bus1: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x27, class 0x0)
bcma: bus1: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x1E, class 0x0)
bcma: bus1: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x14, class 0x0)

b43-phy0: Broadcom 43217 WLAN found (core revision 30)
b43-phy0: Found PHY: Analog 9, Type 4 (N), Revision 17
b43-phy0: Found Radio: Manuf 0x17F, ID 0x2057, Revision 14, Version 1

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 27cfdb05 24-Jul-2014 Rafał Miłecki <zajec5@gmail.com>

bcma: add support for BCM43131 that was found in Tenda W311E

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d1d3799f 15-Jul-2014 Rafał Miłecki <zajec5@gmail.com>

bcma: add support for BCM43217 found in Tenda W322E (14e4:43a9)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 342a11e1 02-Dec-2013 Jingoo Han <jg1.han@samsung.com>

bcma: pci: remove DEFINE_PCI_DEVICE_TABLE macro

Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro
is not preferred.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0a7a109e 24-Nov-2013 Jingoo Han <jg1.han@samsung.com>

bcma: pci: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# b9f54bd0 03-Oct-2013 Hauke Mehrtens <hauke@hauke-m.de>

bcma: add PCI id 0x4313

This PCI id is used by some BCM4313 cards without a sprom. I have seen
such a card on a router connected to some BCM63XX SoC via PCIe. There
are cards out there with the same PCI id and a BCM4311, which is a pre
ieee80211n chip only supporting ieee80211a, these are still not
supported by b43 and not detected by ssb.

This devices was found by someone in this ticket:
https://dev.openwrt.org/ticket/13551

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# dfa0415b 03-Oct-2013 Hauke Mehrtens <hauke@hauke-m.de>

bcma: reject PCI cards in bcma.

bcma currently only supports PCIe cards and no PCI cards, reject them
if we find them. I have never heard of any PCI card using the AI bus
(bcma), all of them are using ssb instead.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 88f9b65d 26-Jun-2013 Rafał Miłecki <zajec5@gmail.com>

bcma: add support for BCM43142

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0f58a01d 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: bcma: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, and __devexit
from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ccd60953 16-Oct-2012 Yuanhan Liu <yuanhan.liu@linux.intel.com>

bcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

warning: 'xxx_suspend' defined but not used [-Wunused-function]
warning: 'xxx_resume' defined but not used [-Wunused-function]

Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)

Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).

Cc: John W. Linville <linville@tuxdriver.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 646e0827 21-Sep-2012 Rafał Miłecki <zajec5@gmail.com>

bcma: handle BCM43227

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Tested-by: Jack <x6719620@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 94f3457f 05-Aug-2012 Hauke Mehrtens <hauke@hauke-m.de>

bcma: make some functions static

The functions and structs are not used in an other file and the
prototypes are in no header file, just make them static so the compiler
is able to optimize them better.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# c263c2c1 23-Jul-2012 Rafał Miłecki <zajec5@gmail.com>

bcma: BCM43228 support

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 3d9d8af3 05-Jul-2012 Rafał Miłecki <zajec5@gmail.com>

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: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 02817be0 29-Jun-2012 Hauke Mehrtens <hauke@hauke-m.de>

bcma: add PCI ID for BCM43224

This ID was found on the PCIe wireless card on the board of a Netgear
WNDR3400 using a bcm4716. The device with this ID is identified by b43
as "Broadcom 43224 WLAN".

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 16d75fae 04-May-2012 Nathan Hintz <nlhintz@hotmail.com>

bcma: Add __devexit to bcma_host_pci_remove

Add missing __devexit attribute to bcma_host_pci_remove.

Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 0a2fcaa7 28-Apr-2012 Hauke Mehrtens <hauke@hauke-m.de>

bcma: add boardinfo struct

This struct contains information about the board, the chip is running
on. The struct is filled for PCIe devices and SoCs. This information is
used by b43 and will be used by brcmsmac soon.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# d1a7a8e1 30-Jan-2012 Hauke Mehrtens <hauke@hauke-m.de>

bcma: make some functions __devinit

bcma_core_pci_hostmode_init() has to be in __devinit as it will call a
function in that section and so all functions calling it also have to
be in __devinit.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 685a4ef0 13-Jan-2012 Linus Torvalds <torvalds@linux-foundation.org>

bcma: add stub for bcma_bus_suspend()

.. and connect it up with the pci host bcma driver.

Now, the next step is to connect those bcma bus-level suspend/resume
functions to the actual bcma device suspend resume functions.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 5d2031f2 13-Jan-2012 Linus Torvalds <torvalds@linux-foundation.org>

bcma: convert suspend/resume to pm_ops

.. and avoid doing the unnecessary PCI operations - the PCI layer will
do them for us.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 28e7d218 13-Jan-2012 Rafał Miłecki <zajec5@gmail.com>

bcma: invalidate the mapped core over suspend/resume

This clears the currently mapped core when suspending, to force
re-mapping after resume. Without that we were touching default core
registers believing some other core is mapped. Such a behaviour
resulted in lockups on some machines.

Cc: stable@vger.kernel.org
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 775ab521 09-Dec-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: support for suspend and resume

bcma used to lock up machine without enabling PCI or initializing CC.

Cc: stable@vger.kernel.org
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 439678f8 05-Dec-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: pci: use fixed windows when possible

Some cores are mapped in the fixed way, they registers can be accessed
all the time.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 200351c7 01-Jul-2011 Paul Gortmaker <paul.gortmaker@windriver.com>

bcma: add module.h to the modular portions of this driver

This will ensure that it continues to build once we remove
the implicit module.h presence from everywhere later on.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>


# 91fa4b0a 17-Jun-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: enable support for 14e4:4357 (BCM43225)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 9d75ef0f 19-May-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: host pci: implement block R/W operations

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# ba7328b2 26-May-2011 Andrew Morton <akpm@linux-foundation.org>

drivers/bcma/host_pci.c needs slab.h

alpha allmodconfig:

drivers/bcma/host_pci.c: In function 'bcma_host_pci_probe':
drivers/bcma/host_pci.c:102: error: implicit declaration of function 'kzalloc'
drivers/bcma/host_pci.c:102: warning: assignment makes pointer from integer without a cast

Cc: <zajec5@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 9594b56d 14-May-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: add PCI ID of the card found in Thinkpad X120e

Reported-by: Gottfried Haider <gottfried.haider@gmail.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 8369ae33 09-May-2011 Rafał Miłecki <zajec5@gmail.com>

bcma: add Broadcom specific AMBA bus driver

Broadcom has released cards based on a new AMBA-based bus type. From a
programming point of view, this new bus type differs from AMBA and does
not use AMBA common registers. It also differs enough from SSB. We
decided that a new bus driver is needed to keep the code clean.

In its current form, the driver detects devices present on the bus and
registers them in the system. It allows registering BCMA drivers for
specified bus devices and provides them basic operations. The bus driver
itself includes two important bus managing drivers: ChipCommon core
driver and PCI(c) core driver. They are early used to allow correct
initialization.

Currently code is limited to supporting buses on PCI(e) devices, however
the driver is designed to be used also on other hosts. The host
abstraction layer is implemented and already used for PCI(e).

Support for PCI(e) hosts is working and seems to be stable (access to
80211 core was tested successfully on a few devices). We can still
optimize it by using some fixed windows, but this can be done later
without affecting any external code. Windows are just ranges in MMIO
used for accessing cores on the bus.

Cc: Greg KH <greg@kroah.com>
Cc: Michael Büsch <mb@bu3sch.de>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: George Kashperko <george@znau.edu.ua>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Botting <andy@andybotting.com>
Cc: linuxdriverproject <devel@linuxdriverproject.org>
Cc: linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>