lnls-dig / openMMC

Open source firmware for MMC controllers
GNU General Public License v3.0
39 stars 32 forks source link

Separate the I2C chipid map for AFC devices and RTM devices #179

Closed augustofg closed 1 year ago

augustofg commented 1 year ago

We should not define the I2C devices of the RTM card in the AFC I2C mapping table, otherwise it will be necessary to generate a new port for every combination of AFC and RTM cards.

One way to solve this is to create different i2c_chip_mapping_t arrays and reserve chip_id numbers between 0 and 63 to AFC devices and between 64 and 127 to the RTM devices. > 128 should be reserved for now (we could use them for the FMC cards in the future).

I2C mapping table of the AFCv3.1: https://github.com/lnls-dig/openMMC/blob/7a91948975f87f6613b28fc1ea562a2a7bb3c475/port/board/afc-v3/i2c_mapping.c#L20-L55

Function responsible for getting the I2C device bus and address: https://github.com/lnls-dig/openMMC/blob/7a91948975f87f6613b28fc1ea562a2a7bb3c475/modules/i2c.c#L86-L98