From patchwork Sat Aug 22 08:00:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 43300 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7M80sH4002774 for ; Sat, 22 Aug 2009 08:00:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752736AbZHVIAu (ORCPT ); Sat, 22 Aug 2009 04:00:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932361AbZHVIAu (ORCPT ); Sat, 22 Aug 2009 04:00:50 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:45279 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752736AbZHVIAu (ORCPT ); Sat, 22 Aug 2009 04:00:50 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n7M80KXb024443; Sat, 22 Aug 2009 03:00:26 -0500 Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n7M80DZ2007964; Sat, 22 Aug 2009 13:30:14 +0530 (IST) Received: from linfarm476.india.ti.com (localhost [127.0.0.1]) by linfarm476.india.ti.com (8.12.11/8.12.11) with ESMTP id n7M80DaG005315; Sat, 22 Aug 2009 13:30:13 +0530 Received: (from a0393909@localhost) by linfarm476.india.ti.com (8.12.11/8.12.11/Submit) id n7M80Cum005311; Sat, 22 Aug 2009 13:30:12 +0530 From: Santosh Shilimkar To: tony@atomide.com, khilman@deeprootsystems.com, rmk@arm.linux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-arm-kernel@lists.arm.linux.org.uk, linux-omap@vger.kernel.org, Santosh Shilimkar , Syed Rafiuddin Subject: [PATCH 1/2 v2] ARM: OMAP4: Fix NULL pointer dereference crash. Date: Sat, 22 Aug 2009 13:30:11 +0530 Message-Id: <1250928012-5233-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.5.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 Signed-off-by: Santosh Shilimkar Acked-by: Tony Lindgren Acked-by: Kevin Hilman --- arch/arm/mach-omap2/board-4430sdp.c | 2 +- arch/arm/mach-omap2/serial.c | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index b0c7402..1b22307 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -39,7 +39,7 @@ static struct platform_device *sdp4430_devices[] __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 = { diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index a7421a5..e1be77b 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -112,7 +112,21 @@ static struct plat_serial8250_port serial_platform_data2[] = { .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, int offset) { @@ -550,6 +564,17 @@ static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = { }, }, }, +#ifdef CONFIG_ARCH_OMAP4 + { + .pdev = { + .name = "serial8250", + .id = PLAT8250_DEV_FOURPORT, + .dev = { + .platform_data = serial_platform_data3, + }, + }, + }, +#endif }; void __init omap_serial_init(void)