summaryrefslogtreecommitdiff
path: root/board/casta
Commit message (Collapse)AuthorAgeFilesLines
* Casta : Change charging voltage and currentYongBeum.Ha2023-02-081-1/+6
| | | | | | | | | | | | | Change charging voltage(8600mV) and current(3200mA). BUG=b:266123223 BRANCH=firmware-octopus-11297.B TEST=build, update and check charging voltage and current Change-Id: Ib7b520fbb355ac7ad73634e21271569ed5073d10 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199245 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Casta : Change Maximum Voltage of BatteryYongBeum.Ha2023-01-311-1/+1
| | | | | | | | | | | | | Change max voltage of battery to 8600mV BUG=b:266123223 BRANCH=firmware-octopus-11297.B TEST= build, update and check charging voltage Change-Id: I4caaf30dceb87dc8de6c41aa2e996f89fc7f00d8 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199244 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* board: Sort header filesJeremy Bettis2022-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | Sort all includes in board with the clang-format rules used by the zephyr project. BRANCH=None BUG=b:247100970 TEST=zmake build -a TEST=./twister --clobber -v -i TEST=make -j72 buildall_only runtests TEST=zmake compare-builds -a Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I6ad72b167cbb768a64c338fa633eb4bf5a401897 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060360 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* Rename CONFIG_CHARGER_INPUT_CURRENT to _CHARGER_DEFAULT_CURRENT_LIMITPeter Marheine2022-11-291-1/+2
| | | | | | | | | | | | | | | | | | | "Default input current" is not a very clear name, so rename this option to better express its use as a default value that is set in the charger. This is made possible by splitting other uses into CHARGER_MIN_INPUT_CURRENT_LIMIT, making the only use for CHARGER_INPUT_CURRENT be as a default. BUG=b:163093572 TEST=make buildall; zmake build -a BRANCH=none LOW_COVERAGE_REASON=isl9241 and sm5803 currently lack emulators Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ia9c1df9061825b15477466e85343afeb2a371288 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4025404 Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* Update license boilerplate text in source code filesMike Frysinger2022-09-127-7/+7
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* board/casta/board.c: Format with clang-formatJack Rosenthal2022-07-011-24/+22
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I85789ac69a93d5014d6e611102b2268b948d19db Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728115 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/casta/battery.c: Format with clang-formatJack Rosenthal2022-07-011-8/+8
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ib140f1ce9ef06d48a8c520b8ae416d3f76763c18 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728140 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/casta/board.h: Format with clang-formatJack Rosenthal2022-07-011-2/+2
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ibdae3b275aaecbfce1e751c6f5e3a44ec8f06ccc Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728116 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* board/casta/led.c: Format with clang-formatJack Rosenthal2022-06-301-42/+46
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ifc845bb878c47ee4ef3944b09608f357378d5b03 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728141 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* COIL: Update I2C terminologyRicardo Quesada2022-02-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | This CL replaces slave_addr_flags with addr_flags. For context, "addr_flags" is the name is that is being used in the caller function. E.g: http://cs/chromeos_public/src/platform/ec/common/i2c_controller.c?l=137 So, the naming convention is the name as the rest of the functions, and also conforms with COIL. BRANCH=None BUG=b:163885307 TEST=compare_build.sh -b all matches Signed-off-by: Ricardo Quesada <ricardoq@google.com> Change-Id: I75efe758daa8f51ae37f6ba2c67c3a7bf8ce3a8e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3436449 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Ricardo Quesada <ricardoq@chromium.org> Tested-by: Ricardo Quesada <ricardoq@chromium.org> Auto-Submit: Ricardo Quesada <ricardoq@chromium.org>
* tree: Files should end with single newlineTom Hughes2021-10-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | One of the checks that runs as part of "repo upload" looks for a single newline at the end of each file. I'm getting warnings about this when I touch files that do not follow this, even though I didn't add the extra newlines. This commit fixes all files by running the following: for f in $(find . -name '*.[ch]'); do printf '%s\n' "$(cat ${f})" > ${f}; done BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ia3ece5b64b549d21ca11708791368002bb6e9b0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229797 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* board: Rename RSMRST_L_PGOOD as PG_EC_RSMRST_ODLfirmware-chameleon-14280.B-mainDivya Sasidharan2021-10-121-0/+2
| | | | | | | | | | | | | | | | | GPIO_RSMRST_L_PGOOD is also used as GPIO_PG_EC_RSMRST_ODL creating redundancy. Removing it will help need for redefinitions for zephyr. Remove reference to GPIO_RSMRST_L_PGOOD in zephyr BUG=b:200975143 BRANCH=main TEST=make buildall -j, boot up on brya Change-Id: Iff46595174c54db347b69cff3ad9e266ba9fd535 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180808 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-271-1/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* chgstv2: Unify power-on and shutdown battery thresholdsDaisuke Nojiri2021-06-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, power-on battery SoC and shutdown battery SoC are independently configured by each board. This patch will unify the setting as follows: CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 2 (don't boot if soc < 2%) CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2 (shutdown if soc <= 2%) BATTERY_LEVEL_SHUTDOWN = 3 (shutdown if soc < 3%) CONFIG_BATTERY_EXPORT_DISPLAY_SOC = Y (removed) CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC = 1 This allows us to show the low battery alert whenever we can because EC doesn't inhibit power-on even if it knows the host would immediately shut down. With CONFIG_BATTERY_EXPORT_DISPLAY_SOC, boards will start using the CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2% as the low battery threshold (and the SoC will be agreed between the EC and Powerd). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 1 will keep the same threshold. This is for avoiding degrading the UX by increasing the power-on threshold (even though a question that 1% may not be enough for soft sync to finish consistently remains to be answered). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON > 2 will have a lower threshold but we think 2% is enough to finish the software sync. A lower threshold also improves the UX by showing the low battery alert in the situation where otherwise the system would leave the user uninformed by not responding to a power button press. BUG=b:191837893 BRANCH=None TEST=buildall Change-Id: If6ff733bc181f929561a3fffb8a84e760668ce37 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: Remove a few configs from allowlistPhilip Chen2021-06-031-1/+0
| | | | | | | | | | | | | | | | | | CONFIG_TABLET_MODE_SWITCH is already in zephyr Kconfig. CONFIG_TABLET_SWITCH is not a valid EC config. Remove them from config_allowed.txt. BRANCH=None BUG=None TEST=make buildall Change-Id: I36cd880e7b9f8df0a30503829dd46abcc2f54e07 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2935058 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* LED On/Off: Make battery LED optionalDiana Z2021-04-221-4/+5
| | | | | | | | | | | | | | | Currently, all boards using the LED On/Off module have battery LEDs. However, if we'd like to expand support to Chromeboxes then the battery LED must become optional. BRANCH=None BUG=b:185508707 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieae098829ebe6c8b103f23d5abdbf70e7bcbdf2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832692 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* LED On/Off: Remove power LED configDiana Z2021-04-222-3/+2
| | | | | | | | | | | | | | | | | | | | | | Move the LED on/off module towards using a more flexible LED support approach. Define a weak power LED table and setter for boards to override when needed. Note that during run-time these functions will not get called since led_auto_control_is_enabled() will return false for nonexistent LEDs. This consumes an average of 165 additional bytes of flash space on boards which do not use a power LED. BRANCH=None BUG=b:185508707 TEST=make -j buildall, load on guybrush (battery LED only) and confirm no errors are seen. Load on Boten (both LEDs) and confirm behavior appears normal Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iaa1e22a7f5d8be39eb8792ee13d358087d7f7482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832691 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* thermisor: move header to include dirDawid Niedzwiecki2021-04-221-1/+1
| | | | | | | | | | | | | | | | Move the "thermistor.h" header to the include/driver/temp_sensor directory. It is used by the Zephyr shim, so the change is useful to include the header. BUG=b:180403276 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e83df97e50a3b324440b65ddb900ddf135f2439 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2843323 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* genvif: Use VIF overrides by defaultAbe Levkoy2021-03-301-0/+3
| | | | | | | | | | | | | | Use board-specific override files when generating VIFs for boards. BUG=b:172276715 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I197365018ceb8197c22d631cebf4cbce1c0119f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785506 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* config: Fix inconsistent VBUS measurement configAbe Levkoy2021-01-221-1/+5
| | | | | | | | | | | | | | | | | | Remove CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT from boards that define CONFIG_USB_PD_VBUS_MEASURE_CHARGER. This change is a no-op, because charge_manager.c is the only place where CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENT is checked, and it is only checked if CONFIG_USB_PD_VBUS_MEASURE_CHARGER is not defined. BUG=b:178102402 TEST=make buildall TEST=Build sizes before and after change are the same BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: Ia3caa57a8531a5cba549b64c9087c337996af9c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2642892 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Move tcpic.h header into include/driverSimon Glass2021-01-071-1/+1
| | | | | | | | | | | | | | | | | | This header cannot currently be accessed by Zephyr since it is in a driver directory, not an include directory. This header has quite a bit of public stuff in it, so it seems reasonable to consider everything public. Move the header file and update all users. BUG=b:175434113 BRANCH=none TEST=make buildall -j30 build volteer on zephyr Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ibba37f47a06783fafb5095f853f2a68d92b6df87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607745
* charger: rename charger_set_input_currentEric Yilun Lin2020-12-081-5/+5
| | | | | | | | | | | | | | | charger_set_input_current was actually sets the input current limit, so renames it to charger_set_input_current_limit. BUG=b:171853295 TEST=make buildall TEST=not output from `grep -r "\<charger_set_input_current\>"` BRANCH=none Change-Id: Icf4e99f287a7d4fc2d9560e8502e46cc07bfc085 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569083 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* casta: change CONFIG_BC12_MAX14637_DELAY_FROM_OFF_TO_ON to 100Marco Chen2020-12-071-0/+4
| | | | | | | | | | | | | | | | BUG=b:173166535 BRANCH=octopus TEST=build and flash to casta; verify whether BC12 can detect CDP/DCP/SDP correctly. TEST=`make buildall -j` Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I6e3b9d79416a0cdf8200dae16e22cf0b2564c391 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567198 Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
* Casta : Write input current limit on AC removalYongBeum.Ha2020-11-171-0/+13
| | | | | | | | | | | | | | | | Input current limit is set to default when AC is removed. It needs to change input current on AC removal. BUG=b:169259388 BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Ia6d6a28bb418b475513bd541498646f2e1cc70dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2430905 Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Dossym Nurmukhanov <dossym@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Casta : Support Multi-ChargerYongBeum.Ha2020-11-172-2/+26
| | | | | | | | | | | | | | | Casta needs to support 2 chargers(ISL9238 & BQ25710) BUG=b:168122776 BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I18758acbd0920132c2958bf9d238b4eac3fb5b73 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428354 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* casta : remove rev0 configurationYongBeum.Ha2020-10-221-11/+0
| | | | | | | | | | | | casta doesn't support rev0 board. BUG=None BRANCH=firmware-octopus-11297.B TEST=None Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I41fd8bbb6b4d26f0d5f633db8c37b5c46cce6422 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2455016 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* casta : change battery voltage maxYongBeum Ha2020-08-131-1/+1
| | | | | | | | | | | | | | | change battery voltage max to 8650mV BUG=b:163453304 BRANCH=master TEST=flash EC and check battery charging. Signed-off-by: YongBeum Ha <ybha@samsung.com> Change-Id: Ie98ec604b5ebca25cff693542e1e65452bcf1e57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352960 Reviewed-by: Justin TerAvest <teravest@chromium.org> Commit-Queue: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org>
* casta : set a charging voltage limitYongBeum Ha2020-08-131-0/+6
| | | | | | | | | | | | | | | limit charging voltage to battery voltage max BUG=b:163453304 BRANCH=master TEST=flash EC and check battery charging. Signed-off-by: YongBeum Ha <ybha@samsung.com> Change-Id: I5f82f71392bfade3a4b5aa288cf5ba19687556f3 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2351645 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* ec: change usage of "sane" per inclusive languagePaul Fagerburg2020-07-221-1/+1
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "sane", "sanity check", and similar with inclusive/non-stigmatizing alternatives. BUG=b:161832469 BRANCH=None TEST=`make buildall -j` succeeds. `grep -Eir "sane|sanity" .` shows results only in third-party code or documentation. Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I29e78ab27f84f17b1ded75cfa10868fa4e5ae88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311169 Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: ensure we are suspending USB-C ports on shutdownJett Rink2020-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | After CL:2208221, the check for the PD_CMD task no longer trigger, so we end up not calling suspend on our TCPC ports. We want to continue to suspend, which will apply CC open in TCPMv2 for a cooperative shutdown Also, correct override keyword usage for board_get_usb_pd_port_count since I had to touch those definitions to make IS_ENABLE work BRANCH=none BUG=b:160243292 TEST=See that software sync reboot, applies CC open (and browns out system) Change-Id: I00bf08c7d347441d77834e2c5122a09ca2316280 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276318 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* PD: Remove unnecessary PDCMD taskDiana Z2020-05-201-1/+0
| | | | | | | | | | | | | | | | | | | The PDCMD task is only pulling interrupts from the TCPCs on most boards, which is unnecessary since the PD_INT tasks handle this job now. Remove it from any boards using the PD_INT command which are not using the older CONFIG_HOSTCMD_PD functionality (ex. samus, oak). Located boards using: find -name "ec.tasklist" | xargs grep -l PD_INT | xargs grep PDCMD BRANCH=None BUG=b:154959596 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I29be8ab1d7a2616603fb55236aed4329ed8654f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2208221 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* casta: Configure number of PD ports basing on SKU IDPatryk Duda2020-05-111-0/+21
| | | | | | | | | | | | | | | | | | | | | Bluebird board contains only one Type-C port. This patch implements limiting number of available Type-C ports basing on SKU ID. Also obtaining SKU ID was implemented by fetching it from EEPROM, similarly to garg board. BUG=b:154602760 BRANCH=none TEST=Flash on bluebird, open EC console. Issue command 'typec 1 usb'. Command should fail with information that parameter 1 is invalid. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I20c8799b2ee687956d5fbfd4029aacfaa768fe07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187212 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Temp sensor: Remove action_delay_sec fieldDiana Z2020-02-141-6/+3
| | | | | | | | | | | | | | The action_delay_sec field hasn't actually been referenced by any code since 2013. Removing the corresponding struct field. BUG=None BRANCH=None TEST=builds Change-Id: Ia7334c26b85d0161ff61bb51fbdda61bb921595a Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2054945 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Rename CONFIG_USB_PD_PORT_COUNT as CONFIG_USB_PD_PORT_MAX_COUNTKarthikeyan Ramasubramanian2019-11-011-1/+1
| | | | | | | | | | | | | | | | | 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>
* octopus: lock gpio config for reset signalJett Rink2019-10-191-1/+6
| | | | | | | | | | | | | BRANCH=octopus BUG=b:142953493 TEST=verify that later modification of gpio flag will no allow driving signal high. Change-Id: I0b8c1503ba8c03afa3eb6fa4f921b3480106f05b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869407 Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* casta & bluebird : make charge state to ST_DISCHARGEYongBeum Ha2019-07-301-1/+2
| | | | | | | | | | | | | | | | charge_profile_override() changes charge state from ST_DISCHARGE to ST_IDLE on overtemperature condition. This makes led color to green when there is no adapter. This CL skip changing charge state when charge state is ST_DISCHARGE. BUG=b:138268383 BRANCH=None TEST=None Change-Id: I581a42641cf6632657b8e19ab41b532805024d9e Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715952 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-201-5/+5
| | | | | | | | | | | | | | | | | | | 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-191-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Casta: Adjust power button init timeout for no battery bootsDiana Z2019-06-071-1/+11
| | | | | | | | | | | | | | | | | | Bluebird units may need some additional time to complete PD negotiation when booting without a battery, so allow an extra second during power button init. This additional time is due to the fact that they do not have a TCPC on port 1, so the PD1 task will take longer to attempt to communicate with the TCPC before suspending. BRANCH=octopus BUG=b:134462099 TEST=removed battery on bluebird unit and verified it could reliably automatically power-on when AC was inserted Change-Id: I769e10db7bbf223a5d174bae3ec1b7a4b9f542c4 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1646992 Reviewed-by: Jett Rink <jettrink@chromium.org>
* casta : Blink red led to indicate low batteryYongBeum Ha2019-05-281-2/+3
| | | | | | | | | | | | | | | | | | When low battery(under 1%) is connected to system and ac is connected, the system waits till RSOC becomes 1%. We need to notify user that battery is charging to get enough power to power on. BUG=b:133459206 BRANCH=octopus TEST=flash EC, connect PD adapter and check if red led blinks on low battery(under 1%) Change-Id: Ie5f23e0dfe170ea4317103682733f88c203c2339 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1627844 Reviewed-by: Diana Z <dzigterman@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* casta:Do not override charge on dead batteryYongBeum Ha2019-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | charger_profile_override() change charging voltage & current as battery temperature. The flag for bad temperature is set when battery is not responsive then the current is set to 0. Charge doesnot charge dead battery and the battery can't wake. Then the system can't power on with dead battery. BUG=b:131126731 BRANCH=octopus TEST=flash EC and check if dead battery is charged. Change-Id: I3a46442344f89d129c4b90b0b7ceb9ffc863fbf3 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1605298 Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
* Casta: Adjust charger configs for low battery bootingDiana Z2019-05-221-0/+9
| | | | | | | | | | | | | | | | | | | | | When a locked system boots up with a very low or non-communicating battery, the DUT should refrain from booting S0 in order to avoid hard reset brown outs after the system jumps to RW and begins attempting PD negotiation. BUG=b:131126731 BRANCH=octopus TEST=loaded onto locked casta with low battery, verified that the system didn't boot to S0 until the battery had passed the min battery percent configuration Change-Id: I64736eb1d39883cd95a5e317b1f964354e6f8e41 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1595272 Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
* common: led_onoff_states: move forward baseboard led_state to common codeDevin Lu2019-04-202-2/+2
| | | | | | | | | | | | | | | | | 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>
* casta:Turn on green led when charge state is idleYongBeum Ha2019-04-131-1/+1
| | | | | | | | | | | | | | Battery led is green when charging is stopped, AC is connected and system is S5. BUG=b:130334341 TEST=Build & flash EC then check battery led. Change-Id: Ib31a94ba5ad9a7e78cc87a3bf1980638ae9599c3 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1563873 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ec.tasklist: Consolidate duplicate commentsDaisuke Nojiri2019-04-081-14/+1
| | | | | | | | | | | | | | | | | | | | | | | It's simply a bad idea to describe a macro in multiple locations. It'll make it hard to change. It'll be difficult to keep all locations in sync. This patch replaces the comment duplicated in all ec.tasklist with a pointer to the CONFIG_TASK_LIST definition. The macro will be described in a single place (just like all/most other macros). Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: Id658b9d68e742e4334c692b804d9c98c8de21313 Reviewed-on: https://chromium-review.googlesource.com/1551579 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Casta: Add MKBP events on EC_AP_INT_ODLDiana Z2019-04-042-3/+3
| | | | | | | | | | | | | | | Though casta isn't using sensors, the GPIO for the MKBP events is still populated so configure and enable it. BUG=None BRANCH=octopus TEST=builds Change-Id: Id5efe1dd79efaeb43a94b6fcd005d5ae7078a03c Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1545084 Reviewed-by: Enrico Granata <egranata@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* casta : Turn on blue led when system is onYongBeum Ha2019-03-131-1/+5
| | | | | | | | | | | | | | | | When system turns on violet led is shown for a while. So EC makes green and red led turn off when blue led is turned on. BUG=b:128009540 BRANCH=octopus TEST=builds, flash and check led color when system turns on Change-Id: I1b31c372d0878c02f63c562d7daf37f05a2eb329 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1517060 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* mkbp_event,include/config.h: Clarify MKBP delivery method.Yilun Lin2019-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have two MKBP delivery methods: 1. define CONFIG_MKBP_USE_HOST_EVENT to notify via host event 2. undef CONFIG_MKBP_USE_HOST_EVENT to notify via GPIO interrupt It may become more complicated if new notification methods introduced. e.g.: mt_scp uses IPI, rather than host event and GPIO interrupt. This CL does: 1. add CONFIG_MKBP_USE_GPIO to explicilty declare that MKBP event are sent via GPIO interrupt. 2. CONFIG_MKBP_USE_CUSTOM for boards which have custmized methods. 3. Remove weak attribute in mkbp_set_host_active (which can be done with CONFIG_MKBP_USE_CUSTOM now. 4. Removes mkbp_set_host_active function in board Nocturne. It only deliver MKBP events through GPIO interrupt now. BRANCH=None BUG=b:120808999 TEST=grep -rn "CONFIG_MKBP_USE_GPIO\|EC_INT_L" board/ baseboard/ and see the result is reasonable: 1. EC_INT_L must be 1-to-1 mapped to define CONFIG_MKBP_USE_GPIO in every board, except that meep, yorp, ampton which are defined in baseboard octopus. 2. undef CONFIG_MKBP_USE_GPIO in bip and casta, which use host event, but also have baseboard octopus. Change-Id: I4af6110e4fd3c009968075c3623ef2d91cbd770b Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1490794 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* casta : charger overrideYongBeum Ha2019-01-281-0/+1
| | | | | | | | | | | | | | | Enable charger override. BUG=b:122868858 BRANCH=None TEST=flash EC & check charger current and voltage Change-Id: I338b45d6a2a3aa4a6e47f23136fd329b41bdd6bb Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1436715 Commit-Ready: Diana Z <dzigterman@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* casta:enable pull-up of usb mux0 interruptYongBeum Ha2019-01-251-0/+11
| | | | | | | | | | | | | | | | | Pull up resistor is not stuffed on USB_MUX0 interrupt. This is schemetic bug on revision 0. The pull up resistor will be stuffed on next revision. BUG=b:118856396 BRANCH=master TEST=build, flash ec and check PD port 0. Change-Id: Ib278af4e0cff5d1db40c7dbd5536570e0fc620a7 Signed-off-by: YongBeum Ha <ybha@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/1426297 Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org> Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org>