Enabling more UARTs on Stamp9G20/PortuxG20

Stamp9G20 and PortuxG20 come with UARTs, that are not enabled due to missing D-SUB connectors on these ports so that you can use the corresponding pins for GPIO or other functions, that are multiplexed with the pins. If you want to use these UARTs, you have to enable them in the board file of your product in the kernel sources.

The files to edit are:

  • arch/arm/mach-at91/board-portuxg20.c (for PortuxG20)
  • arch/arm/mach-at91/board-stamp9g20.c (for stand alone Stamp9G20)
  • arch/arm/mach-at91/stamp9g20-evb.c (for Stamp9G20 on the evaluation board)

For every UART you want to use call the function at91_register_uart. Do this in the function portuxg20_map_io, stamp9g20_map_io or stamp9g20_evb_init respectively. It should look like this:

/* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
                                        | ATMEL_UART_DTR | ATMEL_UART_DSR
                                        | ATMEL_UART_DCD | ATMEL_UART_RI);

The first parameter designates the UART to use (here USART0). The second parameter selects the number in the device file (here 1 for ttyS1). The last parameter describes, which control lines should be used (please note, that not all UARTs have all control lines available).

After recompiling the kernel and rebooting the system with the new kernel, you should have new device files (ttySx) for every UART you added.