Skip to content

Commit f063387

Browse files
Woomeemegugolple
authored andcommitted
Now using U-boot & fsbl from soghgo
1 parent 63668a8 commit f063387

File tree

3 files changed

+50
-59
lines changed

3 files changed

+50
-59
lines changed

configs/common/patches/fsbl/0001-fix-compile-error.patch

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
1-
From f3d19c2b583c3f6b4f8fe5c3d367a68275242d9d Mon Sep 17 00:00:00 2001
2-
From: Justin Hammond <[email protected]>
3-
Date: Sat, 6 Apr 2024 10:49:01 +0000
4-
Subject: [PATCH] fix compile error
5-
6-
---
7-
plat/sg200x/bl2/bl2_main.c | 3 ++-
8-
1 file changed, 2 insertions(+), 1 deletion(-)
9-
10-
diff --git a/plat/sg200x/bl2/bl2_main.c b/plat/sg200x/bl2/bl2_main.c
11-
index d1f830b..6f2d788 100644
12-
--- a/plat/sg200x/bl2/bl2_main.c
13-
+++ b/plat/sg200x/bl2/bl2_main.c
14-
@@ -15,6 +15,7 @@
1+
diff --git a/plat/cv180x/bl2/bl2_main.c b/plat/cv180x/bl2/bl2_main.c
2+
index e1eee38..f989e09 100644
3+
--- a/plat/cv180x/bl2/bl2_main.c
4+
+++ b/plat/cv180x/bl2/bl2_main.c
5+
@@ -25,8 +25,8 @@ int init_comm_info(int ret)
6+
transfer_config_s.encode_buf_size = CVIMMAP_H26X_ENC_BUFF_SIZE;
7+
transfer_config_s.dump_print_enable = RTOS_DUMP_PRINT_ENABLE;
8+
transfer_config_s.dump_print_size_idx = RTOS_DUMP_PRINT_SZ_IDX;
9+
- transfer_config_s.image_type = RTOS_FAST_IMAGE_TYPE;
10+
- transfer_config_s.mcu_status = MCU_STATUS_NONOS_DONE;
11+
+// transfer_config_s.image_type = RTOS_FAST_IMAGE_TYPE;
12+
+// transfer_config_s.mcu_status = MCU_STATUS_NONOS_DONE;
13+
for (int i = 0; i < transfer_config_s.conf_size; i++) {
14+
checksum += ptr[i];
15+
}
16+
diff --git a/plat/cv181x/bl2/bl2_main.c b/plat/cv181x/bl2/bl2_main.c
17+
index 09b117b..b0185d9 100644
18+
--- a/plat/cv181x/bl2/bl2_main.c
19+
+++ b/plat/cv181x/bl2/bl2_main.c
20+
@@ -10,6 +10,7 @@ enum CHIP_CLK_MODE chip_clk_mode = CLK_ND;
1521
#ifdef RTOS_ENABLE_FREERTOS
1622
int init_comm_info(int ret)
1723
{
1824
+#if 0
1925
struct transfer_config_t *transfer_config = (struct transfer_config_t *)MAILBOX_FIELD;
2026
struct transfer_config_t transfer_config_s;
2127
unsigned char *ptr = (unsigned char *)&transfer_config_s;
22-
@@ -40,7 +41,7 @@ int init_comm_info(int ret)
28+
@@ -35,7 +36,7 @@ int init_comm_info(int ret)
2329

2430
transfer_config_s.checksum = checksum;
2531
memcpy(transfer_config, &transfer_config_s, sizeof(struct transfer_config_t));
@@ -28,6 +34,3 @@ index d1f830b..6f2d788 100644
2834
return ret;
2935
}
3036
#endif
31-
--
32-
2.43.0
33-
Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
From 9d123e5baddd3415e1282d166740f2c578b7771a Mon Sep 17 00:00:00 2001
2-
From: Justin Hammond <[email protected]>
3-
Date: Sat, 13 Apr 2024 13:22:32 +0800
4-
Subject: [PATCH] Update for distroboot
5-
6-
---
7-
include/configs/mars-asic.h | 25 +++++++++++++++++++++----
8-
1 file changed, 21 insertions(+), 4 deletions(-)
9-
10-
diff --git a/include/configs/mars-asic.h b/include/configs/mars-asic.h
11-
index 12cdefac84..de5219eb49 100644
12-
--- a/include/configs/mars-asic.h
13-
+++ b/include/configs/mars-asic.h
1+
diff --git a/include/configs/cv181x-asic.h b/include/configs/cv181x-asic.h
2+
index 1c276f1c..0e80d8b3 100644
3+
--- a/include/configs/cv181x-asic.h
4+
+++ b/include/configs/cv181x-asic.h
145
@@ -9,13 +9,14 @@
156
#define __CV181X_ASIC_H__
167

17-
#include <../../../board/cvitek/mars/mars_reg.h>
8+
#include <../../../board/cvitek/cv181x/cv181x_reg.h>
189
+#include <config_distro_bootcmd.h>
1910

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

30-
@@ -181,6 +182,12 @@
21+
@@ -181,6 +182,11 @@
3122
#define CONFIG_GATEWAYIP 192.168.0.11
3223
#define CONFIG_SERVERIP 192.168.56.101
3324

3425
+#define BOOT_TARGET_DEVICES(func) \
3526
+ func(MMC, mmc, 0) \
3627
+ func(DHCP, dhcp, 0) \
3728
+ func(PXE, pxe, na)
38-
+
3929
+
4030
#ifdef CONFIG_USE_DEFAULT_ENV
4131
/* The following Settings are chip dependent */
4232
/******************************************************************************/
43-
@@ -256,7 +263,17 @@
33+
@@ -254,7 +260,17 @@
34+
"root=" ROOTARGS "\0" \
4435
"sdboot=" SD_BOOTM_COMMAND "\0" \
45-
"sdbootauto=" SD_BOOTM_COMMAND_AUTO "\0" \
4636
"othbootargs=" OTHERBOOTARGS "\0" \
4737
- PARTS_OFFSET
4838
+ "kernel_addr_r=" __stringify(CONFIG_SYS_TEXT_BASE) "\0" \
@@ -59,18 +49,16 @@ index 12cdefac84..de5219eb49 100644
5949

6050
/********************************************************************************/
6151
/* UBOOT_VBOOT commands */
62-
@@ -311,9 +328,9 @@
63-
#ifdef CONFIG_ENABLE_ALIOS_UPDATE
64-
#define CONFIG_BOOTCOMMAND "cvi_update_rtos"
65-
#elif CONFIG_SD_BOOT
66-
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run sdboot || run sdbootauto"
67-
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run distro_bootcmd || run sdboot || run sdbootauto"
52+
@@ -301,10 +317,10 @@
53+
#ifdef CONFIG_ENABLE_ALIOS_UPDATE
54+
#define CONFIG_BOOTCOMMAND "cvi_update_rtos"
55+
#else
56+
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run norboot || run nandboot ||run emmcboot"
57+
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run distro_bootcmd || run norboot || run nandboot ||run emmcboot"
58+
#endif
6859
#else
69-
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run norboot || run nandboot ||run emmcboot"
70-
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "cvi_update || run distro_bootcmd || run norboot || run nandboot ||run emmcboot"
60+
- #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run sdboot"
61+
+ #define CONFIG_BOOTCOMMAND SHOWLOGOCMD "run distro_bootcmd || run sdboot || run sdbootauto"
7162
#endif
7263

7364
#if defined(CONFIG_NAND_SUPPORT)
74-
--
75-
2.44.0
76-

scripts/Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ NPROCS := $(shell nproc)
3838
$(BUILDDIR)/linux-prepare-checkout-stamp:
3939
@echo "$(COLOUR_GREEN)Checking out Kernel for $(BOARD)$(END_COLOUR)"
4040
@mkdir -p $(BUILDDIR)
41-
@git clone -b sg200x-dev --depth 5 https://github.com/sophgo/linux_5.10.git /build/kernel
41+
@git clone -b sg200x-dev --depth 7 https://github.com/sophgo/linux_5.10.git /build/kernel
4242
@cd $(BUILDDIR)/kernel && git checkout 8b8fbf8
4343
@touch $@
4444

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

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

101101
$(BUILDDIR)/uboot-prepare-configure-stamp: $(BUILDDIR)/uboot-prepare-patch-stamp
102102
@echo "$(COLOUR_GREEN)Configuring U-Boot for $(BOARD)$(END_COLOUR)"
103-
@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
103+
@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
104104
@touch $@
105105

106106
$(BUILDDIR)/uboot-compile-stamp: $(BUILDDIR)/uboot-prepare-configure-stamp
107107
@echo "$(COLOUR_GREEN)Building U-Boot for $(BOARD)$(END_COLOUR)"
108-
@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-"
109-
@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
108+
@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-"
109+
@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
110110
@cp $(BUILDDIR)/u-boot/u-boot.bin $(BUILDDIR)
111111
@cp $(BUILDDIR)/u-boot/u-boot.dtb $(BUILDDIR)
112112
@cp $(BUILDDIR)/u-boot/u-boot-initial-env $(BUILDDIR)
@@ -122,7 +122,7 @@ uboot-clean:
122122
$(BUILDDIR)/opensbi-prepare-checkout-stamp:
123123
@echo "$(COLOUR_GREEN)Checking out OpenSBI for $(BOARD)$(END_COLOUR)"
124124
@mkdir -p $(BUILDDIR)
125-
@git clone -b sg200x-dev --depth 1 https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi
125+
@git clone -b sg200x-dev --depth 4 https://github.com/sophgo/opensbi.git $(BUILDDIR)/opensbi
126126
@cd $(BUILDDIR)/opensbi && git checkout 216793f
127127
# git clone https://github.com/riscv-software-src/opensbi.git $(BUILDDIR)/opensbi
128128
# @cd $(BUILDDIR)/opensbi && git checkout a2b255b
@@ -138,7 +138,7 @@ $(BUILDDIR)/opensbi-prepare-patch-stamp: $(BUILDDIR)/opensbi-prepare-checkout-st
138138
$(BUILDDIR)/opensbi-compile-stamp: $(BUILDDIR)/opensbi-prepare-patch-stamp $(BUILDDIR)/uboot-compile-stamp
139139
@echo "$(COLOUR_GREEN)Building OpenSBI for $(BOARD)$(END_COLOUR)"
140140
@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
141-
@cp $(BUILDDIR)/opensbi/build/platform/generic/firmware/fw_dynamic.bin $(BUILDDIR)
141+
@cp $(BUILDDIR)/opensbi/build/platform/generic/firmware/fw_dynamic.bin $(BUILDDIR)
142142
@touch $@
143143

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

158158
$(BUILDDIR)/fsbl-prepare-patch-stamp: $(BUILDDIR)/fsbl-prepare-checkout-stamp
@@ -197,7 +197,7 @@ $(BUILDDIR)/image-prepare-stamp:
197197
@rm -rf /rootfs/
198198
@-rm $(addon-targets)
199199
@mkdir -p /rootfs/
200-
@curl -s https://sophgo.my-ho.st:8443/public-key.asc -o $(BUILDDIR)/public-key.asc
200+
@curl -v -L https://sophgo.my-ho.st:8443/public-key.asc -o $(BUILDDIR)/public-key.asc
201201
@apt-key add $(BUILDDIR)/public-key.asc
202202
@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"
203203
@touch $@
@@ -260,4 +260,4 @@ image-clean-customize:
260260

261261
clean: opensbi-clean uboot-clean linux-clean fsbl-clean
262262

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

0 commit comments

Comments
 (0)