| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds the system.h/system.c shim layer to import jump data
passing between images.
BRANCH=none
BUG=b:167392037
TEST=Added tests in zephyr-chrome/tests/
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I8c6ae2cf579be063c5b3f7219c440aadad3eefa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2491430
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Zephyr provides definitions for these macros. Guard them away in the
preprocessor so we don't get warnings about duplicate definitions.
BUG=b:167590251
BRANCH=none
TEST=no warnings in follow-up CLs
Change-Id: If2ccb23878ee6cdffa004f95562ea6a24350e063
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427094
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we are using Zephyr headers and EC sources together, we need to
make an IS_ENABLED macro which is compatible with both the Zephyr
concept of being enabled, and the CrOS EC concept (since we inherit
many default options from config.h).
The Zephyr concept of being enabled is defined, specifically only to
the token "1". The CrOS EC concept of being enabled is defined,
specifically to no tokens. Thus a macro which allows both concepts
defines "enabled" as defined, either to no tokens, or the token "1".
BUG=b:167590251
BRANCH=none
TEST=compile common/timer.c in follow-up CLs
Change-Id: Ieded05e65d0d7c27070f40ef1dd4d24db73b9de4
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427093
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EC images are copied in full from flash to RAM. When the code RAM size
is smaller than 1/2 the flash size, the EC image size is limited to the
code RAM size, leaving unused flash space.
Create a new linker section .init_rom used to store data objects that
are single use in the previously unused flash area. Data objects can be
used at runtime by copying into RAM using the flash_read() function.
This change is tied to the NPCX flash layout, with asserts to ensure
builds fail if the CONFIG_CHIP_INIT_ROM_REGION is not supported by
the chip.
CLs that enable CONFIG_CHIP_INIT_ROM_REGION should not be merged until
the predecessor CL:2325764 is available in CPFE images.
BUG=b:160330682
BRANCH=none
TEST=make buildall
TEST=With debug code, use the _init_rom macro and validate the data can
be read using flash_read().
TEST=Using hex editor, verify .init_rom section located at 192K boundary
and unused bytes are filled with 0xFF.
TEST=compare_build.sh passes when run against waddledoo (npcx, cortex-m)
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: Ia0785798fd1938ad6a1c254a070b219027ee82a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311268
Reviewed-by: caveh jalali <caveh@chromium.org>
Commit-Queue: caveh jalali <caveh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the __override symbol markers before the config.h include so that
these markers can be used in baseboard.h and board.h
BUG=none
BRANCH=none
TEST=make buildall
Change-Id: I99f99d6ba1431cd2bd48207c5bc189d178a04d5d
Signed-off-by: Keith Short <keithshort@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2138145
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For functions which should only be used in test builds, this lets us
add __test_only to the prototype, causing an error if used outside of
tests.
Example error output:
test.c: In function ‘main’:
test.c:17:5: error: call to ‘foo’ declared with attribute error:
This function should only be used by tests
foo();
^~~~~
This will not cause errors if the usage is guarded by a disabled
IS_ENABLED (or any other form of optimized-away branch).
BUG=none
BRANCH=none
TEST=see above
Change-Id: I64115fd9e7940de9b10063a46548e8d00033d1d3
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1872962
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The clang compiler is used by the fuzz tests, and while clang does not
have support for the error attribute in GCC, we can do our best to
make sure that errors are raised on clang where appropriate by placing
functions defined with __error in the special section "/DISCARD/",
which the linker discards.
An error like below is shown when compiling in clang:
`foo' referenced in section `.text' of foo.o:
defined in discarded section `/DISCARD/' of /tmp/foo.o
BUG=none
BRANCH=none
TEST=see above error output when __error is used on clang
Change-Id: Id58131578f67b9dff7e58e5df58b3509d6046138
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1874382
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A `UINT32_FROM_BYTE_ARRAY_BE` macro would be good to have for
https://crrev.com/i/1898937, and since it seems there are use cases for
for a little-endian variant of that and a big-endian variant for
uint16_t, add those as well.
BRANCH=none
BUG=none
TEST=Add the following host command somewhere and manually verify the
results:
static int command_macro_test(int argc, char **argv)
{
uint8_t bytes[] = { 0x01, 0x23, 0x45, 0x67 };
CPRINTF("Bytes (all hex): %02X, %02X, %02X, %02X\n",
bytes[0], bytes[1], bytes[2], bytes[3]);
CPRINTF("16 bits (using first two bytes of array):\n");
CPRINTF("UINT16_FROM_BYTE_ARRAY_LE(bytes, 0): %04X\n",
UINT16_FROM_BYTE_ARRAY_LE(bytes, 0));
CPRINTF("UINT16_FROM_BYTE_ARRAY_BE(bytes, 0): %04X\n",
UINT16_FROM_BYTE_ARRAY_BE(bytes, 0));
CPRINTF("32 bits:\n");
CPRINTF("UINT32_FROM_BYTE_ARRAY_LE(bytes, 0): %08X\n",
UINT32_FROM_BYTE_ARRAY_LE(bytes, 0));
CPRINTF("UINT32_FROM_BYTE_ARRAY_BE(bytes, 0): %08X\n",
UINT32_FROM_BYTE_ARRAY_BE(bytes, 0));
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(macro_test, command_macro_test, "",
"Test the UINT macros");
Change-Id: I7c2053c846f43d369402c01c0d46ce8546e4923a
Signed-off-by: Harry Cutts <hcutts@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1848259
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This had been used in the GT7288 driver, but is now being used quite a
bit in the private repo, so it's time to put it in common.
BRANCH=none
BUG=chromium:1008568
TEST=Check that a board which uses the GT7288 driver builds correctly.
Change-Id: I111018a73def7a30ff899f9bf435da6f89d9b86a
Signed-off-by: Harry Cutts <hcutts@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1848493
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to pass the right printf format specifiers for certain types
that are compiled both in 32-bit EC and 64-bit host environments,
standard macros PRIx64 and PRId64 must be introduced. These specify
the correct printf format specifier in the given compilation environment
for printing a 64-bit value.
On the host, inttypes.h already exists. Add an inttypes.h for the EC
codebase so that these macros can be used where they're needed.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=none
Change-Id: I76e3bdc88aef7da6e5234d5b86b595f7138ea9a1
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819642
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A simple driver which allows touch reports and firmware version
information to be read. If the appropriate config flag is set, console
commands are included for testing.
Unlike the other two touchpad drivers already implemented, which simply
receive I2C HID events and send them straight out again over USB HID, we
want to do some processing on the touchpad data in the board directory.
For that reason, this driver leaves handling the touch interrupts up to
the user.
BRANCH=none
BUG=none
TEST=With https://crrev.com/c/1716928 patched, run the various host
commands and check the output.
Change-Id: Ia38e516473b78fb052ae18ca89acc5d815b53bd6
Signed-off-by: Harry Cutts <hcutts@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1799290
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves the EC_CMD_GET_UPTIME_INFO command from behind the
CONFIG_CMD_AP_RESET_LOG config in chipset.c into the generic
common/uptime.c file, so that all boards in the codebase can use it. If
CONFIG_CMD_AP_RESET_LOG is enabled, the "AP reset stats" will be filled.
Otherwise, ap_reset_stats is a no-op and recent_ap_reset is filled with
zero.
BRANCH=none
BUG=chromium:997314
TEST=cat /sys/kernel/debug/cros_fp/uptime
Change-Id: I3b6f91b2dd22d3d55b707309ec1fdfd26d42fd70
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769393
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A common pattern to use with IS_ENABLED is like this:
/*
* This var should only be used if CONFIG_FOO. The linker errors if
* CONFIG_FOO is not defined is intentional.
*/
#ifdef CONFIG_FOO
static
#else
extern
#endif
int some_var;
The issue with this is that it leads to an over-verbose and
potentially hard to read pattern, and does not have the check that
CONFIG_FOO was only defined to blank.
Suppose a macro like this existed:
STATIC_IF(CONFIG_FOO) int some_var;
... which expands to "static" when CONFIG_FOO is defined to empty,
"extern" when CONFIG_FOO is not defined, and errors when CONFIG_FOO is
defined to non-empty.
This CL implements that, as well as the inverse (STATIC_IF_NOT).
BUG=chromium:989786
BRANCH=none
TEST=provided unit tests, buildall
Change-Id: Ib57aaba62bc184fda9aa782a780d5f13ba44ae88
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731859
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang does not feature the error(...) attribute on functions, and
apparently we use that compiler for the cr50 fuzz tests.
Work around clang's limitations by removing the error(...) attribute
when compiling with clang, allowing us to use IS_ENABLED in files that
get compiled by the cr50 fuzz tests.
BUG=chromium:989315
BRANCH=none
TEST=make buildall -j
TEST=IS_ENABLED works in system.c
Change-Id: I15bf7a2d2854db12f8e00009afe39359cb6f5c19
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1726948
Reviewed-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Raul E Rangel <rrangel@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ran the following command:
git grep -l 'Copyright (c)' | \
xargs sed -i 's/Copyright (c)/Copyright/g'
BRANCH=none
BUG=none
TEST=make buildall -j
Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces macros to mark weak symbols. These macros are
used to annotate weak definitions, declarations, and overriding
definitions.
__override_proto: declarations
__override: definitions which take precedence
__overridable: default (weak) definitions
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=chromium.org/964060
BRANCH=none
TEST=buildall
Change-Id: I44cec41e0523e285db19a890d084b52337f64a9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1633911
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Functions which might go unused under a particular set of CONFIG_
options have historically been wrapped in an ifdef to clear up
compiler warnings about unused functions.
Since we are trying to reduce conditional compilation in favor of
macros like IS_ENABLED, the Linux kernel style guide suggests using
__maybe_unused for these functions. This adds the __maybe_unused
macro.
BUG=none
BRANCH=none
TEST=make buildall -j
Change-Id: Ia8239ad566b5aa518c258eaab0e4dceada790da4
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1602489
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If IS_ENABLED is called with any unknown values, a compiler error will be
thrown. This change requires that the optimizer always be enabled,
otherwise errors will be thrown when a value is not defined.
BUG=none
BRANCH=none
TEST=make runtests TEST_LIST_HOST="is_enabled_error is_enabled"
Change-Id: I1b166311f81d07e48b3665f4bc0e9502d2ccc4c6
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1592728
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is copied from coreboot with added support for empty defines. We
should favor using this macro instead of using #ifdef. The macro will
evaluate to 0 if the option is not defined. This allows all the code to
be compiled and then the optimizer will remove the sections of code that
won't ever run. This way we don't end up with #ifdef sections with
invalid syntax because no one ever tests that specific permutation.
e.g.,
if (IS_ENABLED(CONFIG_USBC_SS_MUX)) {
...
}
There are currently spots where #ifdefs are nested 3 levels deep. This
makes it very hard to follow the code.
BUG=none
TEST=Added some code that uses the macro and verified it executes when
the config value is defined, and doesn't when it's not.
Change-Id: I796b899f7cbbd3067ea3a4d52527d980c68935c9
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1553573
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch eliminates unnecessary legacy nvmem.c and nvmem_vars.c code
and brings the code base to the state where the new NVMEM layout is
fully functional.
BRANCH=cr50, cr50-mp
BUG=b:69907320, b:129710256
CQ-DEPEND=CL:1450278
TEST=the following tests pass:
- test cases in ./test/nvmem.c
- TCG suite (passes on par with the existing Cr50 code with the
reduced code footprint TPM2 library)
- Chrome OS device migrates from legacy to new implementation with
user account maintained.
- Chrome OS user account is maintained over AP and H1 reboots and
deep sleep cycles.
Change-Id: If4bc2dd125873a79dbe0e268eb32100a8b8b352d
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1496607
Reviewed-by: Andrey Pronin <apronin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-Added support to scale 12MHz to 1MHz
-Fixes the timestamp issue
-Changes under CONFIG_ISH_30
ISH 3.0 has 12MHz Main counter
ISH 4.0 has 32KHz Main counter
BUG=none
BRANCH=master
TEST=On Soraka board modified for ISH, ensure
clock tick happens correctly. Ensure ISH
probe and sensor info is seen in kernel logs
Change-Id: Ib5d8a48bf99d1398a0424596399abd7df431e07a
Signed-off-by: Naresh Solakni <naresh.solanki@intel.com>
Signed-off-by: Sadashiva Rao Pv <sadashiva.rao.pv@intel.com>
Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/686434
Commit-Ready: Caveh Jalali <caveh@google.com>
Tested-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Kyoung Il Kim <kyoung.il.kim@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This creates a build target called libec.a by setting the visibility
of functions that conflict with cstdlib to hidden. It then links
those symbols locally into one large object file that makes up libec.a
Fuzzing targets are linked against libec.a so that they can invoke ec
functionality while depending on outside libraries that need cstdlib.
When linking a particular object against cstdlib, to avoid conflicting
function declarations put the following before any includes from the
ec codebase:
#define __stdlib_compat(...)
The fuzzing targets are now linked using clang++, so that c++ libraries
and objects can be used as part of the fuzzers.
BRANCH=none
BUG=chromium:876582
TEST=make -j buildfuzztests &&
./build/host/host_command_fuzz/host_command_fuzz.exe
Change-Id: Ifdfdc6a51c6ef23b4e192b013ca993bf48a4411b
Signed-off-by: Allen Webb <allenwebb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1180401
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatically use CC=clang if TEST_ASAN is specified.
Also, add a __no_sanitize_address attribute macro to prevent ASan
from adding guards around host_command, mkbp_event, and hook
"arrays" that are generated at link-time.
Also, set ASAN_OPTIONS env variable in run_host_test.
BRANCH=none
BUG=chromium:854924
TEST=make TEST_ASAN=y runtests -j
Change-Id: Iaf0ec405022760d757a8a9d62a5022460d1b16e1
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1109661
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We might want to try out address sanitizer/fuzzer on some host
tests: make it possible to build host tests using clang.
Board builds are broken, and there is no intention to fix them,
at least for now.
BRANCH=none
BUG=chromium:854924
TEST=make buildall -j
TEST=make CC=clang runtests -j
Change-Id: Id49a1b8537bc403d53437a2245f4fab6ceae89ac
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1107522
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add error code to indicate a piece of hardware is not working properly.
BUG=none
TEST=compile
BRANCH=none
Change-Id: I34eca8073a359aec1c559241654a1d0a7075cd44
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/753968
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL adds the driver support for the WoV module which inludes the
following files:
- wov.c
- wov_chip.h
- apm.c
- apm_chip.h
It also supports the console commad "wov" which can test different
configuration and audio quality by entering different parameters.
The detail description of WoV console command is listed below:
------------------------------------------------------------------------
[Note]: Before changing any of settings, please make sure the operation
mode is on the "OFF" state. (ie. run the command wov cfgmod off
first) .
> wov init
Initialize WoV interface, including pin mux and interrupt
registration etc.
> wov mute <enable / disable >
mute enable / disable.
> wov cfgsrc <mono | stereo | left | right>
set audio source, ex: wov cfgsrc left, means audio source from left
MIC.
> wov cfgbis <16|18|20|24>
set audio resolution, ex: wov cfgbit 16 means audio resolution are
16bits.
> wov cfgsfs <8000|12000|16000|24000|32000|48000>
set audio sampling frequency rate, ex: wov cfgsfs 48000 means audio
sampling rate are 48Khz.
> wov cfgbck <32fs|48fs|64fs|128fs|256fs>
set I2S bit clock rate, ex: wov cfgsfs 48000 and wov cfgbck 32fs
means audio sampling rate are 1536Khz (32*48000).
> wov cfgfmt <i2s|right|left|pcma|pcmb|tdm>
set I2S but format, ex: wov cfgfmt right means audio I2S format are
Right-Justify.
> wov cfgmod <off|vad|ram|i2s|rami2s>
set audio operation mode ,ex: wov cfgmod i2s means audio output via
I2S bus.
> wov cfgtdm <0~496 0~496 0~3>
set TDM time slot, the first values is left channel delay counter,
the second is right channel, and the 3rd is startup counting condition.
(chosen LRCK raising or falling edge) .
[Note: this command is just working on cfgmod equal to tdm]
> wov cfgget
retrieve above settings.
> wov vadsens
(currently not support, reserve for next version)
> wov gain (0~31)
set audio data gain value, ex: wov gain 10 means setting audio digital
gain are 10dB.
> wov cfgdck <1.0 | 2.4 | 3.0 >
set digital MIC PDM clock rate. ex: wov cfgdck 2.4 means PDM clock
are 2.4Mhz.
-----------------------------------------------------------------------
This CL also adds the chip ID (0x24) for npcx7m7w. So the console
command "version" can show the chip is npcx7m7w.
BRANCH=none
BUG=none
TEST=No build errors for make buildall.
TEST="BOARD=npcx7_evb make"; Flash the image on EVB; Test WoV function
with console commands described above.
Change-Id: Ief2b3e89edbd3e6d2a9d82d317a93c9f0b7a20cd
Signed-off-by: Dror Goldstein <dror.goldstein@nuvoton.com>
Signed-off-by: Simon Liang <CMLiang@nuvoton.com>
Signed-off-by: CHLin <CHLIN56@nuvoton.com>
Reviewed-on: https://chromium-review.googlesource.com/897314
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: CH Lin <chlin56@nuvoton.com>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch defines more error codes to make the consle more
descriptive.
BUG=none
BRANCH=none
TEST=Boot Fizz.
Change-Id: I84cc6cd7f309bb2f2e1f36dea6cf5a7f0f862f50
Reviewed-on: https://chromium-review.googlesource.com/639160
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Stefan Reinauer <reinauer@google.com>
BRANCH=none
BUG=none
TEST=The following sequence passes
sudo emerge coreboot-sdk
export CROSS_COMPILE_arm=/opt/coreboot-sdk/bin/arm-eabi-
export CROSS_COMPILE_i386=/opt/coreboot-sdk/bin/i386-elf-
export CROSS_COMPILE_nds=/opt/coreboot-sdk/bin/nds32le-elf-
make buildall -j
Change-Id: I4cafbcd70efd6bdf102f848f1cca4772b4ccd10e
Reviewed-on: https://chromium-review.googlesource.com/595207
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds min_frequency and max_frequency to struct motion_sensor_t.
New attributes min_frequency and max_frequency are now returned in
ectool's MOTIONSENSE_CMD_INFO response.
Incremented ectool's MOTIONSENSE_CMD_INFO version to version 3.
Add constants for MIN_FREQUENCY and MAX_FREQUENCY to each sensor's
header file.
BRANCH=none
BUG=chromium:615059
TEST=build/boot and verify MOTIONSENSE_CMD_INFO response on kevin,
make buildall -j passes.
Change-Id: I66db9715c122ef6bb4665ad5d086a9ecc9c7c93a
Signed-off-by: Nick Vaccaro <nvaccaro@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/482703
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(From CL 431233)
Limit battery charge voltage to prevent battery over-charge, due to
regulation inaccuracy. Since RO FW may charge > 8656 mV, ensure the
battery is not full before charging.
BUG=chrome-os-partner:61906
BRANCH=none
TEST=Manual on Electro, sysjump with battery @ 99%, verify battery
discharges, then re-charges to 100%, before discharging once again.
Change-Id: I28212c83057a442fd75e39f8ad51927a7a1f2817
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/432857
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This error code is used to indicates the data has not changed.
Motion sense task will therefore not add any entry in the sensor FIFO.
BUG=chrome-os-partner:59423
TEST=make -j buildall
BRANCH=reef
Change-Id: I58b9be5675d8949bd682d8c89dadea1dfff9bf2e
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424856
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some ECs such as the MEC1322 have a data RAM optimized region as well as
a code RAM optimized region. We discovered that we could save quite a
bit more space by reusing the a portion of the code RAM region as an
additional .bss section. However, this region resides in the code RAM
region. If on the same cycle the processor fetches an instruction and
does a load or store to this code RAM region, the data access will be
delayed by one cycle. Hence, the naming of ``.bss.slow" section.
For boards which do not define CONFIG_REUSE_LOADER_WITH_BSS_SLOW, all
objects bearing this tag will be simply appended to the existing .bss
section.
BUG=chrome-os-partner:46056
BUG=chrome-os-partner:46063
BRANCH=None
TEST=make -j buildall tests
CQ-DEPEND=CL:306173
Change-Id: I126fbeee5255732a6dd6fea1d4557fc2b2c62c96
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/311209
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When IRQ handler is not processing any event raised,
return NOT_HANDLED.
Without this change, any event would set the light sensor
process timestamp and, if the light sensor frequency was lower
than BM160 fifo interrupt frequency, we would never read from
the light sensor.
BRANCH=smaug
BUG=chrome-os-partner:43800
TEST=Compile. Check that light sensor data get updated.
Change-Id: I302f80c5cd9b4f3c926362fdafdc8b5074cabb60
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/298686
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"RO" is a workaround for GP base instructions.
And now we have added "-mno-gp-direct" option in the NDS32 toolchain.
So the compiler would not generate GP base instructions directly,
and we can remove this "RO".
Signed-off-by: Dino Li <dino.li@ite.com.tw>
BRANCH=none
BUG=chrome-os-partner:24378
TEST=console "version" and "gpioget"
Change-Id: I23cb6374fb8eb57081d713bf5c70b80a87dd2fb5
Signed-off-by: Dino Li <dino.li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/281862
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add CONFIG_LTO to use GCC Link-Time Optimizations to try to reduce the
flash footprint of the firmware.
Add additional protection to some functions/data to avoid removal by the
linker when their usage is not obvious.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=make buildall (with and without LTO enable on all boards)
Change-Id: I586b8c1eda4592b416c85383b65153c1d5ab0059
Reviewed-on: https://chromium-review.googlesource.com/271291
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added macros for register read/write.
BRANCH=none
BUG=chrome-os-partner:33815
TEST="make buildall -j; Verified on RevA1 chip"
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Change-Id: I25c6f6b5865c7fdde002b2191b1f2eaaba15f589
Reviewed-on: https://chromium-review.googlesource.com/236402
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
Tested-by: Sheng-liang Song <ssl@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ref: http://smbus.org/specs/smbus20.pdf
- Support software CRC8 generation and checking.
- Support read/write word (2-bytes)
- Support read/write blocks (up to 32 bytes)
BUG=chrome-os-partner:24741
BRANCH=ToT,glimmer
TEST=Verified with smart battery firmware update application on glimmer.
Passed LGC & Simplo Battery.
Change-Id: Ic2e7f759af80c06741ed49fee1826213429fbf8a
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209747
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to stringify macros arguments in various places in the code,
avoid duplicating this definition.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=make buildall
Change-Id: I03530c06139fad4c60711d041239b396d9ed321e
Reviewed-on: https://chromium-review.googlesource.com/201576
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes the toolchain tries to put a relocation which is not suitable
to access variables in a read-only section.
The nds32 gcc uses GP-relative signed 17-bit relocation to access
variables stored in .rodata (eg lwi.gp $r0, [ +gp ])
That's wrong since $gp is pointing in the middle of .data and .bss in
the SRAM, while .rodata is sitting in flash.
Since on IT8380, the flash is at 0x00000 and the SRAM is at 0x80000
(512kB further), the linker will fail trying to create the signed 17-bit
relocation (it detect that it needs to truncate it)
Force the compiler to put another relocation as a workaround for now.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=chrome-os-partner:24378
TEST=./util/make_all.sh ; make BOARD=it8380dev
check "version" and "gpioget" on spring, link and it8380dev.
Change-Id: Ife50adf3a26be28f113292f73a1a70e8d74b5d8c
Reviewed-on: https://chromium-review.googlesource.com/176913
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the initial commit of mec1322 support. This includes:
- Basic GPIO driver. Interrupt not supported yet.
- Microsecond timer
- UART driver
The script to pack the firmware binary will be checked in in
following-up CL.
BUG=chrome-os-partner:24107
TEST=Build and boot on eval board
BRANCH=None
Change-Id: I9013c908049d1f740f84bb56abca51b779f39eef
Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/175716
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is tidier than every board defining its own module_id enum, and
encourages standard naming of modules.
A subsequent CL will do more cleanup (standardizing on MODULE_LED
instead of MODULE_POWER_LED and MODULE_LED_KIRBY), but it's easier to
do that as a separate CL than part of this one.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms; pass unit tests
Change-Id: If0fcef284fb3aa2fa145bc9ff3d1f3f2d25a2e47
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/174382
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This just replaces all the "X - 273", "Y + 273" stuff with a macro.
BUG=none
BRANCH=falco,peppy
TEST=manual
Run the EC console command "temps". It should print human-readable things.
Change-Id: Icc4284c89fdbc0cd3b206a0faacf121973652a63
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/65005
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes unaligned access exceptions when totally-unrelated code
changes happen to move around host_command.c's global variables.
BUG=chrome-os-partner:21578
BRANCH=none
TEST=add a ccprintf() call to host_command.c; no longer causes an exception
Change-Id: I5407e5631a08ea647dc40e5bd9c7bd101868ced0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/64233
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To create a token by concatenating already-defined macros and new
text, it's necessary to use multiple levels of macro. We'd already
done that in several places in the code such as STM32_CAT; this now
standardizes it into a single place.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=Build all platforms; examine ec.RO.map to see that irq_*_handler and prio_* symbols
evaluated the same as before. (Other macro evaluations would simply fail to compile
if they were incorrect, since the concatenated tokens wouldn't fully expand.)
Change-Id: Ic9bf11d27881a84507fe7b6096dab6217c6c6dc7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/63231
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This file will soon contain the exhaustive list of all CONFIG defines
and their descriptions.
Chip-level configs are renamed to config_chip.h to avoid naming
conflicts.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I9e94146f5b4c016894bd3ae3d371c4b9f3f69afe
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/62122
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 89e688a3325e91d3c59ac639f04f2c91019c9b10.
Time-scaling is added back. We can run this test now.
BUG=chrome-os-partner:19236
TEST=Pass the test.
BRANCH=None
Change-Id: Id3dcec6fc12489f5f0602de91c6560a8dfbef9af
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51551
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Time-scale functionality is temporarily reverted and this test
is now taking too long. Revert this test now. Will add it back
when we solve the time-scale issue.
This reverts commit d9cf88b35ad211d873f48b41fd985e22ff049b83
Change-Id: Id9ce1071eb2114dd6968d3df9f0bce395edaeef6
Reviewed-on: https://gerrit.chromium.org/gerrit/51482
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chrome-os-partner:19236
TEST=Pass the test.
BRANCH=None
Change-Id: I1c96437e1fb3492faa5352383f852dc1d2718ace
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51248
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
And use them for LM4 as well as STM32. Consistency is good.
No functional changes, just moving/renaming code.
BUG=chrome-os-partner:18343
BRANCH=none
TEST=build all platforms
Change-Id: I029a21fadb50726500255219dc38615874a369e7
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47700
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces two symbols for mocking functions in existing code:
- test_mockable
- test_mockable_static
BUG=chrome-os-partner:18598
TEST=none
BRANCH=none
Change-Id: Ia7251a9b609136c8f3b155c221634bac7dcb1d68
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47540
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|