Assorted resources about the Allwinner Nezha D1 RISC-V development board Some useful links • Allwinner documentation • sunxi wiki: Allwinner Nezha page • sunxi wiki: D1 page • RVBoards D1 demos • RVBoards D1 documentation (source) • riscv.org devboard-community mailing list • D1 40-pin header pin-out label • Fedora RISC-V wiki pages: D1-specific information, generic installation guide • Tiny FEL tools for Allwinner SoC • D1 buildroot for Docker containers • Source code of this page Hardware Power supply Robert Lipe notes that Apple hardware and Nezha D1 do not work together using a USB-C to USB-C cable. It should be possible to work around the problem using the USB-A to USB-C cable(s) supplied with the board. SPI NAND layout Kernel 5.4.61 (as reported by Gabe R): mtd0: 00100000 00040000 "boot0" mtd1: 00400000 00040000 "uboot" mtd2: 00100000 00040000 "secure_storage" mtd3: 0fa00000 00040000 "sys" Kernel 5.16.0-rc2: # cat /proc/mtd dev: size erasesize name mtd0: 10000000 00020000 "spi0.0" Some files (may be mirrored locally, or not) Filename and Description Packed Packed SHA-1 Unpacked Unpacked SHA-1 Notes Size Size fedora-riscv64-d1-developer-xfce-rawhide-Rawhide-20220104-012902.n.0-sda.raw.zst 3071767070 13589544960 bytes a9b3314ee9fb420bfc60677db8c1d816ac98001c bytes 2633feda290654b549ebd4e231a2fb09b1f19457 6 Fedora, zstd-compressed plain disk image (2.86 GiB, (12.66 GiB, 3.07 GB) 13.59 GB) fedora-riscv64-d1-developer-xfce-rawhide-Rawhide-20211130-010217.n.0-sda.raw.zst 2949853513 13589544960 bytes 46d9baf4c2ab47bb476cee0ec5c68ab5fcd58929 bytes 5fa09af0a1af148f7fe70a97aaf028ee47899fe0 6, 7, Fedora, zstd-compressed plain disk image (2.75 GiB, (12.66 GiB, 8, 9 (local copy) 2.95 GB) 13.59 GB) fedora-2021-11-30_kernel_5.4.61_extlinux_manual_1GB.txt boot log for the above Fedora image (kernel 5.4.61 via original U-Boot, 76059 bytes 7 extlinux and manual input) fedora-2021-11-30_kernel_5.16.0-rc2_manual_GRUB.txt boot log for the above Fedora image (kernel 5.16.0-rc2 via custom U-Boot, GRUB 73595 bytes 8 and manual input) 1384960 fedora-2021-11-30_D1-1GB_bootloader.bin bytes 8ac5752e14ef8db5cc6d82d26e70684c05e4d4eb 9 custom D1-1GB bootloader block for the above Fedora image (1.32 MiB, 1.38 MB) Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide-20210912.n.0-sda.raw.zst 3309078513 13589544960 Fedora, zstd-compressed plain disk image bytes 4e82f8712f818f929f21303a8b514bb543d2c16e bytes 35cdb5624ce839c8e4327b97f51443a8873adf14 6, 7 (local copy) (3.08 GiB, (12.66 GiB, 3.31 GB) 13.59 GB) D1_boot_Fedora_complete_2021-09-12.txt 64140 bytes boot log for the above minicom5.cap.txt 26595 bytes 5 boot log for the above RVBoards_D1_Debian_img_v0.6.1.zip 1199870674 3685322752 Debian 0.6.1, zip-compressed proprietary (PhoenixCard?) disk image bytes 8737cd46c2ffa5e92b39c524b9fa74d2e06e616f bytes 548a7086417d58779e56844baaa63ac15e234868 2 (local copy) (1.12 GiB, (3.43 GiB, 1.20 GB) 3.69 GB) RVBoards_D1_Debian_lxde_img_linux_v0.4.1.img.zip 1339477995 4330408448 Debian 0.4.1, zip-compressed plain disk image bytes 8ac24e9e7515fe3838fc46fe997a05ca93ab359f bytes 5bd7b5f573e9067b2408bfc9179d65e9650618d4 2, 4 (local copy) (1.25 GiB, (4.03 GiB, 1.34 GB) 4.33 GB) minicom6.cap.txt 26712 bytes 5 boot log for the above RVBoards_D1_Debian_lxde_img_linux_v0.4.gz 1223811642 31719424000 Debian 0.4, gz-compressed plain disk image bytes e46f9d4e60c90d2a345352e8b279d64653156fab bytes e9e7ed6262253b16587cc8c4348d1f55154b8300 2 (local copy) (1.14 GiB, (29.54 GiB, 1.22 GB) 31.72 GB) 1462120194 4004597760 debian-hdmi-card.zip bytes c076593e9642e0831979e85b972a67a9b7b6177d bytes 5132c0fb70d2581248abb91c004ad0faa0a89e07 3 Debian 0.3, zip-compressed proprietary (PhoenixCard?) disk image (1.36 GiB, (3.73 GiB, 1.46 GB) 4.00 GB) 1462121334 4004597760 debian-mipi-card.zip bytes 7c0f931bed76613b04ba2e3e87140bd57f07565c bytes 89d7ad02ea6d40200fb2e0b33317aa444652d188 3 Debian 0.3, zip-compressed proprietary (PhoenixCard?) disk image (1.36 GiB, (3.73 GiB, 1.46 GB) 4.00 GB) micarr_0610 55064 bytes 511db5d9386a6e09c4233334d8b75cec64c7a6fe 3 Debian 0.3, Sipeed mic array demo (RISC-V ELF, README) 888483224 2858535936 RVBoards_D1_Debian_lxde_img_v0.2.zip bytes bytes Debian 0.2, zip-compressed proprietary (PhoenixCard?) disk image (847.32 74f25ba29f587644e6cb4d215778dc49fa1dec86 (2.66 GiB, 19739ae540b39b114105574f5c7e0906bee0902a 2 (local copy) MiB, 2.86 GB) 888.48 MB) 81186641 336188416 RVBoards_D1_Debian_console_img_v0.2.zip byte bytes Debian 0.2, zip-compressed proprietary (PhoenixCard?) disk image (77.43 deee14f826d05dd09aafcbf4c38d54e40c18b5f9 (320.61 ba01bdf15494513e352e0c9e72ac976f97e65d48 2 (local copy) MiB, 81.19 MiB, 336.19 MB) MB) minicom1.cap.txt 39125 bytes 5 OpenWrt boot log minicom2.cap.txt 5053 bytes 5 U-Boot default environment and available commands Notes 2 Pristine disk images as published by PerfXLab & RVBoards. 3 Pristine disk images from MEGA as published by Sipeed. 4 This disk image requires a 2 TiB device, of which it allocates only the first 29.5 GiB with GPT, of which it fills only the first 4.03 GiB with data. Because of these discrepancies D1 cannot boot from this disk image. 5 By Gary E. Miller. 6 As published on Fedora RISC-V wiki and openkoji service of Institute of Software, Chinese Academy of Sciences. 7 The Linux kernel in this disk image does not auto-detect the RAM size, but uses a hard-coded size from a DeviceTree file. Each boot menu item has its own DeviceTree file, and the default boot menu item (1) stands for 2 GB: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide-20210912.n.0 Boot Options. 1: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 2G) 2: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 1G) 3: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 512M) 4: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 128M) Enter choice: 1: Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 2G) [...] Retrieving file: /aw_nezha_d1_2G.dtb If you try to use more RAM than the D1 board actually has, it will sooner or later crash. The following commands can be used to change the default to 1 GB: # For the 2021-09-12 revision: echo 'default Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.61+ 1G)' >>/boot/extlinux/extlinux.conf # For the 2021-11-30 revision: echo 'default Fedora-riscv64-d1-developer-xfce-with-esp-Rawhide (5.4.16.riscv64.fc33.riscv64 1G)' >>/boot/extlinux/extlinux.conf 8 To boot the latest kernel, this image requires booting through GRUB. This can be done manually during the boot sequence as follows: [...] Importing environment from mmc0 ... Autoboot in 2 seconds <---------------------------------- press "v" [Nezha]# [Nezha]# run boot_grub 4681728 bytes read in 808 ms (5.5 MiB/s) Scanning disk mmc@4020000.blk... Scanning disk mmc@4021000.blk... Disk mmc@4021000.blk not ready Found 4 disks No EFI system partition Booting /\EFI\fedora\grubriscv64.efi Welcome to GRUB! [...] The following command can be used after booting to have U-Boot load GRUB by default: echo 'bootcmd=run boot_grub' >>/boot/boot/uEnv.txt 9 When booting the latest kernel from this image, it will use the RAM size provided by U-Boot, not the RAM size in DeviceTree files. However, U-Boot in this image has the RAM size hard-coded to 2GB, so to work with the latest kernel on D1-1GB this image requires to replace the bootloader with a custom version (provided by Fu Wei): dd if=fedora-2021-11-30_D1-1GB_bootloader.bin bs=512 seek=32800 of=/dev/mmcblk0