From da0a5f0c65913e4ec0a70a5019ce0a7bcaab21c9 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 10 Apr 2008 17:03:04 +0200 Subject: [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 Acked-by: Scott Wood Signed-off-by: Kumar Gala --- arch/powerpc/boot/mpc52xx-psc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'arch/powerpc/boot/mpc52xx-psc.c') diff --git a/arch/powerpc/boot/mpc52xx-psc.c b/arch/powerpc/boot/mpc52xx-psc.c index 1074626..d4cb4e4 100644 --- a/arch/powerpc/boot/mpc52xx-psc.c +++ b/arch/powerpc/boot/mpc52xx-psc.c @@ -51,14 +51,9 @@ static unsigned char psc_getc(void) int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp) { - int n; - /* Get the base address of the psc registers */ - n = getprop(devp, "virtual-reg", &psc, sizeof(psc)); - if (n != sizeof(psc)) { - if (!dt_xlate_reg(devp, 0, (void *)&psc, NULL)) - return -1; - } + if (dt_get_virtual_reg(devp, &psc, 1) < 1) + return -1; scdp->open = psc_open; scdp->putc = psc_putc; -- cgit v1.1