summaryrefslogtreecommitdiff
path: root/board/sweetberry
Commit message (Collapse)AuthorAgeFilesLines
* i2c: Use declared initializers for i2c_ports: servo boardsKeith Short2021-11-301-8/+28
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7eb605c0a87fad9b803955fa6ae34d39d71ad27a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300660 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* COIL: Rename CONFIG_I2C_CONTROLLERDiana Z2020-11-051-1/+1
| | | | | | | | | | | | | Rename CONFIG_I2C_CONTROLLER and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ied6a1829bf54a5c9a32e6772982a4b8aa31aaf23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Servo: Enable LTO to improve flash spaceBrian J. Nemec2019-12-171-0/+2
| | | | | | | | | | | | | | | | | | | Enables LTO (Link Time Optimization) in order to improve flash space on ServoV4. Current builds have 48B remaining, the link time optimization frees up 6kB of space in the flash. Feature was enabled on ServoMicro and sweetberry. BRANCH=servo BUG=b:145512023 TEST=Manually tested flashing process to ensure they updated both regions, basic communication, and functionality on the following platforms: ServoV4, ServoMicro, and Sweetberry. Change-Id: I8f7a0d23478581c54a7379241a0290b897a635ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1961149 Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Drop LTO workaround from sweetberryStefan Reinauer2019-11-071-5/+0
| | | | | | | | | | | | | | | | Because it breaks external builds such as coverity builds. The issue needs to be fixed differently. BUG=b:132204142 TEST=flash on sweetberry and see usb endpoints work BRANCH=none Change-Id: I2ee1789e12dd5240fac4bf97a2638efa85446df6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1851105 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Auto-Submit: Stefan Reinauer <reinauer@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-201-1/+1
| | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* sweetberry: update I2C clock speeds to match spec/measurements.Brian J. Nemec2019-05-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All 4 I2C ports on the Sweetberry were configured at 800 KHz. 3 of the I2C ports are limited to 400 KHz and the FMP I2C port can be up to 1 MHz. This means that 3 of the slower speed I2C ports are out of spec by a factor of two. Traces of the rails showed that the rails were still functioning at 800 KHz, although the FMP I2C rail is actually at 896 KHz. The STM32F4 Reference Manual Rev4 does not indicate which potential problems occur when operating in this condition. The I2C speeds were adjusted to match spec with the 3 slow speed ports set to 400 KHZ. The I2C prescalers for the FMP I2C port do not have a suitable 1 MHz configuration at our system clock speed so the FMP I2C rail was adjusted to 900 KHz to match the measured speed within 2% for all rails. The cost of this change is the scan time for a group of 28 INA's increased from 4.9 ms to 5.5 ms. BRANCH=servo BUG=b:133503970 TEST=Verified Sweetberry can measure rails when used with powerlog. Observed I2C rail activity using a Saleae analyzer. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Id345c1dd902212b92089e5ab3e04dd187efb4542 Reviewed-on: https://chromium-review.googlesource.com/1628641 Commit-Ready: Brian Nemec <bnemec@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Brian Nemec <bnemec@chromium.org>
* Reverts an update to the compiler toolchain when building theBrian J. Nemec2019-05-251-0/+5
| | | | | | | | | | | | | | | | | | | | | Sweetberry project to repair ToT. The change which updated the toolchain exposed a problem with the USB initialization which prevents powerlog from being able to communicate with the device. The root cause has not been identified so the follow up issue b/132204142 has been filed. BRANCH=Servo BUG=b:126223732 TEST=Verified that the Sweetberry project is able to build, lsusb identifies the device, and powerlog is capable of communicating with the device and retrieving data. Change-Id: I0d1f7e79a8ea890dcf5da3c16427220cf9067fdf Signed-off-by: Brian Nemec <bnemec@google.com> Reviewed-on: https://chromium-review.googlesource.com/1601350 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* ec.tasklist: Consolidate duplicate commentsDaisuke Nojiri2019-04-081-11/+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>
* i2c: Split i2c_xfer into locked/unlocked versions.Jonathan Brandmeyer2018-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename i2c_xfer to i2c_xfer_unlocked. Audit all users of i2c_xfer to see if they can use simple locking semantics or require their own locking. Since locked accesses are only safe for I2C_XFER_SINGLE transactions, remove the flags parameter from i2c_xfer. This also makes the audit a bit easier. Some remaining applications hold the bus locked across several transactions that would otherwise be atomic, and a few others implement complex I2C transactions in multiple commands. Add a (nondeterministic) verification on the I2C port locking correctness. This will catch all statically incorrect locking patterns, although dynamically incorrect locking patterns may not be caught. Related: Revise the i2c_port_active_count to be a bitmap of the active ports instead of a count of the active ports. The EC's mutex does not provide an is_locked() primitive, and we would prefer not to have one. - board/glados: Custom locking for battery reset - board/mchpevb1: Custom locking for battery reset - board/oak: Custom locking for battery reset - board/samus: Custom locking for lightbar reset - board/sweetberry: simple locking - board/servo_micro: Custom locking for funky i2c transfers - capsense: simple locking - host_command_master: multi-command transactions - lb_common: manual locking to support samus power sequence - smbus: multi-command transactions - usb_i2c: simple locking - driver/tcpm/fusb302: simple locking and multi-command transactions - driver/tcpm/tcpi: Forward _unlocked and implicitly locked interface to fusb302 - driver/touchpad_elan: simple locking BUG=chromium:871851 BRANCH=none TEST=buildall; very careful audit TEST=grunt clamshell and Coral clamshell, test boot, battery charging, PD communication, and TCPC port low-power mode. Signed-off-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Change-Id: Ieabf22bcab42780bdb994fca3ced5d8c62519d56 Reviewed-on: https://chromium-review.googlesource.com/1169913 Commit-Ready: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* i2c: add i2c_lock before and after calling i2c_xferZhuohao Lee2018-08-071-0/+2
| | | | | | | | | | | | | | | According to the include/i2c.h, we need to call i2c_lock before and after calling i2c_xfer. This patch adds the lock to protect the i2c data transmission. BUG=none BRANCH=master TEST=make buildall -j Change-Id: If125333902105c35ca332c154bbb8012c363d1bf Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1163543 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* sweetberry: expose i2c over usbRuben Rodriguez Buchillon2018-05-212-12/+22
| | | | | | | | | | | | | | | | Expose the i2c interface through usb so that we can read power rails through servod leveraging the work being done there. BRANCH=none BUG=chromium:806148 TEST=manual testing - powerlog still works - i2c over usb using servod code works (other CLs needed) Change-Id: I48876bc4839509a397ce77376b337c37c556ae40 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1051136 Reviewed-by: Nick Sanders <nsanders@chromium.org>
* chip/stm32/usb: Replace reset handler by generic event handlerNicolas Boichat2017-08-161-1/+1
| | | | | | | | | | | | | | | | | | | Some USB interface handlers need to know when USB has been successfully resumed after a wake event. For example, this is useful so that HID keyboard can send the events at the right time. BRANCH=none BUG=b:35775048 TEST=Using USB HID keyboard patches to queue keys in a FIFO: After USB autosuspends, press a single key and hold it. Without this patch the endpoint data only gets reloaded on the _next_ event. TEST=On hammer, I2C passthrough still works. Change-Id: I9b52b9de16767c8a66c702a5ae70369334a3d590 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/569547 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add flash command support to boards with STM32F4Gwendal Grignou2017-06-031-0/+2
| | | | | | | | | | | | | | | | | | | Add support to write and erase all flash with flashrom. Add support to use all the memory. Note that PSTATE must not used its own page, as the STM32F4 use big pages. BUG=b:38018926 BRANCH=none TEST=With flashrom, write all, RO, RW regions. Use flash command on the console, including flashwp Change-Id: I4f0aee1b3a4f342bdf4ca97bf5d8e8bcc153fd9c Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/264032 Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org> Tested-by: Wei-Ning Huang <wnhuang@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* common/update_fw: Remove board-specific rw_sectionsNicolas Boichat2017-04-151-19/+0
| | | | | | | | | | | | | | | | | | | | | | rw_sections is defined in the exact same way on all common code boards, let's remove it, and hard-code the values in update_fw.c instead. Take this as an opportunity to fold set_valid_section in fw_update_start (this will be useful later on, as we also want to return the inactive region version). BRANCH=none BUG=b:35587171 TEST=make buildall -j TEST=Can update hammer over USB using usb_updater2 Change-Id: I4dd3224f17f89c1851c379255f1195dc54528b3d Reviewed-on: https://chromium-review.googlesource.com/476451 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* sweetberry: add usb power logging interfaceNick Sanders2016-11-112-3/+12
| | | | | | | | | | | | | This allows logging of power data over sweetberry BUG=chromium:608039 TEST=log power data BRANCH=None Change-Id: I6f642384cbf223959294c7bd99bca0f9206775b8 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385540 Reviewed-by: Todd Broch <tbroch@chromium.org>
* sweetberry: add usb fw updateNick Sanders2016-09-022-5/+33
| | | | | | | | | | | | | | | Port USB firmware update to stm32f4 dwc usb from st usb. This includes usb dwc usb stream inplementation, generic endpoint interfaces, and the sweetberry test case. BUG=chromium:608039 TEST=usb update works BRANCH=None Change-Id: Ia26e4f7e990ee64991468799c99b036f5f32190f Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/377520 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* sweetberry: remove superfluous gpiosNick Sanders2016-09-021-6/+9
| | | | | | | | | | | | | | | | | Sweetberry specifies UART pins as GPIOs, however this is not necessary for uart use. Let's remove these. UART4 is also dup'd with sweetberry's signal gpios, which is fixed with this CL. BUG=chromium:608039 TEST=boots BRANCH=None Change-Id: I81ee2351c0191ff5ec3d5fad37fe10866bf1ad32 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380439 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* sweetberry: add dwc usb supportNick Sanders2016-09-012-0/+64
| | | | | | | | | | | | | | | stm32f446 uses a synopsys designware USB block rather than the typical ST one. This change adds driver support for the new block, including usb console support. BUG=chromium:608039 TEST=usb console works BRANCH=None Change-Id: I0e143758ae0b5285f1c94ea2ec5aee159e22e00c Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/365448 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* sweetberry: add i2c supportNick Sanders2016-08-212-0/+28
| | | | | | | | | | | | | | | | | stm32f446 has two types of i2c blocks, the traditional stm i2c, and "fast mode plus" i2c, which need different drivers. This commit adds both, muxed in i2c-stm32f4, as the ec codebase doesn't really support multiple types of the same interface. BUG=chromium:608039 TEST=i2c works on all 4 channels BRANCH=None Change-Id: I6a9ac632f44142bd809ffee5782a192ae47af1f0 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/368358 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* sweetberry: add build target for sweetberryNick Sanders2016-08-195-0/+235
sweetberry is an stm32f446 based power monitoring board, with 48 channels of INA current sense chips BUG=chromium:608039 TEST=boots BRANCH=none Change-Id: If263bcee3a648ba3605f991999d481b7a0e2a1db Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/370718 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>