Change ACPI tables to add HID-over-I2C device?

razor1000razor1000 New Member Posts: 8

Hi,
I need to add an entry for a HID-over-I2C device to the ACPI DSDT table.
I noticed that the Up Xtreme is supported by Intel's edk2 firmware project:
https://github.com/tianocore/edk2-platforms/tree/master/Platform/Intel#aaeon

Before I buy an Up Xtreme and try to build edk2, I figured I would ask about existing HID-over-I2C support. Are there any existing HID-over-I2C entries in the stock ACPI table? If so, what is their configuration? (I2C bus, speed, etc).

If there are no existing entries, is it really necessary to build edk2 in order to change the contents of the ACPI DSDT table? (I need to use Windows 10 and not Linux). Is there an easier way to do it?

Thanks!

Comments

  • garywgaryw New Member, Moderator, AAEON Posts: 37 admin

    @razor1000
    We don't have existing HID-over-I2C in ACPI table, you can refer Microsoft's document to add ACPI table in test mode https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn642101(v=vs.85)

    HID-over-I2C spec document you can refer this document https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn642101(v=vs.85)

  • razor1000razor1000 New Member Posts: 8

    @garyw said:
    We don't have existing HID-over-I2C in ACPI table, you can refer Microsoft's document to add ACPI table in test mode

    Did you mean to link to the HID-over-I2C spec twice?

    I am very familiar with the HID-over-I2C spec. I have created a working HID-over-I2C device. I have tested it on Linux and it works fine. Linux allows me to modify the DSDT table and compile the modified table into the kernel. But Windows does not allow that, and I need to certify my HID-over-I2C device on Windows 10.

    Is it possible to modify the DSDT table on the UP Xtreme?

  • garywgaryw New Member, Moderator, AAEON Posts: 37 admin
    edited February 4
  • razor1000razor1000 New Member Posts: 8

    @garyw

    This is great! It looks like rhproxy is exactly what I need. Thank you!

    Can you provide me with the ASL code for the serial busses and GPIOs that are available for use on the UP Xtreme?

    Thanks!

  • garywgaryw New Member, Moderator, AAEON Posts: 37 admin

    @razor1000
    rhproxy is different with HID-over-I2C, if you just want to access I2C bus, you can through our UpFramework SDK https://downloads.up-community.org/download/up-sdk-for-windows-10-and-windows-iot/

    windows demo app you can refer this link https://github.com/aaeonaeu/win-demo-apps

    if you still want to try rhproxy , you can refer attached patch file for Up Xtreme.

  • razor1000razor1000 New Member Posts: 8

    @garyw
    I received my UP Xtreme board, and I discovered that it is possible to add a custom HID-over-I2C device using the CRB BIOS settings.
    This is an even easier method than I had hoped for! I can add a HID-over-I2C device to I2C0 and/or I2C1. So now I just need to know how to connect my device to I2C0 or I2C1, and a GPIO.

    What I2C bus # are the I2C pins on the eDP connector connected to? Are they 3.3V or 1.8V?
    The INT pin used for touchpanels is normally E7; is that routed out somewhere? If not, is there a different pin I can use?
    (The interrupt can also come from the NVIC, but I'm not sure how to set that up).

    Thanks!

  • jaymanjayman New Member Posts: 46 ✭✭

    The following connectors have I2C ports:

    • M.2 2280 M-key connector (CN4) - The manual says I2C1, but not clear if that correlates to chipset I2C1 or not.
    • EDP connector (CN13) - unclear which chipset port that connects to.
    • HAT connector (CN22) - they're labeled I2C1 and I2C0 in the manual, but actually connect to I2C4 and I2C3 on the chipset respectively.
    • Docking II connector (CN26) - that one is labeled I2C4 in the manual.

    The 2 I2C ports on the HAT connector are definitely I2C3 and I2C4. Hopefully someone at AAEON can fill in / confirm the other I2C ports.

    The 2 I2C ports on the HAT connector are definitely 1.8V. The other ones (on M.2, EDP, and Docking II) are probably 1.8V as well since there's no good reason to level shift them, but again, someone at AAEON would need to confirm. The one on the Docking II connector is actually labeled 1V8 in the manual, so that's a pretty safe bet there.

    As far as INT, every GPIO pin on the HAT connector can be configured as an INT pin via ACPI overrides. Those are all at 3.3V though via MAX V level shifters.

  • jaymanjayman New Member Posts: 46 ✭✭

    @razor1000

    I received my UP Xtreme board, and I discovered that it is possible to add a custom HID-over-I2C device using the CRB BIOS settings.
    This is an even easier method than I had hoped for! I can add a HID-over-I2C device to I2C0 and/or I2C1. So now I just need to know how to connect my device to I2C0 or I2C1, and a GPIO.

    Where did you find that HID-over-I2C setting in BIOS?

  • razor1000razor1000 New Member Posts: 8

    @jayman said:
    Where did you find that HID-over-I2C setting in BIOS?

    It's in the CRB setup.

    Main->
    CRB Setup->
    CRB Chipset->
    PCH-IO Configuration->
    SerialIo Configuration

    If I2C0 and I2C1 are enabled, some options show up in the "Serial IO I2C# Settings" further down.
    I2C0 Controller [Enabled]
    I2C1 Controller [Enabled]

    For I2C0, there's settings for a "Touch Pad". There are a couple pre-configured devices, but you can also select "Custom Device", which lets you pick the I2C address, HID descriptor address, and I2C bus speed. Oh, and you can select either APIC or GPIO for the interrupt source.
    For I2C1, it's basically the same thing, except it's called "Touch Panel".
    Unfortunately there are no options for the other I2C bus numbers, even if they are enabled.

    Serial IO I2C0 Settings->
    Serial IO Touch Pad Settings->
    Touch Pad [Custom Device]

    Touch Pad Interrupt Mode [APIC Interrupt/GPIO Interrupt]
    Device's bus address 0
    Device's HID address 0
    Device's bus speed [100kHz/400kHz/1MHz]

    Serial IO I2C1 Settings->
    Serial IO Touch Panel Settings->
    Touch Panel [Custom Device]

    Touch Panel Interrupt Mode [APIC Interrupt/GPIO Interrupt]
    Device's bus address 0
    Device's HID address 0
    Device's bus speed [100kHz/400kHz/1MHz]

  • razor1000razor1000 New Member Posts: 8

    @jayman said:
    The following connectors have I2C ports:

    • M.2 2280 M-key connector (CN4) - The manual says I2C1, but not clear if that correlates to chipset I2C1 or not.
    • EDP connector (CN13) - unclear which chipset port that connects to.
    • HAT connector (CN22) - they're labeled I2C1 and I2C0 in the manual, but actually connect to I2C4 and I2C3 on the chipset respectively.
    • Docking II connector (CN26) - that one is labeled I2C4 in the manual.

    The 2 I2C ports on the HAT connector are definitely I2C3 and I2C4. Hopefully someone at AAEON can fill in / confirm the other I2C ports.

    The 2 I2C ports on the HAT connector are definitely 1.8V. The other ones (on M.2, EDP, and Docking II) are probably 1.8V as well since there's no good reason to level shift them, but again, someone at AAEON would need to confirm. The one on the Docking II connector is actually labeled 1V8 in the manual, so that's a pretty safe bet there.

    As far as INT, every GPIO pin on the HAT connector can be configured as an INT pin via ACPI overrides. Those are all at 3.3V though via MAX V level shifters.

    Just to confirm, the bus that is labeled I2C1 on the HAT connector is definitely I2C4, and it does seem to be at 1.8V. I couldn't confirm which one I2C0 is; I tried it without a shifter, and that wasn't likely to work. I was lucky that writes to the other bus showed up.

    I made an ACPITABL.dat for rhproxy that has an entry for all 6 I2C bus numbers. I hooked up a logic analyzer to the pins, and then used I2cTestTool.exe to write to a unique address for each bus, and then I checked which address came through.

    It's too bad the CRB BIOS option won't work, but I was planning to use a different method, anyway. I just need to verify that I can override a GPIO entry in the ACPI tables and make it generate an interrupt. I'll probably use rhproxy again to figure out which GPIOs map to which pin numbers in the APCI tables. It's a quick way to check this kind of stuff.

  • jaymanjayman New Member Posts: 46 ✭✭

    Yes, I2C1 on HAT is definitely chipset I2C4, and I2C0 on HAT is definitely chipset I2C3.

    You can confirm that in the BIOS setup under Advanced > HAT Configurations. If you toggle I2C3 on/off, pins 27/28 will toggle between I2C and GPIO. Likewise if you toggle I2C4 on/off, pins 3/5 will toggle between I2C and GPIO.

    I also have I2C devices attached to the I2C ports on the HAT, and they do respond correctly when I access the chipset I2C3 / I2C4 resources.

Sign In or Register to comment.