summaryrefslogtreecommitdiff
path: root/target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-03-14 21:48:23 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-03-14 21:48:23 +0000
commit7fee567dc04fe5614504e0d33f7c8aa46718ce2e (patch)
tree759f9d91a7405b67f98bd71876d3c815fa54d3d2 /target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch
parentfab5be9b4fe6132f474b302d5a5eace1f08497f9 (diff)
downloadmtk-20170518-7fee567dc04fe5614504e0d33f7c8aa46718ce2e.zip
mtk-20170518-7fee567dc04fe5614504e0d33f7c8aa46718ce2e.tar.gz
mtk-20170518-7fee567dc04fe5614504e0d33f7c8aa46718ce2e.tar.bz2
brcm47xx: move and rename the patches
The patches are now grouped by the part what they are doing and are using three digest numbers. This does not remove or adds anything SVN-Revision: 30942
Diffstat (limited to 'target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch b/target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch
new file mode 100644
index 0000000..cba9a63
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.2/040-bcma-add-the-core-unit-number.patch
@@ -0,0 +1,61 @@
+From 7b9116eeaf44c0d368b5eeaa06eb101465284596 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Wed, 11 Jan 2012 15:26:11 +0100
+Subject: [PATCH 23/31] bcma: add the core unit number
+
+Some SoCs have two pcie or gmac cores and we need to know the number of
+the specific core on the bus. This is the case for the BCM4706.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ drivers/bcma/scan.c | 14 ++++++++++++++
+ include/linux/bcma/bcma.h | 1 +
+ 2 files changed, 15 insertions(+), 0 deletions(-)
+
+--- a/drivers/bcma/scan.c
++++ b/drivers/bcma/scan.c
+@@ -212,6 +212,17 @@ static struct bcma_device *bcma_find_cor
+ return NULL;
+ }
+
++static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 coreid)
++{
++ struct bcma_device *core;
++
++ list_for_each_entry_reverse(core, &bus->cores, list) {
++ if (core->id.id == coreid)
++ return core;
++ }
++ return NULL;
++}
++
+ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
+ struct bcma_device_id *match, int core_num,
+ struct bcma_device *core)
+@@ -392,6 +403,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
+ bcma_scan_switch_core(bus, erombase);
+
+ while (eromptr < eromend) {
++ struct bcma_device *other_core;
+ struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL);
+ if (!core)
+ return -ENOMEM;
+@@ -411,6 +423,8 @@ int bcma_bus_scan(struct bcma_bus *bus)
+
+ core->core_index = core_num++;
+ bus->nr_cores++;
++ other_core = bcma_find_core_reverse(bus, core->id.id);
++ core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
+
+ pr_info("Core %d found: %s "
+ "(manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
+--- a/include/linux/bcma/bcma.h
++++ b/include/linux/bcma/bcma.h
+@@ -136,6 +136,7 @@ struct bcma_device {
+ bool dev_registered;
+
+ u8 core_index;
++ u8 core_unit;
+
+ u32 addr;
+ u32 wrap;