apollo-lhc / cm_mcu

Microcontroller source code for the APOLLO blade for the CMS tracker HL-LHC upgrade.
MIT License
2 stars 2 forks source link

Create I2C device functionality for control of devices by SM/Zynq data path #210

Open pwittich opened 4 months ago

pwittich commented 4 months ago

We need to create a I2C device functionality that will allow the MCU to relay commands from the Zynq via I2C for configuration and reading of registers on various devices that only the ~Zynq~ MCU has access to.

These devices include

The Zynq would initiate a command, which the MCU would read (high priority interrupt), get the necessary information (either from MCU memory or via an explicit I2C r/w to the attached I2C busses), and then put the information on the bus back to the Zynq, possibly delaying the response to the zynq (I2C clock stretching?).

The first blush proposal is to support I2C registered access only with a fixed data size (8 bit addresses, 16 bit data). Expand the address space with pages as is customary with I2C devices.

Page Information
0 Frequent baseline information.
1 LGA80D devices
2-2+20 Firefly devices -- one page per device?
23 - 23+5 Clock devices
pwittich commented 4 months ago

Can use the base I2CSlaveTask for this purpose, making the changes to expand it beyond the basic single-use I2C device from the IPMC, as outlined here. I guess the additional change would be that it needs to be configurable on the size of the data?