summaryrefslogtreecommitdiff
path: root/board/meep
Commit message (Collapse)AuthorAgeFilesLines
* Remove __7b, __8b and __7bfDenis Brockus2019-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1767528 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Use 7bit I2C/SPI slave addresses in ECDenis Brockus2019-08-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt for 7bit slave addresses in EC code. If 8bit is expected by a driver, make it local and show this in the naming. Use __7b, __7bf and __8b as name extensions for i2c/spi addresses used in the EC codebase. __7b indicates a 7bit address by itself. __7bf indicates a 7bit address with optional flags attached. __8b indicates a 8bit address by itself. Allow space for 10bit addresses, even though this is not currently being used by any of our attached devices. These extensions are for verification purposes only and will be removed in the last pass of this ticket. I want to make sure the variable names reflect the type to help eliminate future 7/8/7-flags confusion. BUG=chromium:971296 BRANCH=none TEST=make buildall -j Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1767525 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Octopus: add reset logic for C0 TCPCDiana Z2019-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | This change adds a call to the C0 TCPC reset for standalone TCPC boards which have that pin hooked up in hardware, and adds the GPIO as unimplemented for boards which do not have this yet. BRANCH=None BUG=b:112756630 TEST=Added a log print and rebooted EC on bobba to verify TCPC C0 reset, then verified that charging on C0 worked. Also imaged yorp proto 2 and rebooted, verifying C0 reset was not attempted. Change-Id: I615861f0d9ce9b5a89692e3982ed2e19c7e0b237 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1257647 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1767501 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* common: led_onoff_states: move forward baseboard led_state to common codeDevin Lu2019-08-122-3/+4
| | | | | | | | | | | | | | | | | | | | | Now we have led_onoff_states instead of led_state of baseboard, to avoid duplicate file so move forward to common code. BUG=b:126460269 BRANCH=none TEST=make buildall -j, make sure led behavior on meep intended as well. Change-Id: I3adf20ebf2efd2f02b1ae101faf1c36f2f5ed454 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1556869 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1749722 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* driver: lsm6dsm: Move the interrupt GPIO into sensor structYuval Peress2019-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | | This changes allows each board to add a custom configuration for the sensors. In this case particularly setting the GPIO enum that is used for the interrupt signal in the lsm6dsm. BUG=b:129159505 BRANCH=arcada TEST=I ran `make buildall` since this change isn't used yet it doesn't affect run-time behavior. Change-Id: I4a2d5e097d5fd8a45af591a24c4e6e917865a093 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1621747 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719560 Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* motion: Define macros for custom eventsGwendal Grignou2019-08-021-1/+3
| | | | | | | | | | | | | | | | | | Define macros to define custom events used by sensor interrupt handlers. Remove CONFIG_ for activity events. BUG=none BRANCH=none TEST=compile, sensors work on eve. Change-Id: I08ef6ed2a004466ebc5f7650d6952a150b9de713 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1272189 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719544 Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* driver: lsm6dsm: Integrate LIS2MDL behind LSM6DSMGwendal Grignou2019-08-022-62/+90
| | | | | | | | | | | | | | | | | | | | | | | | | - Cros set_rate and normalize between LIS2MDL and LSM6DSM - Remove unused sensor hub function. - Remove parent field, use macro instead (magnetometer is just after the gyroscope). BUG=b:110143516,b:115587004 BRANCH=none TEST=On meep, check the magnetometer is returning data with shell/python script. Check calibration quick in. Check with AIDA64, compass and sensor app the magnetometer is seen. Change-Id: I2efef99eda095e33b6a0555b1cbc4ac8fdbfab5d Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1361992 Reviewed-by: Justin TerAvest <teravest@chromium.org> Trybot-Ready: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719525 Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* drvier: lsm6dsm: Populate Gyroscope scale properlyGwendal Grignou2019-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Range of 250/1000/2000 dps is an approximation. The Gyrscope uses a slighly higher range: range | gain(udps/LSB) | actual value(dps) 250 | 8750 | 286.72 500 | 17500 | 573.44 1000 | 35000 | 1146.88 2000 | 70000 | 2293.76 Returns the actual value for a given range. BUG=b:121279721 BRANCH=octopus TEST=Check scale returns the correct value: cd /sys/bus/iio/devices/... for i in 250 500 1000 2000 ; do echo $i > scale ; V=$(cat scale) ; echo -n "$i: " ; echo -n "$V: " ; echo $V | python -c 'import sys for line in sys.stdin: print float(line) * 32768 * 180 / 3.14159' ; done 250: 0.000152331: 285.996835182 500: 0.000305197: 572.998116648 1000: 0.000610395: 1145.99811077 2000: 0.001221325: 2293.00066781 Check CTS Verifier Gyroscope Measurement Test pass. Change-Id: I76c977140321d01702af16f58a3dfb7036673014 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1423597 Reviewed-by: Enrico Granata <egranata@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719399 Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* motion_lid: Use CONFIG_TABLET_MODEFurquan Shaikh2019-02-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change updates motion_lid driver to use CONFIG_TABLET_MODE to decide if device requires reporting of tablet mode. This basically makes the config options CONFIG_LID_ANGLE_INVALID_CHECK and CONFIG_LID_ANGLE_TABLET_MODE obsolete. Now that EC will always report tablet mode aligned with Chrome (at 180 degree), any device that supports tablet mode and uses motion lid driver will require this by default and should not require boards to individually select any special config options. Thus, it also gets rid of unused CONFIG_LID_ANGLE_TABLET_MODE and CONFIG_LID_ANGLE_INVALID_CHECK. BUG=b:120050761 BRANCH=octopus TEST=make -j buildall Change-Id: Ib73af66ca1c17d4033cf54f0b4b86bf41793f3a3 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1350470 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1484644 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* tablet_mode: Introduce hall sensor specific handlingFurquan Shaikh2019-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change performs the following renaming: 1. CONFIG_TABLET_SWITCH -> CONFIG_HALL_SENSOR Indicates if a device has hall sensor 2. TABLET_MODE_GPIO_L -> HALL_SENSOR_GPIO_L Provides the interrupt line from hall sensor to EC. 3. tablet_mode_isr -> hall_sensor_isr Interrupt routine that gets control on hall sensor interrupt. 4. tablet_mode_init -> hall_sensor_init Init routine for initializing hall sensor interrupt. 5. tablet_switch_disable -> hall_sensor_disable Disable hall sensor interrupt and tablet mode sub-system. This is done to separate hall sensor interrupt from tablet mode handling. It is another step towards aligning tablet mode detection on EC with Chrome. Hall sensor interrupt occurs when the lid is in 360-degree flipped mode. If tablet mode is not already triggered by lid motion driver, then hall_sensor_isr will set tablet mode and take necessary actions to disable input peripherals. CQ-DEPEND=CL:1351518 BUG=b:120050761 BRANCH=octopus TEST=make -j buildall Change-Id: I5841f6875d538a624cb888bc048f252397ab457c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1350469 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1484643 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* bc12: rename bq24392 driver to max14637Scott Collyer2018-10-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | The MAX14637 BC 1.2 USB charger detection chip is functionally similar to the bq24392 and can use the same driver. Rather than have 2 copies of the same driver, or a generic named driver than can be used for both chips, rename the existing bq24392 driver to max14637 as that's the BC 1.2 chip that our current designs are using. BUG=b:113267982 BRANCH=none TEST=make -j buildall Change-Id: I03cfb4918513d756c2a41341001a8162652a29b6 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1250031 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1265315 Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* type: Rename matrix_3x3_t to mat33_fp_tYilun Lin2018-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I51d88d44252184e4b7b3564236833b0b892edc39 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215449 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1230991 Reviewed-by: Martin Roth <martinroth@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org>
* meep: Add Power LED behaviorZick Wei2018-09-023-10/+44
| | | | | | | | | | | | | | | | | | | | | | Add Power LED behavior to meet spec: System is ON(S0):LED solid ON White. System is Suspend/S0ix: LED blink White(1 sec on, 1 sec off). System is OFF: LED OFF. BUG=none BRANCH=none TEST=manual Check Power LED solid on White when system is ON(S0). Check Power LED blink White(1 sec on, 1 sec off) when system is Suspend/S0ix. Check Power LED off when system is OFF. Change-Id: I0e53a51446735dee0296e9f2c5eb3ceb84313720 Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1196642 Commit-Ready: Devin Lu <Devin.Lu@quantatw.com> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* meep: add VBUS voltage adc sensingDevin Lu2018-08-313-0/+29
| | | | | | | | | | | | | | This patch add to detect VBUS voltage, we are using 10x voltage divider. BUG=b:113193009 BRANCH=none TEST=make sure "ectool usbpdpower" can detect VBUS voltage. Change-Id: Ie96465ce1a28dde3381a2105afff14b1d41c89dd Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1184587 Reviewed-by: Jett Rink <jettrink@chromium.org>
* meep: Add charge LED behaviorZick Wei2018-08-292-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add charge LED behavior to meet spec: AC attached: solid on White. Charging: solid on Amber. Discharging(S0/S3/S5): Both(White/Amber) Off. Battery Error: Blinking White (0.5 sec on, 0.5 sec off) Fuel <10%: Blinking White (1 sec on, 1 sec off) Force idle for factory: Blinking Amber (1 sec on, 1 sec off) BUG=b:112825269 BRANCH=None TEST=manual Check charge Led off when battery is discharging. Check charge Amber Led on when battery is charging. Check charge White Led on when battery is full and AC is attached. Check charge White led blink(0.5 sec on, 0.5 sec off) when battery error. Check charge White led blink(1 sec on, 1 sec off) when battery fuel less than 10%. Check charge Amber led blink(1 sec on, 1 sec off) when factory test. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I2cc2f9d710a6b94fa48f6d2fb78ac7996a7615f5 Reviewed-on: https://chromium-review.googlesource.com/1184941 Commit-Ready: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* meep: Add batteries configurationDevin Lu2018-08-172-3/+180
| | | | | | | | | | | | | | meep plan to use batteries the same as careena. BUG=b:111838980 BRANCH=none TEST=make buildall -j Change-Id: I29955dfaecefd16a48b6b14a48c3f06de97e11c0 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1177096 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ppc: nx20p3483: Rename driver to nx20p348x to support NX20P3481Scott Collyer2018-08-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | This CL doesn't change any functionality, but renames the driver from 3483 to 348x. The motivation for this is that we need to support the NX20P3481 PPC as well. Those chips use the same registers, but the 3481 adds FRS support and sink/source control is done via I2C writes instead of gpio controls. Because the chips are slighlty different the config option CONFIG_USBC_PPC_NX20P3483 needs to remain. BUG=b:111281797 BRANCH=none TEST=make -j buildall Change-Id: Ie1085140eb2ef23c0b6e1a79a6f2d7f823326c6d Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1176382 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* octopus: increase USB charger stack sizesDiana Z2018-08-081-2/+2
| | | | | | | | | | | | | | | | | | The bip board has had issues with running out of task space in the USB_CHG_P[0,1] tasks when it runs into I2C errors and needs to run resets. Performing a full stack analysis should happen when the firmware branches for octopus, but for now this change increases the stack sizes for all of the USB_CHG_P[0,1] tasks. BRANCH=None BUG=b:111840286 TEST=builds, bip no longer hit stack overflows with the larger space during i2c resets Change-Id: Ib10e052bb89202cbedfe23345c8335f1e0a8e16b Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1167653 Reviewed-by: Jett Rink <jettrink@chromium.org>
* meep: confirm thermistor partsDiana Z2018-08-061-1/+0
| | | | | | | | | | | | | | Confirmed that meep is using thermistors with the same b-constants as yorp, so removing the TODO to overwrite the yorp values BRANCH=None BUG=b:111920102 TEST=builds Change-Id: Iccf7ba59b0c137b33d7544807d82d6e814a2e259 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1160867 Reviewed-by: Jett Rink <jettrink@chromium.org>
* meep: create initial EC imageDiana Z2018-07-277-0/+693
This image is based on yorp proto 2 from ToT and the most recent meep schematics BRANCH=none BUG=b:111543000 TEST=builds Change-Id: I42df536b26266da377efbda0db98af1ef269380b Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1151545 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>