Raspberrypi3: AUX Uart driver

Christian Mauderer list at c-mauderer.de
Sat Jan 4 19:27:56 UTC 2020


On 04/01/2020 09:32, Niteesh wrote:
> We could now run RTEMS on Rpi3. I tried examples from the samples
> section and they run
> fine. But still, a lot of functionality has to tested since it uses the
> RPI2 BSP. To test these examples
> I used a simple driver for the AUX.
> The documentation from BCM link
> <https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf> (pg
> no 10) states that
>  
> 
>     *The implemented UART is not a 16650 compatible UART However as far
>     as possible the first 8 control and status registers are laid out
>     like a 16550 UART.*

It also tells

    "Al 16550 register bits which are not supported can be written but
will be ignored and read back as 0. All control bits for simple UART
receive/transmit operations are available."

So I would expect that not everything works like expected (for example
setting DCD, DSR, DTR, RI - they are not there for the mini UART) but
the basic stuff should work.

> 
> 
> My question is can we use the existing ns16550 driver or should I create
> a new one? I also checked the address of the registers the offsets don't
> seem right to me, but someone should check and correct me if I am wrong. 

If you compare the registers in the existing driver
(NS16550_RECEIVE_BUFFER, ... in ns16550_p.h) and the one in the BCM
datasheet the registers look very similar (at least from the position /
function). I haven't done a bit by bit comparison yet. Please note that
you have to do a conversion between the defines and register addresses.
The define gives you a register index for a 32bit register. So you have
to multiply by 4 to get an address. The driver is designed that you
provide a setRegister and getRegister function that can do this conversion.

Where did you find differences?

I would suggest to just try the driver.


More information about the devel mailing list