summaryrefslogtreecommitdiff
path: root/chip
Commit message (Collapse)AuthorAgeFilesLines
* include/compiler.h: Add generic macro for disabling compiler warningsTom Hughes2022-10-131-7/+3
| | | | | | | | | | | | | | These macros are easier to read and use than the underlying pragmas. BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I2f67cbb3f83230b7e1a6a4512471bbd2bec0498f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872552 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* tree: Remove CONFIG_SOFTWARE_PANICTom Hughes2022-10-123-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | It's always enabled in the core/<core>/core_config.h files. The following script demonstrates that it's enabled in all boards: for board in `make print-boards`; do make print-configs board="${board}" | grep -q CONFIG_SOFTWARE_PANIC if [ $? -ne 0 ]; then echo "${board} failed" exit 1 fi done BRANCH=none BUG=none TEST=make buildall Cq-Depend: chromium:3943248 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If683b244f17b48bedf3699f2b24e83b5ad6e849e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933255 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* chip/stm32: Remove self-assignmentTom Hughes2022-10-121-2/+2
| | | | | | | | | | | | | | | | | | | When building with clang it warns: chip/stm32/clock-stm32l4.c:400:9: error: explicitly assigning value of variable of type 'uint32_t' (aka 'unsigned int') to itself [-Werror,-Wself-assign] val = val; ~~~ ^ ~~~ BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=hyperdebug Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ie4fae7251747d27b96ed08c3ef166fddd5411b9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3947822 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* ish: add HOSTCMD task checkLi Feng2022-10-081-1/+2
| | | | | | | | | | | | | | | | | | | | | host_packet_receive() is defined when HOSTCMD task is enabled; so add a check of HOSTCMD; otherwise there is build error for board which doesn't enable HOSTCMD task. One of ISH solutions is to provide power management functionalities. It powers on ISH and puts it in deep sleep. HOSTCMD task is disabled in this case to avoid waking up ISH periodically. BUG=b:234136500 BRANCH=none TEST=build tglrvp_ish Signed-off-by: Li Feng <li1.feng@intel.com> Signed-off-by: Guangfu Hu <guangfu.hu@intel.com> Change-Id: I64cd6ad4d292847d477f08708ece4d41b4e94650 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3892628 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* ec: Don't declare forward decls as weakJeremy Bettis2022-10-072-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a function in a header is marked as weak (test_mockable), that tells the linker that it is ok for the symbol to be missing. We never want that. If a function implementation is marked as weak, that tells the linker it is ok to use a non-weak symbol instead of this one. This is what we want when we are trying to override functions. Remove all test_mockables from headers, except for one inline function that I wasn't sure what to do with. BRANCH=None BUG=None TEST=make -j$(nproc) runhosttests buildall && zmake build -a && \ ./twister -v -i --clobber LOW_COVERAGE_REASON=Added stub get_ap_reset_stats() for tests that don't care about that function, and it's always unused. Change-Id: Ic00a897131c93ef134544f26a8e368ce1f78a5de Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935720 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Tristan Honscheid <honscheid@google.com> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Tristan Honscheid <honscheid@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* mt_scp: Add support for mt8186 decoderYunfei Dong2022-09-305-0/+58
| | | | | | | | | | | | | | | | | | | | | | 1. Add vdec ipi service interface 2. Add supported capability 3. Add ectasklist for mt8186 lat architecture 4. Separate mt8186 and mt8183 using define 5. Fix venc and mdp build error when add mt8186 driver 6. Fix cros_license_check errors BRANCH=none BUG=b:218771968 TEST=build corsola_scp pass Signed-off-by: kyrie wu <kyrie.wu@mediatek.corp-partner.google.com> Signed-off-by: Mingjia Zhang <mingjia.zhang@mediatek.corp-partner.google.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Signed-off-by: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Change-Id: I9d458a8c92ee27366ae03c3386d5682f62f5693b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3379786 Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org> Commit-Queue: Hsin-Yi Wang <hsinyi@chromium.org>
* mt8195/mt_scp: enable av1 decoder driverXiaoyong Lu2022-09-301-1/+1
| | | | | | | | | | | | | | enable av1 decoder driver in mt8195 platform. BUG=b:205889935 TEST= av1/vp9/h264/vp8 fluster test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: Ie58827559cb144d7ef63545d3c4ff2bbb70db603 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3585271 Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-12481-481/+481
| | | | | | | | | | | | | | | 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: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* config: rename HOSTCMD_ESPI_* to HOST_INTERFACE_ESPI_*Michał Barnaś2022-09-096-22/+23
| | | | | | | | | | | | | | | Rename ESPI additional configs to match the name of base config that selects ESPI as HOST_INTERFACE. BUG=b:195416058 BRANCH=main TEST=zmake testall && make buildall Change-Id: I137449a1a58b1ea0d9794ebc0900e1b68413819d Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3291744 Reviewed-by: Sam Hurst <shurst@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* stm32f0.h: update number of channels per controllerJosie Nordrum2022-09-062-9/+10
| | | | | | | | | | | | | | | | | Define only channels valid for each chip. Remove reference to channel 7 when setting callbacks for DMA channels 4+. BRANCH=None BUG=b:233240524 TEST=make buildall -j Signed-off-by: Josie Nordrum <JosieNordrum@google.com> Change-Id: I0258498cc075817b7ee59963482bc6a391853a90 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3656369 Reviewed-by: Bobby Casey <bobbycasey@google.com> Commit-Queue: Josie Nordrum <josienordrum@google.com> Reviewed-by: Craig Hesling <hesling@chromium.org> Tested-by: Josie Nordrum <josienordrum@google.com>
* tree-wide: const-ify argv for console commandsCaveh Jalali2022-09-0145-64/+64
| | | | | | | | | | | | | | | | | | | | | | | This updates the API for console commands from "int cmd(int argc, char **argv)" to "int cmd(int argc, const char **argv)" which is more accurate and in line with common convention. BRANCH=none BUG=b:244387210 TEST="make buildall" passes TEST="zmake build -a" passes TEST="util/compare_build.sh -b all" passes TEST="./twister -v -T zephyr/test" passes Cq-Depend: chrome-internal:4960125 Cq-Depend: chrome-internal:4959932 Change-Id: I57de9f35b85b8f3c7119df36aefb2abf25d2625f Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3863941 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* mtk_scp: Enable I/D-cache for mt8186Allen-kh Cheng2022-08-261-2/+8
| | | | | | | | | | | | | | | | | | | 1. Enable cache mapping on scp boot. 2. Add interrupt disable/enable to prevent preempt when setting cache range. BRANCH=none BUG=b:218771968 TEST=Boot kukui scp and open cam ok make BOARD=corsola_scp -j ALLOW_CONFIG=1 Signed-off-by: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Change-Id: I8d586afc33cba55d388d553dd2a2fc2047089553 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853765 Commit-Queue: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org>
* mtk_scp: Enable uart1 for mt8186Allen-kh Cheng2022-08-261-0/+5
| | | | | | | | | | | | | | | | Enable uart1 for mt8186 scp. BRANCH=none BUG=b:218771968 TEST=Boot kukui scp and open cam ok make BOARD=corsola_scp -j ALLOW_CONFIG=1 Signed-off-by: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Change-Id: Ib53ed293764727b33fe4e4a49abce451724fc689 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853766 Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org> Commit-Queue: Hsin-Yi Wang <hsinyi@chromium.org>
* mtk_scp: Fix mt8186 clock issues for system suspendAllen-kh Cheng2022-08-264-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | | 1. We have to disable VREQ SEL in mt8186. Pmic Wrap will be unable to enter Eint Mode if this is not the case. 2. Change the name of the function from clock_init() to scp_enable_clock() and include the clock register setting for system suspension in clock_init(). 3. Restore the previous register values of the clock while measuring the ulpos 0/1 clock frequency. 4. Remove the unnecessary clock macro values BRANCH=none BUG=b:214978483 TEST=Boot kukui scp and open cam ok make BOARD=corsola_scp -j ALLOW_CONFIG=1 Signed-off-by: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Change-Id: I08a9ab68dd53aad90b68d885f0c13e7bc4e82706 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3853764 Reviewed-by: Hsin-Yi Wang <hsinyi@chromium.org> Commit-Queue: Hsin-Yi Wang <hsinyi@chromium.org>
* npcx: fan: Introduce CONFIG_FAN_BYPASS_SLOW_RESPONSE for slow response fanDevin Lu2022-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | CL:3539776 fine tune the fan control to avoid fan pwm is too aggressive for slow response fan. However, this fan control mechanism will affect normal response fan with another device. Add a new CONFIG_FAN_BYPASS_SLOW_RESPONSE for option. BUG=b:237237424 BRANCH=none TEST=On Redrix. Test FAN is working with expected rpm while startup. TEST=make buildall Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I9c5388dbfe983b9a5f37f7bcb9217e92eab833ba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3840993 Tested-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Devin Lu <devin.lu@quantatw.com> Reviewed-by: CH Lin <chlin56@nuvoton.com>
* chip: npcx: fix the format of NPCX_ALT_TABLE in gpio_chip-npcx5.hJun Lin2022-08-191-72/+72
| | | | | | | | | | | | | | | | | | The format of the table NPCX_ALT_TABLE in gpio_chip-npcx5.h is messed up after applying clang-format. This CL changes it back to the original layout for better reading. Also, surround the table with /* clang-format off */ and /* clang-format on */ to pass CQ check. BRANCH=none BUG=none TEST=pass "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ic6efe9bbc83575ea172af84f92e5f07f714400d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826716 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com>
* chip: npcx: fix the format of NPCX_ALT_TABLE in gpio_chip-npcx7.hJun Lin2022-08-191-93/+93
| | | | | | | | | | | | | | | | | | The format of the table NPCX_ALT_TABLE in gpio_chip-npcx7.h is messed up after applying clang-format. This CL changes it back to the original layout for better reading. Also, surround the table with /* clang-format off */ and /* clang-format on */ to pass CQ check. BRANCH=none BUG=none TEST=pass "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I7e4533517f2615fbeb3512f7f7eddfaf22160355 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826715 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com>
* chip: npcx: fix the format of NPCX_ALT_TABLE in gpio_chip-npcx9.hJun Lin2022-08-191-92/+92
| | | | | | | | | | | | | | | | | | The format of the table NPCX_ALT_TABLE in gpio_chip-npcx9.h is messed up after applying clang-format. This CL changes it back to the original layout for better reading. Also, surround the table with /* clang-format off */ and /* clang-format on */ to pass CQ check. BRANCH=none BUG=none TEST=pass "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Iba7e55280319ed71ecc6019549f73b4bdb49554c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826714 Tested-by: CH Lin <chlin56@nuvoton.com> Commit-Queue: CH Lin <chlin56@nuvoton.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* npcx/fan: Fix mft_set_apb1_prescaler descriptionCaveh Jalali2022-08-171-1/+1
| | | | | | | | | | | | | | This fixes the description of mft_set_apb1_prescaler(). BUG=none BRANCH=none TEST=buildall passes Change-Id: Ia683f0d004021e62bba322440c5562c0940a4e79 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3833922 Commit-Queue: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* chip/mt_scp: remove gpio configurationTinghan Shen2022-08-163-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UART console is mainly for debug purpose. Remove it to prevent malicious usage of this interface. If required, a user can configure the pin mux by kernel dts. Take mt8195 as an example to enable the SCP UART in dts, scp_pins: scp { pins_scp_vreq { pinmux = <PINMUX_GPIO76__FUNC_SCP_VREQ_VAO>; bias-disable; input-enable; }; + + pins_uart { + pinmux = <PINMUX_GPIO102__FUNC_TP_UTXD1_AO>, + <PINMUX_GPIO103__FUNC_TP_URXD1_AO>; + bias-pull-up; + }; }; BUG=none TEST=boot cherry scp ok. scp boot log still records in /var/log/cros_scp.log Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> Change-Id: I37bc65b47e7423e9def5a399ba7ceb2761dc9615 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791283 Tested-by: TingHan Shen <tinghan.shen@mediatek.corp-partner.google.com> Reviewed-by: Wei-Shun Chang <weishunc@chromium.org> Commit-Queue: Wei-Shun Chang <weishunc@chromium.org>
* util: remove unused includesYuval Peress2022-08-0549-1/+51
| | | | | | | | | | | | | | | | Remove these includes as they're not needed in this header. Instead, the includes should go where they're actually being used. BRANCH=none BUG=b:240574048 TEST=make buildall -j TEST=zmake build -a Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I64b10af3216654b2a20caa1cabd267661a0bca39 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791980 Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com>
* chip/mt_scp: add define to support av1 decoderXiaoyong Lu2022-08-031-0/+1
| | | | | | | | | | | | | | | Add define to support av1 decoder in scp: VDEC_CAP_AV1_FRAME BIT(11) BUG=b:205889935 TEST= av1/vp9/h264/vp8 fluster test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: I29de57ae4cb15fee30b2082c688ff446c2360fea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771327 Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
* ec: Switch black to 80 cols and reformat filesJeremy Bettis2022-07-265-37/+151
| | | | | | | | | | | | | | | | | | | | Add pyproject.toml config file to set black to 80 columns. Remove column length overrides from other config files. Reformat python files to 80 cols. BRANCH=None BUG=b:238434058 TEST=presubmit/CQ Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I870a68f1bb751f4bad97024045f6e3075489e80f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3764071 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* mt8195/mt_scp: enable mt8195 inner racing modeXiaoyong Lu2022-07-221-2/+2
| | | | | | | | | | | | | | enable inner racing mode in mt8195 platform. BUG=b:209531198 TEST=cts/gts test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Change-Id: Ie58827559cb144d7ef63545d3c4ff2bbb70db609 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3261922 Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
* chip/mt_scp: add define to support inner racing modeXiaoyong Lu2022-07-201-0/+1
| | | | | | | | | | | | | | | | Add define to support inner racing in scp: VDEC_CAP_INNER_RACING BIT(17). BUG=b:209531198 TEST=cts/gts test pass Signed-off-by: Xiaoyong Lu <xiaoyong.lu@mediatek.corp-partner.google.com> Change-Id: I292645a7d976c7a88fae831ae38cd47dad1c7aaa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3771682 Tested-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Commit-Queue: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Yunfei Dong <yunfei.dong@mediatek.corp-partner.google.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
* tree: Remove non-standard "%ph" printf formatTom Hughes2022-07-192-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The non-standard "%ph" format is replaced with snprintf_hex_buffer and then using "%s" to print the resulting buffer. Using standard format specifiers makes it easier to switch between the "builtin" EC standard library and the C standard library provided by the toolchain (or Zephyr). BRANCH=none BUG=b:238433667, b:234181908 TEST=Enable CONFIG_CMD_RAND in nocturne_fp/board.h On icetower v0.1 with servo_micro and J-Trace: Before change: > rand rand 8ab8b15090ca5ae83bdad671c906d51a5f2b98a359a4106054ee6b54a4087190 After change: > rand rand 2a8645235a31936a28b8d1b9c4948f46d39662e7fcb10a185ddb14c6a998e2eb Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3bff928d32579440d7cdb27a75899e45159accfb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3759123 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* ec: Fix some bad formatting and warningsJeremy Bettis2022-07-135-70/+16
| | | | | | | | | | | | | | | | | | | | The black formatting revealed some odd formatting. Fixed all errors from cros lint. find . \( -path ./private -prune \) -o -name '*.py' -print | \ xargs cros lint -v |& grep ": E" BRANCH=None BUG=b:238434058 TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ia1d2e9cfb0cd2b7000d15b3b918d24881987673e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749249 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* tree: Check return value from snprintfTom Hughes2022-07-131-4/+10
| | | | | | | | | | | | | | snprintf returns a negative value on failure. The return value should be checked to make sure that there were no errors. BRANCH=none BUG=b:238433667, b:234181908 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I64e2e69df7fa22c94f19acbbca8c6afbe6cf1ff1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3756174 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* ec: Format all python files with black and isortJeremy Bettis2022-07-125-1689/+2140
| | | | | | | | | | | | | | | | | | | find . \( -path ./private -prune \) -o -name '*.py' -print | xargs black find . \( -path ./private -prune \) -o -name '*.py' -print | xargs ~/chromiumos/chromite/scripts/isort --settings-file=.isort.cfg BRANCH=None BUG=b:238434058 TEST=None Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I63462d6f15d1eaf3db84eb20d1404ee976be8382 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749242 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tree: Fix -Wstrict-prototypes warningTom Hughes2022-07-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | The latest clang complains about missing 'void' in function definition if it's specified in the declaration: core/cortex-m/vecttable.c:23:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] void default_handler() ^ void BRANCH=none BUG=b:230345382, b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5a3d95203cc6cbb59676f4a66876a4a6f2946e31 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3750108 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* chip/stm32/registers-stm32l.h: Format with clang-formatJack Rosenthal2022-07-071-580/+566
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Idcf30bc6916b729321e183a5d43e16afb6e2c12e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729533 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/registers-stm32h7.h: Format with clang-formatJack Rosenthal2022-07-071-801/+789
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I6336557f0869f177d1df82651b21f76d7f6a6e9b Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729532 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/registers.h: Format with clang-formatJack Rosenthal2022-07-071-327/+322
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Ic76151cfe4fd7b211b9a065befe67224bb8d6d64 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729535 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* tree: Move stdlib implementation to builtin directoryTom Hughes2022-07-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keeping all of the standard library implementation in a single directory makes it easier to choose between EC's implementation or the implementation from the toolchain. BRANCH=none BUG=b:234181908, b:172020503 TEST=make buildall -j TEST=Using icetower v0.1, Segger J-Trace, and servo micro: ./test/run_device_tests.py -b dartmonkey Test "aes": PASSED Test "cec": PASSED Test "cortexm_fpu": PASSED Test "crc": PASSED Test "flash_physical": PASSED Test "flash_write_protect": PASSED Test "fpsensor_hw": PASSED Test "fpsensor_spi_ro": PASSED Test "fpsensor_spi_rw": PASSED Test "fpsensor_uart_ro": PASSED Test "fpsensor_uart_rw": PASSED Test "mpu_ro": PASSED Test "mpu_rw": PASSED Test "mutex": PASSED Test "pingpong": PASSED Test "printf": PASSED Test "queue": PASSED Test "rollback_region0": PASSED Test "rollback_region1": PASSED Test "rollback_entropy": PASSED Test "rtc": PASSED Test "sha256": PASSED Test "sha256_unrolled": PASSED Test "static_if": PASSED Test "system_is_locked_wp_on": PASSED Test "system_is_locked_wp_off": PASSED Test "timer_dos": PASSED Test "utils": PASSED Test "utils_str": PASSED Test "panic_data_dartmonkey_v2.0.2887": PASSED Test "panic_data_nocturne_fp_v2.2.64": PASSED Test "panic_data_nami_fp_v2.2.144": PASSED Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I75f8591e87a9076d47208eb598186a391c77966d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3724488 Reviewed-by: Edward Hill <ecgh@chromium.org>
* chip/npcx/gpio_chip-npcx5.h: Format with clang-formatJack Rosenthal2022-07-071-71/+71
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Id46ebca41fb1bd943277f5b037eefe2cfb45a804 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749457 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/uart_regs.h: Format with clang-formatJack Rosenthal2022-07-071-158/+190
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I0dd604a8b62416a5b57708f9656bbbf9fd2b2e6a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749435 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/pwrseq_regs.h: Format with clang-formatJack Rosenthal2022-07-071-27/+32
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I9b49beabcc3114cee29d67177e94a45466b77922 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749433 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/npcx/gpio_chip-npcx7.h: Format with clang-formatJack Rosenthal2022-07-071-104/+110
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Iff535c58706ca8599e114c9af4ed53c44235effa Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749458 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/wdt_regs.h: Format with clang-formatJack Rosenthal2022-07-071-44/+54
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Ie06213a30b4102ea2b657b6c0e6ecc2b9bd19db9 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749456 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/ish/dma.c: Format with clang-formatJack Rosenthal2022-07-071-4/+5
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I04972bcbdc517b7f4c2e7c1a5ca4bc571c517704 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749428 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/npcx/gpio_chip-npcx9.h: Format with clang-formatJack Rosenthal2022-07-071-101/+106
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I27900d570c33c9413c25eb91ac66b3f339ab153c Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749459 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/registers-stm32f4.h: Format with clang-formatJack Rosenthal2022-07-071-2/+3
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I8bf57a3d4c493e5b2db0bee9b346892e359712cf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749462 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/usart-stm32l5.c: Format with clang-formatJack Rosenthal2022-07-071-5/+5
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I5d2cc33dd442535ebf84e316993c4bd6b67950ed Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749464 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/flc_regs.h: Format with clang-formatJack Rosenthal2022-07-071-41/+50
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Ic1a8f9d3a3a03e274d2bc88c402fc30f103ee59e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749430 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/tmr_regs.h: Format with clang-formatJack Rosenthal2022-07-071-50/+62
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I85905dc45d29bf481827a4547e4bc492f9784004 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749434 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/hwtimer32.c: Format with clang-formatJack Rosenthal2022-07-071-5/+6
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I085e9b74837d56664bccd0135cbea052ecce5d77 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749461 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/gpio_regs.h: Format with clang-formatJack Rosenthal2022-07-071-70/+86
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I93f395b8ceab89475b2af7956cb32a40dcd9fbed Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749432 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/max32660/gcr_regs.h: Format with clang-formatJack Rosenthal2022-07-071-606/+735
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I8c6682ee73a7e6b69ccd568d43f8decebe8a264d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749431 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/stm32/hwtimer.c: Format with clang-formatJack Rosenthal2022-07-071-5/+6
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I2c84c1f8477b5299b3c398722eefa7a3c8dea709 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749460 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* chip/it83xx/config_chip_it8xxx2.h: Format with clang-formatJack Rosenthal2022-07-071-2/+3
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: I759eeec588d8bbbd8edec6aff61576ea753aafa0 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749429 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>