Skip to content

Commit

Permalink
Add support for dongshanpi 1GiB LPDDR3.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjianxin-canaan authored and kendryte747 committed Sep 12, 2024
1 parent 11e99a1 commit 17952a6
Show file tree
Hide file tree
Showing 4 changed files with 18,568 additions and 2 deletions.
41 changes: 41 additions & 0 deletions board/kendryte/common/board_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,45 @@ static int do_k230_boot(struct cmd_tbl *cmdtp, int flag, int argc,

U_BOOT_CMD_COMPLETE(k230_boot, 6, 0, do_k230_boot, NULL, K230_BOOT_HELP, NULL);

typedef void (*func_app_entry)(void);
static int k230_boot_baremetal(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
static ulong boot_address , boot_size, boot_cpu;

if (argc < 4)
return CMD_RET_USAGE;

boot_cpu = hextoul(argv[1], NULL);
boot_address = hextoul(argv[2], NULL);
boot_size = hextoul(argv[3], NULL);

flush_cache(boot_address, boot_size);
printf("boot_cpu = %ld boot_address = 0x%lx boot_size=0x%lx\n", boot_cpu, boot_address, boot_size);
if(boot_cpu)
{
writel(boot_address, (void*)0x91102104ULL);//cpu1_hart_rstvec
udelay(100);
writel(0x10001000,(void*)0x9110100c);
udelay(100);
writel(0x10001,(void*)0x9110100c);
udelay(100);
writel(0x10000,(void*)0x9110100c);
}
else
{
func_app_entry app_entry = (void *)(long)boot_address;
app_entry();
}

return 0;
}

U_BOOT_CMD_COMPLETE(
boot_baremetal, 4, 1, k230_boot_baremetal,
"boot_baremetal",
"\n boot_baremetal cpu addr size\n", NULL
);


#endif
6 changes: 4 additions & 2 deletions board/kendryte/k230_canmv_dongshanpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if TARGET_K230_CANMV_DONGSHANPI

config SYS_CPU
default "k230"

config SYS_VENDOR
default "kendryte"

Expand All @@ -18,9 +18,11 @@ config BOARD_SPECIFIC_OPTIONS

choice
prompt "DDR Type And Frequency"
default CANMV_DONGSHANPI_LPDDR3_2133
default CANMV_DONGSHANPI_LPDDR3_1866

config CANMV_DONGSHANPI_LPDDR3_2133
bool "k230 canmv dongshanpi ddr3 2133"
config CANMV_DONGSHANPI_LPDDR3_1866
bool "k230 canmv dongshanpi ddr3 1866"
endchoice
endif
5 changes: 5 additions & 0 deletions board/kendryte/k230_canmv_dongshanpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ obj-$(CONFIG_CANMV_DONGSHANPI_LPDDR3_2133) += gen_canmv_ddr_2133.lex.o

$(obj)/gen_canmv_ddr_2133.lex.c: $(src)/canmv_ddr_init_2133.c $(BOARD_COMMON_DIR)/ddr.sh
$(Q)($(BOARD_COMMON_DIR)/ddr.sh $< $@ 0x50000 0x53fff 0x54000 0x54359 || exit 1)

obj-$(CONFIG_CANMV_DONGSHANPI_LPDDR3_1866) += gen_canmv_ddr_1866.lex.o

$(obj)/gen_canmv_ddr_1866.lex.c: $(src)/canmv_ddr_init_1866.c $(BOARD_COMMON_DIR)/ddr.sh
$(Q)($(BOARD_COMMON_DIR)/ddr.sh $< $@ 0x50000 0x53fff 0x54000 0x54359 || exit 1)
Loading

0 comments on commit 17952a6

Please sign in to comment.