Commit Graph

25 Commits

Author SHA1 Message Date
Furquan Shaikh
d1aba367b7 jerry: Use HOSTCMD_ALIGNED instead of GPIO_SHORTNAMES
This is required to allow bumping up of host events to 64-bit by making
space in the rodata. CL 770923 had initially used GPIO_SHORTNAMES, but
HOSTCMD_ALIGNED seems to be a better option.

BUG=b:69329196
BRANCH=None
TEST=make -j buildall

Change-Id: I63699f9cec244925c031d81f50889851c6da8b5c
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/771931
Reviewed-by: Shawn N <shawnn@chromium.org>
2017-11-16 18:45:38 -08:00
Furquan Shaikh
1a0dedbf02 jerry: Enable CONFIG_COMMON_GPIO_SHORTNAMES
Turn on CONFIG_COMMON_GPIO_SHORTNAMES to save some space in rodata.

BUG=b:69329196
BRANCH=None
TEST=make -j BOARD=jerry

Change-Id: Ib1e4cb13c013cce7b0d6422b842ca47c0f4ff62c
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/770923
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2017-11-15 04:31:04 -08:00
Furquan Shaikh
a27f1049b6 power: Add flags parameter to power_signal_info
Replace structure member "level" in power_signal_info with "flags".
"level" has been used on all boards to indicate active-high or
active-low levels. Addition of "flags" allows easy extension of
power_signal_info structure to define various flags that might be
applicable to power signals (e.g. "level"). Going forward, additional
flag will be added in follow-up CLs.

Also, provide a helper function power_signal_is_asserted that checks
the actual level of a signal and compares it to the flags level to
identify if a power signal is asserted.

BUG=b:65421825
BRANCH=None
TEST=make -j buildall

Change-Id: Iacaabd1185b347c17b5159f05520731505b824b8
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/679979
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2017-10-03 14:26:09 -07:00
Shawn Nematbakhsh
6ba124a81b hostcmd: Remove EC_CMD_VBNV_CONTEXT handler for most boards
Most boards do not keep VBNV storage on the EC, so leave out the host
command handler by default.

BUG=chromium:693210
BRANCH=None
TEST=`make buildall -j`

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ia202ec7d73d1804d8430fe7516cc783afd86e89a
Reviewed-on: https://chromium-review.googlesource.com/446716
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2017-02-25 16:34:15 -08:00
Aseda Aboagye
ae3996fb2f jerry: Increase HC task stack size.
With ToT images, we were hitting a stack overflow in the host command
task.

BUG=none
BRANCH=none
TEST=disable EC SW sync, flash jerry, verify it boots to login screen.

Change-Id: I978b768c1619b4f0dfe862e96c31a91cebce8b87
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/440396
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-02-10 19:02:58 -08:00
Daisuke Nojiri
815b135690 Remove Makefile symlinks under board directory
This feature is inconsistent. Not all boards have such a symlink
(for a obvious reason).

This feature is fragile. It's most likely not tested and going to be
broken if not already. Developers won't like it if they have to test
two different ways to build boards before submitting patches.

This feature is not necessary. If you build EC in the standard way
(e.g. make BOARD=samus), these symlinks are not needed.

This feature is wasteful. Extra disk spaces are used and extra lines
are added to Makefile (increasing code complexity slightly).

BUG=chromium:626776
BRANCH=none
TEST=make buildall

Change-Id: Id5444284d773cb0e9225f39abd877441b8f61440
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359321
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-07-09 01:40:47 -07:00
Shawn Nematbakhsh
8f2c7d7f76 jerry: Free up flash space
Remove console command help strings to free flash space.

BUG=None
TEST=Build for jerry, verify free flash space goes from ~40 bytes to
~2500 bytes.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I3e250c86420978446ae0b348ded7646b13272486
Reviewed-on: https://chromium-review.googlesource.com/348073
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
2016-05-31 16:16:38 +00:00
Bill Richardson
5a9a8f3dbf cleanup: Add warning comment to gpio.inc files
With commit e9883124ff, a GPIO_INT macro was added. That change
also required that all instances of GPIO_INT in a board's
gpio.inc file come before any GPIO macros, or the interrupt
handler wouldn't work properly.

This CL just adds a warning comment about requirement to all
gpio.inc files.

BUG=chromium:471331
BRANCH=none
TEST=make buildall, test image on Cr50

This is a change to comments only. There is no new behavior to
verify, although I did run try out one new image just to be sure
nothing stupid happened.

Change-Id: I83f7819929a53bce3a8bae04d15b3ee3bda11738
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/329334
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2016-02-25 18:25:37 -08:00
Aseda Aboagye
29b084094f jerry: Increase UART TX buffer size.
Found out that the string that is printed from console_init() doesn't
show up on the EC console for jerry.  It seems that perhaps due to the
priority of the console task and the numerous prints during boot, that
print never makes it to the TX buffer.  Currently, there's about 7200
bytes available in the shared memory region, which indicates that
there's still a lot of free space.  Therefore, increase the UART TX
buffer size.

BUG=None
BRANCH=None
TEST=Flash jerry and verify that 'console is enabled' string shows up on
the EC console.
TEST=make -j buildall tests

Change-Id: Id0603a3b758b5c600d0b59f27040ead2ce48bbaf
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/329180
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2016-02-23 22:40:23 -08:00
Anton Staaf
0a644a9125 GPIO: Move definitions of GPIO_KB_INPUT and OUTPUT
Previously these were often done in board.c files, which made it
impossible to include the gpio.inc anywhere else.  As part of
refactoring the GPIO code we now need to be able to include gpio.inc
from common/gpio.c.  Moving these defines into gpio.inc makes them
available wherever gpio.inc is included.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=None
BUG=None
TEST=make buildall -j

Change-Id: I28e7b5a1d40b113ae824b18f020b2d1e51e0c08a
Reviewed-on: https://chromium-review.googlesource.com/328822
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2016-02-22 23:50:52 -08:00
Shawn Nematbakhsh
2431602575 cleanup: Standardize use of CONFIG_I2C and add MASTER/SLAVE CONFIGs
Some chips previously defined CONFIG_I2C and others didn't. Standardize
the usage by removing CONFIG_I2C from all config_chip files and force it
to be defined at the board level. Also, make boards define
CONFIG_I2C_MASTER and/or CONFIG_I2C_SLAVE based on the I2C interfaces
they will use - this will assist with some later cleanup.

BUG=chromium:550206
TEST=`make buildall -j`
BRANCH=None

Change-Id: I2f0970e494ea49611abc315587c7c9aa0bc2d14a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/310070
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-03 09:08:21 -08:00
Mary Ruthven
49d4254bd4 Jerry: enable virtual battery
BUG=chromium:484841
BRANCH=none
TEST=check power_supply_info works properly on Jerry

Change-Id: I166fd4fc876b2d71f82e8fc7b33e4268a30be567
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/309264
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-29 10:31:40 -07:00
Ben Lok
c2cf0fb198 oak: enable MBKP events for PD events
(refer to CL:273620) enable the MKBP event feature to send host event
and wire up the PD specific events.
But, CONFIG_MKBP_EVENT conflicts with CONFIG_KEYBOARD_PROTOCOL_MKBP,
due to the GPIO name of EC interrupt pin. Align the GPIO naming of EC
interrupt pin to EC_INT_L.

BRANCH=none
BUG=chrome-os-partner:44643
TEST=On Oak rev3, plug/unplug USB devices and add kernel trace to see
the PD events happening.

Change-Id: I10de9c6611583bb6165bdc1848e542d4b8bba954
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/296012
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Rong Chang <rongchang@chromium.org>
2015-08-31 22:59:52 -07:00
Myles Watson
065b177a4d Jerry: add "cleanup: fix all the header guards"
104f811e67

BUG=chromium:511324
TEST=make buildall -j
BRANCH=none

Change-Id: I994e11c94413d7b8683b64e86807ba45b61c7eea
Signed-off-by: Myles Watson <mylesgw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288239
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
2015-07-25 17:45:33 +00:00
Myles Watson
3348557d82 Jerry: add "cleanup: remove board_discharge_on_ac"
Apply ac1cba419a to Jerry.

BUG=chromium:511324
TEST=make buildall -j
BRANCH=none

Change-Id: I04f168f8e1a8e6a1e7c21cc3ce8c06315d9e7495
Signed-off-by: Myles Watson <mylesgw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288238
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-07-25 17:45:28 +00:00
Myles Watson
24a0b31732 Jerry: Revert "Remove obsolete EC targets"
Jerry is being used for FAFT in the lab.  Remove Pinky instead.

This reverts part of commit bdc680d8ed.

BUG=chromium:511324
TEST=make buildall -j
BRANCH=none

Change-Id: I034a814ffe3397728e443f99ed270d412be1bc1d
Signed-off-by: Myles Watson <mylesgw@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288236
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
2015-07-25 01:22:42 +00:00
Randall Spangler
bdc680d8ed Remove obsolete EC targets
This is needed to allow cleanup and refactoring of the EC codebase in
ToT.  All of these boards use firmware from branches and uploaded to
BCS, so they don't actually care that ToT can't build their firmware.

BUG=chromium:493866
TEST=build on the following using cbuildbot:
    daisy-paladin
    falco-paladin
    link-paladin
    nyan-paladin
    peppy-paladin
    samus-paladin
    squawks-paladin
    daisy_spring-paladin
CQ-DEPEND=CL:274121,CL:274127
BRANCH=none

Change-Id: I19598843755ded7b2385cc712ef463e5de4411b8
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274121
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-06-05 19:35:06 +00:00
Steven Jian
937cc8a64e mec1322: Simplify GPIO lists
Our existing GPIO macros use port# / gpio#, but the concept of different
GPIO ports does not exist on the mec1322. Therefore, add new GPIO macros
for chips which do not have distinct GPIO ports.

BUG=None
BRANCH=None
TEST=make buildall -j

Change-Id: Ibda97c6563ad447d16dab39ecadab43ccb25174b
Signed-off-by: Steven Jian <steven.jian@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/262841
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2015-05-27 03:58:16 +00:00
Aseda Aboagye
e9883124ff gpio: Refactor IRQ handler pointer out of gpio_list
In the gpio_info struct, we had a irq_handler pointer defined even
though a majority of the GPIOs did not have irq handlers associated. By
removing the irq_handler pointer out of the struct, we can save some
space with some targets saving more than others. (For example, ~260
bytes for samus_pd).

This change also brings about a new define:

     GPIO_INT(name, port, pin, flags, signal)

And the existing GPIO macro has had the signal parameter removed since
they were just NULL.

     GPIO(name, port, pin, flags)

In each of the gpio.inc files, all the GPIOs with irq handlers must be
defined at the top of the file. This is because their enum values from
gpio_signal are used as the index to the gpio_irq_handlers table.

BUG=chromium:471331
BRANCH=none
TEST=Flashed ec to samus and samus_pd, verified lightbar tap, lid, power
button, keyboard, charging, all still working.
TEST=Moved a GPIO_INT declaration after a GPIO declaration and watched the build
fail.
TEST=make -j BOARD=peppy tests
TEST=make -j BOARD=auron tests
TEST=make -j BOARD=link tests

Change-Id: Id6e261b0a3cd63223ca92f2e96a80c95e85cdefb
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/263973
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-04-10 22:08:25 +00:00
Alexandru M Stan
4003052d66 jerry: Switch led to CONFIG_LED_POLICY_STD
BUG=chrome-os-partner:35355,
TEST=The led behavior should match the cros spec
BRANCH=None

Change-Id: I360e30ff72d8c874651544ea41479189a0ac7e08
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/240706
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-01-14 21:49:45 +00:00
Alexandru M Stan
a0395b1ea9 rockchip: Enable UART RX DMA
UART with no DMA is likely to drop RX characters when system is busy. This is
because the UART interrupt is lower priority than the spi_event GPIO interrupt.
We can work around this by enabling the DMA, so no UART interrupts are required
while recieving, since everything will happen in DMA.

This replaces the other patch(CL 236089) which suggested changing UART IRQ
priority.

BUG=chrome-os-partner:33451
TEST=get firmware to poll the EC for keyboard presses, type really fast on the
keyboard, note how no character is lost anymore
TEST=faft dev mode test now passes, faft is able to type "kbpress $(insert args
for Ctrl+D) 1" correctly without missing characters because firmware is loading
the EC with keyboard polls
TEST=While '+'s are scrolling on the EC terminal paste something big like this:
"kbpress 1 1 1
kbpress 1 1 0
123456789012345678901234567890
". Both kbpresses should be interpreted/executed properly(no "kbprss") and there
should be no missing digits in the echo back.
BRANCH=None

Change-Id: I01d4eaa23f10f07083875846ea48c34da2e2f6ce
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236365
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-12-18 00:46:27 +00:00
Alexandru M Stan
5ec4f320f4 Jerry: Move AC_PRESENT for the new board
The new board will move AC_PRESENT to another pin in order to avoid the
[1.052524 Overriding AC_PRESENT with KB_IN00 on EXTI8] problem.

BUG=chrome-os-partner:34024
TEST=EC should react to AC events
BRANCH=None

Change-Id: I5c1110f10a3ed2704593c749cef35ab73fceb3e8
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/234586
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Jerry Parson <jwp@chromium.org>
2014-12-11 21:09:45 +00:00
Chris Zhong
1d4c619a0a Jerry: modify the power led polarity
the power led polarity is wrong, so reverse it

BRANCH=None
BUG=chrome-os-partner:33269 chrome-os-partner:32782
TEST=power led is works correctly

Change-Id: I4e91ea185ee5cb1f5b5202832a967244313062b4
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/230170
Reviewed-by: Lin Huang <hl@rock-chips.com>
Tested-by: Lin Huang <hl@rock-chips.com>
Reviewed-by: Wei-Ning Huang <wnhuang@chromium.org>
Commit-Queue: Lin Huang <hl@rock-chips.com>
2014-11-17 16:34:09 +00:00
Chris Zhong
208f28fac1 Jerry: modify gpio config, hibernate
Added hibernate wakeup pin(EC_WAKE) that covers both AC_PRESENT and LID_OPEN. It pulses a
rising edge when either of them have a rising edge.

The power button was also inverted to handle hibernation better, now it's low
except when pressed it temporarly goes high.

BRANCH=None
BUG=chrome-os-partner:33269 chrome-os-partner:32782
TEST=make BOARD=jerry
Try hibernating, all wakeup sources should work, it shouldn't stay hibernated.
All signals(AC, lid, power button) should work equally well as in pinky.

Change-Id: I894135bdfd5600919296f7510dc9cd1acd567ddc
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/228763
2014-11-13 04:23:22 +00:00
Katie Roberts-Hoffman
908b3f559b Add initial support for jerry
BUG=chrome-os-partner:33269
TEST=make BOARD=jerry; ./util/flash_ec BOARD=jerry
(on a pinky rev2 as a sanity)

Change-Id: I2c54e4044a65a0014adb32dd46f74bf5ed11b02d
Signed-off-by: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225300
Reviewed-by: Alexandru Stan <amstan@chromium.org>
2014-10-25 08:14:16 +00:00