* [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes
@ 2010-03-15 23:04 Sergio Aguirre
2010-03-15 23:04 ` [PATCH 1/7] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
This series contains fixes for omap2/3/4 serial code, and are
fixing:
- Avoid doing ioremap of a zero-based physical address.
(causing a kernel panic during early init on 3630boards)
- Unproper omap_revision check during uart globals setup.
(omap_revision is not yet filled at that point)
- Don't try to enable all uarts generically for zoom2/3
and 3630sdp.
- Make zoom2/3 just register one serial port (ttyS0).
This is a subset of the original series found here: [1]
Thanks to:
- Vikram Pandita
- Paul Walmsley
- Kevin Hilman
- Manjunath Kondaiah
- Felipe Balbi
- Tony Lindgreen
For all the feedback recieved so far.
Regards,
Sergio
Detailed changelog:
Sergio Aguirre (7):
OMAP3: serial: Check for zero-based physical addr
OMAP3: serial: Use dev_* macros instead of printk
omap2/3/4: serial: Remove condition for getting uart4_phys
omap3: zoom2/3 / 3630sdp: Don't init always all uarts
omap3: 3630sdp: Explicitly enable all UARTs
omap3: zoom 2/3: Change debugboard serial port id
omap3: zoom2/3: Register only 1 8250 port
arch/arm/configs/omap_zoom2_defconfig | 2 +-
arch/arm/configs/omap_zoom3_defconfig | 2 +-
arch/arm/mach-omap2/board-3630sdp.c | 1 +
arch/arm/mach-omap2/board-zoom-debugboard.c | 2 +-
arch/arm/mach-omap2/board-zoom-peripherals.c | 1 -
arch/arm/mach-omap2/serial.c | 35 +++++++++++++------------
6 files changed, 22 insertions(+), 21 deletions(-)
[1] http://marc.info/?l=linux-omap&m=126826639903105&w=2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/7] OMAP3: serial: Check for zero-based physical addr
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 2/7] OMAP3: serial: Use dev_* macros instead of printk Sergio Aguirre
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
This is for protecting a wrong mapping attempt of a zero-based
physical address.
The result is that, no serial port will be attempted to be mapped.
Also add an additional protection for NULL clocks before attempting
to enable them (if above condition applies)
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index da77930..ef91fc0 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -664,6 +664,12 @@ void __init omap_serial_early_init(void)
struct device *dev = &pdev->dev;
struct plat_serial8250_port *p = dev->platform_data;
+ /* Don't map zero-based physical address */
+ if (p->mapbase == 0) {
+ printk(KERN_WARNING "omap serial: No physical address"
+ " for uart#%d, so skipping early_init...\n", i);
+ continue;
+ }
/*
* Module 4KB + L4 interconnect 4KB
* Static mapping, never released
@@ -727,6 +733,13 @@ void __init omap_serial_init_port(int port)
pdev = &uart->pdev;
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_reset(uart);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/7] OMAP3: serial: Use dev_* macros instead of printk
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
2010-03-15 23:04 ` [PATCH 1/7] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 3/7] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
As we have a struct device populated at the time we are
printing the errors, using dev_* macros makes more sense,
as could give a better idea where the error/warning came from.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ef91fc0..a55e6ae 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -550,7 +550,7 @@ static ssize_t sleep_timeout_store(struct device *dev,
unsigned int value;
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;
}
@@ -666,8 +666,8 @@ void __init omap_serial_early_init(void)
/* Don't map zero-based physical address */
if (p->mapbase == 0) {
- printk(KERN_WARNING "omap serial: No physical address"
- " for uart#%d, so skipping early_init...\n", i);
+ dev_warn(dev, "no physical address for uart#%d,"
+ " so skipping early_init...\n", i);
continue;
}
/*
@@ -676,21 +676,21 @@ void __init omap_serial_early_init(void)
*/
p->membase = ioremap(p->mapbase, SZ_8K);
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;
}
sprintf(name, "uart%d_ick", i + 1);
uart->ick = clk_get(NULL, name);
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;
}
sprintf(name, "uart%d_fck", i+1);
uart->fck = clk_get(NULL, name);
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;
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/7] omap2/3/4: serial: Remove condition for getting uart4_phys
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
2010-03-15 23:04 ` [PATCH 1/7] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
2010-03-15 23:04 ` [PATCH 2/7] OMAP3: serial: Use dev_* macros instead of printk Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 4/7] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
This check is invalid, since we haven't filled the
omap_revision var at this point.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/serial.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index a55e6ae..3771254 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/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[] = {
{
.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)
{
serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;
serial_platform_data1[0].mapbase = omap2_globals->uart2_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,
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/7] omap3: zoom2/3 / 3630sdp: Don't init always all uarts
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
` (2 preceding siblings ...)
2010-03-15 23:04 ` [PATCH 3/7] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 5/7] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
This is useless, since in Zoom2/3 boards, the ports aren't even
physically accessible.
They must be explicitly initted in the board-zoom2.c, board-zoom3.c
and board-3630sdp.c files instead.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-zoom-peripherals.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index ca95d8d..6b39849 100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/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)
{
omap_i2c_init();
- omap_serial_init();
usb_musb_init(&musb_board_data);
enable_board_wakeup_source();
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 5/7] omap3: 3630sdp: Explicitly enable all UARTs
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
` (3 preceding siblings ...)
2010-03-15 23:04 ` [PATCH 4/7] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 6/7] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
All UARTs seem physically reachable, so, enable them all.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-3630sdp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index a0a2a11..504d2bd 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/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)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
+ omap_serial_init();
zoom_peripherals_init();
board_smc91x_init();
enable_board_wakeup_source();
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 6/7] omap3: zoom 2/3: Change debugboard serial port id
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
` (4 preceding siblings ...)
2010-03-15 23:04 ` [PATCH 5/7] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-15 23:04 ` [PATCH 7/7] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
2010-03-22 21:16 ` [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
This is now changed to PLAT8250_DEV_PLATFORM (= 0), because
it's the only port that's going to be initialized in
Zoom 2/3 boards.
So, it doesn't make sense to keep the hardcoded 3 value anymore.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/mach-omap2/board-zoom-debugboard.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c
index bb4018b..e15d2e8 100644
--- a/arch/arm/mach-omap2/board-zoom-debugboard.c
+++ b/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 = {
.name = "serial8250",
- .id = 3,
+ .id = PLAT8250_DEV_PLATFORM,
.dev = {
.platform_data = serial_platform_data,
},
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 7/7] omap3: zoom2/3: Register only 1 8250 port
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
` (5 preceding siblings ...)
2010-03-15 23:04 ` [PATCH 6/7] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
@ 2010-03-15 23:04 ` Sergio Aguirre
2010-03-22 21:16 ` [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Sergio Aguirre @ 2010-03-15 23:04 UTC (permalink / raw)
To: linux-arm-kernel
There's no more serial ports available, so, doesn't make sense
to create 4 device nodes.
Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
arch/arm/configs/omap_zoom2_defconfig | 2 +-
arch/arm/configs/omap_zoom3_defconfig | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/configs/omap_zoom2_defconfig b/arch/arm/configs/omap_zoom2_defconfig
index f5c6e11..881faea 100644
--- a/arch/arm/configs/omap_zoom2_defconfig
+++ b/arch/arm/configs/omap_zoom2_defconfig
@@ -661,7 +661,7 @@ CONFIG_DEVKMEM=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
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_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
diff --git a/arch/arm/configs/omap_zoom3_defconfig b/arch/arm/configs/omap_zoom3_defconfig
index ea9a501..5e55b55 100644
--- a/arch/arm/configs/omap_zoom3_defconfig
+++ b/arch/arm/configs/omap_zoom3_defconfig
@@ -680,7 +680,7 @@ CONFIG_DEVKMEM=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
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_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
--
1.6.3.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
` (6 preceding siblings ...)
2010-03-15 23:04 ` [PATCH 7/7] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
@ 2010-03-22 21:16 ` Tony Lindgren
7 siblings, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2010-03-22 21:16 UTC (permalink / raw)
To: linux-arm-kernel
* Sergio Aguirre <saaguirre@ti.com> [100315 15:59]:
> Hi,
>
> This series contains fixes for omap2/3/4 serial code, and are
> fixing:
> - Avoid doing ioremap of a zero-based physical address.
> (causing a kernel panic during early init on 3630boards)
> - Unproper omap_revision check during uart globals setup.
> (omap_revision is not yet filled at that point)
> - Don't try to enable all uarts generically for zoom2/3
> and 3630sdp.
> - Make zoom2/3 just register one serial port (ttyS0).
Thanks, I've pulled this into omap-fixes-for-linus.
Regards,
Tony
> This is a subset of the original series found here: [1]
>
> Thanks to:
> - Vikram Pandita
> - Paul Walmsley
> - Kevin Hilman
> - Manjunath Kondaiah
> - Felipe Balbi
> - Tony Lindgreen
>
> For all the feedback recieved so far.
>
> Regards,
> Sergio
>
> Detailed changelog:
>
> Sergio Aguirre (7):
> OMAP3: serial: Check for zero-based physical addr
> OMAP3: serial: Use dev_* macros instead of printk
> omap2/3/4: serial: Remove condition for getting uart4_phys
> omap3: zoom2/3 / 3630sdp: Don't init always all uarts
> omap3: 3630sdp: Explicitly enable all UARTs
> omap3: zoom 2/3: Change debugboard serial port id
> omap3: zoom2/3: Register only 1 8250 port
>
> arch/arm/configs/omap_zoom2_defconfig | 2 +-
> arch/arm/configs/omap_zoom3_defconfig | 2 +-
> arch/arm/mach-omap2/board-3630sdp.c | 1 +
> arch/arm/mach-omap2/board-zoom-debugboard.c | 2 +-
> arch/arm/mach-omap2/board-zoom-peripherals.c | 1 -
> arch/arm/mach-omap2/serial.c | 35 +++++++++++++------------
> 6 files changed, 22 insertions(+), 21 deletions(-)
>
> [1] http://marc.info/?l=linux-omap&m=126826639903105&w=2
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-03-22 21:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-15 23:04 [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Sergio Aguirre
2010-03-15 23:04 ` [PATCH 1/7] OMAP3: serial: Check for zero-based physical addr Sergio Aguirre
2010-03-15 23:04 ` [PATCH 2/7] OMAP3: serial: Use dev_* macros instead of printk Sergio Aguirre
2010-03-15 23:04 ` [PATCH 3/7] omap2/3/4: serial: Remove condition for getting uart4_phys Sergio Aguirre
2010-03-15 23:04 ` [PATCH 4/7] omap3: zoom2/3 / 3630sdp: Don't init always all uarts Sergio Aguirre
2010-03-15 23:04 ` [PATCH 5/7] omap3: 3630sdp: Explicitly enable all UARTs Sergio Aguirre
2010-03-15 23:04 ` [PATCH 6/7] omap3: zoom 2/3: Change debugboard serial port id Sergio Aguirre
2010-03-15 23:04 ` [PATCH 7/7] omap3: zoom2/3: Register only 1 8250 port Sergio Aguirre
2010-03-22 21:16 ` [PATCH 0/7] omap3: serial code for 3630 and zoom2/3 fixes Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).