Преглед на файлове

Merge pull request #25 from shalasaka/JH7100_starlight_multimedia_for_visionfive

usdk: Add starfive VisionFive board support
andyhu-stf преди 2 години
родител
ревизия
e8ef36e2a7
променени са 6 файла, в които са добавени 245 реда и са изтрити 6 реда
  1. 36 5
      Makefile
  2. 10 1
      README.md
  3. 34 0
      conf/beaglev_defconfig_513
  4. 55 0
      conf/starlight-a1-uboot-fit-image.its
  5. 55 0
      conf/starlight-uboot-fit-image.its
  6. 55 0
      conf/visionfive-uboot-fit-image.its

+ 36 - 5
Makefile

@@ -2,6 +2,7 @@ ISA ?= rv64imafdc
 ABI ?= lp64d
 TARGET_BOARD := U74
 BOARD_FLAGS	:=
+HWBOARD ?= visionfive
 
 srcdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
 srcdir := $(srcdir:/=)
@@ -38,7 +39,7 @@ ifeq ($(TARGET_BOARD),U74)
 export TARGET_BOARD
 	BOARD_FLAGS += -DTARGET_BOARD_U74
 	bbl_link_addr :=0x80700000
-	its_file=$(confdir)/u74_nvdla-uboot-fit-image.its
+	its_file=$(confdir)/$(HWBOARD)-uboot-fit-image.its
 else
 	bbl_link_addr :=0x80000000
 	its_file=$(confdir)/nvdla-uboot-fit-image.its
@@ -75,8 +76,16 @@ uboot := $(uboot_wrkdir)/u-boot.bin
 uboot_config := HiFive-U540_regression_defconfig
 
 ifeq ($(TARGET_BOARD),U74)
+ifeq ($(HWBOARD), starlight)
 	uboot_config := starfive_jh7100_starlight_smode_defconfig
-	# uboot_config := starfive_vic7100_evb_smode_defconfig
+	uboot_dtb_file := $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight.dtb
+else ifeq ($(HWBOARD), starlight-a1)
+	uboot_config := starfive_jh7100_starlight_smode_defconfig
+	uboot_dtb_file := $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight-a1.dtb
+else ifeq ($(HWBOARD), visionfive)
+	uboot_config := starfive_jh7100_visionfive_smode_defconfig
+	uboot_dtb_file := $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-visionfive.dtb
+endif
 else
 	uboot_config := HiFive-U540_nvdla_iofpga_defconfig
 endif
@@ -86,8 +95,8 @@ rootfs := $(wrkdir)/rootfs.bin
 
 target_gcc ?= $(CROSS_COMPILE)gcc
 
-.PHONY: all nvdla-demo
-nvdla-demo: $(fit) $(vfat_image)
+.PHONY: all nvdla-demo check_arg
+nvdla-demo: check_arg $(fit) $(vfat_image)
 	@echo "To completely erase, reformat, and program a disk sdX, run:"
 	@echo "  make DISK=/dev/sdX format-nvdla-disk"
 	@echo "  ... you will need gdisk and e2fsprogs installed"
@@ -95,7 +104,7 @@ nvdla-demo: $(fit) $(vfat_image)
 	@echo "  This can be done manually if needed"
 	@echo
 
-all: $(fit) $(flash_image)
+all: check_arg $(fit) $(flash_image)
 	@echo
 	@echo "This image has been generated for an ISA of $(ISA) and an ABI of $(ABI)"
 	@echo "Find the image in work/image.fit, which should be copied to an MSDOS boot partition 1"
@@ -107,6 +116,11 @@ all: $(fit) $(flash_image)
 	@echo "  This can be done manually if needed"
 	@echo
 
+check_arg:
+ifeq ( , $(filter $(HWBOARD), starlight starlight-a1 visionfive))
+	$(error board $(HWBOARD) is not supported, BOARD=[starlight | starlight-a1 | visionfive(deflault)])
+endif
+
 # TODO: depracated for now
 #ifneq ($(RISCV),$(buildroot_initramfs_wrkdir)/host)
 #$(target_gcc):
@@ -115,6 +129,23 @@ all: $(fit) $(flash_image)
 #$(target_gcc): $(buildroot_initramfs_tar)
 #endif
 
+.PHONY: visionfive starlight starlight-a1
+
+visionfive: HWBOARD := visionfive
+visionfive: uboot_config := starfive_jh7100_visionfive_smode_defconfig
+visionfive: uboot_dtb_file := $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-visionfive.dtb
+visionfive: nvdla-demo
+
+starlight: HWBOARD := starlight
+starlight: uboot_config = starfive_jh7100_starlight_smode_defconfig
+starlight: uboot_dtb_file = $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight.dtb
+starlight: nvdla-demo
+
+starlight-a1: HWBOARD := starlight-a1
+starlight-a1: uboot_config = starfive_jh7100_starlight_smode_defconfig
+starlight-a1: uboot_dtb_file = $(wrkdir)/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight-a1.dtb
+starlight-a1: nvdla-demo
+
 $(buildroot_initramfs_wrkdir)/.config: $(buildroot_srcdir)
 	rm -rf $(dir $@)
 	mkdir -p $(dir $@)

+ 10 - 1
README.md

@@ -49,6 +49,13 @@ After update submodules, run `make` or `make -jx` and the complete toolchain and
 fw_payload.bin.out & image.fit will be built. The completed build tree will consume about 18G of
 disk space.
 
+Usdk support different hardware boards, you should specify the board you use when build the project. Now usdk support fit image build for three starfive boards:
+starlight, starlight-a1 or visionfive.
+
+You can choose your target board with assigning HWBOARD,
+eg. `make HWBOARD=visionfive`, or just **default visionfive**.
+You can also specify the target to build, e.g. `make visionfive`.
+
 By default, the above generated image does not contain VPU driver module(wave511, the video hard decode driver and wave521, the video hard encode driver).  The following instructions will add VPU driver module according to your requirement:
 
 	$ make -jx
@@ -176,7 +183,9 @@ to
 CONFIG_CMDLINE="earlyprintk console=tty1 console=ttyS0,115200 debug rootwait stmmaceth=chain_mode:1 root=/dev/mmcblk0p3"
 ```
 
-HiFive_U-Boot/configs/starfive_jh7100_starlight_smode_defconfig:
+HiFive_U-Boot/configs/starfive_jh7100_starlight_smode_defconfig(using starlight or starlight-a1 board)
+or
+HiFive_U-Boot/configs/starfive_jh7100_visionfive_smode_defconfig (using visionfive board):
 
 ```
 change

+ 34 - 0
conf/beaglev_defconfig_513

@@ -105,8 +105,42 @@ CONFIG_SCSI_SCAN_ASYNC=y
 CONFIG_NETDEVICES=y
 CONFIG_WIREGUARD=y
 CONFIG_TUN=y
+# CONFIG_NET_VENDOR_ALACRITECH is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_AQUANTIA is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CADENCE is not set
+# CONFIG_NET_VENDOR_CAVIUM is not set
+# CONFIG_NET_VENDOR_CORTINA is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_GOOGLE is not set
+# CONFIG_NET_VENDOR_HUAWEI is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MICROSOFT is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MELLANOX is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_MICROSEMI is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_NET_VENDOR_NI is not set
+# CONFIG_NET_VENDOR_PENSANDO is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SOLARFLARE is not set
+# CONFIG_NET_VENDOR_SOCIONEXT is not set
 CONFIG_STMMAC_ETH=y
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+# CONFIG_NET_VENDOR_XILINX is not set
 CONFIG_MICREL_PHY=y
+CONFIG_MOTORCOMM_PHY=y
 CONFIG_BRCMFMAC=y
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set

+ 55 - 0
conf/starlight-a1-uboot-fit-image.its

@@ -0,0 +1,55 @@
+/dts-v1/;
+
+/ {
+        description = "U-boot FIT image for starlight-a1 Nvdla";
+        #address-cells = <2>;
+
+        images {
+                vmlinux {
+                        description = "vmlinux";
+                        data = /incbin/("../work/linux/arch/riscv/boot/Image");
+                        type = "kernel";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x80200000>;
+                        entry = <0x0 0x80200000>;
+                        compression = "none";
+                };
+
+                ramdisk {
+                        description = "buildroot initramfs";
+                        data = /incbin/("../work/initramfs.cpio.gz");
+                        type = "ramdisk";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x86100000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+
+                fdt {
+                        data = /incbin/("../work/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight-a1.dtb");
+                        type = "flat_dt";
+                        arch = "riscv";
+                        load = <0x0 0x86000000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+
+        configurations {
+                default = "config-1";
+
+                config-1 {
+                        description = "starlight-a1 Nvdla with opensbi";
+			kernel = "vmlinux";
+                        fdt = "fdt";
+                        loadables = "ramdisk";
+                };
+        };
+};
+

+ 55 - 0
conf/starlight-uboot-fit-image.its

@@ -0,0 +1,55 @@
+/dts-v1/;
+
+/ {
+        description = "U-boot FIT image for starlight Nvdla";
+        #address-cells = <2>;
+
+        images {
+                vmlinux {
+                        description = "vmlinux";
+                        data = /incbin/("../work/linux/arch/riscv/boot/Image");
+                        type = "kernel";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x80200000>;
+                        entry = <0x0 0x80200000>;
+                        compression = "none";
+                };
+
+                ramdisk {
+                        description = "buildroot initramfs";
+                        data = /incbin/("../work/initramfs.cpio.gz");
+                        type = "ramdisk";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x86100000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+
+                fdt {
+                        data = /incbin/("../work/HiFive_U-Boot/arch/riscv/dts/jh7100-beaglev-starlight.dtb");
+                        type = "flat_dt";
+                        arch = "riscv";
+                        load = <0x0 0x86000000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+
+        configurations {
+                default = "config-1";
+
+                config-1 {
+                        description = "starlight Nvdla with opensbi";
+			kernel = "vmlinux";
+                        fdt = "fdt";
+                        loadables = "ramdisk";
+                };
+        };
+};
+

+ 55 - 0
conf/visionfive-uboot-fit-image.its

@@ -0,0 +1,55 @@
+/dts-v1/;
+
+/ {
+        description = "U-boot FIT image for visionfive Nvdla";
+        #address-cells = <2>;
+
+        images {
+                vmlinux {
+                        description = "vmlinux";
+                        data = /incbin/("../work/linux/arch/riscv/boot/Image");
+                        type = "kernel";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x80200000>;
+                        entry = <0x0 0x80200000>;
+                        compression = "none";
+                };
+
+                ramdisk {
+                        description = "buildroot initramfs";
+                        data = /incbin/("../work/initramfs.cpio.gz");
+                        type = "ramdisk";
+                        arch = "riscv";
+                        os = "linux";
+                        load = <0x0 0x86100000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+
+                fdt {
+                        data = /incbin/("../work/HiFive_U-Boot/arch/riscv/dts/jh7100-visionfive.dtb");
+                        type = "flat_dt";
+                        arch = "riscv";
+                        load = <0x0 0x86000000>;
+                        compression = "none";
+                        hash-1 {
+                                algo = "sha256";
+                        };
+                };
+        };
+
+        configurations {
+                default = "config-1";
+
+                config-1 {
+                        description = "visionfive Nvdla with opensbi";
+			kernel = "vmlinux";
+                        fdt = "fdt";
+                        loadables = "ramdisk";
+                };
+        };
+};
+