summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Handle battery charged alarmstabilize-4068.0.BVic Yang2013-04-291-10/+14
| | | | | | | | | | | | | | | | When battery flags TERMINATE_CHARGE or OVER_CHARGED alarm, we should treat them as a signal of battery fully charged. BUG=chrome-os-partner:18914 TEST=On Spring: 1. Plug in adapter when battery if full, see green LED. 2. Plug in adapter when battery is not full, see yellow LED. BRANCH=spring Change-Id: Ica414a0e1667b8f30a0cc9a5d66dba1b119a59ba Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49456 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add cscope.out to .gitignoreVic Yang2013-04-291-0/+1
| | | | | | | | | | | | | | | With this, git doesn't complain about uncommited change if one uses cscope. BUG=none TEST='git status' and see no uncommited change. BRANCH=none Change-Id: I30bb78e4d0a7541444ef1aced683335933a5aa73 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49457 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Clean up gaia_power debug messagesRandall Spangler2013-04-291-15/+14
| | | | | | | | | | | | | | | | Should use CPRINTF("[%T...\n]") so the messages are timestamped; this is really helpful to see when things are going wrong. No functional changes; just changing debug output. BUG=none BRANCH=none TEST=build pit and spring; see prettier debug output Change-Id: I9c658385b836a184a3ebb84856b844cbfc3224a7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49551 Reviewed-by: Simon Glass <sjg@chromium.org>
* Don't enable charger interrupt if charger task is disabledRandall Spangler2013-04-292-9/+8
| | | | | | | | | | | | | | | This fixes pmu_init() failing on pit, where the charger task isn't enabled yet (and thus the charger interrupt is NULL - which can't be enabled). BUG=chrome-os-partner:18657 BRANCH=none TEST=build all platforms; on pit, check that pmu_init() no longer fails Change-Id: I191bbaeb4df10241e3508ccf7ef5ea83f42c5697 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49550 Reviewed-by: Simon Glass <sjg@chromium.org>
* Improved the BUILD_ASSERT macro to work outside of functions.Bill Richardson2013-04-297-25/+36
| | | | | | | | | | | | | | | | | | This will let us check the size of static array initializers. Also moved this macro definition and ARRAY_SIZE into a new "tricks.h" header, so that userspace utils can use it too. BUG=none BRANCH=none TEST=manual Built everything, tested on Link. Tried various assertions. Change-Id: I612891108ea37dbca3572e0f25ab54a7bc0ed860 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49417 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix charging state descriptionsRandall Spangler2013-04-291-0/+2
| | | | | | | | | | | | Two states were added, but the descriptions weren't. This caused a crash. BUG=chrome-os-partner:18914 TEST=boot spring with no battery, wait a few secs; shouldn't crash BRANCH=spring Change-Id: I10f9280232259a1f467ea3b02f3b1b61cee57471 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49391
* spring: Enable both VFET2 and VFET4 for videoVic Yang2013-04-292-0/+3
| | | | | | | | | | | | | | | We are moving video power from VFET2 to VFET4. To support old boards, we need to enable both of them. When new boards are in place, we can then drop VFET2. BUG=chrome-os-partner:18186 TEST=Build spring BRANCH=spring Change-Id: If0cbc1ac49affc1e3c7ec9650a661f80be826f97 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49431 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Make test-list a per-board parameterVic Yang2013-04-293-5/+19
| | | | | | | | | | | | | | Some tests are not applicable to all boards. This change makes test-list a per-board parameter so a test can be enabled/disabled for individual boards. Also disable all the tests that don't compile now. BUG=chrome-os-partner:18598 TEST=make tests for all boards BRANCH=None Change-Id: Id2d18e23856f5c64dbdc7c6ca5949f8ad61b5cc0 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49452
* Remove mock filesVic Yang2013-04-291-26/+0
| | | | | | | | | | | | | We are moving to a per-function mock mechanism, which is less likely to break when someone adds a function to a file with a mock. BUG=chrome-os-partner:18598 TEST=None BRANCH=None Change-Id: Ie625064730d2224accbaf1febbdc4750e793d047 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49451
* Fix kb_scan test when CONFIG_LID_SWITCH is not definedVic Yang2013-04-291-0/+6
| | | | | | | | | | | | If we don't have lid switch, don't test it. BUG=chrome-os-partner:18598 TEST=Build on mccroskey and see errors about GPIO_LID_OPEN go away. BRANCH=None Change-Id: I1084e1bfc2e6bd611dc393c1b2d501e786d2a0e3 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49450
* Fill in I2C test parametersVic Yang2013-04-291-2/+18
| | | | | | | | | | | | | This fills in test parameters for link, pit, snow, and daisy. Also fixes compilation error due to CONFIG_ADC not defined. BUG=chrome-os-partner:18598 TEST=Build test-stress. (Link failed due to unrelated issue.) BRANCH=None Change-Id: I8a5cfcf4acdae607c23dbe5cf3378945f91c7807 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49449
* Add 'clobber' target to Makefile to clean everything.Bill Richardson2013-04-261-0/+4
| | | | | | | | | | | | | | | BUG=none BRANCH=none TEST=manual make BOARD=link make BOARD=snow make clobber Change-Id: I862ec0d0240e48828091259dee7e8aef62544d47 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49370 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add 'TAGS' target to MakefileBill Richardson2013-04-261-0/+10
| | | | | | | | | | | | | | | | | This creates cscope.files and an emacs TAGS file for the specified BOARD. If you don't have etags installed, it just creates cscope.files. BUG=none BRANCH=none TEST=manual make BOARD=link tags ls Change-Id: I9b27ba42ac4e85822c5a5a6e8cb5b5148a3435c3 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49356 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Split pwm.c into pwm_fan.c and pwm_kblight.cBill Richardson2013-04-269-148/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sadly, the existence of fans may not always imply the existence of keyboard backlights. BUG=chrome-os-partner:18825 BRANCH=slippy TEST=manual Use the Link EC console to make sure that both functions still behave. faninfo fanset 4400 faninfo fanset 9999 faninfo autofan faninfo fanduty 50 faninfo fanduty 100 faninfo autofan kblight 0 kblight 100 kblight 50 kbligth 100 Change-Id: I2e07cd46c21bce2d0d4162275a8ea6ae40135e96 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49355
* Rename i2c_commands.c to i2c_common.cRandall Spangler2013-04-262-1/+1
| | | | | | | | | | | | | | | It will soon have cross-platform code moved to it. This CL just does the renaming; no functional changes. BUG=chrome-os-partner:18969 BRANCH=none TEST=build spring,link Change-Id: I8cc475f9dd1422a0a9c586c93eb0d7aaf21a001d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49359 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Allow disabling PMU charger task, and do so on pitRandall Spangler2013-04-267-2/+11
| | | | | | | | | | | | | | | | I2C communication doesn't work on pit yet, so the charger task is spewing errors to the console. This change allows the task to be disabled cleanly on pit, and has no effect on other platforms. BUG=chrome-os-partner:18657 BRANCH=none TEST=build all platforms and see that charger task is still compiled everywhere but pit Change-Id: I788e817d5630fb1a28694819f4ef9948a503a744 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49344 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Move PMU charger irq handler to charger moduleRandall Spangler2013-04-263-10/+15
| | | | | | | | | | | | | | | | No code changes; this is just moving the irq to the module which actually handles it. This makes it simpler to disable the charger task separately from the PMU module. BUG=chrome-os-partner:18343 BRANCH=none TEST=build pit, spring Change-Id: Ife44a17f69bf21aa000d162318a459cea6fdf661 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49334 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Increase UART output buffer on STM32LRandall Spangler2013-04-261-0/+3
| | | | | | | | | | | | | STM32L has 16KB RAM, so can use a bigger output buffer. BUG=chrome-os-partner:18657 BRANCH=none TEST=boot pit, look at EC console output; shouldn't drop output Change-Id: I8a3c7ff2923fd815eff748a898dc873f5d86b46c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49332 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add pit support to flash_ecRandall Spangler2013-04-261-1/+1
| | | | | | | | | | | | | Pit flashes the same way daisy does. BUG=chrome-os-partner:18657 BRANCH=none TEST=./util/flash_ec --board=pit --ro --image=build/pit/ec.bin Change-Id: Id3db86b348963f66e7eb03c38a8efabe3379d21b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49320 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* spring: Show yellow LED when not fully chargedVic Yang2013-04-261-0/+2
| | | | | | | | | | | | | | | | | This includes two situations: 1. When charge state machine is still trying to decide the next state. 2. When we are waiting for acceptable condition to start charging. For now, we show yellow for both. BUG=chrome-os-partner:18914 TEST=none BRANCH=spring Change-Id: I5dd97c735a1ecfee29d506452695014c85d2da0b Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49327 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add new TPS65090 charge state REINIT and BAD_CONDVic Yang2013-04-262-20/+25
| | | | | | | | | | | | | | | | | | Currently INIT state can mean different things. This change introduces two new states to demultiplex INIT. Now, REINIT means charge state machine is deciding the next state. BAD_COND means it's waiting for acceptable charging condition. Note that the three states are doing the same thing so there is no functional change. BUG=chrome-os-partner:18914 TEST=none BRANCH=spring CQ-DEPEND=CL:49327 Change-Id: Ia783e76cf27e28103ef44fe7b8a43674dadccc54 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49326 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: do not enable interrupts on I2C1Vincent Palatin2013-04-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have any interrupt handler for I2C1, so enabling of the I2C1 interrupts will just end up triggering a panic everytime the interrupt fires. By the way, I2C1 is used as master and all communications happen without using the I2C interrupt. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=spring BUG=chrome-os-partner:18499 TEST=On Spring, run EC flashing in a loop from the AP while true do flashrom --fast-verify -p internal:bus=lpc -w ec.bin flashrom --fast-verify -p internal:bus=lpc -w ec_autest_image.bin done and check that we always succeed and have no panic. Original-Change-Id: I6b071f309218410840707380d296bdf14b10e9f5 Reviewed-on: https://gerrit.chromium.org/gerrit/47749 Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 8b3262d644003b3c9727998dc8d4b0c749450aef) Change-Id: Ie2fc30e5661e7eade024e6893eaf16427f94cac2 Reviewed-on: https://gerrit.chromium.org/gerrit/49192 Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Vic Yang <victoryang@chromium.org>
* Split out power button code from switch.cRandall Spangler2013-04-2513-175/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The power button code is platform-independent. This change splits the code out of the LM4 switch.c module so that a subseqent change to STM32 platforms can start using it. BUG=chrome-os-partner:18945 BRANCH=none TEST=manual 1. Power+refresh+esc goes to recovery mode, 2. Press power button at recovery screen turns off. 3. With system off, power button turns system on. 4. Press power button for a second; screen locks. 5. Press power button while typing; blocks keystrokes while it's pressed. 6. Hold power button down for 8 sec; system forced to shutdown. 7. From EC console, with system on: hostevent clear hostevent -> event 0x04 is clear press power button hostevent -> event 0x04 is set 8. From EC console, with system off: powerbtn -> system turns on powerbtn 5000 -> system turns off, just like power button was held for 5 sec Change-Id: If2a9b02514a201e1d03c857d128e2ccab51a16ef Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49217 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Create board directory for Slippy.Bill Richardson2013-04-244-0/+444
| | | | | | | | | | | | | | | | | | This just copies the board/link stuff into board/slippy (with one formatting tweak to pass the presubmit check). It builds, but of course is useless. Customization will follow later. BUG=chrome-os-partner:18825 BRANCH=slippy TEST=manual cd src/platform/ec make BOARD=slippy Change-Id: I2ba62812d9199eec776f9da6732921c6281762ab Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49130 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Temporarily enable all FETs at chipset poweronRandall Spangler2013-04-241-0/+15
| | | | | | | | | | | | | | This will allow debugging until the I2C passthru command is supported, and should be removed once it is supported. BUG=chrome-os-partner:18778 BRANCH=pit TEST=build pit; can't test until we have boards Change-Id: I6285e76763a5f3bfd759161115d4905697b56e6c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49096 Reviewed-by: Doug Anderson <dianders@chromium.org>
* Fix typo in power_led.cRandall Spangler2013-04-241-1/+1
| | | | | | | | | | | | | Should be BOARD_pit, not BOARD_PIT (Thanks, Doug!) BUG=none BRANCH=pit TEST=build pit Change-Id: I1d7ef9e2347f031aec8f94c7a2da87145aa83c4d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49111 Reviewed-by: Doug Anderson <dianders@chromium.org>
* Move LPC constants of out board.c and into chipset where they belongBill Richardson2013-04-243-29/+30
| | | | | | | | | | | | These should be specific to the lm4's lpc.c, not the board. BUG=chrome-os-partner:18343 TEST=build all, run link BRANCH=none Change-Id: Ie02bbd3cf90f09035d302f5dcaad4d33f4ef9e7c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49101
* Replace generated CONFIG_TASK_ macros with HAS_TASK_Bill Richardson2013-04-2426-48/+48
| | | | | | | | | | | | | | | CONFIG_ macros should be set directly. Expanding the task names in the same way made it difficult to tell what was a configuration choice and what was due to changes in ec.tasklist BUG=chrome-os-partner:18343 TEST=build all, run link BRANCH=none Change-Id: Ib82e34f974238ee2dd216f33b701b6f4c6a4f1f1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49098 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Specify the LM4 GPIOs to use for UART1Bill Richardson2013-04-243-4/+11
| | | | | | | | | | | | | | | UART0 is the EC console, and it's consistent. UART1 is the AP console that we export via servo. It was connected to a different set of GPIOS on the BDS. BUG=chrome-os-partner:18343 TEST=build link, bds BRANCH=none Change-Id: Ib4c10fd4d2b7a8ffb4e41e216528d4760ba50de3 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48975 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add test for keyboard disabling when lid closedVic Yang2013-04-241-0/+28
| | | | | | | | | | BUG=chrome-os-partner:17653 TEST=Run on Spring BRANCH=none Change-Id: Ib01f6f4cac3b0ef3039bb1e1daf3dd9c6c8e44c4 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48895
* Move common chipset console commands to chipset.cRandall Spangler2013-04-244-39/+48
| | | | | | | | | | | | | apreset and apshutdown are now the same across all platforms. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; make sure 'apreset warm', 'apreset cold', and 'apshutdown' work. Change-Id: I4ace1ab2bbda4d400528039ad5f84da63c9c7d0e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48942
* spring: Improve battery LED stabilityVic Yang2013-04-241-49/+140
| | | | | | | | | | | | | | | | | | | | | | | Previously, we sometimes saw battery LED went off when going into or out of battery assist mode. This CL adds a state machine to stabilize battery LED. By controlling the state of lighting engine, the tranisition from/to battery assist mode is seamless now. BUG=chrome-os-partner:18844 TEST=On spring, check: 1. LED doesn't go off when going into battery assist mode. 2. LED doesn't suddenly change brightness when coming out of battery assist mode. 3. LED goes red after few seconds when battery is not present. 4. LED goes green when battery is charged. BRANCH=spring Signed-off-by: Vic Yang <victoryang@chromium.org> Change-Id: I3286b54a76edd77c65033ec3bbf0d81d916f7be0 Reviewed-on: https://gerrit.chromium.org/gerrit/48875 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vic Yang <victoryang@chromium.org> Tested-by: Vic Yang <victoryang@chromium.org>
* Unify lid switch processingRandall Spangler2013-04-2410-24/+31
| | | | | | | | | | | | | | | | | | | STM32-based platforms now use the same lid debouncing code as LM4-based platforms, generate lid-open / lid-closed events, and trigger lid-change hooks. This is needed for disabling keyboard scanning when the lid is closed, as well as future changes to mask off wake events when the lid is closed. BUG=chrome-os-partner:18896 BRANCH=spring TEST=build all platforms; check that spring boots when lid is opened Change-Id: I09a6e91119c3739297fe49b7eacac6efda988284 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48924 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Allow keyboard_scan_config to be customized per-boardBill Richardson2013-04-244-19/+33
| | | | | | | | | | | | | | By default it's not, but if you #define CONFIG_CUSTOM_KEYSCAN, you can add your own settings in board.c BUG=chrome-os-partner:18343 TEST=build link, bds BRANCH=none Change-Id: I2a9dd48fd7f4610bc39dcc59e59a3fedec539e28 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48994 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Allow building without battery chargingBill Richardson2013-04-242-1/+6
| | | | | | | | | | | | | | Some experimental boards may want to build without a battery charging task to make bringup easier. BUG=chrome-os-partner:18343 TEST=build all boards BRANCH=none Change-Id: I4269fea4046325241ad7720ec3457b0534aadda3 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48974 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Add LP5562 functions to control engine execution stateVic Yang2013-04-232-0/+32
| | | | | | | | | | | | | | This gives us better control over the execution state of lighting engine. BUG=chromium:233832 TEST=Build success BRANCH=spring Change-Id: Ibfa86be0eef2b7dff8495f770649577295d4cb6f Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48773 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Unify lid switch GPIO nameVic Yang2013-04-233-4/+4
| | | | | | | | | | | | | | | | Link uses LID_SWITCH_L but it means the same thing as LID_OPEN. Changing it to LID_OPEN so that all boards use the same name. No functional changes, just renaming. BUG=chrome-os-partner:18343 TEST=build link, bds BRANCH=none Change-Id: I74893e1365ad3068f13e7fe948f1a54c6c6301bb Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48893 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Software flow control in consoleVic Yang2013-04-231-2/+17
| | | | | | | | | | | | | | | | This adds software flow control handling (a.k.a X-on/X-off). When Ctrl-Q is received, UART transmitting is paused until Ctrl-S is received. If the FIFO or buffer fill up during this period, console output is lost. BUG=chrome-os-partner:18680 TEST=Press Ctrl-Q and see console stopped. Press Ctrl-S and see buffered messages. BRANCH=spring Change-Id: I9ce1198a1119dadc558bb522c48037bb83bba415 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48887 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Increase EC low-battery threshold to 14% to match kernelBill Richardson2013-04-232-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | There is a 4% difference between the kernel's view of battery level and the actual battery level, to give userspace a chance to shut down cleanly. The EC should turn the lightbar red when the battery drops below 10%, so this change makes that happen when the kernel says it's 10%, instead of the real 10%. Note: We don't have to cherry-pick this to the Link branch. Although it affects the EC, we already patch the EC lightbar parameters at boot and that's done in userspace. BUG=chromium:225500 BRANCH=none TEST=manual Unplug Link, let the battery run down. The lightbar should pulse red when the battery level reported by the UI drops to 9% (there may be a little delay due to rounding). Note that it's only red when on battery. Change-Id: If3d335c54ceb37c86da59e4a66f8ecd46ce15664 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48904 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Active-low Link GPIOs end with _L, not n.Randall Spangler2013-04-226-174/+174
| | | | | | | | | | | | | | | This is now consistent with other boards. No functional changes, just renaming, BUG=chrome-os-partner:18343 BRANCH=none TEST=build link, bds Change-Id: Ifd7c1ec608ab61f5f66800e91803ffafe1d944b6 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48804 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Turn on 3.3V rail earlier in power sequence for pitRandall Spangler2013-04-221-6/+22
| | | | | | | | | | | | | | The 3.3V rails powers some of the buck supplies, so must be turned on 1ms after the 5V rail. BUG=chrome-os-partner:18657 BRANCH=none TEST=build pit, snow Change-Id: I18a165744352ae375080824fecfeb56f6ac81a9c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48729 Reviewed-by: Vic Yang <victoryang@chromium.org>
* Add more flash testVic Yang2013-04-212-12/+104
| | | | | | | | | | | | | This adds write protect status check across reboots. BUG=chrome-os-partner:18598 TEST=Run on Spring BRANCH=None Change-Id: Iba0c5d6f906c64af4216aaecac35b87c1392a873 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48752 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add shared memory testVic Yang2013-04-212-16/+56
| | | | | | | | | | | | | Also changes utils test to use EC_SUCCESS to indicate test success. BUG=chrome-os-partner:18598 TEST=Run on Spring BRANCH=None Change-Id: I4a9b08550c15f09cd467706b6a3c0142dd06a558 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48751 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Support power button LED on pitstabilize-4035.0.BRandall Spangler2013-04-192-11/+33
| | | | | | | | | | | | | | | Pit uses GPIO PA2=TIM2_CH3 instead of Snow's PB3=TIM2_CH2. Other than that, the timer setup is identical (STM32F and STM32L are compatible in this respect, anyway). BUG=chrome-os-partner:18657 BRANCH=none TEST=build snow, pit; no pit boards to test on yet Change-Id: I8ba68f99641038e12c9a9c9dd29e3b64410a5eef Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48403 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Move temp sensor struct into board.cRandall Spangler2013-04-193-53/+42
| | | | | | | | | | | | | | | No need for it to be a separate file. Just moving code, no functional changes. BUG=chrome-os-partner:18343 BRANCH=none TEST=build link Change-Id: I25f84c73401929bce4ac76ebdcf6c86ad4852594 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48684 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Add peripheral stress testVic Yang2013-04-193-0/+159
| | | | | | | | | | | | | This includes I2C and ADC. PECI test will be added in another CL. BUG=chrome-os-partner:18598 TEST=Run on Spring BRANCH=None Change-Id: I7424dbf5d3cefda67cad9aaad60367d957c47529 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48614 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Saving the main stack pointer at the entry of exception_panic.Daisuke Nojiri2013-04-182-54/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CPU creates an exception frame on the main stack instead of the process stack when the exception happens in a handler's context. So, we need to save both msp and psp, and pick the right one to locate the exception frame. Tested by marking the stack (as you see in the dump below) then triggering divzero in svc_handler. > crash svc === HANDLER EXCEPTION: 03 ====== xPSR: 6100000b === r0 :00000000 r1 :0000e237 r2 :000015cf r3 :000015cf r4 :00000001 r5 :22222222 r6 :11111111 r7 :0000df01 r8 :00000000 r9 :2000545e r10:00000000 r11:00000000 r12:0000000d sp :20000fb8 lr :000055d7 pc :00000b40 Divide by 0, Forced hard fault mmfs = 2000000, shcsr = 70080, hfsr = 40000000, dfsr = 0 =========== Process Stack Contents =========== 20002738: 11111111 22222222 33333333 44444444 20002748: 00000000 000003ad 000003c0 81000000 20002758: 00000000 0000557d 0000557c 21000000 20002768: 00000000 00000000 00000000 00000000 Rebooting... BUG=chrome-os-partner:16901 BRANCH=none TEST=mentioned above Change-Id: I3ca08a1df20375953552b3dc926350e262b78b2a Signed-off-by: Daisuke Nojiri <dnojiri@google.com> Reviewed-on: https://gerrit.chromium.org/gerrit/47495 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add flash write protect testVic Yang2013-04-174-13/+133
| | | | | | | | | | | BUG=chrome-os-partner:18598 TEST=Run on Spring BRANCH=None Change-Id: I6488ace5d6b758410c76d7625787413eba37cbe9 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48208 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Move STM32 timer regs struct to registers.hRandall Spangler2013-04-172-30/+31
| | | | | | | | | | | | | | | | | | | | | | | This is a struct representation of the STM32 timer registers, so belongs in registers.h instead of the platform-independent hwtimer.h. Note that there are other problems with the use of this struct. It should be volatile, and if it's a win vs. the macros we should replace ALL macro'd timer register accesses with the struct instead of just those in hwtimer.c (that is, we shouldn't do things both ways). I'll address those in a subsequent CL after testing which way generates the most compact code. No functional changes, just moving the struct definition. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms Change-Id: If29d008fb38b9cc847b69eda1ee7c05e67f6e5e7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48415 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Remove 'hello' testVic Yang2013-04-173-33/+1
| | | | | | | | | | | | | | | | Hello test should be a setup step for every test. This should be implemented on the test server side. Remove it to reduce number of test binaries. BUG=chrome-os-partner:18598 TEST=None BRANCH=None Change-Id: I462156f6d7affdf7ceb67e4354804fedb18a5424 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/48196 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>