summaryrefslogtreecommitdiff
path: root/zephyr/drivers/cros_shi
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-054-1369/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* zephyr: npcx: SHI: select the host interface to SHI explicitlyJun Lin2021-08-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | We use the property 'hif-type-auto' in the node /booter-variant to track if the booter of a NPCX chip series sets the host interface type or not. If it is not set, the SHI driver should set it explicitly. BRANCH=none BUG=none TEST=pass "zmake testall" TEST=verify the HIF_TYP_SEL field in DEVCNT register is set correctly. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ic96d03a6eaf347638684f533ea8ff0e447f95b40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3067145 Tested-by: CH Lin <chlin56@nuvoton.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* zephyr: shim: use NPCX_CLK_CTRL_NODE for clock controlFabio Baltieri2021-08-061-1/+1
| | | | | | | | | | | | | | | | | Zephyr NPCX drivers has been switched to the link time device definition, and now NPCX_CLK_CTRL_NODE is available to point to the pcc node directly. Use that in the EC code as well for the clock API. BRANCH=none BUG=none TEST=build and run on volteer Cq-Depend: chromium:3000806, chromium:3070703 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I8a5b5426c5e6a9167cd232fc72e50d372958b31c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001584 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shi: it8xxx2: create phandle of pinmux controlTim Lin2021-08-022-6/+47
| | | | | | | | | | | | | | | | | | | Create the pinmux phandle to the SHI driver node in the devicetree. When the pinmux_pin_set function in cros_shi_ite_init can refer to the setting of phandle. It is more flexible to use. BUG=b:187541831 BRANCH=none TEST=host command is normal. Cq-Depend: chromium:3041210 Cq-Depend: chromium:3056118 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: I0c71333563eb7da04d29b82767b6a6660d867eed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3045026 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: it8xxx2: shi: disable CPU FIFO access at transaction endDino Li2021-07-271-21/+32
| | | | | | | | | | | | | | | | | | | AP will de-assert CS to stop a SPI transaction due to timeout (1 second) of waiting for a valid packet response from the EC. Under the above condition, EC should ensure its SPI module is back at the state where Rx FIFO is ready to clock in data from AP. So EC will be ready to handle next transaction from AP. BRANCH=none BUG=b:192564057 TEST=Slow down host command task to hit the timeout. EC still can handle next transaction correctly. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I1401175fe329dbba9730848f0eccdd722dcf136b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3053136 Reviewed-by: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: it8xxx2: shi: enable CS interruptDino Li2021-07-271-0/+14
| | | | | | | | | | | | | | | This interrupt will be needed in the future to enable low power mode on idle task in S0 state. BRANCH=none BUG=b:185176098 TEST=the interrupt can be triggered correctly on asurada. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I04b066de0129f01adf2c7ba4c9f60788b3d46cbc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3034781 Reviewed-by: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: shim: use DEVICE_DT_GET for clock controlFabio Baltieri2021-06-281-2/+1
| | | | | | | | | | | | | | | | | | | This changes the clock control calls to use DEVICE_DT_GET instead of device_get_binding. DEVICE_DT_GET is more efficient since it's allocated at link time. These are then used by clock_control_on, which already checks for device_is_ready, so no extra safety checks are needed. BRANCH=none BUG=none TEST=zmake configure -b -B ~/build-volteer/ zephyr/projects/volteer/volteer TEST=zmake configure -b -B ~/build-it8xxx2_evb/ zephyr/projects/it8xxx2_evb Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I76a2c47165d197c799be25d8e7e40a1a0873777d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985462 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: remove deprecated macro for power management nopYuval Peress2021-06-221-2/+2
| | | | | | | | | | | | | | | Zephyr v2.6 deprecated the macro device_pm_control_nop, remove the use in our repo to avoid warnings. BRANCH=none BUG=b:190731415 TEST=zmake configure -b zephyr/projects/trogdor/lazor Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I515de7e62e3496ca9ddb55b05ca195fa91e35cc1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980434 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: shi/it8xxx2: Ensure spi chip select alt function is enabled.Dino Li2021-05-201-1/+14
| | | | | | | | | | | BUG=b:188577674, b:180980668 BRANCH=none TEST=boot to kernel on Asurada. (with connecting both AC and battery) Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: Icbcdfbad611eed4b7684c05133a4a20fed245353 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2905038 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: shi: npcx: Improve SHI driverstabilize-RUST-13932.B-mainJun Lin2021-04-231-7/+10
| | | | | | | | | | | | | | | | | | | | | This CL fixes some potential leaks for the SHI driver: 1. Replace irq_lock/irq_unlock with __disable_irq/__enable_irq because irq_lock/irq_unlock leave some system exceptions still enabled. These may block the SHI driver's execution which requires hard timing. 2. Change the interrupt priority of SHI from 2 to 1. BRANCH=none BUG=b:182600858 TEST=Verify the SHI function on Lazor Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: If0ea355b5f300054ce8f7ae53de12f99a6d6aba6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2835526 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* zephyr/drivers: it8xxx2: add SPI host interface drivertim2021-04-213-0/+351
| | | | | | | | | | | | | | | | | Add spi host interface driver which is required to communicate with the EC when the CPU is the ARM processor. BUG=b:185202623 BRANCH=none TEST=replaced board hayato's EC with it81202_evb and the host command can be received and responded. Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I25ccdd0b29bf46b6a4ad451150f63b47dc9d3b97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2813841 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shi: npcx: Fix rx deadline checkingJun Lin2021-04-211-2/+2
| | | | | | | | | | | | | | | | | NPCX shi rx uses k_uptime_get() to check deadline time. However, k_uptime_get() return in 'ms' and SHI_CMD_RX_TIMEOUT set in 'us'. Change SHI_CMD_RX_TIMEOUT to 'ms' to fix the unit. BRANCH=none BUG=b:182600858 TEST=zmake testall Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I9824d3b710dc0af076153e1f8479503fe836900c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842707 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
* zephyr: shi: npcx: Fix unreachable codeJun Lin2021-04-211-2/+2
| | | | | | | | | | | | | | | cros_shi_npcx_disable() has unreachable code. Fix it. BRANCH=none BUG=b:182600858 TEST=zmake testall Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I23394e698805fc9b139dc57a5d096a18dd60df73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842706 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
* zephyr: driver: SHI: remove SHI version controlJun Lin2021-04-021-8/+0
| | | | | | | | | | | | | | | | | | | | | In NPCX7mnFA, the old SHI module and the new SHI module co-exist in this chip. We need to set DEVALTF.bit7 to enable the new version of the SHI module. In the latter npcx7 variants and npcx9 chips, only the new SHI module is supported. Because NPCX7mnFA chip variants are not included in the zephyr repo. We can remove the version control setttng. BUG=b:182600858 BRANCH=none TEST=Test host command "version" and "Hello" on npcx7_evb and the host emulator. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I43b2fb5294f39e2bf04a0794c9d54e87c8e0ce33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799335 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: driver: SHI: rename non-inclusive language wordJun Lin2021-04-021-3/+3
| | | | | | | | | | | | | | | | Use inclusive language wording for SPI interface in the comment. BUG=b:182600858 BRANCH=none TEST=none Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ib58ead6b58464e0a08777c674fcf95f45850e968 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799334 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: driver: SHI: remove unnecessary "default n" in KconfigJun Lin2021-04-021-2/+0
| | | | | | | | | | | | | | | | | | Remove unnecessary "default n" in the Kconfig because the default value of a boolean type config is always n. BUG=b:182600858 BRANCH=none TEST=pass zmake build Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I54cc4a3dbf1615c595e26d874eef3b0d73c3a82e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799333 Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: npcx: support SHI driverJun Lin2021-03-313-0/+947
Add the support for SHI (Serial Host Interface) driver. This is used to transfer host commands between EC and ARM-based AP. BUG=b:182600858 BRANCH=none TEST=Test host command "version" and "Hello" on npcx7_evb and the host emulator. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I5f290fe910600162764f5728f094dd0f42d508ef Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2786887 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>