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-fbdrv.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 a panel definition for the Letux. 70 71 local panel = l:new_channel(); -- exposes panel 72 73 l:start({ 74 caps = { 75 panel = panel:svr(), 76 }, 77 }, 78 "rom/dev_panel_letux400"); 79 80 -- Expose the CPM peripheral. 81 82 local cpm = l:new_channel(); 83 84 l:start({ 85 caps = { 86 vbus = io_buses.cpm, 87 cpm = cpm:svr(), 88 }, 89 }, 90 "rom/dev_cpm_jz4730"); 91 92 -- Expose a framebuffer device. 93 94 local fbdrv_fb = l:new_channel(); 95 96 l:start({ 97 caps = { 98 vbus = io_buses.lcd, 99 fb = fbdrv_fb:svr(), 100 cpm = cpm, 101 display = display, -- needed by LCD driver 102 panel = panel, 103 }, 104 }, 105 "rom/fb-drv");