bcm53xx: update patches

This reorders the patchs and adds some new ones.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 37586
lede-17.01
Hauke Mehrtens 2013-07-28 22:13:52 +00:00
parent 333252e493
commit 1377916ea7
16 changed files with 209 additions and 97 deletions

View File

@ -1,22 +0,0 @@
From 0cf467765b64f6dc60f95c890cdb1641ae1d9390 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 10 Jul 2013 17:54:33 +0200
Subject: [PATCH 16/17] bgmac: bgmac depends on phylib
bgmac is using functions from phylib, add the dependency.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/Kconfig | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/ethernet/broadcom/Kconfig
+++ b/drivers/net/ethernet/broadcom/Kconfig
@@ -133,6 +133,7 @@ config BNX2X_SRIOV
config BGMAC
tristate "BCMA bus GBit core support"
depends on BCMA_HOST_SOC && HAS_DMA
+ select PHYLIB
---help---
This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus.
They can be found on BCM47xx SoCs and provide gigabit ethernet.

View File

@ -1,25 +0,0 @@
From a0c7d2569ed39b8b0d90a431d80babc0f5f1f864 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 10 Jul 2013 17:55:34 +0200
Subject: [PATCH 17/17] bgmac: make bgmac work on systems without nvram
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/net/ethernet/broadcom/bgmac.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -16,7 +16,11 @@
#include <linux/phy.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
+#ifdef CONFIG_BCM47XX
#include <bcm47xx_nvram.h>
+#else
+#define bcm47xx_nvram_getenv(a, b, c) -1
+#endif
static const struct bcma_device_id bgmac_bcma_tbl[] = {
BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS),

View File

@ -1,7 +1,4 @@
From 6c55b7f2fe06eb01f4ca6dad35d54c6e2ecbff25 Mon Sep 17 00:00:00 2001 bcm53xx: initial support for the BCM5301/BCM470X SoC
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 29 Jun 2013 22:06:43 +0200
Subject: [PATCH 08/17] bcm53xx: initial support for the BCM5301/BCM470X SoC
with ARM CPU with ARM CPU
This patch adds support for the BCM5301/BCM470X SoCs with an ARM CPU. This patch adds support for the BCM5301/BCM470X SoCs with an ARM CPU.

View File

@ -1,7 +1,4 @@
From 5b9be5e1e3c368466e482c7dbb2cf6b890614b39 Mon Sep 17 00:00:00 2001 bcm53xx: register bcma bus
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:37:13 +0200
Subject: [PATCH 12/17] bcm53xx: register bcma bus
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---

View File

@ -1,11 +1,27 @@
From 6fe4f63b017c3c0a7caa73d01fab23874ca0ed97 Mon Sep 17 00:00:00 2001 bcma: add some more core names
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:29:48 +0200
Subject: [PATCH 10/17] bcma: add some more core names
These cores were found on a BCM4708 (chipid 53010), this is a ARM SoC These cores were found on a BCM4708 (chipid 53010), this is a ARM SoC
with two Cortex A9 cores. with two Cortex A9 cores.
bcma: bus0: Found chip with id 0xCF12, rev 0x00 and package 0x02
bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x2A, class 0x0)
bcma: bus0: Core 1 found: DMA (manuf 0x4BF, id 0x502, rev 0x01, class 0x0)
bcma: bus0: Core 2 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x04, class 0x0)
bcma: bus0: Core 3 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x04, class 0x0)
bcma: bus0: Core 4 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x04, class 0x0)
bcma: bus0: Core 5 found: GBit MAC (manuf 0x4BF, id 0x82D, rev 0x04, class 0x0)
bcma: bus0: Core 6 found: PCIe Gen 2 (manuf 0x4BF, id 0x501, rev 0x01, class 0x0)
bcma: bus0: Core 7 found: PCIe Gen 2 (manuf 0x4BF, id 0x501, rev 0x01, class 0x0)
bcma: bus0: Core 8 found: ARM Cortex A9 core (ihost) (manuf 0x4BF, id 0x510, rev 0x01, class 0x0)
bcma: bus0: Core 9 found: USB 2.0 (manuf 0x4BF, id 0x504, rev 0x01, class 0x0)
bcma: bus0: Core 10 found: USB 3.0 (manuf 0x4BF, id 0x505, rev 0x01, class 0x0)
bcma: bus0: Core 11 found: SDIO3 (manuf 0x4BF, id 0x503, rev 0x01, class 0x0)
bcma: bus0: Core 12 found: ARM Cortex A9 JTAG (manuf 0x4BF, id 0x506, rev 0x01, class 0x0)
bcma: bus0: Core 13 found: Denali DDR2/DDR3 memory controller (manuf 0x4BF, id 0x507, rev 0x01, class 0x0)
bcma: bus0: Core 14 found: ROM (manuf 0x4BF, id 0x508, rev 0x01, class 0x0)
bcma: bus0: Core 15 found: NAND flash controller (manuf 0x4BF, id 0x509, rev 0x01, class 0x0)
bcma: bus0: Core 16 found: SPI flash controller (manuf 0x4BF, id 0x50A, rev 0x01, class 0x0)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---
drivers/bcma/scan.c | 12 ++++++++++++ drivers/bcma/scan.c | 12 ++++++++++++

View File

@ -1,8 +1,4 @@
From b5f4430c100a4d7b526426db46b76add728f45d4 Mon Sep 17 00:00:00 2001 bcma: make it possible to select SoC support without mips
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:35:22 +0200
Subject: [PATCH 11/17] bcma: make it possible to select SoC support without
mips
To make it possible to use the SoC host interface with ARM SoCs do not To make it possible to use the SoC host interface with ARM SoCs do not
depend on the MIPS driver any more. depend on the MIPS driver any more.

View File

@ -1,7 +1,4 @@
From fda36440e95ef9adbd7955b069248d1d807a85b1 Mon Sep 17 00:00:00 2001 bcma: add constants for new ARM based SoCs
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:48:25 +0200
Subject: [PATCH 13/17] bcma: add constants for new ARM based SoCs
These are the chipIDs of some ARM based SoCs from the BCM47xx line. These are the chipIDs of some ARM based SoCs from the BCM47xx line.

View File

@ -1,7 +1,6 @@
From e2e1b185afd86a047e1f2db405c61ae4e43c0f29 Mon Sep 17 00:00:00 2001 bcma: return correct error code when bus scan failed
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:49:14 +0200 It is better to return the actual error code than just -1.
Subject: [PATCH 14/17] bcma: return correct error code when bus can failed
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---

View File

@ -1,10 +1,8 @@
From 8204277ed0f4aeb7bb38d0d5f39d9ebcced92576 Mon Sep 17 00:00:00 2001 bcma: fix handling of big addrl
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Fri, 5 Jul 2013 00:24:38 +0200
Subject: [PATCH 15/17] bcma: fix handling of big addrl
The return value of bcma_erom_get_addr_desc() is a unsigned value and it The return value of bcma_erom_get_addr_desc() is a unsigned value and it
could wrap around in the two complement writing. could wrap around in the two complement writing. This happens for one
core in the BCM4708 SoC.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---

View File

@ -1,7 +1,4 @@
From d16de2a4ffeaf62fb3d838365a29b80f330bffe0 Mon Sep 17 00:00:00 2001 bcma: register bcma as device tree driver
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Thu, 4 Jul 2013 22:26:58 +0200
Subject: [PATCH 09/17] bcma: register bcma as device tree driver
This driver is used by the bcm53xx ARM SoC code.Now it is possible to This driver is used by the bcm53xx ARM SoC code.Now it is possible to
give the address of the chipcommon core in device tree. give the address of the chipcommon core in device tree.

View File

@ -0,0 +1,18 @@
bcma: fix dma mask
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/main.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -155,6 +155,7 @@ static int bcma_register_cores(struct bc
core->irq = bus->host_pci->irq;
break;
case BCMA_HOSTTYPE_SOC:
+ core->dev.coherent_dma_mask = DMA_BIT_MASK(32);
core->dev.dma_mask = &core->dev.coherent_dma_mask;
core->dma_dev = &core->dev;
break;

View File

@ -0,0 +1,156 @@
bcma: add arm support
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
drivers/bcma/Kconfig | 9 +++++
drivers/bcma/Makefile | 1 +
drivers/bcma/driver_arm.c | 61 ++++++++++++++++++++++++++++++++++
drivers/bcma/main.c | 7 ++++
include/linux/bcma/bcma.h | 2 ++
include/linux/bcma/bcma_driver_arm.h | 20 +++++++++++
6 files changed, 100 insertions(+)
create mode 100644 drivers/bcma/driver_arm.c
create mode 100644 include/linux/bcma/bcma_driver_arm.h
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -54,6 +54,15 @@ config BCMA_DRIVER_MIPS
If unsure, say N
+config BCMA_DRIVER_ARM
+ bool "BCMA Broadcom ARM core driver"
+ depends on BCMA && ARM
+ help
+ Driver for the Broadcom MIPS core attached to Broadcom specific
+ Advanced Microcontroller Bus.
+
+ If unsure, say N
+
config BCMA_SFLASH
bool
depends on BCMA_DRIVER_MIPS
--- a/drivers/bcma/Makefile
+++ b/drivers/bcma/Makefile
@@ -5,6 +5,7 @@ bcma-$(CONFIG_BCMA_NFLASH) += driver_ch
bcma-y += driver_pci.o
bcma-$(CONFIG_BCMA_DRIVER_PCI_HOSTMODE) += driver_pci_host.o
bcma-$(CONFIG_BCMA_DRIVER_MIPS) += driver_mips.o
+bcma-$(CONFIG_BCMA_DRIVER_ARM) += driver_arm.o
bcma-$(CONFIG_BCMA_DRIVER_GMAC_CMN) += driver_gmac_cmn.o
bcma-$(CONFIG_BCMA_DRIVER_GPIO) += driver_gpio.o
bcma-$(CONFIG_BCMA_HOST_PCI) += host_pci.o
--- /dev/null
+++ b/drivers/bcma/driver_arm.c
@@ -0,0 +1,53 @@
+/*
+ * Broadcom specific AMBA
+ * Broadcom MIPS32 74K core driver
+ *
+ * Copyright 2009, Broadcom Corporation
+ * Copyright 2006, 2007, Michael Buesch <mb@bu3sch.de>
+ * Copyright 2010, Bernhard Loos <bernhardloos@googlemail.com>
+ * Copyright 2011, Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include "bcma_private.h"
+
+#include <linux/bcma/bcma.h>
+
+static void bcma_core_mips_set_irq_name(struct bcma_bus *bus, unsigned int irq,
+ u16 coreid, u8 unit)
+{
+ struct bcma_device *core;
+
+ core = bcma_find_core_unit(bus, coreid, unit);
+ if (!core) {
+ bcma_warn(bus,
+ "Can not find core (id: 0x%x, unit %i) for IRQ configuration.\n",
+ coreid, unit);
+ return;
+ }
+ core->irq = irq;
+}
+
+void bcma_core_arm_init(struct bcma_drv_arm *acore)
+{
+ struct bcma_bus *bus;
+ struct bcma_device *core;
+ bus = acore->core->bus;
+
+ if (acore->setup_done)
+ return;
+
+ bcma_core_mips_set_irq_name(bus, 111, BCMA_CORE_USB20, 0);
+
+ bcma_core_mips_set_irq_name(bus, 179, BCMA_CORE_MAC_GBIT, 0);
+ bcma_core_mips_set_irq_name(bus, 180, BCMA_CORE_MAC_GBIT, 1);
+ bcma_core_mips_set_irq_name(bus, 181, BCMA_CORE_MAC_GBIT, 2);
+ bcma_core_mips_set_irq_name(bus, 182, BCMA_CORE_MAC_GBIT, 3);
+
+ bcma_core_mips_set_irq_name(bus, 112, BCMA_CORE_USB30, 0);
+ bcma_debug(bus, "IRQ reconfiguration done\n");
+
+
+ acore->setup_done = true;
+}
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -269,6 +269,13 @@ int bcma_bus_register(struct bcma_bus *b
bcma_core_mips_init(&bus->drv_mips);
}
+ /* Init ARM core */
+ core = bcma_find_core(bus, BCMA_CORE_ARMCA9);
+ if (core) {
+ bus->drv_arm.core = core;
+ bcma_core_arm_init(&bus->drv_arm);
+ }
+
/* Init PCIE core */
core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0);
if (core) {
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -7,6 +7,7 @@
#include <linux/bcma/bcma_driver_chipcommon.h>
#include <linux/bcma/bcma_driver_pci.h>
#include <linux/bcma/bcma_driver_mips.h>
+#include <linux/bcma/bcma_driver_arm.h>
#include <linux/bcma/bcma_driver_gmac_cmn.h>
#include <linux/ssb/ssb.h> /* SPROM sharing */
@@ -334,6 +335,7 @@ struct bcma_bus {
struct bcma_drv_cc drv_cc;
struct bcma_drv_pci drv_pci[2];
struct bcma_drv_mips drv_mips;
+ struct bcma_drv_arm drv_arm;
struct bcma_drv_gmac_cmn drv_gmac_cmn;
/* We decided to share SPROM struct with SSB as long as we do not need
--- /dev/null
+++ b/include/linux/bcma/bcma_driver_arm.h
@@ -0,0 +1,20 @@
+#ifndef LINUX_BCMA_DRIVER_ARM_H_
+#define LINUX_BCMA_DRIVER_ARM_H_
+
+struct bcma_device;
+
+struct bcma_drv_arm {
+ struct bcma_device *core;
+ u8 setup_done:1;
+ u8 early_setup_done:1;
+};
+
+#ifdef CONFIG_BCMA_DRIVER_ARM
+extern void bcma_core_arm_init(struct bcma_drv_arm *acore);
+
+#else
+static inline void bcma_core_arm_init(struct bcma_drv_arm *acore) { }
+
+#endif
+
+#endif /* LINUX_BCMA_DRIVER_ARM_H_ */

View File

@ -1,7 +1,4 @@
From d29611892717def1628f2677f7b0bd6eb2c58565 Mon Sep 17 00:00:00 2001 bgmac: add dependency to phylib
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 10 Jul 2013 17:54:33 +0200
Subject: [PATCH 16/18] bgmac: add dependency to phylib
bgmac is using functions from phylib, add the dependency. bgmac is using functions from phylib, add the dependency.

View File

@ -1,7 +1,4 @@
From e484cca2387df0878d55d8f3e8e4543aa668dd52 Mon Sep 17 00:00:00 2001 bgmac: make bgmac work on systems without nvram
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 10 Jul 2013 17:55:34 +0200
Subject: [PATCH 17/18] bgmac: make bgmac work on systems without nvram
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---

View File

@ -1,7 +1,4 @@
From a145c561b9ba9ef402fbc3aa295b31521aa8591d Mon Sep 17 00:00:00 2001 bgmac: register phy
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 14 Jul 2013 00:04:21 +0200
Subject: [PATCH 18/18] bgmac: register phy
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- ---

View File

@ -1,7 +1,4 @@
From 91c50931fd696fa8d2f9888482f89a6a0683fe6f Mon Sep 17 00:00:00 2001 bgmac: add supprot for BCM4707
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Mon, 15 Jul 2013 22:22:25 +0200
Subject: [PATCH 19/20] bgmac: add supprot for BCM4707
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>