SlideShare a Scribd company logo
1 of 38
Allwinner Kernel
Upstreaming Experiences
Chen-Yu Tsai (wens) 蔡鎮宇
Chen-Yu Tsai 蔡鎮宇
• Software Engineer @ CloudMosa
• Puffin Web Browser
• Totally not embedded Linux related
• Linux-sunxi community hobbyist
• Contributions to U-boot and Linux
• git log --oneline --author “Chen-Yu Tsai”
• Translations
2015/8/25 2
Disclaimer
I have only done Allwinner/sunxi related stuff.
Linux-sunxi is community/volunteer based.
Your mileage may vary.
2015/8/25 3
Outline
• Current Status
• Where to start
• Tips
• What to expect
• New SoC bringup
• Supporting new boards
• Priorities
• Difficulties
2015/8/25 4
Current Status
Let’s look at some ARM SoC vendors
2015/8/25 5
linux-sunxi?
• Cheap hardware
• Development boards
• Documents and SDKs available
• Given by hardware vendors
• Allwinner now provides them on github
• https://github.com/allwinner-zh/
2015/8/25 6
Allwinner
• Headless server w/ MMC/SATA/USB storage
• I2C & SPI
• LCD/HDMI/VGA display w/ simplefb
• Audio WIP
2015/8/25 7
Allwinner
• Community driven
• git lo --no-merges --perl-regexp --grep
'sunxi|sun[0-9]i' | grep -v m68k | wc –l
• 1118
• Extremely active
• Allwinner supplies documents and their source code
• Answers questions
2015/8/25 8
Rockchip
• Basically a fully working system
• MMC/USB
• I2C & SPI
• Full KMS display support
• I2S & audio codecs
• Chromebook based on mainline kernel + dts
• IP blocks mostly from ARM or Synopsys
2015/8/25 9
Rockchip
• Hobbyist maintainer
• git lo --author 'Heiko Stuebner' | wc -l
• 158
• filtered out Samsung related
• Official support
• git lo --author @rock-chips.com | wc -l
• 169
2015/8/25 10
Mediatek
• Basics (machine, clk, pinctrl , uart)
• Drivers for
• I2C, SPI, MMC, PMIC, Audio
• Not seen in DTS yet
2015/8/25 11
Mediatek
• Outside maintainer
• git lo --author 'Matthias Brugger' | wc -l
• 53
• Since 2014/7/22
• Official support
• git lo --author @mediatek.com | wc -l
• 122
• Since 2014/11/4
2015/8/25 12
Where to start
2015/8/25 13
Getting it to boot
• Machine definition (arch/arm/mach-*)
• Basic DTS
• UART
2015/8/25 14
Infrastructure
• Clocks
• Pinctrl
• Reusable
2015/8/25 15
Peripherals
• Storage
• MMC
• SATA
• USB
• PMIC
• I2C
• SPI
• …
• Common vs custom IP?
2015/8/25 16
Tips
The kernel is very big and moves very fast
2015/8/25 17
Start small
• Is it a known, supported IP block?
• Only standard resources?
• MMIO, IRQ, clocks, resets
• Ex: USB host
• Hardware glue? Quirks?
• Is the core supported?
• Is it a library?
• Write a glue driver
• Modify / port
• Ex: SATA AHCI, STMMAC
2015/8/25 18
Start simple
• Clocks can be done one at a time
• Driver describes clock controls
• Driver or DTS describes relationship between clocks
• Both methods are used
• Pinctrl / GPIO
• Transcribe datasheets
2015/8/25 19
Look around and Ask
• Subscribe to mailing lists
• Look at how other contributors write code
• Learn what reviewers ask for
• Look at how other platforms do it
• mediatek pinctrl driver is very similar to sunxi
• Documentation is sometimes lacking
• When in doubt, ask
• Release often
• No one is going to review unsent code
2015/8/25 20
What to expect
Not getting merged is not the end of the world
2015/8/25 21
Code issues
• Code style
• Indentation
• Comments
• Error path
• Bugs
• Resource leak?
2015/8/25 22
NACK
• Wrong design
• Ex: rfkill dt support
• Deprecated functions
• Ex: platform_data
• Occasional disagreement
• “simplefb: add clock handling code”
2015/8/25 23
Maintainers are busy
• Sometimes you don’t get feedback
• Maintainers often write code as well
• Lots of mailing list traffic
• Ping or resend
2015/8/25 24
Didn’t get your patches in
this release?
• You can do better
• Write better code
• Respond to reviewers
• Keep working
• Release cycle is predictable
• Sometimes it’s not your fault
• Maintainer missed your patch or pull request
• It happens
• Maintainer went on vacation
• Maintainer missing (?)
2015/8/25 25
New SoC bringup
2015/8/25 26
New SoC
1. Getting it to Boot
• Machine definition (arch/arm/mach-*)
• Basic DTS
• UART
2. Clocks / Pinctrl
3. Peripherals
• IP blocks don’t often change
• Existing drivers should work
• Quite satisfying!
2015/8/25 27
Supporting new boards
2015/8/25 28
Supporting new boards
• Need schematics or hardware description
• What peripherals are connected to the board?
• What external ICs are there?
• PMICs, audio codecs, sensors, storage…
• Extra GPIOs?
• LEDs
• Write a .dts file
• Test that everything works
• Fairly easy!
2015/8/25 29
Priorities
2015/8/25 30
Paid work
• Not really much say
• Getting products shipped is all that matters
• Still
• You should try
• What benefits the most platforms / boards?
• Must have vs. want?
• MMC vs USB vs audio
2015/8/25 31
Community hackers
• Expertise / prior experience
• Did clocks before, do it again
• Interest
• Me: I want WiFi! I want SMP!
• Low hanging fruit
• Me: Network is DWMAC based, only need glue code
• Popular demand
• DMA engine
• Audio
2015/8/25 32
Difficulties
2015/8/25 33
Documents
• NDA?
• Incorrect
• How do you know it’s incorrect?
• Missing sections
• Completely non-existent
• No board schematics
• Should you risk it going up in smoke?
2015/8/25 34
Porting vendor code
• Is often bad
• Because of time to market concerns
• Quite old
• Android kernel still at 3.4?
• Custom frameworks
• Obsoleted by common frameworks
• Clocks, resets, pinctrl, gpio, PHY, regmap, …
• Binary blobs
• No source code
2015/8/25 35
Binary drivers
• Third-party IP vendors
• GPUs
• VPUs
• …
• NDAs
2015/8/25 36
GPL violations
• There shouldn’t be binary-only blobs in the kernel
• http://linux-sunxi.org/GPL_Violations
• http://www.xda-developers.com/have-you-paid-
your-linux-kernel-source-license-fee/
2015/8/25 37
Questions?
2015/8/25 38

More Related Content

What's hot

XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
Balazs Bucsay
 
2012 workshop wed_ethernet_servicesoveri_poib
2012 workshop wed_ethernet_servicesoveri_poib2012 workshop wed_ethernet_servicesoveri_poib
2012 workshop wed_ethernet_servicesoveri_poib
strelecru
 

What's hot (20)

Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
 
Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021Janus Workshop pt.2 @ ClueCon 2021
Janus Workshop pt.2 @ ClueCon 2021
 
Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020Insertable Streams and E2EE @ ClueCon2020
Insertable Streams and E2EE @ ClueCon2020
 
Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...
Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...
Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...
 
WebRTC, Whats in it for me?
WebRTC, Whats in it for me?WebRTC, Whats in it for me?
WebRTC, Whats in it for me?
 
Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021Can WebRTC help musicians? @ FOSDEM 2021
Can WebRTC help musicians? @ FOSDEM 2021
 
Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020Can SFUs and MCUs be friends @ IIT-RTC 2020
Can SFUs and MCUs be friends @ IIT-RTC 2020
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
WebRTC security+more @ KamailioWorld 2018
WebRTC security+more @ KamailioWorld 2018WebRTC security+more @ KamailioWorld 2018
WebRTC security+more @ KamailioWorld 2018
 
WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022WHIP WebRTC Broadcasting @ FOSDEM 2022
WHIP WebRTC Broadcasting @ FOSDEM 2022
 
Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021Write a SocialTV app @ OpenSIPS 2021
Write a SocialTV app @ OpenSIPS 2021
 
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
 
2012 workshop wed_ethernet_servicesoveri_poib
2012 workshop wed_ethernet_servicesoveri_poib2012 workshop wed_ethernet_servicesoveri_poib
2012 workshop wed_ethernet_servicesoveri_poib
 
Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019Simulcast/SVC @ IIT-RTC 2019
Simulcast/SVC @ IIT-RTC 2019
 
Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...
Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...
Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...
 
Armbian balcoon
Armbian balcoonArmbian balcoon
Armbian balcoon
 
Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019Fuzzing Janus @ IPTComm 2019
Fuzzing Janus @ IPTComm 2019
 
IETF remote participation via Meetecho @ WebRTC Meetup Stockholm
IETF remote participation via Meetecho @ WebRTC Meetup StockholmIETF remote participation via Meetecho @ WebRTC Meetup Stockholm
IETF remote participation via Meetecho @ WebRTC Meetup Stockholm
 
Bus Pirate Workshop Ruxcon Hardware Hacking 2017
Bus Pirate Workshop Ruxcon Hardware Hacking 2017Bus Pirate Workshop Ruxcon Hardware Hacking 2017
Bus Pirate Workshop Ruxcon Hardware Hacking 2017
 
WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21WebRTC, RED and Janus @ ClueCon21
WebRTC, RED and Janus @ ClueCon21
 

Similar to Allwinner Kernel Upstreaming Experiences

Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
Srikanth Pilli
 

Similar to Allwinner Kernel Upstreaming Experiences (20)

The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback2014 01-21-mpi-community-feedback
2014 01-21-mpi-community-feedback
 
12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction12 Lessons Learnt in Boot Time Reduction
12 Lessons Learnt in Boot Time Reduction
 
Seminario utovrm
Seminario utovrmSeminario utovrm
Seminario utovrm
 
Considerations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack CloudConsiderations for Operating An OpenStack Cloud
Considerations for Operating An OpenStack Cloud
 
The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)The end of embedded Linux (as we know it)
The end of embedded Linux (as we know it)
 
Computer motherboard
Computer motherboardComputer motherboard
Computer motherboard
 
Considerations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack CloudConsiderations for Operating an OpenStack Cloud
Considerations for Operating an OpenStack Cloud
 
embedded-systems-for-beginners
embedded-systems-for-beginnersembedded-systems-for-beginners
embedded-systems-for-beginners
 
StarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
StarlingX - A Platform for the Distributed Edge | Ildiko VancsaStarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
StarlingX - A Platform for the Distributed Edge | Ildiko Vancsa
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture
 
Build IoT Applications with C#
Build IoT Applications with C#Build IoT Applications with C#
Build IoT Applications with C#
 
MPI Requirements of the Network Layer
MPI Requirements of the Network LayerMPI Requirements of the Network Layer
MPI Requirements of the Network Layer
 
Hacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmataHacking Meatspace with Arduino and pyFirmata
Hacking Meatspace with Arduino and pyFirmata
 
Building foundations
Building foundationsBuilding foundations
Building foundations
 
Intro to Hardware Firmware Hacking
Intro to Hardware Firmware HackingIntro to Hardware Firmware Hacking
Intro to Hardware Firmware Hacking
 
LCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solutionLCA14: LCA14-502: The way to a generic TrustZone® solution
LCA14: LCA14-502: The way to a generic TrustZone® solution
 
Raspberry Pi Introduction
Raspberry Pi IntroductionRaspberry Pi Introduction
Raspberry Pi Introduction
 
Webinar: STM32WB - microcontrolador dual-core certificado BLE 5.0
Webinar: STM32WB - microcontrolador dual-core certificado BLE 5.0Webinar: STM32WB - microcontrolador dual-core certificado BLE 5.0
Webinar: STM32WB - microcontrolador dual-core certificado BLE 5.0
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
 

Recently uploaded

Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
Abortion Pill Prices Jozini ](+27832195400*)[ 🏥 Women's Abortion Clinic in Jo...
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
Abortion Clinic In Pongola ](+27832195400*)[ 🏥 Safe Abortion Pills In Pongola...
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Rapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and InsightsRapidoform for Modern Form Building and Insights
Rapidoform for Modern Form Building and Insights
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 

Allwinner Kernel Upstreaming Experiences

  • 2. Chen-Yu Tsai 蔡鎮宇 • Software Engineer @ CloudMosa • Puffin Web Browser • Totally not embedded Linux related • Linux-sunxi community hobbyist • Contributions to U-boot and Linux • git log --oneline --author “Chen-Yu Tsai” • Translations 2015/8/25 2
  • 3. Disclaimer I have only done Allwinner/sunxi related stuff. Linux-sunxi is community/volunteer based. Your mileage may vary. 2015/8/25 3
  • 4. Outline • Current Status • Where to start • Tips • What to expect • New SoC bringup • Supporting new boards • Priorities • Difficulties 2015/8/25 4
  • 5. Current Status Let’s look at some ARM SoC vendors 2015/8/25 5
  • 6. linux-sunxi? • Cheap hardware • Development boards • Documents and SDKs available • Given by hardware vendors • Allwinner now provides them on github • https://github.com/allwinner-zh/ 2015/8/25 6
  • 7. Allwinner • Headless server w/ MMC/SATA/USB storage • I2C & SPI • LCD/HDMI/VGA display w/ simplefb • Audio WIP 2015/8/25 7
  • 8. Allwinner • Community driven • git lo --no-merges --perl-regexp --grep 'sunxi|sun[0-9]i' | grep -v m68k | wc –l • 1118 • Extremely active • Allwinner supplies documents and their source code • Answers questions 2015/8/25 8
  • 9. Rockchip • Basically a fully working system • MMC/USB • I2C & SPI • Full KMS display support • I2S & audio codecs • Chromebook based on mainline kernel + dts • IP blocks mostly from ARM or Synopsys 2015/8/25 9
  • 10. Rockchip • Hobbyist maintainer • git lo --author 'Heiko Stuebner' | wc -l • 158 • filtered out Samsung related • Official support • git lo --author @rock-chips.com | wc -l • 169 2015/8/25 10
  • 11. Mediatek • Basics (machine, clk, pinctrl , uart) • Drivers for • I2C, SPI, MMC, PMIC, Audio • Not seen in DTS yet 2015/8/25 11
  • 12. Mediatek • Outside maintainer • git lo --author 'Matthias Brugger' | wc -l • 53 • Since 2014/7/22 • Official support • git lo --author @mediatek.com | wc -l • 122 • Since 2014/11/4 2015/8/25 12
  • 14. Getting it to boot • Machine definition (arch/arm/mach-*) • Basic DTS • UART 2015/8/25 14
  • 16. Peripherals • Storage • MMC • SATA • USB • PMIC • I2C • SPI • … • Common vs custom IP? 2015/8/25 16
  • 17. Tips The kernel is very big and moves very fast 2015/8/25 17
  • 18. Start small • Is it a known, supported IP block? • Only standard resources? • MMIO, IRQ, clocks, resets • Ex: USB host • Hardware glue? Quirks? • Is the core supported? • Is it a library? • Write a glue driver • Modify / port • Ex: SATA AHCI, STMMAC 2015/8/25 18
  • 19. Start simple • Clocks can be done one at a time • Driver describes clock controls • Driver or DTS describes relationship between clocks • Both methods are used • Pinctrl / GPIO • Transcribe datasheets 2015/8/25 19
  • 20. Look around and Ask • Subscribe to mailing lists • Look at how other contributors write code • Learn what reviewers ask for • Look at how other platforms do it • mediatek pinctrl driver is very similar to sunxi • Documentation is sometimes lacking • When in doubt, ask • Release often • No one is going to review unsent code 2015/8/25 20
  • 21. What to expect Not getting merged is not the end of the world 2015/8/25 21
  • 22. Code issues • Code style • Indentation • Comments • Error path • Bugs • Resource leak? 2015/8/25 22
  • 23. NACK • Wrong design • Ex: rfkill dt support • Deprecated functions • Ex: platform_data • Occasional disagreement • “simplefb: add clock handling code” 2015/8/25 23
  • 24. Maintainers are busy • Sometimes you don’t get feedback • Maintainers often write code as well • Lots of mailing list traffic • Ping or resend 2015/8/25 24
  • 25. Didn’t get your patches in this release? • You can do better • Write better code • Respond to reviewers • Keep working • Release cycle is predictable • Sometimes it’s not your fault • Maintainer missed your patch or pull request • It happens • Maintainer went on vacation • Maintainer missing (?) 2015/8/25 25
  • 27. New SoC 1. Getting it to Boot • Machine definition (arch/arm/mach-*) • Basic DTS • UART 2. Clocks / Pinctrl 3. Peripherals • IP blocks don’t often change • Existing drivers should work • Quite satisfying! 2015/8/25 27
  • 29. Supporting new boards • Need schematics or hardware description • What peripherals are connected to the board? • What external ICs are there? • PMICs, audio codecs, sensors, storage… • Extra GPIOs? • LEDs • Write a .dts file • Test that everything works • Fairly easy! 2015/8/25 29
  • 31. Paid work • Not really much say • Getting products shipped is all that matters • Still • You should try • What benefits the most platforms / boards? • Must have vs. want? • MMC vs USB vs audio 2015/8/25 31
  • 32. Community hackers • Expertise / prior experience • Did clocks before, do it again • Interest • Me: I want WiFi! I want SMP! • Low hanging fruit • Me: Network is DWMAC based, only need glue code • Popular demand • DMA engine • Audio 2015/8/25 32
  • 34. Documents • NDA? • Incorrect • How do you know it’s incorrect? • Missing sections • Completely non-existent • No board schematics • Should you risk it going up in smoke? 2015/8/25 34
  • 35. Porting vendor code • Is often bad • Because of time to market concerns • Quite old • Android kernel still at 3.4? • Custom frameworks • Obsoleted by common frameworks • Clocks, resets, pinctrl, gpio, PHY, regmap, … • Binary blobs • No source code 2015/8/25 35
  • 36. Binary drivers • Third-party IP vendors • GPUs • VPUs • … • NDAs 2015/8/25 36
  • 37. GPL violations • There shouldn’t be binary-only blobs in the kernel • http://linux-sunxi.org/GPL_Violations • http://www.xda-developers.com/have-you-paid- your-linux-kernel-source-license-fee/ 2015/8/25 37