Changeset fdf0e55 in rtems


Ignore:
Timestamp:
Nov 8, 2017, 7:42:33 AM (18 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
7078a00b
Parents:
336fe3b
git-author:
Sebastian Huber <sebastian.huber@…> (11/08/17 07:42:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/08/17 07:43:27)
Message:

bsp/imx: Add UART baud change

Update #3090.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/imx/console/console-config.c

    r336fe3b rfdf0e55  
    2424#include <bsp/irq.h>
    2525
     26#include <arm/freescale/imx/imx_ccmvar.h>
    2627#include <arm/freescale/imx/imx_uartreg.h>
    2728
     
    193194)
    194195{
     196  imx_uart_context *ctx;
     197  volatile imx_uart *regs;
     198  uint32_t ufcr;
     199  uint32_t baud;
     200
     201  ctx = (imx_uart_context *) base;
     202  regs = imx_uart_get_regs(&ctx->base);
     203
     204  baud = rtems_termios_baud_to_number(term->c_ospeed);
     205
     206  if (baud != 0) {
     207    ufcr = regs->ufcr;
     208    ufcr = IMX_UART_UFCR_RFDIV_SET(ufcr, 0x5);
     209    regs->ufcr = ufcr;
     210    regs->ubir = 15;
     211    regs->ubmr = imx_ccm_uart_hz() / baud - 1;
     212  }
     213
    195214  return true;
    196215}
Note: See TracChangeset for help on using the changeset viewer.