thanhduongvs / note

0 stars 0 forks source link

stm32mp1 uboot #13

Open thanhduongvs opened 1 year ago

thanhduongvs commented 1 year ago

openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15 TF-A v2.6 OP-TEE v3.16.0 Linux 5.15.24 U-Boot v2021.10

python3 ~/bin/repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-5.15-yocto-kirkstone-mp1-v22.06.15 python3 ~/bin/repo sync -j8

DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh bitbake st-image-core --runall=fetch bitbake -k st-image-core

v2021.10-stm32mp ef9715e76295f5f6aae49efdb51617b440b54deb ef9715e76295f5f6aae49efdb51617b440b54deb

git branch -M v2021.10-stm32mp git remote add origin git@github.com:OneKiwiTech/uboot-stm32mp.git git push -u origin v2021.10-stm32mp

u-boot-stm32mp-v2021.10-stm32mp optee-os-stm32mp-3.16.0-stm32mp

CONFIG_STM32MP1_DDR_INTERACTIVE=y CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_STM32=y export CROSS_COMPILE=arm-linux-gnueabihf- export CROSS_COMPILE=arm-ostl-linux-gnueabi- export ARCH=arm export KBUILD_OUTPUT=./build make distclean make onekiwi_somab_basic_defconfig make DEVICE_TREE=onekiwi-stm32mp151a-somab all -j8 DDR_INTERACTIVE=1 make DEVICE_TREE=onekiwi-stm32mp151a-somab DDR_INTERACTIVE=1 all -j8

STM32_Programmer_CLI -c port=usb1 -w build/u-boot-spl.stm32 0x01 --start 0x01

For OpenSTLinux, two U-Boot files are used by ST boards to generate the FIP file used by FSBL TF-A, with or without OP-TEE support:

BL33_CFG=u-boot.dtb : the U-Boot device tree, selected by DEVICE_TREE, loaded by TF-A BL2 and amended by secure monitor (SP-MIN or OP-TEE) BL33=u-boot-nodtb.bin: the U-Boot executable, loaded by TF-A BL2 started by secure monitor with BL33_CFG as parameter Nota: All the compiled device tree are available in $KBUILD_OUTPUT/arch/arm/dts/*.dtb. You can select them as BL33_CFG parameter without U-Boot recompilation.

See TF-A_overview for FIP details.

The file used to debug with gdb is

u-boot : elf file for U-Boot The file u-boot.stm32, i.e. the U-Boot binary with STM32 header, is no more generated and used in OpenSTlinux.

//////////////////////

make CROSS_COMPILE=arm-ostl-linux-gnueabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=sp_min STM32MP_EMMC=1 STM32MP_USB_PROGRAMMER=1 DTB_FILE_NAME=onekiwi-stm32mp151a-somab.dtb BL33=/home/vanson/working/u-boot/build/u-boot-nodtb.bin BL33_CFG=/home/vanson/working/u-boot/build/u-boot.dtb fip

make CROSS_COMPILE=arm-ostl-linux-gnueabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=sp_min STM32MP_EMMC=1 STM32MP_USB_PROGRAMMER=1 DTB_FILE_NAME=onekiwi-stm32mp151a-somab.dtb

make CROSS_COMPILE=arm-ostl-linux-gnueabi- PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 AARCH32_SP=sp_min STM32MP_EMMC=1 STM32MP_USE_STM32IMAGE=1 DTB_FILE_NAME=onekiwi-stm32mp151a-somab.dtb

STM32_Programmer_CLI -c port=usb1 -d tf-a_onekiwi.stm32 0x1 -s 0x1 -d fip.bin 0x3 -s 0x3 STM32_Programmer_CLI -c port=usb1 -w FlashLayout.tsv

STM32_Programmer.sh -c port=usb1 -w u-boot-spl.stm32 0x01 --start 0x01 STM32_Programmer.sh -c port=usb1 -w u-boot-spl.stm32 0x01 --start 0x01 STM32_Programmer_CLI -c port=usb1 -w ./build/u-boot-spl.stm32 0x01 --start 0x01

RAM: DDR3-DDR3L 16bits 533000kHz DDR invalid size : 0x4, expected 0x20000000 DRAM init failed: -22

ERROR ### Please RESET the board

RAM: DDR3-DDR3L 16bits 533000kHz DDR info.size: 0 DDR invalid size : 0x0, expected 0x20000000 DRAM init failed: -22

step 3 print dx0dllcr edit dx0dllcr 0x40008000 edit dx0dllcr 0x40004000 edit dx0dllcr 0x40001000 edit dx0dllcr 0x40002000 print dx0dllcr test 9

vcore 1.2 vddr 1.35 vdda 2.9 vdd 3v3 1v2 0 1v8 0

CONFIG_STM32MP1_DDR_INTERACTIVE=y CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_STM32=y

export CROSS_COMPILE=arm-ostl-linux-gnueabi- export ARCH=arm export KBUILD_OUTPUT=./build make distclean make stm32mp15_basic_defconfig make DEVICE_TREE=stm32mp157a-dk1 DDR_INTERACTIVE=1 all -j8 STM32_Programmer_CLI -c port=usb1 -w ./build/spl/u-boot-spl.stm32 0x01 --start 0x01

param cal

tuning 0

DX0DQSTR 0x3DB00002
DX0DQSTR 0x3DB02000

DX1DQSTR 0x3DB00002

execute 1:Bit de-skew Result: Failed [Cannot Deskew lines, there is no PASS region] Result: Failed [Cannot Deskew lines, there is no PASS region] Result: Failed [error = 2]

execute 2:Eye Training Result: Failed [Cannot DQS timings, there is no PASS region] Result: Failed [Cannot DQS timings, there is no PASS region] Result: Failed [error = 2]

DDR>tuning 0 execute 0:Read DQS gating Byte 0, R0DGSL = 0, R0DGPS = 2 Byte 1, R0DGSL = 0, R0DGPS = 2 Result: Pass [] print dx0dqstr print dx1dqstr edit dx0dqstr 0x3db02002 edit dx1dqstr 0x3db02002

DDR>tuning 0 execute 0:Read DQS gating Byte 0, R0DGSL = 2, R0DGPS = 1 Byte 1, R0DGSL = 0, R0DGPS = 2 Result: Pass []

dx0dqstr = 0x3DB01002 print dx0dqstr 0x3db01002 dx1dqstr = 0x3DB02000

DDR>tuning 1 execute 1:Bit de-skew Byte 0, DQS unit = 4, phase = 6 Byte 0, bit 0, DQ delay = 0 Byte 0, bit 1, DQ delay = 0 Byte 0, bit 2, DQ delay = 3 Byte 0, bit 3, DQ delay = 0 Byte 0, bit 4, DQ delay = 0 Byte 0, bit 5, DQ delay = 0 Byte 0, bit 6, DQ delay = 0 Byte 0, bit 7, DQ delay = 0 Result: Failed [Cannot Deskew lines, there is no PASS region] Result: Failed [error = 1]