This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X PR1 UART0 Mux 0

I'm not sure if this is even possible with the way things are set up, but I thought I'd give it a try. I'd like to use the Zigbee pin header and PR1 UART0 mux 0. I would use UART2 on this header, however the device I'd like to interface with requires RTS and CTS, which are not supported on this header.

My end goal is to get a device registered in the user space so that I can use the PR1 uart the same as any other uart.


What I've done so far:

I've modified my board-am335xevm.c file to add in the following structure:

static struct pinmux_config PRU1_Uart0_pin_mux[] = {

{"spi0_sclk.pr1_uart0_cts_n_mux0", OMAP_MUX_MODE4 | AM33XX_PULL_DISA | AM33XX_INPUT_EN},

{"spi0_d0.pr1_uart0_rts_n_mux0", OMAP_MUX_MODE4 | AM33XX_OUTPUT},

{"spi0_sclk.pr1_uart0_rxd_mux0", OMAP_MUX_MODE4 | AM33XX_PULL_DISA | AM33XX_INPUT_EN},

{"spi0_d0.pr1_uart0_txd_mux0", OMAP_MUX_MODE4 | AM33XX_OUTPUT},

{NULL, 0},

};

Further down I've added:

static void pr1_uart0_init(int evm_id, int profile)

{

steup_pin_mux(PRU1_Uart0_pin_mux);

}

Finally I've added the following line to the static struct evm_dev_cfg evm_sk_dev_cfg[] = {

.........

{pr1_uart0_init, DEV_ON_BASEBOARD, PROFILE_ALL},

};

After re-compiling my kernel, I don't see anything in the /dev folder that looks like what I'm wanting, but truth be told since this UART is part of the PRU I'm not all that certain of what I should be looking for in the first place.

Any thoughts about what my next steps should be to get this working are appreciated.

  • Hi Tim,

    I think you should check whether the PRU is enabled and functional clock is provided to it.

  • Hi Biser,I had no idea that the PRU even had its own software support package.
    From What I'm seeing, it looks like the PRU support package is part of the SDK v.7. Will it work with the V6 SDK that I've got or will I need to upgrade?
  • The PRU support package is for SDK 7.0. However I'm not sure you need it. This is used to load firmware and control the PRU processors from Linux. The PRU UART should be visible from the Cortex-A8 side. I was talking about enabling the PRU, I think it's not enabled by default.

  • Hi Biser,
    That sounds promising, however, I don't see any options within my menuconfig, /omap2/board-am335xevm.c file, or arm/configs/tisdk_am335x-evm_defconfig file that would allow me to enable it. Where would I go to do this? If it is a line that does not exist in one of these files, where would I go to to find out how to enable this? There don't seem to be any clear cut answers on the forum.
  • Hi Tim,

    While it is theoretically possible to use the PR1 UART from user space like any other UART, this feature has not been enabled yet and is not available today.

    Regards,
    Melissa

  • Hi Melissa,
    What does that mean "not enabled yet"? How would I go about enabling it? Does that mean I need to write my own driver to use it? Is the UART available at a kernel level where I could use kernel function calls to access it? Or are you basically saying that while the UART exists in the PRU, its basically extra hardware that sits there and is inaccessible?
  • Hi Tim,

    The PRU UART hardware is accessible by the ARM.  However, to my knowledge, there has been no Linux development (kernel or user space) to make use of this UART.  There is a PRU firmware example though that demonstrates how to control the UART via the PRU.  This example is included in PRU support package that Biser mentioned (here) and is described on the PRU Cape Getting Started Guide.

    If you choose to write your own PRU UART Linux driver, please note that there is one key difference between this UART and the other SoC UARTs (outside of the PRU-ICSS).  The PRU UART’s interrupts are routed to the PRU Interrupt Controller and are not directly available by the ARM Interrupt Controller.  However, the PRU INTC can be configured to map the PRU UART interrupts to Host Interrupt 2-9, which are connected to the ARM Interrupt Controller.  More details about configuring the PRU INTC are available in the AM335x TRM.

    Regards,

    Melissa

  • Hi Melissa,

    I think that's more software than I'm willing to get into right now, but I appreciate your response. We may pursue this route in the future, and this will provide a useful stepping stone for myself or anyone else who may wish to pursue this.