summaryrefslogtreecommitdiff
path: root/board/glados_pd
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Remove Makefile symlinks under board directoryDaisuke Nojiri2016-07-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* cleanup: pd: Define VBUS detection sourceShawn Nematbakhsh2016-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously CONFIG_USB_PD_TCPM_VBUS had two uses which were independent: - When operating as a TCPC, it indicated that the VBUS level should be tracked (through GPIO inputs) and sent to the external TCPM when appropriate. - When operating as a TCPM, it indicated that the VBUS level should be obtained by querying the TCPC. These two independent uses have been split into CONFIG_USB_PD_TCPC_TRACK_VBUS and CONFIG_USB_PD_VBUS_DETECT_TCPC, which sould be more clear. In addition, CONFIG_USB_PD_VBUS_DETECT_* CONFIGs have been added for other means of VBUS detection. BUG=chromium:616580 BRANCH=None TEST=Verify kevin continues to boot + charge. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I936821481d6577e17e3e9c61ff97c037574d6923 Reviewed-on: https://chromium-review.googlesource.com/348950 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@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-253-1/+22
| | | | | | | | | | | | | | | | | | | | 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>
* cleanup: Add warning comment to gpio.inc filesBill Richardson2016-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | With commit e9883124ff16, 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>
* chell / chell_pd: Use power-optimized GPIO defaultsShawn Nematbakhsh2015-12-241-1/+1
| | | | | | | | | | | | | | | | | Pull floating pins high, don't duplicate external pull ups, and make a few other minor changes. BUG=chrome-os-partner:48109 TEST=Verify chell continues to boot and S5 power is reduced to ~5.5 mW. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Iaee0cc926149dae1f4189e6b9e4f7e3a4da6ba1c Reviewed-on: https://chromium-review.googlesource.com/319165 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* Add documentation for the TCPC microcontroller implementationMark Hayter2015-11-124-0/+119
| | | | | | | | | | | | | | | | Include text in markdown, png from Willis' block diagram, and the pdf schematic page extracted from the main schematic. BUG=chrome-os-partner:46903 TEST=markdown preview from emacs BRANCH=none Signed-off-by: Mark Hayter <mdhayter@chromium.org> Change-Id: I94d9b48fbe480c6ade837adb3984194fa2c738c5 Reviewed-on: https://chromium-review.googlesource.com/310554 Commit-Ready: Mark Hayter <mdhayter@chromium.org> Tested-by: Mark Hayter <mdhayter@chromium.org> Reviewed-by: David Schneider <dnschneid@chromium.org>
* oak_pd: change oak_pd to be a sym link to glados_pdAlec Berg2015-11-043-19/+15
| | | | | | | | | | | | | | | | | | | | | | 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
* cleanup: Standardize use of CONFIG_I2C and add MASTER/SLAVE CONFIGsShawn Nematbakhsh2015-11-031-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* 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_pd: reduce image size and build full RO and RWAlec Berg2015-10-192-3/+24
| | | | | | | | | | | | | | | | | | | | | | Modify glados_pd to build a full RO and RW binary. Note that in order to fit RO and RW into the small flash size, this CL removes the console task and adds one-way debug printfs to save space. For debugging purposes, you add the console back in by uncommenting the CONSOLE task in ec.tasklist. This will build an RW image only that has a full console. BUG=chrome-os-partner:41959 BRANCH=none TEST=load on glados_pd and verify host commands from EC work and charging with zinger works. also test that software sync works. Change-Id: I57895d12a1776a865aac1735aeb0aa8897f1779e Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/306784 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados_pd: oak_pd: add and enable option for i2c slave onlyAlec Berg2015-10-191-0/+1
| | | | | | | | | | | | | | Add CONFIG_I2C_SLAVE_ONLY for boards that only operate as a slave on i2c. BUG=chrome-os-partner:41959 BRANCH=none TEST=make BOARD=glados_pd and see 2kB flash savings Change-Id: I30831ce48b391d985c25e266229d5c6f2312042b Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/306783 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados / glados_pd: Hibernate the PD when the EC hibernatesShawn Nematbakhsh2015-10-052-0/+15
| | | | | | | | | | | | | | | | | | 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>
* glados_pd: Enable low power idleShawn Nematbakhsh2015-09-301-1/+1
| | | | | | | | | | | | | | BUG=chrome-os-partner:45010 TEST=Manual on glados / glados_pd. Verify that PD power drops by ~60% when PD MCU is reset and no charger is plugged. BRANCH=None Change-Id: Id5a6a8a0f770efe86a21f1b98a967f9b28bbf697 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/303405 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
* cleanup: Remove CONFIG_FW_IMAGE_SIZEShawn Nematbakhsh2015-09-241-2/+2
| | | | | | | | | | | | | | | | | | Since CONFIG_RO_SIZE and CONFIG_RW_SIZE now exist (which may theoretically be different sizes), it is no longer useful to globally define the size of an image. BUG=chromium:535027 BRANCH=None TEST=`make buildall -j`. Also, verify glados / glados_pd continue to function as expected. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ie29959923bc5d02b4d7d6d507ff2191bcb7d24c8 Reviewed-on: https://chromium-review.googlesource.com/301743 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* build-infr: Add support for shared RO library.Aseda Aboagye2015-07-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the build infrastructure changes needed for creating a shared RO library. (libsharedobjs). The end goal is for the library to contain various objects that can be shared with both the RO and RW EC images. Now, there are 3 make goals: ro, rw, and libsharedobjs. In order for changes that are only specific to a single image (ie: RW only) to be applied correctly, the object files are now built separately for the RO, RW, shared objects library targets. NOTE: Certain EC targets are incompatible with this model due to the fact that only one image is present within flash at a time. BRANCH=none BUG=None TEST=make -j buildall tests TEST=make -j BOARD=cr50 xrefs TEST=make BOARD=samus dis TEST=Built samus EC image and compared that the final EC image was identical to the upstream version (except for the git SHAs & version strings). CQ-DEPEND=CL:285934 Change-Id: I8e67f089710be9c6d7017718109262394bdad2f5 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/274079 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@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>
* cleanup: fix all the header guardsBill Richardson2015-06-182-6/+6
| | | | | | | | | | | | | | | This unifies all the EC header files to use __CROS_EC_FILENAME_H as the include guard. Well, except for test/ util/ and extra/ which use __TEST_ __UTIL_ and __EXTRA_ prefixes respectively. BUG=chromium:496895 BRANCH=none TEST=make buildall -j Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: Iea71b3a08bdec94a11239de810a2b2e152b15029 Reviewed-on: https://chromium-review.googlesource.com/278121 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* glados_pd: oak_pd: fix PD tx_disable timingAlec Berg2015-06-131-16/+18
| | | | | | | | | | | | | | | | | Disabling CC TX_DATA needs to be very fast to avoid clocking out an extra garbage bit at the end of transmit. This change fixes pd_tx_disable() to disable the TX_DATA line as fast as possible. BUG=chrome-os-partner:40920 BRANCH=none TEST=test on glados with scope attached to CC. note before this change we occasionally get a garbage bit at the end of CC transmit. With this change, it looks clean. Change-Id: I86b47881e3846b2e3dd4fc2afcf2d28386a068a6 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/277295 Reviewed-by: Vincent Palatin <vpalatin@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-043-7/+8
| | | | | | | | | | | | | | 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: fix typo in config for PD port 1Alec Berg2015-06-031-1/+1
| | | | | | | | | | | | | Fix typo in usb_pd_config.h for enabling transmit on port 1. BUG=chrome-os-partner:40920 BRANCH=none TEST=make buildall Change-Id: I452920eda02ab7f612b5047b2944b16515ab828a Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/274898 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados_pd: clean-up end of PD transmissionAlec Berg2015-06-031-5/+3
| | | | | | | | | | | | | | | | | | Clean up pd_tx_disable() so that it doesn't toggle a couple times when we stop transmitting. Need to first set the CC pin to Hi-Z and then the TX_DATA line since the CC pin is normally held low during transmission. BUG=none BRANCH=none TEST=test on glados. use twinkie to capture traffic and note that without this change, the CC line toggles an extra time at the end of each transmission. With this change it is a lot cleaner. Change-Id: If26c7a10bbb08bc55b972bb0145115836579d37b Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/274884 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* glados_pd: add initial support for glados PDAlec Berg2015-06-017-0/+626
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>