CHG: [uboot] allow none as consoledev on nbhw14

BugzId: 48313

SVN commit 25524@trunk
This commit is contained in:
Stefan Eichenberger 2017-12-05 13:31:12 +00:00 committed by Moritz Rosenthal
parent 4c8e3d319a
commit adc75fb180
5 changed files with 34 additions and 9 deletions

View File

@ -30,10 +30,8 @@ static void select_fdt(void)
{
char fdt_image[256];
if (mvBoardPhyAddrGet(0) >= 0) {
strncpy (fdt_image, "openwrt-nbhw14.dtb", sizeof(fdt_image));
}
else if (mvBoardPhyAddrGet(1) >= 0) {
strncpy (fdt_image, "openwrt-nbhw14.dtb", sizeof(fdt_image));
if (mvBoardPhyAddrGet(1) >= 0) {
strncpy (fdt_image, "openwrt-nbhw14-sgmii.dtb", sizeof(fdt_image));
}
@ -75,8 +73,8 @@ static void pass_hw_rev(void)
void nbhw_update_env(void)
{
find_and_set_active_partition();
select_fdt();
pass_hw_rev();
set_console();
select_fdt();
}

View File

@ -26,6 +26,8 @@
#include "../nbhw_bd.h"
#include "../nbhw_fpga_prog.h"
DECLARE_GLOBAL_DATA_PTR;
unsigned int CONFIG_SYS_DUART_CHAN = 0;
static unsigned char OUTPUT_EXTENSION_CACHE = 0;
@ -178,6 +180,11 @@ int reset_reset_counter(void)
static int is_module_check_abort(void) {
char c;
if (gd->flags & GD_FLG_SILENT) {
return 0;
}
/* Check for abort */
if (tstc()) {
c = getc();

View File

@ -8,8 +8,8 @@
void find_and_set_active_partition(void)
{
u8 boot_partition = bd_get_boot_partition();
if (boot_partition > 1) {
u8 boot_partition = bd_get_boot_partition();
if (boot_partition > 1) {
boot_partition = 0;
}
@ -29,7 +29,6 @@ void set_console(void)
setenv("defaultconsole", buf);
}
#if defined(CONFIG_PRE_CONSOLE_BUFFER)
/* If consoldev is set take this as productive conosle instead of default console */
if (fs_set_blk_dev("mmc", "0:3", FS_TYPE_EXT) != 0) {
@ -38,6 +37,18 @@ void set_console(void)
}
len = fs_read("/root/boot/consoledev", (ulong)buf, 0, 5);
if (len == 0) {
puts("Using default console\n");
goto use_default_console;
}
/* If no console configured */
if (strncmp("none", buf, 4) == 0) {
setenv("silent", "1");
setenv("consoledev", "");
return;
}
if ((len != 5) || (strstr(buf, "tty")!=buf) || ((buf[4]<'0') && (buf[4]>'1'))) {
puts("Using default console\n");
goto use_default_console;

View File

@ -23,6 +23,8 @@
#include "nbhw_bd.h"
#include "nbhw_fpga_prog.h"
DECLARE_GLOBAL_DATA_PTR;
static fpga_prog_operation *_operation = NULL;
static int fpga_valid = 0;
@ -313,6 +315,10 @@ static int abort_fpga_boot (void)
int c, i;
int count = 0;
if (gd->flags& GD_FLG_SILENT) {
return 0;
}
/* check for 3 stop keystrokes */
for (i = 0; i < 5; i++) {
if (tstc()) {

View File

@ -728,6 +728,8 @@ extern unsigned int CONFIG_SYS_DUART_CHAN;
#undef CONFIG_AUTOBOOT_DELAY_STR
#define CONFIG_AUTOBOOT_STOP_STR "s"
#define CONFIG_SILENT_CONSOLE
#define CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
/* Overwritte the default environment */
#undef CONFIG_EXTRA_ENV_SETTINGS
@ -739,7 +741,8 @@ extern unsigned int CONFIG_SYS_DUART_CHAN;
"kernel_addr=0x2000000\0" \
"modify_fdt=fdt addr $fdt_addr;\0" /* Default port behaviour, overwritte in board/mv_ebu/a38x/nbhw14_env.c */ \
"root_part=1\0" /* Default root partition, overwritte in board/mv_ebu/a38x/nbhw14_env.c */ \
"add_sd_bootargs=setenv bootargs $bootargs root=/dev/mmcblk0p$root_part ro rootfstype=ext4 console=$consoledev,115200 rootwait\0" \
"set_console_dev=if test -n ${consoledev}; then setenv bootargs $bootargs console=$consoledev,115200; fi; true\0" \
"add_sd_bootargs=setenv bootargs $bootargs root=/dev/mmcblk0p$root_part ro rootfstype=ext4 rootwait; run set_console_dev\0" \
"add_version_bootargs=setenv bootargs $bootargs\0" \
"fdt_skip_update=yes\0" \
"ethaddr=" ETHADDR "\0" \