summaryrefslogtreecommitdiff
path: root/common/system_common.c
Commit message (Collapse)AuthorAgeFilesLines
...
* More debug command cleanup to save spaceRandall Spangler2012-05-211-43/+32
| | | | | | | | | | (saves another 1.5KB) BUG=none TEST=(run the commands) Change-Id: Id3ca58528fa68a4cec606edf2b98b9af38ac228f Signed-off-by: Randall Spangler <rspangler@chromium.org>
* Add LM4 support for hard resetRandall Spangler2012-05-211-5/+13
| | | | | | | | | | | | (And add STM32 support for disabling interrupts before reset, which got missed before.) Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7470 TEST=from console, "reboot", then "reboot hard" Change-Id: Ib98792abc0c91a01e2230b419fc876052380655a
* Fix partition address when flash base is not zeroVincent Palatin2012-05-181-3/+3
| | | | | | | | | | | | | On chips where CONFIG_FLASH_BASE is not 0 (e.g. stm32), the reset vector address check in system_run_image_copy would fail because we are comparing an absolute address against a flash offset. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:8865 TEST=on Daisy, type "sysjump B" in EC console. Change-Id: Ib79677fb926a37fcf32f4aac013dc36b086f4464
* de-LPCify the EC host interfaceVincent Palatin2012-05-151-31/+31
| | | | | | | | | | | | | Preparatory work to use common host command code between ARM and x86. Just rename constants, do not change the binary API. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9614 TEST=make BOARD=link Change-Id: I534d427c9b50103273835a6f32a0ddb622c762b3
* Slightly update the host commands APIVincent Palatin2012-05-141-6/+9
| | | | | | | | | | | | | | | | | | | | Preparatory work to use common host command code between ARM and x86. Every command sends back explicitly the size of the response payload. The size of the response defaults to 0 ond can be updated. Add a protocol version number returned as command 0x00 to help with backward compatibility. move a couple of function from lpc specific header to host commands to be able to implement them for the I2C link. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=chrome-os-partner:9614 TEST=make BOARD=link Change-Id: I6a28edf02996ddf6b7f32a3831d07d5f0271848f
* Maintain timer value across sysjumps and clean up init debug outputRandall Spangler2012-05-111-1/+1
| | | | | | | | | | | This helps us keep track of how long vboot is taking on the EC. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9651 TEST=reboot system and look at debug log. time shouldn't start over after it jumps to image A. Change-Id: Iad86e90d42dabf1c67b2c2be80dda1151cf9a288
* Add gpio_set_flags() and system_get_board_version()Randall Spangler2012-05-081-3/+40
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9117 TEST=version; board version should be 0 on proto1 and 1 on EVT Change-Id: Ic64ad0d009151fbda09f5c1605ef50ae708cb6ae
* Clean up sysjump struct parsing and add memmove()Randall Spangler2012-05-071-41/+27
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9447 TEST=update from old EC 517 to this one Change-Id: I275b5bf6c4ae1ab6e0c0a05cf9260314d644c79b
* Add header_size in struct jump_data.Louis Yung-Chieh Lo2012-05-031-1/+38
| | | | | | | | | | | | | | | | 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
* Enhance LPC EC REBOOT reset command to allow to request recoveryVadim Bendebury2012-04-301-19/+41
| | | | | | | | | | | | | | | | | | | | | | 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>
* Refactor async console outputRandall Spangler2012-04-241-29/+32
| | | | | | | | | | | | | | | | | | This adds a 'ch' command which prints/sets which channels are active This handles all the async output; the remaining debug commands will be refactored to use ccprintf() / ccputs() in a followup CL. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:7464 TEST=manual ch --> all channels active ch 0x100 -> just port80 active powerbtn -> system boots; only port 80 codes shown on console Change-Id: I9efc43acec919b62b78c2c82c61946d32380adfe
* Implement HOOK_SYSJUMP and use it to preserve LPC host event maskRandall Spangler2012-04-191-11/+102
| | | | | | | | | | | | | | | | | | | | This also changes shared_mem to use all the remaining RAM, instead of reserving a fixed-size buffer. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9161 TEST=manual hostevent --> all masks should be 0 hostevent smi 0x12300000 hostevent --> should confirm SMI mask was set sysjump b hostevent --> should confirm SMI mask is still set reboot hostevent --> should confirm SMI mask is back to 0 Change-Id: Iccb6da6ccc93ee5036a3f478d24b717a462d9150
* Move externs from .lds file into a header fileRandall Spangler2012-04-191-3/+1
| | | | | | | | | | | Fewer magic externs = good. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=if it boots, it works Change-Id: Ifadeb1701400c5492c40d2eaf8f68f2d70189648
* Add chipinfo commandRandall Spangler2012-04-181-0/+10
| | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=none TEST=chipinfo Change-Id: Ie3414bf92c9dd35aaa4e54028bd525e860028c33
* Fix getting version string for other imagesRandall Spangler2012-04-131-32/+30
| | | | | | | | | | | | | | | | | | Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:9049 TEST=manual sysjump ro version sysjump a version sysjump b version All should return versions for RO, RW-A, RW-B. Change-Id: Ie189d2d777a4743460e2edec65750e563bc69354
* Support chipinfo command (ectool/host commands)Louis Yung-Chieh Lo2012-04-091-0/+14
| | | | | | | | | | | | | | | | Add a host command returning chip information. The interface is in common/ while the implementations are in chip-specific code (note: added simple value for stm). BUG=chrome-os-partner:8567 TEST=on board % ectool chipinfo Chip info: vendor: xx name: yyyy revision: zzzzz Change-Id: I5030a03a6fcfbfc080d5acd8efb763fde7eefde5
* Preserve reset cause when jumping between EC imagesRandall Spangler2012-04-031-0/+54
| | | | | | | | | | | | | | | | | | | | | BUG=chrome-os-partner:8718 TEST=manual 1) Use 'reboot' command from console to boot image. Should end up in image A, with last reset reason soft cold. 'sysinfo' should show we jumped to this image. 2) sysjump RO. Should end up in RO; otherwise same as 1) 3) reboot using Power+Esc+Reload. Should end up in image RO, with last reset reason reset pin. 'sysinfo' should show we did not jump to this image. 4) sysjump A. Should end up in A with reset reason reset pin. 'sysinfo' should show we jumped here. Change-Id: I2dd5595eab4ba2c91bfe8b2b2e9677d7732aca63 Signed-off-by: Randall Spangler <rspangler@chromium.org>
* flash write and erase commands protect the active image.Louis Yung-Chieh Lo2012-03-271-0/+31
| | | | | | | | | | | | | | | Comapre the range to be write (erase) with the range of active image. If overlap, return error to indicate the access denied. Note that we actually protect only runtime code and ro data. FMAP is intentional unprotected so that flashrom can update to new map before jumping. Since the vector table and init code are in the same erase page, they are unprotected as well. BUG=chrome-os-partner:7478 TEST= Change-Id: Icb5cc89836432a11cef80e18eb66bb39a6c9b1d9
* Remove old scratchpad-based reboot-to-image interfaceRandall Spangler2012-03-201-0/+9
| | | | | | | | | | | | | | | | | Now that we can jump directly to other images, we don't need this. We jump to image A by default, unless the recovery button or signal is asserted. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8562 TEST=manual Reboot -> runs image A Reboot with reload (F3) held down -> runs RO Reboot with 'dut-control goog_rec_mode:on' -> runs RO Change-Id: I8259fe0d738ce0ca897d2f4427d8cf61858b8901
* Support warm reboot from one EC image to another.Randall Spangler2012-03-191-23/+123
| | | | | | | | | | | | | | | | | | | | | This is necessary at init-time for verified boot to jump from RO to one of the RW images. It's also used by factory EC update to update one image and then jump to the updated image to finish the update. In this case, the x86 does NOT reboot. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8449 TEST=manual 1) power on x86 and log in 2) sysjump a --> system is in a; x86 has not rebooted 3) sysjump ro --> system is back in RO; x86 has not rebooted 4) reboot -> system is in RO; x86 HAS rebooted Change-Id: I9dbadcf9775e146a0718abfd4ee0758b65350a87
* More cleanup of board/chip configs and initializationRandall Spangler2012-03-191-0/+263
More modules can be disabled individually through CONFIG_ defines. Reordered early module pre-init and init, and added comments to explain why things are ordered in main() the way they are. Fixed a few assorted init-related bugs along the way, like st32m keyboard scan double-initializing. BUG=none TEST=build link, bds, daisy Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I04a7fa51d743adfab4be4bdddaeef68943b96dec