CBB driver for Tegra194, Tegra234 & Tegra-Grace
Subsystems (2)
v6 cover CBB driver for Tegra194, Tegra234 & Tegra-Grace
The patch series adds Control BackBone(CBB) error handling driver for Tegra194, Tegra234 and Tegra-Grace SOC's. Tegra194 is using CBB version 1.0. Tegra234 and Tegra-Grace are using CBB version 2.0. Both CBB1.0 and CBB2.0 have different internal architecture. So, separate drivers are required.
Tegra194 and Tegra234 are using Device Tree. Tegra-Grace is using ACPI.
Request to queue the patch series for 5.19.
---
v5 -> v6:
- Minor changes in yaml files in patch number 2 and 6.
v4 -> v5:
- fix warnings on diabling CONFIG_ACPI reported by kernel test robot.
v3 -> v4:
- rebased patches on 5.18-rc5.
v2 -> v3:
- fixed warnings with GCC 11.2 and W=1 reported by kernel test robot.
- changed some function names to make consistent with tegra_cbb_*.
v1 -> v2:
- moved err-notifier-base and off-mask-erd from DT to driver.
- yaml fixes by Thierry.
Sumit Gupta (9):
soc: tegra: set ERD bit to mask inband errors
dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
dt-bindings: arm: tegra: Add NVIDIA Tegra194 axi2apb binding
arm64: tegra: Add node for CBB1.0 in Tegra194 SOC
soc: tegra: cbb: Add CBB1.0 driver for Tegra194
dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
arm64: tegra: Add node for CBB2.0 in Tegra234 SOC
soc: tegra: cbb: Add driver for Tegra234 CBB2.0
soc: tegra: cbb: Add support for tegra-grace SOC
.../arm/tegra/nvidia,tegra194-axi2apb.yaml | 40 + .../arm/tegra/nvidia,tegra194-cbb.yaml | 98 + .../arm/tegra/nvidia,tegra234-cbb.yaml | 74 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 62 +- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 42 + drivers/soc/tegra/Kconfig | 9 + drivers/soc/tegra/Makefile | 1 + drivers/soc/tegra/cbb/Makefile | 9 + drivers/soc/tegra/cbb/tegra-cbb.c | 198 ++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2261 +++++++++++++++++ drivers/soc/tegra/cbb/tegra234-cbb.c | 833 ++++++ drivers/soc/tegra/fuse/tegra-apbmisc.c | 29 +- include/soc/tegra/fuse.h | 6 + include/soc/tegra/tegra-cbb.h | 43 + include/soc/tegra/tegra-grace-cbb.h | 219 ++ include/soc/tegra/tegra194-cbb.h | 158 ++ include/soc/tegra/tegra234-cbb.h | 342 +++ 17 files changed, 4421 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml create mode 100644 drivers/soc/tegra/cbb/Makefile create mode 100644 drivers/soc/tegra/cbb/tegra-cbb.c create mode 100644 drivers/soc/tegra/cbb/tegra194-cbb.c create mode 100644 drivers/soc/tegra/cbb/tegra234-cbb.c create mode 100644 include/soc/tegra/tegra-cbb.h create mode 100644 include/soc/tegra/tegra-grace-cbb.h create mode 100644 include/soc/tegra/tegra194-cbb.h create mode 100644 include/soc/tegra/tegra234-cbb.h
Signature · 1 line
2.17.1
v6 cover CBB driver for Tegra194, Tegra234 & Tegra-Grace
The patch series adds Control BackBone(CBB) error handling driver for Tegra194, Tegra234 and Tegra-Grace SOC's. Tegra194 is using CBB version 1.0. Tegra234 and Tegra-Grace are using CBB version 2.0. Both CBB1.0 and CBB2.0 have different internal architecture. So, separate drivers are required.
Tegra194 and Tegra234 are using Device Tree. Tegra-Grace is using ACPI.
Request to queue the patch series for 5.19.
---
v5 -> v6:
- Minor changes in yaml files in patch number 2 and 6.
v4 -> v5:
- fix warnings on diabling CONFIG_ACPI reported by kernel test robot.
v3 -> v4:
- rebased patches on 5.18-rc5.
v2 -> v3:
- fixed warnings with GCC 11.2 and W=1 reported by kernel test robot.
- changed some function names to make consistent with tegra_cbb_*.
v1 -> v2:
- moved err-notifier-base and off-mask-erd from DT to driver.
- yaml fixes by Thierry.
Sumit Gupta (9):
soc: tegra: set ERD bit to mask inband errors
dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
dt-bindings: arm: tegra: Add NVIDIA Tegra194 axi2apb binding
arm64: tegra: Add node for CBB1.0 in Tegra194 SOC
soc: tegra: cbb: Add CBB1.0 driver for Tegra194
dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
arm64: tegra: Add node for CBB2.0 in Tegra234 SOC
soc: tegra: cbb: Add driver for Tegra234 CBB2.0
soc: tegra: cbb: Add support for tegra-grace SOC
.../arm/tegra/nvidia,tegra194-axi2apb.yaml | 40 + .../arm/tegra/nvidia,tegra194-cbb.yaml | 98 + .../arm/tegra/nvidia,tegra234-cbb.yaml | 74 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 62 +- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 42 + drivers/soc/tegra/Kconfig | 9 + drivers/soc/tegra/Makefile | 1 + drivers/soc/tegra/cbb/Makefile | 9 + drivers/soc/tegra/cbb/tegra-cbb.c | 198 ++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2261 +++++++++++++++++ drivers/soc/tegra/cbb/tegra234-cbb.c | 833 ++++++ drivers/soc/tegra/fuse/tegra-apbmisc.c | 29 +- include/soc/tegra/fuse.h | 6 + include/soc/tegra/tegra-cbb.h | 43 + include/soc/tegra/tegra-grace-cbb.h | 219 ++ include/soc/tegra/tegra194-cbb.h | 158 ++ include/soc/tegra/tegra234-cbb.h | 342 +++ 17 files changed, 4421 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml create mode 100644 drivers/soc/tegra/cbb/Makefile create mode 100644 drivers/soc/tegra/cbb/tegra-cbb.c create mode 100644 drivers/soc/tegra/cbb/tegra194-cbb.c create mode 100644 drivers/soc/tegra/cbb/tegra234-cbb.c create mode 100644 include/soc/tegra/tegra-cbb.h create mode 100644 include/soc/tegra/tegra-grace-cbb.h create mode 100644 include/soc/tegra/tegra194-cbb.h create mode 100644 include/soc/tegra/tegra234-cbb.h
Signature · 1 line
2.17.1
Hi Thierry,
Gentle Ping.
As we have ACK from Rob for DT changes, Can we please queue the patch series for 5.20.
Best Regards,
Sumit Gupta
Quoted 70 lines · Sumit Gupta
The patch series adds Control BackBone(CBB) error handling driver for Tegra194, Tegra234 and Tegra-Grace SOC's. Tegra194 is using CBB version 1.0. Tegra234 and Tegra-Grace are using CBB version 2.0. Both CBB1.0 and CBB2.0 have different internal architecture. So, separate drivers are required.
Tegra194 and Tegra234 are using Device Tree. Tegra-Grace is using ACPI.Request to queue the patch series for 5.19.
---
v5 -> v6:
- Minor changes in yaml files in patch number 2 and 6.v4 -> v5:
- fix warnings on diablingCONFIG_ACPIreported by kernel test robot.v3 -> v4:
- rebased patches on 5.18-rc5.v2 -> v3:
- fixed warnings with GCC 11.2 and W=1 reported by kernel test robot.
- changed some function names to make consistent with tegra_cbb_*.v1 -> v2:
- moved err-notifier-base and off-mask-erd from DT to driver.
- yaml fixes by Thierry.Sumit Gupta (9):
soc: tegra: set ERD bit to mask inband errors
dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
dt-bindings: arm: tegra: Add NVIDIA Tegra194 axi2apb binding
arm64: tegra: Add node for CBB1.0 in Tegra194 SOC
soc: tegra: cbb: Add CBB1.0 driver for Tegra194
dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
arm64: tegra: Add node for CBB2.0 in Tegra234 SOC
soc: tegra: cbb: Add driver for Tegra234 CBB2.0
soc: tegra: cbb: Add support for tegra-grace SOC.../arm/tegra/nvidia,tegra194-axi2apb.yaml | 40 + .../arm/tegra/nvidia,tegra194-cbb.yaml | 98 + .../arm/tegra/nvidia,tegra234-cbb.yaml | 74 + arch/arm64/boot/dts/nvidia/tegra194.dtsi | 62 +- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 42 + drivers/soc/tegra/Kconfig | 9 + drivers/soc/tegra/Makefile | 1 + drivers/soc/tegra/cbb/Makefile | 9 + drivers/soc/tegra/cbb/tegra-cbb.c | 198 ++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2261 +++++++++++++++++ drivers/soc/tegra/cbb/tegra234-cbb.c | 833 ++++++ drivers/soc/tegra/fuse/tegra-apbmisc.c | 29 +- include/soc/tegra/fuse.h | 6 + include/soc/tegra/tegra-cbb.h | 43 + include/soc/tegra/tegra-grace-cbb.h | 219 ++ include/soc/tegra/tegra194-cbb.h | 158 ++ include/soc/tegra/tegra234-cbb.h | 342 +++ 17 files changed, 4421 insertions(+), 3 deletions(-)create mode 100644
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yamlcreate mode 100644Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yamlcreate mode 100644Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yamlcreate mode 100644drivers/soc/tegra/cbb/Makefile
create mode 100644drivers/soc/tegra/cbb/tegra-cbb.c
create mode 100644drivers/soc/tegra/cbb/tegra194-cbb.c
create mode 100644drivers/soc/tegra/cbb/tegra234-cbb.c
create mode 100644include/soc/tegra/tegra-cbb.h
create mode 100644include/soc/tegra/tegra-grace-cbb.h
create mode 100644include/soc/tegra/tegra194-cbb.h
create mode 100644include/soc/tegra/tegra234-cbb.h
PATCH v6 1/9 soc: tegra: set ERD bit to mask inband errors
In reply to Sumit GuptaAdd function to set Error Response Disable bit in MISCREG_CCROC_ERR_CONFIG register from the Control Backbone(CBB) error handler driver. ERD bit allows masking of SError due to inband errors which are caused by illegal register accesses through CBB. When the bit is set, interrupt is used for reporting errors and magic code '0xdead2003' is returned. This change is only required for Tegra194 SOC as the config is moved to CBB register space for future SOC's. Also, remove unmapping the apbmisc_base as it's required to get the base address for accessing the misc register.
--- drivers/soc/tegra/fuse/tegra-apbmisc.c | 29 ++++++++++++++++++++++++-- include/soc/tegra/fuse.h | 6 ++++++ 2 files changed, 33 insertions(+), 2 deletions(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +27 -2
@@ -16,12 +16,16 @@#define FUSE_SKU_INFO 0x10 +#define ERD_ERR_CONFIG 0x120c +#define ERD_MASK_INBAND_ERR 0x1 +#define PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT 4#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_LONG \ (0xf << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT)#define PMC_STRAPPING_OPT_A_RAM_CODE_MASK_SHORT \ (0x3 << PMC_STRAPPING_OPT_A_RAM_CODE_SHIFT) +static void __iomem *apbmisc_base;static bool long_ram_code;static u32 strapping;static u32 chipid;
@@ -93,6 +97,28 @@ u32 tegra_read_ram_code(void) }EXPORT_SYMBOL_GPL (tegra_read_ram_code); +/* +* The function sets ERD(Error Response Disable) bit. +* This allows to mask inband errors and always send an +* OKAY response from CBB to the master which caused error. +*/ +int tegra194_miscreg_mask_serror (void ) +{ +if (!apbmisc_base) +return -EPROBE_DEFER ; + +if (!of_machine_is_compatible ("nvidia,tegra194" )) { +WARN (1 ,"Only supported for Tegra194 devices!\n" ); +return -EOPNOTSUPP ; + } + +writel_relaxed (ERD_MASK_INBAND_ERR , + apbmisc_base +ERD_ERR_CONFIG ); + +return 0 ; +} +EXPORT_SYMBOL (tegra194_miscreg_mask_serror); +static const struct of_device_id apbmisc_match[]__initconst = { { .compatible ="nvidia,tegra20-apbmisc" , }, { .compatible ="nvidia,tegra186-misc" , },
@@ -134,7 +160,7 @@ void __init tegra_init_revision(void)void __init tegra_init_apbmisc (void ) { -void __iomem *apbmisc_base, *strapping_base; +void __iomem *strapping_base;struct resource apbmisc, straps;struct device_node *np;
@@ -196,7 +222,6 @@ void __init tegra_init_apbmisc(void)pr_err ("failed to map APBMISC registers\n" ); }else { chipid =readl_relaxed (apbmisc_base +4 ); -iounmap (apbmisc_base); } strapping_base =ioremap (straps.start,resource_size (&straps));
include/soc/tegra/fuse.h +6 -0
@@ -58,6 +58,7 @@ u32 tegra_read_chipid(void);u8 tegra_get_chip_id (void );u8 tegra_get_platform (void );bool tegra_is_silicon (void ); +int tegra194_miscreg_mask_serror (void );#else static struct tegra_sku_info tegra_sku_info__maybe_unused ;
@@ -95,6 +96,11 @@ static inline bool tegra_is_silicon(void) {return false; } + +static inline int tegra194_miscreg_mask_serror (void ) +{ +return false; +}#endif struct device *tegra_soc_device_register (void );
Signature · 1 line
2.17.1
PATCH v6 2/9 dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
In reply to Sumit GuptaAdd device-tree binding documentation to represent the Control Backbone (CBB) version 1.0 used in Tegra194 SOC.
--- .../arm/tegra/nvidia,tegra194-cbb.yaml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml new file +98 -0
@@ -0,0 +1,98 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra194-cbb.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NVIDIA Tegra194 CBB 1.0 bindings + +maintainers: + - Sumit Gupta <[email protected]> + +description: |+ + The Control Backbone (CBB) is comprised of the physical path from an + initiator to a target's register configuration space. CBB 1.0 has + multiple hierarchical sub-NOCs (Network-on-Chip) and connects various + initiators and targets using different bridges like AXIP2P, AXI2APB. + + This driver handles errors due to illegal register accesses reported + by the NOCs inside the CBB. NOCs reporting errors are cluster NOCs + "AON-NOC, SCE-NOC, RCE-NOC, BPMP-NOC, CV-NOC" and "CBB Central NOC" + which is the main NOC. + + By default, the access issuing initiator is informed about the error + using SError or Data Abort exception unless the ERD (Error Response + Disable) is enabled/set for that initiator. If the ERD is enabled, then + SError or Data Abort is masked and the error is reported with interrupt. + + - For CCPLEX (CPU Complex) initiator, the driver sets ERD bit. So, the + errors due to illegal accesses from CCPLEX are reported by interrupts. + If ERD is not set, then error is reported by SError. + - For other initiators, the ERD is disabled. So, the access issuing + initiator is informed about the illegal access by Data Abort exception. + In addition, an interrupt is also generated to CCPLEX. These initiators + include all engines using Cortex-R5 (which is ARMv7 CPU cluster) and + engines like TSEC (Security co-processor), NVDEC (NVIDIA Video Decoder + engine) etc which can initiate transactions. + + The driver prints relevant debug information like Error Code, Error + Description, Master, Address, AXI ID, Cache, Protection, Security Group + etc on receiving error notification. + +properties: + $nodename: + pattern: "^[a-z]+-noc@[0-9a-f]+$" + + compatible: + enum: + - nvidia,tegra194-cbb-noc + - nvidia,tegra194-aon-noc + - nvidia,tegra194-bpmp-noc + - nvidia,tegra194-rce-noc + - nvidia,tegra194-sce-noc + + reg: + maxItems: 1 + + interrupts: + description: + CCPLEX receives secure or nonsecure interrupt depending on error type. + A secure interrupt is received for SEC(firewall) & SLV errors and a + non-secure interrupt is received for TMO & DEC errors. + items: + - description: non-secure interrupt + - description: secure interrupt + + nvidia,axi2apb: + $ref: '/schemas/types.yaml#/definitions/phandle' + description: + Specifies the node having all axi2apb bridges which need to be checked + for any error logged in their status register. + + nvidia,apbmisc: + $ref: '/schemas/types.yaml#/definitions/phandle' + description: + Specifies the apbmisc node which need to be used for reading the ERD + register. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - nvidia,axi2apb + - nvidia,apbmisc + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + cbb-noc(a)2300000 { + compatible = "nvidia,tegra194-cbb-noc"; + reg = <0x02300000 0x1000>; + interrupts = <GIC_SPI 230 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + nvidia,axi2apb = <&axi2apb>; + nvidia,apbmisc = <&apbmisc>; + };
Signature · 1 line
2.17.1
Re: [Patch v6 2/9] dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
Quoted 9 lines · Sumit Gupta
Add device-tree binding documentation to represent the Control Backbone (CBB) version 1.0 used in Tegra194 SOC.
Signed-off-by Sumit Gupta <[email protected]>--- .../arm/tegra/nvidia,tegra194-cbb.yaml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml
PATCH v6 3/9 dt-bindings: arm: tegra: Add NVIDIA Tegra194 axi2apb binding
In reply to Sumit GuptaAdd device-tree binding documentation to represent the axi2apb bridges used by Control Backbone (CBB) 1.0 in Tegra194 SOC. All errors for APB slaves are reported as slave error because APB bas single bit to report error. So, CBB driver needs to further check error status registers of all the axi2apb bridges to find error type.
--- .../arm/tegra/nvidia,tegra194-axi2apb.yaml | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml new file +40 -0
@@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra194-axi2apb.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NVIDIA Tegra194 AXI2APB bridge + +maintainers: + - Sumit Gupta <[email protected]> + +properties: + $nodename: + pattern: "^axi2apb@([0-9a-f]+)$" + + compatible: + enum: + - nvidia,tegra194-axi2apb + + reg: + maxItems: 6 + description: Physical base address and length of registers for all bridges + +additionalProperties: false + +required: + - compatible + - reg + +examples: + - | + axi2apb: axi2apb(a)2390000 { + compatible = "nvidia,tegra194-axi2apb"; + reg = <0x02390000 0x1000>, + <0x023a0000 0x1000>, + <0x023b0000 0x1000>, + <0x023c0000 0x1000>, + <0x023d0000 0x1000>, + <0x023e0000 0x1000>; + };
Signature · 1 line
2.17.1
PATCH v6 4/9 arm64: tegra: Add node for CBB1.0 in Tegra194 SOC
In reply to Sumit GuptaAdding device tree nodes to enable the driver for handling errors from Control Backbone(CBB). CBB version 1.0 is used in Tegra194 SOC.
--- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 62 +++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra194.dtsi +61 -1
@@ -23,7 +23,7 @@ #size-cells = <1>; ranges = <0x0 0x0 0x0 0x40000000>; - misc(a)100000 { + apbmisc: misc(a)100000 { compatible = "nvidia,tegra194-misc"; reg = <0x00100000 0xf000>, <0x0010f000 0x1000>;
@@ -88,6 +88,27 @@ gpio-controller; }; + cbb-noc(a)2300000 { + compatible = "nvidia,tegra194-cbb-noc"; + reg = <0x02300000 0x1000>; + interrupts = <GIC_SPI 230 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + nvidia,axi2apb = <&axi2apb>; + nvidia,apbmisc = <&apbmisc>; + status = "okay"; + }; + + axi2apb: axi2apb(a)2390000 { + compatible = "nvidia,tegra194-axi2apb"; + reg = <0x2390000 0x1000>, + <0x23a0000 0x1000>, + <0x23b0000 0x1000>, + <0x23c0000 0x1000>, + <0x23d0000 0x1000>, + <0x23e0000 0x1000>; + status = "okay"; + }; + ethernet(a)2490000 { compatible = "nvidia,tegra194-eqos", "nvidia,tegra186-eqos",
@@ -1460,6 +1481,26 @@ #phy-cells = <0>; }; + sce-noc(a)b600000 { + compatible = "nvidia,tegra194-sce-noc"; + reg = <0xb600000 0x1000>; + interrupts = <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; + nvidia,axi2apb = <&axi2apb>; + nvidia,apbmisc = <&apbmisc>; + status = "okay"; + }; + + rce-noc(a)be00000 { + compatible = "nvidia,tegra194-rce-noc"; + reg = <0xbe00000 0x1000>; + interrupts = <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; + nvidia,axi2apb = <&axi2apb>; + nvidia,apbmisc = <&apbmisc>; + status = "okay"; + }; + hsp_aon: hsp(a)c150000 { compatible = "nvidia,tegra194-hsp"; reg = <0x0c150000 0x90000>;
@@ -1594,6 +1635,25 @@ }; + aon-noc(a)c600000 { + compatible = "nvidia,tegra194-aon-noc"; + reg = <0xc600000 0x1000>; + interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>; + nvidia,apbmisc = <&apbmisc>; + status = "okay"; + }; + + bpmp-noc(a)d600000 { + compatible = "nvidia,tegra194-bpmp-noc"; + reg = <0xd600000 0x1000>; + interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + nvidia,axi2apb = <&axi2apb>; + nvidia,apbmisc = <&apbmisc>; + status = "okay"; + }; + iommu(a)10000000 { compatible = "nvidia,tegra194-smmu", "nvidia,smmu-500"; reg = <0x10000000 0x800000>;
Signature · 1 line
2.17.1
PATCH v6 5/9 soc: tegra: cbb: Add CBB1.0 driver for Tegra194
In reply to Sumit GuptaAdding driver to handle errors from Control Backbone(CBB) which are generated due to illegal accesses. CBB1.0 is used in Tegra194 SOC. When an error is reported from a NOC within CBB, the driver prints debug information about failed transaction like Error Code, Error Description, Master, Address, AXI ID, Cache, Protection, Security Group etc. It then causes system crash using BUG_ON() or call WARN() based on whether the error type is fatal or not.
--- drivers/soc/tegra/Kconfig | 9 + drivers/soc/tegra/Makefile | 1 + drivers/soc/tegra/cbb/Makefile | 8 + drivers/soc/tegra/cbb/tegra-cbb.c | 198 +++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2261 ++++++++++++++++++++++++++ include/soc/tegra/tegra-cbb.h | 43 + include/soc/tegra/tegra194-cbb.h | 158 ++ 7 files changed, 2678 insertions(+) create mode 100644 drivers/soc/tegra/cbb/Makefile create mode 100644 drivers/soc/tegra/cbb/tegra-cbb.c create mode 100644 drivers/soc/tegra/cbb/tegra194-cbb.c create mode 100644 include/soc/tegra/tegra-cbb.h create mode 100644 include/soc/tegra/tegra194-cbb.h
drivers/soc/tegra/Kconfig +9 -0
@@ -162,3 +162,12 @@ config SOC_TEGRA30_VOLTAGE_COUPLER bool "Voltage scaling support for Tegra30 SoCs" depends on ARCH_TEGRA_3x_SOC || COMPILE_TEST depends on REGULATOR + +config SOC_TEGRA_CBB + tristate "Tegra driver to handle error from CBB" + depends on ARCH_TEGRA_194_SOC + default y + help + Support for handling error from Tegra Control Backbone(CBB). + This driver handles the errors from CBB and prints debug + information about the failed transactions.
drivers/soc/tegra/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-y += fuse/ +obj-y += cbb/ obj-y += common.o obj-$(CONFIG_SOC_TEGRA_FLOWCTRL) += flowctrl.o
drivers/soc/tegra/cbb/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 +# +# Control Backbone Driver code. +# +ifdef CONFIG_SOC_TEGRA_CBB +obj-y += tegra-cbb.o +obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra194-cbb.o +endif
drivers/soc/tegra/cbb/tegra-cbb.c new file +198 -0
198 lines not on this page · raw message
drivers/soc/tegra/cbb/tegra194-cbb.c new file +2261 -0
2,261 lines not on this page · raw message
include/soc/tegra/tegra-cbb.h new file +43 -0
43 lines not on this page · raw message
include/soc/tegra/tegra194-cbb.h new file +158 -0
158 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v6 6/9 dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
In reply to Sumit GuptaAdd device-tree binding documentation to represent the Control Backbone (CBB) version 2.0 used in T234 SoC.
--- .../arm/tegra/nvidia,tegra234-cbb.yaml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml new file +74 -0
@@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra234-cbb.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: NVIDIA Tegra CBB 2.0 bindings + +maintainers: + - Sumit Gupta <[email protected]> + +description: |+ + The Control Backbone (CBB) is comprised of the physical path from an + initiator to a target's register configuration space. CBB 2.0 consists + of multiple sub-blocks connected to each other to create a topology. + The Tegra234 SoC has different fabrics based on CBB 2.0 architecture + which include cluster fabrics BPMP, AON, PSC, SCE, RCE, DCE, FSI and + "CBB central fabric". + + In CBB 2.0, each initiator which can issue transactions connects to a + Root Master Node (MN) before it connects to any other element of the + fabric. Each Root MN contains a Error Monitor (EM) which detects and + logs error. Interrupts from various EM blocks are collated by Error + Notifier (EN) which is per fabric and presents a single interrupt from + fabric to the SoC interrupt controller. + + The driver handles errors from CBB due to illegal register accesses + and prints debug information about failed transaction on receiving + the interrupt from EN. Debug information includes Error Code, Error + Description, MasterID, Fabric, SlaveID, Address, Cache, Protection, + Security Group etc on receiving error notification. + + If the Error Response Disable (ERD) is set/enabled for an initiator, + then SError or Data abort exception error response is masked and an + interrupt is used for reporting errors due to illegal accesses from + that initiator. The value returned on read failures is '0xFFFFFFFF' + for compatibility with PCIE. + +properties: + $nodename: + pattern: "^[a-z]+-fabric@[0-9a-f]+$" + + compatible: + enum: + - nvidia,tegra234-aon-fabric + - nvidia,tegra234-bpmp-fabric + - nvidia,tegra234-cbb-fabric + - nvidia,tegra234-dce-fabric + - nvidia,tegra234-rce-fabric + - nvidia,tegra234-sce-fabric + + reg: + maxItems: 1 + + interrupts: + items: + - description: secure interrupt from error notifier + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + cbb-fabric(a)1300000 { + compatible = "nvidia,tegra234-cbb-fabric"; + reg = <0x13a00000 0x400000>; + interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + };
Signature · 1 line
2.17.1
Re: [Patch v6 6/9] dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
Quoted 9 lines · Sumit Gupta
Add device-tree binding documentation to represent the Control Backbone (CBB) version 2.0 used in T234 SoC.
Signed-off-by Sumit Gupta <[email protected]>--- .../arm/tegra/nvidia,tegra234-cbb.yaml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml
PATCH v6 7/9 arm64: tegra: Add node for CBB2.0 in Tegra234 SOC
In reply to Sumit GuptaControl Backbone(CBB) version 2.0 is used in Tegra234 SOC. Adding nodes to enable handling of errors from different CBB 2.0 based fabrics in Tegra234 SOC.
--- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +42 -0
@@ -933,6 +933,20 @@ status = "okay"; }; + sce-fabric(a)b600000 { + compatible = "nvidia,tegra234-sce-fabric"; + reg = <0xb600000 0x40000>; + interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + rce-fabric(a)be00000 { + compatible = "nvidia,tegra234-rce-fabric"; + reg = <0xbe00000 0x40000>; + interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + hsp_aon: hsp(a)c150000 { compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp"; reg = <0x0c150000 0x90000>;
@@ -1017,6 +1031,27 @@ interrupt-controller; }; + aon-fabric(a)c600000 { + compatible = "nvidia,tegra234-aon-fabric"; + reg = <0xc600000 0x40000>; + interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + bpmp-fabric(a)d600000 { + compatible = "nvidia,tegra234-bpmp-fabric"; + reg = <0xd600000 0x40000>; + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + dce-fabric(a)de00000 { + compatible = "nvidia,tegra234-sce-fabric"; + reg = <0xde00000 0x40000>; + interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + gic: interrupt-controller(a)f400000 { compatible = "arm,gic-v3"; reg = <0x0f400000 0x010000>, /* GICD */
@@ -1310,6 +1345,13 @@ nvidia,memory-controller = <&mc>; status = "okay"; }; + + cbb-fabric(a)0x13a00000 { + compatible = "nvidia,tegra234-cbb-fabric"; + reg = <0x13a00000 0x400000>; + interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; }; ccplex(a)e000000 {
Signature · 1 line
2.17.1
PATCH v6 8/9 soc: tegra: cbb: Add driver for Tegra234 CBB2.0
In reply to Sumit GuptaAdding driver to handle errors from CBB version 2.0 which is used in Tegra234 SOC. The driver prints debug information about failed transaction on receiving interrupt from Error Notifier. Error notifier collates the interrupts from various Error Monitor blocks and presents a single interrupt to the SOC Interrupt Controller.
For timeout errors, the driver also does the lookup to find timedout clients and prints client id. The IP's who want to reset if there is a timeout will have to call BPMP from the client IP's driver. BPMP firmware will also clear the timeout bit after resetting the IP so that next transactions are send to them after reset.
--- drivers/soc/tegra/Kconfig | 2 +- drivers/soc/tegra/cbb/Makefile | 1 + drivers/soc/tegra/cbb/tegra234-cbb.c | 743 +++++++++++++++++++++++++++ include/soc/tegra/tegra234-cbb.h | 342 ++++++++++++ 4 files changed, 1087 insertions(+), 1 deletion(-) create mode 100644 drivers/soc/tegra/cbb/tegra234-cbb.c create mode 100644 include/soc/tegra/tegra234-cbb.h
drivers/soc/tegra/Kconfig +1 -1
@@ -165,7 +165,7 @@ config SOC_TEGRA30_VOLTAGE_COUPLER config SOC_TEGRA_CBB tristate "Tegra driver to handle error from CBB" - depends on ARCH_TEGRA_194_SOC + depends on ARCH_TEGRA_194_SOC || ARCH_TEGRA_234_SOC default y help Support for handling error from Tegra Control Backbone(CBB).
drivers/soc/tegra/cbb/Makefile +1 -0
@@ -5,4 +5,5 @@ ifdef CONFIG_SOC_TEGRA_CBB obj-y += tegra-cbb.o obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra194-cbb.o +obj-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra234-cbb.o endif
drivers/soc/tegra/cbb/tegra234-cbb.c new file +743 -0
743 lines not on this page · raw message
include/soc/tegra/tegra234-cbb.h new file +342 -0
342 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v6 9/9 soc: tegra: cbb: Add support for tegra-grace SOC
In reply to Sumit GuptaAdding support for Tegra Grace SOC which uses CBB2.0 architecture based fabrics. Also, adding ACPI support required for Grace. Fabrics reporting errors in Grace are "CBB Fabric" and "BPMP Fabric". "CBB Fabric" connects various other CBB2.0 based fabrics and also services the Initiators and Targets which are connected to itself. "BPMP Fabric" is present in BPMP cluster.
--- drivers/soc/tegra/cbb/tegra234-cbb.c | 92 ++++++++++- include/soc/tegra/tegra-grace-cbb.h | 219 +++++++++++++++++++++++++++ 2 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 include/soc/tegra/tegra-grace-cbb.h
drivers/soc/tegra/cbb/tegra234-cbb.c +91 -1
@@ -11,6 +11,7 @@*/ #include <asm/cpufeature.h> +#include <linux/acpi.h> #include <linux/clk.h> #include <linux/debugfs.h> #include <linux/module.h>
@@ -27,6 +28,7 @@#include <soc/tegra/fuse.h> #include <soc/tegra/tegra-cbb.h> #include <soc/tegra/tegra234-cbb.h> +#include <soc/tegra/tegra-grace-cbb.h> static LIST_HEAD (cbb_errmon_list);static DEFINE_SPINLOCK (cbb_errmon_lock);
@@ -258,14 +260,32 @@ static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_recou8 cache_type =0 , prot_type =0 , burst_length =0 ;u8 mstr_id =0 , grpsec =0 , vqc =0 , falconsec =0 ;u8 beat_size =0 , access_type =0 , access_id =0 ; +u8 requester_socket_id =0 , local_socket_id =0 ;u8 slave_id =0 , fab_id =0 , burst_type =0 ;char fabric_name[20 ]; +bool is_numa =0 ; + +if (num_possible_nodes () >1 ) + is_numa = true; mstr_id =FIELD_GET (FAB_EM_EL_MSTRID , errmon->mn_user_bits); vqc =FIELD_GET (FAB_EM_EL_VQC , errmon->mn_user_bits); grpsec =FIELD_GET (FAB_EM_EL_GRPSEC , errmon->mn_user_bits); falconsec =FIELD_GET (FAB_EM_EL_FALCONSEC , errmon->mn_user_bits); +/* +* For SOC with multiple NUMA nodes, print cross socket access +* errors only if initiator/master_id is CCPLEX, CPMU or GPU. +*/ +if (is_numa) { + local_socket_id =numa_node_id (); + requester_socket_id =FIELD_GET (REQ_SOCKET_ID , errmon->mn_attr2); + +if (requester_socket_id != local_socket_id) { +if ((mstr_id !=0x1 ) && (mstr_id !=0x2 ) && (mstr_id !=0xB )) +return ; + } + } fab_id =FIELD_GET (FAB_EM_EL_FABID , errmon->mn_attr2); slave_id =FIELD_GET (FAB_EM_EL_SLAVEID , errmon->mn_attr2);
@@ -298,6 +318,15 @@ static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_recoelse strcpy (fabric_name, errmon->name); +if (is_numa) { +tegra_cbb_print_err (file,"\t Requester_Socket_Id\t: 0x%x\n" , + requester_socket_id); +tegra_cbb_print_err (file,"\t Local_Socket_Id\t: 0x%x\n" , + local_socket_id); +tegra_cbb_print_err (file,"\t No. of NUMA_NODES\t: 0x%x\n" , +num_possible_nodes ()); + } +tegra_cbb_print_err (file,"\t Fabric\t\t: %s\n" , fabric_name);tegra_cbb_print_err (file,"\t Slave_Id\t\t: 0x%x\n" , slave_id);tegra_cbb_print_err (file,"\t Burst_length\t\t: 0x%x\n" , burst_length);
@@ -585,6 +614,23 @@ static struct tegra_cbb_fabric_data tegra234_sce_fab_data = { .err_notifier_base = 0x19000 }; +static struct tegra_cbb_fabric_data tegra_grace_cbb_fab_data = { + .name ="cbb-fabric" , + .tegra_cbb_master_id = tegra_grace_master_id, + .sn_addr_map = tegra_grace_cbb_sn_lookup, + .noc_errors = tegra_grace_errmon_errors, + .err_notifier_base =0x60000 , + .off_mask_erd =0x40004 +}; + +static struct tegra_cbb_fabric_data tegra_grace_bpmp_fab_data = { + .name ="bpmp-fabric" , + .tegra_cbb_master_id = tegra_grace_master_id, + .sn_addr_map = tegra_grace_bpmp_sn_lookup, + .noc_errors = tegra_grace_errmon_errors, + .err_notifier_base =0x19000 +}; +static const struct of_device_id tegra234_cbb_dt_ids[] = { {.compatible ="nvidia,tegra234-cbb-fabric" , .data = &tegra234_cbb_fab_data},
@@ -602,6 +648,38 @@ static const struct of_device_id tegra234_cbb_dt_ids[] = { };MODULE_DEVICE_TABLE (of, tegra234_cbb_dt_ids); +struct cbb_acpi_uid_noc { +const char *hid; +const char *uid; +const struct tegra_cbb_fabric_data *fab; +}; + +static const struct cbb_acpi_uid_noc cbb_acpi_uids[] = { + {"NVDA1070" ,"1" , &tegra_grace_cbb_fab_data }, + {"NVDA1070" ,"2" , &tegra_grace_bpmp_fab_data }, + { }, +}; + +static const struct +tegra_cbb_fabric_data *cbb_acpi_get_fab_data (struct acpi_device *adev) +{ +const struct cbb_acpi_uid_noc *u; + +for (u = cbb_acpi_uids; u->hid; u++) { +if (acpi_dev_hid_uid_match (adev, u->hid, u->uid)) +return u->fab; + } +return NULL ; +} + +#ifdef CONFIG_ACPI +static const struct acpi_device_id tegra_grace_cbb_acpi_ids[] = { + {"NVDA1070" }, + { }, +}; +MODULE_DEVICE_TABLE (acpi, tegra_grace_cbb_acpi_ids); +#endif +static int tegra234_cbb_errmon_init (const struct tegra_cbb_fabric_data *pdata,struct tegra_cbb *cbb,struct resource *res_base)
@@ -646,10 +724,19 @@ static int tegra234_cbb_probe(struct platform_device *pdev)struct tegra_cbb_errmon_record *errmon =NULL ;const struct tegra_cbb_fabric_data *pdata =NULL ;struct resource *res_base =NULL ; +struct acpi_device *device;struct tegra_cbb *cbb;int err =0 ; - pdata =of_device_get_match_data (&pdev->dev); +if (of_machine_is_compatible ("nvidia,tegra23x" ) || +of_machine_is_compatible ("nvidia,tegra234" )) { + pdata =of_device_get_match_data (&pdev->dev); + }else { + device =ACPI_COMPANION (&pdev->dev); +if (!device) +return -ENODEV ; + pdata =cbb_acpi_get_fab_data (device); + }if (!pdata) {dev_err (&pdev->dev,"No device match found\n" );return -EINVAL ;
@@ -720,6 +807,9 @@ static struct platform_driver tegra234_cbb_driver = { .owner = THIS_MODULE, .name = "tegra234-cbb", .of_match_table = of_match_ptr(tegra234_cbb_dt_ids), +#ifdef CONFIG_ACPI + .acpi_match_table = ACPI_PTR(tegra_grace_cbb_acpi_ids), +#endif #ifdef CONFIG_PM_SLEEP .pm = &tegra234_cbb_pm,#endif
include/soc/tegra/tegra-grace-cbb.h new file +219 -0
219 lines not on this page · raw message
Signature · 1 line
2.17.1