aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/ns16550.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-03-26 15:52:24 -0500
committerPaul Mackerras <paulus@samba.org>2007-04-13 03:55:15 +1000
commit6e1af384f1c1742ae6d86bbf779d4fa020c509bc (patch)
treee07f1cc421fdc4e51847d26bb9bdccc53341e1cc /arch/powerpc/boot/ns16550.c
parentdbf8eefa2b814d6922492120bfa46d4bc42ceb20 (diff)
[POWERPC] bootwrapper: Add dt_xlate_reg(), and use it to find serial registers.
dt_xlate_reg() uses the ranges properties of a node's parentage to find the absolute physical address of the node's registers. The ns16550 driver uses this when no virtual-reg property is found. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/ns16550.c')
-rw-r--r--arch/powerpc/boot/ns16550.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
index 1ffe72e35cd..f8f1b2f3141 100644
--- a/arch/powerpc/boot/ns16550.c
+++ b/arch/powerpc/boot/ns16550.c
@@ -55,10 +55,15 @@ static u8 ns16550_tstc(void)
int ns16550_console_init(void *devp, struct serial_console_data *scdp)
{
int n;
+ unsigned long reg_phys;
n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
- if (n != sizeof(reg_base))
- return -1;
+ if (n != sizeof(reg_base)) {
+ if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
+ return -1;
+
+ reg_base = (void *)reg_phys;
+ }
n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift))