upstream in house board support package
play

Upstream In-House Board Support Package Magnus Damm - PowerPoint PPT Presentation

Upstream In-House Board Support Package Magnus Damm damm@opensource.se Renesas Technology Japan Linux Symposium 2009 Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 1 / 58 Outline


  1. Upstream In-House Board Support Package Magnus Damm damm@opensource.se Renesas Technology Japan Linux Symposium 2009 Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 1 / 58

  2. Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 2 / 58

  3. Introduction Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 3 / 58

  4. Introduction Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 4 / 58

  5. Introduction Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 5 / 58

  6. Introduction linux-2.6.22.14_20071226.tar.bz2 Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 6 / 58

  7. Introduction Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 7 / 58

  8. Introduction 79 files changed, 37033 insertions(+), 21 deletions(-) Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 8 / 58

  9. Introduction An Out-Of-Tree Nightmare ◮ Very Experimental Code ◮ Not Performing (Well) ◮ Old Kernel Version ◮ Support Gone Elsewhere Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 9 / 58

  10. Introduction What Was Needed ◮ Long Term Well-Performing Device Support ◮ Kernel Snapshots to BSP Team (ASAP!) Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 10 / 58

  11. Introduction A Successful Recipe ◮ Study Hardware & Software ◮ Check Dependencies, Prioritize ◮ Decide Order, Assign Tasks ◮ Write and Submit Upstream ◮ Backport to Internal BSP Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 11 / 58

  12. Processor & Board Support Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 12 / 58

  13. Processor & Board Support Processor Support arch/sh/kernel/cpu/... ◮ Processor type probe support ◮ On-chip device support (timers, serial ports) ◮ Interrupt controller support ◮ GPIO & Pinmux code ◮ Clocks & Power Management ◮ MMU & Caches ◮ DMA controllers & PCI bridges ◮ On-chip memory ◮ KConfig entries Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 13 / 58

  14. Processor & Board Support Processor Support - Boot-up Processor Probing -- linux-2.6.22.14/arch/sh/kernel/cpu/sh4/probe.c +++ linux-2.6.22.14-x/arch/sh/kernel/cpu/sh4/probe.c @@ -134,7 +134,7 @@ CPU_HAS_LLSC; break; case 0x3008: - if (prr == 0xa0) { + if (prr == 0xa0 || prr == 0xa1) { current_cpu_data.type = CPU_SH7722; current_cpu_data.icache.ways = 4; current_cpu_data.dcache.ways = 4; ◮ High Priority Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 14 / 58

  15. Processor & Board Support Board Support arch/sh/board/... ◮ Pinmux configuration ◮ On-board devices ◮ On-chip devices with board-specific configuration ◮ I2C and SPI bus configuration ◮ Clock configuration ◮ Kconfig bits ◮ Mach-type entry ◮ Defconfig Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 15 / 58

  16. Processor & Board Support Processor & Board Support Useful Debugging Techniques: ◮ Hardware debugger ◮ Serial port printouts (early printk) ◮ LED toggling ◮ Infinite loop vs forced reboot Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 16 / 58

  17. Device Drivers Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 17 / 58

  18. Device Drivers Existing Drivers Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 18 / 58

  19. Device Drivers Existing Drivers Ethernet - SMC91C111 Original Patch: -- linux-2.6.22.14/drivers/net/smc91x.h +++ linux-2.6.22.14-x/drivers/net/smc91x.h @@ -295,6 +294,18 @@ #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) +#elif CONFIG_SH_7722_MIGO_R +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_IO_SHIFT 0 +#define SMC_NOWAIT 1 Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 19 / 58

  20. Device Drivers Existing Drivers Ethernet - SMC91C111 Improved Driver: [PATCH] smc91x: pass along private data [PATCH] smc91x: introduce platform data flags [PATCH] smc91x: make superh use default config [PATCH] smc91x: add insw/outsw to default config Nicolas Pitre: “Thank you for doing this work. I really meant to do it, and commit 09779c6df2dbe95483269d194b327d41fe2cc57e was the first step towards that goal... I have a few comments though.” Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 20 / 58

  21. Device Drivers Existing Drivers Ethernet - SMC91C111 Improved Driver V2: [PATCH] smc91x: pass along private data V2 [PATCH] smc91x: introduce platform data flags V2 [PATCH] smc91x: add insw/outsw to default config V2 [PATCH] smc91x: make superh use default config V2 drivers/net/smc91x.c | 335 +++++++++++++++------- drivers/net/smc91x.h | 343 +++++++++++++---------- include/linux/smc91x.h | 13 + 3 files changed, 359 insertions(+), 332 deletions(-) Nicolas Pitre: Acked-by: Nicolas Pitre <nico...> Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 21 / 58

  22. Device Drivers Existing Drivers NOR Flash - SP29PL256N Original Diffstat: drivers/mtd/maps/Kconfig | 6 drivers/mtd/maps/Makefile | 2 drivers/mtd/maps/migo-r.c | 79 New Patch: Add NOR flash support to the MigoR board by giving board specific data to the physmap-flash platform driver. Signed-off-by: Magnus Damm <damm...> -- arch/sh/boards/renesas/migor/setup.c | 46 ++++++++++++++ 1 file changed, 46 insertions(+) Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 22 / 58

  23. Device Drivers Existing Drivers Existing Drivers - Lessons Learned ◮ Take Time To Study And Improve Existing Code ◮ Build Your Position In The Community ◮ Remove Redundant Code ◮ Scratch Your Itch Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 23 / 58

  24. Device Drivers New Drivers Outline Introduction Processor & Board Support Device Drivers Existing Drivers New Drivers Advanced Drivers Framework Extensions New Video Formats Zero Copy Frame Capture Upstream Patches & Internal Snapshots Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 24 / 58

  25. Device Drivers New Drivers I2C Original Driver: /* This is a wrapper for kernel modules that need to call the transfer function directly. It can be called in atomic context since it polls the hardware until the transfer completes. */ int i2c_sh7343_xfer_mod_poll(int ch, struct i2c_msg *msgs, int num) Original Diffstat: drivers/i2c/busses/Kconfig | 10 drivers/i2c/busses/Makefile | 1 drivers/i2c/busses/i2c-sh7343.c | 908 ++++++ drivers/i2c/busses/i2c-sh7343.h | 105 Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 25 / 58

  26. Device Drivers New Drivers I2C New Driver: This is V5 of the SuperH Mobile I2C Controller Driver. A simple Master only driver for the I2C block included in processors such as sh7343, sh7722 and sh7723. Tested on a sh7722 MigoR using a rs5c732b rtc. Signed-off-by: Magnus Damm <damm...> Signed-off-by: Paul Mundt <lethal...> -- drivers/i2c/busses/Kconfig | 10 drivers/i2c/busses/Makefile | 1 drivers/i2c/busses/i2c-sh_mobile.c | 500 ++++++++ 3 files changed, 511 insertions(+) Magnus Damm (damm@opensource.se) Upstream In-House Board Support Package Japan Linux Symposium 2009 26 / 58

Recommend


More recommend