i2c driver for RTEMS

Hello, I’m interested in getting I2C working on the Beaglebone Black while running RTEMS 4.10. I basically need to write an I2C driver from scratch. I need to start the I2C subsystem myself. I am looking at the AM335x Sitara Technical Reference Manual, and it has a set of steps starting on page 4488 in Section 21.3.15. The first steps are to configure the prescaler and clocks. I’d like to know what the system clock frequency is that is used to derive the 12 MHz module clock. I’d also like to know the base address/mechanism by which I would access the other registers listed (i.e. I2C_OA, etc). Any help would be appreciated!

  1. Program the prescaler to obtain an approximately 12-MHz I2C module clock (I2C_PSC = x; this value
    is to be calculated and is dependent on the System clock frequency).
  2. Program the I2C clock to obtain 100 Kbps or 400 Kbps (SCLL = x and SCLH = x; these values are to
    be calculated and are dependent on the System clock frequency).
  3. Configure its own address (I2C_OA = x) - only in case of I2C operating mode (F/S mode).

thanks,
-andrew