summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Clear OWNERS for factory/firmware branchfirmware-mistral-12422.BBrian Norris2021-09-106-21/+0
| | | | | | | | | | | | BUG=none TEST=none Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1 Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155205 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Owners-Override: Jora Jacobi <jora@google.com> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* stm32: Fix manual interrupt clearing functionCraig Hesling2020-03-161-1/+3
| | | | | | | | | | | | | | | | | | | | | This fixes a bug in gpio_clear_pending_interrupt, where all pending interrupts are unintentionally cleared. This is not in the code path for normal gpio interrupt handlers, since the normal interrupt clearing occurs in gpio_interrupt (right below this function). BRANCH=none BUG=chromium:1059520 TEST=none Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I4d6fe7947f4d76cf3b57dfbf3bb926e41851c80c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101208 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> (cherry picked from commit c2c2c083fef813e3e3c70f8c13a1418717ba682d) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106677
* octopus: reduce USB-C source current to 1.5Alu.zhang2019-08-131-1/+0
| | | | | | | | | | | | | | | | octopus hardware does not support sourcing 3A over USB-C and 1.5A over USB-A at the same time for any daughter board. Reduce what we advertise to 1.5A. BRANCH=none BUG=b:139110010,b:139201733 TEST=connect a sink device with a pd analyzer to see if source capabilities is 5V/1.5A Change-Id: Idad7a11b28cefda1aabbca540864a6248d826a47 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741597 Reviewed-by: Edward Hill <ecgh@chromium.org>
* ppc: initialize vbus current limit on initJett Rink2019-08-131-0/+9
| | | | | | | | | | | | | | | The nx20p348 should also set the initial current limit during its initialization. BRANCH=octopus BUG=b:139110010,b:139201733 TEST=with CL stack, phaser limits both ports to 1.5A Change-Id: I876b32434bd37bf410d546a3d27f0f7ba949d3ea Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749945 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* motion: bh1730: use 1K scale for d1_1k/d0_1kJongpil Jung2019-08-131-1/+3
| | | | | | | | | | | | | | | | | | | To use integer instead of float, we use d1_1k/d0_1k instead of d1/d0. But when we devide value, d1_1k/d0_1k is not 1k base. So, before we use value, we need to multiply value by 1K. BUG=b:130835790 BRANCH=none TEST=make -j BOARD=kohaku flash ec.bin on kokaku and read lux with ectool motionsense Change-Id: If4e6abae43b4d296007680452f0584366825ad1e Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1739028 Tested-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org>
* kohaku: Update tuned parameters to get lux from BH1733Jongpil Jung2019-08-131-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | Tune parameters for equation to get lux from register value. How to tune parameters. Place system into dark chamber. Place halogen/led lamp. We can change lux from lamp. Read data0 and data1 from two different devices. Then we will get two equation from test. Solve equation to get/calculate constant value as light source. Parameter can be changed as chassis. BUG=b:130835790 BRANCH=none TEST=make -j BOARD=kohaku flash ec on kokaku and then check lux with ectool motionsense Change-Id: I01950a62a2a449728c2d99aae7f7551b3b9d8bea Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1739029 Tested-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* gsctool: print devid in image version outputMary Ruthven2019-08-131-0/+24
| | | | | | | | | | | | | | | If the image is node locked to a devid, print that information in the '-b' output. BUG=none BRANCH=none TEST=get version output of node locked and prod signed image. Change-Id: I0db2828d7bd699013ec84467c7e2a4b918bd7b27 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742913 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: add support for endorsement seed vcMary Ruthven2019-08-131-3/+85
| | | | | | | | | | | | | | | Add support for getting and setting the endorsement key using the vendor command. BUG=b:138943966 BRANCH=none TEST=Get/Set endorsement seed using vendor command. Change-Id: I5c2f5d9efa0fbc236731430cac650785693c8db8 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1740076 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* g: add vendor cmd to get/set the endorsement seedMary Ruthven2019-08-133-1/+66
| | | | | | | | | | | | | | | | We've had some eraseflashinfo issues that cause the endorsement key seed to get lost. Add a vendor command, so we can set the endorsement key seed if it's erased. BUG=b:138943966 BRANCH=none TEST=get/set endorsement key seed. Change-Id: Iee7d78e22f44786efd86b3ec68780a53e567705d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1740075 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* gsctool: make options mutually exclusiveMary Ruthven2019-08-131-2/+3
| | | | | | | | | | | | | | | | Fix the mutually exclusive check, so using 2 raises an error. Also fix the error message to show -U instead of -u. Upstart isn't exclusive. CCD unlock is. BUG=none BRANCH=none TEST=gsctool -i -U raises an error. Change-Id: Iaf43f18fefc1a8c4b6612b05daa5c82a7680b310 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1742220 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* kohaku: add TEMP_SENSOR_3 and TEMP_SENSOR_4 to DPTFPaul Fagerburg2019-08-133-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Kohaku V24 schematic adds two additional temperature sensors to the EC. Add these to the DPTF tables. BRANCH=none BUG=b:138578073 TEST=Rebuild EC and BIOS, look for new thermal sensors in kernel. 1. Build EC ``cd ~/trunk/src/platform/ec`` ``make -j BOARD=kohaku`` 2. Program EC ``./util/flash_ec --board=kohaku`` 3. Reboot device 4. Rebuild BIOS ``cd ~/trunk/src/third_party/coreboot`` ``FEATURES="noclean" FW_NAME=kohaku emerge-hatch chromeos-ec depthcharge vboot_reference libpayload coreboot-private-files intel-cmlfsp coreboot-private-files-hatch coreboot chromeos-bootimage`` 5. Use flashrom to program the BIOS 6. Reboot device 7. Log into the root console (ctrl-alt-F2 or servo) 8. Example thermal sensor information ``grep . /sys/class/thermal/t*/type`` Look for "TSR0" through "TSR3" in the output. Change-Id: Ifb0cc83418e684cf6b2a66eb046267f07bf3e7f8 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1740186 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* driver: lis2dw12: Add driver supportmario tesi2019-08-137-0/+789
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added ACC LIS2DW12 driver support. Features included in this driver are: - Basic Sensor Read acceleration data - ODR and FS runtime configuration - FIFO support with watermark interrupt events - Shared commons function with ST MEMs devices - Switch Low Power to High perf. mode in case of ODR > 200 Hz - Configure D-TAP event detection in Hardware BUG=b:73546254 BRANCH=master TEST=Tested on discovery_stmems target BOARD with LIS2DW12 connected to EC i2c master bus and motion sense task running. To build firmware for discovery_stmems target with LIS2DW12 sensor connected, simply uncomment CONFIG_ACCEL_LIS2DW12 define in board.h target file and make with target BOARD=discovery_stmems. Commands used to test LIS2DW12 device are: - accelinit 0 (to configure accel. device) All basic features tested, including changing in ODR: - accelrate 0 10000 (set ODR to 10 Hz) - accelrate 0 12500 (set ODR to 12.5 Hz) - accelrate 0 25000 (set ODR to 25 Hz) - accelrate 0 50000 (set ODR to 50 Hz) - accelrate 0 100000 (set ODR to 100 Hz) - accelrate 0 200000 (set ODR to 200 Hz) - accelrate 0 400000 (set ODR to 400 Hz) - accelrate 0 800000 (set ODR to 800 Hz) - accelrate 0 1600000 (set ODR to 1.6 kHz) Full Scale Range: - accelrange 0 2 (set Full Scale Range to 2g) - accelrange 0 4 (set Full Scale Range to 4g) - accelrange 0 8 (set Full Scale Range to 8g) - accelrange 0 16 (set Full Scale Range to 16g) FIFO features and interrupt management: - accelinfo on 1000 (motion info task with refresh rate 1 s) and polling data read: - accelread 0 (to read data from accelerometer) Change-Id: I0b9861a71e81052e7ee8eb235a1a5b2a57d4c6f5 Signed-off-by: mario tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/515302 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* hatch: update for 30.9K resistor in thermistor dividerPaul Fagerburg2019-08-136-9/+9
| | | | | | | | | | | | | | | | | | | All hatch-family hardware uses a 30.9K resistor in the temperature sensor with the 47K thermistor. Update Hatch reference, Helios, and Kindred. BRANCH=none BUG=b:124316213 TEST=Rebuild EC for each board: ``cd ~/trunk/src/platform/ec`` ``make -j BOARD=hatch`` ``make -j BOARD=helios`` ``make -j BOARD=kindred`` Change-Id: I71cb0b8db79f64e4809a2ef66db6fb1f0607ed53 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749740 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* cleanup: change initializer for storm_trackerJett Rink2019-08-131-1/+1
| | | | | | | | | | | | | | | The octopus firmware branch cannot build with the { 0 } format, but it can build with {}. Since they mean the same thing, use {} everywhere. BRANCH=octopus BUG=none TEST=build on ToT and octopus branch Change-Id: I621dd89c40b8c7297db72a3093631f9aba8dd9b6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749551 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Trembyle: Change port 1 PPC to NX20P3483Denis Brockus2019-08-132-5/+6
| | | | | | | | | | | | BUG=b:138599218 BRANCH=none TEST=make buildall -j Change-Id: If68259e289a2b3e052028ff0b2ffd59076eaf970 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745569 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* dma: separate out DMA enable status from wait_for_bytesTom Hughes2019-08-137-28/+64
| | | | | | | | | | | | | | | | | | | | | | | When wait_for_bytes returns 0 when DMA is disabled, we can't differentiate between DMA being disabled and a transfer having completed when it has reached the end of the requested transfer. Separating out into separate functions lets us distinguish the two cases. The reason we didn't hit this in the past is that the requested receive size is generally larger than the actual amount we're sending. Since we know the amount that we're waiting for from the header, we would stop the transfer in software. BRANCH=none BUG=b:132444384 TEST=On DUTs with bloonchipper and dartmonkey: ectool --name=cros_fp testmaxtransfer TEST=make buildall -j Change-Id: I885161a3e04b7a12d597d8dc8691f599990bda8b Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1734010 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* npcx: i2c: adjust i2c bus frequency when it is set to 100kHz.Mulin Chao2019-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When npcx i2c module's bus frequency is set to 100KHz, it operates in normal mode and its bus frequency, fSCL, follows the formula listed below: fSCL = fCLK / (4*SCLFRQ), ie. SCLFRQ = fCLK / (4*fSCL) where fCLK is the source clock frequency of i2c module and SCLFRQ defines the SCL output period in SMBCTL2/3 registers. But integer division in this formula is equal to the floor of regular division if it isn't divisible. So far, all i2c modules' source clock frequency is 15MHz and if the desired i2c bus frequency is 100KHz, the SCLFRQ will be: SCLFRQ = fCLK/(4*fSCL) = 15MHz/(4*100kHz) = floor(37.5) = 37 And the actual i2c frequency is: fSCL = fCLK/(4*SCLFRQ) = 15MHz/(4*37) = 101.35KHz That's why we observe the i2c frequency is slightly higher than 100kHz. To fix this issue, this CL replaces integer division with the ceiling value of the formula to make sure bus frequency is lower than 100KHz and meet i2c spec when it operates in normal mode. BRANCH=none BUG=b:138350407 TEST=No build errors for npcx series. Measure the actual i2c bus which is configured to 100KHz after applying this CL. The actual frequency is 98.7 KHz on npcx5/7 evbs. Change-Id: I71e2c3090bc91c7b9945c01c04c9ac5ac656c893 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741566 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* cbi-util: Remove OEM_ID from required fieldsPhilip Chen2019-08-121-6/+4
| | | | | | | | | | | | | BUG=b:138663009 BRANCH=none TEST=successfully create a cbi image w/o OEM_ID set Change-Id: Ic2b96f6d6f02a433de4f2ddc0777035369fd9c4a Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1734007 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* Trembyle: Set GPIO pullup and voltageEdward Hill2019-08-121-12/+10
| | | | | | | | | | | | | Add GPIO_PULL_UP and GPIO_SEL_1P8V to GPIOs as needed. BUG=b:138615773 b:138617417 BRANCH=none TEST=make BOARD=trembyle Change-Id: I80401c1cee181acc2df7fb41a5f32ea8c3076a14 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1747006 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* kohaku: update for 30.9K resistor in thermistor dividerPaul Fagerburg2019-08-122-3/+3
| | | | | | | | | | | | | | The resistor divider on Kohaku for the temperature sensors has been changed to a 30.9K pull-up with the same 47K thermistor. BRANCH=none BUG=b:124316213 TEST=Rebuild EC and flash Change-Id: Ida61cc448ece42dbd026846b27fd861054e66189 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745357 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* thermistor: update Steinhart-Hart equationsPaul Fagerburg2019-08-123-1/+54
| | | | | | | | | | | | | | | Add support for 30.9K pull-up on resistor divider with the 47K thermistor. BRANCH=none BUG=b:124316213 TEST=Rebuild EC and flash Change-Id: I5bc72fa67549ab15c0e4e1b0291eb934990ee61b Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742914 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* hatch: SLP_S3/S4 sideband signals guarded with wrong configKeith Short2019-08-129-9/+4
| | | | | | | | | | | | | | | | All the hatch platforms had a typo with the config option guarding the configuration of the SLP_S3_L and SLP_S4_L signals. Changed CONFIG_HOSTCMD_ESPI_VW_SIGNALS to CONFIG_HOSTCMD_ESPI_VW_SLP_SIGNALS. BUG=b:139198212 BRANCH=none TEST=make buildall -j Change-Id: I96c01fb8e1903585f3bc19a30b2f9c0596e9edad Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745655 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* kukui: Check IRQ and HPD in DPStatus message.Pi-Hsun Shih2019-08-121-1/+1
| | | | | | | | | | | | | | | | | | | Per the VESA DisplayPort Alt Mode on USB Type-C spec, IRQ_HPD indicates that a high to low followed by a low to high transition was detected. Therefore, we should be checking when IRQ is high and HPD is low is received as that is an error. This commit fixes that bug where were comparing our level to the GPU instead of what was shown in the PDO. This is basically applying CL:1422458 to kukui. BUG=b:138696135 BRANCH=none TEST=manually Change-Id: I53e6d96a54dc45910055a7d535bf89477ce87430 Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1743906 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hammer: Add masterball boardNicolas Boichat2019-08-123-1/+14
| | | | | | | | | | | | | | | | A close hammer derivative. BRANCH=none BUG=b:138968914 TEST=make BOARD=masterball -j Flash into staff, see the board boot: util/flash_ec --board=masterball --port=9000 Change-Id: I9f8d897c23d0f53557c6d6789c33e5b776dca982 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741589 Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* hammer: Refactor config options to support more variantsNicolas Boichat2019-08-125-69/+108
| | | | | | | | | | | | | | | | | board.h is already quite difficult to read, and will become worse as we add more and more derivatives, let's refactor most of the variations into variants.h. BRANCH=none BUG=b:138968914 TEST=make buildall -j, see that there is no size change before and after the change. Change-Id: Ideb381d8d04c65c3e76eb3ab9353e1ce5cdee954 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746352 Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* cr50: use dedicated region for info1 accessesVadim Bendebury2019-08-106-115/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The INFO1 flash space is used for various purposes (endorsement key seed, Board ID and flags, serial number, etc.). Accessing these spaces in INFO1 is accompanied by managing the flash region registers, each time opening a window of the appropriate size, with appropriate permissions, etc, In fact none of these spaces contain a secret, to simplify things and preventing situations when concurrent accesses change the flash range window settings lets dedicate previously unused Region 7 register file to providing always open read access to INFO1. Write access will be enabled/disabled as required. In prod images write accesses will always happen from the vendor command context. In DBG images CLI commands will also have write access to INFO1. INFO1 window is accessed by other H1 based devices as well, this is why it is necessary to enable the window in the common chip code. BRANCH=cr50, cr50-mp BUG=b:138256149 TEST=the firmware_Cr50SetBoardId test now passes on Mistral. Cq-Depend: chrome-internal:1577866, chrome-internal:1581327 Change-Id: Id27348f3b04191f1b3b60fd838d06009f756baa2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1730147 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* flash_ec: removing the bandaid fix on setting i2c_mux for npcx_uutNamyoon Woo2019-08-101-17/+1
| | | | | | | | | | | | | | | The issue in http://b/126189871 has been fixed thanks to pseudo_i2c driver. There is no need to retry 'dut-control dut_i2c_mux:ec_prog'. BUG=b:126189871 BRANCH=none TEST=ran flash_ec on Ampton twice in a raw using CCD, and servo_v4 as well. Change-Id: I72e2bf8eb48dff7a3c81545221ac71a44469c033 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746974 Reviewed-by: Matthew Blecker <matthewb@chromium.org>
* usb: convert cc1 from int to enumJett Rink2019-08-0918-57/+73
| | | | | | | | | | | | | | Refactor code to use proper type for cc1 and cc2 lines. BRANCH=none BUG=none TEST=builds. No functional change. Change-Id: Id292db8480920e2b191bac9d9ecc2685f61e4ea9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744654 Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* usb: fix issue with CC line interpretation as DTSJett Rink2019-08-091-8/+6
| | | | | | | | | | | | | | We need to pass both cc1 and cc2 into the get current limit function. BRANCH=none BUG=none TEST=unit test pass still Change-Id: I123fb315948ee042ad1ea05bb835e618f4ca31de Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744653 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* test: use new TEST_EQ for usb testsJett Rink2019-08-091-286/+275
| | | | | | | | | | | BRANCH=none BUG=none TEST=builds and passes. Error have better message now Change-Id: I606f6d0711ac1333ce8974449751bd8fed31d22d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733741 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* test: make TEST_EQ and TEST_NE use %d as formatJett Rink2019-08-091-2/+2
| | | | | | | | | | | | | | | When using TEST_EQ, the checkpatch.pl script complains about space around a ...., %d). When we are testing for equality, we are most likely be using a integer BRANCH=none BUG=none TEST=Uses of TEST_EQ work as expected when displaying errors Change-Id: Iedc69ee8b3e98fdcb2243f9dde445425f2714818 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1739584 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* flash_ec: die explicitly on error casesNamyoon Woo2019-08-091-18/+34
| | | | | | | | | | | | | | | | | | | | | | | This patch lets flash_ec die on any of program, read and verification errors. Intends to help testers recognize those failures easier. BUG=b:137386185 BRANCH=None TEST=Ran flash_ec on several platforms with program and verify args. Also checked the exit code for each case, and temp file deletion as well: - Fleex (Octopus) with servo_micro, and ccd, covering npcx_int_spi and npcx_uut - Ampton(Octopus) with servo_micro, and ccd, covering it83xx - Atlas with servo_v2, servo_micro, and ccd, covering npcx_int_spi - Scarlet with ccd, covering stm32 - DragonTalon with servo_v2 and servo_micro, covering stm32 - Coral with servo_v2, servo_micro, and ccd, covering npcx_spi Change-Id: I5a545f6ac6f4b09f405a51bb69c3adf2d3d6cb6e Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745348 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* doc: switch to markdown anchorsKeith Short2019-08-092-30/+30
| | | | | | | | | | | | | Switch from HTML to markdown anchors for linked references. BUG=none BRANCH=none TEST=none Change-Id: Ibd032e58cb0bea9234713fa3082db8fb3e259153 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1745346 Reviewed-by: Edward Hill <ecgh@chromium.org>
* doc: Add documentation for EC termsKeith Short2019-08-093-4/+164
| | | | | | | | | | | | | Add documentation for acronyms and technologies used in the EC codebase. BRANCH=none BUG=none TEST=run md_browser.py against changes Change-Id: I2ccc6e7c0c60144ded2e7b8cc171fa2a2897d006 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1740080 Reviewed-by: Edward Hill <ecgh@chromium.org>
* g: Make DMEM word writes explicitLouis Collard2019-08-091-85/+104
| | | | | | | | | | | | | | | | | | This change refactors access to DMEM during ECC operations to make all writes explicitly word writes. This is effectively a no-op, but should prevent against any future regressions. BUG=b:131807777 TEST=build and flash on soraka locally, ensure signature of known blob matches signature generated prior to this CL BRANCH=none Signed-off-by: Louis Collard <louiscollard@chromium.org> Change-Id: Ie24712c3f4a5dc15c8ad08cd50b9e8b9cdab2822 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1595928 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* kohaku: Change location for bh1730 ALSScott Collyer2019-08-092-5/+5
| | | | | | | | | | | | | | | | | The bh1730 ALS, used for keyboard backlight control is located in the base, not the lid. This CL changes the location field in the sensor config table and associated sensor enum value. BRANCH=none BUG=b:138866924 TEST=make -j BOARD=kohaku Change-Id: I7d46cefe7d092a77604f8f239f16e8c813a04bdf Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1743213 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* hatch: Allow data role swaps when EC is in ROScott Collyer2019-08-091-9/+2
| | | | | | | | | | | | | | | | | | | | | | | Data role swap requests were being rejected when the EC was running RO. This can result in our type C ports attaching in the wrong data role in cases such as dead battery. The rationale for this PD policy is no longer valid as data/power roles are perserved during RO to RW sysjumps. This CL removes the check for RO such that data role swaps are allowed. BUG=b:138618816 BRANCH=none TEST=Tested by issuing battery cutoff command, then connected a powered charger though hub. Verfied that data role swap request is no longer reejected and the USB device attached to the hub enumerates as expected. Change-Id: Ic63ecde3336ba4c64492d9f727035c8fea936e8f Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742870 Tested-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* pi3usb9201: Add EC console log for host CDP mode settingScott Collyer2019-08-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | For the pi3usb9201 the usb D+/D- switches are closed automatically based on either the result of bc1.2 client detection completion or setting CDP_HOST mode. There is a console log already that shows the bc1.2 client mode detection result. However, for host mode there was no console log. This CL adds a message when this setting is used which is useful for knowing for certain that the D+/D- switches have been closed. BUG=b:138618816 BRANCH=none TEST=Verfied message when data role is DFP 2019-08-07 14:32:40 [0.716611 pi3usb9201[p0]: CDP_HOST mode] Change-Id: I65a6321452a8e668c839eba7a18d92398c2b78d1 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742869 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* Trembyle: enable throttle ap to allow the system to use fanDenis Brockus2019-08-082-1/+4
| | | | | | | | | | | | BUG=b:138600244 BRANCH=none TEST=make buildall -j Change-Id: I31b662bbd14388e238d1bd4fd1b5597824dd5749 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741300 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Zork: cleanup USBC related arraysKeith Short2019-08-081-4/+7
| | | | | | | | | | | | | | | | Fix some consistency problems with the USBC related arrays. Add some addtional BUILD_ASSERTS to ensure port counts are correct. BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ib68ae887288e8171ef02f2544ec28bb0ca633780 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1744649 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* isl9241: add charger_get_vbus_voltageDenis Brockus2019-08-085-8/+53
| | | | | | | | | | | | BUG=b:138600692 BRANCH=none TEST=make buildall -j Change-Id: Idd20b1833945e37a84db4e7c444d8974f6059f83 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742532 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* kodama: Initial image copied from kukuilu.zhang2019-08-089-1/+1110
| | | | | | | | | | | | | | | | | | Since kukui baseboad will be created and kodama board is symbolic link now, this image is just copied from kukui ToT instead of symbolic link. BRANCH=none BUG=none TEST=builds Change-Id: I1e1577c294cc9860c60f643ef61e87cd0fd8b4a5 Signed-off-by: lu.zhang <lu.zhang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1725383 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Peichao Li <peichao.wang@bitland.corp-partner.google.com> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com>
* Trembyle: add fan supportDenis Brockus2019-08-083-0/+84
| | | | | | | | | | | BUG=b:138600244 BRANCH=none TEST=make buildall -j Change-Id: Ibaf217e9fccf76dff6b70ae529e089367db89221 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742039 Reviewed-by: Keith Short <keithshort@chromium.org>
* baseboard/kukui: refactor smart battery codeTing Shen2019-08-085-53/+60
| | | | | | | | | | | | | | | | | | | | - Use common fuel gauge implenentation in battery_fuel_gauge.c for things like cutoff and get_info - Move battery characteristics data into per-board folder, so follower devices can add their own battery. - Move Jacuzzi-only battery_hw_present() into per-board folder BUG=b:136977971 TEST=boot ec, verify that ec console prints 'found batt:PANASONIC' BRANCH=master Change-Id: Ib4d33a2d3b4e1e061b390a000071f805d4780c27 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1728671 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* akemi: add initial content for the buildPeichao Wang2019-08-087-0/+1003
| | | | | | | | | | | | | | | | | | | This initial content of akemi is taken after hatch. It will need to be revised later. BUG=b:138879565 BRANCH=none TEST=make -j BOARD=akemi Change-Id: Iae84e5b908e678165311147356f65f61270bfda9 Signed-off-by: peichao.wang <peichao.wang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679849 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* treeya: remove keyboard backlightlu.zhang2019-08-083-31/+3
| | | | | | | | | | | | | | | | This CL removes keyboard backlight accordding to most recent treeya schematics. BRANCH=none BUG=b:138744661 TEST=builds Change-Id: I2a42b2dcb122ac1fd805f9f614d1b68c0b60d7ca Signed-off-by: lu.zhang <lu.zhang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1738526 Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* treeya: add power led and change battery led behaviorlu.zhang2019-08-083-50/+61
| | | | | | | | | | | | | | | | Accordding to the treeya schematics, a power led is added. Also, the behavior of battery leds does not follow Lenovo's spec BRANCH=none BUG=b:138744661 TEST=builds Signed-off-by: lu.zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I51466c36973b9cd4ced3501bf77b5672530d7d98 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1739027 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* pd: Don't request LPM in DRP_TOGGLE if cc is not openScott Collyer2019-08-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, LPM_REQUESTED flag is always set in the DRP_AUTO_TOGGLE state. This is true even when the next state will be SNK_DISCONNECTED or SRC_DISCONNECTED. This setting makes sense for SNK_DISCONNECTED as when the AP is not in S0, then auto toggling will be disabled so the PD state machine should remain in SNK_DISCONNECTED until something is attached. But for the transition from DRP_TOGGLE to SRC_DISCONNECTED should only happen when either an adapter gets attached while the AP is in S0, or the chipset enters S0 with an adapter already attached. This 2nd case is problematic as if LPM_REQUESTED is set and there is no CC event pending, the PD task will get suspended (wait = -1) and therefore remain in SRC_DISCONNECTED. This CL modifies the existing logic to not set LPM_REQUESTED when something is attached as given by the CC1 and CC2 values. BUG=b:137697655 BRANCH=none TEST=Tested both EC reboot and resume from suspend with a USB stick connected via a type C->A adapter and verified that the PD state machine advances to PD_STATE_SRC_DISCOVERY as expected and the USB stick enumerates. Change-Id: I6afbd642ce38134ddabd20f7dc5e15f937b9810a Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730967 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* makefile: remove print-chip-variantJack Rosenthal2019-08-071-5/+0
| | | | | | | | | | | | | | | We ended up deciding on a different design for the location of ISH firmware in the filesystem (long ago), and the chip variant is no longer needed in the ebuild. Remove this target. BUG=b:122371717 BRANCH=none TEST=buildall Change-Id: I9d5152537c9f4e86296546b86c98f581534d379f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742418 Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* touchpad_elan: Add missing tablet_mode.h includeNicolas Boichat2019-08-071-0/+1
| | | | | | | | | | | BRANCH=none BUG=b:138968914 TEST=make buildall -j Change-Id: Ia753d1a089a326eb15a28528f0ff0cfa320b4e1d Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741588 Reviewed-by: Yilun Lin <yllin@chromium.org>