These are the steps I'm following:
[Yocto]
For recipes-kernel/linux
1. Created custom dts file with:
chosen {
bootargs = "console=ttyLP7,115200 earlycon";
stdout-path = &lpuart8;
};
...
&lpuart8 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart8>;
status = "okay";
};
...
&iomuxc {
pinctrl_uart8: uart8grp {
fsl,pins = <
MX93_PAD_GPIO_IO13__LPUART8_RX 0x31e
MX93_PAD_GPIO_IO12__LPUART8_TX 0x31e
>;
};
};
2. Patched arch/arm64/boot/dts/freescale/Makefile
+dtb-$(CONFIG_ARCH_MXC) += imx93-11x11-evk-custom.dtb
3. Inserted CONFIG_CONS_INDEX=8 into defconfig
4. Create linux-imx_%.bbappend and added:
do_patch:append(), do_configure:prepend(), do_install:append(), do_deploy:append() to make sure patches are applied and copied to deployment folder (works)
KERNEL_DEVICETREE:append = " \
freescale/imx93-11x11-evk-custom.dtb \
"
IMAGE_BOOT_FILES:append = " \
freescale/imx93-11x11-evk-custom.dtb \
"
For recipes-bsp/u-boot
5. Patched /arch/arm/dts/Makefile
+ imx93-11x11-evk-custom.dtb
6. Patched board/freescale/imx93_evk/imx93_evk.c
static iomux_v3_cfg_t const uart_pads[] = {
- MX93_PAD_UART1_RXD__LPUART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
- MX93_PAD_UART1_TXD__LPUART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO13__LPUART8_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+ MX93_PAD_GPIO_IO12__LPUART8_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
};
7. Patched include/configs/imx93_evk.h
- "console=ttyLP0,115200 earlycon\0" \
+ "console=ttyLP7,115200 earlycon\0" \
8. Patched /board/freescale/imx93_evk/spl.c
void board_init_f(ulong dummy)
memset(__bss_start, 0, __bss_end - __bss_start);
+ // Clock Root Control Register (CLOCK_ROOT32_CONTROL_SET - 0x1000)
+ // Clock Root Control Register (CLOCK_ROOT32_AUTHEN_SET - 0x1030)
+ __raw_writel(0xFFFF0300, 0x44451030); // Enable access to UART8
+ __raw_writel(0x01000000, 0x44451000); // Turn on clock for UART8
9. Then, built yocto:
[IMX-ATF]
I made modifications out of yocto for imx-atf
10. In /IMX_ATF/imx-atf/plat/imx/imx93/include/platform_def.h I changed
- #define IMX_LPUART_BASE U(0x44380000)
+ #define IMX_LPUART_BASE U(0x426a0000) // For UART8
11. Built IMX-ATF
export CROSS_COMPILE=aarch64-linux-gnu-
make PLAT=imx93 clean
make PLAT=imx93 all
12. Copied IMX_ATF/imx-atf/build/imx93/release/bl31.bin to /imx-mkimage/iMX93
13. Copied u-boot.bin and u-boot-spl.bin to /imx-mkimage/iMX93
14. Copied $DEPLOY_DIR/imx-boot-tools/mx93a1-ahab-container.img to /imx-mkimage/iMX93
15. Copied lpddr4_dmem*.bin and lpddr4_imem*.bin /imx-mkimage/iMX93
16. Copied imx93-11x11-evk-custom.dtb to /imx-mkimage/iMX93
17. Made imx-mkimage
make KERNEL_DTB=imx93-11x11-evk-custom.dtb SOC=iMX93 flash_singleboot
Note: I see "header tag missmatched 0" in the output below:
include autobuild.mak
34451+1 records in
34452+0 records out
137808 bytes (138 kB, 135 KiB) copied, 0.092699 s, 1.5 MB/s
./../mkimage_imx8 -commit > head.hash
if [ -f tee.bin ]; then \
if [ ]; then \
./../mkimage_imx8 -soc IMX9 -sw_version -c \
-ap bl31.bin a55 0x204E0000 \
-ap u-boot-hash.bin a55 0x80200000 \
-ap tee.bin a55 0x96000000 \
-out u-boot-atf-container.img; \
else \
./../mkimage_imx8 -soc IMX9 -c \
-ap bl31.bin a55 0x204E0000 \
-ap u-boot-hash.bin a55 0x80200000 \
-ap tee.bin a55 0x96000000 -out u-boot-atf-container.img; \
fi; \
else \
./../mkimage_imx8 -soc IMX9 -c \
-ap bl31.bin a55 0x204E0000 \
-ap u-boot-hash.bin a55 0x80200000 \
-out u-boot-atf-container.img; \
fi
SOC: IMX9
New Container: 0
AP: bl31.bin core: a55 addr: 0x204e0000
AP: u-boot-hash.bin core: a55 addr: 0x80200000
Output: u-boot-atf-container.img
CONTAINER FUSE VERSION: 0x00
CONTAINER SW VERSION: 0x0000
Platform: i.MX9
ivt_offset: 1024
container image offset (aligned):2000
csf_off 0x2400
flags: 0x10
Hash of the images =
1+0 records in
1+0 records out
49152 bytes (49 kB, 48 KiB) copied, 0.000234421 s, 210 MB/s
94+1 records in
94+1 records out
48257 bytes (48 kB, 47 KiB) copied, 0.000655148 s, 73.7 MB/s
AP file_offset = 0x2000 size = 0xc000
Hash of the images =
1+0 records in
1+0 records out
1152000 bytes (1.2 MB, 1.1 MiB) copied, 0.00112789 s, 1.0 GB/s
2249+1 records in
2249+1 records out
1151705 bytes (1.2 MB, 1.1 MiB) copied, 0.00545241 s, 211 MB/s
AP file_offset = 0xe000 size = 0x119400
CST: CONTAINER 0 offset: 0x0
CST: CONTAINER 0: Signature Block: offset is at 0x110
Offsets = 0x0 0x110
DONE.
Note: Please copy image to offset: IVT_OFFSET + IMAGE_OFFSET
./../mkimage_imx8 -soc IMX9 -append mx93a1-ahab-container.img -c -ap u-boot-spl-ddr.bin a55 0x2049A000 -out flash.bin
SOC: IMX9
New Container: 0
AP: u-boot-spl-ddr.bin core: a55 addr: 0x2049a000
Output: flash.bin
CONTAINER FUSE VERSION: 0x00
CONTAINER SW VERSION: 0x0000
Platform: i.MX9
ivt_offset: 1024
header tag missmatched 0
container image offset (aligned):1a000
csf_off 0x1a400
flags: 0x10
Hash of the images =
1+0 records in
1+0 records out
221184 bytes (221 kB, 216 KiB) copied, 0.000262497 s, 843 MB/s
431+1 records in
431+1 records out
221136 bytes (221 kB, 216 KiB) copied, 0.00115518 s, 191 MB/s
AP file_offset = 0x1a000 size = 0x36000
CST: CONTAINER 0 offset: 0x400
CST: CONTAINER 0: Signature Block: offset is at 0x490
Offsets = 0x400 0x490
DONE.
Note: Please copy image to offset: IVT_OFFSET + IMAGE_OFFSET
append u-boot-atf-container.img at 320 KB, psize=1024
1181+0 records in
1181+0 records out
1209344 bytes (1.2 MB, 1.2 MiB) copied, 0.0042381 s, 285 MB/s
18. When I then attempt to apply to my board with UUU (uuu -v -b emmc flash.bin) it doesn't seem to complete.
However, I added a custom print in the SPL.C file and it DOES print out, so I guess that part is working.
However...the debug output STILL comes from UART1, and when it goes to load the kernel, no more print messages are seen. So either it hasn't worked at all, going to the wrong UART or something else is wrong.