All of lore.kernel.org
 help / color / mirror / Atom feed
* bcm63xx updates for 2.6.34
@ 2010-01-30 17:34 Maxime Bizon
  2010-01-30 17:34 ` [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device Maxime Bizon
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf

Hi Ralf,

Here is a set of updates for bcm63xx on top of linux-queue tree.

Regards,

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-01-31 13:13   ` Sergei Shtylyov
  2010-01-30 17:34 ` [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI " Maxime Bizon
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

The bcm63xx SOC has an integrated OHCI controller, this patch adds
platform device registration and change board code to register ohci
device when necessary.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/Kconfig                          |    6 ++
 arch/mips/bcm63xx/Makefile                         |    3 +-
 arch/mips/bcm63xx/boards/board_bcm963xx.c          |    4 ++
 arch/mips/bcm63xx/dev-usb-ohci.c                   |   49 ++++++++++++++++++++
 .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h        |    6 ++
 5 files changed, 67 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/bcm63xx/dev-usb-ohci.c
 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h

diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
index fb177d6..76fbbf7 100644
--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -16,10 +16,16 @@ config BCM63XX_CPU_6345
 config BCM63XX_CPU_6348
 	bool "support 6348 CPU"
 	select HW_HAS_PCI
+	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_BIG_ENDIAN_DESC
+	select USB_OHCI_BIG_ENDIAN_MMIO
 
 config BCM63XX_CPU_6358
 	bool "support 6358 CPU"
 	select HW_HAS_PCI
+	select USB_ARCH_HAS_OHCI
+	select USB_OHCI_BIG_ENDIAN_DESC
+	select USB_OHCI_BIG_ENDIAN_MMIO
 endmenu
 
 source "arch/mips/bcm63xx/boards/Kconfig"
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
index 00064b6..be5d7ad 100644
--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -1,5 +1,6 @@
 obj-y		+= clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
-		   dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o
+		   dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
+		   dev-usb-ohci.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-y		+= boards/
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index ea17941..e2c0c36 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -24,6 +24,7 @@
 #include <bcm63xx_dev_enet.h>
 #include <bcm63xx_dev_dsp.h>
 #include <bcm63xx_dev_pcmcia.h>
+#include <bcm63xx_dev_usb_ohci.h>
 #include <board_bcm963xx.h>
 
 #define PFX	"board_bcm963xx: "
@@ -803,6 +804,9 @@ int __init board_register_devices(void)
 	    !board_get_mac_address(board.enet1.mac_addr))
 		bcm63xx_enet_register(1, &board.enet1);
 
+	if (board.has_ohci0)
+		bcm63xx_ohci_register();
+
 	if (board.has_dsp)
 		bcm63xx_dsp_register(&board.dsp);
 
diff --git a/arch/mips/bcm63xx/dev-usb-ohci.c b/arch/mips/bcm63xx/dev-usb-ohci.c
new file mode 100644
index 0000000..f1fb442
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-usb-ohci.c
@@ -0,0 +1,49 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_dev_usb_ohci.h>
+
+static struct resource ohci_resources[] = {
+	{
+		/* start & end filled at runtime */
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		/* start filled at runtime */
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+static u64 ohci_dmamask = ~(u32)0;
+
+static struct platform_device bcm63xx_ohci_device = {
+	.name		= "bcm63xx_ohci",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(ohci_resources),
+	.resource	= ohci_resources,
+	.dev		= {
+		.dma_mask		= &ohci_dmamask,
+		.coherent_dma_mask	= 0xffffffff,
+	},
+};
+
+int __init bcm63xx_ohci_register(void)
+{
+	if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
+		return 0;
+
+	ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
+	ohci_resources[0].end = ohci_resources[0].start;
+	ohci_resources[0].end += RSET_OHCI_SIZE - 1;
+	ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0);
+	return platform_device_register(&bcm63xx_ohci_device);
+}
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
new file mode 100644
index 0000000..518a04d
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
@@ -0,0 +1,6 @@
+#ifndef BCM63XX_DEV_USB_OHCI_H_
+#define BCM63XX_DEV_USB_OHCI_H_
+
+int bcm63xx_ohci_register(void);
+
+#endif /* BCM63XX_DEV_USB_OHCI_H_ */
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI controller device.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
  2010-01-30 17:34 ` [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-01-31 13:16   ` Sergei Shtylyov
  2010-01-30 17:34 ` [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration Maxime Bizon
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

The bcm63xx SOC has an integrated EHCI controller, this patch adds
platform device registration and change board code to register
EHCI device when necessary.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/Kconfig                          |    2 +
 arch/mips/bcm63xx/Makefile                         |    2 +-
 arch/mips/bcm63xx/boards/board_bcm963xx.c          |    4 ++
 arch/mips/bcm63xx/dev-usb-ehci.c                   |   49 ++++++++++++++++++++
 .../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h        |    6 ++
 5 files changed, 62 insertions(+), 1 deletions(-)
 create mode 100644 arch/mips/bcm63xx/dev-usb-ehci.c
 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h

diff --git a/arch/mips/bcm63xx/Kconfig b/arch/mips/bcm63xx/Kconfig
index 76fbbf7..4aa21e8 100644
--- a/arch/mips/bcm63xx/Kconfig
+++ b/arch/mips/bcm63xx/Kconfig
@@ -26,6 +26,8 @@ config BCM63XX_CPU_6358
 	select USB_ARCH_HAS_OHCI
 	select USB_OHCI_BIG_ENDIAN_DESC
 	select USB_OHCI_BIG_ENDIAN_MMIO
+	select USB_ARCH_HAS_EHCI
+	select USB_EHCI_BIG_ENDIAN_MMIO
 endmenu
 
 source "arch/mips/bcm63xx/boards/Kconfig"
diff --git a/arch/mips/bcm63xx/Makefile b/arch/mips/bcm63xx/Makefile
index be5d7ad..6e229c2 100644
--- a/arch/mips/bcm63xx/Makefile
+++ b/arch/mips/bcm63xx/Makefile
@@ -1,6 +1,6 @@
 obj-y		+= clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
 		   dev-dsp.o dev-enet.o dev-pcmcia.o dev-uart.o dev-wdt.o \
-		   dev-usb-ohci.o
+		   dev-usb-ohci.o dev-usb-ehci.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-y		+= boards/
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index e2c0c36..b0d3db3 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -25,6 +25,7 @@
 #include <bcm63xx_dev_dsp.h>
 #include <bcm63xx_dev_pcmcia.h>
 #include <bcm63xx_dev_usb_ohci.h>
+#include <bcm63xx_dev_usb_ehci.h>
 #include <board_bcm963xx.h>
 
 #define PFX	"board_bcm963xx: "
@@ -804,6 +805,9 @@ int __init board_register_devices(void)
 	    !board_get_mac_address(board.enet1.mac_addr))
 		bcm63xx_enet_register(1, &board.enet1);
 
+	if (board.has_ehci0)
+		bcm63xx_ehci_register();
+
 	if (board.has_ohci0)
 		bcm63xx_ohci_register();
 
diff --git a/arch/mips/bcm63xx/dev-usb-ehci.c b/arch/mips/bcm63xx/dev-usb-ehci.c
new file mode 100644
index 0000000..4bdd675
--- /dev/null
+++ b/arch/mips/bcm63xx/dev-usb-ehci.c
@@ -0,0 +1,49 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <bcm63xx_cpu.h>
+#include <bcm63xx_dev_usb_ehci.h>
+
+static struct resource ehci_resources[] = {
+	{
+		/* start & end filled at runtime */
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		/* start filled at runtime */
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+static u64 ehci_dmamask = ~(u32)0;
+
+static struct platform_device bcm63xx_ehci_device = {
+	.name		= "bcm63xx_ehci",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(ehci_resources),
+	.resource	= ehci_resources,
+	.dev		= {
+		.dma_mask		= &ehci_dmamask,
+		.coherent_dma_mask	= 0xffffffff,
+	},
+};
+
+int __init bcm63xx_ehci_register(void)
+{
+	if (!BCMCPU_IS_6358())
+		return 0;
+
+	ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
+	ehci_resources[0].end = ehci_resources[0].start;
+	ehci_resources[0].end += RSET_EHCI_SIZE - 1;
+	ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0);
+	return platform_device_register(&bcm63xx_ehci_device);
+}
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
new file mode 100644
index 0000000..17fb519
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
@@ -0,0 +1,6 @@
+#ifndef BCM63XX_DEV_USB_EHCI_H_
+#define BCM63XX_DEV_USB_EHCI_H_
+
+int bcm63xx_ehci_register(void);
+
+#endif /* BCM63XX_DEV_USB_EHCI_H_ */
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
  2010-01-30 17:34 ` [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device Maxime Bizon
  2010-01-30 17:34 ` [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI " Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-03-19 12:00   ` Ralf Baechle
  2010-01-30 17:34 ` [PATCH 4/7] MIPS: bcm63xx: add support for second uart Maxime Bizon
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

bcm63xx_gpio_init is already called from prom_init to allow board to
use them early, so we can remove the unneeded arch_initcall.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/gpio.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
index 87ca390..3725345 100644
--- a/arch/mips/bcm63xx/gpio.c
+++ b/arch/mips/bcm63xx/gpio.c
@@ -130,5 +130,3 @@ int __init bcm63xx_gpio_init(void)
 
 	return gpiochip_add(&bcm63xx_gpio_chip);
 }
-
-arch_initcall(bcm63xx_gpio_init);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/7] MIPS: bcm63xx: add support for second uart.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
                   ` (2 preceding siblings ...)
  2010-01-30 17:34 ` [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-03-19 12:19   ` Ralf Baechle
  2010-01-30 17:34 ` [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file Maxime Bizon
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

The bcm63xx SOC has two uarts, some boards use the second one for
bluetooth.  This patch changes platform device registration code to
handle this. Changes to the uart driver are in a separate patch.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/boards/board_bcm963xx.c          |   27 +++++++-
 arch/mips/bcm63xx/cpu.c                            |    5 ++
 arch/mips/bcm63xx/dev-uart.c                       |   66 +++++++++++++++-----
 arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h   |   15 +++++
 .../include/asm/mach-bcm63xx/bcm63xx_dev_uart.h    |    6 ++
 .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h |    2 +
 6 files changed, 102 insertions(+), 19 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h

diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index b0d3db3..90faa37 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -18,6 +18,7 @@
 #include <asm/addrspace.h>
 #include <bcm63xx_board.h>
 #include <bcm63xx_cpu.h>
+#include <bcm63xx_dev_uart.h>
 #include <bcm63xx_regs.h>
 #include <bcm63xx_io.h>
 #include <bcm63xx_dev_pci.h>
@@ -42,6 +43,7 @@ static struct board_info __initdata board_96338gw = {
 	.name				= "96338GW",
 	.expected_cpu_id		= 0x6338,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.enet0 = {
 		.force_speed_100	= 1,
@@ -84,6 +86,7 @@ static struct board_info __initdata board_96338w = {
 	.name				= "96338W",
 	.expected_cpu_id		= 0x6338,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.enet0 = {
 		.force_speed_100	= 1,
@@ -128,6 +131,8 @@ static struct board_info __initdata board_96338w = {
 static struct board_info __initdata board_96345gw2 = {
 	.name				= "96345GW2",
 	.expected_cpu_id		= 0x6345,
+
+	.has_uart0			= 1,
 };
 #endif
 
@@ -139,6 +144,7 @@ static struct board_info __initdata board_96348r = {
 	.name				= "96348R",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_pci			= 1,
 
@@ -182,6 +188,7 @@ static struct board_info __initdata board_96348gw_10 = {
 	.name				= "96348GW-10",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -241,6 +248,7 @@ static struct board_info __initdata board_96348gw_11 = {
 	.name				= "96348GW-11",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -294,6 +302,7 @@ static struct board_info __initdata board_96348gw = {
 	.name				= "96348GW",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -351,9 +360,10 @@ static struct board_info __initdata board_FAST2404 = {
 	.name				= "F@ST2404",
 	.expected_cpu_id		= 0x6348,
 
-	.has_enet0			= 1,
-	.has_enet1			= 1,
-	.has_pci			= 1,
+	.has_uart0			= 1,
+        .has_enet0			= 1,
+        .has_enet1			= 1,
+        .has_pci			= 1,
 
 	.enet0 = {
 		.has_phy		= 1,
@@ -374,6 +384,7 @@ static struct board_info __initdata board_DV201AMR = {
 	.name				= "DV201AMR",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_pci			= 1,
 	.has_ohci0			= 1,
 
@@ -393,6 +404,7 @@ static struct board_info __initdata board_96348gw_a = {
 	.name				= "96348GW-A",
 	.expected_cpu_id		= 0x6348,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -418,6 +430,7 @@ static struct board_info __initdata board_96358vw = {
 	.name				= "96358VW",
 	.expected_cpu_id		= 0x6358,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -469,6 +482,7 @@ static struct board_info __initdata board_96358vw2 = {
 	.name				= "96358VW2",
 	.expected_cpu_id		= 0x6358,
 
+	.has_uart0			= 1,
 	.has_enet0			= 1,
 	.has_enet1			= 1,
 	.has_pci			= 1,
@@ -516,6 +530,7 @@ static struct board_info __initdata board_AGPFS0 = {
 	.name                           = "AGPF-S0",
 	.expected_cpu_id                = 0x6358,
 
+	.has_uart0			= 1,
 	.has_enet0                      = 1,
 	.has_enet1                      = 1,
 	.has_pci                        = 1,
@@ -794,6 +809,12 @@ int __init board_register_devices(void)
 {
 	u32 val;
 
+	if (board.has_uart0)
+		bcm63xx_uart_register(0);
+
+	if (board.has_uart1)
+		bcm63xx_uart_register(1);
+
 	if (board.has_pccard)
 		bcm63xx_pcmcia_register();
 
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index 70378bb..cbb7caf 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -36,6 +36,7 @@ static const unsigned long bcm96338_regs_base[] = {
 	[RSET_TIMER]		= BCM_6338_TIMER_BASE,
 	[RSET_WDT]		= BCM_6338_WDT_BASE,
 	[RSET_UART0]		= BCM_6338_UART0_BASE,
+	[RSET_UART1]		= BCM_6338_UART1_BASE,
 	[RSET_GPIO]		= BCM_6338_GPIO_BASE,
 	[RSET_SPI]		= BCM_6338_SPI_BASE,
 	[RSET_OHCI0]		= BCM_6338_OHCI0_BASE,
@@ -72,6 +73,7 @@ static const unsigned long bcm96345_regs_base[] = {
 	[RSET_TIMER]		= BCM_6345_TIMER_BASE,
 	[RSET_WDT]		= BCM_6345_WDT_BASE,
 	[RSET_UART0]		= BCM_6345_UART0_BASE,
+	[RSET_UART1]		= BCM_6345_UART1_BASE,
 	[RSET_GPIO]		= BCM_6345_GPIO_BASE,
 	[RSET_SPI]		= BCM_6345_SPI_BASE,
 	[RSET_UDC0]		= BCM_6345_UDC0_BASE,
@@ -109,6 +111,7 @@ static const unsigned long bcm96348_regs_base[] = {
 	[RSET_TIMER]		= BCM_6348_TIMER_BASE,
 	[RSET_WDT]		= BCM_6348_WDT_BASE,
 	[RSET_UART0]		= BCM_6348_UART0_BASE,
+	[RSET_UART1]		= BCM_6348_UART1_BASE,
 	[RSET_GPIO]		= BCM_6348_GPIO_BASE,
 	[RSET_SPI]		= BCM_6348_SPI_BASE,
 	[RSET_OHCI0]		= BCM_6348_OHCI0_BASE,
@@ -150,6 +153,7 @@ static const unsigned long bcm96358_regs_base[] = {
 	[RSET_TIMER]		= BCM_6358_TIMER_BASE,
 	[RSET_WDT]		= BCM_6358_WDT_BASE,
 	[RSET_UART0]		= BCM_6358_UART0_BASE,
+	[RSET_UART1]		= BCM_6358_UART1_BASE,
 	[RSET_GPIO]		= BCM_6358_GPIO_BASE,
 	[RSET_SPI]		= BCM_6358_SPI_BASE,
 	[RSET_OHCI0]		= BCM_6358_OHCI0_BASE,
@@ -170,6 +174,7 @@ static const unsigned long bcm96358_regs_base[] = {
 static const int bcm96358_irqs[] = {
 	[IRQ_TIMER]		= BCM_6358_TIMER_IRQ,
 	[IRQ_UART0]		= BCM_6358_UART0_IRQ,
+	[IRQ_UART1]		= BCM_6358_UART1_IRQ,
 	[IRQ_DSL]		= BCM_6358_DSL_IRQ,
 	[IRQ_ENET0]		= BCM_6358_ENET0_IRQ,
 	[IRQ_ENET1]		= BCM_6358_ENET1_IRQ,
diff --git a/arch/mips/bcm63xx/dev-uart.c b/arch/mips/bcm63xx/dev-uart.c
index b051946..c2963da 100644
--- a/arch/mips/bcm63xx/dev-uart.c
+++ b/arch/mips/bcm63xx/dev-uart.c
@@ -11,31 +11,65 @@
 #include <linux/platform_device.h>
 #include <bcm63xx_cpu.h>
 
-static struct resource uart_resources[] = {
+static struct resource uart0_resources[] = {
 	{
-		.start		= -1, /* filled at runtime */
-		.end		= -1, /* filled at runtime */
+		/* start & end filled at runtime */
 		.flags		= IORESOURCE_MEM,
 	},
 	{
-		.start		= -1, /* filled at runtime */
+		/* start filled at runtime */
 		.flags		= IORESOURCE_IRQ,
 	},
 };
 
-static struct platform_device bcm63xx_uart_device = {
-	.name		= "bcm63xx_uart",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(uart_resources),
-	.resource	= uart_resources,
+static struct resource uart1_resources[] = {
+	{
+		/* start & end filled at runtime */
+		.flags		= IORESOURCE_MEM,
+	},
+	{
+		/* start filled at runtime */
+		.flags		= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device bcm63xx_uart_devices[] = {
+	{
+		.name		= "bcm63xx_uart",
+		.id		= 0,
+		.num_resources	= ARRAY_SIZE(uart0_resources),
+		.resource	= uart0_resources,
+	},
+
+	{
+		.name		= "bcm63xx_uart",
+		.id		= 1,
+		.num_resources	= ARRAY_SIZE(uart1_resources),
+		.resource	= uart1_resources,
+	}
 };
 
-int __init bcm63xx_uart_register(void)
+int __init bcm63xx_uart_register(unsigned int id)
 {
-	uart_resources[0].start = bcm63xx_regset_address(RSET_UART0);
-	uart_resources[0].end = uart_resources[0].start;
-	uart_resources[0].end += RSET_UART_SIZE - 1;
-	uart_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
-	return platform_device_register(&bcm63xx_uart_device);
+	if (id >= ARRAY_SIZE(bcm63xx_uart_devices))
+		return -ENODEV;
+
+	if (id == 1 && !BCMCPU_IS_6358())
+		return -ENODEV;
+
+	if (id == 0) {
+		uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0);
+		uart0_resources[0].end = uart0_resources[0].start +
+			RSET_UART_SIZE - 1;
+		uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0);
+	}
+
+	if (id == 1) {
+		uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1);
+		uart1_resources[0].end = uart1_resources[0].start +
+			RSET_UART_SIZE - 1;
+		uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1);
+	}
+
+	return platform_device_register(&bcm63xx_uart_devices[id]);
 }
-arch_initcall(bcm63xx_uart_register);
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index b12c4ac..96a2391 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -85,6 +85,7 @@ enum bcm63xx_regs_set {
 	RSET_TIMER,
 	RSET_WDT,
 	RSET_UART0,
+	RSET_UART1,
 	RSET_GPIO,
 	RSET_SPI,
 	RSET_UDC0,
@@ -123,6 +124,7 @@ enum bcm63xx_regs_set {
 #define BCM_6338_TIMER_BASE		(0xfffe0200)
 #define BCM_6338_WDT_BASE		(0xfffe021c)
 #define BCM_6338_UART0_BASE		(0xfffe0300)
+#define BCM_6338_UART1_BASE		(0xdeadbeef)
 #define BCM_6338_GPIO_BASE		(0xfffe0400)
 #define BCM_6338_SPI_BASE		(0xfffe0c00)
 #define BCM_6338_UDC0_BASE		(0xdeadbeef)
@@ -153,6 +155,7 @@ enum bcm63xx_regs_set {
 #define BCM_6345_TIMER_BASE		(0xfffe0200)
 #define BCM_6345_WDT_BASE		(0xfffe021c)
 #define BCM_6345_UART0_BASE		(0xfffe0300)
+#define BCM_6345_UART1_BASE		(0xdeadbeef)
 #define BCM_6345_GPIO_BASE		(0xfffe0400)
 #define BCM_6345_SPI_BASE		(0xdeadbeef)
 #define BCM_6345_UDC0_BASE		(0xdeadbeef)
@@ -182,6 +185,7 @@ enum bcm63xx_regs_set {
 #define BCM_6348_TIMER_BASE		(0xfffe0200)
 #define BCM_6348_WDT_BASE		(0xfffe021c)
 #define BCM_6348_UART0_BASE		(0xfffe0300)
+#define BCM_6348_UART1_BASE		(0xdeadbeef)
 #define BCM_6348_GPIO_BASE		(0xfffe0400)
 #define BCM_6348_SPI_BASE		(0xfffe0c00)
 #define BCM_6348_UDC0_BASE		(0xfffe1000)
@@ -208,6 +212,7 @@ enum bcm63xx_regs_set {
 #define BCM_6358_TIMER_BASE		(0xfffe0040)
 #define BCM_6358_WDT_BASE		(0xfffe005c)
 #define BCM_6358_UART0_BASE		(0xfffe0100)
+#define BCM_6358_UART1_BASE		(0xfffe0120)
 #define BCM_6358_GPIO_BASE		(0xfffe0080)
 #define BCM_6358_SPI_BASE		(0xdeadbeef)
 #define BCM_6358_UDC0_BASE		(0xfffe0800)
@@ -246,6 +251,8 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 		return BCM_6338_WDT_BASE;
 	case RSET_UART0:
 		return BCM_6338_UART0_BASE;
+	case RSET_UART1:
+		return BCM_6338_UART1_BASE;
 	case RSET_GPIO:
 		return BCM_6338_GPIO_BASE;
 	case RSET_SPI:
@@ -292,6 +299,8 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 		return BCM_6345_WDT_BASE;
 	case RSET_UART0:
 		return BCM_6345_UART0_BASE;
+	case RSET_UART1:
+		return BCM_6345_UART1_BASE;
 	case RSET_GPIO:
 		return BCM_6345_GPIO_BASE;
 	case RSET_SPI:
@@ -338,6 +347,8 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 		return BCM_6348_WDT_BASE;
 	case RSET_UART0:
 		return BCM_6348_UART0_BASE;
+	case RSET_UART1:
+		return BCM_6348_UART1_BASE;
 	case RSET_GPIO:
 		return BCM_6348_GPIO_BASE;
 	case RSET_SPI:
@@ -384,6 +395,8 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 		return BCM_6358_WDT_BASE;
 	case RSET_UART0:
 		return BCM_6358_UART0_BASE;
+	case RSET_UART1:
+		return BCM_6358_UART1_BASE;
 	case RSET_GPIO:
 		return BCM_6358_GPIO_BASE;
 	case RSET_SPI:
@@ -429,6 +442,7 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
 enum bcm63xx_irq {
 	IRQ_TIMER = 0,
 	IRQ_UART0,
+	IRQ_UART1,
 	IRQ_DSL,
 	IRQ_ENET0,
 	IRQ_ENET1,
@@ -510,6 +524,7 @@ enum bcm63xx_irq {
  */
 #define BCM_6358_TIMER_IRQ		(IRQ_INTERNAL_BASE + 0)
 #define BCM_6358_UART0_IRQ		(IRQ_INTERNAL_BASE + 2)
+#define BCM_6358_UART1_IRQ		(IRQ_INTERNAL_BASE + 3)
 #define BCM_6358_OHCI0_IRQ		(IRQ_INTERNAL_BASE + 5)
 #define BCM_6358_ENET1_IRQ		(IRQ_INTERNAL_BASE + 6)
 #define BCM_6358_ENET0_IRQ		(IRQ_INTERNAL_BASE + 8)
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
new file mode 100644
index 0000000..23c705b
--- /dev/null
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h
@@ -0,0 +1,6 @@
+#ifndef BCM63XX_DEV_UART_H_
+#define BCM63XX_DEV_UART_H_
+
+int bcm63xx_uart_register(unsigned int id);
+
+#endif /* BCM63XX_DEV_UART_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index 6479090..474daaa 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -45,6 +45,8 @@ struct board_info {
 	unsigned int	has_ohci0:1;
 	unsigned int	has_ehci0:1;
 	unsigned int	has_dsp:1;
+	unsigned int	has_uart0:1;
+	unsigned int	has_uart1:1;
 
 	/* ethernet config */
 	struct bcm63xx_enet_platform_data enet0;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
                   ` (3 preceding siblings ...)
  2010-01-30 17:34 ` [PATCH 4/7] MIPS: bcm63xx: add support for second uart Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-03-19 12:23   ` Ralf Baechle
  2010-01-30 17:34 ` [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall() Maxime Bizon
  2010-01-30 17:34 ` [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot Maxime Bizon
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

Fix typo: CONFIG_BCMCPU_IS_63xx does not exists,
CONFIG_BCM63XX_CPU_63xx is the valid config option.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 .../asm/mach-bcm63xx/cpu-feature-overrides.h       |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
index 71742ba..f453c01 100644
--- a/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-bcm63xx/cpu-feature-overrides.h
@@ -24,7 +24,7 @@
 #define cpu_has_smartmips		0
 #define cpu_has_vtag_icache		0
 
-#if !defined(BCMCPU_RUNTIME_DETECT) && (defined(CONFIG_BCMCPU_IS_6348) || defined(CONFIG_CPU_IS_6338) || defined(CONFIG_CPU_IS_BCM6345))
+#if !defined(BCMCPU_RUNTIME_DETECT) && (defined(CONFIG_BCM63XX_CPU_6348) || defined(CONFIG_BCM63XX_CPU_6345) || defined(CONFIG_BCM63XX_CPU_6338))
 #define cpu_has_dc_aliases		0
 #endif
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
                   ` (4 preceding siblings ...)
  2010-01-30 17:34 ` [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-03-02 13:38   ` Florian Fainelli
  2010-03-19 12:34   ` Ralf Baechle
  2010-01-30 17:34 ` [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot Maxime Bizon
  6 siblings, 2 replies; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

Some device registration (eg leds), expect subsystem initcall to be
run first, so move board device registration to device_initcall().

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
index d005659..04a3499 100644
--- a/arch/mips/bcm63xx/setup.c
+++ b/arch/mips/bcm63xx/setup.c
@@ -124,4 +124,4 @@ int __init bcm63xx_register_devices(void)
 	return board_register_devices();
 }
 
-arch_initcall(bcm63xx_register_devices);
+device_initcall(bcm63xx_register_devices);
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot.
  2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
                   ` (5 preceding siblings ...)
  2010-01-30 17:34 ` [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall() Maxime Bizon
@ 2010-01-30 17:34 ` Maxime Bizon
  2010-03-19 13:22   ` Ralf Baechle
  6 siblings, 1 reply; 18+ messages in thread
From: Maxime Bizon @ 2010-01-30 17:34 UTC (permalink / raw)
  To: linux-mips, ralf; +Cc: Maxime Bizon

To avoid glitch during gpio initialisation, fetch gpio output
registers values left by bootloader.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
---
 arch/mips/bcm63xx/gpio.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/mips/bcm63xx/gpio.c b/arch/mips/bcm63xx/gpio.c
index 3725345..315bc7f 100644
--- a/arch/mips/bcm63xx/gpio.c
+++ b/arch/mips/bcm63xx/gpio.c
@@ -125,6 +125,8 @@ static struct gpio_chip bcm63xx_gpio_chip = {
 
 int __init bcm63xx_gpio_init(void)
 {
+	gpio_out_low = bcm_gpio_readl(GPIO_DATA_LO_REG);
+	gpio_out_high = bcm_gpio_readl(GPIO_DATA_HI_REG);
 	bcm63xx_gpio_chip.ngpio = bcm63xx_gpio_count();
 	pr_info("registering %d GPIOs\n", bcm63xx_gpio_chip.ngpio);
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device.
  2010-01-30 17:34 ` [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device Maxime Bizon
@ 2010-01-31 13:13   ` Sergei Shtylyov
  0 siblings, 0 replies; 18+ messages in thread
From: Sergei Shtylyov @ 2010-01-31 13:13 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips, ralf

Hello.

Maxime Bizon wrote:

> The bcm63xx SOC has an integrated OHCI controller, this patch adds
> platform device registration and change board code to register ohci
> device when necessary.
>
> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
>   

[...]

> diff --git a/arch/mips/bcm63xx/dev-usb-ohci.c b/arch/mips/bcm63xx/dev-usb-ohci.c
> new file mode 100644
> index 0000000..f1fb442
> --- /dev/null
> +++ b/arch/mips/bcm63xx/dev-usb-ohci.c
> @@ -0,0 +1,49 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <bcm63xx_cpu.h>
> +#include <bcm63xx_dev_usb_ohci.h>
> +
> +static struct resource ohci_resources[] = {
> +	{
> +		/* start & end filled at runtime */
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		/* start filled at runtime */
> +		.flags		= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static u64 ohci_dmamask = ~(u32)0;
>   

   Should be DMA_BIT_MASK(32).

> +
> +static struct platform_device bcm63xx_ohci_device = {
> +	.name		= "bcm63xx_ohci",
> +	.id		= 0,
> +	.num_resources	= ARRAY_SIZE(ohci_resources),
> +	.resource	= ohci_resources,
> +	.dev		= {
> +		.dma_mask		= &ohci_dmamask,
> +		.coherent_dma_mask	= 0xffffffff,
>   

   Same here...

> +	},
> +};
> +
> +int __init bcm63xx_ohci_register(void)
> +{
> +	if (!BCMCPU_IS_6348() && !BCMCPU_IS_6358())
> +		return 0;
> +
> +	ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
> +	ohci_resources[0].end = ohci_resources[0].start;
> +	ohci_resources[0].end += RSET_OHCI_SIZE - 1;
>   

   Why not do it in a signle statement?

WBR, Sergei

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI controller device.
  2010-01-30 17:34 ` [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI " Maxime Bizon
@ 2010-01-31 13:16   ` Sergei Shtylyov
  0 siblings, 0 replies; 18+ messages in thread
From: Sergei Shtylyov @ 2010-01-31 13:16 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips, ralf

Hello.

Maxime Bizon wrote:

> The bcm63xx SOC has an integrated EHCI controller, this patch adds
> platform device registration and change board code to register
> EHCI device when necessary.
>
> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
>   

[...]

> diff --git a/arch/mips/bcm63xx/dev-usb-ehci.c b/arch/mips/bcm63xx/dev-usb-ehci.c
> new file mode 100644
> index 0000000..4bdd675
> --- /dev/null
> +++ b/arch/mips/bcm63xx/dev-usb-ehci.c
> @@ -0,0 +1,49 @@
> +/*
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2010 Maxime Bizon <mbizon@freebox.fr>
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <bcm63xx_cpu.h>
> +#include <bcm63xx_dev_usb_ehci.h>
> +
> +static struct resource ehci_resources[] = {
> +	{
> +		/* start & end filled at runtime */
> +		.flags		= IORESOURCE_MEM,
> +	},
> +	{
> +		/* start filled at runtime */
> +		.flags		= IORESOURCE_IRQ,
> +	},
> +};
> +
> +static u64 ehci_dmamask = ~(u32)0;
>   

   Should be DMA_BIT_MASK(32).

> +
> +static struct platform_device bcm63xx_ehci_device = {
> +	.name		= "bcm63xx_ehci",
> +	.id		= 0,
> +	.num_resources	= ARRAY_SIZE(ehci_resources),
> +	.resource	= ehci_resources,
> +	.dev		= {
> +		.dma_mask		= &ehci_dmamask,
> +		.coherent_dma_mask	= 0xffffffff,
>   

   Same here...

> +	},
> +};
> +
> +int __init bcm63xx_ehci_register(void)
> +{
> +	if (!BCMCPU_IS_6358())
> +		return 0;
> +
> +	ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
> +	ehci_resources[0].end = ehci_resources[0].start;
> +	ehci_resources[0].end += RSET_EHCI_SIZE - 1;
>   

   Why not do it in a single statement? Besides you could initialize the 
field with that, and then do

    ehci_resources[0].end += ehci_resources[0].start;

WBR, Sergei

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()
  2010-01-30 17:34 ` [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall() Maxime Bizon
@ 2010-03-02 13:38   ` Florian Fainelli
  2010-03-19 12:47     ` Ralf Baechle
  2010-03-19 12:34   ` Ralf Baechle
  1 sibling, 1 reply; 18+ messages in thread
From: Florian Fainelli @ 2010-03-02 13:38 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips, ralf

Hi Maxime,

On Saturday 30 January 2010 18:34:57 Maxime Bizon wrote:
> Some device registration (eg leds), expect subsystem initcall to be
> run first, so move board device registration to device_initcall().
> 
> Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
> ---
>  arch/mips/bcm63xx/setup.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/mips/bcm63xx/setup.c b/arch/mips/bcm63xx/setup.c
> index d005659..04a3499 100644
> --- a/arch/mips/bcm63xx/setup.c
> +++ b/arch/mips/bcm63xx/setup.c
> @@ -124,4 +124,4 @@ int __init bcm63xx_register_devices(void)
>  	return board_register_devices();
>  }
> 
> -arch_initcall(bcm63xx_register_devices);
> +device_initcall(bcm63xx_register_devices);

This breaks the fallback SPROM registration, that one needs to be set before
the PCI subsystem is intialized, otherwise b43 gets an empty WLAN MAC
address. This was the reason to move bcm63xx_register_devices to
the arch_initcall level in the first place.

Let's use the first stage board callback which also has to be called prior to
PCI initialization.

From: Florian Fainelli <ffainelli@freebox.fr>
Subject: [PATCH] bcm63xx: register SSB SPROM fallback in board's first stage callback

Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
diff --git a/arch/mips/bcm63xx/boards/board_bcm963xx.c b/arch/mips/bcm63xx/boards/board_bcm963xx.c
index 90faa37..f7e0be1 100644
--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
@@ -676,6 +676,17 @@ void __init board_prom_init(void)
 	}
 
 	bcm_gpio_writel(val, GPIO_MODE_REG);
+
+	/* Generate MAC address for WLAN and
+	 * register our SPROM */
+#ifdef CONFIG_SSB_PCIHOST
+	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
+		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
+		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
+			printk(KERN_ERR "failed to register fallback SPROM\n");
+	}
+#endif
 }
 
 /*
@@ -835,17 +846,6 @@ int __init board_register_devices(void)
 	if (board.has_dsp)
 		bcm63xx_dsp_register(&board.dsp);
 
-	/* Generate MAC address for WLAN and
-	 * register our SPROM */
-#ifdef CONFIG_SSB_PCIHOST
-	if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
-		memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
-		if (ssb_arch_set_fallback_sprom(&bcm63xx_sprom) < 0)
-			printk(KERN_ERR "failed to register fallback SPROM\n");
-	}
-#endif
-
 	/* read base address of boot chip select (0) */
 	if (BCMCPU_IS_6345())
 		val = 0x1fc00000;

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration.
  2010-01-30 17:34 ` [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration Maxime Bizon
@ 2010-03-19 12:00   ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:00 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Sat, Jan 30, 2010 at 06:34:54PM +0100, Maxime Bizon wrote:

> bcm63xx_gpio_init is already called from prom_init to allow board to
> use them early, so we can remove the unneeded arch_initcall.

Applied, thanks.

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 4/7] MIPS: bcm63xx: add support for second uart.
  2010-01-30 17:34 ` [PATCH 4/7] MIPS: bcm63xx: add support for second uart Maxime Bizon
@ 2010-03-19 12:19   ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:19 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Sat, Jan 30, 2010 at 06:34:55PM +0100, Maxime Bizon wrote:

> The bcm63xx SOC has two uarts, some boards use the second one for
> bluetooth.  This patch changes platform device registration code to
> handle this. Changes to the uart driver are in a separate patch.

Applied.  Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file.
  2010-01-30 17:34 ` [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file Maxime Bizon
@ 2010-03-19 12:23   ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:23 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Sat, Jan 30, 2010 at 06:34:56PM +0100, Maxime Bizon wrote:

> Fix typo: CONFIG_BCMCPU_IS_63xx does not exists,
> CONFIG_BCM63XX_CPU_63xx is the valid config option.

Thanks, applied.

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()
  2010-01-30 17:34 ` [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall() Maxime Bizon
  2010-03-02 13:38   ` Florian Fainelli
@ 2010-03-19 12:34   ` Ralf Baechle
  2010-03-19 12:44     ` Ralf Baechle
  1 sibling, 1 reply; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:34 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Sat, Jan 30, 2010 at 06:34:57PM +0100, Maxime Bizon wrote:

> Some device registration (eg leds), expect subsystem initcall to be
> run first, so move board device registration to device_initcall().

Applied.  Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()
  2010-03-19 12:34   ` Ralf Baechle
@ 2010-03-19 12:44     ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:44 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Fri, Mar 19, 2010 at 01:34:31PM +0100, Ralf Baechle wrote:

> > Some device registration (eg leds), expect subsystem initcall to be
> > run first, so move board device registration to device_initcall().
> 
> Applied.  Thanks,

And pulled again.  Florian posted his NACK together with a new patch
which get sorted separately by patchworks so I didn't see the NACK right
away.

To avoid that sort of things do me a favor, post comments to an old
patch and submissions of new patches in separate emails.  Thanks.

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall()
  2010-03-02 13:38   ` Florian Fainelli
@ 2010-03-19 12:47     ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 12:47 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Maxime Bizon, linux-mips

On Tue, Mar 02, 2010 at 02:38:47PM +0100, Florian Fainelli wrote:

And applied this one.  Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot.
  2010-01-30 17:34 ` [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot Maxime Bizon
@ 2010-03-19 13:22   ` Ralf Baechle
  0 siblings, 0 replies; 18+ messages in thread
From: Ralf Baechle @ 2010-03-19 13:22 UTC (permalink / raw)
  To: Maxime Bizon; +Cc: linux-mips

On Sat, Jan 30, 2010 at 06:34:58PM +0100, Maxime Bizon wrote:

> To avoid glitch during gpio initialisation, fetch gpio output
> registers values left by bootloader.

Applied as well.

Thanks,

  Ralf

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-03-19 13:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-30 17:34 bcm63xx updates for 2.6.34 Maxime Bizon
2010-01-30 17:34 ` [PATCH 1/7] MIPS: bcm63xx: register integrated OHCI controller device Maxime Bizon
2010-01-31 13:13   ` Sergei Shtylyov
2010-01-30 17:34 ` [PATCH 2/7] MIPS: bcm63xx: register integrated EHCI " Maxime Bizon
2010-01-31 13:16   ` Sergei Shtylyov
2010-01-30 17:34 ` [PATCH 3/7] MIPS: bcm63xx: fix double gpio registration Maxime Bizon
2010-03-19 12:00   ` Ralf Baechle
2010-01-30 17:34 ` [PATCH 4/7] MIPS: bcm63xx: add support for second uart Maxime Bizon
2010-03-19 12:19   ` Ralf Baechle
2010-01-30 17:34 ` [PATCH 5/7] MIPS: bcm63xx: fix typo in cpu-feature-overrides file Maxime Bizon
2010-03-19 12:23   ` Ralf Baechle
2010-01-30 17:34 ` [PATCH 6/7] MIPS: bcm63xx: call board_register_device from device_initcall() Maxime Bizon
2010-03-02 13:38   ` Florian Fainelli
2010-03-19 12:47     ` Ralf Baechle
2010-03-19 12:34   ` Ralf Baechle
2010-03-19 12:44     ` Ralf Baechle
2010-01-30 17:34 ` [PATCH 7/7] MIPS: bcm63xx: initialize gpio_out_low & out_high to current value at boot Maxime Bizon
2010-03-19 13:22   ` Ralf Baechle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.