]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
greybus: svc: Add TimeSync SVC commands
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 12 May 2016 11:43:50 +0000 (12:43 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 14 May 2016 16:26:24 +0000 (18:26 +0200)
commit5705020fbe2a274a1a49709e688b4cc471425036
treebfb07febd84e31241debf29df1050f5a8a29092b
parenta974f469ff097f8f6e242f3ef5b26ba3604fbaf2
greybus: svc: Add TimeSync SVC commands

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>
drivers/staging/greybus/svc.c
drivers/staging/greybus/svc.h