summaryrefslogtreecommitdiff
path: root/zephyr/dts/bindings/i2c
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: Automatically detect shared I2C portsKeith Short2021-09-141-8/+0
| | | | | | | | | | | | | | | | | | | Delete the "physical-port" node from named-i2c-ports, and automatically detected when multiple children point to the same I2C bus. This ensures that the I2C bus locking always blocks all matching I2C nodes, without the user needing to specify this relationship manually in the devicetree. BUG=none BRANCH=none TEST=Dump out i2c_physical_ports[] on herobrine. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I3d254684483a95af12e7940446f4cd8743684708 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3154694 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: npcx_evb: Enable I2CWealian Liao2021-07-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL enables I2C for npcx7/9_evb. Currently, zephyr-OS ec doesn't use the GPIO for i2c unwedge functionality. Remove the GPIO setting for i2c in gpio.dts. BUG=none BRANCH=none TEST=Get sensor value by `i2c` shell command ``` uart:~$ i2c scan I2C_2_PORT_0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- 1 devices found on I2C_2_PORT_0 uart:~$ i2c read I2C_2_PORT_0 0x48 0x00 2 00000000: 1f 80 ``` Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: If5029c41b7ba5400ee1492b408f7ab6975218c5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3060348 Reviewed-by: Yuval Peress <peress@chromium.org> Commit-Queue: Yuval Peress <peress@chromium.org>
* zephyr: i2c: protect physical portDino Li2021-07-221-0/+8
| | | | | | | | | | | | | | | | | | If i2c devices are connected to the same port, they should use the same mutex_lock() index. So the new transaction won't break the ongoing transaction. BRANCH=none BUG=b:189855648 TEST=Enable CONFIG_SMBUS_PEC and voltage regulator function on asurada. No i2c transaction is broken. Change-Id: Ib848e3c2e60b99ce66ad5fd2fc7095f90820a15d Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010920 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: herobrine_npcx9: Update I2C busesWai-Hong Tam2021-07-201-0/+1
| | | | | | | | | | | | | | | This CL is a Zephyr-equivalent of CL:2993218. Add the I2C bus for the RTC chip. The chip runs at 400KHz. BRANCH=None BUG=b:192253134 TEST=Built the herobrine_npcx9 image successfully. Change-Id: I399485706c66070464fcd9fe53bec35b4c0454a6 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3039388 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: asurada: Add more I2C informationSimon Glass2021-06-091-0/+4
| | | | | | | | | | | | | | | Add the I2C ports used by USB-C, so we can support charging. BUG=b:189855648 BRANCH=none TEST=with other CLs, build asurada for Zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I59ce2ad3b9158cf01dac7d89ab56c46c668a07e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2941813 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: Fix I2C_PASSTHRU host commandDawid Niedzwiecki2021-06-081-0/+6
| | | | | | | | | | | | | | | | | | | | ZephyrEC uses different I2C port numbers than CrosEC does, so convert the received remote port via I2C_PASSTHRU command into a proper one. The conversion is done based on a new property remote-port, which tells what port number is used by external components like kernel. The change fixes an issue with unexpected entering OTG mode by the charger. BUG=b:188885798 BRANCH=none TEST=Flash Lazor and make sure that no "charge problem" prints are displayed. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Id00265a3abf286ca59cbecb38ff7933d75e0d361 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2933296 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: brya: enable i2cYuval Peress2021-06-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Enable (status = "okay") i2c ports for sensors, battery, and charger/ eeprom. uart:~$ i2c scan I2C_7_PORT_0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- 09 -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- 2 devices found on I2C_7_PORT_0 BRANCH=none BUG=b:188605676 TEST=run i2c scan shell command Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id841551a09aec86faa56d9bd0977f0aa1f6b24e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932460
* zephyr: it8xxx2_evb: enable I2C drivertim2021-05-181-0/+3
| | | | | | | | | | | | | | | | | | Enable the I2C driver and connect with I2C peripheral to test writing and reading data. BUG=b:185202623 BRANCH=none TEST=shell: "i2c scan I2C_0(I2C_1, I2C_2, I2C_4)" "i2c write_byte I2C_0 0x52(slv) 0x10 0x20" "i2c read_byte I2C_0 0x52(slv) 0x10" Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I112aa379ba6162d774e6cd861fb6f579bb859823 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2878764 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: i2c: remove scl and sda referencesYuval Peress2021-05-141-6/+0
| | | | | | | | | | | | | | | The SDA and SCL components of the struct i2c_port_t are only used in and for the i2c_wedge.c logic. This isn't needed in Zephyr. Remove the values and functions that use them from the Zephyr build. BRANCH=none BUG=b:188179405 TEST=build volteer and trogdor Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I71a26fbd9bc51def744ef1f16a540728482c5a2b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2896235 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: i2c: remove frequency from devicetreeYuval Peress2021-05-141-5/+0
| | | | | | | | | | | | | | | | The frequency wasn't actually being used as it was set by the i2c controller in the proper Zephyr driver. Also, remove the kbps field in struct i2c_port_t for Zephyr builds to make sure we don't accidentally use it later on. BRANCH=none BUG=none TEST=build trogdor and volteer Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I2eea231ff629d3e6f0ebbe71923a7b0ae96af87c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2896234 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: config: add a dts node for the CBI EEPROMFabio Baltieri2021-04-091-14/+0
| | | | | | | | | | | | | | | | | This makes a separate dts node for the CBI EEPROM. The node uses the existing at24 dts binding and defines all the required properties, even though right now only the address is used. BUG=b:184739382 BRANCH=none TEST=build and flash on volteer TEST=cbi shell command Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8a3ed6f3dc504118fa6d61bc78e2b4c46d6c4840 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814621 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: volteer: init i2c_portsYuval Peress2021-04-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Populate i2c_ports[] and set i2c_ports_used correctly. Add child bindings for named i2c ports that allow configurations. A configured named i2c node MUST have a kbps property and 2 child nodes for `scl` and `sda` which will use the same enums as the named gpios. This provides a compile-time check to make sure that the overlay gpio.dts defined a named gpio using the SCL/SDA enums. This means that if the i2c port config uses a valid enum from gpio-enum-name.yaml but the overlay did not define a node using that same enum, the build will break (because the gpio_signal enum will not have that enum defined). BRANCH=none BUG=b:184269641 TEST=zmake testall TEST=run firmware_ECCbiEeprom FAFT on volteer Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I7f46ab8f8b4079cf6ae5287869e6844fea38a100 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810333 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: i2c mapping using an enumYuval Peress2021-04-083-8/+49
| | | | | | | | | | | | | | | | | | | | Currently, every project will need to provide a custom mapping header for i2c as well as gpios. We'd like to move that overhead to the dts files, which will make the board dts a lot more reusable as well as clean up the bringup of new boards. Add to the i2c_ports enum from the dts named i2c port list. Each enum is only added if a node exists using that enum. This also allowes for verifying that the enum is only used once. BRANCH=none BUG=b:184786824 TEST=build and flashed volteer TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I42cc098a9badac57a3781fa9dfaf32c0ec0c5aca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780838
* volteer: i2c: rename i2c-keys node to named-i2c-portsFabio Baltieri2021-01-211-4/+4
| | | | | | | | | | | | | | Rename the node definition and instance to named-i2c-ports. This matches the node name and other references in the code. BUG=none TEST=zmake testall BRANCH=none Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I426cc29073d1725c208e151d0deeb9d5214bf7ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638253 Reviewed-by: Keith Short <keithshort@chromium.org>
* dts: Add custom bindings directory to buildsYuval Peress2021-01-151-0/+17
This change adds a dts/bindings directory which can be included for our builds. Normally, we would have to add the dts/bindings directory to each project. That means that we would need to add the custom bindings at projects/experimental/volteer/dts/bindings. This change allows us to add a single location of it instead at the zephyr-chrome/ level. The first use case is a custom list of phandles which allows us to curate the mapping of i2c ports. This will later be used to move away from our dependency on platform/ec/chip/ files. BUG=b:173031122 TEST=firmware_builder.py test Change-Id: I251cb32d1a3e63fc0d76c7f3f480a6538d539af4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/zephyr-chrome/+/2546328 Tested-by: Yuval Peress <peress@chromium.org> Auto-Submit: Yuval Peress <peress@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2630146 Tested-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>