Commit de26851f authored by Santosh Shilimkar's avatar Santosh Shilimkar

ARM: OMAP4: Fix NULL pointer dereference crash.

After the patch series "[PATCH 00/14] OMAP PM fixes for .31-rc"
merge in 2.6.31-rc5, the kernel crashed during boot on OMAP4430.
This patch fixes it by adding UART4 support and related code.
Without this patch omap_serial_init() would produce " NULL pointer
dereference" and kernel crashes in the bootup on OMAP4430 platform.

Some more info on the merge issue can be found here.
More info- http://lkml.org/lkml/2009/8/20/192

Note: While merging this patch,"IO_ADDRESS" needs to be changed
to "OMAP2_IO_ADDRESS" if the Tony's below series is already merged in.
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg15072.html

id = 3 instead of "PLAT8250_DEV_FOURPORT" as suggested by Kevin.
Signed-off-by: default avatarSyed Rafiuddin <rafiuddin.syed@ti.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 6bedfb76
...@@ -39,7 +39,7 @@ static struct platform_device *sdp4430_devices[] __initdata = { ...@@ -39,7 +39,7 @@ static struct platform_device *sdp4430_devices[] __initdata = {
}; };
static struct omap_uart_config sdp4430_uart_config __initdata = { static struct omap_uart_config sdp4430_uart_config __initdata = {
.enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2), .enabled_uarts = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
}; };
static struct omap_lcd_config sdp4430_lcd_config __initdata = { static struct omap_lcd_config sdp4430_lcd_config __initdata = {
......
...@@ -112,7 +112,21 @@ static struct plat_serial8250_port serial_platform_data2[] = { ...@@ -112,7 +112,21 @@ static struct plat_serial8250_port serial_platform_data2[] = {
.flags = 0 .flags = 0
} }
}; };
#ifdef CONFIG_ARCH_OMAP4
static struct plat_serial8250_port serial_platform_data3[] = {
{
.membase = IO_ADDRESS(OMAP_UART4_BASE),
.mapbase = OMAP_UART4_BASE,
.irq = 70,
.flags = UPF_BOOT_AUTOCONF,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = OMAP24XX_BASE_BAUD * 16,
}, {
.flags = 0
}
};
#endif
static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
int offset) int offset)
{ {
...@@ -550,6 +564,17 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { ...@@ -550,6 +564,17 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
}, },
}, },
}, },
#ifdef CONFIG_ARCH_OMAP4
{
.pdev = {
.name = "serial8250",
.id = 3,
.dev = {
.platform_data = serial_platform_data3,
},
},
},
#endif
}; };
void __init omap_serial_init(void) void __init omap_serial_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment