Changeset ce28d601 in rtems


Ignore:
Timestamp:
Sep 28, 2017, 8:03:44 AM (19 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9db9024
Parents:
7e195e66
git-author:
Sebastian Huber <sebastian.huber@…> (09/28/17 08:03:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/02/17 11:40:56)
Message:

bsp/imx: Add imx_get_reg_of_node()

Update #3090.

Location:
c/src/lib/libbsp/arm/imx
Files:
3 edited

Legend:

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

    r7e195e66 rce28d601  
    7272{
    7373  int node;
    74   int len;
    75   const uint32_t *val;
    7674
    7775  rtems_termios_device_context_initialize(&ctx->base, "UART");
    78 
    7976  node = fdt_path_offset(fdt, serial);
    80 
    81   val = fdt_getprop(fdt, node, "reg", &len);
    82   if (val != NULL && len >= 4) {
    83     ctx->regs = (imx_uart *) fdt32_to_cpu(val[0]);
    84   }
    85 
     77  ctx->regs = imx_get_reg_of_node(fdt, node);
    8678#ifdef CONSOLE_USE_INTERRUPTS
    8779  ctx->irq = imx_get_irq_of_node(fdt, node, 0);
  • c/src/lib/libbsp/arm/imx/include/bsp.h

    r7e195e66 rce28d601  
    4242void arm_generic_timer_get_config(uint32_t *frequency, uint32_t *irq);
    4343
     44void *imx_get_reg_of_node(const void *fdt, int node);
     45
    4446rtems_vector_number imx_get_irq_of_node(
    4547  const void *fdt,
  • c/src/lib/libbsp/arm/imx/startup/bspstart.c

    r7e195e66 rce28d601  
    2323
    2424#define MAGIC_IRQ_OFFSET 32
     25
     26void *imx_get_reg_of_node(const void *fdt, int node)
     27{
     28  int len;
     29  const uint32_t *val;
     30
     31  val = fdt_getprop(fdt, node, "reg", &len);
     32  if (val == NULL || len < 4) {
     33    return NULL;
     34  }
     35
     36  return (void *) fdt32_to_cpu(val[0]);
     37}
    2538
    2639rtems_vector_number imx_get_irq_of_node(
Note: See TracChangeset for help on using the changeset viewer.