Commit Graph

7 Commits

Author SHA1 Message Date
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