Linux on OpenPOWER: internals, interfaces and integration
Jeremy Kerr
Join the Conversation #OpenPOWERSummitJoin the Conversation #OpenPOWERSummit
2
Outline
Runtime Linux implementation Boot services Management processor implementation
3
Runtime Linux implementation
“powernv” platform linux: arch/powerpc/platforms/powernv/
4
Platform description: device tree
cpus { PowerPC,POWER8@10 { i-cache-size = <0x8000>; d-cache-size = <0x10000>; timebase-frequency = <0x1e848000>; clock-frequency = <0xae673780>; ibm,chip-id = <0x0>; …
}
PowerPC,POWER8@18 { … }
5
Platform interfaces: OPAL API
“Open Power Abstraction Layer” opal-api.h Functions for the kernel platform code to call Shipped as machine firmware
http://github.com/open-power/skiboot/
6
Platform interfaces: OPAL API
#define OPAL_CONSOLE_WRITE 1#define OPAL_CONSOLE_READ 2#define OPAL_RTC_READ 3#define OPAL_RTC_WRITE 4#define OPAL_CEC_POWER_DOWN 5#define OPAL_CEC_REBOOT 6#define OPAL_READ_NVRAM 7#define OPAL_WRITE_NVRAM 8…
7
Platform interfaces: OPAL API
OPAL_CONSOLE_WRITE------------------
Parameters:
int64_t term_number int64_t *length const uint8_t *buffer
Returns:
OPAL_SUCCESS OPAL_PARAMETER - invalid term_number OPAL_CLOSED - console device closed OPAL_BUSY_EVENT - unable to write any of buffer
term_number is the terminal number as represented in the device tree.length is a pointer to the length of buffer.
A conforming implementation SHOULD try to NOT do partial writes, althoughpartial writes and not writing anything are valid.
8
OPAL design
“Library” concept Always invoked through and on behalf of Linux
No interrupts / hidden entry points
Fixed calling convention 64-bit, big-endian mode Exceptions disabled Translation disabled
9
OPAL interactions
Linux kernel
OPAL
powernv platform
OPAL API
Workload
10
... plus the OpenPOWER-specific drivers
Standard Linux support for PNOR flash access NX cryptography acceleration & RNG CPU frequency & idle Real-time clock Console IPMI channel I²C HWMON
Again, OPAL simply provides lightweight abstractions
11
OPAL interactions
Linux kernel
OPAL
powernv platform
OPAL API drivers
Workload
12
So how do we boot?
13
Petitboot
14
Petitboot
15
Using Linux for boot services
Reuse existing core code! OPAL firmware support OPAL device drivers Network stack Network protocol support (DHCP, DNS, HTTP, ...) Standard storage device drivers Standard network device drivers Standard input device drivers
16
Boot service functionality in userspace
Customisable as standard Linux application No real-mode code Standard libraries & utilities available
https://github.com/open-power/petitboot
17
Management controller integration
Standard Baseband Management Controller (BMC)
Usual methods of platform management Chassis power control Sensor readings SOL console Firmware update
18
OpenPOWER BMC functionality
A few OEM-specific commands Forming the initial reference implementation
Not necessary for the majority of deployments
https://github.com/open-power/docs/
19
Thank you!
20
Resources
https://github.com/open-power/ Code repositories for firmware Documentation repositories Issue tracking
Mailing lists: Linux kernel development: [email protected] OPAL/skiboot development: [email protected] Petitboot development: [email protected]
21
Legal & trademarks
This work represents the view of the author and does not necessarily represent the view of IBM.
IBM, IBM (logo), OpenPOWER, POWER, POWER8, and Power Systems are trademarks or registered trademarks of International Business Machines Corporation in the United States and/or other countries.
Linux is a registered trademark of Linus Torvalds. Other company, product and service names may be trademarks or service marks of others.