Changeset b89d6cc in rtems for bsps/arm/include/libcpu/am335x.h


Ignore:
Timestamp:
Jun 24, 2019, 8:16:59 PM (8 weeks ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
master
Children:
5cbee18
Parents:
5803f37
git-author:
Christian Mauderer <christian.mauderer@…> (06/24/19 20:16:59)
git-committer:
Christian Mauderer <oss@…> (06/29/19 07:37:24)
Message:

bsp/beagle: Partial re-write of I2C driver.

The old driver worked well for EEPROMS with the RTEMS EEPROM driver. But
it had problems with a lot of other situations. Although it's not a
direct port, the new driver is heavily modeled after the FreeBSD ti_i2c
driver.

Closes #3764.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/include/libcpu/am335x.h

    r5803f37 rb89d6cc  
    665665#define AM335X_I2C_CON_STB   (0x00000800u)
    666666#define AM335X_I2C_SYSC_AUTOIDLE   (0x00000001u)
     667#define AM335X_I2C_SYSC_SRST       (0x00000002u)
     668#define AM335X_I2C_SYSC_ENAWAKEUP  (0x00000004u)
     669#define AM335X_I2C_SYSS_RDONE      (0x00000001u)
    667670
    668671/*I2C0 module clock registers*/
     
    687690
    688691
     692#define AM335X_I2C_BUF_TXTRSH_SHIFT (0)
     693#define AM335X_I2C_BUF_TXTRSH_MASK  (0x0000003Fu)
     694#define AM335X_I2C_BUF_TXTRSH(X)    (((X) << AM335X_I2C_BUF_TXTRSH_SHIFT) \
     695                                     & AM335X_I2C_BUF_TXTRSH_MASK)
     696#define AM335X_I2C_BUF_TXFIFO_CLR   (0x00000040u)
     697#define AM335X_I2C_BUF_RXTRSH_SHIFT (8)
     698#define AM335X_I2C_BUF_RXTRSH_MASK  (0x00003F00u)
     699#define AM335X_I2C_BUF_RXTRSH(X)    (((X) << AM335X_I2C_BUF_RXTRSH_SHIFT) \
     700                                     & AM335X_I2C_BUF_RXTRSH_MASK)
     701#define AM335X_I2C_BUF_RXFIFO_CLR   (0x00004000u)
     702
    689703/* I2C status Register */
     704#define AM335X_I2C_IRQSTATUS_AL   (1 << 0)
    690705#define AM335X_I2C_IRQSTATUS_NACK (1 << 1)
    691 #define AM335X_I2C_IRQSTATUS_ROVR (1 << 11)
    692 #define AM335X_I2C_IRQSTATUS_AL   (1<<0)
    693706#define AM335X_I2C_IRQSTATUS_ARDY (1 << 2)
    694707#define AM335X_I2C_IRQSTATUS_RRDY (1 << 3)
    695708#define AM335X_I2C_IRQSTATUS_XRDY (1 << 4)
     709#define AM335X_I2C_IRQSTATUS_GC   (1 << 5)
     710#define AM335X_I2C_IRQSTATUS_STC  (1 << 6)
     711#define AM335X_I2C_IRQSTATUS_AERR (1 << 7)
     712#define AM335X_I2C_IRQSTATUS_BF   (1 << 8)
     713#define AM335X_I2C_IRQSTATUS_AAS  (1 << 9)
    696714#define AM335X_I2C_IRQSTATUS_XUDF (1 << 10)
    697 #define AM335X_I2C_BUF_TXFIFO_CLR   (0x00000040u)
    698 #define AM335X_I2C_BUF_RXFIFO_CLR   (0x00004000u)
    699 #define AM335X_I2C_IRQSTATUS_AAS  (1 << 9)
    700 #define AM335X_I2C_IRQSTATUS_BF  (1 << 8)
    701 #define AM335X_I2C_IRQSTATUS_STC  (1 << 6)
    702 #define AM335X_I2C_IRQSTATUS_GC (1 << 5)
    703 #define AM335X_I2C_IRQSTATUS_XDR (1 << 14)
    704 #define AM335X_I2C_IRQSTATUS_RDR (1 << 13)
     715#define AM335X_I2C_IRQSTATUS_ROVR (1 << 11)
     716#define AM335X_I2C_IRQSTATUS_BB   (1 << 12)
     717#define AM335X_I2C_IRQSTATUS_RDR  (1 << 13)
     718#define AM335X_I2C_IRQSTATUS_XDR  (1 << 14)
    705719
    706720#define AM335X_I2C_INT_RECV_READY AM335X_I2C_IRQSTATUS_RRDY
     
    709723#define AM335X_I2C_CFG_MST_RX AM335X_I2C_CON_MST
    710724#define AM335X_I2C_CFG_MST_TX  (AM335X_I2C_CON_TRX | AM335X_I2C_CON_MST)
    711 #define AM335X_I2C_IRQSTATUS_RAW_BB   (0x00001000u)
    712725#define AM335X_CM_PER_OCPWP_L3_CLKSTCTRL_CLKACTIVITY_OCPWP_L4_GCLK (0x00000020u)
    713726#define AM335X_I2C_INT_STOP_CONDITION AM335X_I2C_IRQSTATUS_BF
Note: See TracChangeset for help on using the changeset viewer.