From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/14] omap: Change low-level serial init to use ioremap
Date: Fri, 16 Oct 2009 16:40:17 -0700 [thread overview]
Message-ID: <20091016234017.2463.89842.stgit@localhost> (raw)
In-Reply-To: <20091016233624.2463.26653.stgit@localhost>
Change low-level serial init to use ioremap
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap1/serial.c | 11 ++++++++---
arch/arm/mach-omap2/serial.c | 15 ++++++++++-----
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index ed07af1..cab4171 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -64,7 +64,6 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
static struct plat_serial8250_port serial_platform_data[] = {
{
- .membase = OMAP1_IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = OMAP_UART1_BASE,
.irq = INT_UART1,
.flags = UPF_BOOT_AUTOCONF,
@@ -73,7 +72,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
.uartclk = OMAP16XX_BASE_BAUD * 16,
},
{
- .membase = OMAP1_IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = OMAP_UART2_BASE,
.irq = INT_UART2,
.flags = UPF_BOOT_AUTOCONF,
@@ -82,7 +80,6 @@ static struct plat_serial8250_port serial_platform_data[] = {
.uartclk = OMAP16XX_BASE_BAUD * 16,
},
{
- .membase = OMAP1_IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = OMAP_UART3_BASE,
.irq = INT_UART3,
.flags = UPF_BOOT_AUTOCONF,
@@ -126,6 +123,14 @@ void __init omap_serial_init(void)
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
unsigned char reg;
+ /* Static mapping, never released */
+ serial_platform_data[i].membase =
+ ioremap(serial_platform_data[i].mapbase, SZ_2K);
+ if (!serial_platform_data[i].membase) {
+ printk(KERN_ERR "Could not ioremap uart%i\n", i);
+ continue;
+ }
+
switch (i) {
case 0:
uart1_ck = clk_get(NULL, "uart1_ck");
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index ae21868..9b6c403 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -73,7 +73,6 @@ static LIST_HEAD(uart_list);
static struct plat_serial8250_port serial_platform_data0[] = {
{
- .membase = OMAP2_IO_ADDRESS(OMAP_UART1_BASE),
.mapbase = OMAP_UART1_BASE,
.irq = 72,
.flags = UPF_BOOT_AUTOCONF,
@@ -87,7 +86,6 @@ static struct plat_serial8250_port serial_platform_data0[] = {
static struct plat_serial8250_port serial_platform_data1[] = {
{
- .membase = OMAP2_IO_ADDRESS(OMAP_UART2_BASE),
.mapbase = OMAP_UART2_BASE,
.irq = 73,
.flags = UPF_BOOT_AUTOCONF,
@@ -101,7 +99,6 @@ static struct plat_serial8250_port serial_platform_data1[] = {
static struct plat_serial8250_port serial_platform_data2[] = {
{
- .membase = OMAP2_IO_ADDRESS(OMAP_UART3_BASE),
.mapbase = OMAP_UART3_BASE,
.irq = 74,
.flags = UPF_BOOT_AUTOCONF,
@@ -110,7 +107,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
.uartclk = OMAP24XX_BASE_BAUD * 16,
}, {
#ifdef CONFIG_ARCH_OMAP4
- .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
.mapbase = OMAP_UART4_BASE,
.irq = 70,
.flags = UPF_BOOT_AUTOCONF,
@@ -126,7 +122,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {
#ifdef CONFIG_ARCH_OMAP4
static struct plat_serial8250_port serial_platform_data3[] = {
{
- .membase = OMAP2_IO_ADDRESS(OMAP_UART4_BASE),
.mapbase = OMAP_UART4_BASE,
.irq = 70,
.flags = UPF_BOOT_AUTOCONF,
@@ -605,6 +600,16 @@ void __init omap_serial_early_init(void)
struct device *dev = &pdev->dev;
struct plat_serial8250_port *p = dev->platform_data;
+ /*
+ * Module 4KB + L4 interconnect 4KB
+ * Static mapping, never released
+ */
+ p->membase = ioremap(p->mapbase, SZ_8K);
+ if (!p->membase) {
+ printk(KERN_ERR "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)) {
next prev parent reply other threads:[~2009-10-16 23:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-16 23:40 [PATCH 00/14] Use ioremap for omap, split OMAP2_IO_ADDRESS for more space Tony Lindgren
2009-10-16 23:40 ` Tony Lindgren [this message]
2009-10-16 23:40 ` [PATCH 02/14] omap: Use ioremap in irq.c Tony Lindgren
2009-10-16 23:40 ` [PATCH 03/14] omap: Use ioremap in dma.c Tony Lindgren
2009-10-16 23:40 ` [PATCH 04/14] omap: Use ioremap in dmtimer.c Tony Lindgren
2009-10-16 23:41 ` [PATCH 05/14] omap: Use ioremap in gpio.c Tony Lindgren
2009-10-17 8:10 ` Russell King - ARM Linux
2009-10-17 16:13 ` Tony Lindgren
2009-10-19 0:19 ` Tony Lindgren
2009-10-16 23:41 ` [PATCH 06/14] omap: Use ioremap in omap_hwmod.c Tony Lindgren
2009-10-16 23:41 ` [PATCH 07/14] omap: Use getnstimeofday for omap_device Tony Lindgren
2009-10-16 23:41 ` [PATCH 08/14] omap: Use ioremap for omap4 L4 code Tony Lindgren
2009-10-16 23:46 ` Tony Lindgren
2009-10-17 10:48 ` Shilimkar, Santosh
2009-10-17 16:19 ` Tony Lindgren
2009-10-19 0:24 ` Tony Lindgren
2009-10-19 7:27 ` Shilimkar, Santosh
2009-10-19 17:12 ` Tony Lindgren
2009-10-19 17:21 ` Aguirre Rodriguez, Sergio Alberto
2009-10-19 17:38 ` Tony Lindgren
2009-10-19 18:07 ` Aguirre Rodriguez, Sergio Alberto
2009-10-20 6:34 ` Shilimkar, Santosh
2009-10-16 23:41 ` [PATCH 09/14] omap: Use ioremap in dispc.c Tony Lindgren
2009-10-16 23:42 ` [PATCH 10/14] omap: Split OMAP2_IO_ADDRESS to L3 and L4 Tony Lindgren
2009-10-16 23:42 ` [PATCH 11/14] omap: Remap L3, L4 to get more kernel io address space Tony Lindgren
2009-10-20 0:20 ` Tony Lindgren
2009-10-20 6:32 ` Shilimkar, Santosh
2009-10-16 23:42 ` [PATCH 12/14] omap: Move SRAM map to claim more io space Tony Lindgren
2009-10-16 23:42 ` [PATCH 13/14] omap: Fix DEBUG_LL UART io address Tony Lindgren
2009-10-16 23:42 ` [PATCH 14/14] omap: Add OMAP4 L3 and L4 peripherals Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091016234017.2463.89842.stgit@localhost \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).