Help in adding support for the i.MX8 chips to rustBoot

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Help in adding support for the i.MX8 chips to rustBoot

跳至解决方案
616 次查看
npashi
Contributor III

I'd like to add support for the i.MX8 chips to rustBoot and I'm hoping you could point me in the right direction w.r.t the following questions.

  1. documentation on NXP's i.MX8 container formats is sparse. Where can I find details on 'container-layouts' i.e. which bytes mean what and what makes-up a valid container.
  2. do we have a tool (of some sort) that can be used to inspect arbitrary containers.
  3. I was also wondering if someone could help me understand the i.MX8 boot-flow. In this case, I'm referring to the i.MX8M Nano, assuming secure-boot is not enabled
    1. SCU ROM code loads SCU-firmware into SCU-TCM and loads m4 and cortex-a app-firmware i.e. next-stage bootloader into SRAM from addresses/locations specified in the corresponding i.MX8 container.
    2. The SCU firmware is initialized and starts the ARM Cortex-M and Cortex-A cores
    3. SCU firmware then passes execution-control of cortex-a to the next-stage bootloader.
    4. In the case of the `nano`, we have to additionally train ddr4 memory and initialize or set-up DRAM.
    5. which then passes control to whatever comes next.
    6. Am I missing anything?
标签 (1)
0 项奖励
回复
1 解答
533 次查看
npashi
Contributor III

So, I managed to get this working. The container format is a 0x20 byte header with the following fields.

========= UNSIGNED WORKING DDR4 HEADER (OR) IVT =========
header.tag:       0xd1
header.length:    0x2000
header.version:   0x41
entry:            0x912000
reserved1:        0x00
dcd_ptr:          0x00
boot_data_ptr:    0x911fe0
self:             0x911fc0
csf:              0x93d9c0
reserved2:        0x0
boot_data.start:  0x911fc0
boot_data.size:   0x2da00
boot_data.plugin: 0x0

 Btw, I found the information I was looking for in the i.MX8M mini's reference manual - section 6.1.6 Program image (rather than the nano's).

PS: I put together a Rust implementation for the nano along with a working uart console. You can find the code here

Welcome to minicom 2.8

OPTIONS:
Compiled on Oct 25 2021, 04:59:49.
Port /dev/tty.usbserial-1101, 11:47:54

Press Meta-Z for help on special keys

[    0.000002] imx8mn-rs version 0.1.0
[    0.003485] Booting on: i.MX 8M Nano EVK
[    0.007385] Current privilege level: EL3
[    0.011295] Exception handling state:
[    0.014934]       Debug:  Masked
[    0.018143]       SError: Unmasked
[    0.021431]       IRQ:    Masked
[    0.024728]       FIQ:    Masked
[    0.027919] Drivers loaded:
[    0.030685]       1. i.MX 8M Nano Uart2
[    0.034428] Chars written: 388
[    0.037546] Counter Control Register: 259
[    0.041462]

[    0.042998]  ... wait forever

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
534 次查看
npashi
Contributor III

So, I managed to get this working. The container format is a 0x20 byte header with the following fields.

========= UNSIGNED WORKING DDR4 HEADER (OR) IVT =========
header.tag:       0xd1
header.length:    0x2000
header.version:   0x41
entry:            0x912000
reserved1:        0x00
dcd_ptr:          0x00
boot_data_ptr:    0x911fe0
self:             0x911fc0
csf:              0x93d9c0
reserved2:        0x0
boot_data.start:  0x911fc0
boot_data.size:   0x2da00
boot_data.plugin: 0x0

 Btw, I found the information I was looking for in the i.MX8M mini's reference manual - section 6.1.6 Program image (rather than the nano's).

PS: I put together a Rust implementation for the nano along with a working uart console. You can find the code here

Welcome to minicom 2.8

OPTIONS:
Compiled on Oct 25 2021, 04:59:49.
Port /dev/tty.usbserial-1101, 11:47:54

Press Meta-Z for help on special keys

[    0.000002] imx8mn-rs version 0.1.0
[    0.003485] Booting on: i.MX 8M Nano EVK
[    0.007385] Current privilege level: EL3
[    0.011295] Exception handling state:
[    0.014934]       Debug:  Masked
[    0.018143]       SError: Unmasked
[    0.021431]       IRQ:    Masked
[    0.024728]       FIQ:    Masked
[    0.027919] Drivers loaded:
[    0.030685]       1. i.MX 8M Nano Uart2
[    0.034428] Chars written: 388
[    0.037546] Counter Control Register: 259
[    0.041462]

[    0.042998]  ... wait forever

 

0 项奖励
回复