Support BCM23550 SoC
Subsystems (6)
cover Support BCM23550 SoC
This patchset introduces support for the BCM23550 SoC and the Broadcom Sparrow development board.
It modifies the BCM21664 support slightly to share code between the two.
With this patchset, a multi-v7 kernel brings up all 4 CPUs on a Sparrow board, and gets to a shell prompt. Many of the IP blocks that are shared with BCM28155 and BCM21664 are also functional, although not all have been thoroughly tested.
Chris Brand (6):
power: Introduce Broadcom kona reset driver
arm: bcm21664: Remove reset code
docs: Document BCM23550 bindings
arm: Add support for Broadcom BCM23550 SoC
arm: BCM23550 SMP support
arm: dt: bcm23550: Add device tree files
.../bindings/arm/bcm/brcm,bcm23550-cpu-method.txt | 36 ++ .../devicetree/bindings/arm/bcm/brcm,bcm23550.txt | 15 + Documentation/devicetree/bindings/arm/cpus.txt | 1 + arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/bcm23550-sparrow.dts | 75 ++++ arch/arm/boot/dts/bcm23550.dtsi | 419 +++++++++++++++++++++ arch/arm/mach-bcm/Kconfig | 12 +- arch/arm/mach-bcm/Makefile | 5 +- arch/arm/mach-bcm/board_bcm21664.c | 42 --- arch/arm/mach-bcm/board_bcm23550.c | 25 ++ arch/arm/mach-bcm/platsmp.c | 58 +++ drivers/power/reset/Kconfig | 10 + drivers/power/reset/Makefile | 1 + drivers/power/reset/brcm-kona-reset.c | 75 ++++ 14 files changed, 731 insertions(+), 46 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550.txt create mode 100644 arch/arm/boot/dts/bcm23550-sparrow.dts create mode 100644 arch/arm/boot/dts/bcm23550.dtsi create mode 100644 arch/arm/mach-bcm/board_bcm23550.c create mode 100644 drivers/power/reset/brcm-kona-reset.c
Signature · 1 line
1.9.1
PATCH 1/6 power: Introduce Broadcom kona reset driver
This driver supports reset on both BCM21664 and BCM23550. Code is being moved from arch/arm/mach-bcm/board_bcm21664.c
--- drivers/power/reset/Kconfig | 10 +++++ drivers/power/reset/Makefile | 1 + drivers/power/reset/brcm-kona-reset.c | 75 +++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 drivers/power/reset/brcm-kona-reset.c
drivers/power/reset/Kconfig +10 -0
@@ -38,6 +38,16 @@ config POWER_RESET_AXXIA Say Y if you have an Axxia family SoC. +config POWER_RESET_BRCMKONA + bool "Broadcom Kona reset driver" + depends on ARM || COMPILE_TEST + default ARCH_BCM_MOBILE + help + This driver provides restart support for Broadcom Kona chips. + + Say Y here if you have a Broadcom Kona-based board and you wish + to have restart support. + config POWER_RESET_BRCMSTB bool "Broadcom STB reset driver" depends on ARM || MIPS || COMPILE_TEST
drivers/power/reset/Makefile +1 -0
@@ -2,6 +2,7 @@ obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_POWEROFF) += at91-poweroff.o obj-$(CONFIG_POWER_RESET_AT91_RESET) += at91-reset.o obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o +obj-$(CONFIG_POWER_RESET_BRCMKONA) += brcm-kona-reset.o obj-$(CONFIG_POWER_RESET_BRCMSTB) += brcmstb-reboot.o obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o obj-$(CONFIG_POWER_RESET_GPIO_RESTART) += gpio-restart.o
drivers/power/reset/brcm-kona-reset.c new file +75 -0
75 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 2/6 arm: bcm21664: Remove reset code
In reply to Chris BrandThe kona reset driver now provides this functionality.
--- arch/arm/mach-bcm/board_bcm21664.c | 42 -------------------------------------- 1 file changed, 42 deletions(-)
arch/arm/mach-bcm/board_bcm21664.c +0 -42
@@ -11,53 +11,12 @@* GNU General Public License for more details. */ -#include <linux/of_address.h> #include <linux/of_platform.h> -#include <linux/io.h> #include <asm/mach/arch.h> #include "kona_l2_cache.h" -#define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr" - -#define RSTMGR_REG_WR_ACCESS_OFFSET 0 -#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4 - -#define RSTMGR_WR_PASSWORD 0xa5a5 -#define RSTMGR_WR_PASSWORD_SHIFT 8 -#define RSTMGR_WR_ACCESS_ENABLE 1 - -static void bcm21664_restart (enum reboot_mode mode,const char *cmd) -{ -void __iomem *base; -struct device_node *resetmgr; - - resetmgr =of_find_compatible_node (NULL ,NULL ,RSTMGR_DT_STRING ); -if (!resetmgr) { -pr_emerg ("Couldn't find " RSTMGR_DT_STRING "\n" ); -return ; - } - base =of_iomap (resetmgr,0 ); -if (!base) { -pr_emerg ("Couldn't map " RSTMGR_DT_STRING "\n" ); -return ; - } - -/* -* A soft reset is triggered by writing a 0 to bit 0 of the soft reset -* register. To write to that register we must first write the password -* and the enable bit in the write access enable register. -*/ -writel ((RSTMGR_WR_PASSWORD <<RSTMGR_WR_PASSWORD_SHIFT ) | -RSTMGR_WR_ACCESS_ENABLE , - base +RSTMGR_REG_WR_ACCESS_OFFSET ); -writel (0 , base +RSTMGR_REG_CHIP_SOFT_RST_OFFSET ); - -/* Wait for reset */ -while (1 ); -} -static void __init bcm21664_init (void ) {of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL );
@@ -71,6 +30,5 @@ static const char * const bcm21664_dt_compat[] = {DT_MACHINE_START (BCM21664_DT ,"BCM21664 Broadcom Application Processor" ) .init_machine = bcm21664_init, - .restart = bcm21664_restart, .dt_compat = bcm21664_dt_compat,MACHINE_END
Signature · 1 line
1.9.1
PATCH 3/6 docs: Document BCM23550 bindings
In reply to Chris BrandAdd binding document for Broadcom BCM23550 SoC.
BCM23550 has a Cluster Dormant Control IP block that holds cores in an idle state. Introduce a new CPU enable method in which the CDC is accessed to bring the core online.
--- .../bindings/arm/bcm/brcm,bcm23550-cpu-method.txt | 36 ++++++++++++++++++++++ .../devicetree/bindings/arm/bcm/brcm,bcm23550.txt | 15 +++++++++ Documentation/devicetree/bindings/arm/cpus.txt | 1 + 3 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550.txt
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt new file +36 -0
@@ -0,0 +1,36 @@ +Broadcom Kona Family CPU Enable Method +-------------------------------------- +This binding defines the enable method used for starting secondary +CPUs in the following Broadcom SoCs: + BCM23550 + +The enable method is specified by defining the following required +properties in the "cpu" device tree node: + - enable-method = "brcm,bcm23550-cpu-method"; + - secondary-boot-reg = <...>; + +The secondary-boot-reg property is a u32 value that specifies the +physical address of the register used to request the ROM holding pen +code release a secondary CPU. The value written to the register is +formed by encoding the target CPU id into the low bits of the +physical start address it should jump to. + +Example: + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <1>; + enable-method = "brcm,bcm23550-cpu-method"; + secondary-boot-reg = <0x3500417c>; + }; + };
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550.txt new file +15 -0
@@ -0,0 +1,15 @@ +Broadcom BCM23550 device tree bindings +-------------------------------------- + +This document describes the device tree bindings for boards with the BCM23550 +SoC. + +Required root node property: + - compatible: brcm,bcm23550 + +Example: + / { + model = "BCM23550 SoC"; + compatible = "brcm,bcm23550"; + [...] + }
Documentation/devicetree/bindings/arm/cpus.txt +1 -0
@@ -194,6 +194,7 @@ nodes to be present and contain the properties described below. "allwinner,sun8i-a23" "arm,psci" "arm,realview-smp" + "brcm,bcm23550-cpu-method" "brcm,bcm-nsp-smp" "brcm,brahma-b15" "marvell,armada-375-smp"
Signature · 1 line
1.9.1
Rob Herring
maintainerRe: [PATCH 3/6] docs: Document BCM23550 bindings
Quoted 21 lines · Chris Brand
Add binding document for Broadcom BCM23550 SoC.
BCM23550 has a Cluster Dormant Control IP block that holds cores in an idle state. Introduce a new CPU enable method in which the CDC is accessed to bring the core online.
Signed-off-by Chris Brand <[email protected]>--- .../bindings/arm/bcm/brcm,bcm23550-cpu-method.txt | 36 ++++++++++++++++++++++ .../devicetree/bindings/arm/bcm/brcm,bcm23550.txt | 15 +++++++++ Documentation/devicetree/bindings/arm/cpus.txt | 1 + 3 files changed, 52 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550.txtDocumentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt new file +0
-0
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt line 9
Quoted 9 lines
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt new file +9
-0@@ -0,0 +1,36 @@ +Broadcom Kona Family CPU Enable Method +-------------------------------------- +This binding defines the enable method used for starting secondary +CPUs in the following Broadcom SoCs: + BCM23550 + +The enable method is specified by defining the following required +properties in the "cpu" device tree node: + - enable-method = "brcm,bcm23550-cpu-method";
"-cpu-method" is a bit redundant. brcm,bc23550 is probably sufficient.
Quoted 7 lines
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt new file +7
-0+ - secondary-boot-reg = <...>; + +The secondary-boot-reg property is a u32 value that specifies the +physical address of the register used to request the ROM holding pen +code release a secondary CPU. The value written to the register is +formed by encoding the target CPU id into the low bits of the +physical start address it should jump to.
Re: [PATCH 3/6] docs: Document BCM23550 bindings
Quoted 2 lines · Rob Herring
Quoted 1 line · Chris Brand
Add binding document for Broadcom BCM23550 SoC.
[...]
Quoted 5 lines
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt line 9
Quoted 3 lines
Documentation/devicetree/bindings/arm/bcm/brcm,bcm23550-cpu-method.txt new file +3
-0+The enable method is specified by defining the following required +properties in the "cpu" device tree node: + - enable-method = "brcm,bcm23550-cpu-method";"-cpu-method" is a bit redundant. brcm,bc23550 is probably sufficient.
Fair enough. Thanks, Rob!
Chris
PATCH 4/6 arm: Add support for Broadcom BCM23550 SoC
In reply to Chris BrandBCM23550 is a quad-A7 SoC used on the Broadcom "Sparrow" board. It shares many IP blocks with other Broadcom Kona chips.
--- arch/arm/mach-bcm/Kconfig | 12 ++++++++++-- arch/arm/mach-bcm/Makefile | 5 ++++- arch/arm/mach-bcm/board_bcm23550.c | 25 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-bcm/board_bcm23550.c
arch/arm/mach-bcm/Kconfig +10 -2
@@ -111,9 +111,17 @@ config ARCH_BCM_21664 Enable support for the BCM21664 family, which includes BCM21663 and BCM21664 variants. +config ARCH_BCM_23550 + bool "Broadcom BCM23550 SoC" + depends on ARCH_MULTI_V7 + select ARCH_BCM_MOBILE + select HAVE_SMP + help + Enable support for the BCM23550. + config ARCH_BCM_MOBILE_L2_CACHE bool "Broadcom mobile SoC level 2 cache support" - depends on ARCH_BCM_MOBILE + depends on ARCH_BCM_281XX || ARCH_BCM_21664 default y select CACHE_L2X0 select ARCH_BCM_MOBILE_SMC
@@ -128,7 +136,7 @@ config ARCH_BCM_MOBILE_SMP select HAVE_ARM_SCU select ARM_ERRATA_764369 help - SMP support for the BCM281XX and BCM21664 SoC families. + SMP support for the BCM281XX, BCM21664 and BCM23550 SoC families. Provided as an option so SMP support for SoCs of this type can be disabled for an SMP-enabled kernel.
arch/arm/mach-bcm/Makefile +4 -1
@@ -26,7 +26,10 @@ obj-$(CONFIG_ARCH_BCM_281XX) += board_bcm281xx.o # BCM21664 obj-$(CONFIG_ARCH_BCM_21664) += board_bcm21664.o -# BCM281XX and BCM21664 SMP support +# BCM23550 +obj-$(CONFIG_ARCH_BCM_23550) += board_bcm23550.o + +# BCM281XX, BCM21664 and BCM23550 SMP support obj-$(CONFIG_ARCH_BCM_MOBILE_SMP) += platsmp.o # BCM281XX and BCM21664 L2 cache control
arch/arm/mach-bcm/board_bcm23550.c new file +25 -0
@@ -0,0 +1,25 @@ +/* +* Copyright (C) 2016 Broadcom +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation version 2. +* +* This program is distributed "as is" WITHOUT ANY WARRANTY of any +* kind, whether express or implied; without even the implied warranty +* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#include <linux/of_platform.h> + +#include <asm/mach/arch.h> + +static const char *const bcm23550_dt_compat[] = { +"brcm,bcm23550" , +NULL , +}; + +DT_MACHINE_START (BCM23550_DT ,"BCM23550 Broadcom Application Processor" ) + .dt_compat = bcm23550_dt_compat, +MACHINE_END
Signature · 1 line
1.9.1
PATCH 5/6 arm: BCM23550 SMP support
In reply to Chris BrandBCM23550 has a Cluster Dormant Control IP block that holds cores in an idle state. Support a new CPU enable method in which the CDC is accessed to bring the core online.
--- arch/arm/mach-bcm/platsmp.c | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
arch/arm/mach-bcm/platsmp.c +58 -0
@@ -19,6 +19,7 @@#include <linux/io.h> #include <linux/jiffies.h> #include <linux/of.h> +#include <linux/of_address.h> #include <linux/sched.h> #include <linux/smp.h>
@@ -255,6 +256,57 @@ static int kona_boot_secondary(unsigned int cpu, struct task_struct *idle)return -ENXIO ; } +/* Cluster Dormant Control command to bring CPU into a running state */ +#define CDC_CMD 6 +#define CDC_CMD_OFFSET 0 +#define CDC_CMD_REG (cpu) (CDC_CMD_OFFSET + 4*(cpu)) + +/* +* BCM23550 has a Cluster Dormant Control block that keeps the core in +* idle state. A command needs to be sent to the block to bring the CPU +* into running state. +*/ +static int bcm23550_boot_secondary (unsigned int cpu,struct task_struct *idle) +{ +void __iomem *cdc_base; +struct device_node *dn; +char *name; +int ret; + +/* Make sure a CDC node exists before booting the +* secondary core. +*/ + name ="brcm,bcm23550-cdc" ; + dn =of_find_compatible_node (NULL ,NULL , name); +if (!dn) { +pr_err ("unable to find cdc node\n" ); +return -ENODEV ; + } + + cdc_base =of_iomap (dn,0 ); +of_node_put (dn); + +if (!cdc_base) { +pr_err ("unable to remap cdc base register\n" ); +return -ENOMEM ; + } + +/* Boot the secondary core */ + ret =kona_boot_secondary (cpu, idle); +if (ret) + goto out; + +/* Bring this CPU to RUN state so that nIRQ nFIQ +* signals are unblocked. +*/ +writel_relaxed (CDC_CMD , cdc_base +CDC_CMD_REG (cpu)); + +out: +iounmap (cdc_base); + +return ret; +} +static int nsp_boot_secondary (unsigned int cpu,struct task_struct *idle) {int ret;
@@ -283,6 +335,12 @@ static const struct smp_operations bcm_smp_ops __initconst = {CPU_METHOD_OF_DECLARE (bcm_smp_bcm281xx,"brcm,bcm11351-cpu-method" , &bcm_smp_ops); +static const struct smp_operations bcm23550_smp_ops__initconst = { + .smp_boot_secondary = bcm23550_boot_secondary, +}; +CPU_METHOD_OF_DECLARE (bcm_smp_bcm23550,"brcm,bcm23550-cpu-method" , + &bcm23550_smp_ops); +static const struct smp_operations nsp_smp_ops__initconst = { .smp_prepare_cpus = bcm_smp_prepare_cpus, .smp_boot_secondary = nsp_boot_secondary,
Signature · 1 line
1.9.1
PATCH 6/6 arm: dt: bcm23550: Add device tree files
In reply to Chris BrandAdd device tree files for the Broadcom BCM23550 SoC and the Broadcom Sparrow board.
--- arch/arm/boot/dts/Makefile | 3 +- arch/arm/boot/dts/bcm23550-sparrow.dts | 75 ++++++ arch/arm/boot/dts/bcm23550.dtsi | 419 +++++++++++++++++++++++++++++++++ 3 files changed, 496 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm23550-sparrow.dts create mode 100644 arch/arm/boot/dts/bcm23550.dtsi
arch/arm/boot/dts/Makefile +2 -1
@@ -95,7 +95,8 @@ dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \ bcm958305k.dtb dtb-$(CONFIG_ARCH_BCM_MOBILE) += \ bcm28155-ap.dtb \ - bcm21664-garnet.dtb + bcm21664-garnet.dtb \ + bcm23550-sparrow.dtb dtb-$(CONFIG_ARCH_BCM_NSP) += \ bcm958625k.dtb dtb-$(CONFIG_ARCH_BERLIN) += \
arch/arm/boot/dts/bcm23550-sparrow.dts new file +75 -0
75 lines not on this page · raw message
arch/arm/boot/dts/bcm23550.dtsi new file +419 -0
419 lines not on this page · raw message
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerRe: [PATCH 6/6] arm: dt: bcm23550: Add device tree files
arch/arm/boot/dts/bcm23550.dtsi line 49
Quoted 6 lines · On Thursday 05 May 2016 13:48:54 Chris Brand wrote:
arch/arm/boot/dts/bcm23550.dtsi new file +5
-0+ + chosen { + bootargs = "console=ttyS0,115200n8"; + }; +
Can you move this into the .dts file, and add a stdout-path property to make earlycon work?
Arnd
Re: [PATCH 6/6] arm: dt: bcm23550: Add device tree files
Quoted 11 lines · Arnd Bergmann
arch/arm/boot/dts/bcm23550.dtsi line 49
Quoted 6 lines · On Thursday 05 May 2016 13:48:54 Chris Brand wrote:
arch/arm/boot/dts/bcm23550.dtsi new file +5
-0+ + chosen { + bootargs = "console=ttyS0,115200n8"; + }; +Can you move this into the .dts file, and add a stdout-path property to make earlycon work?
Quoted 1 line
Arnd
Will do. Thanks, Arnd.
Chris
Arnd Bergmann
maintainerQuoted 9 lines · On Thursday 05 May 2016 13:48:48 Chris Brand wrote:
This patchset introduces support for the BCM23550 SoC and the Broadcom Sparrow development board.
It modifies the BCM21664 support slightly to share code between the two.
With this patchset, a multi-v7 kernel brings up all 4 CPUs on a Sparrow board, and gets to a shell prompt. Many of the IP blocks that are shared with BCM28155 and BCM21664 are also functional, although not all have been thoroughly tested.
Looks really nice overall, I only found one tiny detail I commented on for patch 6.
I'm glad to see work on the old chips resume, are you working on new code for it as well, or just upstreaming the patches that were already done in the past?
Arnd
On Thu, May 5, 2016 at 2:09 PM, Arnd Bergmann <[email protected]> wrote:
[...]
Quoted 2 lines
Looks really nice overall, I only found one tiny detail I commented on for patch 6.
Thanks!
Quoted 3 lines
I'm glad to see work on the old chips resume, are you working on new code for it as well, or just upstreaming the patches that were already done in the past?
This is new work. It was actually a good testament to the value of upstreaming that it was so easy to bring up a 4.6 kernel on this chip.
Chris