1BarrySongbaohua@kernel.org2Agenda§ RebuiltinfrastructureinARMLinux§ Multi-platformARMkernels§ big.LITTLEswitcherandscheduler§ AndroidMainliningProject 3RebuiltinfrastructureinARMLinux4LinusTorvaldssaidthiswholeARMthingisaf*ckingpainintheass-LinusTorvalds,Mar.2011 5RebuiltinfrastructureinARMLinux3.x§ DeviceTreebaseddriversandBSP§ CommonpinctrlFramework§ CommonclockFramework§ CommonDMAFramework§ Supportmulti-platformsARMkernel § Alotofunifiedandre-usedcodes 6Devicetree§ Thedevicetreeisasimpletreestructureofnodesandproperties.Propertiesarekey-valuepairs,andnodemaycontainbothpropertiesandchildnodes./{node1{a-string-property=Astring;a-string-list-property=firststring,secondstring;a-byte-data-property=[0x010x230x340x56];child-node1{first-child-property;second-child-property=1;a-string-property=Hello,world;};child-node2{};};node2{an-empty-property;a-cell-property=1234;/*eachnumber(cell)isauint32*/child-node1{};};}; 7ComponentsofDeviceTree§ DTS(devicetreesource)§ DTC(devicetreecompiler)§ DeviceTreeBlob(.dtb)§ Binding Documentation/devicetree/bindings§ Bootloader#defineCONFIG_OF_LIBFDT 8Platformdevices§ Use.dtstodescriberesourcesofplatformdevicei2c0:i2c@cc0e0000{cell-index=0;compatible=sirf,marco-i2c;reg=0xcc0e00000x10000;interrupts=0240;#address-cells=1;#size-cells=0;status=disabled;}; staticstructresourcesirfsoc_i2c0_resource[]={{.start=SIRFSOC_I2C0MOD_PA_BASE,.end=SIRFSOC_I2C0MOD_PA_BASE+SIRFSOC_I2C0MOD_SIZE-1,.flags=IORESOURCE_MEM,},{.start=IRQ_I2C0,.end=IRQ_I2C0,.flags=IORESOURCE_IRQ,},};9I2C&SPIclients§ Legacy:i2c_board_info&spi_board_info§ DT:i2c0:i2c@cc0e0000{status=okay;fpga-cpld@4d{compatible=sirf,fpga-cpld;reg=0x4d;};};spi1:spi@cc170000{status=okay;pinctrl-names=default;pinctrl-0=&spi1_pins_a;spi@0{compatible=spidev;reg=0;spi-max-frequency=1000000;};}; 10Commonboardfileforaseriesofboards§ Don’ttouchboardfilesasweoftendidbeforein2.6!!Commonboardfile:staticconstchar*prima2_dt_match[]__initdata={sirf,prima2,NULL};DT_MACHINE_START(PRIMA2_DT,GenericPRIMA2(FlattenedDeviceTree)).map_io=sirfsoc_map_lluart,.init_irq=sirfsoc_of_irq_init,.timer=&sirfsoc_timer,.dma_zone_size=SZ_256M,.init_machine=sirfsoc_mach_init,.init_late=sirfsoc_init_late,.dt_compat=prima2_dt_match,.restart=sirfsoc_restart,MACHINE_END11PINCTRLsubsystem§ Pinmultiplexerandconfiguration12Multi-platformARMkernels13ARMmulti-platformfeature§ TheARMmulti-platformfeatureallowsforhavingsupportformultipleARMSoCs/platformswithinasingleLinuxkernelimage.§ Withthemulti-platformsupport,itbecamepossibletohaveonekernelforcoveringCalxedaHighbank,VersatileExpress,Altera,PicoXcell,BroadcomBCM2835,CNS3XXX,SiRF,Nomadik,MSX,Spear,NVIDIATegra,andUX500.14Whowantmulti-platformARMkernel?§ ThestoryofDistributorsWearekeenonmultiplatformkernelsbecausebuildingagreatpileofdifferentonesisamassivepain(andnotjustforarmbecauseitholdsupsecurityupdates),andifwecouldstillcoverallthatlotwithonekernel,orindeedanynumberlessthan7thatwouldbegreat.-DebiandeveloperWookey15Changesformulti-platform§ Removeper-platformmach-mach/include/mach/*§ Removeper-platformlistofdevicetreesinmach-mach/Makefile.boot§ Movemanyplatformcodese.g.clocksource,irqcontrollerfrommach-machtodrivers16Anexampleofmovingtomulti-platform§ Droppingmach-mach/include/macharch/arm/mach-prima2/Kconfig|13+arch/arm/mach-prima2/Makefile|5+-arch/arm/mach-prima2/common.c|26+-arch/arm/mach-prima2/common.h|4+-arch/arm/mach-prima2/include/mach/clkdev.h|15-arch/arm/mach-prima2/include/mach/debug-macro.S|29--arch/arm/mach-prima2/include/mach/entry-macro.S|22--arch/arm/mach-prima2/include/mach/hardware.h|15-arch/arm/mach-prima2/include/mach/irqs.h|17-arch/arm/mach-prima2/include/mach/map.h|18--arch/arm/mach-prima2/include/mach/timex.h|14-arch/arm/mach-prima2/include/mach/uncompress.h|41---arch/arm/mach-prima2/irq.c|129--------arch/arm/mach-prima2/lluart.c|14+-arch/arm/mach-prima2/platsmp.c|1–§ Movingplatformcodesoutofmach-machdrivers/irqchip/irq-sirfsoc.c|126++++++++renamearch/arm/{mach-prima2/include/mach/uart.h=include/debug/sirf.S}(55%)rename{arch/arm/mach-prima2=drivers/clocksource}/timer-marco.c(94%)rename{arch/arm/mach-prima2=drivers/clocksource}/timer-prima2.c(90%)createmode100644drivers/irqchip/irq-sirfsoc.c17Singlekerneldefconfig§ arch/arm/configs/multi_v7_defconfigCONFIG_MACH_ARMADA_370=yCONFIG_MACH_ARMADA_XP=yCONFIG_ARCH_BCM=yCONFIG_GPIO_PCA953X=yCONFIG_ARCH_HIGHBANK=yCONFIG_ARCH_KEYSTONE=yCONFIG_ARCH_MXC=yCONFIG_MACH_IMX51_DT=yCONFIG_SOC_IMX53=yCONFIG_SOC_IMX6Q=yCONFIG_SOC_IMX6SL=yCONFIG_SOC_VF610=yCONFIG_ARCH_OMAP3=yCONFIG_ARCH_OMAP4=yCONFIG_SOC_OMAP5=yCONFIG_SOC_AM33XX=y…CONFIG_ARCH_ZYNQ=y18big.LITTLEswitcherandscheduler19big.LITTLE:Performancevs.Energy-Efficiency§ AsystemthatcontainstwosetsofarchitecturallyidenticalCPUs.§ CPUsdifferinthepowerandperformancetheyyield.§ Similararchitectureallowsto:§ RunthesamesoftwaretransparentlyonallCPUs.§ MigratefromoneCPUtoanothertransparently.20In-kernelSwitching(IKS)§ A7andA15CPUfromeachclusterarecoupledtogethe