summaryrefslogtreecommitdiff
path: root/board/eve/gpio.inc
Commit message (Collapse)AuthorAgeFilesLines
* Eve: Enable usb device modefactory-poppy-10509.BJagadish Krishnamoorthy2018-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | For the dual data role, when the state is UFP assert the otg pins to activate the usb device controller. This will enable usb gadget mode and the board will act as usb device instead of host. For DFP state, de-assert the otg pins to activate the host mode. BUG=b:74339386 BRANCH=NONE TEST=Connect two Eve boards with the usb type c cable. On ec console, type the command usb pd 0 swap data. pd 0 state should return UFP mode. Verify that the otg pins are high (USB2_OTG_ID and USB2_OTG_VBUSSENSE). Change-Id: I0efb08ae3946ff09ce9dfeb89cff049e551fe000 Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> Reviewed-on: https://chromium-review.googlesource.com/961381 Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Duncan Laurie <dlaurie@google.com>
* ec: unused gpio reconfigure for lower suspend powerRuben Rodriguez Buchillon2018-03-171-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change brings the improvements to suspend EC power on npcx by properly configuring unused GPIOs to INPUT | PULL_UP. BOARDID pins are all reconfigured for low power since they get properly configured on reading anyways. Those are: GPIO43 (BOARD_VERSION1) GPIO44 (BOARD_VERSION2) GPIO45 (BOARD_VERSION3) GPIO57 (TP_EC_GPIO_57) is unused GPIO01 (CHARGER_RST_ODL) is floating GPIO02 (EC_HAVEN_RESET_ODL) is floating BRANCH=eve BUG=b:69816245 TEST=manual with R67-10492.0.0, and ec: eve_v1.1.6585-859d2ea99 (powerd_dbus_suspend) @@ NAME COUNT AVERAGE STDDEV MAX MIN @@ pp3300_dsw_ec_mw 5053 19.57 6.12 39.14 9.59 with R67-10492.0.0, and ec: eve_v1.1.6620-f8301499 (this change) (powerd_dbus_suspend) @@ NAME COUNT AVERAGE STDDEV MAX MIN @@ pp3300_dsw_ec_mw 5199 12.78 5.43 17.99 3.98 Change-Id: I83879be45c1aa74dc4746ea51db41e068e2284b4 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/965782 Reviewed-by: Duncan Laurie <dlaurie@google.com>
* eve: PROCHOT behavior fixesDuncan Laurie2017-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | 1) Don't assert prochot by default, this signal has an inverter and driving it high is asserting prochot until it gets deasserted during S3->S0 transition. 2) Clear PMIC power source interrupts in pmic_init in case they were inadvertently set by misbehaving PMIC. The BATTSHORT event that matters for PROCHOT assertion is masked so it should never be set anyway, but I found a system where it was set. This register does not seem to get cleared by an LDO reset so PROCHOT was stuck on until battery cutoff. BUG=b:63913242 BRANCH=eve TEST=manual testing on Eve unit Change-Id: I5c7f7ca528160972f65bd714deea98357fa43a53 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/579904 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* eve: Enable device eventsDuncan Laurie2017-06-301-3/+2
| | | | | | | | | | | | | | | | Use device events for waking the system from Deep S3. This enables the trackpad and DSP as Deep S3 wake sources and allows the AP to log them properly. BUG=b:36024430 BRANCH=eve TEST=manual testing on Eve with trackpad and DSP wake events Change-Id: If17698a4901002e1590f4852f970fd9963964cb6 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/555633 Reviewed-by: Shawn N <shawnn@chromium.org>
* eve: Swap volume up and down GPIODuncan Laurie2017-06-021-2/+3
| | | | | | | | | | | | | | The buton behavior is inverted if we follow the schematic, so swap the GPIO on these inputs so they match the expected behavior. BUG=b:62120390 BRANCH=none TEST=manual test of side volume button behavior Change-Id: I0ad18b4a15fcc2832d97dfad3b03186180e4517a Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/522410 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* eve: Enable trackpad wake from Deep S3Duncan Laurie2017-03-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support waking from Deep S3 the trackpad interrupt is routed to the EC. The EC needs to enable this interrupt when going into S3, and disable it otherwise. It also needs to filter events and only wake the system when it is not in tablet mode. This is accomplished with the following rules: 1) Enable trackpad wake in S0->S3 transition, if !tablet_mode 2) Disable trackpad wake in S3->S5 transition 3) Disable trackpad wake in S3->S0 transition 4) Disable trackpad wake when entering tablet mode in S3 5) Enable trackpad wake when lid angle is <180 degrees and in S3 And finally a check in the trackpad interrupt itself to ensure that it only sends the wake event if not in tablet mode. The function to enable or disable trackpad wake uses a static variable to keep track of the enable state because when enabling the GPIO for wake it first clears pending events and if multiple transitions are happening (suspending, plus lid angle rotation) this can get called multiple times in quick succession. Currently a placeholder KEY_PRESSED event is used to wake the AP since we do not have device specific events. Fixing this behavior is tracked in b/36024430. BUG=b:35587072 BRANCH=none TEST=manual testing on eve P1b: 1) ensure that trackpad wake in clamshell mode works 2) ensure that trackpad wake in tablet mode does not waork 3) ensure that if in S3 during transition to or from tablet mode the wake event is enabled appropriately Change-Id: Ib2020b5010bdde396a3b05243894431b67edb503 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/450954 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* eve: Modify 1.5 vs 3.0 current limit setting for P1B boardsScott2017-03-011-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | P1B adds 2 new GPIO signals to explicitly control the 1.5 vs 3.0 current limit selection. In addition, the use case for the 5V enable gpio changes to on/off and no longer needs to be toggled between input and output. This change is tied to the board version so that the operation for P1 and older boards is unaffected. BUG=chrome-os-partner:61431 BRANCH=none TEST=Manual Connected display adapter into C0 port and verified gpio signals: 1 USB_C0_5V_EN 0* USB_C1_5V_EN 1* EN_USB_C0_3A 0 EN_USB_C1_3A Then connect another adapter to C1: 1 USB_C0_5V_EN 1* USB_C1_5V_EN 0* EN_USB_C0_3A 0 EN_USB_C1_3A Remove adapter from C0: 0* USB_C0_5V_EN 1 USB_C1_5V_EN 0 EN_USB_C0_3A 1* EN_USB_C1_3A Also tested P1 system to verify that the correct board version is read and the signals match the expected value. Change-Id: Iebab84304a33282c766b8963dba4a56052a295c7 Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/447866 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* eve: Disable TCPC low powerDuncan Laurie2017-02-251-0/+5
| | | | | | | | | | | | | | | Until we can understand and fix the reset loop when we enable low power for the TCPC mux lets just disable that feature. BUG=chrome-os-partner:63204 BRANCH=none TEST=build and boot on eve, verify that TCPC does not get in a reset loop when the system is off. Change-Id: I646948066a76ab25758e437498f3fb7f533ba6a5 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/446592 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* eve: Add support for anx3429 tcpc low power modeScott2017-02-201-2/+2
| | | | | | | | | | | | | | | | | | | Added interrupt handler for CABLE_DET signal on both port 0/1. This allows us to define CONFIG_USB_PD_TCPC_LOW_POWER. BUG=chrome-os-partner:63067 BRANCH=none TEST=Connected USB mouse, keyboard and USB stick to both ports and verified the devices were recognized and attached properly. Verified that ports 0/1 always worked with blackcat typeC charger. Change-Id: I4d8a8bdba4f95e73333e2e01f11fe1d48453a2fe Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/444315 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* eve: Add Si114x ALS sensorScott2017-02-201-3/+3
| | | | | | | | | | | | | | | | | | | Added Si114x light sensor to the motion sense struct and enabled it in polling mode. Also added backward compatibility for the ALS to report readings via ACPI. BUG=chrome-os-partner:61470 BRANCH=none TEST=Enter 'accelinfo on 1000' on the EC console and verify light readings are present and they increase/decrease as the light pointed to the sensor changes. Also verifed with AIDA64 app in arc++ Change-Id: I22e0b87034150d2e987987da053de3c312fcc98b Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/440378 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* eve: Revert trackpad interrupt changesDuncan Laurie2017-02-131-1/+1
| | | | | | | | | | | | | The trackpad interrupt is input only to the EC and should not ever be driven from here. BUG=chrome-os-partner:58666 BRANCH=none TEST=build and boot on eve p1 Change-Id: I3ffa2ddb4990550b57c9191b5d721ab0ba206aca Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/439829
* eve: Fix sensor dataGwendal Grignou2017-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lid and base matrix were wrong, chrome would enter tablet mode while in clamshell mode. Sensors are powered in S3 and S5. Enable lid angle to disable keyboard while in tent mode. Disable Trackpad in S5, but just block the interrupt while in tablet mode and not in S0. Allow reporting tablet switch mode to AP via ACPI event. BUG=chrome-os-partner:62385 BRANCH=eve TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: ectool motionsense Motion sensing active Sensor 0: 368 -368 16752 Sensor 1: 828 -820 16293 When on the base bottom edge, report gravity along Y axis: ectool motionsense Motion sensing active Sensor 0: 256 16160 -976 Sensor 1: 993 16362 -391 Sensor 2: 0 0 0 Sensor 3: 0 0 0 When on its left side, report gravity along X axis: ectool motionsense Motion sensing active Sensor 0: 15968 368 1920 Sensor 1: 16503 219 2430 Sensor 2: 0 0 0 Sensor 3: 0 0 0 Power down machine. Power back up. Check sensors are still working. Check we can not resume machine while in tent mode from keyboard. Resuming from trackpad does not work yet. Change-Id: I4ee6efc57f217d76e5eb97683efa56ceb211cad8 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/437906 Reviewed-by: Alexandru Stan <amstan@chromium.org>
* eve: Add support for 3 color PWM controlled LEDsScott2017-01-311-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eve has two 3 color PWM controlled LEDs. This CL adds basic support for these LEDs so that they can be set to off, red, green, or blue. In addition, the LED policy from Kevin is appropriated. In S0 the LEDs will be blue. In S3/S5 if no charger is connected, then the LEDs are off If a charger is connected and the charge level is less than a threshold, both LEDs are set to red. When the charge level gets above a certain level or if the charge state is idle, then the LEDs are set to green. BRANCH=none BUG=chrome-os-partner:60797 TEST=manual Turn the system on so it's in S0, verify both LEDs are blue. Close the lid with no external charger and verify that the LEDs are both off. Connect the charger, and using battfake <> EC command verify that when the charge level is less than the threshold the LEDs are red, otherwise they are green. Set battfake to 0, and verified flashing red. Change-Id: I556ccdafde03cd5f5205e8948d5737dcbdc09d6d Signed-off-by: Scott <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/434146 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com> Reviewed-by: Todd Broch <tbroch@chromium.org>
* eve: Select CONFIG_CHIPSET_HAS_PLATFORM_PMIC_RESETFurquan Shaikh2017-01-231-1/+1
| | | | | | | | | | | | | Also program EC_PLATFORM_RST as an out signal from the EC. BUG=chrome-os-partner:61883 BRANCH=None TEST=Compiles successfully for eve. Change-Id: I41486e6050727ca822a27054244da3fed5ee3b7a Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/431194 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* eve: Updates from P1 buildDuncan Laurie2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - revert the change for issue 61431 as main build systems have updated resistor values - enable CONFIG_CHARGER_BD9995X_CHGEN, with the necessary changes in battery.c to support the custom battery present functions - enable CONFIG_CHARGER_MAINTAIN_VBAT - enable CONFIG_CHARGE_MANAGER_EXTERNAL_POWER_LIMIT for testing - set pre-charge current to 256mA to better wake up batteries - set voltage-min to 6.1V to account for charger inaccuracies since the battery expects >= 6V to wake up - enable CONFIG_BACKLIGHT_LID to enforce backlight off with lid closed - put all CONFIG_CMD enables in the same place - make PCH_ACOK open drain (pull-up to be enabled on PCH) BUG=chrome-os-partner:61431,chrome-os-partner:61676 BRANCH=none TEST=manual testing on P1 boards at the factory Change-Id: Ib20693c8200d253819873d03b54f91e12bda8270 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/428902 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* eve: Enable Sensor FIFOGwendal Grignou2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable to FIFO to allow ARC++ sensor support and sensor tests. BUG=chrome-os-partner:59144 BRANCH=eve TEST=On an eve machine, check the ring sensor is receiving data: cd /sys/bus/iio/devices/iio:device0 # cros-ec-ring for i in scan_elements/*_en ; do echo 1 > $i ;done echo 1024 > buffer/length echo 1 > buffer/enable cd /sys/bus/iio/devices/iio:device1 # cros-ec-accel echo 1000 > sampling_frequency # 1s echo 25000 > frequency # 25Hz Check we are receiving data with: od -x /dev/iio\:device0& ... 0031560 0001 0400 ff5e c072 7719 873e 002a 0000 0031600 0001 03e1 ff61 c0be 983e 8995 002a 0000 0031620 0001 03ea ff50 c095 b963 8bec 002a 0000 0031640 0001 03fb ff5c c0c8 da88 8e43 002a 0000 0031660 0001 03ed ff63 c0b0 fbad 909a 002a 0000 ... Change-Id: I0401df4233f4fa1514dfa6d368ba463dcc705895 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/424846
* eve: Enable CONFIG_PWM_KBLIGHT and fix volume buttonsDuncan Laurie2017-01-021-2/+2
| | | | | | | | | | | | | | | | - Enable keyboard backlight configuration option so the keyboard backlight interface is present. - Enable interrupt on both directions for volume buttons, otherwise we see the press but not the release. BUG=chrome-os-partner:58666 BRANCH=none TEST=manual testing on P1 board Change-Id: If0b6a913bb63f31051ab5a30ffe9f0682550e058 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/424493 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* reef/pyro/eve/snappy: source 3A on one portVincent Palatin2016-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add a new source policy to provide 3A if there is only one port used as a source. Also ensure that the load switch on VBUS when sourcing power is properly configured to limit the current to 1.5A or 3.0A depending on the case. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:56110 TEST=manual: connect the laptop to a type-C sink with Twinkie in between, without anything else connected on the laptop, see 3A flowing when measuring with Twinkie ('tw vbus'), plug a dangling C-to-A receptacle dongle on the other port and see 1.5A flowing through Twinkie. Force the input current limit on the sink to 3.0A and see the laptop cutting VBUS. Change-Id: Ic94ba186fc0648e770c8d13be0f96b23e968f855 Reviewed-on: https://chromium-review.googlesource.com/403851 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* eve: Add new boardDuncan Laurie2016-10-261-0/+117
Add support for eve P0 board with: - chip: npcx - pmic: bd999992GW - charger: bd99956 - tcpc: 2x anx3429 BUG=chrome-os-partner:58666 BRANCH=none TEST=build and boot on eve board Change-Id: I69ff246e9f8197d5d50241e6a8fa4796f4c9bfda Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/400638