summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/svc.h
Commit message (Collapse)AuthorAgeFilesLines
* staging: greybus: Remove redundant license textGreg Kroah-Hartman2017-11-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Now that the SPDX tag is in all greybus files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: David Lin <dtwlin@gmail.com> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Acked-by: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: add SPDX identifiers to all greybus driver filesGreg Kroah-Hartman2017-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/staging/greybus files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Vaibhav Hiremath <hvaibhav.linux@gmail.com> Cc: "Bryan O'Donoghue" <pure.logic@nexus-software.ie> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com> Acked-by: David Lin <dtwlin@gmail.com> Reviewed-by: Alex Elder <elder@linaro.org> Acked-by: Johan Hovold <johan@kernel.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Greer <mgreer@animalcreek.com> Acked-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: greybus: remove timesync protocol supportGreg Kroah-Hartman2017-01-071-7/+0
| | | | | | | | | | | | | | | | | While the timesync protocol was a great idea, it never ended up getting implemented by any known hardware devices. It's also a bit "interesting" in how it ties into the platform controller. So, just remove it for now. It's not needed, no one uses it, and it's a stumbling block in getting the greybus core code merged out of the staging tree. If anyone wants it in the future, reverting this patch is a great place to start from. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alex Elder <elder@kernel.org> Acked-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* greybus: svc_watchdog: Add sysfs file to change the behavior of biteDavid Lin2016-07-261-0/+6
| | | | | | | | | | | | | | | | | Currently, AP performs unipro_reset if SVC fails to response to its ping. While this error recovery is best suited for the end-user experience, errors in the UniPro network could potentially go unnoticed by the QA and fishfooders in the development phase of the project. This patch adds an option to trigger a kernel panic so logs can be collected for analysis. Testing Done: - Reproduce issue and observe kernel panic when watchdob_control is changed to 'panic' Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: connection: drop the svc quiescing operationJohan Hovold2016-07-191-2/+0
| | | | | | | | | | | | | | | | | | | Connection tear down is being reworked, and the SVC quiescing operation is going away. Let's remove this operation now along with the coupled second ping from our intermediate tear down implementation. This both avoids unnecessary noise in the logs resulting from the fact that the SVC side of the quiescing operation was never merged, and speeds up connection tear down slightly. Testing done: Tested on EVT2 using runtime PM. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add power mode call for link hibernationDavid Lin2016-07-081-0/+1
| | | | | | | | | | | | | | | | Due to when using set_power_mode to hibernate a link, it won't trigger a POWERMODEIND event, hence the hard-coded GB_SVC_SETPWRM_PWR_OK would be returned and it should also be considered as successful result code for link hibernation. Therefore, adding this set_power_mode_hibernate function to separate the two calls in order to check with the correct result code. Testing Done: - Suspend an Interface and observe no set power mode error. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
* greybus: svc: add interface resume operationDavid Lin2016-07-081-0/+2
| | | | | | | | | | | Add the AP implementation for the Greybus SVC Interface Resume Operation. This operation allows the AP to request the SVC to resume an Interface which was previously SUSPENDED, allowing it to later be ENUMERATED. Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
* greybus: svc: remove input device handling in SVC protocolSandeep Patil2016-06-281-2/+0
| | | | | | | | | | | | | | The input device was added before to handle the key(s) connected directly to SVC, which is not the case anymore. So, this change removes the gb_svc_key_event() operation and the corresponding input device code with it. Testing Done: Boot tested and tried module insert/removal through AraManager Change-Id: Iaa541d4aefb5c0ed16caaa39450029de35d7c228 Signed-off-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: update UniPro Set Interface Power Mode operation to match specEli Sennesh2016-06-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Bring the gb_svc_intf_set_power_mode() up-to-date with the current Greybus specification. This largely involves adding more members to the structure sent across the wire. Also change the camera code to use the new operation properly, with default values passed for the new necessary arguments. The correctness of these default values is confirmed via testing and by asking Rob Johnson. We must make sure to zero the request structure sent across the wire, lest bite us most cruelly, and we fix by changing the Set Power Mode Response structure to use a __u8 rather than a __le16. Testing Done: Took a picture with a camera module, received error code when passing deliberately incorrect values for new parameters, got proper -EIO and Greybus result code printed when operation stopped halfway through. Could induce error by initializing request struct with random nonsense, and can stop it by initializing request struct with zeroes. Associated Firmware Changes: 1669-1671 on Android N Gerrit for SW-2945 Signed-off-by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add stub connection-quiescing operationJohan Hovold2016-05-271-0/+2
| | | | | | | | | Add stubbed out connection-quiescing operation that is needed for proper connection tear down. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: Revert "update UniPro Set Interface Power Mode operation to match spec"Jeffrey Carlyle2016-05-251-4/+1
| | | | | | | | | | This reverts commit 29fee8c55b59bb6ac59b99a0563c89c514cba42b. This change and its companion NuttX changes seem to be triggering a storm of POWERMODEIND switch interrupts on the SVC. Signed-off-by: Jeffrey Carlyle <jcarlyle@google.com> Acked-by: Sandeep Patil <sspatil@google.com>
* greybus: update UniPro Set Interface Power Mode operation to match specEli Sennesh2016-05-241-1/+4
| | | | | | | | | | | | | | | | | | | | | Bring the gb_svc_intf_set_power_mode() up-to-date with the current Greybus specification. This largely involves adding more members to the structure sent across the wire. Also change the camera code to use the new operation properly, with default values passed for the new necessary arguments. The correctness of these default values is confirmed via testing and by asking Rob Johnson. Testing Done: Took a picture with a camera module, received error code when passing deliberately incorrect values for new parameters, got proper -EIO and Greybus result code printed when operation stopped halfway through. Associated Firmware Changes: 6810-6812 on Gerrit for SW-1239, 6870 and 5612-5613 on Gerrit for SW-2945 Signed-off-by: Eli Sennesh <esennesh@leaflabs.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: Add TimeSync SVC commandsBryan O'Donoghue2016-05-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simple addition of the TimeSync commands defined in the specification. Adds: - svc.c::timesync_enable(u8 count, u64 frame_time, u32 strobe_delay, u32 refclk) Commands the SVC to initiate count TimeSync strobe pulses with strobe_delay microseconds delay between each strobe to the specified bit-mask of Interface IDs indicated in a previous timesync_wake_pins_acquire command. The frame_time parameter indicates the initial time the SVC should base the first strobe from. The refclk parameter indicates the APs clock rate, the SVC should ensure its own clock ticks at this rate. Once enabled the SVC may not enter a low-power mode which will result in the reference timer used to track time switching off. The SVC will capture the authoritative FrameTime at each strobe and store these values for later propagation to the AP with the timesync_authoritative request. - svc.c::timesync_disable(void) Commands the SVC to immediately halt TimeSync logic. This will allow the SVC to transition into low-power modes where the reference timer being used for TimeSync may switch off. - svc.c::timesync_authoritative(u64 *frame_time) Used by the AP Module to ask the SVC for the authoritative FrameTime as captured at each TimeSync strobe. - svc.c::timesync_ping(u64 *frame_time) Used by the AP Module to command the SVC to initiate a single strobe on a specified bit-mask of Interface IDs communicated in a previous timesync_wake_pins_acquire command. SVC will latch the FrameTime on the rising edge of the outbound pulse and will return the FrameTime to the AP Module in the response phase of the greybus transaction. - svc::timesync_wake_pins_acquire(u32 strobe_mask) Used by the AP to tell the SVC to set a bit-mask of wake lines associated with a bit-mask of Interface IDs to a known initial state prior to the SVC generating a TimeSync related pulse such as timesync-enable or timesync-ping. - svc::timesync_wake_pins_release(void) Used by the AP to tell the SVC to release all wake-detect lines in the timesync active state as previously specified in the timesync_wake_pins_acquire operation. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: clean up gb_svc struct for pwrmonDavid Lin2016-04-251-2/+0
| | | | | | | | | | | | | | The power rail names and counts are unnecessarily stored in the gb_svc structure once the SVC created, this causes waste of memory usage. This patch removes rail names and rail counts storage from th gb_svc structure. Testing Done: - Validated the readings from /d/greybus/1-svc/pwrmon/* Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add stub interface-activate functionJohan Hovold2016-04-251-0/+1
| | | | | | | | | Add message structures (based on the current spec) for the SVC Interface Activate operation, and a stub function that always return the Greybus interface type. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add stub functions for v_sys, refclk and uniproJohan Hovold2016-04-251-0/+3
| | | | | | | Add stub functions for v_sys, refclk and unipro resource management. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add AP power measurements debugfs supportDavid Lin2016-04-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the AP Power Monitor functions to read out all the rails power information monitored by the SVC. Testing Done: - $ cat /d/greybus/1-svc/pwrmon/*/* and validate the output with the svc stub power monitor functions - $ tree /d/greybus/1-svc/pwrmon | | | |---pwrmon | | | | |---DUMMY_RAIL_1 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_2 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_3 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now | | | | |---DUMMY_RAIL_4 | | | | | |---current_now | | | | | |---power_now | | | | | |---voltage_now Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add Interface power measurements supportDavid Lin2016-04-071-0/+2
| | | | | | | | | | | | | | | | | | | This change implements the AP Power Monitor functions for obtaining current/voltage/power on a specific rail of an Interface. Testing Done: $ cat /sys/bus/greybus/devices/1-3/current_now 103 $ cat /sys/bus/greybus/devices/1-3/power_now 303 $ cat /sys/bus/greybus/devices/1-3/voltage_now 203 Signed-off-by: David Lin <dtwlin@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: Revert "Added a sysfs entry to power down the SVC"Akash Choudhari2016-04-011-1/+0
| | | | This reverts commit a1d8f2c3856804ed26157104bb203edf4c882a6c.
* greybus: Added a sysfs entry to power down the SVCGeorgi Dobrev2016-04-011-0/+1
| | | | | | | | | | Added a sysfs entry called pwr_off. When a "1" is passed to it, it sends a GB_SVC_TYPE_PWR_DOWN command to the SVC, powering it down along with the switch and INA231 chips. Testing Done: Tested on EVT1_5, works. Signed-off-by: Georgi Dobrev <dobrev_georgi@projectara.com>
* greybus: interface: move route creation to interface activationJohan Hovold2016-03-301-0/+4
| | | | | | | | | | | | Creating and destroying a route to an interface is arguably an interface operation and belongs with the interface code. Add new interface_activate and interface_deactivate helpers that will be used to activate and deactivate an interface in the new interface boot sequence. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: indent CPort flag defines properlyJohan Hovold2016-03-301-3/+3
| | | | | | | Use tabs to indent CPort-flag values. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: remove bogus interface-reset helperJohan Hovold2016-03-301-1/+0
| | | | | | | | | Remove unused, bogus interface-reset helper. The interface-reset operation is initiated by the SVC, not the AP. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: core: fix two container-of macrosJohan Hovold2016-03-301-1/+1
| | | | | | | | Fix two greybus container-of macros that used the pointer name for the member. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: connection: generalise CPortFlags handlingJohan Hovold2016-03-041-1/+5
| | | | | | | | | | | | | Generalise the svc connection-create helper to accept a cport-flags argument and handle the flags in the connection code instead. Note that the camera driver currently manages its data connection directly. We keep E2EFC enabled for now even though it will soon need to be disabled due to some pending firmware updates. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc watchdog: allow it to be enabled/disabled from userspaceGreg Kroah-Hartman2016-01-261-0/+3
| | | | | | | | | Sometimes you want to disable the SVC watchdog without having to patch your kernel, so provide a sysfs file to do this. This can let us do power measurements, and let the firmware developers not go crazy worrying that the kernel is going to reset their chips with no notice. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add a "watchdog" to check the network healthGreg Kroah-Hartman2016-01-231-0/+5
| | | | | | | | | | | | Now that we have a svc ping command, let's add a watchdog to call it every so often (1 second at the moment.) If it finds something went wrong, post a stern message to the kernel log and call: start unipro_reset to reset the whole greybus hardware subsystem. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add ping commandGreg Kroah-Hartman2016-01-211-0/+1
| | | | | | | | | | This implements the SVC "ping" command. It's tiny and simple, but we need something like this in order for us to "know" if all is working well. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add key event handlingRui Miguel Silva2016-01-201-0/+3
| | | | | | | | | | | | Add a new input device associated with the SVC to handle key events. This new events are transfer over a new greybus svc operation which is unidirectional. It was selected the KEY_A for representing the KEY_ARA_BUTTON key code. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: store protocol versionJohan Hovold2016-01-191-0/+3
| | | | | | | | | | | | Store the "negotiated" protocol version to use in the svc state struct instead of the connection struct. The generic concept of a connection version is going away in favour of bundle-class versions. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: add interface eject operationRui Miguel Silva2016-01-121-0/+1
| | | | | | | | | Add a new svc operation which will be used to send a request to eject a given interface. Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Reviewed-by: Jeffrey Carlyle <jcarlyle@google.com>
* greybus: svc: Replace link config hack with standard operationLaurent Pinchart2016-01-081-3/+4
| | | | | | | | | The link config operation was a hack only designed to fulfill the camera driver's needs. Now that a standard operation is defined for the same purpose, implement it and remove the hack. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: Add support for the link config operationLaurent Pinchart2015-12-211-0/+3
| | | | | Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: create svc along with host deviceJohan Hovold2015-12-081-0/+5
| | | | | | | | | | | | | Create svc device along with host-device and move the svc-connection to the svc structure. The svc connection is enabled when registering the host device, but as the SVC protocol is currently driven by the SVC, we need to defer registration of the svc device to the connection request handler. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: core: add bus id to ueventsJohan Hovold2015-12-031-0/+1
| | | | | | | | | | Add the bus id to all greybus uevents. This is needed to identify devices that are being removed (e.g. at hot-unplug). Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: fix racy hotplug handlingJohan Hovold2015-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | Fix racy hotplug handling by serialising all processing of hot-plug and unplug requests using a single-threaded dedicated workqueue. This fixes a reported crash during enumeration when processing multiple events. The current svc implementation does not handle concurrency at all (e.g. no interface list lock or refcounting) so we need to use the big hammer for now. Note that we will eventually want to process events for different interfaces in parallel, but that we'd still need a workqueue in order not to starve other svc requests (e.g. for timesync). Reported-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: hd: fix svc-connection handlingJohan Hovold2015-11-251-2/+0
| | | | | | | | | | | | | | | | | Create the svc connection when registering the host-device and remove the current svc connection hacks that "upgraded" the svc connection once the endo id and ap interface id was known. Note that the old implementation was partly based on a misunderstanding as it was the remote interface id, rather than the local AP interface id, that used to define a connection (but we also needed the endo_id). The remote interface is no longer needed as static connections, such as the svc connection, are now simply defined by the host-device and host cport id. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: move endo id and ap interface id to svcJohan Hovold2015-11-251-0/+3
| | | | | | | | | | Move endo_id and AP interface id to the svc device. The endo abstraction is about to be removed, and these attributes are arguable attributes of the svc anyway. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: register svc device at helloJohan Hovold2015-11-251-1/+14
| | | | | | | | | | Register the svc device upon reception of the HELLO request. The SVC HELLO request contains the endo id and AP interface id, which will be exposed from the svc device rather than the endo. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: hd: rename host-device structureJohan Hovold2015-11-041-2/+2
| | | | | | | | | Rename host-device structure gb_host_device to match our other structures. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: skip setting flags for boot over uniproViresh Kumar2015-10-091-1/+1
| | | | | | | | | | | | | We need to skip setting E2EFC and other flags to the SVC connection create request, for all cports, on an interface that need to boot over unipro, i.e. interfaces required to download firmware. This also adds a FIXME as we need to do it differently for ES3. Tested-by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off by: Eli Sennesh <esennesh@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: Implement DME peer get/set attributes helpersViresh Kumar2015-09-141-0/+4
| | | | | | | | | These are required to get/set DME attributes of the modules. This is implemented based on the greybus specifications. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: unexport few internal functionsViresh Kumar2015-09-031-1/+0
| | | | | | | | | There are no external users of these, and probably would never be. Make them static. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
* greybus: svc: No need to return errors from [gb_]svc_connection_destroy()Viresh Kumar2015-09-031-2/+2
| | | | | | | | | | | | These routines are responsible to destroy a connection that is going away, the return value is of no use. At best, print an error message to show that we got an error. Make their return type void. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
* greybus: svc: remove interface->svc pointerViresh Kumar2015-07-241-6/+1
| | | | | | | | | Its not updated/used anymore, remove it. Also move back the struct gb_svc to svc.c as its not referenced by external users anymore. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Perry Hung <perry@leaflabs.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: Add helpers to create AP<->SVC connectionViresh Kumar2015-07-221-0/+3
| | | | | | | | | | | | | | | | | | SVC connection is required before the AP knows its position on the endo and type of endo. To enable message processing between the AP and SVC at this time, we need a partially initialized connection which can handle these messages. Once the AP receives more information from the SVC, it can discard this partially initialized connection and create a proper one, tied to a bundle and interface. Destroying the partially initialized connection is a bit tricky, as it is required to send a response to svc-hello. That part will be properly fixed separately. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: save pointer to struct gb_svc in struct gb_interfaceViresh Kumar2015-07-081-1/+6
| | | | | | | | | Its another special protocol (just like control protocol) and is required to be accessed from other files, lets save a pointer to it in interface structure. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: svc: SVC is part of greybus coreViresh Kumar2015-07-081-0/+2
| | | | | | | | Its an essential part of greybus core and shouldn't be present as a separate module. Make it part of greybus.ko module. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* greybus: introduce SVC protocolAlex Elder2015-05-231-0/+22
This patch adds support for the Greybus SVC protocol. We may want to rearrange protocol numbers at some point, since this is a pretty fundamental protocol. Note: It has only been compile tested; no SVC CPorts have yet been defined, so this code is not yet exercised. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
OpenPOWER on IntegriCloud