CBB driver for Tegra194, Tegra234 & Tegra-Grace
Subsystems (2)
v2 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.
---
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 | 93 + .../arm/tegra/nvidia,tegra234-cbb.yaml | 70 + 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 | 199 ++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2266 +++++++++++++++++ drivers/soc/tegra/cbb/tegra234-cbb.c | 827 ++++++ 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, 4412 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
PATCH v2 1/9 soc: tegra: set ERD bit to mask inband errors
Add 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 v2 2/9 dt-bindings: arm: tegra: Add NVIDIA Tegra194 CBB1.0 binding
In reply to Sumit GuptaAdd device-tree binding documentation to represent the error handling driver for Control Backbone (CBB) version 1.0 used in Tegra194 SOC. The driver prints debug information about failed transactions due to illegal register accesses on receiving interrupt from CBB.
--- .../arm/tegra/nvidia,tegra194-cbb.yaml | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml new file +93 -0
@@ -0,0 +1,93 @@ +# 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 device tree 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 ERD register. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - nvidia,axi2apb + - nvidia,apbmisc + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + cbb-noc@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"; + };
Signature · 1 line
2.17.1
PATCH v2 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@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 v2 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
@@ -22,7 +22,7 @@ #size-cells = <1>; ranges = <0x0 0x0 0x0 0x40000000>; - misc@100000 { + apbmisc: misc@100000 { compatible = "nvidia,tegra194-misc"; reg = <0x00100000 0xf000>, <0x0010f000 0x1000>;
@@ -87,6 +87,27 @@ gpio-controller; }; + cbb-noc@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@2390000 { + compatible = "nvidia,tegra194-axi2apb"; + reg = <0x2390000 0x1000>, + <0x23a0000 0x1000>, + <0x23b0000 0x1000>, + <0x23c0000 0x1000>, + <0x23d0000 0x1000>, + <0x23e0000 0x1000>; + status = "okay"; + }; + ethernet@2490000 { compatible = "nvidia,tegra194-eqos", "nvidia,tegra186-eqos",
@@ -1359,6 +1380,26 @@ #phy-cells = <0>; }; + sce-noc@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@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@c150000 { compatible = "nvidia,tegra194-hsp", "nvidia,tegra186-hsp"; reg = <0x0c150000 0x90000>;
@@ -1374,6 +1415,15 @@ #mbox-cells = <2>; }; + aon-noc@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"; + }; + gen2_i2c: i2c@c240000 { compatible = "nvidia,tegra194-i2c"; reg = <0x0c240000 0x10000>;
@@ -1552,6 +1602,16 @@ status = "okay"; }; + bpmp-noc@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"; + }; + host1x@13e00000 { compatible = "nvidia,tegra194-host1x"; reg = <0x13e00000 0x10000>,
Signature · 1 line
2.17.1
PATCH v2 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 | 199 +++ drivers/soc/tegra/cbb/tegra194-cbb.c | 2266 ++++++++++++++++++++++++++ include/soc/tegra/tegra-cbb.h | 43 + include/soc/tegra/tegra194-cbb.h | 158 ++ 7 files changed, 2684 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
@@ -161,3 +161,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 +199 -0
199 lines not on this page · raw message
drivers/soc/tegra/cbb/tegra194-cbb.c new file +2266 -0
2,266 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
kernel test robot
build botRe: [Patch v2 5/9] soc: tegra: cbb: Add CBB1.0 driver for Tegra194
Thank you for the patch! Perhaps something to improve:
Hi Sumit,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on tegra-drm/drm/tegra/for-next v5.16-rc5 next-20211217] [cannot apply to tegra/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sumit-Gupta/CBB-driver-for-Tegra194-Tegra234-Tegra-Grace/20211217-200840 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20211218/202112180528.6oINgaDF-lkp(a)intel.com/config) compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/4289c950622627160bdc937ad22a311db38f4ca8
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sumit-Gupta/CBB-driver-for-Tegra194-Tegra234-Tegra-Grace/20211217-200840 git checkout 4289c950622627160bdc937ad22a311db38f4ca8
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/soc/tegra/cbb/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/soc/tegra/cbb/tegra-cbb.c: In function 'print_cbb_err':
>> drivers/soc/tegra/cbb/tegra-cbb.c:31:17: warning: function 'print_cbb_err' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
31 | seq_vprintf(file, fmt, args);
| ^~~~~~~~~~~vim +31 drivers/soc/tegra/cbb/tegra-cbb.c
22
23 void print_cbb_err(struct seq_file *file, const char *fmt, ...)
24 {
25 va_list args;
26 struct va_format vaf;
27
28 va_start(args, fmt);
29
30 if (file) {
> 31 seq_vprintf(file, fmt, args);
32 } else {
33 vaf.fmt = fmt;
34 vaf.va = &args;
35 pr_crit("%pV", &vaf);
36 }
37
38 va_end(args);
39 }
40 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH v2 6/9 dt-bindings: arm: tegra: Add NVIDIA Tegra234 CBB2.0 binding
In reply to Sumit GuptaAdd device-tree binding documentation to represent CBB2.0 (Control Backbone) error handling driver. The driver prints debug information about failed transaction on receiving interrupt from CBB2.0.
--- .../arm/tegra/nvidia,tegra234-cbb.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml new file +70 -0
@@ -0,0 +1,70 @@ +# 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 Error handling driver device tree 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 CBB2.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: true + +required: + - compatible + - reg + - interrupts + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + cbb-fabric@1300000 { + compatible = "nvidia,tegra234-cbb-fabric"; + reg = <0x13a00000 0x400000>; + interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + };
Signature · 1 line
2.17.1
PATCH v2 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
@@ -73,6 +73,20 @@ #mbox-cells = <2>; }; + sce-fabric@b600000 { + compatible = "nvidia,tegra234-sce-fabric"; + reg = <0xb600000 0x40000>; + interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + rce-fabric@be00000 { + compatible = "nvidia,tegra234-rce-fabric"; + reg = <0xbe00000 0x40000>; + interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + hsp_aon: hsp@c150000 { compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp"; reg = <0x0c150000 0x90000>;
@@ -109,6 +123,27 @@ interrupt-controller; }; + aon-fabric@c600000 { + compatible = "nvidia,tegra234-aon-fabric"; + reg = <0xc600000 0x40000>; + interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + bpmp-fabric@d600000 { + compatible = "nvidia,tegra234-bpmp-fabric"; + reg = <0xd600000 0x40000>; + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + + dce-fabric@de00000 { + compatible = "nvidia,tegra234-sce-fabric"; + reg = <0xde00000 0x40000>; + interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; + gic: interrupt-controller@f400000 { compatible = "arm,gic-v3"; reg = <0x0f400000 0x010000>, /* GICD */
@@ -120,6 +155,13 @@ #interrupt-cells = <3>; interrupt-controller; }; + + cbb-fabric@0x13a00000 { + compatible = "nvidia,tegra234-cbb-fabric"; + reg = <0x13a00000 0x400000>; + interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>; + status = "okay"; + }; }; sysram@40000000 {
Signature · 1 line
2.17.1
PATCH v2 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 | 738 +++++++++++++++++++++++++++ include/soc/tegra/tegra234-cbb.h | 342 +++++++++++++ 4 files changed, 1082 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
@@ -164,7 +164,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 +738 -0
738 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
kernel test robot
build botRe: [Patch v2 8/9] soc: tegra: cbb: Add driver for Tegra234 CBB2.0
Thank you for the patch! Perhaps something to improve:
Hi Sumit,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on tegra-drm/drm/tegra/for-next v5.16-rc5 next-20211217] [cannot apply to tegra/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Sumit-Gupta/CBB-driver-for-Tegra194-Tegra234-Tegra-Grace/20211217-200840 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20211218/202112180744.BM6U6RpD-lkp(a)intel.com/config) compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/79bd78736f10c5f36ba4a18c6d313d62cae7b010
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sumit-Gupta/CBB-driver-for-Tegra194-Tegra234-Tegra-Grace/20211217-200840 git checkout 79bd78736f10c5f36ba4a18c6d313d62cae7b010
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/soc/tegra/cbb/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
drivers/soc/tegra/cbb/tegra234-cbb.c: In function 'print_errlog_err':
>> drivers/soc/tegra/cbb/tegra234-cbb.c:260:44: warning: variable 'access_id' set but not used [-Wunused-but-set-variable]
260 | u8 beat_size = 0, access_type = 0, access_id = 0;
| ^~~~~~~~~vim +/access_id +260 drivers/soc/tegra/cbb/tegra234-cbb.c
255
256 static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_record *errmon)
257 {
258 u8 cache_type = 0, prot_type = 0, burst_length = 0;
259 u8 mstr_id = 0, grpsec = 0, vqc = 0, falconsec = 0;
> 260 u8 beat_size = 0, access_type = 0, access_id = 0; 261 u8 slave_id = 0, fab_id = 0, burst_type = 0; 262 char fabric_name[20]; 263 264 mstr_id = FIELD_GET(FAB_EM_EL_MSTRID, errmon->mn_user_bits); 265 vqc = FIELD_GET(FAB_EM_EL_VQC, errmon->mn_user_bits); 266 grpsec = FIELD_GET(FAB_EM_EL_GRPSEC, errmon->mn_user_bits); 267 falconsec = FIELD_GET(FAB_EM_EL_FALCONSEC, errmon->mn_user_bits); 268 269 fab_id = FIELD_GET(FAB_EM_EL_FABID, errmon->mn_attr2); 270 slave_id = FIELD_GET(FAB_EM_EL_SLAVEID, errmon->mn_attr2); 271 272 access_id = FIELD_GET(FAB_EM_EL_ACCESSID, errmon->mn_attr1); 273 274 cache_type = FIELD_GET(FAB_EM_EL_AXCACHE, errmon->mn_attr0); 275 prot_type = FIELD_GET(FAB_EM_EL_AXPROT, errmon->mn_attr0); 276 burst_length = FIELD_GET(FAB_EM_EL_BURSTLENGTH, errmon->mn_attr0); 277 burst_type = FIELD_GET(FAB_EM_EL_BURSTTYPE, errmon->mn_attr0); 278 beat_size = FIELD_GET(FAB_EM_EL_BEATSIZE, errmon->mn_attr0); 279 access_type = FIELD_GET(FAB_EM_EL_ACCESSTYPE, errmon->mn_attr0); 280 281 print_cbb_err(file, "\t First logged Err Code : %s\n", 282 t234_errmon_errors[errmon->err_type].errcode); 283 284 print_cbb_err(file, "\t MASTER_ID\t\t: %s\n", errmon->tegra_cbb_master_id[mstr_id]); 285 print_cbb_err(file, "\t Address\t\t: 0x%llx\n", (u64)errmon->addr_access); 286 287 print_cache(file, cache_type); 288 print_prot(file, prot_type); 289 290 print_cbb_err(file, "\t Access_Type\t\t: %s", (access_type) ? "Write\n" : "Read\n"); 291 292 if (fab_id == PSC_FAB_ID) 293 strcpy(fabric_name, "psc-fabric"); 294 else if (fab_id == FSI_FAB_ID) 295 strcpy(fabric_name, "fsi-fabric"); 296 else 297 strcpy(fabric_name, errmon->name); 298 299 print_cbb_err(file, "\t Fabric\t\t: %s\n", fabric_name); 300 print_cbb_err(file, "\t Slave_Id\t\t: 0x%x\n", slave_id); 301 print_cbb_err(file, "\t Burst_length\t\t: 0x%x\n", burst_length); 302 print_cbb_err(file, "\t Burst_type\t\t: 0x%x\n", burst_type); 303 print_cbb_err(file, "\t Beat_size\t\t: 0x%x\n", beat_size); 304 print_cbb_err(file, "\t VQC\t\t\t: 0x%x\n", vqc); 305 print_cbb_err(file, "\t GRPSEC\t\t: 0x%x\n", grpsec); 306 print_cbb_err(file, "\t FALCONSEC\t\t: 0x%x\n", falconsec);
307
308 if ((fab_id == PSC_FAB_ID) || (fab_id == FSI_FAB_ID))
309 return;
310
311 if (!strcmp(errmon->noc_errors[errmon->err_type].errcode, "TIMEOUT_ERR")) {
312 tegra234_lookup_slave_timeout(file, errmon, slave_id, fab_id);
313 return;
314 }
315 print_cbb_err(file, "\t Slave\t\t\t: %s\n", errmon->sn_addr_map[slave_id].slave_name);
316 }
317
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
PATCH v2 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 | 93 +++++++++++- include/soc/tegra/tegra-grace-cbb.h | 219 +++++++++++++++++++++++++++ 2 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 include/soc/tegra/tegra-grace-cbb.h
drivers/soc/tegra/cbb/tegra234-cbb.c +91 -2
@@ -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,33 @@ 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);
@@ -278,7 +299,8 @@ static void print_errlog_err(struct seq_file *file, struct tegra_cbb_errmon_reco beat_size =FIELD_GET (FAB_EM_EL_BEATSIZE , errmon->mn_attr0); access_type =FIELD_GET (FAB_EM_EL_ACCESSTYPE , errmon->mn_attr0); -print_cbb_err (file,"\t First logged Err Code : %s\n" , +print_cbb_err (file,"\n" ); +print_cbb_err (file,"\t Error Code\t\t: %s\n" , t234_errmon_errors[errmon->err_type].errcode);print_cbb_err (file,"\t MASTER_ID\t\t: %s\n" , errmon->tegra_cbb_master_id[mstr_id]);
@@ -296,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) { +print_cbb_err (file,"\t Requester_Socket_Id\t: 0x%x\n" , + requester_socket_id); +print_cbb_err (file,"\t Local_Socket_Id\t: 0x%x\n" , + local_socket_id); +print_cbb_err (file,"\t No. of NUMA_NODES\t: 0x%x\n" , +num_possible_nodes ()); + } +print_cbb_err (file,"\t Fabric\t\t: %s\n" , fabric_name);print_cbb_err (file,"\t Slave_Id\t\t: 0x%x\n" , slave_id);print_cbb_err (file,"\t Burst_length\t\t: 0x%x\n" , burst_length);
@@ -582,6 +613,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},
@@ -599,6 +647,36 @@ 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 acpi_device_id tegra_grace_cbb_acpi_ids[] = { + {"NVDA1070" }, + { }, +}; +MODULE_DEVICE_TABLE (acpi, tegra_grace_cbb_acpi_ids); + +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 ; +} +static int tegra234_cbb_errmon_init (const struct tegra_cbb_fabric_data *pdata,struct tegra_cbb *cbb,struct resource *res_base)
@@ -643,10 +721,20 @@ 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 device *dev = &pdev->dev; +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 (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 ;
@@ -715,6 +803,7 @@ static struct platform_driver tegra234_cbb_driver = { .owner = THIS_MODULE, .name = "tegra234-cbb", .of_match_table = of_match_ptr(tegra234_cbb_dt_ids), + .acpi_match_table = ACPI_PTR(tegra_grace_cbb_acpi_ids),#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