Changeset a4e96cf in rtems


Ignore:
Timestamp:
Sep 17, 2019, 8:46:05 PM (5 weeks ago)
Author:
Vijay Kumar Banerjee <vijaykumar9597@…>
Branches:
master
Children:
33ed412
Parents:
c1a1f2c
git-author:
Vijay Kumar Banerjee <vijaykumar9597@…> (09/17/19 20:46:05)
git-committer:
Christian Mauderer <oss@…> (09/19/19 19:27:16)
Message:

bsps/beagle: register i2c device at initialization

Location:
bsps/arm/beagle
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/beagle/i2c/bbb-i2c.c

    rc1a1f2c ra4e96cf  
    187187  bus->con_reg = 0;
    188188  regs->BBB_I2C_CON = bus->con_reg;
    189   udelay( 50000 );
     189  rtems_counter_delay_nanoseconds(50000000);
    190190
    191191  regs->BBB_I2C_SYSC = AM335X_I2C_SYSC_SRST;
    192   udelay( 1000 );
     192  rtems_counter_delay_nanoseconds(1000000);
    193193  regs->BBB_I2C_CON = AM335X_I2C_CON_I2C_EN;
    194194
     
    196196          && timeout >= 0 ) {
    197197    --timeout;
    198     udelay( 100 );
     198    rtems_counter_delay_nanoseconds(100000);
    199199  }
    200200
  • bsps/arm/beagle/include/bsp/i2c.h

    rc1a1f2c ra4e96cf  
    9595);
    9696
    97 static inline int bbb_register_i2c_0( void )
    98 {
    99   return am335x_i2c_bus_register(
    100     BBB_I2C_0_BUS_PATH,
    101     AM335X_I2C0_BASE,
    102     I2C_BUS_CLOCK_DEFAULT,
    103     BBB_I2C0_IRQ
    104   );
    105 }
    106 
    10797static inline int bbb_register_i2c_1( void )
    10898{
  • bsps/arm/beagle/start/bspstart.c

    rc1a1f2c ra4e96cf  
    1818#include <bsp/fdt.h>
    1919#include <bsp/linker-symbols.h>
     20#include <bsp/i2c.h>
     21#include <rtems/sysinit.h>
    2022
    2123#include "bspdebug.h"
     
    4244  return intr[0];
    4345}
     46
     47static void bbb_i2c_0_initialize(void)
     48{
     49  int err;
     50
     51  err = am335x_i2c_bus_register(BBB_I2C_0_BUS_PATH,
     52                                AM335X_I2C0_BASE,
     53                                I2C_BUS_CLOCK_DEFAULT,
     54                                BBB_I2C0_IRQ);
     55  if (err != 0) {
     56    printk("rtems i2c-0: Device could not be registered (%d)", err);
     57  }
     58}
     59
     60RTEMS_SYSINIT_ITEM(
     61  bbb_i2c_0_initialize,
     62  RTEMS_SYSINIT_LAST,
     63  RTEMS_SYSINIT_ORDER_LAST
     64);
Note: See TracChangeset for help on using the changeset viewer.