[PATCH 16/19] bootwrapper: Add xlate_reg(), and use it to find serial registers.
Mark A. Greer
mgreer at mvista.com
Tue Mar 13 10:01:48 EST 2007
On Mon, Mar 12, 2007 at 02:42:02PM -0600, Scott Wood wrote:
> diff --git a/arch/powerpc/boot/ns16550.c b/arch/powerpc/boot/ns16550.c
> index 1ffe72e..cce7a11 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", ®_base, sizeof(reg_base));
> - if (n != sizeof(reg_base))
> - return -1;
> + if (n != sizeof(reg_base)) {
> + if (!xlate_reg(devp, 0, ®_phys, NULL))
> + return -1;
> +
> + reg_base = (void *)reg_phys;
> + }
NACK.
'virtual-reg' _is_ the fully translated virtual address.
Its simply the virtual address that maps to the fully translated
physical addr in the 'reg' property.
Even if it wasn't, 'ranges' only work for physical/'reg' properties
and can't be used for a virtual one--you'd have to make a parellel
'ranges' thingy for 'virtual-reg'.
Mark
More information about the Linuxppc-dev
mailing list