调试串口驱动,发现在MLO里面配置了串口引脚,然后u-boot阶段,内核阶段,再次更改串口的引脚配置,串口仍可以正常打印,是不是说串口的引脚配置只能配置一次,再次配置将失效?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
调试串口驱动,发现在MLO里面配置了串口引脚,然后u-boot阶段,内核阶段,再次更改串口的引脚配置,串口仍可以正常打印,是不是说串口的引脚配置只能配置一次,再次配置将失效?
SPL阶段的串口配置在arch/arm/cpu/armv7/am33xx/board.c里面
void early_system_init(void)
{
/*
* The ROM will only have set up sufficient pinmux to allow for the
* first 4KiB NOR to be read, we must finish doing what we know of
* the NOR mux in this space in order to continue.
*/
#ifdef CONFIG_NOR_BOOT
enable_norboot_pin_mux();
#endif
//看门狗关闭
watchdog_disable();
//串口接口配置
set_uart_mux_conf();
//配置时钟
setup_early_clocks();
//串口软件复位
uart_soft_reset();
//串口模式初始化
preloader_console_init();
#ifdef CONFIG_TI_I2C_BOARD_DETECT
//板级检查
do_board_detect();
#endif
#if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
/* Enable RTC32K clock */
rtc32k_enable();
#endif
}
上面串口的配置展开:具体是在board/ti/am335x/board.c里面
void set_uart_mux_conf(void)
{
#if CONFIG_CONS_INDEX == 1
enable_uart0_pin_mux();
#elif CONFIG_CONS_INDEX == 2
enable_uart1_pin_mux();
#elif CONFIG_CONS_INDEX == 3
enable_uart2_pin_mux();
#elif CONFIG_CONS_INDEX == 4
enable_uart3_pin_mux();
#elif CONFIG_CONS_INDEX == 5
enable_uart4_pin_mux();
#elif CONFIG_CONS_INDEX == 6
enable_uart5_pin_mux();
#endif
}
void enable_uart0_pin_mux(void)
{
configure_module_pin_mux(uart0_pin_mux);
}
static struct module_pin_mux uart0_pin_mux[] = {
{OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* UART0_RXD */
{OFFSET(uart0_txd), (MODE(0) | PULLUDEN)}, /* UART0_TXD */
{-1},
};
内核阶段是在设备树上进行描述:
/*调试串口*/
uart0_pins: pinmux_uart0_pins {
pinctrl-single,pins = <
0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
>;
};
我现在的意思是,串口在u-boot阶段配置好以后进入内核读取设备树信息时,当更改了串口的配置信息时,串口一样可以打印信息,也就是说,设备树的描述信息完全没有起作用,这是为什么