summaryrefslogtreecommitdiff
path: root/board/kukui
Commit message (Collapse)AuthorAgeFilesLines
* krane: Use the PWM mode to adjust brightness as lowestLeo Zhou2019-11-221-4/+22
| | | | | | | | | | | | | | | | | | Adjust current=4ma, pwm=1/32, and change the state as: charging is blue charged full is green low battery is red BUG=b:137618886 BRANCH=kukui TEST=Do a full charging test, notice LED indicator status under different charge state Change-Id: Ic1b7a99ab3edaee5c92a5cae56bc6d9a321e9c23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918995 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Kook Zhang <zhangbinbin@huaqin.corp-partner.google.com> Commit-Queue: Leo Zhou <zhoubo@huaqin.corp-partner.google.com>
* kukui,kodama,jacuzzi: fix charge/discharge control setting orderYilun Lin2019-11-151-4/+7
| | | | | | | | | | | | | | | | | | | | Should enable charge first then the charge port can function normally. Besides, for device using mt6370 and in force discharge mode, mt6370 would receive a DPDM detach event and release BC1.2 charge supply info. We should force BC1.2 detection again to recognize BC1.2 device again. TEST=on krane 'ectool chargecontrol discharge; ectool chargecontrol normal' and see the charge is charging. BUG=b:143045248 BRANCH=kukui Change-Id: I72481dfddf48b1e274d8d81f8d9223ccb8295c72 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1916160 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Clean up double tap related definitionHeng-Ruey Hsu2019-11-131-0/+1
| | | | | | | | | | | | | | | | Fixes: commit 2f2a81079191ca "Add double tap and make motion sense wake up ap" CONFIG_GESTURE_DETECTION_MASK includes significant motion in activity list. We cannot use it for double tap. Add more flags to distinguish it. BUG=b:135575671 BRANCH=kukui TEST=AP can receive mkbp event when double tap is triggered Change-Id: I13776a01b14dc251396a615c8c97353f2d0477d4 Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1911263 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* baseboard/kukui: fix pogo extpower statusYilun Lin2019-11-111-1/+8
| | | | | | | | | | | | | | | | On krane, POGO provide extpower when only connects to a dock, so we should check if it's connecting to a dock, rather than checking POGO_VBUS_PRESENT only. TEST=see battery LED is off when connects to keyboard, and LED on when connets to a USB-C charger. BUG=b:144137508 BRANCH=kukui Change-Id: Iab38590780b1e86149287fb9985c8ffa625b016f Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1907670 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* power/mt8183: Need 1s pwrbtn press to exit off stateYilun Lin2019-11-111-0/+1
| | | | | | | | | | | | | | | | | | To prevent mispressed cases, we decide to increase the power button press boot time to at least 1s. TEST=aps; powerbtn $sec; where $sec is between 0~1000 and see it won't boot TEST=aps; powerbtn $sec; where $sec > 1000 and see it boot TEST=aps; ensures the physical power button press is working as expected. BUG=b:131856041 BRANCH=kukui Change-Id: Ie3099ba9639a729cee77b7d444a459fbef72733d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906387 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Enable double tap host detection in kukuiHeng-Ruey Hsu2019-11-112-1/+27
| | | | | | | | | | | BUG=b:135575671 BRANCH=none TEST=AP can receive mkbp event when double tap is triggered Change-Id: I35abf2a62d4980c9b9232c28a72c5ba624142270 Signed-off-by: Heng-Ruey Hsu <henryhsu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772867 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNTKarthikeyan Ramasubramanian2019-11-011-2/+2
| | | | | | | | | | | | | | | | | Certain SKUs of certain boards have lesser number of USB PD ports than defined by CONFIG_USB_PD_PORT_COUNT. Hence rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNT. BUG=b:140816510, b:143196487 BRANCH=octopus TEST=make -j buildall; Boot to ChromeOS Change-Id: I7c33b27150730a1a3b5813b7b4a72fd24ab73c6a Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1879337 Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* kukui: set SPI pin to high speedTing Shen2019-10-261-3/+0
| | | | | | | | | | | | | | | | | The SPI pins should be configured to high speed to meet the spec. And since the pin assignment is same on all kukui families, move the setup code to baseboard/. BUG=b:138768646 TEST=verified by observe the waveform BRANCH=kukui Change-Id: I5b07767000bdf47101f83d338d06e7679c4f4848 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770329 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org>
* krane: Modify the charge indicatorLeo Zhou2019-10-261-2/+13
| | | | | | | | | | | | | | | | Based on the OD, the charge indicator should be red under low battery BUG=b:142835019 BRANCH=kukui TEST=1. Charge DUT to battery SOC > 20%, then plug out charger 2. Wait for battery SOC <= 10%, notice the charge indicator Change-Id: I2013bc6182067ddf64bb790f5cbf4bc0621b7899 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1871502 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
* Kodama: folio case has no function but only works in VT2xiong.huang2019-10-221-3/+0
| | | | | | | | | | | | | | | | | | | When DUT starts up in S5/G3, HOOK_CHIPSET_STARTUP only called in RO stage. In fact, POGO ADC interrupt not be enabled after jumping to RW stage. Krane and Kodama board use POGO keyboard function. Moving common API to HOOK_INI (pogo_chipset_init) to ensure POGO ADC interrupt is enabled and API base_detect_deferred would be called after jumping to RW stage. BUG=b:142849032 BRANCH=kukui TEST=folio case works well in UI and VT2. Change-Id: Ie3fed9a88620414afeea2fa4dcbf2cd120e7ac37 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869170 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* krane: set end of charge current threshold to 140mAstabilize-12607.6.Bstabilize-12607.5.Bstabilize-12607.3.BTing Shen2019-10-181-0/+14
| | | | | | | | | | | | | | | | According to the battery spec in b/142097561#comment15, EoC current should be 140mA. BUG=b:142097561 TEST=make BRANCH=kukui Change-Id: I913a1abecd2fc6ac28ba16513c3f0cc145afc38c Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866212 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: Modify the Charging and Fully charged LED colorLeo Zhou2019-10-181-5/+4
| | | | | | | | | | | | | | | Based on the Lenovo requirement,modify the Charging and Fully charged LED color as white BUG=b:137618886 BRANCH=kukui TEST=Do a charge test Change-Id: I75a3e9f24c98a67cb6b9dda8294c73926c20d4d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1706248 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kukui: runtime usb mux config selectionTing Shen2019-10-171-0/+6
| | | | | | | | | | | | | | | | | The compile time IF_ENABLED(CONFIG_USB_MUX_XXX) does not work on kukui, change this to runtime selection. BUG=b:135079572 TEST=On Krane Rev5/Kodama, verify the mux switch to dp + usb mode (i2cxfer r 0 0x48 0x11 returns 0x03 or 0x13) BRANCH=kukui Change-Id: Ib44f0c383ed5f9156e3dd3bf6faa3daebb22e146 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1864493 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* krane: change sensor-ref point to default device orintationYilun Lin2019-09-301-1/+1
| | | | | | | | | | | | | | | Switch from display scanout orientation to device default orientation. (go/chromeos-tablet-orientation) TEST=Ensure the display acts normal with UI patch. BUG=b:133201004 BRANCH=None Change-Id: If7a1632f3fcc03b381411b46d7b5441f8de5847d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826360 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* baseboard/kukui: Move base_detect_* into baseboardYilun Lin2019-09-183-180/+2
| | | | | | | | | | | | | | | | | The implementation of base detection in Kodama and Krane are very similar. This CL unify the implementation by adding VARIANT_KUKUI_POGO_KEYBOARD and VARIANT_KUKUI_POGO_DOCK. VARIANT_KUKUI_POGO_KEYBOARD is a mandatory config if pick and VARIANT_KUKUI_POGO_DOCK is optional. TEST=make buildall BUG=b:140608847 BRANCH=none Change-Id: I068905d8a52404eda6709d88543fcb6042db7378 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1806633
* krane: no longer need for MT6370 to provide display bias voltageTing Shen2019-09-171-4/+4
| | | | | | | | | | | | | | | After kukui rev 4, we use an external chip to provide db voltage (CL:*1584487), limit the display bias setup code to rev 2&3 only. BUG=b:140136293 TEST=manually BRANCH=master Change-Id: I689b0f0e5995dd0fcef0d69b8ecb9052ac62db46 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1790568 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Sean Abraham <seanabraham@chromium.org>
* krane: als: add tcs3400 coefficientsTing Shen2019-09-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Recent tcs3400 driver change requires board file to provide a conversion matrix to convert raw data into lux value. The coeffcients requires some complex step to measure (b:139366662), before the measurement is done, we need some non-precise value instead of the default zero matrix for functional test in next build. Based on the observation in b:135166710, I pick Y(lux) = C/10 in this CL. BUG=b:139366662 TEST=`cat /sys/bus/iio/devices/*/in_illuminance_input`, verify that the sensor readings is around 250 on my desk. (according to wikipedia, office lighting is around 320~500 lux, 250 is a little bit low, but good enough for ALS functional test) BRANCH=master Change-Id: I46cb417b919c40de6a81ce9254fcd2bcb51c0d5f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763897 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Sean Abraham <seanabraham@chromium.org>
* kukui: move board_set_charge_limit to baseboardTing Shen2019-09-121-12/+0
| | | | | | | | | | | | | | | | | The function is shared across all mt6370 users, move it to a common place. BUG=b:140156596 TEST=make BRANCH=master Change-Id: I7a9dafa5aafd078d997afe82fe7e0c555ecb5006 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1797196 Tested-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* krane: set tablet mode switch when base attachedYilun Lin2019-09-121-1/+5
| | | | | | | | | | | | | | | | | The switch should be set to inform AP of base status change. TEST=event_path=$(grep cros_ec_buttons /sys/class/input/event*/device/name \ | sed -nE 's|.*(/input/event[0-9]*)/.*|/dev\1|p' | head -n 1) evtest --query "${event_path}" EV_SW SW_TABLET_MODE ensure the return code is 0 (for success). BUG=b:140608847 BRANCH=none Change-Id: I4ae2a783e7fc3ebbf42fdf0ff0e9a17630631e5d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1795723 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kukui: enable hw ramp for mt6370Ting Shen2019-09-091-1/+0
| | | | | | | | | | | | | BUG=b:139012899 TEST=observe the charging curve (see issue above for result) BRANCH=none Change-Id: Ic4e6368763db4d741d82fc233e63e428fb67e610 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755882 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* jacuzzi: enable DPTing Shen2019-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | enable dp on jacuzzi, and add back the dp implementation before CL:1660524 for all new devices including jacuzzi. usb_pd_policy now supports two different configs: - kukui/krane, rev <= 4: no mux (CONFIG_USB_MUX_VIRTUAL defined) - all new devices: have a real mux BUG=b:135895590,b:135079572 TEST=attach a usb hub and moniter to the dut, verify that dp/dp+mux mode and both polarities can detected correctly BRANCH=master Change-Id: I3e4757c97d555a4afb48076fc4785305c96b0a7f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1723892 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: add it5205 driverTing Shen2019-09-053-4/+35
| | | | | | | | | | | | | | | | | | | | | | | An it5205 is added in kukui/krane rev 5, and deprecated gpio pin USB_C0_DP_OE_L and USB_C0_DP_POLARITY. This CL is intended to make the fw works for both old and new boards: 1) the default usb_mux driver is updated to rev 5, and board_rev_init may change it back for old boards. 2) keep VARIANT_KUKUI_DP_MUX_GPIO in kukui/board.h, and add a customized function to set/clear these gpio pins. BUG=b:135079572 TEST=verify that type c display works on board rev 4/5 BRANCH=master Change-Id: Ibe28816eed026ccb8a9a5234a612f80b038884f1 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1785197 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* include: Move RESET_FLAG_* into ec_commands.h as EC_RESET_FLAG_*You-Cheng Syu2019-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | RESET_FLAGS_* are used when setting/reading the field ec_reset_flags of struct ec_response_uptime_info, which is defined in ec_commands.h. So it might be better to put those macros there. To be consistent with the other macros in the file, add "EC_" prefixes to them. BUG=b:109900671,b:118654976 BRANCH=none TEST=make buildall -j Cq-Depend: chrome-internal:1054910, chrome-internal:1054911, chrome-internal:1045539 Change-Id: If72ec25f1b34d8d46b74479fb4cd09252102aafa Signed-off-by: You-Cheng Syu <youcheng@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1520574 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Ready: Yu-Ping Wu <yupingso@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* common: Move fifo logic out of motion_sense.cYuval Peress2019-08-232-2/+6
| | | | | | | | | | | | | | | | | | | | This change is needed to allow better testing of the fifo behavior. Additionally, motion_sense_fifo.c will only be compiled if CONFIG_ACCEL_FIFO is defined. This behaviour requires a few small changes to several boards and baseboards to make sure that we only define CONFIG_ACCEL_FIFO when the MOTIONSENSE task is present (some times that may be only in one section RW or RO). BUG=b:137758297 BRANCH=None TEST=buildall and ran CTS on arcada Change-Id: I2f7e4e436ba9568a35b7a0b2c8d53a73f198ba73 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704163 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Alexandru M Stan <amstan@chromium.org>
* tcs3400: update fields for als and rgb sensorNick Vaccaro2019-08-201-5/+19
| | | | | | | | | | | | | | | | Update board files for akemi, flapjack, hatch, kohaku, and kukui to use new field names in als_calibration_t and als_channel_scale_t. BUG=b:124512628 BRANCH=master TEST='make buildall' of the EC, verified builds succeed. Cq-Depend: chromium:1633269 Change-Id: I7ee324ce3de3377cd1538b631f4ec6294d2e9078 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1711958 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* kukui: enable CONFIG_CHARGER_MT6370_BC12_GPIOTing Shen2019-08-151-0/+5
| | | | | | | | | | | | | | | Apply the new option in CL:1575050 to Kukui devices with MT6370. TEST=Verify that krane is able to detect BC12 DCP. BUG=b:122866184 BRANCH=None Change-Id: I18f17af3672a364952779dcc2ee19b05b0459e20 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753566 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* charge_manager: Mark functions overridableDaisuke Nojiri2019-08-142-7/+3
| | | | | | | | | | | | | | | | | | | Functions such as board_fill_source_power_info are overridable. This patch annotates them properly using override macros, and removes their declarations from board.h. These functions are declared in both charge_manager.h and {kukui,krane,kodama}/board.h. The latter causes comm-dev.c to fail to be compiled in chrome-base/diagnostics. BUG=none BRANCH=none TEST=buildall Change-Id: I27d6dfe2fa9299550ac5205c34095a4fe02dabdb Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1752597 Tested-by: Yu-Ping Wu <yupingso@chromium.org>
* kukui: fix tcpc_init failed on kukuiTing Shen2019-08-063-11/+15
| | | | | | | | | | | | | | | | | Calling board_pogo_charge_init() when DEDICATED_CHARGE_PORT disabled causes buffer overflow inside charge manager, move the function to a suitable place to fix the issue. BUG=b:138741956 TEST=flash and verify that kukui is bootable BRANCH=master Change-Id: I43d8aabf8fd21ed62a37671ba7cd471c8c188b9f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731212 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* kukui: remove duplicate items in i2c_ports arrayTing Shen2019-08-021-6/+2
| | | | | | | | | | | | | | | | i2c_ports[] should have one entry for each port, not for each i2c slave BUG=None TEST=verify that `i2cscan` only scans port 0 and 1 once. BRANCH=master Change-Id: I457c780fabd7bb68a5dc8871236a080d2fc6f332 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1729097 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* kukui: fix incorrect input power limitTing Shen2019-08-021-2/+7
| | | | | | | | | | | | | | | | | | | This CL includes two major changes: - set input current in board_set_charge_limit() instead of charger_profile_override(). - remove board revision constraint, apply the fix to all kukui/kranes. BUG=b:134227872 TEST=manually, boot with new fw and measure the power. BRANCH=master Change-Id: Ib826e805990fe3e9af5a88c231825bd477592e49 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730378 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* jacuzzi: bringup ecTing Shen2019-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | Initial version of jacuzzi ec. The files are basically copied from board/kukui/, battery and charger configured to the correct i2c port and component, and pogo / sensor removed. BUG=b:135895590 TEST=verify that this is bootable on a Jacuzzi, charger and battery looks good, and no error message spamming on ec console. BRANCH=master Change-Id: Ia786076c08019dd2aa1711a68ff1c82cc7fa45ed Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1673955 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* baseboard/kukui: support battery/charger variantsTing Shen2019-07-311-6/+8
| | | | | | | | | | | | | | | | | | This CL introduces config option VARIANT_KUKUI_BATTERY_* and VARIANT_KUKUI_CHARGER_* for derivatives to pick their battery / charger option. BUG=b:137172860 TEST=build and deploy on Krane, verify that `battery` and `charger` console output looks reasonable. BRANCH=master Change-Id: Ic5c33a233ec30c9bc71414c95603157301281041 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1697781 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* kukui: add baseboard/kukuiTing Shen2019-07-306-1392/+19
| | | | | | | | | | | | | | | | | | | | Create a baseboard to reduce the effort of forking and maintaining kukui derivatives. This CL is intended to just moving things around, with minimal changes to make compiler happy, complex logic changes will implement in subsequent CLs. BUG=b:137172860 TEST=build and deploy on a Krane BRANCH=master Change-Id: Ifd3ad5c3b03dce101cd15cbcec304f5e3a1081ac Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1695562 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* krane: Fix g-sensor reference point for all revisionsTing Shen2019-07-231-23/+6
| | | | | | | | | | | | | This should apply to all Kranes. BUG=b:131081336 TEST=factory accelometer test BRANCH=master Change-Id: I44313d73bf6dd484101973e153c6b5209128a789 Signed-off-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1687832 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* krane: limit backlight current for all revisions.Ting Shen2019-07-231-8/+10
| | | | | | | | | | | | | | | | Confirmed by HW eng, this fix should apply to all board revisions. BUG=b:133655155 TEST=none BRANCH=master Change-Id: I20a72ec744c6d6fbf08d0cf57ad78902e35c2df9 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679784 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-202-9/+9
| | | | | | | | | | | | | | | | | | | 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>
* Use 7bit I2C/SPI slave addresses in ECDenis Brockus2019-07-192-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* kukui: code cleanupTing Shen2019-07-093-39/+4
| | | | | | | | | | | | | | | Remove unused clode blocks and includes. BUG=None TEST=make BRANCH=master Change-Id: I66994039e4c215ce652cdef227207a6bbd94b316 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1692364 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* kukui: add chargen to the set of CLI commandsVadim Bendebury2019-07-041-0/+1
| | | | | | | | | | | | | | | This is needed to support CCD testing of UART to USB bridging. BRANCH=none BUG=b:38448364 TEST=ran 'make BOARD=kukui -j', verified that command is included in the symbol map. Change-Id: I675df026c16b5c0b07ed55c99aa5e8b333fd0fab Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1688136 Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* krane: remove als mutexTing Shen2019-07-031-2/+0
| | | | | | | | | | | | | | | According to the comments in CL:1666260, we don't need it anymore. BUG=b:129430139 TEST=make BRANCH=master Change-Id: I98944518e1e70d2a2ea2a607b3dfd478f9c09e55 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679855 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* cleanup: Rename CONFIG_MKBP_WAKEUP_MASK for clarity.Aseda Aboagye2019-07-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | CONFIG_MKBP_WAKEUP_MASK is a bit confusing and is wrongly named. The comment stated that "With this option, we can define the MKBP wakeup events in this mask (as a white list) in board level, those evets allow to interrupt AP during S3.". However, these events are NOT MKBP events at all but are instead host events. This commit tries to clear things up by renaming CONFIG_MKBP_WAKEUP_MASK to CONFIG_MKBP_HOST_EVENT_WAKEUP_MASK to better show that these events are in fact host events. BUG=b:136282898 BRANCH=None TEST=`make -j buildall` Change-Id: I42beadec8217435fd30e679ccf52d784a8ef99a0 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1685784 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* kukui: Enlarge task stack size for temporarily fixing overflow issue.Yilun Lin2019-06-271-7/+7
| | | | | | | | | | | | | | | TEST=make BOARD=krane analyzestack section=RW, and see no tasks uses stack more than it could. BUG=b:135992789 BRANCH=none Change-Id: Ic28b5fed5db35f001fad71ec64db511c700cf614 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1677979 Tested-by: Youcheng Syu <youcheng@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org>
* kukui: Add basic analyzestack.yaml configYilun Lin2019-06-261-0/+3
| | | | | | | | | | | | | | TEST=make BOARD=kukui analyzestack BUG=b:135992789 BRANCH=none Change-Id: Ie5e6447a353e9115199cbab1c5147b95ecfbfdb6 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1677978 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* kodama: add a new configuration for Kodama.peichao.wang2019-06-251-1/+1
| | | | | | | | | | | | | | | | Add a new kodama folder and BOARD configuration for Kodama. BUG=b:135490566 BRANCH=None TEST=1. emerge-kukui chromeos-ec 2. check coreboot binary could be generated under the /build/chroot/kukui/firmware/kodama/. Change-Id: Ia48243ce59597e7f0b85ff46a4c71eb5bbb30661 Signed-off-by: peichao.wang <peichao.wang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1666340 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* krane: enable TCS3400 ALS sensorTing Shen2019-06-252-0/+76
| | | | | | | | | | | | | | BUG=b:129419982 TEST=Combined with CL:1621449, run ectool motionsense. BRANCH=None Change-Id: I028f9a286ba96d7813bb76ba5e1e5235955e40b3 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1628630 Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* kukui/usb_pd_policy: Don't support superspeed lanes.Yilun Lin2019-06-241-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | Kukui doesn't have superspeed lanes, we should avoid using such pin assginments. Also, 1. update usb_mux on receiving DP config packet accordingly, and 2. fix usb_mux setting by removing usb_mux update when receiving DP attention packet. We should inform DP mux on at DP config, and DP mux off at DP safe mode. TEST=print choosed pin mode, and see it choose PIN_C rather than PIN_D. TEST=Plug hub JCA-374 and see the external display is functional. BUG=b:135079572 BRANCH=master Change-Id: Id1edfc5b1962dbef7e5ab79c512d8f2c568777e8 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660524 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Auto-Submit: Yilun Lin <yllin@chromium.org> Commit-Queue: Yilun Lin <yllin@chromium.org>
* krane: detect pogo charger in adc interruptTing Shen2019-06-203-63/+109
| | | | | | | | | | | | | | | | | | | | | | | | 1. Move the charging dock detection logic from POGO_VBUS_PRESENT interrupt to POGO_ADC_INT_L interrupt. (see issue below for more context). 2. Since the analog pin in STM32F0 can not trigger interrupt, the pin is now an input pin, and programmed as an analog pin only when need to read its value. BUG=b:132419493 TEST=Manually, verify that the value of EN_POGO_CHARGE_L, EN_USBC_CHARGE_L and EN_PP3300_POGO are correct when fake device attached. BRANCH=None Change-Id: Idd468f06516a614e07aa357ffe215846314a435b Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1604548 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* kukui: implement pogo discharge and extpower_presentTing Shen2019-06-201-4/+28
| | | | | | | | | | | | | | | | | | - checks pogo present in extpower_present() - implemented customized discharge_on_ac, we can't really discharge on pogo, so only set charge to NONE when force discharging. BUG=b:127767432,b:128386458 TEST=None BRANCH=None Change-Id: I2ffb6a69f102b9e10eff0a7794e04516055fac9d Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1549811 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* kukui: implement pogo charge logicTing Shen2019-06-204-24/+113
| | | | | | | | | | | | | | | | | | Added a dedicated(POGO) charge port and related costomization functions. BUG=b:128386458 TEST=`gpioset POGO_VBUS_PRESENT 0/1` to simulate pogo charger presence, and a normal usb charger for usb port to check its behavior. BRANCH=None Change-Id: If102c57088f1aafee437c7cc912992dc0cf8e9da Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1535087 Reviewed-by: Yilun Lin <yllin@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* krane: limit input power to 5V/2A in S0Ting Shen2019-06-191-2/+13
| | | | | | | | | | | | | | | | This is a short term fix to prevent charger overheat. BUG=b:134227872 TEST=manually, boot with the new fw and measure the power. BRANCH=master Change-Id: I88c3444f0a0c0c9a755579fcb1f9c52fc032a179 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1642478 Tested-by: Tony Lin <tonycwlin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>