Skip to content

Commit

Permalink
ARM: OMAP4: Fix NULL pointer dereference crash.
Browse files Browse the repository at this point in the history
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

Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
  • Loading branch information
Santosh Shilimkar authored and Kevin Hilman committed Sep 2, 2009
1 parent 36d568e commit 0e3eaad
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ static struct plat_serial8250_port serial_platform_data2[] = {
}
};

#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,
int offset)
{
Expand Down Expand Up @@ -550,6 +565,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)
Expand Down

0 comments on commit 0e3eaad

Please sign in to comment.