Linux bring up serial port when to initialize vmlinux. lds. S link script www.2cto.com SECTIONS {. init: {init_callcon_initcall -----------> # define CON_INITCALL \ SECURITY_INITCALL VMLINUX_SYMBOL (_ con_initcall_start) = .; \ INIT_RAM_FS *(. con_initcall.init) \} VMLINUX_SYMBOL (_ con_initcall_end) = .;}} in init. h contains such a macro definition # define console_initcall (fn) \ static initcall_t _ initcall _ # fn \ _ used _ section (. con_initcall.init) = fn serial driver ----> \ drivers \ amlogic \ uart \ am_uart.cstatic int _ init am_uart_lele_init (void) {register_console (& am_uart_console); return 0 ;} console_initcall (listener); static void _ exit am_uart_exit (void) {# if 0 # ifdef CONFIG_AM_UART_CONSOLE unregister_console (& am_uart_console); # endif listener (& listener ); uart_unregister_driver (& am_uart_reg);} module_init (am_uart_init ); ================> at startup, call the initialization serial port module_exit (am_uart_exit ).