Greybus
Greg Kroah-Hartman
1
Linaro
Leaflabs
BayLibre
Google
Linux Foundation
Acknowledgments
2
Familiar high-level semantics from Internet and other networks...
● Send and receive messages of arbitrary size
● Automatic in order delivery
… but sophisticated underpinnings
● Mature and robust technology stack
● Leverages existing high-speed PHY
● Low-power modes
● Low latency
● QoS features
Mobile-friendly basis for other peripheral communication
● UniPro-based camera standard: CSI-3
● UniPro-based flash storage standard: UFS
UniPro is easy to use
3
UniPro provides bidirectional connections for data transfer
UniPro Switch
Module C
Module A Module B
UniPro connections are established
between modules.
Multiple connections between
modules are possible.
4
UniPro Switch
Module C
Module A Module B
Each UniPro port on a module establishes a
link with a corresponding port on a UniPro
switch in the Endo. A “Device ID” (like an IP
address) in each packet identifies the
destination module.
Each UniPro connection (red, yellow, and
purple) has two “CPort IDs” (like port
numbers), one for each module.
UniPro packets contain destination CPort
IDs, which identify the packet’s
associated connection.
UniPro provides bidirectional connections for data transfer
5
UniPro key features and non-features
Features
● Multiple independent bidirectional
connections between endpoints
● Reliable, in order transmission and
reception of datagrams
● Error handling
● Credit-based flow control
● Traffic prioritization
Non-Features
● Stream transmission and reception
(datagrams only)
● Multicast (endpoint-to-endpoint only)
6
UniPro strictly adheres to OSI layering
DME
Transport
Network
L1
Link
PHY Adapter
L4
L3
L2
L1.5
Physical
Bidirectional datagram connections, L4 flow control
Device and network routing
Framing, error handling, flow control, traffic prioritization
Link initialization, control, and management, other functions
Physical medium
L5+: Application specific protocols. Not part of UniPro; we are defining these for Project Ara.
7
Greybus
An application layer for Unipro
8
Greybus protocol
● Device discovery and description
● Network routing and housekeeping
● Class protocols
9
Device description
A Manifest describes the device to the system.
Examples of this information:
● Vendor and Product ID
● Serial Number
● “Bundles”
● Protocols used
10
Module X
Modules Interfaces CPorts Bundles
11
Interface 1
Modules Interfaces CPorts Bundles
Interface 0
Module X
12
Interface 1
Module X
Modules Interfaces CPorts Bundles
Interface 0 CPort 0 CPort 0
13
Interface 1
Module X
Interface 0
Modules Interfaces CPorts Bundles
CPort 1
CPort 2
CPort 3
CPort 4
Bundle 0 Bundle 1 Bundle 0
CPort 1CPort 5
CPort 0CPort 0
14
Operations
● RPC-like way to talk to an interface
● Request / Response communication
15
Operations
● RPC-like way to talk to an interface
● Request / Response communication
int get_version(char *major, char *minor);
int vibrator_on(short timeout_ms);
16
Protocol classes
17
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
18
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
In progress
● Audio
● Input (HID)
● Sensors
● Camera
19
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
In progress
● Audio
● Input (HID)
● Sensors
● Camera
Later
● Wifi
● Bluetooth
● Cellular modem
● GPS
● Lights
● Display
20
Bridged PHY protocols
● SPI
● SDIO
● UART
● PWM
● USB
● I2
C
● I2
S
● GPIO
21
“Tunneled” protocols
● CSI
● DSI
22
github.com/projectara/greybus
Linux kernel implementation
23
Supervisor control, Module Manifest, Power Management,
EPMs, RF Bus, Driver Core Integration, Sysfs
Greybus Subsystem
Kernel
Greybus Core
24
Supervisor control, Module Manifest, Power Management,
EPMs, RF Bus, Driver Core Integration, Sysfs
AP Bridge
host controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Native UniPro
host controllers
25
Sensors
Supervisor control, Module Manifest, Power Management,
EPMs, RF Bus, Driver Core Integration, Sysfs
Native UniPro
host controllers
AP Bridge
host controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Camera
(CSI-3)
V4L2 iio
Power
Subsystem
Battery
...
Class
Drivers
26
Sensors
Supervisor control, Module Manifest, Power Management,
EPMs, RF Bus, Driver Core Integration, Sysfs
Native UniPro
host controllers
AP Bridge
host controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Camera
(CSI-3)
V4L2 iio
Power
Subsystem
Battery
...
USBBridged
PHY Driver
USB
Subsystem
I2C
Subsystem
I2C
...
Class
Drivers
27
Linux kernel - Bridged-PHY support
● USB devices “just work”
● UART devices “just work”
● Userspace access provided for rest
● Existing kernel drivers need 20 lines added
28

Kernel Recipes 2015: Greybus

  • 1.
  • 2.
  • 3.
    Familiar high-level semanticsfrom Internet and other networks... ● Send and receive messages of arbitrary size ● Automatic in order delivery … but sophisticated underpinnings ● Mature and robust technology stack ● Leverages existing high-speed PHY ● Low-power modes ● Low latency ● QoS features Mobile-friendly basis for other peripheral communication ● UniPro-based camera standard: CSI-3 ● UniPro-based flash storage standard: UFS UniPro is easy to use 3
  • 4.
    UniPro provides bidirectionalconnections for data transfer UniPro Switch Module C Module A Module B UniPro connections are established between modules. Multiple connections between modules are possible. 4
  • 5.
    UniPro Switch Module C ModuleA Module B Each UniPro port on a module establishes a link with a corresponding port on a UniPro switch in the Endo. A “Device ID” (like an IP address) in each packet identifies the destination module. Each UniPro connection (red, yellow, and purple) has two “CPort IDs” (like port numbers), one for each module. UniPro packets contain destination CPort IDs, which identify the packet’s associated connection. UniPro provides bidirectional connections for data transfer 5
  • 6.
    UniPro key featuresand non-features Features ● Multiple independent bidirectional connections between endpoints ● Reliable, in order transmission and reception of datagrams ● Error handling ● Credit-based flow control ● Traffic prioritization Non-Features ● Stream transmission and reception (datagrams only) ● Multicast (endpoint-to-endpoint only) 6
  • 7.
    UniPro strictly adheresto OSI layering DME Transport Network L1 Link PHY Adapter L4 L3 L2 L1.5 Physical Bidirectional datagram connections, L4 flow control Device and network routing Framing, error handling, flow control, traffic prioritization Link initialization, control, and management, other functions Physical medium L5+: Application specific protocols. Not part of UniPro; we are defining these for Project Ara. 7
  • 8.
  • 9.
    Greybus protocol ● Devicediscovery and description ● Network routing and housekeeping ● Class protocols 9
  • 10.
    Device description A Manifestdescribes the device to the system. Examples of this information: ● Vendor and Product ID ● Serial Number ● “Bundles” ● Protocols used 10
  • 11.
    Module X Modules InterfacesCPorts Bundles 11
  • 12.
    Interface 1 Modules InterfacesCPorts Bundles Interface 0 Module X 12
  • 13.
    Interface 1 Module X ModulesInterfaces CPorts Bundles Interface 0 CPort 0 CPort 0 13
  • 14.
    Interface 1 Module X Interface0 Modules Interfaces CPorts Bundles CPort 1 CPort 2 CPort 3 CPort 4 Bundle 0 Bundle 1 Bundle 0 CPort 1CPort 5 CPort 0CPort 0 14
  • 15.
    Operations ● RPC-like wayto talk to an interface ● Request / Response communication 15
  • 16.
    Operations ● RPC-like wayto talk to an interface ● Request / Response communication int get_version(char *major, char *minor); int vibrator_on(short timeout_ms); 16
  • 17.
  • 18.
  • 19.
    Protocol classes Implemented ● Battery ●Vibrator ● NFC In progress ● Audio ● Input (HID) ● Sensors ● Camera 19
  • 20.
    Protocol classes Implemented ● Battery ●Vibrator ● NFC In progress ● Audio ● Input (HID) ● Sensors ● Camera Later ● Wifi ● Bluetooth ● Cellular modem ● GPS ● Lights ● Display 20
  • 21.
    Bridged PHY protocols ●SPI ● SDIO ● UART ● PWM ● USB ● I2 C ● I2 S ● GPIO 21
  • 22.
  • 23.
  • 24.
    Supervisor control, ModuleManifest, Power Management, EPMs, RF Bus, Driver Core Integration, Sysfs Greybus Subsystem Kernel Greybus Core 24
  • 25.
    Supervisor control, ModuleManifest, Power Management, EPMs, RF Bus, Driver Core Integration, Sysfs AP Bridge host controllers USB Subsystem Greybus Subsystem Kernel Greybus Core Native UniPro host controllers 25
  • 26.
    Sensors Supervisor control, ModuleManifest, Power Management, EPMs, RF Bus, Driver Core Integration, Sysfs Native UniPro host controllers AP Bridge host controllers USB Subsystem Greybus Subsystem Kernel Greybus Core Camera (CSI-3) V4L2 iio Power Subsystem Battery ... Class Drivers 26
  • 27.
    Sensors Supervisor control, ModuleManifest, Power Management, EPMs, RF Bus, Driver Core Integration, Sysfs Native UniPro host controllers AP Bridge host controllers USB Subsystem Greybus Subsystem Kernel Greybus Core Camera (CSI-3) V4L2 iio Power Subsystem Battery ... USBBridged PHY Driver USB Subsystem I2C Subsystem I2C ... Class Drivers 27
  • 28.
    Linux kernel -Bridged-PHY support ● USB devices “just work” ● UART devices “just work” ● Userspace access provided for rest ● Existing kernel drivers need 20 lines added 28