As I said I use 0xdroid provided omap3-2.6.32 Kernel, there is no omap-
serial.c inside.
At first I wanted to add 2.6.37 file to 2.6.32, but it failed....since
file dependency.
So I added the 2.6.32 omap-serial.c to my kernel, here is my steps:
(Reference PATCH omap: Hack: Switch sholes to the omap serial driver
http://android.git.kernel.org/?p=kernel/omap.git;a=commitdiff;h=3e9adf317ef6930917923788033b67f669fa01e5)
1. Add new files
drivers/serial/omap-serial.c (
http://android.git.kernel.org/?p=kernel/
omap.git;a=tree;f=drivers/
serial;h=55a7cb5d99fa6f9e666010eaf31920fe7df355d0;hb=refs/heads/
archive/android-omap-2.6.32)
arch/arm/plat-omap/include/plat/omap-serial.h (http://
android.git.kernel.org/?p=kernel/omap.git;a=tree;f=arch/arm/plat-omap/
include/plat;h=7f4702eae7e73bed1d7bbc10a3e0a09b17237c54;hb=refs/heads/
archive/android-omap-2.6.32)
arch/arm/include/asm/mach/serial_omap.h (http://
android.git.kernel.org/?p=kernel/omap.git;a=tree;f=arch/arm/include/
asm/mach;h=0b1b6e286a8d36a58c0a5d4c7b4c6be7fbf66ca4;hb=refs/heads/
archive/android-omap-2.6.32)
2. Replace the 0xdroid files by the 2.6.32 latest one (http://
android.git.kernel.org/?p=kernel/omap.git;a=tree;hb=refs/heads/archive/
android-omap-2.6.32)
arch/arm/mach-omap2/serial.c
arch/arm/plat-omap/include/plat/serial.h
include/linux/serial_core.h
include/linux/serial_reg.h
include/linux/tty.h
3. Modify 0xdroid ordinary files by reference patch (http://
android.git.kernel.org/?p=kernel/
omap.git;a=commitdiff;h=3e9adf317ef6930917923788033b67f669fa01e5)
arch/arm/plat-omap/include/plat/board.h
drivers/serial/Makefile
drivers/serial/Kconfig
arch/arm/mach-omap2/board-sholes.c
4.Modify 0xdroid ordinary files which patch does not mention
(1) arch/arm/mach-omap2/board-devkit8000.c
- omap_serial_init();
+omap_serial_init(0,0);
static struct omap_board_config_kernel devkit8000_config[] _initdata =
{
- /* XXX
{ OMAP_TAG_UART, &devkit8000_uart_config },
- */
};
- /* XXX
static struct omap_uart_config devkit8000_uart_config _initdata = {
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
};
- */
(2) arch/arm/mach-omap2/board-omap3beagle.c
- omap_serial_init();
+omap_serial_init(0,0);
+static struct omap_board_config_kernel omap3_beagle_config[]
_initdata = {
+ { OMAP_TAG_LCD, &omap3_beagle_lcd_config },
+ //christine/* XXX
+ { OMAP_TAG_UART, &omap3_beagle_uart_config },
+};
+static struct omap_uart_config omap3_beagle_uart_config _initdata =
{
+ .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
+};
5. Modify the omap-serial.c to support the correct speed
Because 48000000/16/3=1M, not 48000000/13/x
And 48000000/16/2=1.5M, not 48000000/13/x
//devkit8000-0x5-kernel/drivers/serial/omap-serial.c
serial_omap_get_divisor(struct uart_port *port, unsigned int baud)
{
unsigned int divisor;
- if (baud > OMAP_MODE13X_SPEED && baud != 3000000)
+ if (baud > OMAP_MODE13X_SPEED && baud != 3000000 && baud !=
1000000 && baud != 1500000)
divisor = 13;
else
divisor = 16;
return port->uartclk/(baud * divisor);
}
static void
serial_omap_set_termios(struct uart_port *port, struct ktermios
*termios,
struct ktermios *old)
{
.
.
- if (baud > 230400 && baud != 3000000)
+ if (baud > 230400 && baud != 3000000 && baud != 1000000 &&
baud != 1500000)
serial_out(up, UART_OMAP_MDR1, OMAP_MDR1_MODE13X);
else
serial_out(up, UART_OMAP_MDR1, OMAP_MDR1_MODE16X);
.
.
.
}
6. Add new driver
$ make ARCH=arm menuconfig
<Y> to include the items
Device Drivers >
Character devices >
Serial drivers >
[*] OMAP serial port support
And choose all the drivers under omap serial port
support
7. make
Besides, make sure your serial application on Android set the speed as
you want.
I use busybox's microcom, and I have to define the speed > 921600bps
by myself.
Christine