Bug 6696

Summary: I2C number changed in Firmware?
Product: [Hardware Platforms] MinnowBoard MAX Reporter: John 'Warthog9' Hawley <warthog9>
Component: hw-minnowmaxAssignee: John 'Warthog9' Hawley <warthog9>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: david.wei, dvhart, ivan.rouzanov, michael.p.krau, sjolley.yp.pm
Version: 2C A1   
Target Milestone: Production Release   
Hardware: MinnowBoard Max   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description John 'Warthog9' Hawley 2014-09-08 20:24:19 UTC
Under the LPSS settings we have the two I2C interfaces that are user configurable.  In 0.73 the two interfaces now claim to be #6 and #7, in previous versions it was #5 and #6.

Was this change intentional to deal with confusion from the OS level, or have we enabled / disabled the wrong I2C interfaces now?
Comment 1 Ivan Rouzanov 2014-09-08 20:30:24 UTC
LPSS devices used to be enumerated as PCI, in PCI device instance follows the function number which is 0-based. By default LPSS supposed to be enumerated as ACPI to help all OSes, in ACPI DSDT I2C controllers are named I2C1-I2C7. While this might be confusing, at the same time this is the same scheme all BYT-based platforms follow so I'd suggest to keep it this way as it will make it less confusing for developers supporting different boards (Sharks Cove is one example).
Comment 2 Michael Krau 2014-09-08 20:52:36 UTC
In the hardware the two I2C devices are hardware devices 5 & 6 (zero relative, which matches the PCI enumeration).  LPSS is following the ACPI (one relative numbers).   Same devices just new designations.

The question becomes one of expectation across developers.  If there is consensus across the community, the enumeration could be manipulated to meet that consensus, but if there is some debate, then any change (or not) will not meet all expectations.  

Agreeing with Ivan on this one, the one relative count seems to be more standard across the Baytrail implementations.
Comment 3 John 'Warthog9' Hawley 2014-09-08 23:31:51 UTC
Ok so this boils down to an expected change, but something that needs to get documented since all our public documentation currently refers to those as #5 and #6 respectively, correct?
Comment 4 Ivan Rouzanov 2014-09-08 23:34:36 UTC
Yes, I agree. I am not however sure what is the documentation for ACPI declarations. In production systems ACPI is often considered essentially self-documenting - DSDT is the documentation. But I 100% agree this can (and as we saw already) does get confusing.
Comment 5 Michael Krau 2014-09-08 23:40:42 UTC
There is more here than ACPI verse LPSS:

5 & 6 (the zero relative numbers) are also the designations in the schematic - per the SoC specification.  So somebody looking at the schematic could be confused as well (that is what lead me down the bunny trail).

In the documentation it should be noted that ACPI is one relative and that some devices may be designated by one value higher than the zero relative hardware designation (which is also the PCI enumeration, and could be the LPSS designation).
Comment 6 Ivan Rouzanov 2014-09-08 23:43:19 UTC
I agree, it's just where do we document ACPI numbering?
Despite how confusing it is, I really would prefer ACPI on MinnowBoard MAX to stay consistent with all other BYT-based programs.
Comment 7 Darren Hart 2014-09-11 23:35:40 UTC
Rather than worry about which numbering scheme is used for ACPI and PCI (neither of which impacts the programming interface), why not just use something that makes semantic sense to the end user, like:

"Low Speed Expansion I2C"

and

"High Speed Expansion I2C"
Comment 8 Ivan Rouzanov 2014-09-12 00:01:04 UTC
This is no _DDN, this is actual name if the device as in Device(XXXX) ACPI statement. Per ACPI Spec 5.3 "All names are a fixed 32 bits.", so only 4 characters can be used for the name.
Comment 9 John 'Warthog9' Hawley 2014-09-12 01:15:23 UTC
Ivan, I think you are confused on where we want this statement.  Specifically we want this shown in the firmware menu, that's where this change happened.  I don't really care what's in the ACPI table, assuming that it hasn't changed as well (which it doesn't look like it has under Linux)

Right now the menu says:

LPSS I2C #5 Support  [Enable]
LPSS I2C #6 Support  [Enable]

My original question was, why did those numbers changed to 6 & 7 respectively in 0.73 (might be earlier I'm not sure)

And Darren is suggesting instead of the lines mentioned he wants

Low Speed Expansion I2C   [Enable]
High Speed Expansion I2C  [Enable]

which I've got a small modification of

Low Speed Expansion I2C (#5)  [Enable]
High Speed Expansion I2C (#6) [Enable]
Comment 10 Ivan Rouzanov 2014-09-12 01:21:04 UTC
Ah!
You are right, I did not get it.

Yes, makes perfect sense to me. Maybe help could mention which header it is on.
But in any case - sure, this makes sense. Sorry, I did not get it.
Comment 11 David_Wei 2014-10-09 08:58:13 UTC
BIOS team Update:

Fixed. Will be available in next release. 

Item - Low Speed Expansion I2C (#5)  [Enable]
Help - I2C Controller PCI device Dev24: Func6  ; Schematic names it I2C5, ACPI table names it I2C6.

Item - High Speed Expansion I2C (#6) [Enable]
Help - I2C Controller PCI device Dev24: Func7 ;  Schematic names it I2C6, ACPI table names it I2C7.
Comment 12 Darren Hart 2014-11-06 23:16:58 UTC
Confirmed fixed in Firmware 0.74.