Compare commits
5 Commits
master
...
sg2044-v1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
748d704108 | ||
|
|
3de9421b02 | ||
|
|
1d0d0a6b15 | ||
|
|
ba3b2e6269 | ||
|
|
4e26aa8747 |
1
Makefile
1
Makefile
@@ -427,7 +427,6 @@ DTSCPPFLAGS = $(CPPFLAGS) -nostdinc -nostdlib -fno-builtin -D__DTS__ -x assemble
|
|||||||
|
|
||||||
ifneq ($(DEBUG),)
|
ifneq ($(DEBUG),)
|
||||||
CFLAGS += -O0
|
CFLAGS += -O0
|
||||||
ELFFLAGS += -Wl,--print-gc-sections
|
|
||||||
else
|
else
|
||||||
CFLAGS += -O2
|
CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ static const struct fdt_match ipi_mswi_match[] = {
|
|||||||
{ .compatible = "riscv,clint0", .data = &clint_offset },
|
{ .compatible = "riscv,clint0", .data = &clint_offset },
|
||||||
{ .compatible = "sifive,clint0", .data = &clint_offset },
|
{ .compatible = "sifive,clint0", .data = &clint_offset },
|
||||||
{ .compatible = "thead,c900-clint", .data = &clint_offset },
|
{ .compatible = "thead,c900-clint", .data = &clint_offset },
|
||||||
|
{ .compatible = "thead,c900-clint-mswi", .data = &clint_offset },
|
||||||
{ .compatible = "thead,c900-aclint-mswi" },
|
{ .compatible = "thead,c900-aclint-mswi" },
|
||||||
{ .compatible = "riscv,aclint-mswi" },
|
{ .compatible = "riscv,aclint-mswi" },
|
||||||
{ },
|
{ },
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
#include <sbi_utils/reset/fdt_reset.h>
|
#include <sbi_utils/reset/fdt_reset.h>
|
||||||
#include <sbi_utils/i2c/fdt_i2c.h>
|
#include <sbi_utils/i2c/fdt_i2c.h>
|
||||||
|
|
||||||
#define MANGO_BOARD_TYPE_MASK 0x80
|
|
||||||
|
|
||||||
#define REG_BOARD_TYPE 0x00
|
|
||||||
#define REG_CMD 0x03
|
#define REG_CMD 0x03
|
||||||
|
|
||||||
#define CMD_POWEROFF 0x02
|
#define CMD_POWEROFF 0x02
|
||||||
@@ -60,22 +57,6 @@ static struct sbi_system_reset_device sg2042_mcu_reset_device = {
|
|||||||
.system_reset = sg2042_mcu_reset
|
.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,
|
static int sg2042_mcu_reset_init(const void *fdt, int nodeoff,
|
||||||
const struct fdt_match *match)
|
const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
@@ -96,8 +77,6 @@ static int sg2042_mcu_reset_init(const void *fdt, int nodeoff,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = sg2042_mcu_reset_check_board(mcu_adapter, mcu_reg);
|
|
||||||
|
|
||||||
sbi_system_reset_add_device(&sg2042_mcu_reset_device);
|
sbi_system_reset_add_device(&sg2042_mcu_reset_device);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ static const struct fdt_match timer_mtimer_match[] = {
|
|||||||
{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
|
{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
|
||||||
{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
|
{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
|
||||||
{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
|
{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
|
||||||
|
{ .compatible = "thead,c900-clint-mtimer",
|
||||||
|
.data = &thead_clint_quirks },
|
||||||
{ .compatible = "thead,c900-aclint-mtimer",
|
{ .compatible = "thead,c900-aclint-mtimer",
|
||||||
.data = &thead_aclint_quirks },
|
.data = &thead_aclint_quirks },
|
||||||
{ .compatible = "riscv,aclint-mtimer" },
|
{ .compatible = "riscv,aclint-mtimer" },
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ static int generic_early_init(bool cold_boot)
|
|||||||
else
|
else
|
||||||
rc = fdt_serial_init(fdt);
|
rc = fdt_serial_init(fdt);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return (rc == SBI_ENODEV) ? 0 : rc;
|
||||||
|
|
||||||
fdt_cppc_init(fdt);
|
fdt_cppc_init(fdt);
|
||||||
fdt_hsm_init(fdt);
|
fdt_hsm_init(fdt);
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ static const struct fdt_match thead_generic_match[] = {
|
|||||||
{ .compatible = "sophgo,cv1812h", .data = &sophgo_cv1800_quirks },
|
{ .compatible = "sophgo,cv1812h", .data = &sophgo_cv1800_quirks },
|
||||||
{ .compatible = "sophgo,sg2000", .data = &sophgo_cv1800_quirks },
|
{ .compatible = "sophgo,sg2000", .data = &sophgo_cv1800_quirks },
|
||||||
{ .compatible = "sophgo,sg2002", .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 = "thead,th1520", .data = &thead_th1520_quirks },
|
||||||
{ .compatible = "canaan,kendryte-k230", .data = &canaan_k230_quirks },
|
{ .compatible = "canaan,kendryte-k230", .data = &canaan_k230_quirks },
|
||||||
{ },
|
{ },
|
||||||
|
|||||||
Reference in New Issue
Block a user