Support BCM23550 SoC
Subsystems (6)
v2 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.
Changes since v1
- Moved chosen node from dtsi to dts file
- Added stdout-path property to chosen node in dts
- Removed "-cpu-method" from CPU enable method name
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 | 80 ++++ arch/arm/boot/dts/bcm23550.dtsi | 415 +++++++++++++++++++++ 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, 732 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 v2 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
Re: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Le 11/05/2016 14:36, Chris Brand a ?crit :
Quoted 4 lines
This driver supports reset on both BCM21664 and BCM23550. Code is being moved from
arch/arm/mach-bcm/board_bcm21664.cSigned-off-by Chris Brand <[email protected]>
Sebastian, Dmitry, I know we are in the merge window, let me know if you would want me to take this patch and the 5 others in the next arm-soc pull request, or if you prefer to take this one in your own tree.
Thanks!
Signature · 1 line
Florian
Re: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Hi Florian,
Quoted 9 lines · Florian Fainelli
Le 11/05/2016 14:36, Chris Brand a ?crit :
Quoted 4 lines
This driver supports reset on both BCM21664 and BCM23550. Code is being moved from
arch/arm/mach-bcm/board_bcm21664.cSigned-off-by Chris Brand <[email protected]>Sebastian, Dmitry, I know we are in the merge window, let me know if you would want me to take this patch and the 5 others in the next arm-soc pull request, or if you prefer to take this one in your own tree.
Feel free to queue it via arm-soc with
If I didn't overlook it, it's missing DT documentation, though.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160603/d5acb22a/attachment.sig>
Re: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Quoted 5 lines · Sebastian Reichel
Feel free to queue it via arm-soc with
If I didn't overlook it, it's missing DT documentation, though.
Thanks, Sebastian. Because this is effectively a move of code from arch/arm rather than new code, there's already dt documentation in Documentation/devicetree/bindings/reset/brcm,bcm21664-resetmgr.txt
Chris
Sebastian Reichel
maintainerRe: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Hi,
Quoted 10 lines · Chris Brand
Quoted 5 lines · Sebastian Reichel
Feel free to queue it via arm-soc with
If I didn't overlook it, it's missing DT documentation, though.
Thanks, Sebastian. Because this is effectively a move of code from
arch/armrather than new code, there's already dt documentation inDocumentation/devicetree/bindings/reset/brcm,bcm21664-resetmgr.txt
Ok. That directory is usually used for periphal reset controller. Board/System reset controllers are usually documented in .../bindings/power/reset (following kernel strucuture [drivers/reset and drivers/power/reset]).
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160607/c9f3bfd4/attachment-0001.sig>
Re: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Quoted 14 lines · Sebastian Reichel
Hi,
Quoted 10 lines · Chris Brand
Quoted 5 lines · Sebastian Reichel
Feel free to queue it via arm-soc with
If I didn't overlook it, it's missing DT documentation, though.
Thanks, Sebastian. Because this is effectively a move of code from
arch/armrather than new code, there's already dt documentation inDocumentation/devicetree/bindings/reset/brcm,bcm21664-resetmgr.txt
Quoted 6 lines
Ok. That directory is usually used for periphal reset controller. Board/System reset controllers are usually documented in .../bindings/power/reset (following kernel strucuture [
drivers/resetanddrivers/power/reset]).-- Sebastian
Would you like me to send a separate patch to move that file ?
Chris
Sebastian Reichel
maintainerRe: [PATCH v2 1/6] power: Introduce Broadcom kona reset driver
Hi,
Quoted 15 lines · Chris Brand
Quoted 14 lines · Sebastian Reichel
Hi,
Quoted 10 lines · Chris Brand
Quoted 5 lines · Sebastian Reichel
Feel free to queue it via arm-soc with
If I didn't overlook it, it's missing DT documentation, though.
Thanks, Sebastian. Because this is effectively a move of code from
arch/armrather than new code, there's already dt documentation inDocumentation/devicetree/bindings/reset/brcm,bcm21664-resetmgr.txt
Quoted 8 lines
Quoted 6 lines
Ok. That directory is usually used for periphal reset controller. Board/System reset controllers are usually documented in .../bindings/power/reset (following kernel strucuture [
drivers/resetanddrivers/power/reset]).-- Sebastian
Would you like me to send a separate patch to move that file ?
That would nice, thanks!
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160608/6c22f817/attachment.sig>
PATCH v2 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 v2 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"; + - 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"; + 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" "brcm,bcm-nsp-smp" "brcm,brahma-b15" "marvell,armada-375-smp"
Signature · 1 line
1.9.1
Re: [PATCH v2 3/6] docs: Document BCM23550 bindings
Quoted 6 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.
Quoted 8 lines
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.txt
PATCH v2 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 v2 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" , + &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 v2 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 | 80 +++++++ arch/arm/boot/dts/bcm23550.dtsi | 415 +++++++++++++++++++++++++++++++++ 3 files changed, 497 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 +80 -0
80 lines not on this page · raw message
arch/arm/boot/dts/bcm23550.dtsi new file +415 -0
415 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 10 lines · Chris Brand
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.
Quoted 4 lines
Changes since v1
- Moved chosen node from dtsi to dts file
- Added stdout-path property to chosen node in dts
- Removed "-cpu-method" from CPU enable method name
Series applied, patch 1 applied to drivers/next, patches 2, 4 and 5 applied to soc/next, and patches 2 and 6 applied to devicetree/next, thanks everyone!
Signature · 1 line
Florian