cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP135 TZC Errors At Linux Kernel Load (256MB RAM)

TommyTom
Associate II

EDIT: Sorry I accidentally put this in the wrong topic.

Hi,

I am trying to bring up a board using a STM32MP135 and 256MB RAM (using one of these). I have followed the Wiki instructions to modify for 256MB RAM, and the project previously worked fine. Then I left it for maybe six months and come back to find the memory mapping has changed and now I am getting TZC errors right at "Starting Kernel ...".

I'm using Buildroot with TF-A v2.8-stm32mp-r2, Optee-OS 3.19.0-stm32mp-r2, U-Boot v2022.10-stm32mp-r2, and Linux v6.1-stm32mp-r2. Full Buildroot tree.

I have tried modifying CFG_TZDRAM_START in Optee, DDR_NS_, and, DDR_SEC_ properties in TF-A and I can generate even more memory errors, but this is as far as I can get. Can anybody point me in the right direction, or suggest some things to try? What happens right at "Starting Kernel"? As far as I know, U-Boot must be trying to put the Linux kernel in to protected memory but I cannot figure out why or where that is specified?

Thanks for any help you can offer.

 

 

NOTICE: CPU: STM32MP135D Rev.Y NOTICE: Model: BasicCode STM32MP135 Dev Board TF-A WARNING: regulator_get_by_phandle: phandle 16 not found WARNING: VDD unknown INFO: Reset reason (0x34): INFO: Pad Reset from NRST INFO: FCONF: Reading TB_FW firmware configuration file from: 0x2ffe0000 INFO: FCONF: Reading firmware configuration information for: stm32mp_io INFO: FCONF: Reading firmware configuration information for: stm32mp_fuse INFO: Using SDMMC INFO: Instance 1 INFO: Boot used partition fsbl1 NOTICE: BL2: v2.8-stm32mp1-r2.0(debug):() NOTICE: BL2: Built : 10:10:11, Sep 20 2024 INFO: BL2: Doing platform setup INFO: RAM: DDR3-DDR3L 16bits 533000kHz INFO: Memory size = 0x10000000 (256 MB) INFO: BL2: Loading image id 1 INFO: Loading image id=1 at address 0x30006000 INFO: Image id=1 loaded: 0x30006000 - 0x30006236 INFO: FCONF: Reading FW_CONFIG firmware configuration file from: 0x30006000 INFO: FCONF: Reading firmware configuration information for: mce_config INFO: FCONF: Reading firmware configuration information for: dyn_cfg INFO: FCONF: Reading firmware configuration information for: stm32mp1_firewall INFO: BL2: Loading image id 4 INFO: Loading image id=4 at address 0xce000000 INFO: Image id=4 loaded: 0xce000000 - 0xce00001c INFO: OPTEE ep=0xce000000 INFO: OPTEE header info: INFO: magic=0x4554504f INFO: version=0x2 INFO: arch=0x0 INFO: flags=0x0 INFO: nb_images=0x1 INFO: BL2: Loading image id 8 INFO: Loading image id=8 at address 0xce000000 INFO: Image id=8 loaded: 0xce000000 - 0xce07e540 INFO: BL2: Loading image id 2 INFO: Loading image id=2 at address 0xc0400000 INFO: Image id=2 loaded: 0xc0400000 - 0xc040f100 INFO: BL2: Skip loading image id 16 INFO: BL2: Loading image id 5 INFO: Loading image id=5 at address 0xc0000000 INFO: Image id=5 loaded: 0xc0000000 - 0xc011f3e4 NOTICE: BL2: Booting BL32 INFO: Entry point address = 0xce000000 INFO: SPSR = 0x1d3 I/TC: Early console on UART#4 I/TC: I/TC: Embedded DTB found I/TC: OP-TEE version: Unknown_3.19 (gcc version 12.2.0 (Buildroot 2021.11-4428-g6b6741b)) #1 Fri Sep 20 00:09:57 UTC 2024 arm I/TC: WARNING: This OP-TEE configuration might be insecure! I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html I/TC: Primary CPU initializing I/TC: WARNING: All debug access are allowed I/TC: Platform stm32mp1: flavor PLATFORM_FLAVOR - DT stm32mp135_dev_board-optee.dts I/TC: OP-TEE ST profile: secure_and_system_services I/TC: DTB enables console (non-secure) E/TC:0 0 call_initcalls:43 Initcall __text_start + 0x00075464 failed I/TC: Primary CPU switching to normal world boot optee optee: OP-TEE: revision 3.19 stm32-usbphyc usbphyc@5a006000: Can't get phy-supply regulator clk_register: failed to get ck_usbo_48m device (parent of usbo_k) U-Boot 2022.10-stm32mp-r2 (Sep 20 2024 - 10:10:04 +1000) CPU: STM32MP135D Rev.Y Model: BasicCode STM32MP135 Dev Board Linux Board: stm32mp1 in trusted mode (st,stm32mp135) DRAM: 256 MiB optee optee: OP-TEE: revision 3.19 Clocks: - MPU : 1000 MHz - AXI : 266.500 MHz - PER : 24 MHz - DDR : 533 MHz Core: 250 devices, 31 uclasses, devicetree: board WDT: Started watchdog with servicing (32s timeout) NAND: 0 MiB MMC: stm32_sdmmc2 mmc@58005000: pinctrl_select_state_full: pinctrl_config_one: err=-22 STM32 SD/MMC: 0 Loading Environment from MMC... Invalid ENV offset in MMC, copy=0 In: serial Out: serial Err: serial invalid MAC address 0 in OTP 00:00:00:00:00:00 Can't get adc device(-19) Net: No ethernet found. No EFI system partition Hit any key to stop autoboot: 0 Boot over mmc0! Saving Environment to MMC... Invalid ENV offset in MMC, copy=1 Failed (1) switch to partitions #0, OK mmc0 is current device Scanning mmc 0:4... Found /boot/extlinux/extlinux.conf Retrieving file: /boot/extlinux/extlinux.conf 1: stm32mp135-buildroot Retrieving file: /boot/uImage append: root=/dev/mmcblk0p4 rootwait Retrieving file: /boot/stm32mp135_dev_board.dtb ## Booting kernel from Legacy Image at c2000000 ... Image Name: Linux-6.1.82 Created: 2024-09-19 23:22:21 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 7963160 Bytes = 7.6 MiB Load Address: c2000000 Entry Point: c2000000 Verifying Checksum ... OK ## Flattened Device Tree blob at c6000000 Booting using the fdt blob at 0xc6000000 Loading Kernel Image Loading Device Tree to caad9000, end caaeab5c ... OK Starting kernel ... E/TC:0 tzc_it_handler:79 TZC permission failure E/TC:0 dump_fail_filter:420 Permission violation on filter 0 E/TC:0 dump_fail_filter:425 Violation @0xce0437c0, non-secure privileged read, AXI ID 5c8 E/TC:0 Panic at core/arch/arm/plat-stm32mp1/plat_tzc400.c:84 <tzc_it_handler> E/TC:0 TEE load address @ 0xce000000 E/TC:0 Call stack: E/TC:0 0xce00361d E/TC:0 0xce01deab E/TC:0 0xce0059b9 E/TC:0 0xce01d4f1 E/TC:0 0xce0445c9 E/TC:0 0xce000340
View more

 

 

I noted that my BL32 is loading at address 0xce000000 instead of 0xce200000 but when I modify CFG_TZDRAM_START and DDR_SEC_BASE to move it I just get more errors.

I also noticed that the Wiki specifies CFG_TZDRAM_START, and DDR_SEC_BASE in the memory map on the top of the document are 0xce200000, but then later specify that they should each be set to 0xce000000 in conf.mk and the the TF-A device tree respectively, is this correct?

 

1 ACCEPTED SOLUTION

Accepted Solutions
TommyTom
Associate II

I resolved the issue. In this case it was my "wake_up" node in my Linux device tree. I removed the "wake_up" node from the Linux device tree, AND "typec_wakeup", and "magic_wol" from the Optee device tree. I didn't not look too closely in to why they were causing a problem as I do not need them for my design.

The original question was whether this was a U-Boot problem, or TZC configuration issue, so I went on a bit of a wild goose chase thinking that U-Boot was attempting to put the Linux kernel in to protected memory. Turns out it was just some stray peripheral that I had completely forgotten about in the device tree.

 

View solution in original post

1 REPLY 1
TommyTom
Associate II

I resolved the issue. In this case it was my "wake_up" node in my Linux device tree. I removed the "wake_up" node from the Linux device tree, AND "typec_wakeup", and "magic_wol" from the Optee device tree. I didn't not look too closely in to why they were causing a problem as I do not need them for my design.

The original question was whether this was a U-Boot problem, or TZC configuration issue, so I went on a bit of a wild goose chase thinking that U-Boot was attempting to put the Linux kernel in to protected memory. Turns out it was just some stray peripheral that I had completely forgotten about in the device tree.