By default, the Linux kernel sets the uart2 function as nrts1 and ntcts1, but it is not used as a normal serial port. To use uart2 as a serial port, make the following changes:The linux2.6 kernel sets the gphcon register value to 0x16faaa, which means that gph6 is set to nrts1 and gph7 is set to ncts1. At this time, Serial Port 2 cannot send and receive data.
1. Modify the uart2 configuration in arch/ARM/mach-s3c2440/mach-smdk2440.c, after the modification is as follows:
Static struct s3c2410_uartcfg smdk2440_uartcfgs [] _ initdata = {
[0] = {
. Hwport = 0,
. Flags = 0,
. Ucon = 0x3c5,
. Ulcon = 0x03,
. Ufcon = 0x51,
},
[1] = {
. Hwport = 1,
. Flags = 0,
. Ucon = 0x3c5,
. Ulcon = 0x03,
. Ufcon = 0x51,
},
/* IR port */
[2] = {
. Hwport = 2,
. Flags = 0,
. Ucon = 0x3c5,
. Ulcon = 0x03,/* old0x43 */
. Ufcon = 0x51,
}
};
2. VI Drivers/serial/Samsung. c
// Add the following header file
# Include <Linux/gpio. h>
# Include <Mach/regs-gpio.h>
Add
S3c2410_gpio_cfgpin (s3c2410_gph (6), s3c2410_gph6_txd2 );
S3c2410_gpio_pullup (s3c2410_gph (6), 1 );
S3c2410_gpio_cfgpin (s3c2410_gph (7), s3c2410_gph7_rxd2 );
S3c2410_gpio_pullup (s3c2410_gph (7), 1 );
3. recompile zimage and download it to the Development Board.