[RFC] uartlite driver MicroBlaze compatability
John Williams
jwilliams at itee.uq.edu.au
Tue May 1 16:42:10 EST 2007
Grant Likely wrote:
> On 4/30/07, John Williams <jwilliams at itee.uq.edu.au> wrote:
>
>> All readb/writeb ops are converted to ioread32/iowrite32.
>>
>> On MicroBlaze readb/writeb are picking up the MSB, instead of LSB, and
>> thus reading all zeros instead of the 8-bit control/status/FIFO
>> registers that you intended.
>>
>> Can you please confirm if this works on PPC?
>
> Yes, I've confirmed this does work on PPC; but I don't think it's
> quite the correct fix.
>
> ioread/write32 is mapped to in/out_le32, yet the bootloader driver
> must use in/out_be32. This is because the uartlite driver follows the
> lead of 8250 and requires an offset of 3 from the base address in
> order to find the relevant byte wise address. In fact, I believe the
> driver should work as-is on microblaze if the offset-by-3 is not used
> when registering it to the platform bus.
ugh. I missed the off-by-3 stuff in the PPC platform setup. Smells bad!
> However, the uartlite is *not* an 8250. The 8250 turns up all over
> the place and it's registers are defined as 8 bit wide. The
> offset-by-3 stuff is part of the plat_serial8250_port structure which
> is also used to specify .regshift (increment between registers).
> Whereas the UARTLITE is defined as a 32 bit device and it doesn't show
> up in anywhere near as many designs. Registers are always 4 bytes
> wide and are always located at multiples of 4 bytes off the base
> address.
Agreed.
> So; starting with your patch and modifying it, I've attached I think
> the change should be. It should work for microblaze, but I've only
> tested w/ ppc. Unfortunately the (void*) casts are ugly; there might
> be a way around that, but it's due to the type used for the (struct
> uart_port)->membase variable.
Looks good - boot tested on MicroBlaze 2.6.20
acked-by: John Williams <jwilliams at itee.uq.edu.au>
John
More information about the Linuxppc-embedded
mailing list