Commit Graph

535 Commits

Author SHA1 Message Date
Simon Glass
ea845714fd Add gpio_get_name() to return the name of a signal
Add this to the GPIO API. It seems that the implementation is copied
in LM4 and STM32 so I have reluctantly done the same with this new
function.

BUG=chrome-os-partner:9424
TEST=build and boot on Daisy

Change-Id: Ifddc52e69b2b33af2645384c0171dd264e588fcd
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-05-03 22:05:57 -07:00
Gerrit
b67e435d14 Merge "Add header_size in struct jump_data." 2012-05-03 17:16:31 -07:00
Simon Glass
59c4075172 daisy: Re-introduce SPI protocol support
The changes in the message protocol break SPI support, so re-introduce
these, this time in the driver itself.

We add the concept of an option preamble in the message, a length and a
trailing byte.

BUG=chrome-os-partner:9426
TEST=run U-Boot, see that keyboard works correctly now.

Change-Id: I83b4af7e3745b935ffafcd9e2f521fce77e3bc6e
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-05-03 14:08:56 -07:00
Gerrit
5ba4576cf3 Merge "timer: Add timestamp_expired() to check for expiry" 2012-05-03 12:05:25 -07:00
Louis Yung-Chieh Lo
7cac1d3b52 Add header_size in struct jump_data.
The position of jump_tags was shifted every time a new field was added
to struct jump_data. This broke the sysjump hook badly.

To make this more scalable, add a header_size field in struct jump_data.
Then the new code can always prepend (or reduce if jump_data becomes smaller)
some spaces between jump_data and jump_tags.

BUG=chrome-os-partner:9447
TEST=EC upgrade from EC 517 (2231) to this version, and keyboard keeps working.
Note that EC 526 (2235) to this version is not working because we have no way
to identify that header version change.

Change-Id: If1b506c6f7d22e5affaaf8ada15990f60d2f957a
2012-05-03 21:30:18 +08:00
Gerrit
2d592ca924 Merge "Add charger option output in interactive console" 2012-05-03 06:19:05 -07:00
Rong Chang
a75fcb938c Add charger option output in interactive console
Signed-off-by: Rong Chang <rongchang@chromium.org>

BUG=chrome-os-partner:8982
TEST=manual
  run console command 'charger'
  charger option will be displayed in bin and hex output

Change-Id: I461bce347f13eeb4f2c8595b83a7ba4c7d40ea58
2012-05-03 20:32:13 +08:00
Vic Yang
b5a8816283 Fix a bug in temperature sensor address definition
The address of charger temperature sensor and memory temperature sensor
are interchanged. Fix this in this CL.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:9450
TEST=Manual

Change-Id: I20ae4d39ef13992ca7cac32bb2e6be12e195731e
2012-05-03 16:56:13 +08:00
Simon Glass
4935a885ee timer: Add timestamp_expired() to check for expiry
Rather than open code this each time, create a function for this. The
wrap-around condition may not be needed, if the timer starts at zero,
since we have 64 bits to play with.

BUG=chrome-os-partner:9424
TEST=build and boot on daisy

Change-Id: I84ae651212769b5927c452bc03f31f60a25a829e
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-05-02 19:43:39 -07:00
Vincent Palatin
7026744388 remove deprecated stm32-based boards
We no longer support ADV EVT0 board and Discovery reference design.

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

BUG=None
TEST=make BOARD=daisy && make BOARD=link

Change-Id: I7eb81e5271c070b17f018ac9c14491f1804c0e08
2012-05-02 21:36:40 +00:00
Gerrit
5ee635cf49 Merge "daisy: EVT1 pin mapping" 2012-05-02 14:32:51 -07:00
Gerrit
b1ec950ccf Merge "Make lightbar task stop dropping events." 2012-05-02 13:28:40 -07:00
Gerrit
09def90373 Merge "Enhance LPC EC REBOOT reset command to allow to request recovery" 2012-05-02 12:57:45 -07:00
Bill Richardson
bca494aa53 Make lightbar task stop dropping events.
BUG=chrome-os-partner:9350
TEST=none

Change-Id: I5a208aeb74f34e82393a3208f4a0cd48cdc7bff4
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-02 11:01:11 -07:00
David Hendricks
653f6420f4 daisy: EVT1 pin mapping
This modifies the existing daisy's board.c to use the new pin mapping.

BUG=None
TEST=Tested on Daisy-EVT1

Signed-off-by: David Hendricks <dhendrix@chromium.org>

Change-Id: I717ce78df1ed29843d1498e979956c6ffdb05e80
2012-05-02 10:41:59 -07:00
Vincent Palatin
9f7fa4e800 make verified boot feature optional
this fixes the build breakage on stm32-based platforms.

In the linker script, remove the ASSERT since this macro is not designed
to work in that context and this size condition is already verified by
the linker by setting the "length" of the "FLASH" memory region.

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

BUG=None
TEST=make BOARD=link && make BOARD=daisy
boot on Link and Daisy

Change-Id: I08964749d44f47caa0a359bc93c303a9611e5d73
2012-05-02 15:57:43 +00:00
Louis Yung-Chieh Lo
f1467b61b7 Refine the EC flash size in FMAP structure.
BUG=none
TEST=make and dump:
% dump_fmap build/link/ec.bin
...
fmap_size:       0x0003f800 (260096)
...

Change-Id: I9e5a5d1a1d2c9d3e6660a13d5b2fff438517af7e
2012-05-02 15:29:07 +08:00
Vincent Palatin
cab258137b introducing chip variant for stm32 family [3/3]
Add STM32F support.

Based on David's changelist.

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

BUG=chrome-os-partner:9057
TEST=make BOARD=daisy ; make BOARD=adv ; make BOARD=discovery

Change-Id: Ide817d11480f0b56f67deaae3c08bc631f605075
2012-05-01 17:13:33 -07:00
Vincent Palatin
a9ceb116c7 introducing chip variant for stm32 family [2/3]
Add a parameter to define the chip variant and pass it to build/make
processes.

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

BUG=chrome-os-partner:9057
TEST=make BOARD=daisy ; make BOARD=adv ; make BOARD=discovery

Change-Id: I87b65b582ed5fc2cf5966446e15224ac15e328e9
2012-05-01 17:13:33 -07:00
Gerrit
709eee03f5 Merge "introducing chip variant for stm32 family [1/3]" 2012-05-01 17:08:27 -07:00
Gerrit
306e9632f9 Merge "stm32: fix ADV compilation" 2012-05-01 17:08:26 -07:00
Vincent Palatin
539c397fb1 introducing chip variant for stm32 family [1/3]
just rename STM32L to STM32.
Most of the STM32L15x code is common with STM32F1xx.

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

BUG=chrome-os-partner:9057
TEST=make BOARD=daisy ; make BOARD=adv ; make BOARD=discovery

Change-Id: I819eff5fcd23deff57f5f6dedcf37e6c421b96c2
2012-05-01 22:59:51 +00:00
Vincent Palatin
285fa08d10 stm32: fix ADV compilation
power related GPIO has been renamed, update the board definitions.

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

BUG=None
TEST=make BOARD=adv

Change-Id: I2f0e1e9e93af22c1a6f64f354336bf0c30e9c5cd
2012-05-01 22:59:51 +00:00
Bill Richardson
8d921af0bb Add basic FMAP to EC firmware image.
This is very basic, so you can only rely on RO_SECTION, RW_SECTION_A, and
RW_SECTION_B for now. We'll fill in more regions as we add vboot stuff.

Still, you should be able to do things like this:

  flashrom -p internal:bus=lpc -r ec.bin

  flashrom -p internal:bus=lpc -w ec.bin -i RW_SECTION:ec.B.flat

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

Build the image, look for the FMAP in it.

  cd src/platform/ec
  make BOARD=link
  dump_fmap ./build/link/ec.bin

Change-Id: I0adbbfb8e975faae805bda271873fcef46590cf4
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-01 15:54:39 -07:00
Vadim Bendebury
0467763f5a Enhance LPC EC REBOOT reset command to allow to request recovery
When the host reboots the EC it should be able to request the EC to
force recovery mode after reset. This is achieved by extending the
REBOOT EC command with a bitmask byte, with bit 0 dedicated to
recovery request.

So, when BIOS on the way up determines that recovery is requested, but
the EC is not running from the RO space, the BIOS would reset the EC
forcing it to run from RO and to request recovery mode through the LPC
bitmask. Then BIOS will restart itself ensuring that the system comes
up in consistent state.

Some refactoring was also done to make the code a bit more compact.

BUG=chrome-os-partner:9040
TEST=manual
  . tested along with coreboot changes (test described in the coerboot CL).

Change-Id: I29801b6aec80da0901ba0e8db8e92e615cc778bd
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
2012-04-30 15:36:41 -07:00
Gerrit
a5027ece4c Merge "Prevent issuing warning when fan is off" 2012-04-30 09:31:13 -07:00
Vic Yang
0a7701be57 Prevent issuing warning when fan is off
LM4 reports fan stalled when fan speed is set to 0. Need to check this
before issuing warning.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:7497
TEST=Did not see fan stall warning when fan speed is 0.

Change-Id: I8eecca8516b5442d4943d9195d04acc5b4041085
2012-04-30 21:33:37 +08:00
Rong Chang
a017e30361 Fix ectool battery command printable character detection
Signed-off-by: Rong Chang <rongchang@chromium.org>

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

Change-Id: Ic6d78aaec55d9a357b5c265f303cac3f44505fad
2012-04-30 19:01:07 +08:00
Gerrit
91f7a143d6 Merge "daisy v1.02: power sequencing updates" 2012-04-27 18:49:11 -07:00
David Hendricks
9a3e056af5 daisy v1.02: power sequencing updates
Note: This will not work on older (0.94 boards).

- Use power button (KB_PWR_ON) to drive power sequencing events and
  disable EC_PWRON. This is because EC_PWRON and KB_PWR_ON shared an
  external interrupt line. Daisy v2.x will fix this so that both can
  be enabled. Note: KB_PWR_ON is active low, wihle EC_PWRON is active
  high.

- Relay power button state to PMIC. Also, since we are driving
  PMIC_PWRON instead of PMIC_ACOK now, so updated the naming.

- Add a keyboard power button debounce period to avoid accidentally powering
  the system back on after keyboard power-off.

Signed-off-by: David Hendricks <dhendrix@chromium.org>

BUG=None
TEST=tested on daisy (frh@ verified behavior using a scope)

Change-Id: I5338eebe42c9b43a07af371a450db23276b2a574
2012-04-27 17:58:27 -07:00
Gerrit
e285065ecf Merge "stm32: change slave address to 0x3c" 2012-04-27 17:24:15 -07:00
David Hendricks
e896954165 stm32: change slave address to 0x3c
This is a hack to avoid issues caused by incompatible
messaging protocol updates.

During protocol development, the length of a packet changed which
could cause the system to hang (or other issues) if the host
requested the wrong number of bytes from the EC. This avoids the
issue with development versions of the protocol, by simply making
the EC unresponsive on the old port.

BUG=none
TEST=Tested on Daisy 1.02 and EVT1

Change-Id: I96495d4c2bd14b377bef862801934d5168cb6cc7
Signed-off-by: David Hendricks <dhendrix@chromium.org>
2012-04-27 16:36:19 -07:00
Vincent Palatin
2f7b0116a4 close race condition window in expired timer processing
ensure we cannot miss any timer, no matter how slow is the CPU and how
many simultaneous timer we set.

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

BUG=chrome-os-partner:9319
TEST=boot Link EC and do long key press, see the EC watchdog panic no
longer happening.

Change-Id: I1ecc88fc06698175444fd86cce4c0abb5e846996
2012-04-27 17:18:45 +00:00
Vincent Palatin
6ac7f6f671 link: enable +5V always-on at startup
The EVT boards will have an enable signal for the +5V always-on rail
connected to GPIO PK4.
Just turn it on at startup to ensure that EVT boards will run out of the
box with the current EC firmware.
(PK4 is a test point on proto-1 board, this should be harmless).

We can later implement fancier power saving scheme by enabling it only
when we enter S3.

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

BUG=chrome-os-partner:9284
TEST=boot Linux kernel on Link proto-1 and Link-1 proto-1 reworked with
+5V Always-on enable on PK4.

Change-Id: I26527480c7cd364f3fabcaabaadd079a332f9c1c
2012-04-27 15:37:07 +00:00
Rong Chang
6eafff7ed3 Fix ectool battery command corrupts characters
Signed-off-by: Rong Chang <rongchang@chromium.org>

BUG=chrome-os-partner:9152
TEST=manual
  run latest ectool with old EC image

Change-Id: I09d4f6e8fcc131da227fc5a9c48291b08dfb6d19
2012-04-27 16:06:49 +08:00
Bill Richardson
31190cf215 Create host-side lightbar bikeshedding tool.
BUG=chrome-os-partner:7839
TEST=manual

  cd src/platform/ec
  make BOARD=link

  copy ./build/link/util/lbplay to the host and run it as root.

Change-Id: I6a4a842b7500751185c8f4c2744f4389226bae9b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-26 13:57:19 -07:00
Gerrit
9a59d98b3d Merge "Issue warning on fan stall." 2012-04-26 10:16:24 -07:00
Gerrit
b4f69c406d Merge "Give ectool the same lightbar commands as the console." 2012-04-26 01:46:29 -07:00
Gerrit
eca2748195 Merge "Adjust thermal engine thresholds" 2012-04-26 01:06:58 -07:00
Vic Yang
8b1dd41d77 Adjust thermal engine thresholds
Adjust fan step thresholds:
  T=55C Fan=20%/2200RPM
  T=65C Fan=40%/4400RPM
  T=75C Fan=60%/6600RPM
  T=85C Fan=80%/8800RPM
  T=95C Fan=100%/11000RPM
Also set minimum fan speed to 0 rpm.

Signed-off-by: Vic Yang <victoryang@chromium.org>

BUG=chrome-os-partner:8466
TEST=Manual test

Change-Id: I609853f2eceb9a6a43fbeb500084e82b1461f092
2012-04-26 15:09:27 +08:00
Vic Yang
7710ed563a Issue warning on fan stall.
When PWM module detects fan stall, issue SMI warning and print warning
message to console.

Signed-off-by: Vic Yang <victoryang@google.com>

BUG=chrome-os-partner:7497
TEST=Disconnect fan and power up. See warning message.

Change-Id: I4d96595f7f3cdfab5df333afc35206304bacab9d
2012-04-26 13:45:43 +08:00
Bill Richardson
e763812a3a Give ectool the same lightbar commands as the console.
BUG=chrome-os-partner:7839
TEST=manual

Try "lightbar help" on the EC console and "ectool lightbar help" on the
host. You should see the same commands and behavior.

Change-Id: I6e879e8bb892ef5ada7ef85a97fdf243149f4cb6
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-04-25 18:42:36 -07:00
Vincent Palatin
93a4ed6bcd Fix test configurations build errors
fix small modularity issues to ensure we are able to compile all boards
in "tests" configuration.

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

BUG=chrome-os-partner:8546
TEST=make BOARD=link tests && make BOARD=bds tests
make BOARD=daisy tests && make BOARD=adv tests && make BOARD=discovery tests

Change-Id: I9eed0195af6bfd3b47ef74e3cb27966c4365c345
2012-04-25 23:59:23 +00:00
Gerrit
f93b95cac9 Merge "stm32l: set SYSCFGEN for boards using stm32l" 2012-04-25 16:56:05 -07:00
Gerrit
0d9743c30b Merge "Remove unused uart.h includes" 2012-04-25 16:56:04 -07:00
Gerrit
fe16e4b3a9 Merge "Watchdog fixes" 2012-04-25 16:56:04 -07:00
David Hendricks
340f1feb9b stm32l: set SYSCFGEN for boards using stm32l
This sets the SYSCFGEN bit. Writes to external interrupt config
registers (SYSCFG_EXTICRn) will not stick unless this is set.

Signed-off-by: David Hendricks <dhendrix@chromium.org>

BUG=none
TEST=tested on daisy

Change-Id: I9a92b424e9ac1f909206f89ed773248807619ab2
2012-04-25 16:12:57 -07:00
Gerrit
0d53a4cb66 Merge "simplified message protocol" 2012-04-25 16:08:34 -07:00
Randall Spangler
5cd6f3cf7f Remove unused uart.h includes
Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=none

Change-Id: I8f9c6e67427a5c7f2c42754b421db44504f9c10d
2012-04-25 15:56:10 -07:00
Gerrit
d85fa75275 Merge "Add more info to pll debug command" 2012-04-25 15:13:05 -07:00