summaryrefslogtreecommitdiff
path: root/driver/mcdp28x0.c
Commit message (Collapse)AuthorAgeFilesLines
* chip/stm32/usart: Add flags to usart_configNicolas Boichat2017-10-181-0/+1
| | | | | | | | | | | | | Allows setting TXINV/RXINV bits. BRANCH=none BUG=b:65697962 TEST=make BOARD=wand -j Change-Id: Ib1bb290cd9758c53b98c8fc1ca1a9369c8cff39e Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/694561 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* cleanup: DECLARE_CONSOLE_COMMAND only needs 4 argsBill Richardson2016-08-241-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since pretty much always, we've declared console commands to take a "longhelp" argument with detailed explanations of what the command does. But since almost as long, we've never actually used that argument for anything - we just silently throw it away in the macro. There's only one command (usbchargemode) that even thinks it defines that argument. We're never going to use this, let's just get rid of it. BUG=none BRANCH=none CQ-DEPEND=CL:*279060 CQ-DEPEND=CL:*279158 CQ-DEPEND=CL:*279037 TEST=make buildall; tested on Cr50 hardware Everything builds. Since we never used this arg anyway, there had better not be any difference in the result. Change-Id: Id3f71a53d02e3dc625cfcc12aa71ecb50e35eb9f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/374163 Reviewed-by: Myles Watson <mylesgw@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* USART: Add flexibility needed to support DMAAnton Staaf2015-07-151-6/+7
| | | | | | | | | | | | | | | | | | | | | | In order to support DMA transfers in one or both directions the usart driver needs to be configurable with producer/consumer operations and interrupt handler functions. These are now packaged up in the usart_rx and usart_tx structs, and versions for interrupt driven RX and TX are provided. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I3fd14c675c90873e903195b8e20d2070d2eda5ac Reviewed-on: https://chromium-review.googlesource.com/285023 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
* mcdp28x0: Add more useful error codes.Todd Broch2015-06-111-31/+50
| | | | | | | | | | | | | | BRANCH=samus BUG=none TEST=compiles Signed-off-by: Todd Broch <tbroch@chromium.org> Change-Id: Id925acbafcb49dbf503f666a7edb79b7eb25fecd Reviewed-on: https://chromium-review.googlesource.com/276554 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
* Stream: Remove in_stream/out_stream interfaceAnton Staaf2015-06-111-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The in_stream and out_stream interfaces were a first attempt at providing an abstraction for multiple stream like devices (usart, USB, I2C/LPC host interfaces...). But, by baking the queue into the device it proved to be hard to use and required additional resources (task or deferred hook) to handle passing data from one stream to another. Since then the queue policy and producer/consumer interfaces have replaced the stream interfaces. This CL removes the old stream interfaces and updates the only users (deleting the test echo code from the discovery-stm32f072 board and updating the mcdp28x0 driver to use the queue interfaces). Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: Ic0d2abf81eafc4fb2e61172540151f2d0ba45caf Reviewed-on: https://chromium-review.googlesource.com/276163 Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
* mcdp28x0: Use custom appstest command for get_infoTodd Broch2015-05-301-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firmware's original get_info command always returns the same values for family, chipid, irom & fw despite indeed having different versions. Currently its: family:000e chipid:0001 irom:1.0.0 fw:0.0.0 As we have a new stepping of the chip ('BB') and a corresponding new firmware (>=0.74) we need a mechanism to verify and log this change. CL uses the newly hatched appstest command (0x12) message 0x28 to surface information that properly reflects both hardware and firmware running. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:35939 TEST=manual, For devices running 0.54 | 0.74 fw see gpio MCDP_READY asserted. With CONFIG_CMD_MCDP in board/hoho/board.h see the following responses when executing 'mcdp info' Stepping | FW | Response -------------------------------------------------------------------- 'BA' 0.53 fails as expected 'BA' 0.54 family:0010 chipid:2850 irom:2.0.0 fw:0.54.0 'BB' 0.73 fails as expected 'BB' 0.74 family:0010 chipid:2850 irom:2.1.0 fw:0.74.0 Change-Id: I2c36393a298c617f903389dab24da631b60ec574 Reviewed-on: https://chromium-review.googlesource.com/274049 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
* mcdp28x0: add appstest console command.Todd Broch2015-05-301-1/+61
| | | | | | | | | | | | | | | | Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:35939 TEST=manual, with CONFIG_CMD_MCDP in board/hoho/board.h Try appstest commands on hoho and see them work. Change-Id: I0b3f674251f0d7c68ba4958fd3376b7c8d81b13f Reviewed-on: https://chromium-review.googlesource.com/272792 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
* Producer/Consumer: Refactor to use Queue policiesAnton Staaf2015-05-261-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the Producer and Consumer interfaces tracked the Consumer and Producer respectively at the other end of the queue that they interacted with. This was done to avoid modifying the queue implementation, but resulted in a rougher interface that required additional initialization steps and prevented alternative configurations; many producers and one consumer for example. This commit uses the new queue policies to track this information. The new direct policy behaves as the old producer and consumers did. Now the producers and consumers are just named references to the queue that they work on and a convenient location for a notification callback when the queue is updated in a way that is relevent to the producer or consumer. All users of Producer and Consumer have been updated including the stream adaptors which are in use by the echo test code and the mcdp28x0 driver. Use of the stream adaptors has also been simplified. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Manual testing of Ryu (P5) and discovery board echo task Change-Id: I704be6378a31b4e20f5063295eff9943e4900409 Reviewed-on: https://chromium-review.googlesource.com/271792 Reviewed-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
* Queue: Add policies to queuesAnton Staaf2015-05-261-2/+2
| | | | | | | | | | | | | | | | | | | | Policies give a convenient place to hook into the queue operations and notify something that there is new space free in the queue or new units added. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Change-Id: I94b2aa94b8e8d07911191bc19a39fa827623b117 Reviewed-on: https://chromium-review.googlesource.com/271791 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org> Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org>
* mcdp28x0: Add devid console command.Todd Broch2015-05-221-6/+37
| | | | | | | | | | | | | | | | | | BRANCH=samus BUG=chrome-os-partner:35939 TEST=manual, with CONFIG_CMD_MCDP in board/hoho/board.h > mcdp devid 0 devid[0] = BOBCAT > mcdp devid 1 devid[1] = ST > mcdp devid 2 devid[2] = IROM Change-Id: I82938975be55bb924ced06e9d0a35f03dc47ae99 Signed-off-by: Todd Broch <tbroch@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/272693 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* mcdp28x0: Add info console command.Todd Broch2015-05-221-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | Would be useful to expose more of the GProbe commands to developers who have access to boards console (hoho, honeybuns). This CL adds a console command and seeds it the 'mcdp info' command. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:35939 TEST=manual, with CONFIG_CMD_MCDP defined in board/hoho/board.h - Enter info console command multiple times and see correct return value. mcdp info family:000e chipid:0001 irom:1.0.0 fw:0.0.0 Change-Id: Iaf2c088d5da1af7b2dab11abcfb6e32e289066ea Reviewed-on: https://chromium-review.googlesource.com/272692 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
* mcdp28x0: Add checksum verification to rx_serial.Todd Broch2015-05-221-11/+19
| | | | | | | | | | | | | | Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:35939 TEST=compiles, MCDP_READY gpio still asserted. Change-Id: If20a695380dc44d899951faeaa805bf7acfae1e1 Reviewed-on: https://chromium-review.googlesource.com/272691 Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
* Producer/Consumer: Convert USART and USB Stream driversAnton Staaf2015-03-021-8/+18
| | | | | | | | | | | | | | | | | | | | | | | Previously the USART and USB Stream drivers exposed in_stream and out_stream interfaces, which don't allow for sharing their queues easily. This change converts these drivers over to the producer/consumer model and updates the two uses. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=None BUG=None TEST=make buildall -j Verify that the discovery echo functionality is unchanged. Change-Id: I29f043ab1712373f638e1621378df98647d736cf Reviewed-on: https://chromium-review.googlesource.com/252820 Trybot-Ready: Anton Staaf <robotboy@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
* mcdp28x0: Move structure definitions to ec_commands.hShawn Nematbakhsh2015-01-311-0/+1
| | | | | | | | | | | | | | mcdp_info is a logging payload, so related structures need to be moved to the public include file. BUG=chrome-os-partner:35935 TEST=make buildall -j BRANCH=Samus Change-Id: Idb939db884821fa85faafbfe643e713f5bcdbc59 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/244780 Reviewed-by: Alec Berg <alecaberg@chromium.org>
* pd: hoho: mcdp28x0 serial driver.Todd Broch2014-12-231-0/+149
Add initial serial driver for mdcp2850 dp->hdmi converter. Driver implements 'get information' (cmd:0x40) to provide rudimentary method to test mcdp for functionality and assert GPIO if successful. Future CLs may expose more serial functionality if necessary. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:34122 TEST=manual, when compiles with #define MCDP_DEBUG see successful serial communication and result from get info. buf:[00]0x04 [01]0x40 [02]0x00 [03]0xbc ... buf:[00]0x0f [01]0x40 [02]0x00 [03]0x0e [04]0x00 [05]0x01 [06]0x01 [07]0x00 [08]0x00 [09]0x00 [10]0x00 [11]0x00 [12]0x00 [13]0x00 family:000e chipid:0001 irom:1.0.0 fw:0.0.0 Change-Id: I35f9d9b0437633d1bd6a6c9fa14413bedb12f5c2 Reviewed-on: https://chromium-review.googlesource.com/235930 Trybot-Ready: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org>