summaryrefslogtreecommitdiff
path: root/util/flash_ec
Commit message (Collapse)AuthorAgeFilesLines
* npcx7: WoV: Add support for Wake-on-Voice (WoV) moduleCHLin2018-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds the driver support for the WoV module which inludes the following files: - wov.c - wov_chip.h - apm.c - apm_chip.h It also supports the console commad "wov" which can test different configuration and audio quality by entering different parameters. The detail description of WoV console command is listed below: ------------------------------------------------------------------------ [Note]: Before changing any of settings, please make sure the operation mode is on the "OFF" state. (ie. run the command wov cfgmod off first) . > wov init Initialize WoV interface, including pin mux and interrupt registration etc. > wov mute <enable / disable > mute enable / disable. > wov cfgsrc <mono | stereo | left | right> set audio source, ex: wov cfgsrc left, means audio source from left MIC. > wov cfgbis <16|18|20|24> set audio resolution, ex: wov cfgbit 16 means audio resolution are 16bits. > wov cfgsfs <8000|12000|16000|24000|32000|48000> set audio sampling frequency rate, ex: wov cfgsfs 48000 means audio sampling rate are 48Khz. > wov cfgbck <32fs|48fs|64fs|128fs|256fs> set I2S bit clock rate, ex: wov cfgsfs 48000 and wov cfgbck 32fs means audio sampling rate are 1536Khz (32*48000). > wov cfgfmt <i2s|right|left|pcma|pcmb|tdm> set I2S but format, ex: wov cfgfmt right means audio I2S format are Right-Justify. > wov cfgmod <off|vad|ram|i2s|rami2s> set audio operation mode ,ex: wov cfgmod i2s means audio output via I2S bus. > wov cfgtdm <0~496 0~496 0~3> set TDM time slot, the first values is left channel delay counter, the second is right channel, and the 3rd is startup counting condition. (chosen LRCK raising or falling edge) . [Note: this command is just working on cfgmod equal to tdm] > wov cfgget retrieve above settings. > wov vadsens (currently not support, reserve for next version) > wov gain (0~31) set audio data gain value, ex: wov gain 10 means setting audio digital gain are 10dB. > wov cfgdck <1.0 | 2.4 | 3.0 > set digital MIC PDM clock rate. ex: wov cfgdck 2.4 means PDM clock are 2.4Mhz. ----------------------------------------------------------------------- This CL also adds the chip ID (0x24) for npcx7m7w. So the console command "version" can show the chip is npcx7m7w. BRANCH=none BUG=none TEST=No build errors for make buildall. TEST="BOARD=npcx7_evb make"; Flash the image on EVB; Test WoV function with console commands described above. Change-Id: Ief2b3e89edbd3e6d2a9d82d317a93c9f0b7a20cd Signed-off-by: Dror Goldstein <dror.goldstein@nuvoton.com> Signed-off-by: Simon Liang <CMLiang@nuvoton.com> Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/897314 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* yorp: initial add of octopus BOM-A boardJett Rink2018-02-281-0/+1
| | | | | | | | | | | BRANCH=none BUG=b:73811887 TEST=build yorp and all other boards Change-Id: I2c29ba86f29a3d25128c00c1b55e90f6843bcdd5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/935367 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* cleanup: Sorting list alphabeticallyJett Rink2018-02-281-1/+1
| | | | | | | | | | BRANCH=none BUG=none TEST=make buildall Change-Id: I3c07a87e0a41ad3ec51f78e30e14ac7d45d3e531 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/935366
* flash_ec: iteflash: modify processDino Li2018-02-071-0/+13
| | | | | | | | | | | | | | | | | | With this change, we can do flashing via flex cable. BRANCH=none BUG=b:35573714 TEST=To run "~/trunk/src/platform/ec/util/flash_ec --board=reef_it8320" and flashing is done and cold reset automatically. CQ-DEPEND=CL:855978 Change-Id: I078afa6d6f6f8f7bf60a1677e4c357dbe906e7dc Signed-off-by: Donald Huang <donald.huang@ite.com.tw> Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/344481 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: Wait 1s before flashing meowth.Aseda Aboagye2018-01-311-4/+5
| | | | | | | | | | | | | | | | | | | Meowth also seems to take enough power when flashing without a battery. Zoombini has a similar issue, and the fix is to wait 1s to let the voltage level stabilize before flashing. This commit just waits 1 second before flashing. BUG=b:65694390 BRANCH=None TEST=./util/flash_ec --board meowth; Verify it succeeds without a battery. Change-Id: Ida34a7eb923187940afe05a32d200b48e71aaa9f Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/894370 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Caveh Jalali <caveh@google.com>
* Nami: Add Nami to flash_ec scriptDaisuke Nojiri2018-01-231-0/+2
| | | | | | | | | | | | | This patch adds Nami to flash_ec script. BUG=none BRANCH=none TEST=Flash ec.bin to nami proto0. Change-Id: I7b036c429fb028e916335efd330a4b8d80977263 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/879585 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* eve_fp: remove boardVincent Palatin2018-01-231-2/+1
| | | | | | | | | | | | | | | | fp is dead, long life to fp. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=make buildall Change-Id: Idccb953044018e24d14b6ef1dbf69766fb9b58ab Reviewed-on: https://chromium-review.googlesource.com/880954 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* util: flash_ec: Add support to flash npcx7_evb with npcx7m7x chipCHLin2018-01-181-0/+9
| | | | | | | | | | | | | | | | | | | | This CL modified the flash_ec and openocd script to support flashing npcx7m7x chip on npcx7_evb. BRANCH=none BUG=none TEST=Change CHIP_VARIANT to npcx7m7w in board/npcx7_evb/build.mk; "BOARD=npcx7_evb make"; Move npcx7_evb from array BOARDS_NPCX_7M6X_JTAG to BOARDS_NPCX_7M7X_JTAG in util/flash_ec; Connect servo JTAG to npcx7 EVB; "./util/flash_ec --board=npcx7_evb"; Make sure the programing succeed and EVB bootup. Change-Id: I9d448f55321330cbe9a7103d2b617617963ea307 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/858989 Commit-Ready: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* flash_ec: Support NPCX_INT_SPI using CCD.Aseda Aboagye2018-01-181-8/+35
| | | | | | | | | | | | | | | | | | | | | | A few things needed to be moved around in order for flashing the npcx7 to work over CCD. This commit makes those changes and fixes a small bug with the serial number parameter for raiden devices. (It just needed a space). It also fixes using just a SuzyQable to flash. BUG=b:71548795 BRANCH=None TEST=`./util/flash_ec --board meowth` with a servo_v4 and verify that flashing is successful. TEST=Repeat above test with a servo_v2. TEST=Repeat above test with a servo_micro. TEST=Repeat above test with a SuzyQable. Change-Id: I8ff22fb1d2a5fe7af2ad30a14bf896dbae65c024 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/851354 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* lux: Add lux boardNicolas Boichat2018-01-101-0/+1
| | | | | | | | | | | | | lux is a dual-battery poppy derivative. BRANCH=none BUG=b:67029560 TEST=make BOARD=lux -j Change-Id: I01fdb1e5e2b4803cdf7f03f9e6ee73603f84a7b8 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/845542 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* stm32: add meowth_fp boardVincent Palatin2018-01-081-1/+2
| | | | | | | | | | | | | | | | | | | Configure it as a fingerprint MCU. Currently use ZerbleBarn as a proxy for it. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=flash and run the image on ZerbleBarn, do a finger image acquisition with the 'fptest' console command. Change-Id: I6e060c2d1e950ec81092088e1793b186fc0a5fa0 Reviewed-on: https://chromium-review.googlesource.com/806169 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* util/flash_ec: npcx7 supports programming SPI flash via UARTCHLin2018-01-021-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds scripts to support updating ec image to the SPI flash by UUT(UART Update Tool) for npcx ec. A new array BOARDS_NPCX_UUT is introduced to include the board name which will use the UUT mechanism. The detail of test setup/procedure is listed below: 1. Connect the following singals between npcx7 evb and Servo board v2. NPCX7 EVB Servo V2 --------------------------------------- GPIO64/CR_SIN <--> UART1_SERVO_DUT_TX GPIO65/CR_SOUT <--> UART1_DUT_SERVO_TX VDD_3.3V <--> PPDUT_UART1_VREF 2. Manually pull the UUT mode strap pin(GPIO65/CR_SOUT) to ground with a 10 KOhm resistor. 3. Assert a EC VCC1_RST reset or issue a Power-Up reset. 4. Remove the pull-down in step 2. 5. Move npcx7_evb from array BOARDS_NPCX_7M6X_JTAG to BOARDS_NPCX_UUT in flash_ec. 6. ./util/flash_ec --board=npcx7_evb. BRANCH=none BUG=none TEST=Follow the steps above. Dump the SPI flash content to a file via JTAG. Compare the file and ec image. Make sure their content is all the same. Check the ec can reboot after programming. Run "sysjump rw"; make sure RW image works well. Change-Id: Iada5acb53179bdb78459c4fea7488fd2691575b6 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/826763 Commit-Ready: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* cleanup: Remove Nefario boardPhilip Chen2017-12-201-3/+0
| | | | | | | | | | | It's a dead board. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I9f5530afdea07bb5787fa2b674984147f8425fba Signed-off-by: Philip Chen <philipchen@google.com>
* wand: Add wand boardNicolas Boichat2017-12-201-0/+1
| | | | | | | | | | | | | | hammer derivative, with a battery. BRANCH=none BUG=b:66575472 TEST=make BOARD=wand -j, flash to reworked hammer board, battery charging works. Change-Id: I42366f4738b35c352b9be0c44a17ebeb323adfd1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/678756 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: add --verbose argNick Sanders2017-12-061-5/+25
| | | | | | | | | | | | | | | | Add the option to dump all dut-control and flashrom commands and their arguments. BUG=b:37513705 BRANCH=None TEST=./util/flash_ec --board fizz --verbose Change-Id: Ie57c270a925a00f76d25e52831aa11e23ab9a524 Signed-off-by: Nick Sanders <nsanders@google.com> Reviewed-on: https://chromium-review.googlesource.com/807485 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* cleanup: Remove honeybuns boardShawn Nematbakhsh2017-12-041-1/+0
| | | | | | | | | | | | | BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: Ieeb98eee02eabdf03413975ecf286ca69550ddfc Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/803946 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* coffeecake: initial commitRong Chang2017-11-291-0/+1
| | | | | | | | | | | | | Clone HoHo board to CoffeeCake. BRANCH=none BUG=none TEST=make BOARD=coffeecake -j Signed-off-by: Rong Chang <rongchang@chromium.org> Change-Id: I62b4bf92a2eaffbc145197c7f36cfb7a29722bf5 Reviewed-on: https://chromium-review.googlesource.com/673963 Reviewed-by: Benson Leung <bleung@chromium.org>
* flash_ec: Add support for meowth.Aseda Aboagye2017-11-161-1/+2
| | | | | | | | | | | | | BUG=None BRANCH=None TEST=None Change-Id: Ib0c6b029c608ac361ed661249138589c99ea68b6 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/772910 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* grunt: Initial GPIO setup for gruntEdward Hill2017-11-141-1/+1
| | | | | | | | | | | | | | | | Configure GPIOs to match grunt proto v1.1 schematic. Change EC chip to npcx7m6f. Minimal board.c/h, just enough to build. BUG=b:64935726 BRANCH=none TEST=make BOARD=grunt Change-Id: I1a1f581c7ee7b80808c0dde179bc3ee0d69f960e Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754302 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* rainier: add rainier support for flash_ecEge Mihmanli2017-11-141-0/+1
| | | | | | | | | | | | | BUG=chromium:776441 BRANCH=none TEST=Run "./flash_ec --board=rainier" from ec/util directory and make sure there is no error "board rainier not supported" on stderr. Signed-off-by: egemih@chromium.org Change-Id: I4b4b714962685d0b33d3b9aa4c96b5a89eb566c5 Reviewed-on: https://chromium-review.googlesource.com/767589 Commit-Ready: Ege Mihmanli <egemih@google.com> Tested-by: Ege Mihmanli <egemih@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* cleanup: Remove llama boardShawn Nematbakhsh2017-11-091-1/+0
| | | | | | | | | | | | | | | | | The llama is a South American relative of the camel, though the llama does not have a hump. These sturdy creatures are domestic animals used by the peoples of the Andes Mountains. BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: I55dbd8d5b0b14c41e27c4ef473833563f38878c3 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/761298 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* board: Add support for whiskers boardNicolas Boichat2017-11-091-0/+1
| | | | | | | | | | | | | A hammer derivative. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: I8df5156d622bf518f647addf2fcea6342b2d6f2b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754078 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: Set NEED_SERVO according to chip name instead of board nameWai-Hong Tam2017-11-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | One can pass either a board name (e.g. hammer) or a chip name (stm32) to the flash_ec command. If given a board name, will map to a proper chip name and then call its chip-flashing method. The NEED_SERVO variable ("no" if servo not needed) was set according to the board name. It was broken if only given a chip name. It should be set according to the chip name. BUG=b:68943874 BRANCH=None TEST=Flashed the Staff firmware SERVO $ dut-control ec_boot_mode:on DUT $ ectool gpioset PP3300_DX_BASE 0 DUT $ ectool gpioset PP3300_DX_BASE 1 DUT $ flash_ec --chip stm32_dfu --image staff_ec.bin SERVO $ dut-control ec_boot_mode:off DUT $ ectool gpioset PP3300_DX_BASE 0 DUT $ ectool gpioset PP3300_DX_BASE 1 Change-Id: I1799f083115bfdf203a405733c5baefadbe3fe3e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/755614 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* flash_ec: Get the path of EC UART PTY only in flash_stm32Wai-Hong Tam2017-10-301-3/+2
| | | | | | | | | | | | | | | | | | Flashing STM32 requires the EC UART. The path of EC UART PTY was originally set under some conditions which didn't reflect the case. Instead of fixing these conditions, this change simply moves it inside flash_stm32() as other flash functions don't need EC UART PTY. BRANCH=none BUG=b:67010776 TEST=Used servo-micro to flash_ec a STM32 EC, no error on getting EC UART PTY. Change-Id: I20c31de8e6c7a99fde259f4f397e53325ee80b07 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/745101 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* ec: add initial nautilus boardChris Wang2017-10-231-0/+2
| | | | | | | | | | | | | | For now use the files from poppy. To be changed later on. BUG=b:66458931 TEST=emerge-nautilus chromeos-ec/make buildall -j Change-Id: If829d7307f834f1f30878934623c0e9ee77b907d Signed-off-by: Chris Wang <chriswang@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/701996 Commit-Ready: Grace Kao <grace.kao@intel.com> Tested-by: Grace Kao <grace.kao@intel.com> Reviewed-by: Philip Chen <philipchen@chromium.org>
* flash_ec: Add 1s delay after turning on SPI VREF.Aseda Aboagye2017-10-181-0/+7
| | | | | | | | | | | | | | | | | On zoombini, we were taking enough power that the voltage dipped for a little bit. This commit adds a 1 second delay after applying SPI VREF but before actually flashing the EC. BUG=b:65694390 BRANCH=None TEST=`./util/flash_ec --board zoombini` still works. Change-Id: I431cbfcc569fd5369971b06dedb85e8d5fdb9a32 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/722354 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* flash_ec: Save more variables.Aseda Aboagye2017-10-121-3/+6
| | | | | | | | | | | | | | | | | | | It was found on zoombini, when flashing via flash_ec failed, it would prevent the board from booting as certain controls were left in their "flashing" state. This was because these controls were missing from the variables list which is what was used to restore the controls. BUG=b:65694294 BRANCH=None TEST=Attempt to flash zoombini without the flex connected. Attach the servo flex, apply power, verify DUT boots up. Change-Id: Ic2bc74ef1a61d4f10da6d3ceac77fbd373697838 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/714023 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* grunt: initial setup for ecYH Lin2017-10-111-0/+1
| | | | | | | | | | | | | | Initial files for grunt, to be revised later. BUG=b:67187149 TEST=None BRANCH=None Change-Id: I392bb4982fea0c9374ba8d262f8f4288522207d5 Signed-off-by: YH Lin <yueherngl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/699554 Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* cleanup: Remove lucid and snoball boardsShawn Nematbakhsh2017-09-121-2/+0
| | | | | | | | | | | | | BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: I667e471d4d9187f530da7ae8807c8aa339a17847 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/663817 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* cleanup: Remove 'ryu' boardShawn Nematbakhsh2017-09-111-1/+0
| | | | | | | | | | | | | | | Remove 'ryu' and related ryu-only code. BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: I19b966ea6964a7ed083724f7de80ae192235a406 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/656314 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Intel GLK-RVP: Add initial board bringup codeVijay Hiremath2017-08-071-0/+1
| | | | | | | | | | | | | | | | | | Added bare minimum code to bringup the Intel GLK-RVP using Nuvoton AIC. BUG=b:64394037 BRANCH=glkrvp TEST=Intel GLK-RVP2.0 boots to Chrome OS using Nuvoton AIC. Change-Id: I86816d09fe428091438a16f014e23b2e0c0025b7 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/602515 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: Make sure die works in ec_uart_pty().Aseda Aboagye2017-08-031-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If flash_ec was run without `servod` running and servod is needed, an error message is printed out. ERROR: Cannot communicate with servo. is servod running ? However, in the case of flashing an stm32 without servod running, execution would continue and would lead to claim_pty freezing and thawing a bunch of unrelated processes. I believe the reason is that the "die" was run in a subshell and therefore execution continued. This commit now changes the way that servo_ec_uart_pty() works. If no PTY is found, then flash_ec exits printing out the error message. Additonally, claim_pty() will now warn if no arguments are passed to it instead of finding random victims. BUG=chromium:751386 BRANCH=maybe some fw branches. TEST=Without servod running, try `./util/flash_ec --board hammer`; Verify that flash_ec exists after the call to die. Change-Id: I50784e0c43bbf0e32d408261cb83029377b576a0 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/598506 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* flash_ec: Update method of retrieving serial num.Aseda Aboagye2017-08-021-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | There have been some new methods added to servod to retrieve the serial numbers of the servos attached. Prior to this, with a servo micro connected to a servo v4, retrieving the serial number would always return that of the servo v4. This would cause flashing to fail. This change updates the method to retrieve the serial numbers. CQ-DEPEND=CL:597209 BUG=chromium:740026 BRANCH=maybe some fw branches. TEST=With updated hdctools, flash a kevin using a servo micro connected to a servo v4. TEST=Flash kevin with a servo v2. TEST=Attempt to flash a hammer and verify that the only issue is stm32mon not being able to determine the startup of the monitor mode (since I don't actually have a hammer). Change-Id: I82c2907d689311fe65717a833390b8d0f6e15a94 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/597211 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* flash_ec: Add support for zoombini.Aseda Aboagye2017-07-261-0/+1
| | | | | | | | | | | | | | BUG=None BRANCH=None TEST=Run flash_ec and verify that fw_up is used when trying to flash and that the right programmer is selected. Change-Id: I4d345812c5363895a83b1bdd2e3097148d4ae161 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/587392 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* flash_ec: Fix common_stm32_VARS definition.Aseda Aboagye2017-07-241-2/+2
| | | | | | | | | | | | | | | | In the recent change to flash_ec, there was a problem with they way that common_stm32_VARS was defined. This commit fixes the issue. BUG=chromium:740026 BRANCH=potentially some FW branches. TEST=Using servo_v2, flash elm. Change-Id: I2e14f1f45525f494d9912b420d36d02d89b9dc5a Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/583540 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* flash_ec: Add servo support for Scarlet rev1Philip Chen2017-07-211-2/+1
| | | | | | | | | | | | | | | This will also kill the servo support for Scarlet rev0. BUG=b:62269890 BRANCH=none TEST=none Change-Id: Ibacd8905bf0a07e3787adb7fe1a1daaf2ff98943 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/578927 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: add nefario for supportCaesar Wang2017-07-201-0/+3
| | | | | | | | | | | BUG=b:63408169 BRANCH=none TEST=utils/flash_ec --board=nefario Change-Id: Ic13d6257a548d6c759542f3e8e679b0ce2b4de51 Signed-off-by: Caesar Wang <wxt@rock-chips.com> Reviewed-on: https://chromium-review.googlesource.com/578694 Reviewed-by: Philip Chen <philipchen@chromium.org>
* flash_ec: Add support for servo micro.Aseda Aboagye2017-07-191-30/+53
| | | | | | | | | | | | | | BUG=chromium:740026 BRANCH=maybe some FW branches. TEST=Use a servo_micro, flash kevin, verify kevin boots. TEST=Repeat above test with a servo_v2. Change-Id: I377384f44e85c4a6032871aa4eebd208fd6e3336 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/572142 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* util/flash_ec: Support gang programmer mode for spi flash in npcx ecMulin Chao2017-07-131-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds support for updating FW to the internal spi flash in npcx ec by enabling gang programmer mode. We also added a new array, BOARDS_NPCX_INT_SPI, to indicate which boards will update FW through this mechanism. The preliminary of testing is listed below. Step 1: Connect npcx7 evb and servo v2 with following pins. NPCX796F Servo V2 ----------------------------------------- GP_SEL# --> (Pin 7, J7) FW_UP# VCC1_RST#--> (Pin 4, J7) DUT_COLD_RESET# GP_CS# --> (Pin 1, J11) DUT_SPI1_CS GP_SCLK --> (Pin 2, J11) DUT_SPI1_CLK GP_MISO --> (Pin 5, J11) DUT_SPI1_DO GP_MOSI --> (Pin 6, J11) DUT_SPI1_DI ----------------------------------------- Step 2: Npcx ec is powered up by PPDUT_SPI1_VREF (Pin 8, J11). Step 3: Add external PU on FW_UP#. Step 4: Execute "sudo servod --vendor 0x18d1 --product 0x5002". BRANCH=none BUG=none TEST=Move npcx7_evb from BOARDS_NPCX_7M6X_JTAG to BOARDS_NPCX_INT_SPI. Prepare two different ec images. Use following script "while :; do ./util/flash_ec --board=npcx7_evb --image=../ec1.bin; sleep 1; ./util/flash_ec --board=npcx7_evb --image=../ec2.bin; sleep 1; done" to test gang programmer mode. No errors occur over 2 hours. Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Change-Id: Ie813bf0191c06bb6e30a5e0dccb824f9f79ada53 Reviewed-on: https://chromium-review.googlesource.com/564742 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* flash_ec: fix for SERVO_TYPE=toadWei-Han Chen2017-06-151-22/+22
| | | | | | | | | | | | | | | | | In CL:503475, SERVO_TYPE is initialized *after* toad cable detection. This make flash_ec failed to update plankton EC. This CL adjust the timing of SERVO_TYPE detection, so toad cable detection can work properly. BUG=b:35648297 BRANCH=plankton TEST=utils/flash_ec --board=plankton Change-Id: I08a11b99109454096949b3ff64ed1c4d5f9891df Reviewed-on: https://chromium-review.googlesource.com/535381 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: Support servo_v4 w/ CCD for flash_stm32.Aseda Aboagye2017-06-131-1/+8
| | | | | | | | | | | | | | | | Using servo v4 with the captive CCD cable to flash an STM32 requires bit banging mode to be enabled. This commit adds that support. BUG=b:35648297 BRANCH=gru TEST=Add support for rowan and flash rowan with no issues. Change-Id: I6317d4acdd569888e20a1e298de7c8b620e94bb1 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/503476 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* flash_ec: Add concept of servo type.Aseda Aboagye2017-06-131-19/+52
| | | | | | | | | | | | | | | | | | | Not every servo has support for the same controls. For example, servo micro doesn't have the JTAG buf on flex elements. This commit cleans up the assumptions made and defines some variables which indicate which controls are supported on a particular servo type. The servo type is obtained by the "servo_type" control from servod. BUG=b:35648297 BRANCH=gru TEST=With some other patches, try and flash rowan with a servo v4. Change-Id: Ie10f4f73028a01a81638e9114b48c88941b8bf93 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/503475 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* flash_ec: add scarlet supportBrian Norris2017-06-081-0/+3
| | | | | | | | | | | | | | | BUG=b:62307687 BRANCH=gru TEST=`flash_ec --board=scarlet` Change-Id: Iaee413a3710921c37763ddf620eba558da6e569f Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/448760 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/528060 Commit-Ready: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* npcx7_evb: Add initial board driver of npcx7 ec evb.Mulin Chao2017-05-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the evaluation board driver of npcx7 series ec for testing. If you received the evb which ec is 128-pins package, please notice it has the following limitations. a. No GPIOD7/E0 pins. b. No I2C4_0, I2C4_1, I2C5_1 and I2C6_1 ports. c. No ADC7, ADC8 and ADC9 channels. d. No JTAG port 1. e. Do not enable CONFIG_HIBERNATE_PSL since no PSL circuit on evb. This CL also includes: 1. Modified reset config from srst to sysresetreq in openocd/npcx.cfg. Make sure openocd driver can reset ec by using NVIC_SYSRESETREQ. 2. Add flash utilities for npcx7 ec in openocd/npcx_cmds.tcl. 3. Add npcx7_evb support in flash_ec. BRANCH=none BUG=none TEST=Passed all npcx7 drivers verification on the evb no matter which ec's package is 128 or 144 pins package. Change-Id: I8224d97cd66ce483d70816f47b2e124308f1b69c Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/505832 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* reef_it8320: initial reef_it8320 boardDino Li2017-05-181-0/+1
| | | | | | | | | | | | | | This change is based on reef's board code and modified for it8320. BUG=none BRANCH=none TEST=Run the entire faft_ec suite and passed. Change-Id: I8977d7431eb0a97ceb4ee1dfd11a2c4433687db0 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/487792 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec: add initial coral related filesYH Lin2017-05-161-0/+3
| | | | | | | | | | | | | | For now use the files from reef. To be changed later on. BRANCH=none BUG=b:38271615 TEST=emerge-coral chromeos-ec Change-Id: Iff0a7b21b575d6394c27ff9959010496801fd056 Reviewed-on: https://chromium-review.googlesource.com/506117 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* hammer: Add staff boardNicolas Boichat2017-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | hammer corresponds to poppy, and staff corresponds to soraka. Current differences (hammer/staff): - USB id (5022/502b) - PWM frequency (10kHz/100Hz): - On staff, driving PWM at 10kHz leads to an actual duty cycle around 30-40%, with a PWM output at 1% (long rise/fall time). 100Hz looks better, we get ~1.45% duty with 1% PWM output. BRANCH=none BUG=b:38277869 TEST=Flash staff, boots fine. TEST=pwm 0 1 shows quite dim backlight on staff. Change-Id: I66ba2adf89fbee8578ee473afb28e3e242b4d111 Reviewed-on: https://chromium-review.googlesource.com/505855 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: Respect the raiden flag if no board givenWai-Hong Tam2017-05-161-1/+1
| | | | | | | | | | | | | | | | In a lab servo, flash_ec is executed without the board flag. In this case, don't check the board flag for raiden and simply respect the raiden flag. BRANCH=none BUG=b:38319398 TEST=Ran the flash_ec script in a lab servo. Change-Id: Ib3757a4b7b550fd77facffdf2009cc3317591888 Reviewed-on: https://chromium-review.googlesource.com/506461 Commit-Ready: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* Fizz: Add Fizz to flash_ecDaisuke Nojiri2017-04-171-0/+2
| | | | | | | | | | | | | This patch also fixes years and board names in the comments. BUG=b:37271713 BRANCH=none TEST=none Change-Id: Ib9595a7e091c70680333a02ba2fdde3f24c0f4e6 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/475210 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* ec: add initial soraka related filesYH Lin2017-04-151-2/+4
| | | | | | | | | | | | | For now use the files from poppy. To be changed later on. BUG=b:36995255 TEST=emerge-soraka chromeos-ec Change-Id: Iaf0b2a359586dd4cfdba483a6836eefee06f82c1 Reviewed-on: https://chromium-review.googlesource.com/476934 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>