Commit Graph

11 Commits

Author SHA1 Message Date
Vincent Palatin
6473343075 better unhandled exception panic without runtime
On panic, reboot properly the CPU rather than just jumping to the reset
vector as that might lead to some incorrect initializations.

Properly plug the div by 0 to the panic handling.

Add a small trace if the debug output is activated.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:29840
TEST=add adhoc code triggering a data abort and see the firmware
printing a trace, then rebooting immediatly in a working state.

Change-Id: I1d5a98d9113c8ae08e05588a40f941d1ed22cebe
Reviewed-on: https://chromium-review.googlesource.com/206268
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2014-07-03 02:56:52 +00:00
ChromeOS Developer
7895c27803 cortex-m: Add debug config option for disabling buffered writes
This can be helpful when debugging "Imprecise" data bus errors.

BUG=None
BRANCH=None
TEST=Write to a memory-mapped register such as LM4_ADC_ADCISC
for a hardware block that is powered down.
Check the exception trace for a "Precise" error.

Change-Id: Ia246c3661b482e212bb0ce37b9c2d383021de639
Signed-off-by: Dave Parker <dparker@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/191392
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-03-26 05:33:35 +00:00
Vincent Palatin
60e47a730f make the common runtime optional
In order to achieve really tiny firmwares, make our runtime (tasks,
hooks, muxed timers, GPIO abstraction ...) optional.
Add 2 new build options for it : CONFIG_COMMON_RUNTIME and
CONFIG_COMMON_GPIO which are enabled by default, and ensure all the
source files are built according to the right configuration variable.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=make buildall
build a minimal board with no runtime.

Change-Id: Icb621cbe0a75b3a320cb53c3267d6e578cd3c32f
Reviewed-on: https://chromium-review.googlesource.com/189403
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2014-03-22 06:24:16 +00:00
Randall Spangler
55645f87cb Reformat init.S to use tabs not spaces
And tidy a few comments.  No code changes, only comments and whitespace.

BUG=none
BRANCH=none
TEST=compile code (nothing to test)

Change-Id: I10faadc4f11147984cb911c4e630d05ac594cc56
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/39796
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2012-12-17 14:24:39 -08:00
Bill Richardson
bc50e0cabb Enable FPU support for Link EC
With this CL, if CONFIG_FPU is defined (only for Link, ATM), the EC task
switcher will enable CONTROL.FPCA and expect all stack contexts to include
floating point state as well as normal state (an additional 18 words).

To support this, we need to increase the allocated stack space for each
task. The stack sizes are already chosen empirically, so I'm just rounding
them up a bit.

BUG=chrome-os-partner:14766
BRANCH=Link
TEST=manual

There should be no noticeable change. If you run the EC command "taskinfo"
you'll see the increased size each thread's stack, but everything that was
working before should continue to work just fine.

The additional overhead required to load and store another 18 words on each
context switch is not really measurable (I tried).

Change-Id: Ibaca7d7a2565285f049fda6906f32761e83207af
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34391
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-10-02 10:52:54 -07:00
Simon Glass
3439e70a90 Convert panic() to C code
Move the implementation of panic into C code. Only a very small part
needs to be in assembler, and the reset is easier to maintain as C.

As part of this, define panic_putc() and panic_puts() which directly
wite to the UART.

To make things more convenience for the future, add a simple printf()
implementation in the panic path. This is not reliant on the uart
buffering system being in a happy state. However, we do call the
emergency flush so that our panic message will appear after previous
output rather that surpressing it (which would be extremely confusing).

Code/data size for panic.o grows by about 200 bytes, but this is mostly
due to the increased flexibility.

   text	   data	    bss	    dec	    hex	filename
    292	    272	      0	    564	    234	old panic.S
    692	      3	     48	    743	    2e7	new panic.c

BUG=chrome-os-partner:10146
TEST=manual:
build and boot on snow:
> rw 0x06000000

=== EXCEPTION: 03 ====== xPSR: 01000000 ===========
r0 :0000000b r1 :00000047 r2 :06000000 r3 :200013dd
r4 :00000000 r5 :080052cc r6 :200013d0 r7 :00000002
r8 :00000000 r9 :200013de r10:00000000 r11:00000000
r12:00000000 sp :200009a0 lr :08002a5d pc :08003962

Rebooting...

Change-Id: If3e3f572e0f32af780b6ebda235b1b3cde4de5e4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24503
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-06-08 17:55:40 -07:00
Randall Spangler
11ab34a721 Fix alignment of task scratchpad and system stack
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:10042
TEST=boot system, ctrl+alt+F2, type on console; shouldn't crash

Change-Id: I935bc141fbbc1e7d0d073f1754104808a24fe869
Reviewed-on: https://gerrit.chromium.org/gerrit/24232
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2012-05-31 15:03:17 -07:00
Randall Spangler
b2ac77b37b Support warm reboot from one EC image to another.
This is necessary at init-time for verified boot to jump from RO to
one of the RW images.

It's also used by factory EC update to update one image and then jump
to the updated image to finish the update.  In this case, the x86 does
NOT reboot.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8449
TEST=manual

1) power on x86 and log in
2) sysjump a  --> system is in a; x86 has not rebooted
3) sysjump ro --> system is back in RO; x86 has not rebooted
4) reboot -> system is in RO; x86 HAS rebooted

Change-Id: I9dbadcf9775e146a0718abfd4ee0758b65350a87
2012-03-19 15:41:14 -07:00
Vincent Palatin
a94e3277b3 update versioning information stored in the EC
Add build information (date/time/builder) which can be displayed at the
EC console.

Generate a version from the board name and the branch tag.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chromium-os:27013
TEST=on BDS, run version command on the console.
inspect the built binary.

Change-Id: Idb1f68898ba6b811d02919f17ab4536ed9f8934a
2012-03-02 16:46:26 +00:00
Vic Yang
502613771e FPU control
Implement enable_fpu() and disable_fpu().
enable_fpu() disables interrupt and then enables FPU.
disable_fpu() disables FPU and enables interrupt.
Also added a CONFIG_FPU flag.

BUG=chrome-os-partner:7920
TEST=none

Change-Id: I2d71f396d9c7d7ac4a6a2d525f3d86f8aae87521
Signed-off-by: Vic Yang <victoryang@chromium.org>
2012-02-16 05:42:08 +08:00
Vincent Palatin
cf9fcef328 Move OS files to a CPU specific directory
Preparatory work to introduce a second SoC : 3/5

We split the drivers files which contain SoC specific drivers from the
OS files which only depend the actual CPU core.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=run EC firmware on BDS and test a few commands on the console.

Change-Id: I598f8b23e074da9bd6b0e2ce6689c1075fe854f0
2012-01-25 22:50:07 +00:00