# HG changeset patch # User Paul Boddie # Date 1526828093 -7200 # Node ID fadcca85dc2a678295093d020f34da9a2ae183ff # Parent bbdca5f2432a0b66d690749d71620cc92e3befb7 Added examples demonstrating fbterminal with the hello program. diff -r bbdca5f2432a -r fadcca85dc2a conf/landfall-examples/mips-letux400-fbterminal.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/mips-letux400-fbterminal.cfg Sun May 20 16:54:53 2018 +0200 @@ -0,0 +1,142 @@ +-- vim: ft=lua ts=2 et sw=2 + +-- Start Mag to multiplex the framebuffer showing only a single program. +-- This example shows a framebuffer terminal showing the hello example's output. +-- The target platform is the Letux 400 notebook computer. + +local L4 = require("L4"); + +local l = L4.default_loader; + +-- Define general access to peripherals. + +local io_buses = { + cpm = l:new_channel(); + gpio = l:new_channel(); + lcd = l:new_channel(); + pwm = l:new_channel(); -- exposes GPIO, PWM + }; + +l:start({ + caps = { + cpm = io_buses.cpm:svr(), + gpio = io_buses.gpio:svr(), + lcd = io_buses.lcd:svr(), + pwm = io_buses.pwm:svr(), + + icu = L4.Env.icu, + sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), + }, + }, + "rom/io rom/hw_devices.io rom/mips-letux400-common.io"); + +-- Expose a PWM peripheral as a device. + +local pwm = l:new_channel(); + +l:startv({ + caps = { + vbus = io_buses.pwm, + pwm = pwm:svr(), + }, + }, + "rom/dev_pwm_jz4730", "0", "250", "299", "47"); -- specifying peripheral number, parameters + +-- Expose a PWM backlight device. + +local backlight = l:new_channel(); -- exposes backlight device + +l:startv({ + caps = { + pwm = pwm, + backlight = backlight:svr(), + }, + }, + "rom/dev_backlight_pwm", "0", "300"); -- specifying limits + +-- Expose a display device for the Letux. + +local display = l:new_channel(); -- exposes display device + +l:start({ + caps = { + backlight = backlight, + display = display:svr(), + vbus = io_buses.gpio, + }, + }, + "rom/dev_display_letux400"); + +-- Expose a panel definition for the Letux. + +local panel = l:new_channel(); -- exposes panel + +l:start({ + caps = { + panel = panel:svr(), + }, + }, + "rom/dev_panel_letux400"); + +-- Expose the CPM peripheral. + +local cpm = l:new_channel(); + +l:start({ + caps = { + vbus = io_buses.cpm, + cpm = cpm:svr(), + }, + }, + "rom/dev_cpm_jz4730"); + +-- Expose a framebuffer device. + +local fbdrv_fb = l:new_channel(); + +l:start({ + caps = { + vbus = io_buses.lcd, + fb = fbdrv_fb:svr(), + cpm = cpm, + display = display, -- needed by LCD driver + panel = panel, + }, + }, + "rom/fb-drv"); + +-- Multiplex the framebuffer. + +local mag_caps = { + mag = l:new_channel(), + svc = l:new_channel(), + }; + +l:start({ + caps = { + vbus = io_buses.gpio, -- needed by input driver + fb = fbdrv_fb, + mag = mag_caps.mag:svr(), + svc = mag_caps.svc:svr(), + }, + }, + "rom/mag"); + +-- Show the terminal. + +local term = l:new_channel(); + +l:start({ + caps = { + fb = mag_caps.svc:create(L4.Proto.Goos, "g=800x460+0+0", "barheight=20"), + term = term:svr(), + }, + }, + "rom/fbterminal"); + +-- Show the hello example. + +l:start({ + log_cap = term, + }, + "rom/hello"); diff -r bbdca5f2432a -r fadcca85dc2a conf/landfall-examples/mips-letux400-fbterminal.list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/mips-letux400-fbterminal.list Sun May 20 16:54:53 2018 +0200 @@ -0,0 +1,22 @@ + +modaddr 0x1100000 + +entry mips-letux400-fbterminal-example +bootstrap bootstrap -serial +kernel fiasco -serial_esc +roottask moe rom/mips-letux400-fbterminal.cfg +module mips-letux400-fbterminal.cfg +module mips-letux400-common.io +module plat-letux400/hw_devices.io +module l4re +module io +module ned +module fb-drv +module mag +module dev_pwm_jz4730 +module dev_backlight_pwm +module dev_display_letux400 +module dev_panel_letux400 +module dev_cpm_jz4730 +module fbterminal +module hello diff -r bbdca5f2432a -r fadcca85dc2a conf/landfall-examples/mips-qi_lb60-fbterminal.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/mips-qi_lb60-fbterminal.cfg Sun May 20 16:54:53 2018 +0200 @@ -0,0 +1,140 @@ +-- vim: ft=lua ts=2 et sw=2 + +-- Start Mag to multiplex the framebuffer showing only a single program. +-- This example shows a framebuffer terminal showing the hello example's output. +-- The target platform is the Ben NanoNote. + +local L4 = require("L4"); + +local l = L4.default_loader; + +-- Define general access to peripherals. + +local io_buses = { + cpm = l:new_channel(); + gpio = l:new_channel(); + lcd = l:new_channel(); + }; + +l:start({ + caps = { + cpm = io_buses.cpm:svr(), + gpio = io_buses.gpio:svr(), + lcd = io_buses.lcd:svr(), + + icu = L4.Env.icu, + sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0), + }, + }, + "rom/io rom/hw_devices.io rom/mips-qi_lb60-common.io"); + +-- Expose a SPI peripheral as a device. + +local spi = l:new_channel(); + +l:startv({ + caps = { + vbus = io_buses.gpio, + spi = spi:svr(), + }, + }, + "rom/dev_spi_jz4740", "C23", "C22", "C21"); -- specifying clock, data, enable pin details + +-- Expose a SPI backlight device for the Ben. + +local backlight = l:new_channel(); -- exposes backlight device + +l:start({ + caps = { + spi = spi, + backlight = backlight:svr(), + }, + }, + "rom/dev_backlight_spi_qi_lb60"); + +-- Expose a display device for the Ben. + +local display = l:new_channel(); -- exposes display device + +l:start({ + caps = { + backlight = backlight, + display = display:svr(), + vbus = io_buses.gpio, + }, + }, + "rom/dev_display_qi_lb60"); + +-- Expose a panel definition for the Ben. + +local panel = l:new_channel(); -- exposes panel + +l:start({ + caps = { + panel = panel:svr(), + }, + }, + "rom/dev_panel_qi_lb60"); + +-- Expose the CPM peripheral. + +local cpm = l:new_channel(); + +l:start({ + caps = { + vbus = io_buses.cpm, + cpm = cpm:svr(), + }, + }, + "rom/dev_cpm_jz4740"); + +-- Expose a framebuffer device. + +local fbdrv_fb = l:new_channel(); + +l:start({ + caps = { + vbus = io_buses.lcd, + fb = fbdrv_fb:svr(), + cpm = cpm, + display = display, -- needed by LCD driver + panel = panel, + }, + }, + "rom/fb-drv"); + +-- Multiplex the framebuffer. + +local mag_caps = { + mag = l:new_channel(), + svc = l:new_channel(), + }; + +l:start({ + caps = { + vbus = io_buses.gpio, -- needed by input driver + fb = fbdrv_fb, + mag = mag_caps.mag:svr(), + svc = mag_caps.svc:svr(), + }, + }, + "rom/mag"); + +-- Show the terminal. + +local term = l:new_channel(); + +l:start({ + caps = { + fb = mag_caps.svc:create(L4.Proto.Goos, "g=320x230+0+0", "barheight=10"), + term = term:svr(), + }, + }, + "rom/fbterminal"); + +-- Show the hello example. + +l:start({ + log_cap = term, + }, + "rom/hello"); diff -r bbdca5f2432a -r fadcca85dc2a conf/landfall-examples/mips-qi_lb60-fbterminal.list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/mips-qi_lb60-fbterminal.list Sun May 20 16:54:53 2018 +0200 @@ -0,0 +1,22 @@ + +modaddr 0x1100000 + +entry mips-qi_lb60-fbterminal-example +bootstrap bootstrap -serial +kernel fiasco -serial_esc +roottask moe rom/mips-qi_lb60-fbterminal.cfg +module mips-qi_lb60-fbterminal.cfg +module mips-qi_lb60-common.io +module plat-qi_lb60/hw_devices.io +module l4re +module io +module ned +module fb-drv +module mag +module dev_spi_jz4740 +module dev_backlight_spi_qi_lb60 +module dev_display_qi_lb60 +module dev_panel_qi_lb60 +module dev_cpm_jz4740 +module fbterminal +module hello