ARM: brcmstb: Bus Interface Unit support
Subsystems (5)
cover ARM: brcmstb: Bus Interface Unit support
Hi all,
This patch series adds support for early boot time Bus Interface Unit control register setup which is required to occur before SMP is brought-up, but needs to remap registers, so init_irq() is chosen for that.
This builds on top of the 'soc/next' branch at github.com/Broadcom/stblinux
Thanks!
Florian Fainelli (3):
Documentation: bindings: brcmstb: Document write-pairing
soc: brcmstb: Add Bus Interface Unit control setup
ARM: brcmstb: Setup BIU control registers during boot
.../devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 15 +++ arch/arm/mach-bcm/brcmstb.c | 9 ++ drivers/soc/brcmstb/Makefile | 2 +- drivers/soc/brcmstb/biuctrl.c | 117 +++++++++++++++++++++ include/linux/soc/brcmstb/brcmstb.h | 10 ++ 5 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/brcmstb/biuctrl.c create mode 100644 include/linux/soc/brcmstb/brcmstb.h
Signature · 1 line
2.1.0
PATCH 1/3 Documentation: bindings: brcmstb: Document write-pairing
Document the hif-cpubiuctrl node a bit more, and add a documentation entry for the optional "brcm,write-pairing" property.
--- .../devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +15 -0
@@ -20,6 +20,20 @@ system control is required: - compatible: "brcm,bcm<chip_id>-hif-cpubiuctrl", "syscon" - compatible: "brcm,bcm<chip_id>-hif-continuation", "syscon" +hif-cpubiuctrl node +------------------- + +Required properties: + + - compatible + The string should be "brcm.bcm7445-hif-cpubiuctrl", "syscon" + +Optional properties: + + - brcm,write-pairing: + Boolean property, which when present indicatse that the chip + supports write-pairing. + example: rdb { #address-cells = <1>;
@@ -35,6 +49,7 @@ example: hif_cpubiuctrl: syscon at 3e2400 { compatible = "brcm,bcm7445-hif-cpubiuctrl", "syscon"; reg = <0x3e2400 0x5b4>; + brcm,write-pairing; }; hif_continuation: syscon at 452000 {
Signature · 1 line
2.1.0
Rob Herring
maintainerPATCH 1/3 Documentation: bindings: brcmstb: Document write-pairing
Quoted 13 lines · Florian Fainelli
Document the hif-cpubiuctrl node a bit more, and add a documentation entry for the optional "brcm,write-pairing" property.
Signed-off-by Florian Fainelli <[email protected]>--- .../devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+)Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +0
-0
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 20
Quoted 1 line
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +0
-0@@ -20,6 +20,20 @@ system control is required: - compatible: "brcm,bcm<chip_id>-hif-cpubiuctrl", "syscon"
This has multiple chips allowed, but...
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 24
Quoted 4 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +2
-0- compatible: "brcm,bcm<chip_id>-hif-continuation", "syscon" +hif-cpubiuctrl node +-------------------
Perhaps it is outside this context, but a description of the block would be nice.
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 29
Quoted 5 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5
-0+ +Required properties: + + - compatible + The string should be "brcm.bcm7445-hif-cpubiuctrl", "syscon"
This is just one.
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 34
Quoted 5 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5
-0+ +Optional properties: + + - brcm,write-pairing: + Boolean property, which when present indicatse that the chip
s/indicatse/indicates/
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 35
Quoted 1 line
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +1
-0+ supports write-pairing.
What is write pairing? Please give brief description.
Quoted 13 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +2
-0+ example: rdb { #address-cells = <1>;@@ -35,6 +49,7 @@ example: hif_cpubiuctrl: syscon at 3e2400 { compatible = "brcm,bcm7445-hif-cpubiuctrl", "syscon"; reg = <0x3e2400 0x5b4>; + brcm,write-pairing; }; hif_continuation: syscon at 452000 {
PATCH 1/3 Documentation: bindings: brcmstb: Document write-pairing
Quoted 18 lines · Rob Herring
Quoted 13 lines · Florian Fainelli
Document the hif-cpubiuctrl node a bit more, and add a documentation entry for the optional "brcm,write-pairing" property.
Signed-off-by Florian Fainelli <[email protected]>--- .../devicetree/bindings/arm/bcm/brcm,brcmstb.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+)Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +0
-0Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 20
Quoted 1 line
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +0
-0@@ -20,6 +20,20 @@ system control is required: - compatible: "brcm,bcm<chip_id>-hif-cpubiuctrl", "syscon"This has multiple chips allowed, but...
Quoted 7 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 24
Quoted 4 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +2
-0- compatible: "brcm,bcm<chip_id>-hif-continuation", "syscon" +hif-cpubiuctrl node +-------------------Perhaps it is outside this context, but a description of the block would be nice.
Sure.
Quoted 8 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 29
Quoted 6 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5
-0+ +Required properties: + + - compatible + The string should be "brcm.bcm7445-hif-cpubiuctrl", "syscon"This is just one.
Right, will fix that.
Quoted 9 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 34
Quoted 6 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +5
-0+ +Optional properties: + + - brcm,write-pairing: + Boolean property, which when present indicatse that the chips/indicatse/indicates/
Quoted 3 lines
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt system control is required: · line 35
Quoted 1 line
Documentation/devicetree/bindings/arm/bcm/brcm,brcmstb.txt +1
-0+ supports write-pairing.What is write pairing? Please give brief description.
I will provide an explanation in v2 for what that is.
Signature · 1 line
Florian
PATCH 2/3 soc: brcmstb: Add Bus Interface Unit control setup
In reply to Florian FainelliBroadcom STB SoCs (brcmstb) require an early setup of their Bus Interface Unit control register, this needs to happen before SMP is brought up because it affects how the CPU complex will be interfaced to the memory controller.
Add support code which properly initializes the BIU registers based on whether "brcm,write-pairing" is present in Device Tree, and take care of saving and restoring credit register settings during system-wide suspend/resume operations.
--- drivers/soc/brcmstb/Makefile | 2 +- drivers/soc/brcmstb/biuctrl.c | 117 ++++++++++++++++++++++++++++++++++++ include/linux/soc/brcmstb/brcmstb.h | 10 +++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/brcmstb/biuctrl.c create mode 100644 include/linux/soc/brcmstb/brcmstb.h
drivers/soc/brcmstb/Makefile +1 -1
@@ -1,3 +1,3 @@ obj-$(CONFIG_BRCMSTB_PM) += pm/ -obj-y += common.o +obj-y += common.o biuctrl.o
drivers/soc/brcmstb/biuctrl.c new file +117 -0
117 lines not on this page · raw message
include/linux/soc/brcmstb/brcmstb.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef __BRCMSTB_SOC_H +#define __BRCMSTB_SOC_H + +/* +* Bus Interface Unit control register setup, must happen early during boot, +* before SMP is brought up, called by machine entry point. +*/ +int brcmstb_biuctrl_init (void ); + +#endif /* __BRCMSTB_SOC_H */
Signature · 1 line
2.1.0
PATCH 3/3 ARM: brcmstb: Setup BIU control registers during boot
In reply to Florian FainelliCall brcmstb_biuctrl_init() in brcmstb's init_irq machine descriptor callback since we need to setup the Bus Interface Unit before SMP in particular, but we also need to be able to remap registers.
--- arch/arm/mach-bcm/brcmstb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/mach-bcm/brcmstb.c +9 -0
@@ -12,11 +12,19 @@*/ #include <linux/init.h> +#include <linux/irqchip.h> #include <linux/of_platform.h> +#include <linux/soc/brcmstb/brcmstb.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +static void __init brcmstb_init_irq (void ) +{ +irqchip_init (); +brcmstb_biuctrl_init (); +} +static const char *const brcmstb_match[]__initconst = {"brcm,bcm7445" ,"brcm,brcmstb" ,
@@ -25,4 +33,5 @@ static const char *const brcmstb_match[] __initconst = {DT_MACHINE_START (BRCMSTB ,"Broadcom STB (Flattened Device Tree)" ) .dt_compat = brcmstb_match, + .init_irq = brcmstb_init_irq,MACHINE_END
Signature · 1 line
2.1.0
PATCH 3/3 ARM: brcmstb: Setup BIU control registers during boot
Quoted 18 lines · Florian Fainelli
Call
brcmstb_biuctrl_init()in brcmstb'sinit_irqmachine descriptor callback since we need to setup the Bus Interface Unit before SMP in particular, but we also need to be able to remap registers.Signed-off-by Florian Fainelli <[email protected]>--- arch/arm/mach-bcm/brcmstb.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm/mach-bcm/brcmstb.c +1
-0@@ -12,11 +12,19 @@*/ #include <linux/init.h> +#include <linux/irqchip.h>
arch/arm/mach-bcm/brcmstb.c line 25
Quoted 10 lines
arch/arm/mach-bcm/brcmstb.c +5
-0#include <linux/of_platform.h> +#include <linux/soc/brcmstb/brcmstb.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> +static void __init brcmstb_init_irq (void ) +{ +irqchip_init (); +brcmstb_biuctrl_init ();
I believe you're introducing a dependency on CONFIG_SOC_BRCMSTB, but it's not represented in Kconfig. Maybe SOC_BRCMSTB shouldn't be user-selectable, and it should just be select-ed by ARCH_BRCMSTB?
Brian
Quoted 14 lines
arch/arm/mach-bcm/brcmstb.c +3
-0+} +static const char *const brcmstb_match[]__initconst = {"brcm,bcm7445" ,"brcm,brcmstb" ,@@ -25,4 +33,5 @@ static const char *const brcmstb_match[] __initconst = {DT_MACHINE_START (BRCMSTB ,"Broadcom STB (Flattened Device Tree)" ) .dt_compat = brcmstb_match, + .init_irq = brcmstb_init_irq,MACHINE_END Signature · 1 line
2.1.0
PATCH 3/3 ARM: brcmstb: Setup BIU control registers during boot
Quoted 5 lines · Brian Norris
Quoted 4 lines · Florian Fainelli
Call
brcmstb_biuctrl_init()in brcmstb'sinit_irqmachine descriptor callback since we need to setup the Bus Interface Unit before SMP in particular, but we also need to be able to remap registers.
Quoted 10 lines
arch/arm/mach-bcm/brcmstb.c line 25
Quoted 6 lines
Signed-off-by Florian Fainelli <[email protected]>---
arch/arm/mach-bcm/brcmstb.c +4
-0+static void __init brcmstb_init_irq (void ) +{ +irqchip_init (); +brcmstb_biuctrl_init ();I believe you're introducing a dependency on
CONFIG_SOC_BRCMSTB, but it's not represented inKconfig. MaybeSOC_BRCMSTBshouldn't be user-selectable, and it should just be select-ed byARCH_BRCMSTB?
It is thanks to your previous commit, which is why I mentioned in the cover letter that this was based on the 'soc/next' branch.
https://github.com/Broadcom/stblinux/commit/b19826efa15f94084416d5fc7749c45eabfbee36
Thanks for taking a look though!
Signature · 1 line
Florian
PATCH 3/3 ARM: brcmstb: Setup BIU control registers during boot
Quoted 17 lines · Florian Fainelli
Quoted 5 lines · Brian Norris
Quoted 4 lines · Florian Fainelli
Call
brcmstb_biuctrl_init()in brcmstb'sinit_irqmachine descriptor callback since we need to setup the Bus Interface Unit before SMP in particular, but we also need to be able to remap registers.Quoted 10 lines
arch/arm/mach-bcm/brcmstb.c line 25
Quoted 6 lines
Signed-off-by Florian Fainelli <[email protected]>---
arch/arm/mach-bcm/brcmstb.c +4
-0+static void __init brcmstb_init_irq (void ) +{ +irqchip_init (); +brcmstb_biuctrl_init ();I believe you're introducing a dependency on
CONFIG_SOC_BRCMSTB, but it's not represented inKconfig. MaybeSOC_BRCMSTBshouldn't be user-selectable, and it should just be select-ed byARCH_BRCMSTB?
Quoted 4 lines
It is thanks to your previous commit, which is why I mentioned in the cover letter that this was based on the 'soc/next' branch.
https://github.com/Broadcom/stblinux/commit/b19826efa15f94084416d5fc7749c45eabfbee36
Hah, bad memory I have. I suppose a user-selectable option that is also selected by another symbol is OK if the former has few/no dependencies.
Quoted 1 line
Thanks for taking a look though!
Brian