summaryrefslogtreecommitdiff
path: root/common/build.mk
Commit message (Collapse)AuthorAgeFilesLines
* Update license boilerplate text in source code filesstabilize-quickfix-15278.72.B-ishstabilize-quickfix-15183.78.B-ishstabilize-15446.B-ishstabilize-15439.B-ishstabilize-15432.B-ishstabilize-15429.B-ishstabilize-15415.B-ishstabilize-15395.B-ishstabilize-15393.48.B-ishstabilize-15381.B-ishstabilize-15364.B-ishstabilize-15361.B-ishstabilize-15359.B-ishstabilize-15359.58.B-ishstabilize-15359.50.B-ishstabilize-15359.45.B-ishstabilize-15335.B-ishstabilize-15329.59.B-ishstabilize-15329.44.B-ishstabilize-15317.B-ishstabilize-15301.B-ishstabilize-15300.B-ishstabilize-15278.64.B-ishstabilize-15251.B-ishstabilize-15245.B-ishstabilize-15236.66.B-ishstabilize-15208.B-ishstabilize-15207.B-ishstabilize-15185.B-ishstabilize-15185.7.B-ishstabilize-15183.82.B-ishstabilize-15183.69.B-ishstabilize-15183.14.B-ishstabilize-15174.B-ishstabilize-15167.B-ishstabilize-15129.B-ishstabilize-15122.B-ishstabilize-15120.B-ishstabilize-15117.86.B-ishstabilize-15117.48.B-ishstabilize-15117.111.B-ishrelease-R114-15437.B-ishrelease-R113-15393.B-ishrelease-R112-15359.B-ishrelease-R111-15329.B-ishrelease-R110-15278.B-ishrelease-R109-15237.B-ishrelease-R109-15236.B-ishrelease-R108-15183.B-ishrelease-R107-15117.B-ishishfirmware-ti50-prepvt-15315.B-ishfirmware-skyrim-15390.B-ishfirmware-skyrim-15369.B-ishfirmware-nissa-15217.B-ishfirmware-nissa-15217.45.B-ishfirmware-nissa-15217.126.B-ishfirmware-duplo-15151.B-ishfirmware-corsola-15194.B-ishfactory-trogdor-15210.B-ishfactory-skyrim-15384.B-ishfactory-nissa-15199.B-ishfactory-corsola-15197.B-ishfactory-corsola-15196.B-ishfactory-brya-15231.B-ishMike Frysinger2022-09-141-1/+1
| | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* 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-051-6/+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>
* SSFC: Framework to support two charger sourcesParth Malkan2021-09-241-0/+1
| | | | | | | | | | | | | | | | | | Many platforms have requirements to support more than one charge source (eg. pirika). It can't be supported by just enabling two different CONFIGS as that can lead to conflicts. Eg.USD_PD_VBUS_DETECT_TCPC vs USB_PD_VBUS_DETECT_DISCHARGE. This change provides a framework that supports two different charger sources in the same build. Please see the CL for relevant logs. BRANCH=None BUG=b:194375840 TEST=make -j buildall Signed-off-by: Parth Malkan <parthmalkan@google.com> Change-Id: I309cc5930233983e615d90a4290fc749abf7aa2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088232 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* usbpd: support dynamic PDO selectionEric Yilun Lin2021-09-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support dynamic PDO selection CONFIG_USB_PD_DPS. This config controls the charging voltage and power according to the input power and battery configuration. DPS would continuously evaluate the system load and current charging voltage, and decide a new one by below: 1. If the PDO can fulfill system desired power. 2. If the PDO is efficient for the battery configuration. To detect if the system load cannot be fulfilled by the current PDO, it checks: 1. if the input current closes to the PDO current limit. 2. if the input power closes to the PDO maximum power. To detect if the system load can be fulfilled by a more efficient PDO, it checks: - if the voltage of a new PDO is closer to the battery voltage than the current PDO, and the power is able fulfill the system load. BUG=b:169532537 TEST=1. tested on asurada, the charging voltage is able to switch to different PDOs under different system loads 2. tested that the DPS is able to switch charge port (e.g. C1 12V -> C0 9V) based on the provided PDOs. BRANCH=asurada Change-Id: I7c7706b331dc0d4f8ac68569dc7ed852fc9308e3 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897064 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* common: move standard library functions from util.c to another fileMichał Barnaś2021-08-251-1/+1
| | | | | | | | | | | | | | | | | | This commit moves some of the standard library functions from util.c file to util_stdlib.c file. It will allow to use util.c for both CrOS EC and Zephyr builds and will make shim util file unnecessary. BRANCH=main BUG=b:177096231 TEST=Build both, CrOS EC and Zephyr firmwares Compilation should finish without any problems After flashing, both versions work as they should Change-Id: If6f930a04d28bec35faa16759f43b36176bf3de7 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3081827 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* tmp112: Support reading TMP112 in millikelvinRob Barnes2021-08-251-0/+1
| | | | | | | | | | | | | | | TMP112 supports .0625 degrees of resolution. Retain this resolution and support reading the temp in degrees millikelvin. BUG=b:176994331 TEST=Build and run on guybrush BRANCH=None Change-Id: I2802016b1edb08678953238e7f01acdd320c37cf Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001391 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* common: Add Milli Kelvin conversion macrosRob Barnes2021-08-211-1/+1
| | | | | | | | | | | | | | Add macros to convert to and from milli kelvin and various temperature units. Utilize round_divide for more accurate conversions. BUG=b:176994331 TEST=Unit test BRANCH=None Change-Id: Ie6750b9d2d2b8093fdf9c14f904382e91d8d95bb Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078051 Reviewed-by: Keith Short <keithshort@chromium.org>
* common/build.mk: drop duplicate rules.Eric Yilun Lin2021-07-211-4/+0
| | | | | | | | | | | | | | | | The rule has been added in the Makefile.rules already. BUG=none TEST=make don't complain BRANCH=none Change-Id: I7af66c23ff8cad775e89330d5d1849a4aa91069e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2999361 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com>
* cbi: Introduce CONFIG_CBI_GPIOPhilip Chen2021-07-141-0/+1
| | | | | | | | | | | | | | | | | | | For the boards where SKU_ID/BRD_ID comes from the strapping pins on EC, this new config enables AP to ask EC for those hardware configs using the CBI host command `EC_CMD_GET_CROS_BOARD_INFO`. BRANCH=None BUG=b:186264627 TEST=make buildall -j TEST=Enabled CONFIG_CBI_GPIO for lazor and manually verified with `ectool cbi get`. Change-Id: I7ec9097bab96d2076d9d42db2d003460db000113 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002452 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* driver: bmi3xx: Add support for BMI323 sensorBhanu Prakash Maiya2021-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | BMI323 is one of BMI3XX series accel sensor series. Adding defines, driver from Bosch APIs based initial patches submitted by Bosch team members in crrev/c/2966530. BRANCH=none BUG=b:178398789 TEST=Accel implementation tested on Guybrush EC commands: > accelinfo > acceldata Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Change-Id: I9fa9d80aa25231261994adb4ef0ac5d71ac2f81a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2984740 Reviewed-by: Diana Z <dzigterman@chromium.org> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@google.com> Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
* cbi: Separate CBI EEPROM driver from CBI protocolPhilip Chen2021-06-291-1/+1
| | | | | | | | | | | | | | | | | Factor out the physical storage driver (cbi_eeprom.c) from the CBI data/protocol layer (cbi.c), setting up the groundwork to support more options of CBI sources. BRANCH=None BUG=b:186264627 TEST=make buildall -j Change-Id: Ic30a6f789970dd6723cf70d4e852ddb7161f796f Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965848 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* driver: bma4xx: Add support for BMA422 sensorBhanu Prakash Maiya2021-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | BMA422 is one of BMA4XX series accel sensor series. Adding defines, driver from Bosch APIs based initial patches submitted by Bosch team members in crrev/c/2894333. Reference code can be found on https://github.com/BoschSensortec/BMA423-Sensor-API. BRANCH=none BUG=b:178400750 TEST=Accel implementation tested on Guybrush EC commands: > accelinfo > acceldata Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Change-Id: I8117283e54980379989fb01f68c29b7d6c501eca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981465 Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Rob Barnes <robbarnes@google.com> Reviewed-by: Rob Barnes <robbarnes@google.com>
* config: Rename CONFIG_CROS_BOARD_INFOPhilip Chen2021-06-161-1/+1
| | | | | | | | | | | | | | | | | | Rename CONFIG_CROS_BOARD_INFO to CONFIG_CBI_EEPROM to make it clear that the information comes from on-board EEPROM. It sets up the groundwork for adding more options of CBI sources later. BRANCH=None BUG=b:186264627 TEST=make buildall -j Signed-off-by: Philip Chen <philipchen@google.com> Change-Id: I9a6feee0a8b35bbf29e445544243485507767ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2945792 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* driver: add ICM-42607 driver supportJuHyun Kim2021-05-181-0/+1
| | | | | | | | | | | | | | | | | Add ICM-42607 accel/gyro driver code. BUG=chromium:1198171 BRANCH=None TEST=ectool motionsense && CROS-EC IIO drivers Signed-off-by: JuHyun Kim <jkim@invensense.com> Change-Id: If2cff2bd20ac69ca40bc56af50dcabbd4f5910d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822268 Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
* mkbp: EC buttons and switches via MKBPBoris Mittelberg2021-05-101-0/+2
| | | | | | | | | | | | | | Allowing EC buttons and switches to be signaled via MKBP protocol, using CONFIG_MKBP_INPUT_DEVICES. Default behaviour is unchanged. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Cq-Depend: chromium:2824044 Change-Id: Ib96f98ecb3717a8ee8963be69fb7d7eb72e6d132 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796382
* config: rename CONFIG_FLASH to CONFIG_FLASH_CROSJeremy Bettis2021-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4ac1d81e1430dbfbfba1376a23ab19dfa845d7ef. The config name collides with the same config name in zephyr. Also, renames zephyr Kconfig CONFIG_PLATFORM_EC_FLASH to CONFIG_PLATFORM_EC_FLASH_CROS as the corresponding change at Kconfig side. BUG=chromium:1202406,b:180980668 TEST=make -j16 runhosttests buildall && zmake testall && \ /mnt/host/source/src/platform/ec/zephyr/firmware_builder.py --metrics \ /tmp/tmplt8ty8ci test ; echo $? BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I5b5e58b30d936b5232e049827f458d9a2ed06340 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2855320 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* mkbp: Separate MKBP_INFO host command from the keyboard driverBoris Mittelberg2021-04-271-1/+2
| | | | | | | | | | | | Detaching protocol-related info command from the keyboard driver. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I7943f7537bdf003145e9bd909a14f9451d922a5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2796381
* mkbp: Separate FIFO from the keyboard driverBoris Mittelberg2021-04-271-1/+1
| | | | | | | | | | | | | | Move protocol-related functionality out from the keyboard driver. This change is required to allow passing button events via MKBP on devices with non-MKBP keyboards. It reorganizes the code without changing the logic. BUG=b:170966461 BRANCH=main,firmware-dedede-13606.B,firmware-volteer-13672.B-main TEST=None Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: Ifb5b9d8e605f491313ee1dfe2c9950eb52152aa8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669355
* Revert "config: rename CONFIG_FLASH to CONFIG_FLASH_CROS"stabilize-13935.B-mainJack Rosenthal2021-04-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4e074a16c5703f0cdd7b7d780a8ae1bea53a445a. Reason for revert: responsible for CQ failures (crbug.com/1202406) BUG=chromium:1202406 BRANCH=none TEST=CQ Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Original change's description: > config: rename CONFIG_FLASH to CONFIG_FLASH_CROS > > The config name collides with the same config name in zephyr. > > Also, renames zephyr Kconfig CONFIG_PLATFORM_EC_FLASH to > CONFIG_PLATFORM_EC_FLASH_CROS as the corresponding change at Kconfig > side. > > BUG=b:180980668 > TEST=make buildall > BRANCH=none > > Change-Id: Ibac008ddff8c041aae04dca0bbf973823abe7640 > Signed-off-by: Eric Yilun Lin <yllin@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816622 > Tested-by: Eric Yilun Lin <yllin@google.com> > Reviewed-by: Keith Short <keithshort@chromium.org> > Commit-Queue: Keith Short <keithshort@chromium.org> Bug: b:180980668 Change-Id: Idc5e799d3b0ea8cc76dbbb49a91b3758ce6e9719 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2847274 Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* config: rename CONFIG_FLASH to CONFIG_FLASH_CROSEric Yilun Lin2021-04-231-1/+1
| | | | | | | | | | | | | | | | | | | The config name collides with the same config name in zephyr. Also, renames zephyr Kconfig CONFIG_PLATFORM_EC_FLASH to CONFIG_PLATFORM_EC_FLASH_CROS as the corresponding change at Kconfig side. BUG=b:180980668 TEST=make buildall BRANCH=none Change-Id: Ibac008ddff8c041aae04dca0bbf973823abe7640 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816622 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* common: uart: split off printf and like functions into separate moduleJack Rosenthal2021-02-111-1/+1
| | | | | | | | | | | | | | | | | | This separates the high-level uart output functions like uart_printf and uart_putc from the uart buffering module, allowing the buffering to be implemented separately from the output functions. The contract between this module and the uart_buffering layer is to implement uart_tx_char_raw and uart_tx_start. BUG=b:178033156 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5fb62ca2be1fea04654eaadd7a3806ac0c586929 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685411 Reviewed-by: Simon Glass <sjg@chromium.org>
* common: uart: split off host commands to separate moduleJack Rosenthal2021-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | Split off UART host commands to a separate module for better modularity and to enable sharing the host command code with Zephyr. Note: originally I had intended to share the entire uart_buffering module with Zephyr, but our initial goal was to get working with printk as the backend instead of Zephyr's UART drivers (they are rather complex). We may end up sharing the rest of uart_buffering in the future, but this lets us scale up/down the amount of UART code sharing we do as needed. BUG=b:178033156 BRANCH=none TEST=make buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib63e46700fb79b46c7ec2ea52dfcbe99d9fd8bbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685410 Reviewed-by: Simon Glass <sjg@chromium.org>
* make/util: Modularize util make var buildingCraig Hesling2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The key objectives are to * allow util targets to be added from outside of util/build.mk (for adding tools per board, like ectool_servo) * allow for easier conditioning of tool inclusion (for auto adding tools based on characteristic, like CHIP_NPCX) * reduce the number of tools being built (we can remove irrelevant tools for some boards, like removing stm32mon for npcx boards or iteflash for stm32 boards) We have tons of boards in EC now. This takes a significant amount of time to build, so we should be a bit more careful when adding utils for all boards. This and subsequent changes sets the precedent for selectivity. This shifts the initialization/control to the board and baseboard's build.mk and allows the util/build.mk to add items to these variables. Ideally, we would use multiple variables to aggregate the utils selection from the three sources (baseboard/build.mk, board/build.mk, and util/build.mk), but I don't think the addition complexity is currently warranted. BRANCH=none BUG=b:176500425 TEST=# Check all output artifacts from before and after this CL. make clobber make buildall STATIC_VERSION=1 -j mv build build-orig # Apply the change make clobber make buildall STATIC_VERSION=1 -j diff <(find build-orig | sed 's/build-orig//' | sort) <(find build | sed 's/build//' | sort) # Nothing should be different Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I23153850eda10fc1c88d386b9f3cd8296df9c6f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606511 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* No init.rom section support in ZephyrHyungwoo Yang2021-01-221-1/+2
| | | | | | | | | | | | | | | | | Building zephyr generates a warning on init.rom section. This change removes init.rom section declaration in Zephyr build. The change also added third_party into include folders so files in third_party now can be included in Zephyr build. BUG=b:173508071 BRANCH=none TEST=make BOARD=volteer -j8 build volteer on zephyr Change-Id: Ic86866e41d87d83c00a06a207a352a25fe57054b Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638135 Reviewed-by: Keith Short <keithshort@chromium.org>
* charge_manager: Create mockAbe Levkoy2021-01-221-0/+2
| | | | | | | | | | | | | | | Allow tests to use a mock charge_manager. Do not build the real charge manager when this is used. BUG=b:173023378,b:169385081,b:172709198,b:173028832,b:173028791 BUG=b:173141941,b:173142113 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I49caccafd024515833880d7251092b77623d4a71 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2639584 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* BB retimer: Set UFP mode of BB retimerAyushee2021-01-071-0/+1
| | | | | | | | | | | | | | | | | | | | | This CL enables getting the enter mode information received from DFP and sets the following BB retimer bits accordingly. Bit 2: RE_TIMER_DRIVER Bit 18: CABLE_TYPE Bit 19: VPRO_DOCK_DETECTED Bit 20: TBT_ACTIVE_LINK_TRAINING Bit 22: ACTIVE/PASSIVE Bits 27-25: TBT Cable speed Bits 29-28: TBT_GEN_SUPPORT BUG=b:157163664 BRANCH=None TEST=Tested with volteer as UFP, able to set the retimer bits Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I661aa4630b42fbaa136ff3855c4f70e3dee61546 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2382634 Reviewed-by: Keith Short <keithshort@chromium.org>
* make: Move libcryptoc rules to third_party/rules.mkCraig Hesling2020-12-241-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This moves the libcryptoc hooks from common/build.mk to third_party/rules.mk. Recall that Makefile.rules actually contains all of the "rules"/recipes for making objects. It alone contains all of the build output beautification commands and control. Makefile.rules is included as the last step in the master Makefile. This brings no firmware change, as verified with compare_build.sh. BRANCH=none BUG=none TEST=./util/compare_build.sh -b fp TEST=./util/compare_build.sh -b fp -p # This fails due to the differing position of # -lcryptoc, -lfpsensor, -lfpalgorithm, and/or -lfpbep. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I8d8493536a0e56ac6a5a1a32827b99ae97723727 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2092163 Reviewed-by: Yicheng Li <yichengli@chromium.org>
* COIL: Rename EC-EC comm config to be inclusiveDossym Nurmukhanov2020-12-121-2/+2
| | | | | | | | | | | | | Use server/client nomenclature instead BUG=none TEST=build and run on volteer BRANCH=none Signed-off-by: dossym@chromium.org Change-Id: I2cf4a82291134378ed21bbc068361f1be25e8176 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2587574 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* COIL: Rename ec_ec_comm* files to inclusive languageDossym Nurmukhanov2020-12-121-2/+2
| | | | | | | | | | | | | Rename the files to server/client instead BUG=none TEST=Rebuild and run on volteer BRANCH=none Signed-off-by: dossym@chromium.org Change-Id: Ibcbdcddfab1b878ff48fc4cb76307efe6de4fac0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2586037 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* COIL: Rename common i2c_controllerDiana Z2020-12-011-1/+1
| | | | | | | | | | | | | Rename i2c_controller.c and update related build file. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4fc27e494648c4a17e9f3f3d21ece9727ff6636e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558905 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* COIL: Rename common i2c_peripheral fileDiana Z2020-11-301-1/+1
| | | | | | | | | | | | | Rename i2c_peripheral.c and update related build file. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibd72d3b20b0cc1c07d426fbcf4d76cfb2644bc54 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558904 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* COIL: Rename host_command_controller.cDiana Z2020-11-301-1/+1
| | | | | | | | | | | | | Rename host_command_controller.c and update build.mk BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ib5285b2686ceabca9830bbae40941754d3e13a1d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2558903 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* PCHG: Add peripheral charge managerDaisuke Nojiri2020-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Peripheral charge manager communicates with peripheral charge chips to charge batteries of peripheral devices. Tested using Coachz proto and a listener evaluation board from NXP demo kit as follows: 1. Attach device then battery percentage is reported periodically. 2. Detach device then re-attach device to stop and resume charging. 3. Disable port by 'pchg 0 disable' to stop charging. 4. Enable disabled port by 'pchg 0 enable' to resume charging while device is in proximity. 5. When port is disabled, a device isn't detected or charged. BUG=b:173235954 BRANCH=Trogdor TEST=See the description above. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I0c2b583e5f7736b26ec7d1fb9cd9b6c59c7e8177 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538536 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* TCPM: Add OCP moduleDiana Z2020-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | Currently, the overcurrent protection is tracked in the PPC code. However, as different chips are able to report overcurrent move this code into a generic module. Logic for not sourcing Vbus or Vconn on latched ports moves into the TC layer, and an overridable board overcurrent function is provided for boards which have no special actions to take. BRANCH=None BUG=b:171501161 TEST=make -j buildall; TCPMv2 tested with following drawcia patch Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I75919e345a5b0bce4a0b67432a13515e7716cf6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532676 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Zephyr: add more compliant implementation for irq_(un)lockYuval Peress2020-11-081-1/+1
| | | | | | | | | | | | | | | | | | This change replaces the stubbed irq_(un)lock static functions defined in task.h with new functions that behave more like the Zephyr implementation of irq_(un)lock functions. This should make the migration from interrupt_(dis|en)able to Zephyr more seamless. BRANCH=none BUG=b:172060699 TEST=Added unit tests, make runtests -j, and built for various boards: eve, volteer, arcada_ish, atlas, hatch, kohaku, nocturne, samus, and scarlet Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ia7ad2b8d7d411a11699353bf5d3cc36a261fad14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511720
* motion: orientation: update interfaceGwendal Grignou2020-11-061-0/+1
| | | | | | | | | | | | | | Enabling orientation sensor would not compile anymore. Fix interface by replacing macros with functions. BUG=chromium:718919 BRANCH=none TEST=Compile when enabled on grunt and eve. Change-Id: Ic5d6992d040cde79ef3f691db494804e160b7650 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2491266 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
* COIL: Rename CONFIG_I2C_PERIPHERALDiana Z2020-11-051-1/+1
| | | | | | | | | | | | | Rename CONFIG_I2C_PERIPHERAL and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I3f148e976f3a4d6a1dc6c58686368c056290d5d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518660 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* COIL: Rename CONFIG_I2C_CONTROLLERDiana Z2020-11-051-1/+1
| | | | | | | | | | | | | Rename CONFIG_I2C_CONTROLLER and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ied6a1829bf54a5c9a32e6772982a4b8aa31aaf23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* npcx9: support SHA256 hardware acceleratorCHLin2020-10-131-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | There is the hardware accelerator for SHA computation inside npcx9. This CL wraps the Nuvoton SHA library APIs (which are in the ROM) to Chromium EC's SHA256_* APIs to speed up the SHA256 computation. With the help of the hardware accelerator, the hash computation runs several times faster than the software method (see b:155771688 for more detailed evaluation data.) Also, we can gain ~840 bytes of code size. BRANCH=none BUG=b:165777478 BUG=b:155771688 TEST=pass "make buildall" TEST=flash the same RW image; #define/#undef CONFIG_SHA256_HW_ACCELERATE ; verify the RW hash value is the same in the console message. TEST=with the following test CL, move test patterns in test/sha256.c to board/npcx9_evb/test_sha256.c; pass all test patterns. Signed-off-by: CHLin <CHLin56@nuvoton.com> Change-Id: I45ca609889bd73573d67d15f3e561614201e60f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2455021 Tested-by: CH Lin <chlin56@nuvoton.com> Auto-Submit: CH Lin <chlin56@nuvoton.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* cleanup: Move High-priority interrupt task to a separate fileVijay Hiremath2020-09-091-0/+1
| | | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I63a964721a5471d6a00894cb0cb94e9656c10893 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2389325 Reviewed-by: Poornima Tom <poornima.tom@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* common: implement body_detection state machineChing-Kang Yen2020-09-031-0/+1
| | | | | | | | | | | | | | | | | | | | | Implement body_detection state machine. Detect whether the user is close to the devices or not. Use the variance of acceleration from accelerometer to compute the motion confidence. If motion confidence is high enough, set the motion state to ON_BODY. If low enough, set it to OFF_BODY. Also, make gesture_cal() be called only when the gesture sensor data is updated. BRANCH=None BUG=b:123434029 TEST=make buildall, flash the ec, watch the ec console log Change-Id: If886b7f9fc505ef4db4d7abb08194b8f866121bb Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2230938 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* driver: add ICM-426xx driver supportJean-Baptiste Maneyrol2020-08-291-0/+1
| | | | | | | | | | | | | | | Add ICM-426xx accel/gyro driver code. BUG=chromium:1117541 BRANCH=None TEST=ectool motionsense fifo_read && tast run hardware.SensorRing Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I83fe48abc6aa9cde86576a777ac4272d90fac597 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2317888 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org>
* common: gyro_cal: Implement gyroscope calibrationYuval Peress2020-08-181-1/+1
| | | | | | | | | | | | | | Implement the calibration code for the gyroscope which is ported over from AOSP's https://android.googlesource.com/device/google/contexthub/+/refs/heads/master/firmware/os/algos/calibration/gyroscope/ BUG=b:138303429,b:137204366,chromium:1023858 TEST=Added unit tests BRANCH=None Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic1ab2efb66565cda0a96c9c06722136fb184df77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2244934 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* init_rom: Add init_rom layerKeith Short2020-08-131-1/+1
| | | | | | | | | | | | | | | | | | | Create a thin init_rom layer for accessing data objects linked into the .init_rom section with the CONFIG_CHIP_INIT_ROM_REGION opton and __init_rom attribute. BUG=b:160330682 BRANCH=none TEST=make buildall TEST=Using the next CL, verify BMI260 config data can be read using both memory mapped and indirect access. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I6cd311637e87cd10ac394ff75c4bfc16bbade3b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335739 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* ec: change usage of dummySam Hurst2020-08-051-4/+4
| | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "dummy" with inclusive alternatives. BUG=b:162781382 BRANCH=None TEST=make -j buildall `grep -ir dummy *` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6a42183d998e4db4bb61625f962867fda10722e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335737 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* ec_commands: Add host commands for regulator control.Pi-Hsun Shih2020-07-231-0/+1
| | | | | | | | | | | | BUG=b:149274957 TEST=build BRANCH=none Change-Id: I9c7b5dec7e2f66ab64750b48acd914a1c86dfd3d Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2247431 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* common: online_calibration: Add support for magnetometerYuval Peress2020-06-141-1/+2
| | | | | | | | | | | | Add support for magnetometers in online calibration. BRANCH=None BUG=b:138303797,chromium:1023858 TEST=Added new unit test Change-Id: I3a6dafb2f5fab9b11ac8bd3b53ae4976002d18cd Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2095519
* extpower: Add helper function extpower_handle_updateFurquan Shaikh2020-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a helper function extpower_handle_update() that performs all the necessary actions that need to be done on external power state change: 1. Call hook_notify with AC_CHANGE 2. Update memmap_batt_flags to update EC_BATT_FLAG_AC_PRESENT 3. Set host event for EC_HOST_EVENT_AC_CONNECTED or EC_HOST_EVENT_AC_DISCONNECTED. Step#2 above is important because it ensures that the memory map flag is correctly updated when host reads it. Before this change, it was observed that EC_BATT_FLAG_AC_PRESENT is updated only when static/dynamic battery information gets updated. This could result in host reading the wrong AC state if battery information did not update before host acts on the host event bit getting set for AC connect/disconnect. BUG=b:157752693 BRANCH=None TEST=Verified on trembyle that EC ASL routines read the correct state of AC present flag on receiving host event. Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: I077de1135320654f571e5cf87ced6f08cbf23876 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242353 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Auto-Submit: Furquan Shaikh <furquan@chromium.org>
* OCPC: Configure VSYS via secondary charger ICAseda Aboagye2020-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the bulk of the work in getting OCPC functional. Since the secondary charger IC cannot directly sense the current entering the battery, with OCPC, we recruit the EC to do this work instead. Essentially, VSYS needs to be chosen such that we induce the desired current in the battery while also accounting for losses in the system between the output of the secondary charger IC and the battery. To start, a board needs to define the following CONFIG_* option: CONFIG_OCPC_DEF_RBATT_MOHMS This should be at least the R_ds(on) resistance of the BFET and the series sense resistance. The board should also define CONFIG_OCPC. With the combined system resistance, we can calculate the VSYS required to induce the desired current. However, we will also use a PID control loop to help drive our VSYS target to what it should actually be accounting for our error. The PID constants were found by tuning on a waddledoo board. It remains to be seen whether or not these will differ on a board to board basis. BUG=b:148980016,b:147440290 BRANCH=None TEST=Enable on waddledoo, verify that we can charge the battery from the sub-board. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Icd323546836fe41fa1fcc7c3b6071d822663ed05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135964 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* driver: Add BMI260 basic driver supportChing-Kang Yen2020-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | Add BMI260 accel/gyro driver code. Be able to do initial configuration, start up sensor, config interrupt and fifo, perform calibration, and access the sensor data from AP. BRANCH=None BUG=b:146144827 TEST=make -j4 BOARD=volteer \ && flash_ec --image build/volteer/ec.bin --board volteer Then, check sensor data is available on DUT by "ectool motionsense". TEST=make buildall -j TEST=tast run ${IP} hardware.SensorRing Cq-Depend: chromium:2148802 Change-Id: I5124ee8359a74f98cfe8d26da640325f5e00cb15 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086534 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>