Commit graph

21 commits

Author SHA1 Message Date
Bryan O'Donoghue a5192032a2 greybus: uart: fix typo in defintion
Fixing needless redefinition of operation types in gbsim reveals this typo
GB_UART_TYPE_SET_BREAK -> GB_UART_TYPE_SEND_BREAK. This patch should be
applied in lock-step to the patch to gbsim 'gbsim/uart: remove unnecessary
redefinition of operation types' since gbsim does not contain the typo.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-14 15:59:54 -07:00
Bryan O'Donoghue 52af141b82 greybus: loopback: fix broken tabs in greybus_protocols.h
Copy/paste of code from one file to another missed inappropriate use of tab
after define.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-13 17:08:06 -07:00
Bryan O'Donoghue 384a7a3c4f greybus: loopback: add sink to loopback protocol
Loopback sink command will operate as an amalgam of the ping and tranfer
operations. Sink will send an ACK'd variable size operation over greybus.
Unlike the transfer type which transmits the received data back, the sink
type will simply ACK without sending the received data back.

This patch adds the kernel side of the sink command.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-13 15:42:01 -07:00
Bryan O'Donoghue f9f971a2e5 greybus: loopback: Move loopback operation definitions
In order to have one point of type definition for gbsim move the loopback
operation definitions to greybus_protocols.h.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-13 15:42:01 -07:00
Rui Miguel Silva ef0cc0ec8d greybus: sdio: split cmd_flags to there meaning
Instead of using values in the command cmd_flags field use the real
flags in a bit mask.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-07-06 11:15:42 -07:00
Bryan O'Donoghue ba4b099ca8 greybus: uart: Update UART to reflect field size changes
The greybus UART protocol specification was updated to reduce the size of
the control field in serial-state-request and line-state-request. This
patch updates the kernel protocol driver to reflect the specification
changes. Once applied gbsim changes will be also be updated automatically
since gbsim depends on the header being modified directly.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-30 19:34:47 -07:00
Bryan O'Donoghue 802362d4a6 greybus: uart: Relocate UART parity/overrun/framing/break signals
Parity/overrun/framing and break signals have been moved to the
receive-data message to more easily associate the signals with the TTY API.
Update the definitions in the protocol header and add a flags field to the
receive-data structure to facilitate transmission of those signal with the
receive-data message.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-30 19:34:47 -07:00
Phong Tran 153f4784b4 greybus: sdio: remove the redefine of sdio major and minor
The macro of sdio version major and minor is defined twice.
This patch remove the redundant one.

Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-29 18:06:08 -07:00
Viresh Kumar cdee4f7505 greybus: Add control protocol support
Add control protocol driver that is responsible for handling operations
on control CPort. The AP also needs to support incoming requests on its
control port. Features not implemented yet are marked as TODO for now.

NOTE: This also fixes cport-bundle-id to 0 and cport-id to 2 for control
protocol.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-23 23:16:15 -07:00
Rui Miguel Silva 3b6ecd6de6 greybus: sdio: extend sdio implementation
Extend sdio implementation, as it for now it was basically stubs.

This implementation is compile tested only since there is no fw or
simulation support yet.
Next step is to add sdio support to gbsim and test it with success
using the mmc_test facility.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-23 23:13:41 -07:00
Bryan O'Donoghue cdb5781d9f greybus: uart: Fix sparse warning
Greg reported sparse picked up the following warning:
/home/gregkh/ara/greybus/uart.c:105:34: warning: cast to restricted __le16

This is due to the control variable in gb_uart_serial_state_request which
needs to be declared __le16 not __u16.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reported-by: Greg Kroah-Hartman <gregkh@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-19 16:35:44 -07:00
Bryan O'Donoghue 11fca140c9 greybus: uart: Tidy naming convention to more closely match spec
Update tabs and naming of structures to match the naming used in the greybus
specification more closely.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-04 14:05:48 +09:00
Bryan O'Donoghue 4ef53485c3 greybus: uart: Move UART protocol structs/defines to greybus_protocols.h
gbsim depends on the structures and defines in greybus_protocols.h
generally in order to simulate firmware. Move UART defines into this
header to facilitate.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-06-04 14:05:48 +09:00
Johan Hovold 7ba864a19f greybus: gpio: add irq-type defines
Add Greybus GPIO IRQ-type defines rather than rely on the current
Linux implementation.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-28 14:48:30 -07:00
Johan Hovold 4bf3780982 greybus: gpio: remove unused debounce define
Remove unused debounce define from protocol header.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-28 14:48:14 -07:00
Alex Elder 012d7d4fbe greybus: greybus_protocols: fix guard tag
I neglected to update the "#ifndef/#define" when I renamed
"greybus_protocols.h".  Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-28 14:04:08 -07:00
Johan Hovold 47bf0b4427 greybus: gpio: update operation types
Update the remaining operation types now that the ack operation is gone
to avoid leaving a hole in the type definitions.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-28 14:02:13 -07:00
Johan Hovold 1409c4d6a8 greybus: gpio: fix interrupt protocol
The current interrupt implementation uses the simple irq-flow handler,
which means that the interrupt subsystem makes no irq-chip callbacks
when handling an interrupt. Specifically, no end-of-interrupt message is
sent when the threaded handler has run. This means that we may currently
re-enable an interrupt before it has been serviced (i.e. the irq-event
operation may complete before the threaded handler has run).

The simple flow handler also silently drops a second interrupt arriving
while a handler is running. This means that we may lose a second edge
interrupt with the current firmware.

Switch to a new one-shot interrupt protocol, where the primary handler
(firmware) always masks and acks an interrupt before sending an event to
the AP. The AP is responsible for unmasking the interrupt when it has
been handled. By having the firmware ack an edge interrupt before
sending the event, a second edge interrupt will no longer get lost.

This one-shot protocol can be implemented in the kernel by using the
level irq-flow handler, one-shot interrupts with threaded handlers and
bus-lock synchronisation for slow buses. Note that the same flow handler
is used for both edge and level interrupts.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-26 15:27:39 -07:00
Johan Hovold b8e3ffebac greybus: gpio: remove unused irq-ack operation
Remove unused irq-ack operation, which has never been called and does
not make sense for message-signalled interrupts over slow buses.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-26 15:25:17 -07:00
Alex Elder 30c6d9d753 greybus: introduce SVC protocol
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>
2015-05-23 16:54:39 -07:00
Alex Elder 22e17edaa7 greybus: rename "gpbridge.h"
The file "gpbridge.h" is now used as a single place to define
all protocol message structures.  These protocols are not
necessarily related to the GP bridge, so the name of the
file is misleading.

Rename it "greybus_protocols.h".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-05-23 16:34:50 -07:00
Renamed from drivers/staging/greybus/gpbridge.h (Browse further)