paul@82 | 1 | -- vim: ft=lua ts=2 et sw=2 |
paul@82 | 2 | |
paul@82 | 3 | -- Start the framebuffer driver with supporting devices. |
paul@82 | 4 | -- The target platform is the MIPS Creator CI20. |
paul@82 | 5 | |
paul@82 | 6 | local L4 = require("L4"); |
paul@82 | 7 | |
paul@82 | 8 | local l = L4.default_loader; |
paul@82 | 9 | |
paul@82 | 10 | -- Define general access to peripherals. |
paul@82 | 11 | |
paul@82 | 12 | local io_buses = { |
paul@82 | 13 | cpm = l:new_channel(); |
paul@82 | 14 | gpio = l:new_channel(); |
paul@82 | 15 | hdmi = l:new_channel(); |
paul@82 | 16 | lcd = l:new_channel(); |
paul@82 | 17 | }; |
paul@82 | 18 | |
paul@82 | 19 | l:start({ |
paul@82 | 20 | caps = { |
paul@82 | 21 | cpm = io_buses.cpm:svr(), |
paul@82 | 22 | gpio = io_buses.gpio:svr(), |
paul@82 | 23 | hdmi = io_buses.hdmi:svr(), |
paul@82 | 24 | lcd = io_buses.lcd:svr(), |
paul@82 | 25 | |
paul@82 | 26 | icu = L4.Env.icu, |
paul@82 | 27 | sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), |
paul@82 | 28 | }, |
paul@82 | 29 | }, |
paul@82 | 30 | "rom/io rom/hw_devices.io rom/mips-ci20-common.io"); |
paul@82 | 31 | |
paul@82 | 32 | -- Expose the CPM peripheral. |
paul@82 | 33 | |
paul@82 | 34 | local cpm = l:new_channel(); |
paul@82 | 35 | |
paul@82 | 36 | l:start({ |
paul@82 | 37 | caps = { |
paul@82 | 38 | vbus = io_buses.cpm, |
paul@82 | 39 | cpm = cpm:svr(), |
paul@82 | 40 | }, |
paul@82 | 41 | }, |
paul@82 | 42 | "rom/dev_cpm_jz4780"); |
paul@82 | 43 | |
paul@82 | 44 | -- Expose a display device for the CI20. |
paul@82 | 45 | |
paul@82 | 46 | local display = l:new_channel(); -- exposes display device |
paul@82 | 47 | |
paul@82 | 48 | l:start({ |
paul@82 | 49 | caps = { |
paul@82 | 50 | cpm = cpm, |
paul@82 | 51 | display = display:svr(), |
paul@82 | 52 | icu = L4.Env.icu, |
paul@82 | 53 | vbus = io_buses.hdmi, -- for HDMI resource access |
paul@82 | 54 | }, |
paul@82 | 55 | }, |
paul@82 | 56 | "rom/dev_display_ci20_hdmi"); |
paul@82 | 57 | |
paul@82 | 58 | -- Expose a framebuffer device. |
paul@82 | 59 | |
paul@82 | 60 | local fbdrv_fb = l:new_channel(); |
paul@82 | 61 | |
paul@82 | 62 | l:start({ |
paul@82 | 63 | caps = { |
paul@82 | 64 | vbus = io_buses.lcd, |
paul@82 | 65 | fb = fbdrv_fb:svr(), |
paul@82 | 66 | cpm = cpm, |
paul@82 | 67 | display = display, -- needed by LCD driver |
paul@82 | 68 | }, |
paul@82 | 69 | }, |
paul@82 | 70 | "rom/fb-drv"); |