%deffont "standard" tfont "times.ttf" %deffont "thick" tfont "thick.ttf" %deffont "typewriter" tfont "courier.ttf" %default 1 leftfill, size 2, fore "black", font "thick", bimage "slide-bgwide.jpg" %default 2 size 7, vgap 40, fore "black", prefix " " %default 3 size 2, bar "gray70" 10 12 88, vgap 10, fore "black" %default 4 size 5, fore "white", font "standard", fore "black", prefix " " %tab 1 size 5, vgap 40, prefix " ", icon box "green" 50 %tab 2 size 4, vgap 40, prefix " ", icon arc "yellow" 50 %tab 3 size 3, vgap 40, prefix " ", icon delta3 "black" 40 %page %center Linux on the PowerPC 4xx %vgap 50 David Gibson OzLabs, IBM Linux Technology Center %font "typewriter" %size 4 david@gibson.dropbear.id.au dgibson@au1.ibm.com %pcache 1 1 0 0 %page Overview PowerPC 4xx processors An example: the 405GP Current Linux support Future work %page PowerPC 4xx processors Family of processors for embedded applications But highish end for embedded MMU is simple, but sufficient for a modern OS Implementation of the PowerPC architecture Usually no binary changes for non-kernel code No FPU Low power consumption Hardware debugging support (JTAG) %page On Chip Peripherals Separate logic cores on same piece of silicon Connected via several on chip buses Useful for single board computers Variants chips: same core, different peripherals 405GP, NP405H, NP405L, STBxxx, 405LP Relatively easy to make new chip with new combination of peripherals %page An example: the 405GP Software loaded TLB 16kB icache, 8kB dcache Interrupt controller SDRAM controller Expansion Bus Controller DMA controllers PCI host bridge 10/100 Ethernet 2 RS-232 UARTs I2C controller GPIO 4kB on-chip memory (as fast as cache) ''decompression controller'' %page 405 MMU 64 entry TLB Fully associative Loaded with special instruction %cont %font "typewriter" tlbwe %font "standard" Each entry has: virtual address real address page size (1kB to 16MB) access control bits attribute bits (cache-inhibit, etc.) %page Linux support Many 4xx boards supported: IBM reference boards: Walnut (405GP), Oak (403GCX), Ebony (440GP) Tivo (403GCX) Embedded Planet EP405 (405GP) others... Custom boards common Will usually need kernel tweaking... ...but not much Can use kernel FP emulation... Runs normal PowerPC Linux binaries ...or compile apps/libraries with soft float %page Handling a software MMU Actually quite easy Maintain page tables, just like normal TLB miss handler (assembly) walks tables, loads entry Mostly uses 4kB page size (like all PowerPC Linux) Can use "pinned" 16MB entries for kernel text Recent 2.5 allows dynamically loaded large page entries %page Cache coherency DMA is not cache coherent i.e. CPU core doesn't snoop bus for DMA Not unique (e.g. MIPS), but unlike "normal" PPC Can use uncached memory for DMA Simple Can be slow Tricky if driver is handed pointers Can use explicit cache invalidates Memory "belongs" to CPU or device at a given time Requires care Sometimes impossible Which approach depends on driver's needs %page An example: the Ethernet driver Descriptor tables point to buffers Use uncached memory for descriptor tables Use cached memory for packet buffers Rx path: HW DMAs packet into next buffer HW writes descriptor, signals interrupt Driver parses descriptor table Driver reads packet (pulls into cache) Driver allocates more buffers, invalidates cache Tx path: Driver gets packet from network layer Driver does cache writeback on buffer Driver writes descriptor HW sends packet, updates descriptor, interrupts Driver frees buffer %page On chip peripheral support Drivers exist for many devices PCI, Ethernet, UARTs, I2C, IDE... Chip has no support for HW detection Kernel must "just know" which devices are there Kernel must be compiled for a particular chip Includes .c file with table of devices Drivers locate devices through "OCP" subsystem %page Board and initialisation issues Each board has special devices Often an FPGA or CPLD with control registers Firmware differs from board to board Different initialisation of hardware Usually quite privitive Minimal support for hardware discovery Kernel must be compiled for a particular board Board specific code supplies %cont %font "typewriter" board_init() Handles early hardware initialisation %page Future work Improved power management Device drivers Frequency and voltage scaling Cleanups to OCP support Integration into 2.5 device model Cleanups to board and initialisation support Cleanups to cache incoherence handling Current functions broken in some situations Integration into 2.5 Partially done Necessary for 4xx to be a "full citizen" of the Linux world %page The End %center %size 4 %prefix " " %font "typewriter" linuxppc_2_4_devel %cont %font "standard" kernel tree. %font "typewriter" bk://ppc@ppc.bkbits.net/linuxppc_2_4_devel %font "standard" IBM Corporation, "PowerPC 405GP Embedded Processor User's Manual".