ARM: dts: NSP: Disable PL330 by default, add dma-coherent property
Subsystems (5)
PATCH 1/3 ARM: dts: NSP: Disable PL330 by default, add dma-coherent property
Currently the PL330 is enabled by default. However if left in IDM reset, as is the case with the Meraki and Synology NSP devices, the system will hang when probing for the PL330's AMBA peripheral ID. We therefore should be able to disable it in these cases.
The PL330 is also included among of the list of peripherals put into coherent mode, so "dma-coherent" has been added here as well.
--- arch/arm/boot/dts/bcm-nsp.dtsi | 4 +++- arch/arm/boot/dts/bcm958522er.dts | 4 ++++ arch/arm/boot/dts/bcm958525er.dts | 4 ++++ arch/arm/boot/dts/bcm958525xmc.dts | 4 ++++ arch/arm/boot/dts/bcm958622hr.dts | 4 ++++ arch/arm/boot/dts/bcm958623hr.dts | 4 ++++ arch/arm/boot/dts/bcm958625hr.dts | 4 ++++ arch/arm/boot/dts/bcm958625k.dts | 4 ++++ 8 files changed, 31 insertions(+), 1 deletion(-)
arch/arm/boot/dts/bcm-nsp.dtsi +3 -1
@@ -200,7 +200,7 @@ uart1: serial@400 { status = "disabled"; }; - dma@20000 { + dma: dma@20000 { compatible = "arm,pl330", "arm,primecell"; reg = <0x20000 0x1000>; interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
@@ -215,6 +215,8 @@ dma@20000 { clocks = <&iprocslow>; clock-names = "apb_pclk"; #dma-cells = <1>; + dma-coherent; + status = "disabled"; }; sdio: sdhci@21000 {
arch/arm/boot/dts/bcm958522er.dts +4 -0
@@ -58,6 +58,10 @@ gpio-restart { /* USB 3 support needed to be complete */ +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958525er.dts +4 -0
@@ -58,6 +58,10 @@ gpio-restart { /* USB 3 support needed to be complete */ +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958525xmc.dts +4 -0
@@ -58,6 +58,10 @@ gpio-restart { /* XHCI support needed to be complete */ +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958622hr.dts +4 -0
@@ -58,6 +58,10 @@ gpio-restart { /* USB 3 and SLIC support needed to be complete */ +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958623hr.dts +4 -0
@@ -58,6 +58,10 @@ gpio-restart { /* USB 3 and SLIC support needed to be complete */ +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958625hr.dts +4 -0
@@ -69,6 +69,10 @@ &i2c0 { status = "okay"; }; +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
arch/arm/boot/dts/bcm958625k.dts +4 -0
@@ -48,6 +48,10 @@ memory@60000000 { }; }; +&dma { + status = "okay"; +}; + &amac0 { status = "okay"; };
Signature · 1 line
2.25.4
PATCH 2/3 ARM: dts: NSP: Correct amac_base lengths, mailbox reg and add amac3
According to gmac/src/et/sys/et_linux.c, IORESOURCE_MEM end address for each mac is IPROC_GMACx_REG_BASE+0xbff.
The FA2 mailbox is specified at 0x18025000 but should actually be 0x18025c00, length 0x400 according to socregs_nsp.h and board_bu.c. amac3 is at 25000.
--- arch/arm/boot/dts/bcm-nsp.dtsi | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
arch/arm/boot/dts/bcm-nsp.dtsi +17 -6
@@ -47,6 +47,7 @@ aliases { ethernet0 = &amac0; ethernet1 = &amac1; ethernet2 = &amac2; + ethernet3 = &amac3; }; cpus {
@@ -231,7 +232,7 @@ sdio: sdhci@21000 { amac0: ethernet@22000 { compatible = "brcm,nsp-amac"; - reg = <0x022000 0x1000>, + reg = <0x022000 0x0c00>, <0x110000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
@@ -241,7 +242,7 @@ amac0: ethernet@22000 { amac1: ethernet@23000 { compatible = "brcm,nsp-amac"; - reg = <0x023000 0x1000>, + reg = <0x023000 0x0c00>, <0x111000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
@@ -251,7 +252,7 @@ amac1: ethernet@23000 { amac2: ethernet@24000 { compatible = "brcm,nsp-amac"; - reg = <0x024000 0x1000>, + reg = <0x024000 0x0c00>, <0x112000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
@@ -259,10 +260,20 @@ amac2: ethernet@24000 { status = "disabled"; }; - mailbox: mailbox@25000 { - compatible = "brcm,iproc-fa2-mbox"; - reg = <0x25000 0x445>; + amac3: ethernet@25000 { + compatible = "brcm,nsp-amac"; + reg = <0x025000 0x0c00>, + <0x113000 0x1000>; + reg-names = "amac_base", "idm_base"; interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>; + dma-coherent; + status = "disabled"; + }; + + mailbox: mailbox@25c00 { + compatible = "brcm,iproc-fa2-mbox"; + reg = <0x25c00 0x400>; + interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>; #mbox-cells = <1>; brcm,rx-status-len = <32>; brcm,use-bcm-hdr;
Signature · 1 line
2.25.4
Re: [PATCH 2/3] ARM: dts: NSP: Correct amac_base lengths, mailbox reg and add amac3
Quoted 2 lines · Matthew Hagan
According to
gmac/src/et/sys/et_linux.c,IORESOURCE_MEMend address for each mac isIPROC_GMACx_REG_BASE+0xbff.
The datasheet shows an entire GMAC to end at 0x1000 from its base offset which is likely what was used to construct this DTS, I do not believe this is a functional change, and if we look at the register details, the last register starts at 0xb44 so 0xc00 is giving a little bit of headroom. In practice it does not change anything since you are still going to need a full 4KB page frame to map the registers.
Quoted 3 lines
The FA2 mailbox is specified at
0x18025000but should actually be0x18025c00, length0x400according tosocregs_nsp.handboard_bu.c. amac3 is at 25000.
Yes, FA2 definitively start 0x18025c00, and ends 0x400 later, so I did split this patch in three patches:
- one that fixes the FA2 base address, which can be queued to stable kernel branches
- one that changes the AMAC register size
- one that adds the AMAC3
Such that the first patch can be queued for -stable fixes, whereas the other two, not being functional changes are candidates for devicetree/next.
Result here:
https://github.com/Broadcom/stblinux/commits/devicetree/next
Thanks!
Signature · 1 line
Florian
Re: [PATCH 2/3] ARM: dts: NSP: Correct amac_base lengths, mailbox reg and add amac3
Quoted 17 lines · Florian Fainelli
Quoted 2 lines · Matthew Hagan
According to
gmac/src/et/sys/et_linux.c,IORESOURCE_MEMend address for each mac isIPROC_GMACx_REG_BASE+0xbff.The datasheet shows an entire GMAC to end at
0x1000from its base offset which is likely what was used to construct this DTS, I do not believe this is a functional change, and if we look at the register details, the last register starts at0xb44so0xc00is giving a little bit of headroom. In practice it does not change anything since you are still going to need a full 4KB page frame to map the registers.Quoted 3 lines
The FA2 mailbox is specified at
0x18025000but should actually be0x18025c00, length0x400according tosocregs_nsp.handboard_bu.c. amac3 is at 25000.
Quoted 7 lines
Yes, FA2 definitively start
0x18025c00, and ends0x400later, so I did split this patch in three patches:- one that fixes the FA2 base address, which can be queued to stable kernel branches
- one that changes the AMAC register size
- one that adds the AMAC3
Since AMAC3 has been added with interrupt 150, should the mailbox interrupt not also be incremented to 151?
Quoted 10 lines
Such that the first patch can be queued for -stable fixes, whereas the other two, not being functional changes are candidates for devicetree/next.
Result here:
https://github.com/Broadcom/stblinux/commits/devicetree/next
Thanks!
Thanks,
Matthew
Re: [PATCH 2/3] ARM: dts: NSP: Correct amac_base lengths, mailbox reg and add amac3
Quoted 23 lines · Matthew Hagan
Quoted 20 lines · Florian Fainelli
Quoted 2 lines · Matthew Hagan
According to
gmac/src/et/sys/et_linux.c,IORESOURCE_MEMend address for each mac isIPROC_GMACx_REG_BASE+0xbff.The datasheet shows an entire GMAC to end at
0x1000from its base offset which is likely what was used to construct this DTS, I do not believe this is a functional change, and if we look at the register details, the last register starts at0xb44so0xc00is giving a little bit of headroom. In practice it does not change anything since you are still going to need a full 4KB page frame to map the registers.Quoted 3 lines
The FA2 mailbox is specified at
0x18025000but should actually be0x18025c00, length0x400according tosocregs_nsp.handboard_bu.c. amac3 is at 25000.Yes, FA2 definitively start
0x18025c00, and ends0x400later, so I did split this patch in three patches:
Quoted 7 lines
Quoted 4 lines
- one that fixes the FA2 base address, which can be queued to stable kernel branches
- one that changes the AMAC register size
- one that adds the AMAC3Since AMAC3 has been added with interrupt 150, should the mailbox interrupt not also be incremented to 151?
Yes indeed, now corrected:
https://github.com/Broadcom/stblinux/commit/ac4e106d8934a5894811fc263f4b03fc8ed0fb7a
(have not merged it back into devicetree/next yet)
Signature · 1 line
Florian
PATCH 3/3 ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP
In reply to Matthew HaganThe NSP SoC includes an SP804 timer so should be enabled here.
--- arch/arm/mach-bcm/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-bcm/Kconfig +1 -0
@@ -53,6 +53,7 @@ config ARCH_BCM_NSP select ARM_ERRATA_754322 select ARM_ERRATA_775420 select ARM_ERRATA_764369 if SMP + select ARM_TIMER_SP804 select THERMAL select THERMAL_OF help
Signature · 1 line
2.25.4
Florian Fainelli
AppliedRe: [PATCH 3/3] ARM: bcm: Select ARM_TIMER_SP804 for ARCH_BCM_NSP
Quoted 3 lines · Matthew Hagan
The NSP SoC includes an SP804 timer so should be enabled here.
Signed-off-by Matthew Hagan <[email protected]>
Applied to soc/fixes with:
Thanks
Signature · 1 line
Florian
Florian Fainelli
AppliedQuoted 9 lines · Matthew Hagan
Currently the PL330 is enabled by default. However if left in IDM reset, as is the case with the Meraki and Synology NSP devices, the system will hang when probing for the PL330's AMBA peripheral ID. We therefore should be able to disable it in these cases.
The PL330 is also included among of the list of peripherals put into coherent mode, so "dma-coherent" has been added here as well.
Signed-off-by Matthew Hagan <[email protected]>
Applied to devicetree/fixes with:
Thanks!
Signature · 1 line
Florian