From 5bd0e19445a6768a26a7b02e7c120af8cc56ebfa Mon Sep 17 00:00:00 2001 From: "yang.wang" Date: Wed, 25 Dec 2024 10:25:38 +0800 Subject: [PATCH] Update the README document. Signed-off-by: yang.wang --- README.md | 239 +++--------------------------------------------------- 1 file changed, 10 insertions(+), 229 deletions(-) mode change 100755 => 100644 README.md diff --git a/README.md b/README.md old mode 100755 new mode 100644 index a3e266f..679857d --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# StarFiveTech VisionFive2 SDK +# DeepComputing FML13V01 SDK -This builds a complete RISC-V cross-compile toolchain for the `StarFiveTech` `JH7110` SoC. It also builds U-boot SPL, U-boot and a flattened image tree (FIT) image with a Opensbi binary, linux kernel, device tree, ramdisk image and rootfs image for the `JH7110 VisionFive2` board. Note this SDK is built with the linux kernel version `6.6`. +This builds a complete RISC-V cross-compile toolchain for the `StarFiveTech` `JH7110` SoC. It also builds U-boot SPL, U-boot and a flattened image tree (FIT) image with a Opensbi binary, linux kernel, device tree, ramdisk image and rootfs image for the `DeepComputing FML13V01` board. Note this SDK is built with the linux kernel version `6.6`. ## Prerequisites @@ -28,25 +28,23 @@ $ sudo apt-get install git-lfs Checkout this repository (e.g.: branch `fm7110-6.6`). Then checkout all of the linked submodules using: - $ git clone https://github.com/DC-DeepComputing/fml13v01.git VisionFive2-fml13v01 - $ cd VisionFive2-fml13v01 + $ git clone https://github.com/DC-DeepComputing/fml13v01.git fml13v01-sdk + $ cd fml13v01-sdk $ git submodule update --init --recursive This will take some time and require around 12GB of disk space. Some modules may fail because certain dependencies don't have the best git hosting. The only solution is to wait and try again later (or ask someone for a copy of that source repository). For developer, need to switch the 5 submodules `buildroot`, `u-boot`, `linux`, `opensbi`, `soft_3rdpart` to correct branch manually, or refer to `.gitmodule` -``` $ git submodule foreach --recursive "git checkout origin/fm7110-6.6 -B fm7110-6.6" -``` ## Quick Build Instructions -Below are the quick building for the initramfs image `image.fit` which could be translated to board through tftp and run on board. The completed toolchain, `u-boot-spl.bin.normal.out`, `visionfive2_fw_payload.img`, `image.fit` will be generated under `work/` directory. The completed build tree will consume about 18G of disk space. +Below are the quick building for the initramfs image `image.fit`. The completed toolchain, `u-boot-spl.bin.normal.out`, `visionfive2_fw_payload.img`, `image.fit` will be generated under `work/` directory. The completed build tree will consume about 18G of disk space. $ make -j$(nproc) -Then the below target files will be generated, copy files to tftp server workspace path: +Then the below target files will be generated: ``` work/ @@ -57,13 +55,7 @@ work/ ├── linux/arch/riscv/boot ├── dts │ └── starfive - │ ├── jh7110-starfive-visionfive-2-ac108.dtb - │ ├── jh7110-starfive-visionfive-2-tdm.dtb - │ ├── jh7110-starfive-visionfive-2-v1.2a.dtb - │ ├── jh7110-starfive-visionfive-2-v1.3b.dtb - │ ├── jh7110-starfive-visionfive-2-wm8960.dtb - │ ├── vf2-overlay - │ │ └── vf2-overlay-uart3-i2c.dtbo + │ └──jh7110-starfive-visionfive-2-framework.dtb └── Image.gz ``` @@ -87,164 +79,9 @@ $ make -C ./work/buildroot_rootfs/ O=./work/buildroot_rootfs busybox-rebuild # $ make -C ./work/buildroot_rootfs/ O=./work/buildroot_rootfs ffmpeg-rebuild # build ffmpeg package ``` -## Running on JH7110 VisionFive2 Board via Network - -After the JH7110 VisionFive2 Board is properly connected to the serial port cable, network cable and power cord, turn on the power from the wall power socket to power and you will see the startup information as follows: - -``` -U-Boot SPL 2021.10 (Oct 31 2022 - 12:11:37 +0800) -DDR version: dc2e84f0. -Trying to boot from SPI - -OpenSBI v1.0 - ____ _____ ____ _____ - / __ \ / ____| _ \_ _| - | | | |_ __ ___ _ __ | (___ | |_) || | - | | | | '_ \ / _ \ '_ \ \___ \| _ < | | - | |__| | |_) | __/ | | |____) | |_) || |_ - \____/| .__/ \___|_| |_|_____/|____/_____| - | | - |_| - -Platform Name : StarFive VisionFive V2 -Platform Features : medeleg -Platform HART Count : 5 -Platform IPI Device : aclint-mswi -Platform Timer Device : aclint-mtimer @ 4000000Hz -Platform Console Device : uart8250 -Platform HSM Device : --- -Platform Reboot Device : --- -Platform Shutdown Device : --- -Firmware Base : 0x40000000 -Firmware Size : 360 KB -Runtime SBI Version : 0.3 - -Domain0 Name : root -Domain0 Boot HART : 3 -Domain0 HARTs : 0*,1*,2*,3*,4* -Domain0 Region00 : 0x0000000002000000-0x000000000200ffff (I) -Domain0 Region01 : 0x0000000040000000-0x000000004007ffff () -Domain0 Region02 : 0x0000000000000000-0xffffffffffffffff (R,W,X) -Domain0 Next Address : 0x0000000040200000 -Domain0 Next Arg1 : 0x0000000042200000 -Domain0 Next Mode : S-mode -Domain0 SysReset : yes - -Boot HART ID : 3 -Boot HART Domain : root -Boot HART Priv Version : v1.11 -Boot HART Base ISA : rv64imafdcbx -Boot HART ISA Extensions : none -Boot HART PMP Count : 8 -Boot HART PMP Granularity : 4096 -Boot HART PMP Address Bits: 34 -Boot HART MHPM Count : 2 -Boot HART MIDELEG : 0x0000000000000222 -Boot HART MEDELEG : 0x000000000000b109 - - -U-Boot 2021.10 (Oct 31 2022 - 12:11:37 +0800), Build: jenkins-VF2_515_Branch_SDK_Release-10 - -CPU: rv64imacu -Model: StarFive VisionFive V2 -DRAM: 8 GiB -MMC: sdio0@16010000: 0, sdio1@16020000: 1 -Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB -*** Warning - bad CRC, using default environment - -StarFive EEPROM format v2 - ---------EEPROM INFO-------- -Vendor : StarFive Technology Co., Ltd. -Product full SN: VF7110A1-2243-D008E000-00000001 -data version: 0x2 -PCB revision: 0xa1 -BOM revision: A -Ethernet MAC0 address: 6c:cf:39:00:14:5b -Ethernet MAC1 address: 6c:cf:39:00:14:5c ---------EEPROM INFO-------- - -In: serial@10000000 -Out: serial@10000000 -Err: serial@10000000 -Model: StarFive VisionFive V2 -Net: eth0: ethernet@16030000, eth1: ethernet@16040000 -switch to partitions #0, OK -mmc1 is current device -found device 1 -bootmode flash device 1 -Failed to load 'uEnv.txt' -Can't set block device -Hit any key to stop autoboot: 0 -StarFive # -``` - -Then press any key to stop and enter uboot terminal, there are two way to boot the board - -#### 1. Running image.fit with the default dtb `jh7110-starfive-visionfive-2-v1.3b.dtb` - -transfer image.fit through TFTP: - -Step1: set environment parameters: - -``` -setenv ipaddr 192.168.xxx.xxx; setenv serverip 192.168.xxx.xxx; -``` - -Step2: upload image file to ddr: - -``` -tftpboot ${loadaddr} image.fit; -``` - -Step3: load and execute: - -``` -bootm start ${loadaddr};bootm loados ${loadaddr};run chipa_set_linux;run cpu_vol_set; booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}; -``` - -When you see the `buildroot login:` message, then congratulations, the launch was successful - -``` -buildroot login:root -Password: starfive -``` - -#### 2. Running the other dtb with the Image.gz and initramfs.cpio.gz - -If we want to load the other dtb, e.g. `jh7110-starfive-visionfive-2-wm8960.dtb`, follow the below - -Step1: set environment parameters: - -``` -setenv ipaddr 192.168.xxx.xxx; setenv serverip 192.168.xxx.xxx; -``` - -Step2: upload files to ddr: - -``` -tftpboot ${fdt_addr_r} jh7110-starfive-visionfive-2-wm8960.dtb; -tftpboot ${kernel_addr_r} Image.gz; -tftpboot ${ramdisk_addr_r} initramfs.cpio.gz; -run chipa_set_linux;run cpu_vol_set; -``` - -Step3: load and execute: - -``` -booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r} -``` - -When you see the `buildroot login:` message, then congratulations, the launch was successful - -``` -buildroot login:root -Password: starfive -``` - ## APPENDIX I: Generate Booting SD Card -If you don't already use a local tftp server, then you probably want to make the TF card target; the default size is 16 GBs. **NOTE THIS WILL DESTROY ALL EXISTING DATA** on the target TF card; The `GPT` Partition Table for the TF card is recommended. +Create a bootable TF card image with a default size of 16 GB. Note: This will erase all existing data on the target TF card. It is recommended to use a GPT partition table for the TF card. **NOTE THIS WILL DESTROY ALL EXISTING DATA** on the target TF card; The `GPT` Partition Table for the TF card is recommended. #### Generate SD Card Image File @@ -267,7 +104,7 @@ $ sudo dd if=work/sdcard.img of=/dev/sdX bs=4096 $ sync ``` -Then extend the tf card rootfs partition if needed. There are two ways to implement it. +Then, if the current card's capacity is much larger than the default TF card image (16 GB), you can expand the rootfs partition of the TF card. This can be achieved in the following two ways: The first way could be done on Ubuntu host, need to install the below package: @@ -284,7 +121,7 @@ $ sudo resize2fs /dev/sdX4 # extend filesystem $ sudo fsck.ext4 /dev/sdX4 ``` -The second way could be done on VisionFive2 board, use fdisk and resize2fs command: +The second way could be done on FML13V01 board, use fdisk and resize2fs command: ``` # fdisk /dev/mmcblk1 @@ -351,59 +188,3 @@ mkswap /dev/mmcblk0p5 swapoff -a swapon /dev/mmcblk0p5 ``` - -## APPENDIX II: Using DTB Overlay Dynamically -The system support loading dtb overlay dynamically when the board is running. Run below on board: - -``` -# mount -t configfs none /sys/kernel/config -# mkdir -p /sys/kernel/config/device-tree/overlays/dtoverlay -# cd -# cat vf2-overlay-uart3-i2c.dtbo > /sys/kernel/config/device-tree/overlays/dtoverlay/dtbo -``` - -Additional, you could remove the dtbo feature: - -``` -# rmdir /sys/kernel/config/device-tree/overlays/dtoverlay -``` - -## APPENDIX III: Updating SPL and U-Boot binaries Under U-boot - -Prepare the tftp sever. e.g. `sudo apt install tftpd-hpa` for Ubuntu host. - -1. Power on the VisionFive2 board and wait until enters the u-boot command line - -2. Configure the environment variables by executing: - - ``` - StarFive # setenv ipaddr 192.168.120.222;setenv serverip 192.168.120.99 - ``` - -3. Check the connectivity by pinging the host PC from evaluation board; - -4. Initialize SPI flash: - - ``` - StarFive # sf probe - ``` - -5. Update SPL binary - - ``` - StarFive # tftpboot ${loadaddr} u-boot-spl.bin.normal.out - StarFive # sf update ${loadaddr} 0x0 $filesize - ``` - -6. Update U-Boot binary - - ``` - StarFive # tftpboot ${loadaddr} visionfive2_fw_payload.img - StarFive # sf update ${loadaddr} 0x100000 $filesize - ``` - -## APPENDIX IV: Recovering Bootloader - -The SPL and U-Boot are stored inside the SPI flash on board. There may be situations where you accidentally emptied the flash or if the flash is damaged on your board. In these situations, it's better to recover the bootloader. - -Please jump to https://github.com/starfive-tech/Tools for more details