aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/ns16550.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurentp@cse-semaphore.com>2008-04-10 11:03:04 -0400
committerKumar Gala <galak@kernel.crashing.org>2008-04-17 02:01:37 -0400
commitda0a5f0c65913e4ec0a70a5019ce0a7bcaab21c9 (patch)
tree6aab633690a25acaf46d61416cff6a808deaad8d /arch/powerpc/boot/ns16550.c
parentd464df2667cf181419604e656773f80996cf0470 (diff)
[POWERPC] Add bootwrapper function to get virtual reg from the device tree.
This patch adds a new generic device tree processing function that retrieves virtual reg addresses from the device tree to the bootwrapper code. It also updates the bootwrapper code to use the new function. dt_get_virtual_reg() retrieves the virtual reg addresses from the "virtual-reg" property. If the property can't be found, it uses the "reg" property and walks the tree to translate it to absolute addresses. Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot/ns16550.c')
-rw-r--r--arch/powerpc/boot/ns16550.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
index f8f1b2f31412..aef3bdc89160 100644
--- a/arch/powerpc/boot/ns16550.c
+++ b/arch/powerpc/boot/ns16550.c
@@ -55,15 +55,9 @@ static u8 ns16550_tstc(void)
55int ns16550_console_init(void *devp, struct serial_console_data *scdp) 55int ns16550_console_init(void *devp, struct serial_console_data *scdp)
56{ 56{
57 int n; 57 int n;
58 unsigned long reg_phys;
59 58
60 n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base)); 59 if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1)
61 if (n != sizeof(reg_base)) { 60 return -1;
62 if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
63 return -1;
64
65 reg_base = (void *)reg_phys;
66 }
67 61
68 n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift)); 62 n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
69 if (n != sizeof(reg_shift)) 63 if (n != sizeof(reg_shift))