Commit Graph

545 Commits

Author SHA1 Message Date
David Hendricks
4c8fa572b5 Initial Snow board port
Mostly stolen from Daisy.

Notable differences:
- No SYSCFGEN required for external interrupts ?
- No GPIO H bank on STM32F100, OSC_IN and OSC_OUT are not available
  --> CODEC_INT and ENTERING_RW signals are missing

BUG=None
TEST=Tested on ADV2/Snow, able to see EC serialconsole

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I955e2ff180d064294d67b630ae2ee6cfcfe52ab9
2012-05-04 23:10:29 +00:00
Gerrit
4daea3c1ab Merge "daisy: fix a bug in the GPIO enum listing" 2012-05-04 15:52:51 -07:00
David Hendricks
7cbb8df538 daisy: fix a bug in the GPIO enum listing
These GPIOs should have been removed in fd5d6c.

BUG=Yes.
TEST=built a new image and booted Daisy-EVT1

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

Change-Id: Idce4384cdbe548c2e4fe2be8b52e4275445c9f1b
2012-05-04 14:46:11 -07:00
Bill Richardson
3b361af2a7 Update EC config and FMAP to reserve room for vboot signatures
This just reserves room. It doesn't actually perform any verification yet.

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

  make BOARD=link
  dump_fmap build/link/ec.bin

Change-Id: I424db1d601a614be3dfe5abb200e24e8bc62e47e
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
2012-05-04 14:42:58 -07:00
Gerrit
d5deade06f Merge "Add link helper procedure" 2012-05-04 14:31:59 -07:00
Vadim Bendebury
1cb4a69b92 Add link helper procedure
Add a Jim procedure to program the Link EC image from the default
location as generated by 'emerge-link chromeos-ec'.

BUG=none
TEST=manual
  . emerge-link chromeos-ec
  . start openocd as described in the Link care and feeding document
  . in the port 4444 terminal session type
    flash_emerged_link
  . observe it succeed

Change-Id: Ibfbc38060d7e82ec8c83a73e2ccadff81d633ae4
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
2012-05-04 13:42:26 -07:00
Louis Yung-Chieh Lo
391925a1cb Implement new write protect for host commands.
Rework to call functions in flash_common.c.

Also fixed a bug in parsing size of parse_offset_size().

Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>

BUG=chrome-os-partner:8448
TEST=on link
(CONSOLE) flashwp set 0x3d000 0x1000
(CONSOLE) flashwp lock
(HOST)    flashrom -p internal:bus=lpc --wp-status
          WP: write protect is enabled
          WP: write protect range: start=0x0003d000, len=0x00001000

Change-Id: I4a53735c851ebf4bb0c01a55a1d301d5b706ee0c
2012-05-04 22:46:28 +08:00
Gerrit
0ad2f9226f Merge "Assert PROCHOT when overheated and lower fan control threshold" 2012-05-04 04:55:44 -07:00
Simon Glass
763eb6197e daisy: Rename power signals to indicate polarity
GPIO_KB_PWR_ON and GPIO_PMIC_PWRON are active low, so add _L to each
name to make this clearer.

BUG=chrome-os-partner:9424
TEST=very ad-hoc:
1. build and boot on daisy, flash U-Boot with USB using
'cros_bundle_firmware -w usb', inserting daisy
USB cable when it says 'Reseting board via servo...'
2. Press cold reset, then power on, see that it powers on
3. Then hold power-on for 8 seconds and see that it power off
4. XPSHOLD function not tested yet

Change-Id: Ibdc0064477c36e8658ef5605cdd5811c2283aff9
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-05-03 22:06:33 -07:00
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
020d74242e Assert PROCHOT when overheated and lower fan control threshold
We need to assert PROCHOT signal at/before 68 degree-C. Let's assert it
when CPU is at 68 degree-C. Also, we lower fan speed control threshold
to max fan speed at 65 degree-C.

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

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

Change-Id: Iec0d05308b1310f89bc0a2edb1ad632c8ca96c87
2012-05-03 19:48:51 +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