Overview
Online Support
FAQ
  Atmel Series  (29) TOP10
  MYS-SAM9X5 (3)
  MYS-SAM9G45 (1)
  MYD-SAM9X5 (7)
  MYD-SAM9X5-V2 (2)
  MYD-JA5D2X (0)
  MYD-SAMA5D3X (11)
  MYD-SAMA5D3X-C (0)
  MYD-JA5D4X (0)
  MYC-SAM9X5 (4)
  MYC-SAM9X5-V2 (1)
  MYC-JA5D2X (0)
  MYC-SAMA5D3X (0)
  MCC-SAMA5D3X-C (0)
  MYC-JA5D4X (0)
  NXP Series  (23) TOP10
  MYS-6ULX (4)
  MYD-Y6ULX (3)
  MYD-Y6ULX-HMI (1)
  MYD-IMX28X (2)
  MYD-LPC435X (2)
  MYD-LPC185X (1)
  MYD-LPC1788 (0)
  MYC-Y6ULX (4)
  MYC-IMX28X (0)
  i.MX 6UL/6ULL (6)
  TI Series  (24) TOP10
  MYD-AM335X (12)
  MYD-AM335X-Y (0)
  MYD-AM335X-J (0)
  MYD-C437X (0)
  MYD-C437X-PRU (5)
  Rico Board (6)
  MYC-AM335X (1)
  MCC-AM335X-Y (0)
  MCC-AM335X-J (0)
  MYC-C437X (0)
  Xilinx Series  (20) TOP10
  Z-turn Board (9)
  Z-turn Lite (2)
  MYD-C7Z010/20 (0)
  MYD-C7Z015 (7)
  MYD-Y7Z010/007S (0)
  MYC-C7Z010/20 (0)
  MYC-C7Z015 (0)
  MYC-Y7Z010/007S (0)
  HMI Solutions  (0) TOP10
  MYD-Y6ULX-CHMI (0)
  MY-EVC5100S-HMI (0)
  Others  (1) TOP10
  MY-WF003U (1)
 
  Home >  Support > TI Series > MYD-AM335X
 
How to use six serial ports of the MYD-AM335X board in Linux?
 
Question
The MYD-AM335X board has six serial ports. How can I use all the serial ports?
Answer

The MYD-AM335X board has six serial ports. But UART4 and UART5 have been reused with other functions. If sometimes you need to use all the six serial ports, we can modify the kernel.


  • The UART4 is reused with CAN, we use CAN by default


  • The UART5 is reused with K2/K3 button, we use K2/K3 button by default.

Note: So if you want to use UART4 and UART5, you can not use the CAN and K2/K3 button then.


Please make modifications about kernel as below:

1. Open the kernel file

$vi arch/arm/mach-omap2/board-am335xevm.c


2. Add UART4 and UART5 function definition codes if not exist.

/* Module pin mux for uart3 */
static struct pinmux_config uart3_pin_mux[] = {
        {"spi0_cs1.uart3_rxd", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
        {"ecap0_in_pwm0_out.uart3_txd", OMAP_MUX_MODE1 | AM33XX_PULL_ENBL},
        {NULL, 0},
};

/* Module pin mux for uart4 */
static struct pinmux_config uart4_pin_mux[] = {
        {"uart0_ctsn.uart4_rxd", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP},
        {"uart0_rtsn.uart4_txd", OMAP_MUX_MODE1 | AM33XX_PULL_ENBL},
        {NULL, 0},
};

/* Module pin mux for uart5 */
static struct pinmux_config uart5_pin_mux[] = {
        {"mii1_col.uart5_rxd", OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},
        {"rmii1_refclk.uart5_txd", OMAP_MUX_MODE3 | AM33XX_PULL_ENBL},
        {NULL, 0},


3. Add UART initialization code if not exist, as below in blue words.

static void uart3_init(int evm_id, int profile)
{
        printk("--------uart3_init\n");

        /* Configure Uart3*/
        setup_pin_mux(uart3_pin_mux);
        return;
}

static void uart4_init(int evm_id, int profile)
{
        printk("--------uart4_init\n");

        /* Configure Uart4*/
        setup_pin_mux(uart4_pin_mux);
        return;
}

static void uart5_init(int evm_id, int profile)
{
        printk("--------uart5_init\n");

        /* Configure Uart4*/
        setup_pin_mux(uart5_pin_mux);
        return;
}

4. Add registration for the UART4 and UART5 and comment out the CAN and keys functions as in below red codes.

 {uart1_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {uart2_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {uart3_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {uart4_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
        {uart5_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
//      {d_can_init,    DEV_ON_BASEBOARD, PROFILE_ALL},
//      {gpio_keys_init,  DEV_ON_BASEBOARD, PROFILE_ALL},
        {gpio_led_init,  DEV_ON_BASEBOARD, PROFILE_ALL},
        {NULL, 0, 0},


5. Re-compile the kernel and update the system.