[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>
This commit is contained in:

committed by
Kumar Gala

parent
d464df2667
commit
da0a5f0c65
@@ -55,15 +55,9 @@ 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)) {
|
||||
if (!dt_xlate_reg(devp, 0, ®_phys, NULL))
|
||||
return -1;
|
||||
|
||||
reg_base = (void *)reg_phys;
|
||||
}
|
||||
if (dt_get_virtual_reg(devp, (void **)®_base, 1) < 1)
|
||||
return -1;
|
||||
|
||||
n = getprop(devp, "reg-shift", ®_shift, sizeof(reg_shift));
|
||||
if (n != sizeof(reg_shift))
|
||||
|
Reference in New Issue
Block a user