Commit Graph

14 Commits

Author SHA1 Message Date
Randall Spangler
ef46903dea usleep() chains to udelay() if called before task_start()
...so I can use usleep() for eeprom delays in the CL coming next...

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

BUG=chrome-os-partner:10200
TEST=if it boots, it worked

Change-Id: I564578f24452a4ac39abe79ff28cfff4b665ad2f
2012-05-29 09:38:58 -07:00
Randall Spangler
1aa57e140e Watchdog fixes
1) When frequency changes, reload the watchdog timer right away, or it
may expire before the next reload.  (Only matters when re-enabling the
PLL.)

2) Split out the timer/task debug output used by the watchdog into
their own routines, instead of assuming it's safe to call the command
handlers.  Also make the flushes in those print routines safe to call
from interrupt level.

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

BUG=none
TEST=waitms 1500; should print task dump again

Change-Id: I07e0ed24a526ae499566dab0bbeb0f5755cd5be6
2012-04-25 14:49:49 -07:00
Randall Spangler
0d19c59aba Implement task profiling
Also tracks the distribution of IRQs, so we can see what's triggering
interrupts.

Task profiling is optional, enabled via CONFIG_TASK_PROFILING.

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

BUG=chrome-os-partner:7464
TEST=taskinfo

Change-Id: I266f2b49bff9648cda446210d5a302b460fec244
2012-04-24 12:54:29 -07:00
Randall Spangler
f411bbbe19 Re-enable watchdog in watchdog_reload()
Signed-off-by: Randall Spangler <rspangler@chromium.org>

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

waitms 1500
(see watchdog trace)
waitms 1500
(should see watchdog trace again)
waitms 3000
(should see trace, then system should reboot)

Change-Id: Ieb5009d7a7bc9e1ed795e58efb0cb44a1eeb2706
2012-04-12 12:04:37 -07:00
Randall Spangler
a61d8db3d3 Change task messages to events
Signed-off-by: Randall Spangler <rspangler@chromium.org>

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

make BOARD={bds,link,daisy}
make tests
flash link system and make sure it boots

Change-Id: I1241a1895c083e387e38ddab01ac346ca4474eb9
2012-04-06 09:06:53 -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
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
5e22f8e51b expand properly the IRQ number for IRQ declaration macro
Expand the macros before building the priority variable name in order to
ensure we have a valid name.

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

BUG=None
TEST=check manually preprocessor expansion for several combinations.

Change-Id: I926821d42c966ac674e7d24254c9f22779f93ca2
2012-01-30 22:32:39 +00:00
Vincent Palatin
c89bea4a5b Go back to SoC independant IRQ vectors declaration
Preparatory work to introduce a second SoC : 1/5

Instead of putting hardcoded IRQ SoC name in the vector table,
upgrade the DECLARE_IRQ macro to expand its argument.

Also add a parameter to set the size of the NVIC table to save flash
memory.

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

BUG=None
TEST=run EC on BDS and see timer IRQs firing.

Change-Id: I44fefdabdd37d756492a71f24554979c72c1b50f
2012-01-25 22:47:12 +00:00
Vincent Palatin
16e43a3d0d Initial mutex implementation
They are designed to protect shared hardware resources (e.g. I2C
controller).
Please refrain using them as a general purpose synchronization primitive
for the tasks to avoid unintended slippery effects (e.g. priority inversion),
use the provided message-passing functions instead for that purpose.

The mutex variable (ie the "struct mutex") should be initially filled
with 0, but this is the default compiler behavior if you declare it as a
global variable.

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

BUG=None
TEST=make qemu-tests

Change-Id: I328f7eadf5257560944dbbbeda0b99d5b24520e8
2012-01-25 18:23:48 +00:00
Randall Spangler
37dcc1ab56 Handle all GPIO IRQs. Interrupts no longer enabled by default.
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7456
TEST=if it runs, it works

Change-Id: Ib82afab7d53203af31eefc9887feb98679266ac1
2012-01-17 15:21:20 -08:00
Randall Spangler
84a286b1f4 Use #defined constants for IRQ names
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=none

Change-Id: If07ac671cef6b9d0e9fe0a96bf04455a3d2626ff
2011-12-19 13:48:05 -08:00
Randall Spangler
1ce694189a Add IRQ constants, and task functions to enable/disable/trigger IRQs.
The constants don't work with the DECLARE_IRQ() macro yet, because it
relies on stringizing the IRQ number.

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

BUG=none
TEST=none

Change-Id: Ie6ddecd79e28c319b095089131579ba994a17da3
(cherry picked from commit e24904644a977f2618f51629cc066b93a3d53595)
2011-12-12 14:23:04 -08:00
Vincent Palatin
e24fa592d2 Initial sources import 3/3
source files mainly done by Vincent.

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

Change-Id: Ic2d1becd400c9b4b4a14d4a243af1bdf77d9c1e2
2011-12-07 19:10:02 +00:00