Skip to content

Commit

Permalink
hdata/i2c: Ignore CFAM I2C master
Browse files Browse the repository at this point in the history
Recent FSP firmware builds put in information about the CFAM I2C master
in addition the to host I2C masters accessible via XSCOM. Odds are this
information should not be there since there's no handshaking between the
FSP/BMC and the host over who controls that I2C master, but it is so
we need to deal with it.

This patch adds filtering to the HDAT parser so it ignores the CFAM I2C
master. Without this it will create a bogus i2cm@<addr> which migh cause
issues.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Apr 24, 2018
1 parent b08d198 commit 12514d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hdata/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ int parse_i2c_devs(const struct HDIF_common_hdr *hdr, int idata_index,
continue;
}

/*
* On some systems the CFAM I2C master is represented in the
* host I2C table as engine 6. There are only 4 (0, 1, 2, 3)
* engines accessible to the host via XSCOM so filter out
* engines outside this range so we don't create bogus
* i2cm@<addr> nodes.
*/
if (dev->i2cm_engine >= 4 && proc_gen == proc_gen_p9)
continue;

i2cm = get_i2cm_node(xscom, dev->i2cm_engine);
bus = get_bus_node(i2cm, dev->i2cm_port,
be16_to_cpu(dev->i2c_bus_freq));
Expand Down

0 comments on commit 12514d3

Please sign in to comment.