Skip to content

Commit

Permalink
Merge pull request #41 from Woomeeme/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishwaldo authored Nov 2, 2024
2 parents 63668a8 + dbe601f commit aa713be
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 59 deletions.
39 changes: 21 additions & 18 deletions configs/common/patches/fsbl/0001-fix-compile-error.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
From f3d19c2b583c3f6b4f8fe5c3d367a68275242d9d Mon Sep 17 00:00:00 2001
From: Justin Hammond <[email protected]>
Date: Sat, 6 Apr 2024 10:49:01 +0000
Subject: [PATCH] fix compile error

---
plat/sg200x/bl2/bl2_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plat/sg200x/bl2/bl2_main.c b/plat/sg200x/bl2/bl2_main.c
index d1f830b..6f2d788 100644
--- a/plat/sg200x/bl2/bl2_main.c
+++ b/plat/sg200x/bl2/bl2_main.c
@@ -15,6 +15,7 @@
diff --git a/plat/cv180x/bl2/bl2_main.c b/plat/cv180x/bl2/bl2_main.c
index e1eee38..f989e09 100644
--- a/plat/cv180x/bl2/bl2_main.c
+++ b/plat/cv180x/bl2/bl2_main.c
@@ -25,8 +25,8 @@ int init_comm_info(int ret)
transfer_config_s.encode_buf_size = CVIMMAP_H26X_ENC_BUFF_SIZE;
transfer_config_s.dump_print_enable = RTOS_DUMP_PRINT_ENABLE;
transfer_config_s.dump_print_size_idx = RTOS_DUMP_PRINT_SZ_IDX;
- transfer_config_s.image_type = RTOS_FAST_IMAGE_TYPE;
- transfer_config_s.mcu_status = MCU_STATUS_NONOS_DONE;
+// transfer_config_s.image_type = RTOS_FAST_IMAGE_TYPE;
+// transfer_config_s.mcu_status = MCU_STATUS_NONOS_DONE;
for (int i = 0; i < transfer_config_s.conf_size; i++) {
checksum += ptr[i];
}
diff --git a/plat/cv181x/bl2/bl2_main.c b/plat/cv181x/bl2/bl2_main.c
index 09b117b..b0185d9 100644
--- a/plat/cv181x/bl2/bl2_main.c
+++ b/plat/cv181x/bl2/bl2_main.c
@@ -10,6 +10,7 @@ enum CHIP_CLK_MODE chip_clk_mode = CLK_ND;
#ifdef RTOS_ENABLE_FREERTOS
int init_comm_info(int ret)
{
+#if 0
struct transfer_config_t *transfer_config = (struct transfer_config_t *)MAILBOX_FIELD;
struct transfer_config_t transfer_config_s;
unsigned char *ptr = (unsigned char *)&transfer_config_s;
@@ -40,7 +41,7 @@ int init_comm_info(int ret)
@@ -35,7 +36,7 @@ int init_comm_info(int ret)

transfer_config_s.checksum = checksum;
memcpy(transfer_config, &transfer_config_s, sizeof(struct transfer_config_t));
Expand All @@ -28,6 +34,3 @@ index d1f830b..6f2d788 100644
return ret;
}
#endif
--
2.43.0

46 changes: 17 additions & 29 deletions configs/common/patches/u-boot/0001-enable-distroboot.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
From 9d123e5baddd3415e1282d166740f2c578b7771a Mon Sep 17 00:00:00 2001
From: Justin Hammond <[email protected]>
Date: Sat, 13 Apr 2024 13:22:32 +0800
Subject: [PATCH] Update for distroboot

---
include/configs/mars-asic.h | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/include/configs/mars-asic.h b/include/configs/mars-asic.h
index 12cdefac84..de5219eb49 100644
--- a/include/configs/mars-asic.h
+++ b/include/configs/mars-asic.h
diff --git a/include/configs/cv181x-asic.h b/include/configs/cv181x-asic.h
index 1c276f1c..0e80d8b3 100644
--- a/include/configs/cv181x-asic.h
+++ b/include/configs/cv181x-asic.h
@@ -9,13 +9,14 @@
#define __CV181X_ASIC_H__

#include <../../../board/cvitek/mars/mars_reg.h>
#include <../../../board/cvitek/cv181x/cv181x_reg.h>
+#include <config_distro_bootcmd.h>

/* defined in cvipart.h */
Expand All @@ -27,22 +18,21 @@ index 12cdefac84..de5219eb49 100644
#undef CONFIG_ENV_IS_IN_NAND
#undef CONFIG_ENV_SECT_SIZE

@@ -181,6 +182,12 @@
@@ -181,6 +182,11 @@
#define CONFIG_GATEWAYIP 192.168.0.11
#define CONFIG_SERVERIP 192.168.56.101

+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 0) \
+ func(DHCP, dhcp, 0) \
+ func(PXE, pxe, na)
+
+
#ifdef CONFIG_USE_DEFAULT_ENV
/* The following Settings are chip dependent */
/******************************************************************************/
@@ -256,7 +263,17 @@
@@ -254,7 +260,17 @@
"root=" ROOTARGS "\0" \
"sdboot=" SD_BOOTM_COMMAND "\0" \
"sdbootauto=" SD_BOOTM_COMMAND_AUTO "\0" \
"othbootargs=" OTHERBOOTARGS "\0" \
- PARTS_OFFSET
+ "kernel_addr_r=" __stringify(CONFIG_SYS_TEXT_BASE) "\0" \
Expand All @@ -59,18 +49,16 @@ index 12cdefac84..de5219eb49 100644

/********************************************************************************/
/* UBOOT_VBOOT commands */
@@ -311,9 +328,9 @@
#ifdef CONFIG_ENABLE_ALIOS_UPDATE
#define CONFIG_BOOTCOMMAND "cvi_update_rtos"
#elif CONFIG_SD_BOOT
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run sdboot || run sdbootauto"
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run distro_bootcmd || run sdboot || run sdbootauto"
@@ -301,10 +317,10 @@
#ifdef CONFIG_ENABLE_ALIOS_UPDATE
#define CONFIG_BOOTCOMMAND "cvi_update_rtos"
#else
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run norboot || run nandboot ||run emmcboot"
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run distro_bootcmd || run norboot || run nandboot ||run emmcboot"
#endif
#else
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run norboot || run nandboot ||run emmcboot"
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run distro_bootcmd || run norboot || run nandboot ||run emmcboot"
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run sdboot"
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run distro_bootcmd || run sdboot || run sdbootauto"
#endif

#if defined(CONFIG_NAND_SUPPORT)
--
2.44.0

24 changes: 12 additions & 12 deletions scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ NPROCS := $(shell nproc)
$(BUILDDIR)/linux-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out Kernel for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
@git clone -b sg200x-dev --depth 5 https://github.com/sophgo/linux_5.10.git /build/kernel
@git clone -b sg200x-dev --depth 7 https://github.com/sophgo/linux_5.10.git /build/kernel
@cd $(BUILDDIR)/kernel && git checkout 8b8fbf8
@touch $@

Expand Down Expand Up @@ -79,8 +79,8 @@ linux-clean:
$(BUILDDIR)/uboot-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out U-Boot for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
@git clone --depth 1 https://github.com/milkv-duo/u-boot-2021.10.git $(BUILDDIR)/u-boot
@cd $(BUILDDIR)/u-boot && git checkout a57aa1f
@git clone --depth 1 https://github.com/sophgo/u-boot-2021.10.git $(BUILDDIR)/u-boot
@cd $(BUILDDIR)/u-boot && git checkout 4a21b6b
@touch $@

$(BUILDDIR)/uboot-prepare-patch-stamp: $(BUILDDIR)/uboot-prepare-checkout-stamp
Expand All @@ -100,13 +100,13 @@ $(BUILDDIR)/uboot-prepare-patch-stamp: $(BUILDDIR)/uboot-prepare-checkout-stamp

$(BUILDDIR)/uboot-prepare-configure-stamp: $(BUILDDIR)/uboot-prepare-patch-stamp
@echo "$(COLOUR_GREEN)Configuring U-Boot for $(BOARD)$(END_COLOUR)"
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" $(BOARD)_defconfig
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=cv181x CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" $(BOARD)_defconfig
@touch $@

$(BUILDDIR)/uboot-compile-stamp: $(BUILDDIR)/uboot-prepare-configure-stamp
@echo "$(COLOUR_GREEN)Building U-Boot for $(BOARD)$(END_COLOUR)"
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-"
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=mars CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" u-boot-initial-env
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=cv181x CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-"
@cd $(BUILDDIR)/u-boot/ && $(MAKE) -j$(NPROCS) BOARD=cv181x CONFIG_USE_DEFAULT_ENV=y STORAGE_TYPE=$(STORAGE_TYPE) CHIP=$(UBOOT_CHIP) CVIBOARD=$(UBOOT_BOARD) CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" u-boot-initial-env
@cp $(BUILDDIR)/u-boot/u-boot.bin $(BUILDDIR)
@cp $(BUILDDIR)/u-boot/u-boot.dtb $(BUILDDIR)
@cp $(BUILDDIR)/u-boot/u-boot-initial-env $(BUILDDIR)
Expand All @@ -122,7 +122,7 @@ uboot-clean:
$(BUILDDIR)/opensbi-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out OpenSBI for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
@git clone -b sg200x-dev --depth 1 https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi
@git clone -b sg200x-dev --depth 4 https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi
@cd $(BUILDDIR)/opensbi && git checkout 216793f
# git clone https://github.com/riscv-software-src/opensbi.git $(BUILDDIR)/opensbi
# @cd $(BUILDDIR)/opensbi && git checkout a2b255b
Expand All @@ -138,7 +138,7 @@ $(BUILDDIR)/opensbi-prepare-patch-stamp: $(BUILDDIR)/opensbi-prepare-checkout-st
$(BUILDDIR)/opensbi-compile-stamp: $(BUILDDIR)/opensbi-prepare-patch-stamp $(BUILDDIR)/uboot-compile-stamp
@echo "$(COLOUR_GREEN)Building OpenSBI for $(BOARD)$(END_COLOUR)"
@cd $(BUILDDIR)/opensbi && CROSS_COMPILE="/host-tools/gcc/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-" make PLATFORM=generic FW_FDT_PATH=$(BUILDDIR)/u-boot.dtb
@cp $(BUILDDIR)/opensbi/build/platform/generic/firmware/fw_dynamic.bin $(BUILDDIR)
@cp $(BUILDDIR)/opensbi/build/platform/generic/firmware/fw_dynamic.bin $(BUILDDIR)
@touch $@

opensbi: $(BUILDDIR)/opensbi-compile-stamp
Expand All @@ -151,8 +151,8 @@ opensbi-clean:
$(BUILDDIR)/fsbl-prepare-checkout-stamp:
@echo "$(COLOUR_GREEN)Checking out FSBL for $(BOARD)$(END_COLOUR)"
@mkdir -p $(BUILDDIR)
@git clone -b milkv --depth 1 https://github.com/milkv-duo/fsbl.git $(BUILDDIR)/fsbl
@cd $(BUILDDIR)/fsbl && git checkout beb1483
@git clone -b sg200x-dev --depth 1 https://github.com/sophgo/fsbl.git $(BUILDDIR)/fsbl
@cd $(BUILDDIR)/fsbl && git checkout 15a84c5
@touch $@

$(BUILDDIR)/fsbl-prepare-patch-stamp: $(BUILDDIR)/fsbl-prepare-checkout-stamp
Expand Down Expand Up @@ -197,7 +197,7 @@ $(BUILDDIR)/image-prepare-stamp:
@rm -rf /rootfs/
@-rm $(addon-targets)
@mkdir -p /rootfs/
@curl -s https://sophgo.my-ho.st:8443/public-key.asc -o $(BUILDDIR)/public-key.asc
@curl -v -L https://sophgo.my-ho.st:8443/public-key.asc -o $(BUILDDIR)/public-key.asc
@apt-key add $(BUILDDIR)/public-key.asc
@mmdebstrap -v --architectures=riscv64 --include="$(_PACKAGES)" sid "/rootfs/" "deb http://deb.debian.org/debian/ sid main" "deb https://sophgo.my-ho.st:8443/ debian sophgo"
@touch $@
Expand Down Expand Up @@ -260,4 +260,4 @@ image-clean-customize:

clean: opensbi-clean uboot-clean linux-clean fsbl-clean

.PHONY: image clean opensbi uboot linux fsbl fsbl-clean uboot-clean linux-clean opensbi-clean
.PHONY: image clean opensbi uboot linux fsbl fsbl-clean uboot-clean linux-clean opensbi-clean

0 comments on commit aa713be

Please sign in to comment.