kernel recipes 2015: greybus

28
Greybus Greg Kroah-Hartman 1

Upload: anne-nicolas

Post on 14-Apr-2017

3.342 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Kernel Recipes 2015: Greybus

Greybus

Greg Kroah-Hartman

1

Page 2: Kernel Recipes 2015: Greybus

Linaro

Leaflabs

BayLibre

Google

Linux Foundation

Acknowledgments

2

Page 3: Kernel Recipes 2015: Greybus

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

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

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

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

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

GreybusAn application layer for Unipro

8

Page 9: Kernel Recipes 2015: Greybus

Greybus protocol

● Device discovery and description

● Network routing and housekeeping

● Class protocols

9

Page 10: Kernel Recipes 2015: Greybus

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

Module X

Modules Interfaces CPorts Bundles

11

Page 12: Kernel Recipes 2015: Greybus

Interface 1

Modules Interfaces CPorts Bundles

Interface 0

Module X

12

Page 13: Kernel Recipes 2015: Greybus

Interface 1

Module X

Modules Interfaces CPorts Bundles

Interface 0 CPort 0 CPort 0

13

Page 14: Kernel Recipes 2015: Greybus

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

Operations

● RPC-like way to talk to an interface

● Request / Response communication

15

Page 16: Kernel Recipes 2015: Greybus

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

Protocol classes

17

Page 18: Kernel Recipes 2015: Greybus

Protocol classes

Implemented

● Battery

● Vibrator

● NFC

18

Page 19: Kernel Recipes 2015: Greybus

Protocol classes

Implemented

● Battery

● Vibrator

● NFC

In progress

● Audio

● Input (HID)

● Sensors

● Camera

19

Page 20: Kernel Recipes 2015: Greybus

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

Bridged PHY protocols

● SPI

● SDIO

● UART

● PWM

● USB

● I2C

● I2S

● GPIO

21

Page 22: Kernel Recipes 2015: Greybus

“Tunneled” protocols

● CSI

● DSI

22

Page 23: Kernel Recipes 2015: Greybus

github.com/projectara/greybus

Linux kernel implementation

23

Page 24: Kernel Recipes 2015: Greybus

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

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

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

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

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