Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android add multiboot #2

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions arch/arm/include/asm/arch-gxl/reboot.h
Expand Up @@ -45,6 +45,8 @@ Reboot reason AND corresponding env setting:
#define AMLOGIC_CRASH_REBOOT 11
#define AMLOGIC_KERNEL_PANIC 12
#define AMLOGIC_WATCHDOG_REBOOT 13
#define AMLOGIC_UBUNTU_REBOOT 14
#define AMLOGIC_LIBREELEC_REBOOT 15

/*
old version env
Expand Down
21 changes: 15 additions & 6 deletions board/khadas/configs/kvim.h
Expand Up @@ -72,8 +72,17 @@
#define CONFIG_SYS_MAXARGS 64
#define CONFIG_EXTRA_ENV_SETTINGS \
"firstboot=0\0"\
"start_autoscript="\
"if usb start; then run start_usb_autoscript; if mmcinfo; then run start_mmc_autoscript;fi;fi;"\
"\0"\
"start_mmc_autoscript="\
"if fatload mmc 0 1020000 s905_autoscript; then autoscr 1020000; fi"\
"\0"\
"start_usb_autoscript="\
"if fatload usb 0 1020000 s905_autoscript; then autoscr 1020000; fi"\
"\0"\
"upgrade_step=0\0"\
"jtag=apao\0"\
"jtag=disable\0"\
"loadaddr=1080000\0"\
"outputmode=1080p60hz\0" \
"hdmimode=1080p60hz\0" \
Expand Down Expand Up @@ -213,13 +222,13 @@
"\0"\
"vim_check="\
"saradc open 1;"\
"if saradc get_in_range 0x1d0 0x220; then "\
"if saradc get_in_range 0x1a0 0x220; then "\
"echo Product checking: pass!;"\
"else if saradc get_in_range 0x0 0x1cf; then "\
"echo Product checking: fail!; sleep 5; reboot;"\
"fi;fi;"\
"\0"\
"openelec_check="\
"boot_ini_check="\
"cfgload;"\
"\0"\

Expand All @@ -230,10 +239,9 @@
"run storeargs;"\
"run combine_key;" \
"run upgrade_key;" \
"run vim_check;" \
"run switch_bootmode;"\
"run openelec_check;"
#define CONFIG_BOOTCOMMAND "run storeboot"
"run boot_ini_check;"
#define CONFIG_BOOTCOMMAND "run start_autoscript; run storeboot"

//#define CONFIG_ENV_IS_NOWHERE 1
#define CONFIG_ENV_SIZE (64*1024)
Expand Down Expand Up @@ -365,6 +373,7 @@
#define CONFIG_CMD_I2C 1
#define CONFIG_CMD_MEMORY 1
#define CONFIG_CMD_FAT 1
#define CONFIG_CMD_EXT4 1
#define CONFIG_CMD_GPIO 1
#define CONFIG_CMD_RUN
#define CONFIG_CMD_REBOOT 1
Expand Down
13 changes: 7 additions & 6 deletions board/khadas/kvim/firmware/timing.c
Expand Up @@ -336,12 +336,12 @@ ddr_timing_t __ddr_timming[] = {
/* ddr4 2400 timing */
{
.identifier = CONFIG_DDR_TIMMING_DDR4_2400,
.cfg_ddr_rtp = 9,//(4),
.cfg_ddr_wtr = 9,//(6),
.cfg_ddr_rtp = (4),
.cfg_ddr_wtr = (6),
.cfg_ddr_rp = 15*1.2,//(11),
.cfg_ddr_rcd = 15*1.2,//(11),
.cfg_ddr_ras = 35*1.2,//(35),
.cfg_ddr_rrd = (8),
.cfg_ddr_rrd = (4),
.cfg_ddr_rc =50*1.2,// (46),//RAS+RP
.cfg_ddr_mrd = (8),
.cfg_ddr_mod = (24),
Expand Down Expand Up @@ -491,9 +491,9 @@ ddr_set_t __ddr_setting = {
//.t_pub_zq1pr = 0x7b, //PUB ZQ1PR
//.t_pub_zq2pr = 0x7b, //PUB ZQ2PR
//.t_pub_zq3pr = 0x7b, //PUB ZQ3PR
.t_pub_zq0pr = 0x5d95d, //PUB ZQ0PR
.t_pub_zq1pr = 0x5d95d, //PUB ZQ1PR
.t_pub_zq2pr = 0x5d95d, //PUB ZQ2PR
.t_pub_zq0pr = 0x5d959, //PUB ZQ0PR
.t_pub_zq1pr = 0x5d91d, //PUB ZQ1PR
.t_pub_zq2pr = 0x5d91d, //PUB ZQ2PR
.t_pub_zq3pr = 0x1dd1d, //PUB ZQ3PR

/* pctl0 defines */
Expand Down Expand Up @@ -532,6 +532,7 @@ ddr_set_t __ddr_setting = {
.t_pctl0_dfilpcfg0 = ( 1 | (3 << 4) | (1 << 8) | (13 << 12) | (7 <<16) | (1 <<24) | ( 3 << 28)),
.t_pub_acbdlr0 = 0, //CK0 delay fine tune
.t_pub_aclcdlr = 0,
.t_pub_acbdlr3 = 0, //CS delay fine tune
.ddr_func = DDR_FUNC, /* ddr func demo 2016.01.26 */

.wr_adj_per = {
Expand Down
12 changes: 4 additions & 8 deletions board/khadas/kvim/kvim.c
Expand Up @@ -356,14 +356,10 @@ int board_init(void)
#ifdef CONFIG_AML_V2_FACTORY_BURN
aml_try_factory_usb_burning(0, gd->bd);
#endif// #ifdef CONFIG_AML_V2_FACTORY_BURN
/*for LED*/
//clear pinmux
clrbits_le32(AO_RTI_PIN_MUX_REG, ((1<<3)|(1<<4)));
clrbits_le32(AO_RTI_PIN_MUX_REG2, ((1<<1)|(1<<31)));
//set output mode
clrbits_le32(PREG_PAD_GPIO0_EN_N, (1 << 24));
//set output 1
setbits_le32(PREG_PAD_GPIO0_O, (1 << 24));

/* LED Pin: GPIOAO_9 */
clrbits_le32(AO_GPIO_O_EN_N, 1 << 9); // output mode
setbits_le32(AO_GPIO_O_EN_N, 1 << 25); // set 1

/*Power on GPIOAO_2 for VCC_5V*/
clrbits_le32(P_AO_GPIO_O_EN_N, ((1<<2)|(1<<18)));
Expand Down
14 changes: 14 additions & 0 deletions common/cmd_reboot.c
Expand Up @@ -90,6 +90,16 @@ int do_get_rebootmode (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
setenv("reboot_mode","watchdog_reboot");
break;
}
case AMLOGIC_UBUNTU_REBOOT:
{
setenv("reboot_mode","ubuntu_reboot");
break;
}
case AMLOGIC_LIBREELEC_REBOOT:
{
setenv("reboot_mode","libreelec_reboot");
break;
}

default:
{
Expand Down Expand Up @@ -127,6 +137,10 @@ int do_reboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
reboot_mode_val = AMLOGIC_CRASH_REBOOT;
else if (strcmp(mode, "kernel_panic") == 0)
reboot_mode_val = AMLOGIC_KERNEL_PANIC;
else if (strcmp(mode, "ubuntu_reboot") ==0)
reboot_mode_val = AMLOGIC_UBUNTU_REBOOT;
else if (strcmp(mode, "libreelec_reboot") ==0)
reboot_mode_val = AMLOGIC_LIBREELEC_REBOOT;
else {
printf("Can not find match reboot mode, use normal by default\n");
reboot_mode_val = AMLOGIC_NORMAL_BOOT;
Expand Down