Kernel Recipes 2013 - Automating source code evolutions using Coccinelle
Kernel Recipes 2015: Greybus
-
Upload
anne-nicolas -
Category
Software
-
view
3.342 -
download
0
Transcript of Kernel Recipes 2015: Greybus
![Page 1: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/1.jpg)
Greybus
Greg Kroah-Hartman
1
![Page 2: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/2.jpg)
Linaro
Leaflabs
BayLibre
Linux Foundation
Acknowledgments
2
![Page 3: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/3.jpg)
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
![Page 4: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/4.jpg)
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
![Page 5: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/5.jpg)
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’sassociated connection.
UniPro provides bidirectional connections for data transfer
5
![Page 6: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/6.jpg)
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
![Page 7: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/7.jpg)
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
![Page 8: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/8.jpg)
GreybusAn application layer for Unipro
8
![Page 9: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/9.jpg)
Greybus protocol
● Device discovery and description
● Network routing and housekeeping
● Class protocols
9
![Page 10: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/10.jpg)
Device description
A Manifest describes the device to the system.
Examples of this information:
● Vendor and Product ID
● Serial Number
● “Bundles”
● Protocols used
10
![Page 11: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/11.jpg)
Module X
Modules Interfaces CPorts Bundles
11
![Page 12: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/12.jpg)
Interface 1
Modules Interfaces CPorts Bundles
Interface 0
Module X
12
![Page 13: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/13.jpg)
Interface 1
Module X
Modules Interfaces CPorts Bundles
Interface 0 CPort 0 CPort 0
13
![Page 14: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/14.jpg)
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
![Page 15: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/15.jpg)
Operations
● RPC-like way to talk to an interface
● Request / Response communication
15
![Page 16: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/16.jpg)
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
![Page 17: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/17.jpg)
Protocol classes
17
![Page 18: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/18.jpg)
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
18
![Page 19: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/19.jpg)
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
In progress
● Audio
● Input (HID)
● Sensors
● Camera
19
![Page 20: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/20.jpg)
Protocol classes
Implemented
● Battery
● Vibrator
● NFC
In progress
● Audio
● Input (HID)
● Sensors
● Camera
Later
● Wifi
● Bluetooth
● Cellular modem
● GPS
● Lights
● Display
20
![Page 21: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/21.jpg)
Bridged PHY protocols
● SPI
● SDIO
● UART
● PWM
● USB
● I2C
● I2S
● GPIO
21
![Page 22: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/22.jpg)
“Tunneled” protocols
● CSI
● DSI
22
![Page 23: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/23.jpg)
github.com/projectara/greybus
Linux kernel implementation
23
![Page 24: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/24.jpg)
Supervisor control, Module Manifest, Power Management,EPMs, RF Bus, Driver Core Integration, Sysfs
Greybus Subsystem
Kernel
Greybus Core
24
![Page 25: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/25.jpg)
Supervisor control, Module Manifest, Power Management,EPMs, RF Bus, Driver Core Integration, Sysfs
AP Bridgehost controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Native UniProhost controllers
25
![Page 26: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/26.jpg)
Sensors
Supervisor control, Module Manifest, Power Management,EPMs, RF Bus, Driver Core Integration, Sysfs
Native UniProhost controllers
AP Bridgehost controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Camera(CSI-3)
V4L2 iioPower Subsystem
Battery...
ClassDrivers
26
![Page 27: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/27.jpg)
Sensors
Supervisor control, Module Manifest, Power Management,EPMs, RF Bus, Driver Core Integration, Sysfs
Native UniProhost controllers
AP Bridgehost controllers
USB Subsystem
Greybus Subsystem
Kernel
Greybus Core
Camera(CSI-3)
V4L2 iioPower Subsystem
Battery...USBBridged
PHY Driver
USBSubsystem
I2CSubsystem
I2C...
ClassDrivers
27
![Page 28: Kernel Recipes 2015: Greybus](https://reader031.fdocuments.us/reader031/viewer/2022021921/58f096931a28abc0098b456f/html5/thumbnails/28.jpg)
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