netbird_v2: fix spl uart boot
This commit is contained in:
parent
fd055a5672
commit
3f18cdaff7
|
|
@ -113,7 +113,13 @@ static inline int __maybe_unused read_eeprom(void)
|
||||||
|
|
||||||
struct serial_device *default_serial_console(void)
|
struct serial_device *default_serial_console(void)
|
||||||
{
|
{
|
||||||
return &eserial1_device;
|
if (spl_boot_device() == BOOT_DEVICE_UART) {
|
||||||
|
enable_uart0_pin_mux();
|
||||||
|
return &eserial1_device;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return &eserial2_device;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||||
|
|
@ -206,7 +212,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
|
||||||
|
|
||||||
void set_uart_mux_conf(void)
|
void set_uart_mux_conf(void)
|
||||||
{
|
{
|
||||||
enable_uart0_pin_mux();
|
enable_uart0_disabled_pin_mux();
|
||||||
enable_uart1_pin_mux();
|
enable_uart1_pin_mux();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
* is required on the board.
|
* is required on the board.
|
||||||
*/
|
*/
|
||||||
void enable_uart0_pin_mux(void);
|
void enable_uart0_pin_mux(void);
|
||||||
|
void enable_uart0_disabled_pin_mux(void);
|
||||||
void enable_uart1_pin_mux(void);
|
void enable_uart1_pin_mux(void);
|
||||||
void enable_uart2_pin_mux(void);
|
void enable_uart2_pin_mux(void);
|
||||||
void enable_uart3_pin_mux(void);
|
void enable_uart3_pin_mux(void);
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ static struct module_pin_mux i2c0_pin_mux[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* V2OK */
|
/* V2OK */
|
||||||
static struct module_pin_mux uart0_netbird_pin_mux[] = {
|
static struct module_pin_mux uart0_disabled_netbird_pin_mux[] = {
|
||||||
/* Leave UART0 unconfigured because we want to configure it as needed by linux (can/spi/uart/etc) */
|
/* Leave UART0 unconfigured because we want to configure it as needed by linux (can/spi/uart/etc) */
|
||||||
{OFFSET(uart0_rxd), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (E15) UART0_RXD */
|
{OFFSET(uart0_rxd), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (E15) UART0_RXD */
|
||||||
{OFFSET(uart0_txd), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (E16) UART0_TXD */
|
{OFFSET(uart0_txd), (MODE(7) | PULLUDDIS | RXACTIVE)}, /* (E16) UART0_TXD */
|
||||||
|
|
@ -63,6 +63,12 @@ static struct module_pin_mux uart0_netbird_pin_mux[] = {
|
||||||
{-1},
|
{-1},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct module_pin_mux uart0_netbird_pin_mux[] = {
|
||||||
|
/* Leave UART0 unconfigured because we want to configure it as needed by linux (can/spi/uart/etc) */
|
||||||
|
{OFFSET(uart0_rxd), (MODE(0) | PULLUDEN | PULLUP_EN | RXACTIVE)}, /* (E15) UART0_RXD */
|
||||||
|
{OFFSET(uart0_txd), (MODE(0) | PULLUDEN | PULLUP_EN)}, /* (E16) UART0_TXD */
|
||||||
|
{-1},
|
||||||
|
};
|
||||||
|
|
||||||
/* V2OK */
|
/* V2OK */
|
||||||
static struct module_pin_mux uart1_netbird_pin_mux[] = {
|
static struct module_pin_mux uart1_netbird_pin_mux[] = {
|
||||||
|
|
@ -154,6 +160,11 @@ void enable_uart0_pin_mux(void)
|
||||||
configure_module_pin_mux(uart0_netbird_pin_mux);
|
configure_module_pin_mux(uart0_netbird_pin_mux);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void enable_uart0_disabled_pin_mux(void)
|
||||||
|
{
|
||||||
|
configure_module_pin_mux(uart0_disabled_netbird_pin_mux);
|
||||||
|
}
|
||||||
|
|
||||||
void enable_uart1_pin_mux(void)
|
void enable_uart1_pin_mux(void)
|
||||||
{
|
{
|
||||||
configure_module_pin_mux(uart1_netbird_pin_mux);
|
configure_module_pin_mux(uart1_netbird_pin_mux);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue