Q&A

Q: Bare-metal debugging possible?

Apparently: https://linux-sunxi.org/Allwinner_Nezha#JTAG – but what is the physical connection?

Q: What is the pre-flashed image in MangoPi MQ?

A: None: there is no persistent memory besides the SD card

Q: What is BOOT0?

A: it is the Allwinner SPL (Secondary Program Loader).

It is something that you link into your boot image. Apparently U-Boot obsoletes it: https://github.com/smaeul/u-boot/releases/tag/d1-2022-10-31 (but is it in mainline U-Boot too?)

Searching for get_pmu_exist (appears in boot0 output) yields a lot of other interesting links.

Some MQ-specific configuration here: https://github.com/amessier/sun20i_d1_spl/commit/234b2e905a88f29db91768a25ad1c779594a598e

Q: How to copy .img (IMAGEWTY) files to SD card on Linux?

A: Must use OpenixCard dump feature.

Q: Is OpenSBI needed for bare-metal development?

Not really, it’s a way to have platform firmware in H-mode and OS or hypervisor in S-mode. Bare-metal code can just run in M-mode directly.

Q: xfel vs sunxi-fel

sunxi-fel -> Invalid command ddr

I guess it doesn’t support the F133

Q: Can switch between RV64 and RV32

No, the C906 core doesn’t support this, neither in S- or U-mode.

Q: In light of above, can we at least convince GCC that 32-bit pointers would do?

There is a proposal: https://lpc.events/event/17/contributions/1475/attachments/1186/2442/rv64ilp32_%20Run%20ILP32%20on%20RV64%20ISA.pdf

Is it ratified or at least widely accepted, though?

A future version of this specification may define an ILP32 ABI for the RV64 ISA, but currently this is not a supported operating mode

Might need to build toolchain from source. TBC

TV Encoder (TVE)

Boot images

Tina Linux

RT-Thread example

mangopi-mq-riscv-2023-1-serial-console.img

mq-r-f133-rtl8189fs-5113-dns-uart0.img

  • from https://mangopi.org/mangopi_mq, but filename suggests it’s for the MQ-R
  • couldn’t get it to work, no output on UART0 header
  • might have messed up the copy process

D1s bare-metal code