Răsfoiți Sursa

Merge branch 'omap-fixes-for-tony' of git://dev.omapzoom.org/pub/scm/saaguirre/linux-omap-camera into omap-fixes-for-linus

Tony Lindgren 15 ani în urmă
părinte
comite
b3c7740a12

+ 1 - 1
arch/arm/configs/omap_zoom2_defconfig

@@ -661,7 +661,7 @@ CONFIG_DEVKMEM=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=32
 CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y

+ 1 - 1
arch/arm/configs/omap_zoom3_defconfig

@@ -680,7 +680,7 @@ CONFIG_DEVKMEM=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=32
 CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y

+ 1 - 0
arch/arm/mach-omap2/board-3630sdp.c

@@ -96,6 +96,7 @@ static struct omap_board_mux board_mux[] __initdata = {
 static void __init omap_sdp_init(void)
 static void __init omap_sdp_init(void)
 {
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
+	omap_serial_init();
 	zoom_peripherals_init();
 	zoom_peripherals_init();
 	board_smc91x_init();
 	board_smc91x_init();
 	enable_board_wakeup_source();
 	enable_board_wakeup_source();

+ 1 - 1
arch/arm/mach-omap2/board-zoom-debugboard.c

@@ -96,7 +96,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 
 static struct platform_device zoom_debugboard_serial_device = {
 static struct platform_device zoom_debugboard_serial_device = {
 	.name			= "serial8250",
 	.name			= "serial8250",
-	.id			= 3,
+	.id			= PLAT8250_DEV_PLATFORM,
 	.dev			= {
 	.dev			= {
 		.platform_data	= serial_platform_data,
 		.platform_data	= serial_platform_data,
 	},
 	},

+ 0 - 1
arch/arm/mach-omap2/board-zoom-peripherals.c

@@ -280,7 +280,6 @@ static void enable_board_wakeup_source(void)
 void __init zoom_peripherals_init(void)
 void __init zoom_peripherals_init(void)
 {
 {
 	omap_i2c_init();
 	omap_i2c_init();
-	omap_serial_init();
 	usb_musb_init(&musb_board_data);
 	usb_musb_init(&musb_board_data);
 	enable_board_wakeup_source();
 	enable_board_wakeup_source();
 }
 }

+ 18 - 17
arch/arm/mach-omap2/serial.c

@@ -115,7 +115,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
 	}
 	}
 };
 };
 
 
-#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
 static struct plat_serial8250_port serial_platform_data3[] = {
 static struct plat_serial8250_port serial_platform_data3[] = {
 	{
 	{
 		.irq		= 70,
 		.irq		= 70,
@@ -128,23 +127,12 @@ static struct plat_serial8250_port serial_platform_data3[] = {
 	}
 	}
 };
 };
 
 
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
-	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
-}
-#else
-static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals)
-{
-}
-#endif
-
 void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)
 void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)
 {
 {
 	serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;
 	serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;
 	serial_platform_data1[0].mapbase = omap2_globals->uart2_phys;
 	serial_platform_data1[0].mapbase = omap2_globals->uart2_phys;
 	serial_platform_data2[0].mapbase = omap2_globals->uart3_phys;
 	serial_platform_data2[0].mapbase = omap2_globals->uart3_phys;
-	if (cpu_is_omap3630() || cpu_is_omap44xx())
-		omap2_set_globals_uart4(omap2_globals);
+	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;
 }
 }
 
 
 static inline unsigned int __serial_read_reg(struct uart_port *up,
 static inline unsigned int __serial_read_reg(struct uart_port *up,
@@ -550,7 +538,7 @@ static ssize_t sleep_timeout_store(struct device *dev,
 	unsigned int value;
 	unsigned int value;
 
 
 	if (sscanf(buf, "%u", &value) != 1) {
 	if (sscanf(buf, "%u", &value) != 1) {
-		printk(KERN_ERR "sleep_timeout_store: Invalid value\n");
+		dev_err(dev, "sleep_timeout_store: Invalid value\n");
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
@@ -664,27 +652,33 @@ void __init omap_serial_early_init(void)
 		struct device *dev = &pdev->dev;
 		struct device *dev = &pdev->dev;
 		struct plat_serial8250_port *p = dev->platform_data;
 		struct plat_serial8250_port *p = dev->platform_data;
 
 
+		/* Don't map zero-based physical address */
+		if (p->mapbase == 0) {
+			dev_warn(dev, "no physical address for uart#%d,"
+				 " so skipping early_init...\n", i);
+			continue;
+		}
 		/*
 		/*
 		 * Module 4KB + L4 interconnect 4KB
 		 * Module 4KB + L4 interconnect 4KB
 		 * Static mapping, never released
 		 * Static mapping, never released
 		 */
 		 */
 		p->membase = ioremap(p->mapbase, SZ_8K);
 		p->membase = ioremap(p->mapbase, SZ_8K);
 		if (!p->membase) {
 		if (!p->membase) {
-			printk(KERN_ERR "ioremap failed for uart%i\n", i + 1);
+			dev_err(dev, "ioremap failed for uart%i\n", i + 1);
 			continue;
 			continue;
 		}
 		}
 
 
 		sprintf(name, "uart%d_ick", i + 1);
 		sprintf(name, "uart%d_ick", i + 1);
 		uart->ick = clk_get(NULL, name);
 		uart->ick = clk_get(NULL, name);
 		if (IS_ERR(uart->ick)) {
 		if (IS_ERR(uart->ick)) {
-			printk(KERN_ERR "Could not get uart%d_ick\n", i + 1);
+			dev_err(dev, "Could not get uart%d_ick\n", i + 1);
 			uart->ick = NULL;
 			uart->ick = NULL;
 		}
 		}
 
 
 		sprintf(name, "uart%d_fck", i+1);
 		sprintf(name, "uart%d_fck", i+1);
 		uart->fck = clk_get(NULL, name);
 		uart->fck = clk_get(NULL, name);
 		if (IS_ERR(uart->fck)) {
 		if (IS_ERR(uart->fck)) {
-			printk(KERN_ERR "Could not get uart%d_fck\n", i + 1);
+			dev_err(dev, "Could not get uart%d_fck\n", i + 1);
 			uart->fck = NULL;
 			uart->fck = NULL;
 		}
 		}
 
 
@@ -727,6 +721,13 @@ void __init omap_serial_init_port(int port)
 	pdev = &uart->pdev;
 	pdev = &uart->pdev;
 	dev = &pdev->dev;
 	dev = &pdev->dev;
 
 
+	/* Don't proceed if there's no clocks available */
+	if (unlikely(!uart->ick || !uart->fck)) {
+		WARN(1, "%s: can't init uart%d, no clocks available\n",
+		     kobject_name(&dev->kobj), port);
+		return;
+	}
+
 	omap_uart_enable_clocks(uart);
 	omap_uart_enable_clocks(uart);
 
 
 	omap_uart_reset(uart);
 	omap_uart_reset(uart);