*/
#include <dm.h>
+#include <event.h>
#include <asm/io.h>
#include <asm/arch/gcr.h>
#include "../common/uart.h"
return 0;
}
-int last_stage_init(void)
-{
- board_set_console();
+EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, board_set_console);
- return 0;
-}
#define UART_LCR 0xc
#define LCR_DLAB BIT(7)
-void board_set_console(void)
+int board_set_console(void)
{
const unsigned long baudrate_table[] = CFG_SYS_BAUDRATE_TABLE;
struct udevice *dev = gd->cur_serial_dev;
int ret, i;
if (!dev)
- return;
+ return -ENODEV;
uart_reg = dev_read_addr_ptr(dev);
ret = clk_get_by_index(dev, 0, &clk);
if (ret)
- return;
+ return ret;
uart_clk = clk_get_rate(&clk);
setbits_8(uart_reg + UART_LCR, LCR_DLAB);
snprintf(string, sizeof(string), "ttyS0,%un8", gd->baudrate);
env_set("console", string);
+ return 0;
}
#ifndef _NUVOTON_UART_H
#define _NUVOTON_UART_H
-void board_set_console(void);
+int board_set_console(void);
#endif /* _NUVOTON_COMMON_H */
#include <dm.h>
#include <env.h>
+#include <event.h>
#include <asm/io.h>
#include <asm/arch/gcr.h>
#include <asm/mach-types.h>
return 0;
}
-int last_stage_init(void)
+static int last_stage_init(void)
{
char value[32];
}
sprintf(value, "ttyS%d,115200n8", dev->seq_);
env_set("console", value);
- board_set_console();
+ return board_set_console();
}
return 0;
}
+EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
+
CONFIG_FIT_VERBOSE=y
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="run common_bootargs; run romboot"
-CONFIG_LAST_STAGE_INIT=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="U-Boot>"
CONFIG_SYS_MAXARGS=32
CONFIG_DM_RESET=y
CONFIG_SYS_LOAD_ADDR=0x10000000
CONFIG_TARGET_POLEG=y
+CONFIG_SYS_SKIP_UART_INIT=y
CONFIG_ENV_ADDR=0x80100000
CONFIG_FIT=y
CONFIG_USE_BOOTCOMMAND=y