| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of relying on the host's clock, we need to monotonically
increase a timestamp. This gives tests predictability.
BRANCH=none
BUG=chromium:1013701
TEST=ran usb_prl over 100 times without failure
Change-Id: Id4a1e9a8cbd9dd44509747916c9073444d71af5c
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1860474
Tested-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change waits in USBC tests to 1 MSEC. When we wait and don't care, wait
for much longer.
We also need to ensure that the lower priority task actually ran when we
are trying to cycle the state machine. If the entire process is starved
then we have to do some manual checking.
Added more prints statements to help debug failing tests.
BRANCH=none
BUG=none
TEST=repeat all tests 100 times without failure
Change-Id: I12e0f0fa5247a24c87a4ff457e2be684991f0cad
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837995
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change removes uses of %l from the EC side of the EC codebase.
This is done because the semantics of %l within printf have changed,
and there are concerns that new calls to printf will be cherry-picked
into old firmware branches without the printf changes. So, in
preparation for disallowing %l in master, remove occurrences of %l.
This change was done by manually fixing up anything found under the EC
directory with the following regex: %[0-9*.-]*l[^l]
Remember that anything on the host machine is fine as-is, since the host
printf never changed.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Change-Id: I2a97433ddab5bfb8a6031ca4ff1d3905289444e2
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834603
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change fixes the printf formatting errors found by the
compile-time prinf format checker. The errors fall into a few
categories:
1. Incorrect size specifier (missing or extra l).
2. Missing or extra arguments.
3. Bad line splitting.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=none
Change-Id: I5618097a581210b9fcbfc81560dec050ae30b61c
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819653
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to make our printf more standard, utilize %ll for long long
arguments, rather than %l. This does cost a little bit in flash space
for that extra l in a couple of places, but enables us to turn on
compile-time printf format checking.
For this commit only, the semantics are such that both %l and %ll
take 64-bit arguments. In the next commit, %l goes to its correct
behavior of taking a sizeof(long) argument.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=none
Cq-Depend:chrome-internal:1863686,chrome-internal:1860161,chrome-internal:1914029
Change-Id: I18081b55a8dbf5ef8ec15fc499ca75e59d31da58
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819652
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to avoid landmines later with future extensions to %p,
disallow %p by itself. The danger is that we'll have something
like: printf("%pFOO", myptr), and then later will add a %pF
extension, but miss this printf (maybe the string is split, maybe
it's just missed).
Missing a conversion during extension is worse than just seeing a
print like <ptr_val>OO, since %pF likely reaches through the
pointer and interprets its contents according to whatever F means.
Convert existing uses of %p to %pP, so they're explicitly printing
a pointer value, giving us flexibility to extend in the future.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=None
Cq-Depend:chrome-internal:1560879
Change-Id: I36a4bee8d41cb9a6139171f8de0d8f2f19468132
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730604
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable CONFIG_PRESERVE_LOGS to gather more information
when SCP is crashed.
TEST=1. crash scp
2. restart scp
3. restart timberslide to ensure the logs are fetched
4. see that untransmitted logs are fetched into /var/log/cros_scp.log
BUG=b:140220117
BRANCH=none
Change-Id: I12635afa6c92fd8fa9cc889ce75999f855f18db0
Signed-off-by: Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1833943
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. The end of text section is 4-byte aligned.
We found that rodata section will be shifted 2 bytes in binary file
if compressed instruction (16-bit instruction) is enabled.
So we fix it.
2. Ensure the scratchpad is behind system stack. So the guard value
in scratchpad that we filled in at task initialization would not
get overwrite on first context switch (Because we will change to
use system stack in ISR if SP is greater than the end of system stack).
3. Put some task functions into __ram_code section to fill up the gap.
BUG=none
BRANCH=none
TEST=This change saves 1408 bytes space at RO image and improves ~10ms
boot time.
Before the change:
173516 bytes in flash still available on it83xx_evb RO
> [0.028248 low power idle task started]
After the change:
174924 bytes in flash still available on it83xx_evb RO
> [0.018774 low power idle task started]
Change-Id: I32506383aa63424f12794fb543c51b0485bace8f
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1831931
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
we were missing the __gnu_thumb1_case_si helper function on cortex-m0.
i'm assuming this is needed for huge switch statements and we've
gotten "lucky" so far.
BUG=b:141655831
BRANCH=none
TEST=make buildall passes
Change-Id: Ie4c7d991b37ac40de89634b88b085bb84498ab1a
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826284
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide API to disable/enable tasks.
All the tasks are marked enabled after hook_task starts.
We need a way to control the tasks when it shouldn't run in some states.
BUG=b:136240895
TEST=Disable the tasks and see it won't be scheudled when task_wake().
BRANCH=None
Change-Id: I2662f3619b22ed28387fe3c783001ba2a745620c
Signed-off-by: Yilun Lin <yllin@google.com>
Signed-off-by: Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753562
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Kukui, we need to put console logs and reset reasons at fixed
addresses on SRAM to save the information across each EC resets.
Otherwise, EC will lose console logs and reset reasons after resetting
EC.
This CL ensures that the contents of reset and console logs will not be
clobbered or cleared by putting mandatory symbols at a fixed location on
SRAM. The values will only be reset when checksum or sanity check fails.
BUG=b:133795403
TEST=1. On Kukui, shutdown AP, reboot AP, or sysjump, and see
the previous logs before reboot will be kept
on /var/log/croc_ec.log
2. Reset reasons can be viewed with ectool uptimeinfo
BRANCH=master
Change-Id: I19db49101fda1675dc2fdc047b7f14af77cdb6e6
Signed-off-by: Shannon Chen <shannc@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1716671
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Shannon Chen <shannc@chromium.org>
Tested-by: Shannon Chen <shannc@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had a hard time reading this section, so figured I may as well
rewrite it to use IS_ENABLED while I was here.
Gave CONFIG_{RO,RW}_HEAD_ROOM a default value of zero here, which
makes the math work out for boards without it anyway.
BUG=none
BRANCH=none
TEST=buildall
Change-Id: I87dc2d73838c350088916b57aa51d5f368c5592f
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1727570
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This option was only used with kunimitsu, which was removed from the
EC codebase a long time ago. The EC code won't even compile with this
option enabled anymore.
Remove it!
BUG=chromium:989301
BRANCH=none
TEST=buildall
Change-Id: I8ede226ec1e7b300ded6bb1769d82e142db1b0aa
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1727569
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The file is copied from riscv-rv32i/__builtin.c.
bc12_update_charge_manager() in pi3usb9201 driver uses this
function.
BUG=b:135895590
TEST=combined with CL:1673955, build and deploy on jacuzzi
BRANCH=master
Change-Id: If8b8cc8e4a3acdad7285c23e2f3627c7d05bf3b8
Signed-off-by: Ting Shen <phoenixshen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715951
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make get_time() test_mockable so that we can:
1) make sure the unit tests are deterministic and not flaky (e.g.,
do not depend on system timing, context switches, timer precision)
2) don't execute longer than necessary (e.g., if for some reason we
wanted to test a several second timeout we don't want to delay the
unit tests)
3) verify functionality like timestamp overflow (e.g., things that
are hard to test with a real clock)
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
Change-Id: Icb26617de6382e554bdfae8258a096565c8a7102
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1652627
Tested-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ISH has native support for storing the hardware ticks in a 64-bit
integer. With CONFIG_HWTIMER_64BIT, we can use this instead of relying
on the periodic rollover interrupt.
BUG=b:133190570,chromium:976804
BRANCH=none
TEST=ran arcada_ish for more than 2³² μs, observed timer worked as
normal
Change-Id: I3b608c49081842f28d2ef8c16279992af1cb4fad
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1668056
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The errorcode is pushed to the stack by hardware for vectors
8, 10-14 and 17. The others will be missing that parameter
when exception_panic is called. So make sure to push a 0 for
these other exceptions to line up parameter values.
BUG=b:135671664
BRANCH=none
TEST=make buildall -j
TEST=verify errorcode 0 on exceptions that hw does not push a value
Change-Id: I7aad96278408a5e38cf973c868e05d92b52469dd
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1669884
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For interrupt vectors (as opposed to exception handlers), the eip
value is on top of the stack (referentially the return address by C
calling convention). Use separate code for WDT vector.
BUG=b:129983997
BRANCH=none
TEST='crash watchdog' showing correct EIP, CS values
Change-Id: I7efb2c71aba63eefd89fc71af089bc14034b7d08
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663188
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Yuval Peress <peress@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change AON_ROM references to be AON_PERSISTENT, these are not readonly
Use the linker to set a snowball structure in the right place so we do
not have to maintain hardcoded addresses in the register file
BUG=b:132690500
BRANCH=none
TEST=make buildall -j and check map location of snowball to be correct
Change-Id: I4983a078fbd067b9c7ec9f0c49f962a4cb1581b7
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1664593
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL fixes DRAM section loaded at the wrong location, and
also relayouts the DRAM section to have a smaller flat binary.
Current DRAM region layout is as below:
.dram.data LMA | LOAD
.dram.data VMA |
.dram.bss | NOLOAD
.dram.rodata | LOAD
.dram.text | LOAD
This will create a flat binary file as following layout:
.dram.data
.dram.bss
.dram.rodata
.dram.text
and loader will load .flat.dram to .dram.data LMA's starting section.
This leads to .dram.bss, .dram.rodata and .dram.text been loaded at
the wrong location, where .dram.data VMA resides.
This CL fixes the issue by reorganize the sections into:
.dram.text | LOAD
.dram.rodata | LOAD
.dram.data LMA | LOAD
.dram.data VMA |
.dram.bss | NOLOAD
and thus we have a flat binary as:
.dram.text
.dram.rodata
.dram.data
so that:
1. everything will be placed at the correct address.
2. have a smaller flat binary.
The CL also removes .dram.keep.* section, which is not used so far.
BUG=b:134079593
BRANCH=master
TEST=With crrev.com/c/1646691, check the output of object header:
1. SIZEOF(.dram.text + .dram.rodata + .dram.data) = SIZEOF(.image.RW.dram)
0x68 0x18 0x14 0x94
2. ADDR(.dram.data LMA) + SIZEOF(.dram.data) = ADDR(.dram.data VMA)
0x10000080 0x14 0x10000094
arm-none-eabi-objdump -h build/kukui_scp/RW/ec.RW.elf
Idx Name Size VMA LMA File off Algn
5 .dram.text 00000068 10000000 10000000 00030000 2**3
CONTENTS, ALLOC, LOAD, READONLY, CODE
6 .dram.rodata 00000018 10000068 10000068 00030068 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .dram.data 00000014 10000094 10000080 00030094 2**0
CONTENTS, ALLOC, LOAD, DATA
8 .dram.bss 00000004 100000a8 100000a8 000300a8 2**0
ALLOC
arm-none-eabi-objdump -h build/kukui_scp/ec.obj
Idx Name Size VMA LMA File off Algn
2 .image.RW.dram 00000094 50000000 50000000 00020000 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
TEST=With crrev.com/c/1646691, see the console has correct output:
dram_bss_val = 0
dram_data_val[0]= 1
dram_data_val[1]= 2
dram_data_val[2]= 3
dram_data_val[3]= 4
dram_data_val[4]= 5
dram_data_val[5]= 6
dram_data_val[6]= 7
dram_data_val[7]= 8
dram_data_val[8]= 9
dram_data_val[9]= 10
dram_data_val[10]= 11
dram_data_val[11]= 12
dram_data_val[12]= 13
dram_data_val[13]= 14
dram_data_val[14]= 15
dram_data_val[15]= 16
dram_data_val[16]= 17
dram_rodata_val[0]= 55
dram_rodata_val[1]= 56
dram_rodata_val[2]= 57
dram_rodata_val[3]= 58
dram_rodata_val[4]= 59
dram_rodata_val[5]= 60
Change-Id: Ic6836c6ad553d0ceae4d55df92caa1896fee905d
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1646690
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Yilun Lin <yllin@chromium.org>
Auto-Submit: Yilun Lin <yllin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removed many of the #if conditions and replaced them with IS_ENABLED
BUG=b:132178013
BRANCH=none
TEST=make buildall -j
TEST=verify basic ish ec functionality
Change-Id: I39c1d2dfdb39baa06e53746789d0b6a648275ed9
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660021
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_interrupt_context is only called from code inside #ifdef
CONFIG_TASK_PROFILING.
clang emits an unused function warning for this:
core/cortex-m/task.c:238:19: error: unused function
'get_interrupt_context' [-Werror,-Wunused-function]
static inline int get_interrupt_context(void)
BRANCH=none
BUG=chromium:931797
TEST=make buildall -j
Change-Id: I5ba68d1a58a966eeecb5abdb3cb87fa2684f359b
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660017
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to receive better debug info from panic reports, include the
current task when the panic was encountered.
BUG=b:134071217
BRANCH=none
TEST=saw that task was "CONSOLE" when typing "crash divzero" from
console
Change-Id: I2fa9f931eea0274a762f812b6a7a8281cb8fcc5f
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660018
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Yuval Peress <peress@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because the CL:1648958 made panic_sw_reasons[] common,
so we remove it to fix multiple definition error.
BUG=none
BRANCH=none
TEST=crash console command:
> crash stack
...
Software panic reason: PANIC_SW_STACK_OVERFLOW
Software panic info: 2
> crash assert
...
Software panic reason: PANIC_SW_ASSERT
Software panic info: 192
Change-Id: Ia34ae92f8b47f14040a78ae8a85bd479757f40ea
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1655219
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are able to build EC image with coreboot-sdk, so remove the TODO.
BUG=b:133639441
BRANCH=none
TEST=build board it83xx_evb with RISC-V core.
Change-Id: I21d5aa4735f38debb180277ac1acd9f7284298d1
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1655218
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.dram.bss section is like .bss section that all the contents should
be initialized to zero.
TEST=build a image with .dram.bss section, and verify it only has
ALLOC attribute.
$ arm-none-eabi-objdump -h build/kukui_scp/RW/ec.RW.elf
7 .dram.bss 00000acb 3009aaa8 3009aaa8 0010aaa8 2**2
ALLOC
BUG=b:134079593, b:122058243
BRANCH=master
Change-Id: I853b2977465b83458f566c5dd953458147d4e10e
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1646689
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By moving the __irq_data extern declaration into link_defs.h, the
struct can be used in more than just interrupts.c.
In addition, this provides a common struct definiton for IRQ
definitions consisting of an IRQ number, the assigned routine, and a
handler function, which is a fairly common way to store IRQ
definitions.
BUG=none
BRANCH=none
TEST=arcada ISH functions as normal
Change-Id: Idbb5780ae965faeade74cfe319364f61dd933d9e
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1649375
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The IT83202 is an embedded controller with RISC-V core.
It supports maximum ram size to 256KB and internal flash to 1MB.
BUG=none
BRANCH=none
TEST=EC boots and test console commands (eg: taskinfo, version, sysjump...)
on it83202 EVB.
Change-Id: I424c0d2878beb941c816363b5c7a3f57fda9fd13
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1588300
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding functions for software panic to ISH. This includes
panic_set_reason, panic_get_reason and software_panic.
Added extra output when a software panic is detected.
Had to touch nds32/panic.c in order to make panic_sw_reasons
common.
BUG=b:134502392
BRANCH=none
TEST=Verified with crash assert, with CONFIG_DEBUG_ASSERT defined
Change-Id: Iebfe62a7dcd59b4bbed82b450dfd44cc8eaed1da
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1648958
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move persistent data definitions to a structure and have linker script
define the address of the symbol into the AON ROM (persistent data
storage). Use the magic number "ISHd" to verify persistent data
storage and copy to static memory when valid. Commit changes from the
local copy during reset.
BUG=b:133779707,b:133647823,b:132059981
BRANCH=none
TEST=power-on is only reset flag under cold reset, panic data
persists, watchdog reset produces correct reset flags, UART always
printing system info on boot
Change-Id: I65a458cc2656f8fe26361ef2117ceb5439edff6c
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1636293
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reload the watchdog timer immediately after exiting from D0ix before
re-enabling the reset of the IRQs.
Also re-enable all ISRs in a batch while interrupts are disabled to
limit the number of context switched if multiple interrupts are pending.
BRANCH=none
BUG=b:133190570
TEST=let arcada enter and exit D0i[0123] without issue for a couple of
minutes. There are not adverse affects of this change.
Change-Id: I3ef5878b0618a0c1858664cad061d415329d4302
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1640304
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running on a busy builder, fuzzing tests often time out.
I suspect this is due to the fact that one of the thread is busy
looping, and for some reason, does not give enough time for
other threads to run.
Fix the issue by using nanosleep OS call (avoiding namespace
clash with msleep/usleep that are implemented differently).
From the builder stack traces, we know these tests often
fail in 2 busy-loops, so fix those.
BRANCH=none
BUG=chromium:963768
TEST=Emulate busy system with 4 cores only:
taskset 0xf yes > /dev/null & (about ten times)
Then run tests:
while taskset 0xf build/host/usb_pd_fuzz/usb_pd_fuzz.exe \
-runs=1; do :; done
=> No failures after 30 minutes.
Change-Id: I458ff783d166e27fb38dc33853f08e5b3acba980
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1623050
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we switched to using REG32 macros for registers, we made
a mistake in using address of LAPIC's ISR.
The original CL that changed this was CL:1586458
BRANCH=none
BUG=none
TEST=Tested on Arcada platform
Change-Id: Ia64806a4cb0fa5d150b41407b0f6c9f34f0168e8
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1611746
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we switched to using REG32 macros for registers, we also changed
the math for the offset of the lapic. Fixing the pointer math.
The original CL that changed this was CL:1586458
BRANCH=ish
BUG=none
TEST=ISH runs normally
Change-Id: I1beea99ede496a2eee2adf96adeec21b3f1e1fd4
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1600158
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
watchdog_warning implements similar functionality to exception_panic,
but worse, as the value it prints for EIP is wrong, and it does not
have the no-double-panic logic of the panic handler. This commit
removes watchdog_warning and integrates the relevant functionality
into exception_panic.
BUG=b:129983997
BRANCH=none
TEST=observed watchdog reset with 'waitms 10500'
Change-Id: I78375337aa85be5424850e29a8204c409384d019
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1599732
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a hook for USB PD connect event.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
BUG=b/127228934
BRANCH=none
TEST=buildall. Verify a hook is called on BC12 charger connection.
Change-Id: I88fcd65d1afce07b6275398c5d0b902ecd7a44a3
Reviewed-on: https://chromium-review.googlesource.com/1597794
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ld won't complain .data LMA overlapping if using a computed LMA
address. This CL workaround this by assigning a load memory region.
Related discussion:
https://github.com/rust-embedded/cortex-m-rt/issues/86
TEST=make buildall -j
TEST=cherry-pick https://crrev.com/c/1592972
make BOARD=kukui_scp -j
and see it ld reports failure for LMA overlapping:
build/kukui_scp/RW/ec.RW.elf section `.data' will not fit in region `IROM'
region `IROM' overflowed by 3784 bytes
TEST=w/o this CL; make buildall -j; cp -r build build.old
w/ this CL; comment out EC version rules
#.PHONY: $(out)/ec_version.h
make buildall -j
compares the .flat files by:
for f in $(ls build/*/*/ec.*.flat | sed -e 's|build/||');
do
echo "###### diff ${f}"
diff <(xxd build/${f}) <(xxd build.old/${f})
done
and see that all the .flat are the same, except that
some boards(aquila, arcadia, cr5*, granite,
haven_dev, hg_*, hotelgolf, hslt_*, indus, proto2, red,
starcard, tk-x001) using g-chip have different content at
addr 0x0~0x360 (related to regen key?), and this change
is not likely to touch that address.
BUG=b:131641213
BRANCH=None
Change-Id: I54c697669ef3836c93027bce90f507c33283c6f3
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1588297
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit stores panic data across reset by storing panic data in
the last 256 bytes of AON memory (before AON ROM).
> crash divzero
========== PANIC ==========
Reason: Divide By Zero
Error Code = 0xFF00B60C
EIP = 0xFF010008
CS = 0x00010202
EFLAGS = 0x00103085
EAX = 0x00000001
EBX = 0xFF01B118
ECX = 0x00000000
EDX = 0x00000000
ESI = 0x00000000
EDI = 0xFF017E0E
Resetting system...
===========================
... ISH reset ...
> panicinfo
Saved panic data: (NEW)
Reason: Divide By Zero
Error Code = 0xFF00B60C
EIP = 0xFF010008
CS = 0x00010202
EFLAGS = 0x00103085
EAX = 0x00000001
EBX = 0xFF01B118
ECX = 0x00000000
EDX = 0x00000000
ESI = 0x00000000
EDI = 0xFF017E0E
BUG=b:129425206
BRANCH=none
TEST=see console output above (on arcada_ish)
Change-Id: I5c9e458b53076eafe7fa50ba851f2c6e863f2247
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1593418
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
libgcc provides 64bit division operation functions for 32bit arch,
such as '__udivdi3', link libgcc for general 64bit division on ish.
please note for critical performance required case, do not use these
functions from libgcc.
examples:
scale_us2ticks() in chip/ish/hwtimer.c
BRANCH=none
BUG=b:131590864
TEST=tested on arcada platform
Change-Id: I554e4c79f017e098ab83972928376f82fe7b92d1
Signed-off-by: Hu, Hebo <hebo.hu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1587396
Commit-Ready: Jett Rink <jettrink@chromium.org>
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
kukui_scp is loaded into SRAM. We would like to protect
the memory from a modified code RAM content and executing injected
code in data RAM.
BRANCH=None
BUG=b:123269246
TEST=Apply MPU test patch https://crrev.com/c/1530265.
Test data ram XN:
1. mpu 0 # disable MPU
2. mpu_test # see it prints
3. mpu 1 # enable MPU
4. mpu_test # memory access violation, and reset.
5. mpu_test # memory access violation, and reset
# again. (MPU enabled by default)
Test code ram RO:
1. rw 0x8 0x5566 # Write to code RAM and see memory
# access violation and reset.
2. mpu 0 # disable MPU
3. rw 0x8 0x5566 # Nothing happended
4. rw 0x8 # Read 0x5566
5. mpu 1 # enable MPU
6. rw 0x8 0x5566 # memory access violation.
Change-Id: I6af5029d8c55d795543d4759b2c9168a06eb9ff1
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1530264
Commit-Ready: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a good portion of the fixes needed for b:130573158, but we
still have the HECI registers to deal with. I have those in a separate
CL as they were giving me a significant amount of trouble.
BUG=b:130573158
BRANCH=none
TEST=arcada_ish is functioning as normal after changes
Change-Id: I9c209a329d61f7f55c260006cdffbfc705521195
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1586458
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current s/w generated IRQ uses LAPIC's ICR but it causes pending
interrupts for other IRQs in IOAPIC and leads LVT error with
illegal vector. So instead of using ICR, we use "int" instruction.
BRANCH=none
BUG=b:129937881,b:124128140
TEST=Tested on Arcada platform
Change-Id: I49c4120e7355f9a98d20d5ed259c4fdf6bad5196
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1568786
Commit-Ready: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ish_pm_reset is a rather complex procedure, and encountering a panic
while it is happening could lead to an infinte loop of handling
panics. This will preform a reset of the Minute-IA core if a panic
occurs and the system is already resetting from panic.
BUG=b:130752748,b:130587334
BRANCH=none
TEST=copied some invalid opcodes into switch_to_aontask procedure,
observed the hard reset after forcing a panic
Change-Id: I43459d78da9b67297f84e3a736d3f92da42a814c
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1576835
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had forgotten to remove this from testing the panic handler. This is
a duplicate command of "crash divzero" and should be removed.
BUG=b:126691187
BRANCH=none
TEST=divzero console command is gone on arcada
Change-Id: Id37d3f3749bd4228045cca93a38315ee9c94b2e9
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1576837
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on ish, need fw clean fabric agent error status, otherwise will
cause ish wakeup immediately after entered low power mode.
this operaion has no impact for other functions.
BUG=b:130193448
BRANCH=none
TEST=verified on arcada platform
Change-Id: Iecd85d1ab037aafa988d6c32ad47b51003913198
Signed-off-by: Hu, Hebo <hebo.hu@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1563470
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we can LAPIC's ISR registers to find vector number but
it's already know to the IRQ handler.
BRANCH=none
BUG=none
TEST=Tested on Arcada platform
Change-Id: If6626eee0b2548eb26d15cf97b220403b6afcfdb
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1573203
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Variable "start_called" is never updated due to bug in __task_start.
this patch fixes the bug.
BRANCH=none
BUG=none
TEST=Tested on Arcada platform
Change-Id: Icdea8adf5a06c891188fc84bc49cb643a7e009ec
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1570150
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The LAPIC LVT error irq handler missed EOI to LAPIC at the end
of the handler.
BUG=b:129937881
BRANCH=none
TEST=tested on arcada
Signed-off-by: Leifu Zhao <leifu.zhao@intel.com>
Change-Id: I890271729c5ab1d622016c32e83a8068914f69de
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1567105
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While we figure out how to fix the root cause for missing interrupts, we
can at least get ourselves out of the back scenario by proactively
checking if there is a pending IOAPIC interrupt that the LAPIC does not
know about.
BRANCH=none
BUG=b:129937881
TEST=ISH communication does not permanently lock up
Change-Id: I766b2764748ae85b17992b3c0020ba7fb4e11693
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1566472
Reviewed-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|