Commit 2f0b45f8 authored by John Linn's avatar John Linn Committed by Josh Boyer

[POWERPC] Xilinx: boot support for Xilinx uart 16550.

The Xilinx 16550 uart core is not a standard 16550 because it uses
word-based addressing rather than byte-based adressing. With
additional properties it is compatible with the open firmware
'ns16550' compatible binding.

This code updates the ns16550 driver to use the reg-offset property
so that the Xilinx UART 16550 can be used with it. The reg-shift
was already being handled.
Signed-off-by: default avatarJohn Linn <john.linn@xilinx.com>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
parent 884d04cd
...@@ -55,10 +55,15 @@ static u8 ns16550_tstc(void) ...@@ -55,10 +55,15 @@ static u8 ns16550_tstc(void)
int ns16550_console_init(void *devp, struct serial_console_data *scdp) int ns16550_console_init(void *devp, struct serial_console_data *scdp)
{ {
int n; int n;
u32 reg_offset;
if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1) if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1)
return -1; return -1;
n = getprop(devp, "reg-offset", &reg_offset, sizeof(reg_offset));
if (n == sizeof(reg_offset))
reg_base += reg_offset;
n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift)); n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift)) if (n != sizeof(reg_shift))
reg_shift = 0; reg_shift = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment