Parcourir la source

usdk: Add starfive VisionFive board support

Now usdk support fit image build for three starfive board:
starlight, starlight-a1 and visionfive.

You can choose your target board with assigning HWBOARD,
eg. "make HWBOARD=visionfive", or just default starlight-a1.
You can also specify the target to build, e.g. "make visionfive"

Signed-off-by: Som.Qin <som.qin@starfivetech.com>
Som.Qin il y a 2 ans
Parent
commit
e7676332b0

+ 36 - 5
Makefile

@@ -2,6 +2,7 @@ ISA ?= rv64imafdc
 ABI ?= lp64d
 TARGET_BOARD := U74
 BOARD_FLAGS	:=
+HWBOARD ?= starlight-a1
 
 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(default) | visionfive])
+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 $@)

+ 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";
+                };
+        };
+};
+