mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
arm: K3: common: Allow for early console functionality
Implement an early console functionality in SPL that can be used before the main console is being brought up. This helps in situations where the main console is dependent on System Firmware (SYSFW) being up and running, which is usually not the case during the very early stages of boot. Using this early console functionality will allow for an alternate serial port to be used to support things like UART-based boot and early diagnostic messages until the main console is ready to get activated. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
This commit is contained in:
parent
e413033d35
commit
e630afe1de
3 changed files with 48 additions and 0 deletions
|
@ -66,6 +66,27 @@ config SYS_K3_BOOT_CORE_ID
|
|||
int
|
||||
default 16
|
||||
|
||||
config K3_EARLY_CONS
|
||||
bool "Activate to allow for an early console during SPL"
|
||||
depends on SPL
|
||||
help
|
||||
Turn this option on to enable an early console functionality in SPL
|
||||
before the main console is being brought up. This can be useful in
|
||||
situations where the main console is dependent on System Firmware
|
||||
(SYSFW) being up and running, which is usually not the case during
|
||||
the very early stages of boot. Using this early console functionality
|
||||
will allow for an alternate serial port to be used to support things
|
||||
like UART-based boot and early diagnostic messages until the main
|
||||
console is ready to get activated.
|
||||
|
||||
config K3_EARLY_CONS_IDX
|
||||
depends on K3_EARLY_CONS
|
||||
int "Index of serial device to use for SPL early console"
|
||||
default 1
|
||||
help
|
||||
Use this option to set the index of the serial device to be used
|
||||
for the early console during SPL execution.
|
||||
|
||||
config K3_LOAD_SYSFW
|
||||
bool
|
||||
depends on SPL
|
||||
|
|
|
@ -27,6 +27,32 @@ struct ti_sci_handle *get_ti_sci_handle(void)
|
|||
return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
|
||||
}
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_K3_EARLY_CONS
|
||||
int early_console_init(void)
|
||||
{
|
||||
struct udevice *dev;
|
||||
int ret;
|
||||
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
|
||||
ret = uclass_get_device_by_seq(UCLASS_SERIAL, CONFIG_K3_EARLY_CONS_IDX,
|
||||
&dev);
|
||||
if (ret) {
|
||||
printf("Error getting serial dev for early console! (%d)\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
gd->cur_serial_dev = dev;
|
||||
gd->flags |= GD_FLG_SERIAL_READY;
|
||||
gd->have_console = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SYS_K3_SPL_ATF
|
||||
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
|
||||
{
|
||||
|
|
|
@ -9,3 +9,4 @@
|
|||
#include <asm/armv7_mpu.h>
|
||||
|
||||
void setup_k3_mpu_regions(void);
|
||||
int early_console_init(void);
|
||||
|
|
Loading…
Reference in a new issue