Commit Graph

17 Commits

Author SHA1 Message Date
Randall Spangler
959c38da68 Define non-present interrupt handlers as null
This fixes linker errors when the X86_POWER and/or POWERBTN tasks are disabled.

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

BUG=none
TEST=remove X86POWER and POWERBTN tasks from ec.tasklist and make

Change-Id: I8a95020925e32ac4f80b9363f5aa6ab0a2d9ccd1
2012-01-25 11:04:51 -08:00
Vincent Palatin
d356dea61e Add modularity to the build
You can now enable/disable tasks more easily.
To conditionally compile a C file depending on the task FOO activation,
just write something like that in the build.mk file :
common-$(CONFIG_TASK_FOO)+=foo_source.o

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

BUG=None
TEST=make all BOARD=link && make qemu-tests

Change-Id: I760fb248e1599d13190ccd937a68ef47da17b510
2012-01-24 23:17:07 +00:00
Randall Spangler
a2a85365d6 Use correct ADC channel for charger current on link
Signed-off-by: Randall Spangler <rspangler@chromium.org>

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

Change-Id: I36ab37a8cf1c3e4bf41bfb38e622e766cee8a4c4
2012-01-23 16:39:54 -08:00
Randall Spangler
51df9457f4 Add (disabled) support for compiling code for RAM.
When code is compiled for RAM (by re-enabling the flag in board.mk),
use the following openocd commands to load it:

reset halt
load_image ../../../build/link/ec.RO.flat 0x20000000 bin
reg 15 0x20000400
resume

Note that you'll also usually need to disable a bunch of modules to make
the code small enough to fit in RAM.

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

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

Change-Id: I2b3cc69b361ad73706af3ff6de1ce952e8d5a0a9
2012-01-23 12:40:29 -08:00
Vic Yang
af8026cdf9 USB Charging control
Implement TPS2543 USB charging control.
It contains routine for setting each USB port as dedicated charging port
or standard downstream port. To allow us controlling the current
distributed to each port, we can select whether to allow 500mA or 1500mA
for each port.

BUG=chrome-os-partner:7476
TEST=Added USB port definition for BDS and tested GPIO output voltage
level is correct for all modes.

Change-Id: I19bc4b30d333aa802f868ebfc3a398b30e99ba0f
2012-01-19 10:54:37 +08: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
002bc4278b Add x86 power state machine
For bringup, this powers on the x86 unconditionally.

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

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

Change-Id: Ib23e56d38ab42f8d8a4dbd1ba9dce12f0c3eeec9
2012-01-17 12:19:47 -08:00
Randall Spangler
3c90a7f2ac Move board-specific GPIO lists to board-specific files
Signed-off-by: Randall Spangler <rspangler@chromium.org>

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

Change-Id: I47fd5d709a9575e41fdcdf21a7440ebbb762cef5
2012-01-12 16:47:46 -08:00
Randall Spangler
c9352ce6ca Add constants for all GPIOs.
Signed-off-by: Randall Spangler <rspangler@chromium.org>

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

Change-Id: I3b77cbbb7f0cc12a4daae7ababd603b5d7af32d1
2012-01-11 16:30:56 -08:00
Randall Spangler
1f2f8627c3 Add JTAG module
This just ensures the JTAG pins are reset to JTAG function on warm reboot.

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

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

Change-Id: I0cccdbe7a68c228db7f354898ed30598e9fabff0
2012-01-11 11:37:55 -08:00
Randall Spangler
39f86d2fad Split power button code into its own file
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:7499
TEST=press and release power button; should see debug messages

Change-Id: I8909ae4643afc98753edb690771618ad43135e3e
2012-01-10 14:14:59 -08:00
Louis Yung-Chieh Lo
c425568c40 Interrupt-based keyboard matrix scan.
By default the scanning code would pull-low all column pins and listen to
any key press interrupt on input pins. This can save power compared to the
repeatly polling.

Once a key is pressed, the scanning code enters the busy loop and pull-low
column pins one by one. Then generate the scan code to host.

The code keeps polling after 1 second after no key is pressed. Then goes
back to interrupt mode.

BUG=none
TEST=Manual tested on S*y machine.

Change-Id: I0bf8877450dbd6ad1197a2fe1714ab755dc49a80
2011-12-29 21:12:07 +08:00
Vic Yang
5569f3e3a3 Implement EC lid switch handler
Implement EC lid switch interrupt handler and debouncing.

BUG=chrome-os-partner:7363
TEST=Manually test lid switch output signal is correct.
Use UART console to see debouncing is correct.

Change-Id: I74aad63330716da017fc4a57002349461c6a9b26
2011-12-29 12:04:03 +08:00
Randall Spangler
caba91fe27 Change register.h macros to use inline funcs without concatenate (##).
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=none

Change-Id: Ia8c54bfeff2351e8f76d97db558952a9d2ca9a45
2011-12-13 09:50:53 -08:00
Randall Spangler
20886cb9c0 Add user-mode LPC endpoint
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST='ectool hello' on target system

Change-Id: I39845c2ea107ea6f85ef556d58e49343f5a0e9c0
2011-12-08 16:18:20 -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
Randall Spangler
bdf7da5b08 Initial sources import 1/3
source files mainly done by Randall.

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

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