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

fixes for jellybean #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions board/omap4430sdp/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ int determine_boot_type(void)
extern uint16_t check_charging(uint8_t* enabling);
unsigned long bootcount = bootcount_load();
char s [5];
char *buffer[256];

setenv("bootlimit", stringify(ACCLAIM_BOOTLIMIT));
setenv("altbootcmd", "mmcinit 1; booti mmc1 recovery");
Expand All @@ -694,6 +695,11 @@ int determine_boot_type(void)
lcd_console_setcolor((batt_lvl < 30?(batt_lvl <= 10?CONSOLE_COLOR_RED:CONSOLE_COLOR_ORANGE):CONSOLE_COLOR_GREEN), CONSOLE_COLOR_BLACK);
lcd_printf("batt level: %d\n charging %s", batt_lvl, (charging?"ENABLED":"DISABLED"));

if (load_serial_num() == 0) {
char *serialnum = getenv("serialnum");
sprintf(buffer, "setenv hwbootargs androidboot.serialno=%s", serialnum);
run_command(buffer, 0);
}

int action = get_boot_action();

Expand All @@ -704,37 +710,39 @@ int determine_boot_type(void)
lcd_bl_set_brightness(100); //batt very low, let it charge
switch(action) {
case BOOT_SD_NORMAL:
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 boot.img; booti 0x81000000");
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs} ${hwbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 boot.img; booti 0x81000000");
setenv ("altbootcmd", "run bootcmd"); // for sd boot altbootcmd is the same as bootcmd
display_feedback(BOOT_SD_NORMAL);
return 0;

case BOOT_SD_RECOVERY:
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 recovery.img; booti 0x81000000");
setenv ("altbootcmd", "run bootcmd"); // for sd boot altbootcmd is the same as bootcmd
case BOOT_SD_RECOVERY:
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs} ${hwbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 recovery.img; booti 0x81000000");
setenv ("altbootcmd", "run bootcmd"); // for sd boot altbootcmd is the same as bootcmd
display_feedback(BOOT_SD_RECOVERY);
return 0;
return 0;

case BOOT_SD_ALTBOOT:
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 altboot.img; booti 0x81000000");
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${sdbootargs} ${hwbootargs}; run setbootargs; mmcinit 0; fatload mmc 0:1 0x81000000 altboot.img; booti 0x81000000");
setenv ("altbootcmd", "run bootcmd"); // for sd boot altbootcmd is the same as bootcmd
display_feedback(BOOT_SD_ALTBOOT);
return 0;

//actually, boot from boot+512K -- thanks bauwks!
case BOOT_EMMC_NORMAL:
setenv("bootcmd", "mmcinit 1; booti mmc1 boot 0x80000");
setenv("setbootargs", "setenv bootargs ${bootargs} ${hwbootargs};");
setenv("bootcmd", "run setbootargs; mmcinit 1; booti mmc1 boot 0x80000");
display_feedback(BOOT_EMMC_NORMAL);
return 0;

//actually, boot from recovery+512K -- thanks bauwks!
case BOOT_EMMC_RECOVERY:
setenv("bootcmd", "mmcinit 1; booti mmc1 recovery 0x80000");
setenv("setbootargs", "setenv bootargs ${bootargs} ${hwbootargs};");
setenv("bootcmd", "run setbootargs; mmcinit 1; booti mmc1 recovery 0x80000");
display_feedback(BOOT_EMMC_RECOVERY);
return 0;

case BOOT_EMMC_ALTBOOT: // no 512K offset, this is just a file.
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${emmcbootargs}; run setbootargs; mmcinit 1; fatload mmc 1:5 0x81000000 altboot.img; booti 0x81000000");
setenv ("bootcmd", "setenv setbootargs setenv bootargs ${emmcbootargs} ${hwbootargs}; run setbootargs; mmcinit 1; fatload mmc 1:5 0x81000000 altboot.img; booti 0x81000000");
setenv ("altbootcmd", "run bootcmd"); // for emmc altboot altbootcmd is the same as bootcmd
display_feedback(BOOT_EMMC_ALTBOOT);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ sinclude .depend
ifeq ($(BOARD),omap4430sdp)
# Pull in the default kernel command line
#include $(TOPDIR)/../../../device/ti/blaze/BoardConfig.mk
BOARD_KERNEL_CMDLINE := androidboot.console=ttyO0 console=ttyO0,115200n8 mem=448M@0x80000000 mem=512M@0xA0000000 init=/init rootwait vram=32M,82000000 omapfb.vram=0:5M@82000000
BOARD_KERNEL_CMDLINE := console=/dev/null
CFLAGS += -DBOARD_KERNEL_CMDLINE="$(BOARD_KERNEL_CMDLINE)"
endif
5 changes: 3 additions & 2 deletions include/configs/omap4430sdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@
#define CONFIG_BOOTARGS ""
#define CONFIG_EXTRA_ENV_SETTINGS \
"commonbootargs=" stringify(BOARD_KERNEL_CMDLINE) "\0" \
"sdbootargs=${commonbootargs} root=/dev/mmcblk1p2 rw" "\0" \
"emmcbootargs=${commonbootargs} root=/dev/mmcblk1p2 rw" "\0"
"androidbootargs=androidboot.console=/dev/null androidboot.hardware=acclaim" "\0" \
"sdbootargs=${commonbootargs} ${androidbootargs} root=/dev/mmcblk1p2 rw" "\0" \
"emmcbootargs=${commonbootargs} ${androidbootargs} root=/dev/mmcblk1p2 rw" "\0"

#define CONFIG_BOOTCOMMAND "booti mmc1"

Expand Down