1 -- vim: ft=lua ts=2 et sw=2 2 3 -- Start the framebuffer driver with supporting devices. 4 -- The target platform is the Letux 400 notebook computer. 5 6 local L4 = require("L4"); 7 8 local l = L4.default_loader; 9 10 -- Define general access to peripherals. 11 12 local io_buses = { 13 cpm = l:new_channel(); 14 gpio = l:new_channel(); 15 lcd = l:new_channel(); 16 pwm = l:new_channel(); -- exposes GPIO, PWM 17 }; 18 19 l:start({ 20 caps = { 21 cpm = io_buses.cpm:svr(), 22 gpio = io_buses.gpio:svr(), 23 lcd = io_buses.lcd:svr(), 24 pwm = io_buses.pwm:svr(), 25 26 icu = L4.Env.icu, 27 sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), 28 }, 29 }, 30 "rom/io rom/hw_devices.io rom/mips-letux400-common.io"); 31 32 -- Expose a PWM peripheral as a device. 33 34 local pwm = l:new_channel(); 35 36 l:startv({ 37 caps = { 38 vbus = io_buses.pwm, 39 pwm = pwm:svr(), 40 }, 41 }, 42 "rom/dev_pwm_jz4730", "0", "250", "299", "47"); -- specifying peripheral number, parameters 43 44 -- Expose a PWM backlight device. 45 46 local backlight = l:new_channel(); -- exposes backlight device 47 48 l:startv({ 49 caps = { 50 pwm = pwm, 51 backlight = backlight:svr(), 52 }, 53 }, 54 "rom/dev_backlight_pwm", "0", "300"); -- specifying limits 55 56 -- Expose a display device for the Letux. 57 58 local display = l:new_channel(); -- exposes display device 59 60 l:start({ 61 caps = { 62 backlight = backlight, 63 display = display:svr(), 64 vbus = io_buses.gpio, 65 }, 66 }, 67 "rom/dev_display_letux400"); 68 69 -- Expose the CPM peripheral. 70 71 local cpm = l:new_channel(); 72 73 l:start({ 74 caps = { 75 vbus = io_buses.cpm, 76 cpm = cpm:svr(), 77 }, 78 }, 79 "rom/dev_cpm_jz4730"); 80 81 -- Expose a framebuffer device. 82 83 local fbdrv_fb = l:new_channel(); 84 85 l:start({ 86 caps = { 87 vbus = io_buses.lcd, 88 fb = fbdrv_fb:svr(), 89 cpm = cpm, 90 display = display, -- needed by LCD driver 91 }, 92 }, 93 "rom/fb-drv");