summaryrefslogtreecommitdiff
path: root/board/hatch
Commit message (Collapse)AuthorAgeFilesLines
...
* common: bit change 1 << constants with BIT(constants)Gwendal Grignou2019-03-261-1/+1
| | | | | | | | | | | | | | | | | Mechanical replacement of bit operation where operand is a constant. More bit operation exist, but prone to errors. Reveal a bug in npcx: chip/npcx/system-npcx7.c:114:54: error: conversion from 'long unsigned int' to 'uint8_t' {aka 'volatile unsigned char'} changes value from '16777215' to '255' [-Werror=overflow] BUG=None BRANCH=None TEST=None Change-Id: I006614026143fa180702ac0d1cc2ceb1b3c6eeb0 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1518660 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* motion: Define macros for custom eventsGwendal Grignou2019-03-201-1/+2
| | | | | | | | | | | | | | 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>
* hatch: Enable PP5000_CONTROL for BC1.2 to work in G3Scott Collyer2019-03-161-0/+1
| | | | | | | | | | | | | | | | | | This CL adds the config option CONFIG_POWER_PP5000_CONTROL which enables both power sequencing and bc1.2 detection to request PP5000_A rail to be either on or off. BUG=b:122265772 BRANCH=none TEST=Verfied that bc1.2 detection no longer fails when the AP is in G3. Change-Id: Iff0d33ce302a0f15687248621fb5d1c6c6df9129 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1503957 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Enable sensors sync via dedicated IRQ pinPhilip Chen2019-03-141-0/+3
| | | | | | | | | | | | | | | | BUG=b:125933998 BRANCH=none TEST=build Change-Id: I4633fc18b259710fd27ecec700d9dc9b5ab462aa Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1510513 Commit-Ready: Philip Chen <philipchen@chromium.org> Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Enrico Granata <egranata@chromium.org>
* hatch: Make EN_PP5000_A gpio signal runtime configurableScott Collyer2019-03-133-1/+43
| | | | | | | | | | | | | | | | | | The EC pin used for EN_PP5000_A has changed. This CL adds code to configure and select the correct gpio signal based on board version. BUG=b:123553959 BRANCH=none TEST=Tested on P0 board and verified that AP boots up which means that EN_PP5000_A is being selected properly. Change-Id: I0a1d5a55cf87b0ef8ed044e6e72caec37483692f Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1515950 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch : Add volume buttons functionalityKashyap Nanavati2019-03-063-6/+10
| | | | | | | | | | | | | | | | | | | Enable config and gpio changes for volume buttons BUG=b:122799547 BRANCH=none TEST=gpioget shows volume UP/DOWN gpios and while pressing/releasing the button observed log messages on EC console ('Volume Up' was released/pressed) Also, we need to do the rework(volume down should be reroute to gpio93 from gpio57) on proto boards before testing. still no change in audio volume Change-Id: I8fae622550508eb3ab92f8c3b8a11d10d5ecbcee Signed-off-by: Kashyap Nanavati <kashyap.nanavati@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1504122 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* hatch: Add support for OPT3001 ALSScott Collyer2019-02-272-1/+44
| | | | | | | | | | | | | | | | | | This CL adds support for the OPT3001 to hatch. BUG=b:124337208 BRANCH=none TEST=Verfied that when shining phone light on sensor the numbers went very high (~30k) and when covering sensor values dropped in low 100s. Change-Id: I43842050273eb5c3e4e13d04a7ca679e5a875d91 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1483894 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Tested-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Add support for BMA253 lid accel sensor and lid angle detectionScott Collyer2019-02-272-1/+52
| | | | | | | | | | | | | | | | | | | | | This CL adds the config options required for the BMA253 lid accel sensor. It also adds the configuration table, mutex, and rotation matrix. BUG=b:124337208 BRANCH=none TEST=Verified the sensor readings using 'accelinfo on 10000' and the numbers change on the desired axis when the sensor is moved. The signs can't be verified yet because it's not properly mounted on P0. Change-Id: I2943a82a91472d105d97dba76917f40817f5624e Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1468865 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Tested-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Add support for base accelgyro bmi160 sensorScott Collyer2019-02-274-1/+86
| | | | | | | | | | | | | | | | | | | | | | This CL adds the motion_sensor_t table, config options, gpio interrupt signal, and rotation matrix required for the bmi160 base accel/gyro sensor. BUG=b:124337208 BRANCH=none TEST=Verfied with 'ectool motionsense' that sensor readings are present and that values move in the expected direction as I rotated the unit along it's X and Y axis. Also verified the gyro sensor returns non-zero values when moving the system. Change-Id: I57c323916662a4ee0b9aa3fc00c3a4bf18aaef40 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1464393 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Tested-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Enable bc1.2 supportScott Collyer2019-02-193-0/+22
| | | | | | | | | | | | | | | | | | This CL adds the config options and GPIO signals and interrupt handler required for bc1.2 for the pi3usb8201 chip. BUG=b:123995100 BRANCH=none TEST=Verified that bc1.2 detection occurs following connecting a charger and a EC reboot. Verified that the D+/D- switches are closed in both client and host mode as expected. Change-Id: I43ca74f02d2515dc4dfa3dd8dc689d719779e4b5 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1459822 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Adjust temperature threshold when fan is under EC controlScott Collyer2019-02-131-2/+7
| | | | | | | | | | | | | | | | | | | | | | | Currently the fan is being controlled by EC, not DPTF. The default settings for temperature were taken from Nami, but not adjusted for Hatch. This CL reduces the temperature for fan being used to 25C. This results in the fan being turned on a lower temperature and will hopefully help prevent thermal related AP shutdowns. BUG=b:124316213 BRANCH=none TEST=Verfied that when temperature reading was > 25 degrees the fan turned on and that its on duty cycle decreased from there as the temperature reading decreased until the temp reading was < 25C and the fan turned off. Change-Id: I31025585467b2d0bd87040c034f8a59966a1dd20 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1467968 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Use CONFIG_TEMP_SENSOR_POWER_GPIO to prevent bad temp readingsScott Collyer2019-02-121-0/+1
| | | | | | | | | | | | | | | | | | | This CL adds the config option CONFIG_TEMP_SENSOR_POWER_GPIO to make sure that thermistor temperature readings are only taken when the power rail for the thermistor circuit is enabled. BRANCH=none BUG=b:123900860 TEST=Verified that the the EC console message 'thermal SHUTDOWN' no longer appears following an EC reboot as the ADC readings are now ignored if the GPIO controlling the power rail is not enabled. Change-Id: Ia6dced2f36ed6319c309868bf2d4db3493d29a01 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1460089 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Add support for MST (multi stream transport) enableScott Collyer2019-02-123-0/+22
| | | | | | | | | | | | | | | | | | | | | The MST chip for Hatch needs to be enabled when HPD signal from either the Port 1 TCPC or HDMI port is high. This CL adds support to enable the MST chip based on this criteria. For the Port 1 type C port, the HPD signal level is derived from the USB PD policy level where the HPD update driver method is called. BRANCH=none BUG=b:123894908 TEST=Used external HP Z27n monitor and verifed the display is extended as expected when it's connected to either port 1 type C port or the HDMI connector. Change-Id: I1c46534bc7f32221f9e379dd9c74d5618c8f57e1 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1406496 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Add support for PSL wake sourcesScott Collyer2019-01-312-8/+8
| | | | | | | | | | | | | | | | | | | | This CL adds the alternate function defines for the 4 PSL wake source pins, populates the wake pins table, and enables the config option for PSL mode. BRANCH=none BUG=b:123343366 TEST=Use EC console command to force hiberate and verified EC wakes from hibernate via power button, EC reset, connecting AC power, and opening of lid switch. Change-Id: I6d5ad282f53e9090aafd4164510741d7cfe7907a Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1435971 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* hatch: Fix battery name and add SMP-SDP battery supportScott Collyer2019-01-302-5/+34
| | | | | | | | | | | | | | | | | | This CL fixes the manufacturer name field for the battery used in factory bring up and adds support for the battery being shipped with P0 units. BRANCH=none BUG=b:123244947 TEST=Verifed that both the battery used in the factory and that being shipped with P0 units are found at init time. Change-Id: I572879fc32aaf8aad8289fc52a385262ea61cdc2 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1406495 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hatch: Add support for fan and temperature sensorsScott Collyer2019-01-303-2/+126
| | | | | | | | | | | | | BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: Ib831eecb7e6df270a266f723e2fc5040b741e72f Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387592 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hatch: Enable UART alternate funciton for servoScott Collyer2019-01-301-0/+3
| | | | | | | | | | | | | | | BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: Ie5821c746b86fb6ca2b6e4f48140f0eb45db3289 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387591 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* hatch: Add support for keyboard backlightScott Collyer2019-01-303-0/+18
| | | | | | | | | | | | | | | | This CL adds board specific config options, functions and GPIO signal required for keyboard backlight support. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: Ib60a7c861d2a85939592556437bd6202e6815947 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387590 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hatch: Add support for keyboard scanScott Collyer2019-01-302-0/+11
| | | | | | | | | | | | | | | | | | This CL adds config options and GPIO alternate function definitions required for adding keyboard scan functionality. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: I9511f936e12d25276fa2685afbf7edaa6330d2cf Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387589 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Zack Yang <zack_yang@compal.corp-partner.google.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* hatch: Add smart control for USB-A portsScott Collyer2019-01-301-1/+1
| | | | | | | | | | | | | | | | | There are 2 USB-A ports, but 5V power is controlled by the same signal for both of them. This CL adds support for 5V control for these ports. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: I21328688ec653d91f9e37d2c441a3b5f816206f3 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387588 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* hatch: Add support for 2 color LEDScott Collyer2019-01-294-1/+85
| | | | | | | | | | | | | | | | | | | This CL adds board specific files/functions required to support the battery LED. Similar to Coral or Octopus, the LEDs are controlled by GPIO on/off instead of PWM. BRANCH=none BUG=b:122251649 TEST=make buildall. Verfied charging LED turns when external power is connected. Change-Id: Ic16d4192aaeba6e765e97743ded772d52ca47111 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387586 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Zack Yang <zack_yang@compal.corp-partner.google.com>
* hatch: Add support for charging and USB type CScott Collyer2019-01-296-1/+144
| | | | | | | | | | | | | | | | | This CL adds board specific files and functions required for both battery/charging and Type C support. BRANCH=none BUG=b:122251649 TEST=make buildall, tested both port 0/1 operation at factory. Battery can be charged via both ports. Change-Id: Ia01eabe109e3df780ec053831a71a16a41047f01 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1387585 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hatch: Add support for power sequencingScott Collyer2019-01-244-1/+37
| | | | | | | | | | | | | | | | This CL adds config options, board specific functions and GPIO signals required to add power sequencing support. BRANCH=none BUG=b:122251649 TEST=make buildall, verified at factory that AP reaches S0 Change-Id: I5c7e8331b0f46a830b6e0f6722e7b05ba05212cb Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1377571 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* hatch: Initial skeleton for hatchScott Collyer2019-01-245-0/+160
This CL adds hatch in /board and /baseboard. Only some GPIO signals, flash configuration, and I2C port map/pins required for NPCX to successfully build have been included. BRANCH=none BUG=b:122251649 TEST=make buildall Change-Id: Ief19223473f31b1f3a55e1466cc47d7cfeef8060 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1377569 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>