How can I change the serial port of am335x to normal serial port, and change the serial port of am335x to normal serial port?
Today, the customer needs to change the general debug serial port to the general serial port. Requirements:
1. In the SPL stage, debugging information cannot be printed or entered.
2. The uboot stage cannot contain printed information or input.
3. the kernel cannot be printed or input.
4. The file system cannot print or enter debugging information.
I.
In the SPL stage, we mainly configure ARM core, including the interrupt vector table, cache, MMU, and so on. We also configure the clock, uart, timer, and DDR, to remove the serial port debugging in the SPL phase, refer to uboot/board/ti/am335x/board. the s_init () (a typical initialization function) function in the c file directly shields the preloader_console_init () function. UBOOT starts to output debugging information through the serial port after the function initializes the console (console, so as long as you do not initialize the console, the serial port is still a common serial port.
II.
In the uboot stage, we also need to initialize various peripheral modules, including the SPL stage, in addition to the peripherals that the DDR thinks, so even if we do not initialize the console in the SPL stage, we will continue to do this in the uboot stage. You can see uboot/arch/arm/lib/board. c's init_fnc_t * init_sequence [] struct. All functions in this struct will be loaded and initialized. So find the console function here and shield it from serial_init, lele_init_f, and onsole_init_r.
III.
In start kernel ...... then, uboot will pass the environment variables to the kernel, and the kernel will make relevant configurations according to the environment variables. Therefore, remove the console value in UBOOT or change ttyO0 to ttyONLL, source code in uboot/include/configs/am335x_evm.h is about 66 lines? "Console = ttyONULL, 115200n8 \ 0 "\.
4.
In the file system, the system will automatically run the inittab in the/etc/path to load getty, so that the debug serial port can be logged into the file system for debugging. So we need to remove the following line of command: "ttyO0: respawn:/sbin/getty-L? TtyO0 115200 vt100 # GENERIC_SERIAL"
5.
After you change the debugging serial port to a common serial port, if you need to perform some debugging, you can log on to the Board through the network (ssh). This problem may occur:
When debugging the serial port login, you only need to enter "root" to log on successfully. You do not need a password. When you log on via ssh, you will be prompted to enter the password, and the entered password is incorrect. This is because two parameters in/etc/ssh/sshd_config are not paired. You must allow automatic login by clearing the password and password. The following configuration is required:
PasswordAuthentication yes
PermitEmptyPasswords yes