aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2006-10-04 10:02:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 13:25:05 -0400
commit75d35213777e2b278db57a420efbce2bdb61da93 (patch)
tree2731fc81e13bdca84e6db26a6278c3c9dedca642 /drivers
parent71f2e2b8783f7b270b673e31e2322572057b286a (diff)
[PATCH] atmel_serial: Pass fixed register mappings through platform_data
In order to initialize the serial console early, the atmel_serial driver had to do a hack where it compared the physical address of the port with an address known to be permanently mapped, and used it as a virtual address. This got around the limitation that ioremap() isn't always available when the console is being initalized. This patch removes that hack and replaces it with a new "regs" field in struct atmel_uart_data that the board-specific code can initialize to a fixed virtual mapping for platform devices where this is possible. It also initializes the DBGU's regs field with the address the driver used to check against. On AVR32, the "regs" field is initialized from the physical base address when this it can be accessed through a permanently 1:1 mapped segment, i.e. the P4 segment. If regs is NULL, the console initialization is delayed until the "real" driver is up and running and ioremap() can be used. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Acked-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/atmel_serial.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 2f9d99bb9587..34212df39800 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -694,8 +694,9 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct
694 port->mapbase = pdev->resource[0].start; 694 port->mapbase = pdev->resource[0].start;
695 port->irq = pdev->resource[1].start; 695 port->irq = pdev->resource[1].start;
696 696
697 if (port->mapbase == AT91_VA_BASE_SYS + AT91_DBGU) /* Part of system perpherals - already mapped */ 697 if (data->regs)
698 port->membase = (void __iomem *) port->mapbase; 698 /* Already mapped by setup code */
699 port->membase = data->regs;
699 else { 700 else {
700 port->flags |= UPF_IOREMAP; 701 port->flags |= UPF_IOREMAP;
701 port->membase = NULL; 702 port->membase = NULL;