| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In v2.7, the gp register was removed from the data collected during a
fatal error. See this PR for more details:
https://github.com/zephyrproject-rtos/zephyr/pull/36235
Since that PR implies gp has no useful value, let's just drop it from
the panic data.
BUG=b:198824039
BRANCH=none
TEST=build with Zephyr main branch for hayato
note: still fails at link step due to missing symbol
"_image_rom_size"
Change-Id: Ia917d50c193fd2e493612a6d2dd6c0c6d92a1e6b
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160405
Commit-Queue: Keith Short <keithshort@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the I2C initialization to compile time, saving a modest amount of
RAM space
BUG=b:199328071
BRANCH=none
TEST=zmake testall
TEST=boot Zephyr on Herobrine.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I9d324eedca25666bcce1928b069918a357cf6081
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3158973
Commit-Queue: Yuval Peress <peress@google.com>
Reviewed-by: Yuval Peress <peress@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Zephyr does not use the GPIO based I2C recovery. Delete
i2c_get_line_levels() and I2C_CONFIG_GPIO() as these symbols are no
longer referenced.
Move a the DT_NODE_EXISTS to the top of the file as the named-i2c-ports
node is need throughout this file.
BUG=none
BRANCH=none
TEST=zmake testall
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I62cec339b448b78d1e9ca150227f604f23af32f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3158972
Commit-Queue: Yuval Peress <peress@google.com>
Reviewed-by: Yuval Peress <peress@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current initial stage couldn't use the kernel delay function. Use
CPU nop instruction to wait for the external reset from H1.
BUG=b:182875520
BRANCH=none
TEST=Enable CONFIG_BOARD_RESET_AFTER_POWER_ON for evb & toggle GPIO.
Check the delay is 2 seconds.
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: If221181358c2a4df758d5bb9b57c3fbba31100aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3143633
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The APIs of BBRAM read and write have been renamed and moved to
drivers/bbram. The related call routines of shim/system.c need to
be fixed.
BUG=b:195843756
BRANCH=none
TEST=the board of asurada and it8xxx2_evb can boot EC and
access bbram successfully after adding this CL.
zmake testall --> pass
Change-Id: I98e51a278a24eeb4bbc92343fe6fc97e3e758e8a
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3153117
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set up the pwm_leds data from the device tree, gets rid of most static
map defines and sets CONFIG_LED_PWM_COUNT automatically.
BRANCH=none
BUG=b:177452529
TEST=build and run on volteer
TEST=compared the built up pwm_leds structure with gdb
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: Ib41faf86ae018f5a1ed8a1c96c4b6ec081e175d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3154256
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add EC root directory to include directories list and
fix include directive in kx022 driver info file.
BRANCH=main
BUG=b:194424288
TEST=Compilation for lazor should work correctly.
Change-Id: I1312b4cac8695e61936b9635c7a59c2f59907502
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3129961
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
k_work_reschedule will reschedule a work item if it's already been
scheduled. Switching from k_work_schedule to k_work_reschedule fixes
us the hooks test snag we saw during the v2.6 uprev.
BUG=b:195971523
BRANCH=none
TEST=zmake testall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I66f6bbad1cd39847e68a178165c9c59922abbb7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144378
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Zephyr v2.7, DT_ENUM_TOKEN is deprecated in favor of
DT_STRING_TOKEN. Additionally, DT_ENUM_UPPER_TOKEN is deprecated in
favor of DT_STRING_UPPER_TOKEN.
See the v2.7 release notes for details:
https://docs.zephyrproject.org/latest/releases/release-notes-2.7.html
Since we backported the DT_STRING_* macros to our v2.6 branch, let's
switch to them ahead of time to prepare for the v2.7 uprev.
Note: the DT_STRING_* macros are compatible with Zephyr's device tree
enums, but also allow non-enum properties to be used in the same
fashion. This commit does the bare minimum for compatibility with
v2.7, i.e., just swap the macros without dropping enum properties
anywhere. We should investigate whether we want to continue using the
enum properties or abandon some of them for any string in the future.
BUG=b:198824039
BRANCH=none
TEST=zmake testall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I1efd8f99bc7d93504c0ab94510406cd36ad24cd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144536
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Zephyr 2.7+, CONFIG_UART_SHELL_ON_DEV_NAME is removed in favor of
using the zephyr,shell-uart device chosen by the UART driver. Since
we choose zephyr,shell-uart on all of our boards, we are clear to make
this change ahead of the v2.7 uprev.
Also see https://github.com/zephyrproject-rtos/zephyr/pull/37902.
BUG=b:198824039
BRANCH=none
TEST=zmake testall
TEST=compile posix-ec with v2.7_rc1
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Ic066ce0617fa900ae7c1c96a2cbece0b698764bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3142750
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds possibility to define board's batteries in device
tree. Default battery is defined by adding "default_battery" as node's
label.
It also adds common batteries definitions that can be used using
compatible string.
If no 'batteries' node is defined in device tree, custom board's
logic must be used and old "named-batteries" should be defined.
BRANCH=main
BUG=b:183544739
TEST=This commit shouldn't change behaviour of any build.
Compiling and flashing CrOS EC and Zephyr should
work without problems.
Change-Id: I94f0121f45eb061f1358fadbcd7d8006c08b0bea
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3107385
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Code calling task_get_current() requires to return from this function
valid task ID. To test this code, new TASK_ID_TEST_RUNNER is introduced.
Test can set current thread as test runner and guarantee that
task_get_current() return valid task ID.
BUG=b:184856919
BRANCH=none
TEST=none
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: Id5470e5337ab2419aad07f0f22de5f1576e870c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3110086
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Verify that we can call host commands from driver tests by adding a test
that calls the EC_CMD_GET_PROTOCOL_INFO host command. Add a few
convenience functions to host_command.h when building with CONFIG_ZTEST
enabled. Also, add eSPI emulator to support the test.
Coverage:
- lines 17.4% -> 17.8%
- functions 21.4% -> 22.0%
BRANCH=none
BUG=b:189954415
TEST=zmake configure --test zephyr/test/drivers
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Ib9e750eeab555ea629a560cbf3beed28e346c460
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3031842
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the CONFIG_ADC_CHANNELS_RUNTIME_CONFIG config option to allow
the adc_channels array to be tweaked at runtime.
BRANCH=none
BUG=b:183452273,b:181271666
TEST=buildall passes
Change-Id: I1241012b6e36c19baa7fe80853a6c6de4affeefa
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116990
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current API for system_get_scratchpad mixes the status and the value
being read. Update the signature to allow both.
BRANCH=none
BUG=b:195481980
TEST=make testall && zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I3a5f5ad523d507c53a5d474806f58afafb82e70c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3074828
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for disabling the console command help strings.
With CONFIG_SHELL_HELP=n, 2000 bytes saved on Volteer
BUG=none
BRANCH=none
TEST=zmake testall
TEST=Verify console on Volteer with and without CONFIG_SHELL_HELP
enabled.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I2186828f28691182f673851ac27d207b4a4a6f44
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093492
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the console command shim to pass in a struct, reducing the amount
of duplicated code.
This change saves 500 bytes on Volteer
BUG=none
BRANCH=none
TEST=zmake testall
TEST=verify console on Volteer
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I2da374b9a3b3b78a3e7b66d5c31f4ed2131aef01
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093491
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, functions for reading board version and sku id were defined
in board.c files which are not compiled in Zephyr builds.
Logic from board.c files should be moved to the DeviceTree files.
This commit adds support for defining board version and sku id
pins and numeral system used to decode them.
BRANCH=main
BUG=b:194136536
TEST=Call system_get_sku_id and system_get_board_version
on CrOS EC and Zephyr, values should be correct and
the same on both versions
Change-Id: I61b5e205cb2a2299ad86c5dff38c05a9659eb2d3
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3048102
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for switchcap definition in device tree.
It will allow to remove board specific files which implemented
the switchcap functionalities. This will unify the logic between
different board in zephyr.
BRANCH=main
BUG=b:194211207
TEST=Use linked TEST commits to see example of definitions for lazor
Use GPIO or LN9310 version, build and flash to lazor.
Board should be able to boot correctly.
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Change-Id: Ib80a73dcb2db95e2dcf48e33f876a39246fd506a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3085670
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=none
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Iab1f8a1274e94491590697ad1efffdca46cb8e4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088235
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DT_DRV_COMPAT doesn't have the compatible node. Fix it to use
cros_keyscan.
BRANCH=none
BUG=none
TEST=zmake testall
TEST=check volteer & lazor key by "ksstate on"
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: Ib1280f64ac2fa42539fb93d24922626c9adf2278
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3088960
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We no longer support version 2.5. Drop these obsolete ifdefs.
BUG=b:195571108
BRANCH=none
TEST=zmake testall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I85985108bcf175a2756a2f8096b0aa9e3c22fce5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3086368
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some devices are not able to output fast enough
using shell_fprintf and they timeout unrelated
functionality. For this case it will be allowed
to use a define CONFIG_PLATFORM_EC_CONSOLE_USES_PRINTK
to force zephyr_print to use printk
BUG=b:193585176
BRANCH=none
TEST=zmake configure -b $PROJ_HAYATO
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I8a08fc730637e1d9e2b612b877572fac235a4be4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3082328
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create devicetree node to specify the keyscan runtime parameters.
BUG=b:195945894
BRANCH=none
TEST=zmake testall
TEST=verify keyboard on Volteer with next CL
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I4dbf5e4f2205f31651d33b6ffc1ecd1dd6696795
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3083721
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reimplement the hooks shim code using Zephyr iterable sections. Keep the
existing hook_registry based structure, gets rid of the per-hook init
functions and instead initializes all the list nodes from a single init
call.
BRANCH=none
BUG=b:195521227
TEST=build and run on volteer
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: Ic166d214ee1dcd1431ec484e5014cb297f7fb8c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069399
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rewrite the MKBP events shim using iterable sections.
BRANCH=none
BUG=b:195521227
TEST=build and run on volteer
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: Ia96fb9ec06b1a86b1be293209db317a361ae4741
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3069398
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rewrite the host command shim using Zephyr iterable sections. This
allows initializing the HC structure statically and gets rid of the
runtime init code entirely.
BRANCH=none
BUG=b:195521227
TEST=build and run on volteer
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: I94a55f8eb3e1d58de6a1d93c31b6170a5541a1fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3010284
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This routine is needed when enable CONFIG_HOST_COMMAND_STATUS.
This routine allows the caller to customize its actions, depending on
whether it is a thread or an ISR.
BUG=b:195342437
BRANCH=none
TEST=zmake testall
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: Id2a948c67de81fbc8ee161e5711cff17b8ac359d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3070941
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NPCX & IT8xxx2 series are both use BBRAM for scratchpad/reset_flags
access. cros_bbram API already handles the chip-specific code. This CL
moves scratchpad/reset_flags access functions to the common system.c to
avoid duplicate those functions.
BUG=none
BRANCH=none
TEST=zmake testall
TEST=check reset cause on lazor & npcx_evb
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: I0a394e5fbf784ec2e3caea77f194c88ae9d5542e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3067156
Reviewed-by: Yuval Peress <peress@chromium.org>
Commit-Queue: Yuval Peress <peress@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow building the zephyr/shim/src/espi.c for other SOCs by adding
inline functions to abstract away these concepts. Each SOC should
then implement these under the zephyr/shim/chip/<soc> specific
directory.
BRANCH=none
BUG=b:189954415
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I776bd65326b509ada3b271177ae727a32d4f96da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3044400
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure the whole UART buffer/fifo is flushed in the uart_flush_output
function by checking the interrupt state.
The shell_process function only passes data from shell layer to the
shell_trasport layer(UART) which has its own buffers.
The bug was impacting e.g. hibernating.
BUG=b:191724484, b:193482737
BRANCH=none
TEST=Verify the console output and hibernate works
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Iaf245809be57fdba69c6a5a69d394f024ccf60ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3024264
Reviewed-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement panic register print for rv32i. This lets us see the
registers after a crash, which is very useful for debugging.
BUG=b:193552648
BRANCH=none
TEST=got a crash, see this on UART:
Fatal error: 0
ra = 0x80005864
gp = 0x8010D3C0
tp = 0x00000000
a0 = 0x00000000
a1 = 0x00000000
a2 = 0x00000000
a3 = 0x00000000
a4 = 0x80107FC0
a5 = 0x00000500
a6 = 0x00000000
a7 = 0xAAAAAAAA
t0 = 0x00000000
t1 = 0x8010D298
t2 = 0x435F4450
t3 = 0x00000030
t4 = 0x00000000
t5 = 0x00000000
t6 = 0x00000000
mepc = 0xFFFFFFF4
mstatus = 0x00001880
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I5b91276d274f5792ff6b9136adc319d03ed6dbb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3024958
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a signal_is_gpio to have the system compile with
CONFIG_ASSERT=y. The function is used to check if the line is SoC
GPIO, but there's no platform with that setup right now, so just
returning true for the moment.
BRANCH=none
BUG=none
TEST=build and run on volteer with asserts enabled
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change-Id: I41d3c11d0915ce5b6e888d7152fb3c3bdc43d054
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3017986
Reviewed-by: Yuval Peress <peress@chromium.org>
Commit-Queue: Yuval Peress <peress@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reimplement the printf functions for Zephyr to use shell_* functions
instead of printk.
The main differences are:
-UART output is buffered by the shell layer. The size of the buffer
should be adjusted per board (SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE)
-The shell uses non-blocking UART FIFO operations while printk waits
actively for every sent byte.
-The shell prints can not be split by the other shell prints so it
should increase the quality of the output. However the shell_* functions
can not be used in interrupts, so use printk instead which can divide
the shell output. The output may be messy for boards that have a lot
of prints in interrupts e.g. volteer.
EC uses unusual print format e.g. "%pT" to print a timestamp, so use the
CrosEC's vfnprintf function and then pass the generated string to the
shell_* print. Use the sprintf function for that purpose.
Long term, the EC codebase should switch to a usual print format,
so shell_* can be used directly and not 2 versions of vfnprintf.
This change should also help to pass tests that wait for a certain
pattern on output e.g. ECBootTime.
BUG=b:191724484, b:178033156
BRANCH=none
TEST=Verify the console output works
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ifaed2093ab8c43038c7d3e0ded1449a93f7f7da5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2988194
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Copy gpio_get_ternary() and binary_first_base3_from_bits()
to zephyr.
BRANCH=None
BUG=b:186264627
TEST=zmake testall
Change-Id: I7086668a33da095132dbccae0f41264b59b1b20e
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015243
Tested-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If CONFIG_LOG is enabled we can let the default handler print the panic
information. It is much more detailed.
BRANCH=none
BUG=b:180422087
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Idefa9992aad7d69b8aa01394a5b509e592809e8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3015239
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement irq functions for tasks.
BRANCH=none
BUG=b:190203712
TEST=can zmake hayato and it8xxx2_evb
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
Change-Id: Ic35ed656f10a1b24543145421843b540a6cbc5a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2988744
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow passing a whole string to the console buffer, which is sent to
host.
This should speed up printing because a mutex doesn't have to be locked
for every char separately.
BUG=b:191724484
BRANCH=none
TEST=Make sure buffering of console to host works with the
'ectool console' command
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I5b081984bfa4f930ad4729b19975b1c2eb4bbd18
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2988193
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move NPCX specific code crec_flash_physical_get_protect(),
crec_flash_physical_get_protect_flags(),
crec_flash_physical_protect_at_boot(), and
crec_flash_physical_protect_now() from shim/flash.c to
cros_flash/cros_flash_npcx.c.
BUG=b:187192628
BRANCH=none
TEST=zmake -lDEBUG configure -b -B zephyr/build_volteer \
zephyr/projects/volteer/volteer/
Cq-Depend: chromium:2994430
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: Id6ed382ad4578969838339c9eb874b323390c485
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2891674
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move NPCX specific code flash_dev_init(), crec_flash_physical_write()
and crec_flash_physical_erase() from shim/flash.c to
cros_flash/cros_flash_npcx.c.
BUG=b:187192628
BRANCH=none
TEST=none
Cq-Depend: chromium:2994429
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: I094e26c5b670402872a665ba4d24a6594f7ca77e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994430
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the flash protection routines flash_get_status1() through
flash_write_prot_reg() from shim/flash.c to
cros_flash/cros_flash_npcx.c.
BUG=b:187192628
BRANCH=none
TEST=none
Cq-Depend: chromium:2891674
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Change-Id: Iaca3a32cfb35a77df10b87745bdabc1ed1cd3c40
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2994429
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Logs in /var/log/cros_ec.log contained many duplicate entries. This was
caused by not moving the actual head pointer when reading from the
buffer.
BRANCH=none
BUG=b:180423400
TEST=Flash lazor and observe /var/log/cros_ec.log
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I7951d2fc3e6f13a5d6aebcf0b347238bcb790973
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2995713
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Zephyr deferred calls are run in k_sys_work_queue context instead of
thread running hook_task(). Because of that shimmed task_get_current() is
modfied to return TASK_ID_HOOKS if run from k_sys_work_queue context.
BUG=b:190727776
TEST=make hosttest
BRANCH=none
Signed-off-by: Tomasz Michalec <tm@semihalf.com>
Change-Id: I9e15627df8dce6b0829ad872150cbe2318330f28
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953225
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert few device_get_binding based on DT_PROP_BY_PHANDLE to
DEVICE_DT_GET.
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: Ib8feee8de759481b833010be815cdeb8178f3710
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985464
Reviewed-by: Yuval Peress <peress@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert various device_get_binding to DEVICE_DT_GET, which is processed
at link time and more efficient. Same pattern on different modules where
the output is checked using device_is_ready.
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: If426420da2c61b3bc02eb77e122469a1a40799f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985463
Reviewed-by: Yuval Peress <peress@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update deferred work API calls to work with v2.6. Currently, these
will give warnings, but most of these have been replaced completely
in upstream Zephyr's main branch.
BRANCH=none
BUG=b:190731415
TEST=zmake configure -b zephyr/projects/trogodr/lazor
Change-Id: I99e71089439656a8a45ff35ce489e21ad60f2143
Signed-off-by: Yuval Peress <peress@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2980433
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpio_pin_interrupt_configure() without interrupt flag generates the
assert. Change to use gpio_pin_configure().
BUG=b:190731415
BRANCH=none
TEST=Lazor boot to OS screen
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: I2e4b816ba52a8746bb694ad55d551b427868302a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2977861
Reviewed-by: Yuval Peress <peress@chromium.org>
Commit-Queue: Yuval Peress <peress@chromium.org>
|