5 Commits

Author SHA1 Message Date
Xiaoguang Xing
748d704108 makefile: remove linker garbage collection print
See commmit 0171cfc("Makefile: enable --gc-sections").

Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-12-25 14:16:07 +08:00
haijiao.liu
3de9421b02 lib: fix warning message of timer in boot phase
Optimize the reset driver to prevent the use of the timer function
before the timer driver initialization is completed, which resloves
the following warning messages:

sbi_timer_delay_loop: called without timer device

Signed-off-by: haijiao.liu <haijiao.liu@sophgo.com>
2024-12-25 09:42:05 +08:00
Xiaoguang Xing
1d0d0a6b15 platform: Fix when no serial node in dtb
SOPHGO BM1690 SoC TP dtb has not serial node.

Signed-off-by: bowen.pang <bowen.pang@sophgo.com>
2024-12-25 09:40:40 +08:00
Xiaoguang Xing
ba3b2e6269 lib: add mtimer and mswi support for bm1690 ap and tp
mswi and mtimer' address of bm1690 ap and tp is not contiguous,
so make them separately.

Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-12-25 09:38:33 +08:00
Xiaoguang Xing
4e26aa8747 platform: generic: add sophgo sg2044 and bm1690 soc support
Signed-off-by: Xiaoguang Xing <xiaoguang.xing@sophgo.com>
2024-12-25 09:38:12 +08:00
6 changed files with 6 additions and 23 deletions

View File

@@ -427,7 +427,6 @@ DTSCPPFLAGS = $(CPPFLAGS) -nostdinc -nostdlib -fno-builtin -D__DTS__ -x assemble
ifneq ($(DEBUG),)
CFLAGS += -O0
ELFFLAGS += -Wl,--print-gc-sections
else
CFLAGS += -O2
endif

View File

@@ -56,6 +56,7 @@ static const struct fdt_match ipi_mswi_match[] = {
{ .compatible = "riscv,clint0", .data = &clint_offset },
{ .compatible = "sifive,clint0", .data = &clint_offset },
{ .compatible = "thead,c900-clint", .data = &clint_offset },
{ .compatible = "thead,c900-clint-mswi", .data = &clint_offset },
{ .compatible = "thead,c900-aclint-mswi" },
{ .compatible = "riscv,aclint-mswi" },
{ },

View File

@@ -14,9 +14,6 @@
#include <sbi_utils/reset/fdt_reset.h>
#include <sbi_utils/i2c/fdt_i2c.h>
#define MANGO_BOARD_TYPE_MASK 0x80
#define REG_BOARD_TYPE 0x00
#define REG_CMD 0x03
#define CMD_POWEROFF 0x02
@@ -60,22 +57,6 @@ static struct sbi_system_reset_device sg2042_mcu_reset_device = {
.system_reset = sg2042_mcu_reset
};
static int sg2042_mcu_reset_check_board(struct i2c_adapter *adap, uint32_t reg)
{
static uint8_t val;
int ret;
/* check board type */
ret = i2c_adapter_reg_read(adap, reg, REG_BOARD_TYPE, &val);
if (ret)
return ret;
if (!(val & MANGO_BOARD_TYPE_MASK))
return SBI_ENODEV;
return 0;
}
static int sg2042_mcu_reset_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
@@ -96,8 +77,6 @@ static int sg2042_mcu_reset_init(const void *fdt, int nodeoff,
if (ret)
return ret;
ret = sg2042_mcu_reset_check_board(mcu_adapter, mcu_reg);
sbi_system_reset_add_device(&sg2042_mcu_reset_device);
return 0;

View File

@@ -156,6 +156,8 @@ static const struct fdt_match timer_mtimer_match[] = {
{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
{ .compatible = "thead,c900-clint-mtimer",
.data = &thead_clint_quirks },
{ .compatible = "thead,c900-aclint-mtimer",
.data = &thead_aclint_quirks },
{ .compatible = "riscv,aclint-mtimer" },

View File

@@ -255,7 +255,7 @@ static int generic_early_init(bool cold_boot)
else
rc = fdt_serial_init(fdt);
if (rc)
return rc;
return (rc == SBI_ENODEV) ? 0 : rc;
fdt_cppc_init(fdt);
fdt_hsm_init(fdt);

View File

@@ -58,6 +58,8 @@ static const struct fdt_match thead_generic_match[] = {
{ .compatible = "sophgo,cv1812h", .data = &sophgo_cv1800_quirks },
{ .compatible = "sophgo,sg2000", .data = &sophgo_cv1800_quirks },
{ .compatible = "sophgo,sg2002", .data = &sophgo_cv1800_quirks },
{ .compatible = "sophgo,sg2044", .data = &sophgo_cv1800_quirks },
{ .compatible = "sophgo,bm1690", .data = &sophgo_cv1800_quirks },
{ .compatible = "thead,th1520", .data = &thead_th1520_quirks },
{ .compatible = "canaan,kendryte-k230", .data = &canaan_k230_quirks },
{ },