summaryrefslogtreecommitdiff
path: root/board/glados_pd/board.c
Commit message (Collapse)AuthorAgeFilesLines
* Treat SYSTEM_IMAGE_RW_B also as RW copyDaisuke Nojiri2017-09-091-1/+1
| | | | | | | | | | | | | | SYSTEM_IMAGE_RW_B hasn't been globally treated as a RW copy. This change makes EC treat it also as a RW copy. BUG=none BRANCH=none TEST=make buildall Change-Id: Iae5a9090cdf30f980014daca44cdf8f2a65ea1f2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/656337 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: DECLARE_CONSOLE_COMMAND only needs 4 argsBill Richardson2016-08-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since pretty much always, we've declared console commands to take a "longhelp" argument with detailed explanations of what the command does. But since almost as long, we've never actually used that argument for anything - we just silently throw it away in the macro. There's only one command (usbchargemode) that even thinks it defines that argument. We're never going to use this, let's just get rid of it. BUG=none BRANCH=none CQ-DEPEND=CL:*279060 CQ-DEPEND=CL:*279158 CQ-DEPEND=CL:*279037 TEST=make buildall; tested on Cr50 hardware Everything builds. Since we never used this arg anyway, there had better not be any difference in the result. Change-Id: Id3f71a53d02e3dc625cfcc12aa71ecb50e35eb9f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/374163 Reviewed-by: Myles Watson <mylesgw@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Deferred: Use deferred_data instead of function pointerAnton Staaf2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | Previously calls to hook_call_deferred were passed the function to call, which was then looked up in the .rodata.deferred section with a linear search. This linear search can be replaced with a subtract by passing the pointer to the deferred_data object created when DECLARE_DEFERRED was invoked. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None CQ-DEPEND=CL:*255812 TEST=make buildall -j Change-Id: I951dd1541302875b102dd086154cf05591694440 Reviewed-on: https://chromium-review.googlesource.com/334315 Commit-Ready: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* glados_pd: Add WP_L input GPIO for future boardsShawn Nematbakhsh2016-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | Future glados-derived boards are adding a WP_L GPIO input. Add support for this input, which will apply only if CONFIG_SYSTEM_UNLOCKED is not defined. Undefining CONFIG_SYSTEM_UNLOCKED will result in unpredictable WP GPIO behavior for all boards that currently exist, so it should only be undef'd right before MP FW is released. BUG=chrome-os-partner:50518, chrome-os-partner:50519 BRANCH=glados TEST=Verify 'ectool gpioget A13 --dev=1' always indicates a GPIO state '1' on an old chell_pd without WP_L input. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Id50a13cce54bc2013d83613ce5599ffde6a6837b Reviewed-on: https://chromium-review.googlesource.com/329370 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
* oak_pd: change oak_pd to be a sym link to glados_pdAlec Berg2015-11-041-10/+1
| | | | | | | | | | | | | | | | | | | | | | Make oak_pd a sym link to glados_pd. A few small changes necessary to make this possible: - glados_pd now sets the VBUS present power status bit as oak_pd does and as is appropriate for TCPCI spec. - oak_pd now has watchdog enabled (not sure why it was previously disabled). - add a flag in gpio.inc to define EC_INT pin on B5 for oak_pd and A14 for glaods_pd (and all other boards pointing to glados_pd). Note: this breaks oak board rev 1, where EC_INT was on A14. BUG=none BRANCH=none TEST=make -j buildall Load on glados and make sure zinger works. Change-Id: I28f4ee106e44e2819919f1826508fc1fc05bb2a1 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/310193
* glados: oak: reboot EC if PD MCU crashesAlec Berg2015-10-231-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If PD MCU crashes, it will go back to RO code and stay there until the next AP boot. So, if EC detects PD has crashed, then EC should panic reboot with debug message that it detected a PD crash. PD MCU crash is detected by EC by seeing the PD MCU transition from RW to RO, without it setting the flag that it got there from a sysjump. This CL also makes minor changes to oak_pd and glados_pd board.c files to make them identical, other than the few minor real differences between them. BUG=none BRANCH=none TEST=tested on glados using pdcmd console command on EC to test sysjumps and reboots: sysjump to RW: pdcmd 0xd2 0 2 0 sysjump to RO: pdcmd 0xd2 0 1 0 cold reboot: pdcmd 0xd2 0 4 0 Verified that PD can jump back and forth between RO and RW without EC panicing. Verified that if PD MCU is in RW and reboots, then the EC will panic and print 'PD crash'. Verify if PD MCU reboots while in RO, without ever going to RW first, then EC does not panic. Change-Id: Id3191f4005e70a6c61a9322bf535b4374e85eb9a Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/308586 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados / glados_pd: Hibernate the PD when the EC hibernatesShawn Nematbakhsh2015-10-051-0/+13
| | | | | | | | | | | | | | | | | | When the PD received status that the EC is going to hibernate, have the PD go to hibernate. The wake pin will toggle from low (hibernate state) to high (default state) when the EC leaves hibernate or resets. BUG=chrome-os-partner:45010 TEST=Manual on glados with subsequent commit. Run 'hibernate' on EC console, verify that both EC and PD go to hibernate. Plug zinger and verify that both EC and PD wake, AP boots, and battery begins charging. BRANCH=None Change-Id: I653aea87480437da742b6e203858f194833db553 Reviewed-on: https://chromium-review.googlesource.com/302713 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pd: Allow EC to request PD hibernate via host commandShawn Nematbakhsh2015-10-051-1/+1
| | | | | | | | | | | | | | | | | | | On some systems, we may wish to have the PD follow the EC into hibernate. Add a status field to EC_CMD_PD_EXCHANGE_STATUS to support this. BUG=chrome-os-partner:45010 TEST=Manual on glados with subsequent commit. Run 'hibernate' on EC console, verify that both EC and PD go to hibernate. Plug zinger and verify that both EC and PD wake, AP boots, and battery begins charging. BRANCH=None Change-Id: I0476bc8a47ffb0fe113dccda9d4f8074105c1c84 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/302712 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* pd: Add support for TCPC Alert and Alert_Mask registersScott2015-06-231-12/+36
| | | | | | | | | | | | | | | | | | | Changed the alert function to hold the ec_int line until all of the alert bits are cleared. Added support for the alert_mask register. In addition, created ec_int_status variable to distinguish which of 3 ec_int sources is driving the pd_mcu_int line. BUG=none BRANCH=tot TEST=Tested Zinger to Glados and Zinger to Samus and verified that it established a power contract in both cases. Did not test Oak, but put exact same changes in board.c as in glados. Change-Id: I372e75b8fd5d66a0c01db18b46100b86fd9ac064 Signed-off-by: Scott Collyer <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/278256 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pd: use pdcmd task to handle tcpc interruptAlec Berg2015-06-051-0/+17
| | | | | | | | | | | | | | | | | | | | Use the PDCMD task to handle PD MCU interrupts, and use it to trigger the tcpc_alert(). Note this fixes bug on Glados and Oak that could cause watchdog reset because tcpc_alert() which uses i2c to talk to tcpc was called from hooks task and can delay tickling watchdog. BUG=chrome-os-partner:40920 BRANCH=none TEST=load on glados and plug zinger into both ports many times. make sure we get a stable contract and no watchdog reset. Change-Id: I37625fae2ca0057d2ee8fa1eea6974f2d26d1b91 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/275296 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* glados: add PD support for type-C port 1Alec Berg2015-06-041-3/+1
| | | | | | | | | | | | | | Add USB PD support for port 1 (on the flex cable). BUG=chrome-os-partner:40920 BRANCH=none TEST=load onto glados and test zinger and hoho in both polarities on both ports and verify PD contract established. Change-Id: Ib7ac2e630c0a8f278c8b74c348cc6dc7183f53ec Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/275072 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados_pd: add initial support for glados PDAlec Berg2015-06-011-0/+105
Initial support for glados PD. Charging and PD communication only work on port 0. BUG=none BRANCH=none TEST=make BOARD=glados, make BOARD=glados_pd Connect hoho to glados and verify power contract successful. Connect zinger to glados and verify power contract and charging. Change-Id: I42e7b8d154a79de2f8502648d9af7d4cfc00a266 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/273138 Reviewed-by: Shawn N <shawnn@chromium.org>