Add support for K3 BIST
Subsystems (3)
v3 cover Add support for K3 BIST
This series implements a driver for the BIST (Built-In Self Test) module for K3 devices. The BIST driver must ideally support triggering of BIST tests, both PBIST (Memory BIST) and LBIST (Logic BIST) on a core. Both tests are destructive in nature. Please see links [1] and [2] for further information regarding the two.
At boot up, BIST is executed by hardware for the MCU domain automatically as part of HW POST. So BIST has been checked only for the MCU domain when U-Boot comes up in the usual U-Boot to Linux boot flow. To facilitate the use-case where some safe firmware is intended to be run on a safe core, it is best to have triggered the BIST tests on that core. As an example, we take triggering the BIST tests on the MAIN R52_x cores. The triggering patch is kept as DONOTMERGE.
The general procedure for triggering BIST on a core is:
1. Power on the core under test following a sequence
2. Trigger the BIST test
3. Reset the core under test following a sequence
BIST tests are triggered from A72 SPL where the DM (Device Manager firmware that handles power management) is already up and can perform these power sequences for us.
Boot logs (with LOG_DEBUG and CONFIG_K3_BIST enabled):
https://gist.github.com/nehamalcom/b96785259e64a9ebab0b2571ead3b299
Changes since v2:
-----------------
https://lore.kernel.org/all/[email protected]/
- Udit
- code cleanup and minor optimizations
- reorder patch with DONOTMERGE at the end
- Manorit
- move MCU4_O BIST code into a separate function
Changes since v1:
-----------------
https://lore.kernel.org/all/[email protected]/
- Udit
- alignment and macro naming corrections
- move debug prints to printf for errors
- split to separate SoC BIST header file
- drop enabling CONFIG_K3_BIST by default (patch 3/4)
- unmark triggering of BIST as a DONOTMERGE patch
RFC:
----
https://lore.kernel.org/all/[email protected]/
[1] https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/sdl/sdl_docs/userguide/j721e/modules/pbist.html#introduction
[2] https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/sdl/sdl_docs/userguide/j721e/modules/lbist.html#introduction
Neha Malcom Francis (3):
drivers: misc: k3_bist: Add K3 BIST driver
arm: mach-k3: j784s4_init: Trigger LBIST and PBIST on MAIN R5 2_0
DONOTMERGE: arm: dts: k3-j784s4-main: Add PBIST_14 node
arch/arm/mach-k3/j784s4/j784s4_init.c | 52 ++ drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/k3_bist.c | 805 ++++++++++++++++++ drivers/misc/k3_bist_static_data.h | 673 +++++++++++++++ drivers/misc/k3_j784s4_bist_static_data.h | 388 +++++++++ dts/upstream/src/arm64/ti/k3-j784s4-main.dtsi | 11 + include/k3_bist.h | 44 + 8 files changed, 1982 insertions(+) create mode 100644 drivers/misc/k3_bist.c create mode 100644 drivers/misc/k3_bist_static_data.h create mode 100644 drivers/misc/k3_j784s4_bist_static_data.h create mode 100644 include/k3_bist.h
Signature · 1 line
2.34.1
PATCH v3 1/3 drivers: misc: k3_bist: Add K3 BIST driver
Add a driver for the BIST module that support triggering of both PBIST (Memory BIST) and LBIST (Logic BIST) tests. Also expose the relevant operations and functions that would be required for an end user to trigger the tests.
---
Changes since v2:
- code cleanup and minor optimizations
- reorder patch with DONOTMERGE at the end
drivers/misc/Kconfig | 8 + drivers/misc/Makefile | 1 + drivers/misc/k3_bist.c | 805 ++++++++++++++++++++++ drivers/misc/k3_bist_static_data.h | 673 ++++++++++++++++++ drivers/misc/k3_j784s4_bist_static_data.h | 388 +++++++++++ include/k3_bist.h | 44 ++ 6 files changed, 1919 insertions(+) create mode 100644 drivers/misc/k3_bist.c create mode 100644 drivers/misc/k3_bist_static_data.h create mode 100644 drivers/misc/k3_j784s4_bist_static_data.h create mode 100644 include/k3_bist.h
drivers/misc/Kconfig +8 -0
@@ -664,6 +664,14 @@ config ESM_K3 help Support ESM (Error Signaling Module) on TI K3 SoCs. +config K3_BIST + bool "Enable K3 BIST driver" + depends on ARCH_K3 + help + Support BIST (Built-In Self Test) module on TI K3 SoCs. This driver + supports running both PBIST (Memory BIST) and LBIST (Logic BIST) on + a region or IP in the SoC. + config MICROCHIP_FLEXCOM bool "Enable Microchip Flexcom driver" depends on MISC
drivers/misc/Makefile +1 -0
@@ -89,6 +89,7 @@ obj-$(CONFIG_JZ4780_EFUSE) += jz4780_efuse.o obj-$(CONFIG_MICROCHIP_FLEXCOM) += microchip_flexcom.o obj-$(CONFIG_K3_AVS0) += k3_avs.o obj-$(CONFIG_ESM_K3) += k3_esm.o +obj-$(CONFIG_K3_BIST) += k3_bist.o obj-$(CONFIG_ESM_PMIC) += esm_pmic.o obj-$(CONFIG_SL28CPLD) += sl28cpld.o obj-$(CONFIG_SPL_SOCFPGA_DT_REG) += socfpga_dtreg.o
drivers/misc/k3_bist.c new file +805 -0
805 lines not on this page · raw message
drivers/misc/k3_bist_static_data.h new file +673 -0
673 lines not on this page · raw message
drivers/misc/k3_j784s4_bist_static_data.h new file +388 -0
388 lines not on this page · raw message
include/k3_bist.h new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v3 2/3 arm: mach-k3: j784s4_init: Trigger LBIST and PBIST on MAIN R5 2_0
In reply to Neha Malcom FrancisTrigger all tests of PBIST and LBIST using appropriate calls to set the core under test (MAIN R5 2_0) to it's required state.
---
Changes since v2:
- move MCU4_0 BIST code into a separate function
arch/arm/mach-k3/j784s4/j784s4_init.c | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
arch/arm/mach-k3/j784s4/j784s4_init.c +52 -0
@@ -17,6 +17,7 @@#include <dm/pinctrl.h> #include <mmc.h> #include <remoteproc.h> +#include <k3_bist.h> #include "../sysfw-loader.h" #include "../common.h"
@@ -122,6 +123,48 @@ static void setup_navss_nb(void)writel (NB_THREADMAP_BIT2 , (uintptr_t )NAVSS0_NBSS_NB1_CFG_NB_THREADMAP ); } +/* Execute and check results of BIST executed on MCU1_x and MCU4_O */ +static void run_bist_j784s4 (struct udevice *dev) +{ +struct bist_ops *ops; +struct ti_sci_handle *handle; +int ret; + + ops = (struct bist_ops *)device_get_ops (dev); + handle =get_ti_sci_handle (); + +/* get status of HW POST PBIST on MCU1_x */ +if (ops->run_pbist_post ()) +panic ("HW POST LBIST on MCU1_x failed\n" ); + +/* trigger PBIST tests on MCU4_0 */ + ret =prepare_pbist (handle); + ret |= ops->run_pbist_neg (); + ret |=deprepare_pbist (handle); + + ret |=prepare_pbist (handle); + ret |= ops->run_pbist (); + ret |=deprepare_pbist (handle); + + ret |=prepare_pbist (handle); + ret |= ops->run_pbist_rom (); + ret |=deprepare_pbist (handle); + +if (ret) +panic ("PBIST on MCU4_0 failed: %d\n" , ret); + +/* get status of HW POST PBIST on MCU1_x */ +if (ops->run_lbist_post ()) +panic ("HW POST LBIST on MCU1_x failed\n" ); + +/* trigger LBIST tests on MCU1_x */ + ret =prepare_lbist (handle); + ret |= ops->run_lbist (); + ret |=deprepare_lbist (handle); +if (ret) +panic ("LBIST on MCU4_0 failed: %d\n" , ret); +} +/* * This uninitialized global variable would normal end up in the .bss section, * but the .bss is cleared between writing and reading this variable, so move
@@ -251,6 +294,15 @@ void board_init_f(ulong dummy)printf ("AVS init failed: %d\n" , ret); } +if (!IS_ENABLED (CONFIG_CPU_V7R ) &&IS_ENABLED (CONFIG_K3_BIST )) { + ret =uclass_get_device_by_driver (UCLASS_MISC , +DM_DRIVER_GET (k3_bist), + &dev); +if (ret) +panic ("Failed to get BIST device: %d\n" , ret); +run_bist_j784s4 (dev); + } +if (IS_ENABLED (CONFIG_CPU_V7R ))setup_navss_nb ();
Signature · 1 line
2.34.1
PATCH v3 3/3 DONOTMERGE: arm: dts: k3-j784s4-main: Add PBIST_14 node
In reply to Neha Malcom FrancisAdd DT node for PBIST_14 that is responsible for triggering the PBIST self-tests for the MAIN_R5_2_x cores.
---
Linux dt-binding patch
https://lore.kernel.org/all/[email protected]/
Changes since v2:
- s/ti,bist-instance/ti,bist-under-test
dts/upstream/src/arm64/ti/k3-j784s4-main.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
dts/upstream/src/arm64/ti/k3-j784s4-main.dtsi +11 -0
@@ -113,6 +113,17 @@ status = "disabled"; }; }; + + bist_main14: bist@33c0000 { + compatible = "ti,j784s4-bist"; + reg = <0x00 0x033c0000 0x00 0x400>, + <0x00 0x0010c1a0 0x00 0x01c>; + reg-names = "cfg", "ctrl_mmr"; + clocks = <&k3_clks 237 7>; + power-domains = <&k3_pds 237 TI_SCI_PD_EXCLUSIVE>; + bootph-pre-ram; + ti,bist-under-test = <343>, <344>, <365>, <366>; + }; }; &scm_conf {
Signature · 1 line
2.34.1
Re: [PATCH v3 3/3] DONOTMERGE: arm: dts: k3-j784s4-main: Add PBIST_14 node
Quoted 7 lines · Neha Malcom Francis
Add DT node for
PBIST_14that is responsible for triggering the PBIST self-tests for theMAIN_R5_2_xcores.Signed-off-by Neha Malcom Francis <[email protected]>---
Linux dt-binding patch
https://lore.kernel.org/all/[email protected]/
Please hold off till the binding is closed out with Krystoff.
Quoted 32 lines
Changes since v2:
- s/ti,bist-instance/ti,bist-under-testdts/upstream/src/arm64/ti/k3-j784s4-main.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)dts/upstream/src/arm64/ti/k3-j784s4-main.dtsi +11
-0@@ -113,6 +113,17 @@ status = "disabled"; }; }; + + bist_main14: bist@33c0000 { + compatible = "ti,j784s4-bist"; + reg = <0x00 0x033c0000 0x00 0x400>, + <0x00 0x0010c1a0 0x00 0x01c>; + reg-names = "cfg", "ctrl_mmr"; + clocks = <&k3_clks 237 7>; + power-domains = <&k3_pds 237 TI_SCI_PD_EXCLUSIVE>; + bootph-pre-ram; + ti,bist-under-test = <343>, <344>, <365>, <366>; + }; }; &scm_conf {Signature · 1 line
2.34.1
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Re: [PATCH v3 3/3] DONOTMERGE: arm: dts: k3-j784s4-main: Add PBIST_14 node
Quoted 11 lines · Nishanth Menon
Quoted 7 lines · Neha Malcom Francis
Add DT node for
PBIST_14that is responsible for triggering the PBIST self-tests for theMAIN_R5_2_xcores.Signed-off-by Neha Malcom Francis <[email protected]>---
Linux dt-binding patch
https://lore.kernel.org/all/[email protected]/Please hold off till the binding is closed out with Krystoff.
Yes will do
Quoted 33 lines
Quoted 32 lines
Changes since v2:
- s/ti,bist-instance/ti,bist-under-testdts/upstream/src/arm64/ti/k3-j784s4-main.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)dts/upstream/src/arm64/ti/k3-j784s4-main.dtsi +11
-0@@ -113,6 +113,17 @@ status = "disabled"; }; }; + + bist_main14: bist@33c0000 { + compatible = "ti,j784s4-bist"; + reg = <0x00 0x033c0000 0x00 0x400>, + <0x00 0x0010c1a0 0x00 0x01c>; + reg-names = "cfg", "ctrl_mmr"; + clocks = <&k3_clks 237 7>; + power-domains = <&k3_pds 237 TI_SCI_PD_EXCLUSIVE>; + bootph-pre-ram; + ti,bist-under-test = <343>, <344>, <365>, <366>; + }; }; &scm_conf {Signature · 1 line
2.34.1
Signature · 2 lines
Thanking You Neha Malcom Francis