# HG changeset patch # User Paul Boddie # Date 1527546345 -7200 # Node ID c63bf838295136fd6f088be1e30e52182aeefd36 # Parent 4087e1c2b12a29c0e738ce0032c1a770f299a1de Replaced panel servers with libraries providing the data that are dynamically loaded by the LCD device library. A special file is used to indicate which library is required and both the file and the library must be specified as modules in the payload manifest. Added a tool to configure the special file according to the platform type. diff -r 4087e1c2b12a -r c63bf8382951 README.txt --- a/README.txt Mon May 28 23:44:25 2018 +0200 +++ b/README.txt Tue May 29 00:25:45 2018 +0200 @@ -26,6 +26,22 @@ configuring and building the software. Building can be done after the steps described below. +Configuring this Software +------------------------- + +Some files may need to be adjusted for the device on which the software is to +be deployed. A script is provided to check and update them: + +$LANDFALL/tools/checkconfig.sh + +(Here, $LANDFALL needs to expand to the location of this distribution.) + +For example: + +$LANDFALL/tools/checkconfig.sh qi_lb60 + +This configures the files for the Ben NanoNote. + Installing this Software ------------------------ @@ -89,7 +105,6 @@ input - input event delivery keypad - keypad/keyboard scanning lcd - LCD and other display peripheral support - panel - device-specific panel definitions pwm - pulse width modulation support spi - serial peripheral interface support @@ -130,7 +145,6 @@ \-> dev_display_qi_lb60 Display control \-> dev_backlight_spi_ili8960 Backlight control \-> dev_spi_jz4740 Backlight communication - \-> dev_panel_qi_lb60 Panel information And here is how the Letux 400's framebuffer is supported: @@ -138,15 +152,14 @@ \-> dev_display_letux400 Display control \-> dev_backlight_pwm Backlight control \-> dev_pwm_jz4730 Backlight communication - \-> dev_panel_letux400 Panel information (*) fb-drv links to the same generic JZ4740 LCD controller library in both cases Here, the CPM device provides access to the clock and power management functionality, the display device provides access to the backlight and is -responsible for configuring pins for the display, and the panel device -provides information about the screen that the LCD controller needs. +responsible for configuring pins for the display. Panel information is +provided via a dynamically-loaded library. Potential Improvements ---------------------- @@ -159,9 +172,9 @@ by libraries. For example, GPIO functionality is currently not exposed via a server. -Panel device servers may eventually be replaced by simple resources given that -their only job is to provide precomputed data via a capability channel. This -could be done using a file bundled with the payload. +Panel details are provided by libraries containing the structure definitions +required by the LCD device code. These libraries may eventually be replaced by +simple resource data files. Framebuffer device servers are not currently used, since fb-drv effectively offers the desired functionality together with other things. diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-jz4740-panel.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/mips-jz4740-panel.txt Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,1 @@ +rom/libpanel_qi_lb60.so \ No newline at end of file diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-fbdrv.cfg --- a/conf/landfall-examples/mips-letux400-fbdrv.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-fbdrv.cfg Tue May 29 00:25:45 2018 +0200 @@ -66,17 +66,6 @@ }, "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(); @@ -99,7 +88,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-fbdrv.list --- a/conf/landfall-examples/mips-letux400-fbdrv.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-fbdrv.list Tue May 29 00:25:45 2018 +0200 @@ -15,5 +15,6 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-fbterminal.cfg --- a/conf/landfall-examples/mips-letux400-fbterminal.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-fbterminal.cfg Tue May 29 00:25:45 2018 +0200 @@ -67,17 +67,6 @@ }, "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(); @@ -100,7 +89,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-fbterminal.list --- a/conf/landfall-examples/mips-letux400-fbterminal.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-fbterminal.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,8 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module fbterminal module hello +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-input-event-client.cfg --- a/conf/landfall-examples/mips-letux400-input-event-client.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-input-event-client.cfg Tue May 29 00:25:45 2018 +0200 @@ -67,17 +67,6 @@ }, "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(); @@ -100,7 +89,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-input-event-client.list --- a/conf/landfall-examples/mips-letux400-input-event-client.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-input-event-client.list Tue May 29 00:25:45 2018 +0200 @@ -16,8 +16,9 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module dev_keypad_letux400 module dev_input_keypad_letux400 module ex_input_event_client +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad-demo.cfg --- a/conf/landfall-examples/mips-letux400-keypad-demo.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad-demo.cfg Tue May 29 00:25:45 2018 +0200 @@ -67,17 +67,6 @@ }, "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(); @@ -100,7 +89,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad-demo.list --- a/conf/landfall-examples/mips-letux400-keypad-demo.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad-demo.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,6 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module dev_keypad_letux400 module dev_input_keypad_letux400 @@ -24,3 +23,5 @@ module ex_keypad_ds_client module ex_letux400_backlight module ex_letux400_keypad_physical +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad-ds.cfg --- a/conf/landfall-examples/mips-letux400-keypad-ds.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad-ds.cfg Tue May 29 00:25:45 2018 +0200 @@ -68,17 +68,6 @@ }, "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(); @@ -101,7 +90,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad-ds.list --- a/conf/landfall-examples/mips-letux400-keypad-ds.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad-ds.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,8 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module dev_keypad_letux400 module ex_keypad_ds_client +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad.cfg --- a/conf/landfall-examples/mips-letux400-keypad.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad.cfg Tue May 29 00:25:45 2018 +0200 @@ -67,17 +67,6 @@ }, "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(); @@ -100,7 +89,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-keypad.list --- a/conf/landfall-examples/mips-letux400-keypad.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-keypad.list Tue May 29 00:25:45 2018 +0200 @@ -16,9 +16,10 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module ex_letux400_keypad +module libpanel_letux400.so +module mips-jz4740-panel.txt module lib4re-c.so module lib4re-c-util.so module lib4re.so diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-lcd-driver.cfg --- a/conf/landfall-examples/mips-letux400-lcd-driver.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-lcd-driver.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -96,7 +85,6 @@ vbus = io_buses.lcd, cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/ex_jz4740_lcd_driver"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-lcd-driver.list --- a/conf/landfall-examples/mips-letux400-lcd-driver.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-lcd-driver.list Tue May 29 00:25:45 2018 +0200 @@ -14,6 +14,7 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module ex_jz4740_lcd_driver +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-spectrum.cfg --- a/conf/landfall-examples/mips-letux400-spectrum.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-spectrum.cfg Tue May 29 00:25:45 2018 +0200 @@ -67,17 +67,6 @@ }, "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(); @@ -100,7 +89,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-letux400-spectrum.list --- a/conf/landfall-examples/mips-letux400-spectrum.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-letux400-spectrum.list Tue May 29 00:25:45 2018 +0200 @@ -16,6 +16,7 @@ module dev_pwm_jz4730 module dev_backlight_pwm module dev_display_letux400 -module dev_panel_letux400 module dev_cpm_jz4730 module ex_fb_spectrum_cc +module libpanel_letux400.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-dl-example.cfg --- a/conf/landfall-examples/mips-qi_lb60-dl-example.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-dl-example.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,35 +87,10 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); --- Expose the keypad matrix. - -local keypad = l:new_channel(); - -l:start({ - caps = { - vbus = io_buses.gpio, - keypad = keypad:svr(), - }, - }, - "rom/dev_keypad_qi_lb60"); - --- Expose the keypad events. - -local ev = l:new_channel(); - -l:start({ - caps = { - keypad = keypad, - ev = ev:svr(), - }, - }, - "rom/dev_input_keypad_qi_lb60"); - -- Multiplex the framebuffer. local mag_caps = { @@ -140,7 +104,6 @@ fb = fbdrv_fb, mag = mag_caps.mag:svr(), svc = mag_caps.svc:svr(), - ev = ev, }, }, "rom/mag"); @@ -157,7 +120,7 @@ }, "rom/fbterminal"); --- Show the hello example. +-- Show the dynamic loading example. l:start({ log_cap = term, diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-dl-example.list --- a/conf/landfall-examples/mips-qi_lb60-dl-example.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-dl-example.list Tue May 29 00:25:45 2018 +0200 @@ -16,10 +16,11 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module dev_keypad_qi_lb60 module dev_input_keypad_qi_lb60 module fbterminal module ex_dl_test module libdl_test_data.so +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-fbdrv.cfg --- a/conf/landfall-examples/mips-qi_lb60-fbdrv.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-fbdrv.cfg Tue May 29 00:25:45 2018 +0200 @@ -64,17 +64,6 @@ }, "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(); @@ -97,7 +86,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-fbdrv.list --- a/conf/landfall-examples/mips-qi_lb60-fbdrv.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-fbdrv.list Tue May 29 00:25:45 2018 +0200 @@ -15,5 +15,6 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-fbterminal.cfg --- a/conf/landfall-examples/mips-qi_lb60-fbterminal.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-fbterminal.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,7 +87,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-fbterminal.list --- a/conf/landfall-examples/mips-qi_lb60-fbterminal.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-fbterminal.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,8 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module fbterminal module hello +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-input-event-client.cfg --- a/conf/landfall-examples/mips-qi_lb60-input-event-client.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-input-event-client.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,7 +87,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-input-event-client.list --- a/conf/landfall-examples/mips-qi_lb60-input-event-client.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-input-event-client.list Tue May 29 00:25:45 2018 +0200 @@ -16,8 +16,9 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module dev_keypad_qi_lb60 module dev_input_keypad_qi_lb60 module ex_input_event_client +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad-demo.cfg --- a/conf/landfall-examples/mips-qi_lb60-keypad-demo.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-demo.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,7 +87,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad-demo.list --- a/conf/landfall-examples/mips-qi_lb60-keypad-demo.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-demo.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,6 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module dev_keypad_qi_lb60 module dev_input_keypad_qi_lb60 @@ -24,3 +23,5 @@ module ex_keypad_ds_client module ex_qi_lb60_keypad_physical module ex_qi_lb60_backlight +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad-ds.cfg --- a/conf/landfall-examples/mips-qi_lb60-keypad-ds.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-ds.cfg Tue May 29 00:25:45 2018 +0200 @@ -66,17 +66,6 @@ }, "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(); @@ -99,7 +88,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad-ds.list --- a/conf/landfall-examples/mips-qi_lb60-keypad-ds.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad-ds.list Tue May 29 00:25:45 2018 +0200 @@ -16,7 +16,8 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module dev_keypad_qi_lb60 module ex_keypad_ds_client +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad.cfg --- a/conf/landfall-examples/mips-qi_lb60-keypad.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,7 +87,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-keypad.list --- a/conf/landfall-examples/mips-qi_lb60-keypad.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-keypad.list Tue May 29 00:25:45 2018 +0200 @@ -16,6 +16,7 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module ex_qi_lb60_keypad +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-lcd-driver.cfg --- a/conf/landfall-examples/mips-qi_lb60-lcd-driver.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-lcd-driver.cfg Tue May 29 00:25:45 2018 +0200 @@ -63,17 +63,6 @@ }, "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(); @@ -94,7 +83,6 @@ vbus = io_buses.lcd, cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/ex_jz4740_lcd_driver"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-lcd-driver.list --- a/conf/landfall-examples/mips-qi_lb60-lcd-driver.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-lcd-driver.list Tue May 29 00:25:45 2018 +0200 @@ -14,6 +14,7 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module ex_jz4740_lcd_driver +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-spectrum.cfg --- a/conf/landfall-examples/mips-qi_lb60-spectrum.cfg Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-spectrum.cfg Tue May 29 00:25:45 2018 +0200 @@ -65,17 +65,6 @@ }, "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(); @@ -98,7 +87,6 @@ fb = fbdrv_fb:svr(), cpm = cpm, display = display, -- needed by LCD driver - panel = panel, }, }, "rom/fb-drv"); diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/mips-qi_lb60-spectrum.list --- a/conf/landfall-examples/mips-qi_lb60-spectrum.list Mon May 28 23:44:25 2018 +0200 +++ b/conf/landfall-examples/mips-qi_lb60-spectrum.list Tue May 29 00:25:45 2018 +0200 @@ -16,6 +16,7 @@ module dev_spi_jz4740 module dev_backlight_spi_ili8960 module dev_display_qi_lb60 -module dev_panel_qi_lb60 module dev_cpm_jz4740 module ex_fb_spectrum_cc +module libpanel_qi_lb60.so +module mips-jz4740-panel.txt diff -r 4087e1c2b12a -r c63bf8382951 conf/landfall-examples/platforms.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/landfall-examples/platforms.txt Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,3 @@ +ci20 +letux400 +qi_lb60 diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/Control --- a/pkg/devices/Control Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/Control Tue May 29 00:25:45 2018 +0200 @@ -10,8 +10,6 @@ provides: devices-input-keypad-qi_lb60 provides: devices-keypad-letux400 provides: devices-keypad-qi_lb60 -provides: devices-panel-letux400 -provides: devices-panel-qi_lb60 provides: devices-pwm-jz4730 provides: devices-spi-jz4740 provides: libdevice-backlight-client @@ -32,9 +30,6 @@ provides: libdevice-keypad-server provides: libdevice-lcd provides: libdevice-lcd-jz4740 -provides: libdevice-panel-client -provides: libdevice-panel-ops -provides: libdevice-panel-server provides: libdevice-pwm-client provides: libdevice-spi-client provides: libdevice-util @@ -47,6 +42,9 @@ provides: libdrivers-keypad-qi_lb60 provides: libdrivers-lcd-headers provides: libdrivers-lcd-jz4740 +provides: libdrivers-panel-headers +provides: libdrivers-panel-letux400 +provides: libdrivers-panel-qi_lb60 provides: libdrivers-pwm requires: libc l4re_c libio Maintainer: paul@boddie.org.uk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/Makefile --- a/pkg/devices/Makefile Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/Makefile Tue May 29 00:25:45 2018 +0200 @@ -1,7 +1,7 @@ PKGDIR = . L4DIR ?= $(PKGDIR)/../.. -TARGET = backlight cpm display fb input keypad lcd lib panel pwm spi util +TARGET = backlight cpm display fb input keypad lcd lib pwm spi util include $(L4DIR)/mk/subdir.mk @@ -15,7 +15,6 @@ fb: lcd lib util input: keypad lib keypad: lib util -lcd: display panel lib util -panel: lib +lcd: display lib util pwm: lib util spi: lib util diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lcd/src/jz4740/Makefile --- a/pkg/devices/lcd/src/jz4740/Makefile Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/lcd/src/jz4740/Makefile Tue May 29 00:25:45 2018 +0200 @@ -8,6 +8,6 @@ PRIVATE_INCDIR += $(PKGDIR)/lcd/include -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-lcd libdrivers-lcd-jz4740 libdevice-cpm-client libdevice-panel-client libdevice-util +REQUIRES_LIBS := l4re_c l4re_c-util libdevice-lcd libdrivers-lcd-jz4740 libdrivers-panel-headers libdevice-cpm-client libdevice-util include $(L4DIR)/mk/lib.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc --- a/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Tue May 29 00:25:45 2018 +0200 @@ -21,8 +21,8 @@ #include #include -#include #include +#include #include #include "lcd-jz4740-device.h" @@ -39,17 +39,16 @@ static l4_addr_t lcd_virt_base = 0, lcd_virt_base_end = 0; -// LCD, CPM, display and panel device abstractions. +// LCD, CPM and display device abstractions. static Lcd_jz4740_chip *lcd_chip = 0; static L4::Cap cpm_device; static L4::Cap display_device; -static L4::Cap panel_device; // Panel definition. -static struct Jz4740_lcd_panel panel; +static struct Jz4740_lcd_panel *panel; @@ -239,7 +238,7 @@ if (get_memory("jz4740-lcd", &lcd_virt_base, &lcd_virt_base_end)) return 1; - // Obtain access to the CPM, display and panel devices. + // Obtain access to the CPM and display devices. cpm_device = L4Re::Env::env()->get_cap("cpm"); if (!cpm_device.is_valid()) return 1; @@ -247,17 +246,17 @@ display_device = L4Re::Env::env()->get_cap("display"); if (!display_device.is_valid()) return 1; - panel_device = L4Re::Env::env()->get_cap("panel"); - if (!panel_device.is_valid()) return 1; + // Load the panel data. - // Populate the panel. + void *(*panel_get)(void); + panel_get = (void *(*)(void)) load_function("rom/mips-jz4740-panel.txt", "panel_get"); + if (!panel_get) return 1; - if (panel_device->get_panel((uint8_t *) &panel, sizeof(panel))) - return 1; + panel = (struct Jz4740_lcd_panel *) panel_get(); // Initialise the LCD abstraction. - lcd_chip = new Lcd_jz4740_chip(lcd_virt_base, &panel); + lcd_chip = new Lcd_jz4740_chip(lcd_virt_base, panel); return 0; } diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/Makefile --- a/pkg/devices/lib/Makefile Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/lib/Makefile Tue May 29 00:25:45 2018 +0200 @@ -1,7 +1,7 @@ PKGDIR ?= .. L4DIR ?= $(PKGDIR)/../.. -TARGET := common cpm gpio i2c keypad lcd pwm +TARGET := common cpm gpio i2c keypad lcd panel pwm include $(L4DIR)/mk/subdir.mk @@ -10,4 +10,5 @@ i2c: common keypad: common lcd: common +panel: lcd pwm: common diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/lcd/include/lcd-jz4740-config.h --- a/pkg/devices/lib/lcd/include/lcd-jz4740-config.h Mon May 28 23:44:25 2018 +0200 +++ b/pkg/devices/lib/lcd/include/lcd-jz4740-config.h Tue May 29 00:25:45 2018 +0200 @@ -21,7 +21,7 @@ #pragma once -enum Jz4740_lcd_config_bits : unsigned +enum Jz4740_lcd_config_bits { Jz4740_lcd_config_lcd_pin = 31, /* LCDPIN */ Jz4740_lcd_config_tv_pal_halfline = 30, /* JZ4780: TVEPEH */ @@ -49,14 +49,14 @@ Jz4740_lcd_config_mode = 0, }; -enum Jz4740_lcd_bpp_values : unsigned +enum Jz4740_lcd_bpp_values { Jz4740_lcd_bpp_16 = 0, Jz4740_lcd_bpp_24 = 1, /* JZ4780 */ Jz4740_lcd_bpp_18 = 2, }; -enum Jz4740_lcd_modes : unsigned +enum Jz4740_lcd_modes { Jz4740_lcd_mode_tft_generic = 0, /* parallel 16/18/24-bit panel */ Jz4740_lcd_mode_tft_sharp = 1, @@ -72,7 +72,7 @@ Jz4740_lcd_mode_lcm = 13, /* JZ4780 */ }; -enum Jz4740_lcd_config_values : unsigned +enum Jz4740_lcd_config_values { Jz4740_lcd_de_positive = 0 << Jz4740_lcd_config_de_active_low, Jz4740_lcd_de_negative = 1 << Jz4740_lcd_config_de_active_low, diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/Makefile Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,8 @@ +PKGDIR ?= ../.. +L4DIR ?= $(PKGDIR)/../.. + +TARGET := include src + +include $(L4DIR)/mk/subdir.mk + +src: include diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/include/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/include/Makefile Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,6 @@ +PKGDIR = ../../.. +L4DIR ?= $(PKGDIR)/../.. + +PC_FILENAME := libdrivers-panel-headers + +include $(L4DIR)/mk/include.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/include/panel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/include/panel.h Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,32 @@ +/* + * Panel description access. + * + * (c) 2018 Paul Boddie + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA + */ + +#pragma once + +#include + +/* C language interface. */ + +EXTERN_C_BEGIN + +void *panel_get(void); + +EXTERN_C_END diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/src/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/src/Makefile Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,6 @@ +PKGDIR ?= ../../.. +L4DIR ?= $(PKGDIR)/../.. + +TARGET := letux400 qi_lb60 + +include $(L4DIR)/mk/subdir.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/src/letux400/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/src/letux400/Makefile Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,13 @@ +PKGDIR ?= ../../../.. +L4DIR ?= $(PKGDIR)/../.. + +TARGET = libpanel_letux400.so +PC_FILENAME := libdrivers-panel-letux400 + +SRC_C := panel-letux400.c + +PRIVATE_INCDIR += $(PKGDIR)/lib/panel/include + +REQUIRES_LIBS := libdrivers-lcd-headers + +include $(L4DIR)/mk/lib.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/src/letux400/panel-letux400.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/src/letux400/panel-letux400.c Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,52 @@ +/* + * Export a panel structure for the Letux 400 notebook computer. + * + * (c) 2018 Paul Boddie + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA + */ + +#include +#include + +static struct Jz4740_lcd_panel panel = { + .config = ( + Jz4740_lcd_mode_tft_generic + | Jz4740_lcd_pclock_negative + | Jz4740_lcd_hsync_negative + | Jz4740_lcd_vsync_negative + | Jz4740_lcd_de_positive), + + .width = 800, + .height = 480, + .bpp = 16, + .frame_rate = 60, + .hsync = 80, + .vsync = 20, + .line_start = 0, + .line_end = 0, + .frame_start = 0, + .frame_end = 0, +}; + +/* Employ an opaque pointer type. */ + +void *panel_get(void); + +void *panel_get(void) +{ + return &panel; +} diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/src/qi_lb60/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/src/qi_lb60/Makefile Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,13 @@ +PKGDIR ?= ../../../.. +L4DIR ?= $(PKGDIR)/../.. + +TARGET = libpanel_qi_lb60.so +PC_FILENAME := libdrivers-panel-qi_lb60 + +SRC_C := panel-qi_lb60.c + +PRIVATE_INCDIR += $(PKGDIR)/lib/panel/include + +REQUIRES_LIBS := libdrivers-lcd-headers + +include $(L4DIR)/mk/lib.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/lib/panel/src/qi_lb60/panel-qi_lb60.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pkg/devices/lib/panel/src/qi_lb60/panel-qi_lb60.c Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,52 @@ +/* + * Export a panel structure for the Ben NanoNote. + * + * (c) 2018 Paul Boddie + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA + */ + +#include +#include + +static struct Jz4740_lcd_panel panel = { + .config = ( + Jz4740_lcd_mode_tft_serial + | Jz4740_lcd_pclock_negative + | Jz4740_lcd_hsync_negative + | Jz4740_lcd_vsync_negative + | Jz4740_lcd_de_positive), + + .width = 320, + .height = 240, + .bpp = 32, + .frame_rate = 70, + .hsync = 1, + .vsync = 1, + .line_start = 140, + .line_end = 273, + .frame_start = 20, + .frame_end = 1, +}; + +/* Employ an opaque pointer type. */ + +void *panel_get(void); + +void *panel_get(void) +{ + return &panel; +} diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/Makefile --- a/pkg/devices/panel/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -PKGDIR ?= .. -L4DIR ?= $(PKGDIR)/../.. - -TARGET := include src - -include $(L4DIR)/mk/subdir.mk - -src: include diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/include/Makefile --- a/pkg/devices/panel/include/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -PKGDIR = ../.. -L4DIR ?= $(PKGDIR)/../.. - -PC_FILENAME := libdevice-panel-ops - -include $(L4DIR)/mk/include.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/include/panel-client.h --- a/pkg/devices/panel/include/panel-client.h Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* - * Panel client to access panel servers. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#pragma once - -#ifdef __cplusplus - -#include -#include - -#include - -class Panel_device_interface : public L4::Kobject_t -{ - L4_KOBJECT(Panel_device_interface) - -public: - int get_panel(uint8_t *data, unsigned long datalen) throw(); -}; - -#endif diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/include/panel-ops.h --- a/pkg/devices/panel/include/panel-ops.h Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* - * Panel server operations. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#pragma once - -enum { Panel_op_get_panel }; diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/include/panel-server.h --- a/pkg/devices/panel/include/panel-server.h Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* - * Common panel server functionality. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#pragma once - -#ifdef __cplusplus - -#include -#include -#include - -/* Server object to provide panel data access. */ - -class Panel_server : public L4::Server_object_t -{ -private: - void *_panel; - unsigned long _size; - -public: - /* Initialise the server with an opaque pointer to the panel data and the - size of the data. */ - - explicit Panel_server(void *panel, unsigned long size) - : _panel(panel), _size(size) - {} - - int dispatch(l4_umword_t obj, L4::Ipc::Iostream &ios); -}; - -#endif diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/Makefile --- a/pkg/devices/panel/src/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -PKGDIR ?= ../.. -L4DIR ?= $(PKGDIR)/../.. - -TARGET := client letux400 qi_lb60 server - -include $(L4DIR)/mk/subdir.mk - -letux400: server -qi_lb60: server diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/client/Makefile --- a/pkg/devices/panel/src/client/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. - -TARGET = libdevice_panel_client.o.a -PC_FILENAME := libdevice-panel-client - -SRC_CC := panel-client.cc - -PRIVATE_INCDIR += $(PKGDIR)/panel/include - -REQUIRES_LIBS := l4re_c l4re_c-util - -include $(L4DIR)/mk/lib.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/client/panel-client.cc --- a/pkg/devices/panel/src/client/panel-client.cc Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * Panel client to access panel servers. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#include -#include -#include - -#include "panel-client.h" -#include "panel-ops.h" - -#include - -int -Panel_device_interface::get_panel(uint8_t *data, unsigned long datalen) throw() -{ - L4::Ipc::Iostream s(l4_utcb()); - - int err = l4_error(s.call(cap(), Panel_op_get_panel)); - if (err) return err; - - // Obtain the message from the stream. - - unsigned long size = datalen; - s >> L4::Ipc::buf_cp_in(data, datalen); - - if (size != datalen) return -L4_EIO; - return L4_EOK; -} diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/letux400/Makefile --- a/pkg/devices/panel/src/letux400/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. - -TARGET = dev_panel_letux400 -PC_FILENAME := devices-panel-letux400 - -SRC_CC := panel-letux400.cc - -PRIVATE_INCDIR += $(PKGDIR)/panel/include - -REQUIRES_LIBS := l4re_c l4re_c-util libdrivers-lcd-headers libdevice-panel-server - -include $(L4DIR)/mk/prog.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/letux400/panel-letux400.cc --- a/pkg/devices/panel/src/letux400/panel-letux400.cc Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* - * Export a panel structure. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#include -#include -#include "panel-server.h" - -#include - -static struct Jz4740_lcd_panel panel = { - .config = ( - Jz4740_lcd_mode_tft_generic - | Jz4740_lcd_pclock_negative - | Jz4740_lcd_hsync_negative - | Jz4740_lcd_vsync_negative - | Jz4740_lcd_de_positive), - - .width = 800, - .height = 480, - .bpp = 16, - .frame_rate = 60, - .hsync = 80, - .vsync = 20, - .line_start = 0, - .line_end = 0, - .frame_start = 0, - .frame_end = 0, -}; - -static L4Re::Util::Registry_server<> server; - -int main(void) -{ - /* Initialise and register a new server object. */ - - Panel_server server_obj(&panel, sizeof(panel)); - server.registry()->register_obj(&server_obj, "panel"); - - /* Enter the IPC server loop. */ - - server.loop(); - return 0; -} diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/qi_lb60/Makefile --- a/pkg/devices/panel/src/qi_lb60/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. - -TARGET = dev_panel_qi_lb60 -PC_FILENAME := devices-panel-qi_lb60 - -SRC_CC := panel-qi_lb60.cc - -PRIVATE_INCDIR += $(PKGDIR)/panel/include - -REQUIRES_LIBS := l4re_c l4re_c-util libdrivers-lcd-headers libdevice-panel-server - -include $(L4DIR)/mk/prog.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/qi_lb60/panel-qi_lb60.cc --- a/pkg/devices/panel/src/qi_lb60/panel-qi_lb60.cc Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* - * Export a panel structure. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#include -#include -#include "panel-server.h" - -#include - -static struct Jz4740_lcd_panel panel = { - .config = ( - Jz4740_lcd_mode_tft_serial - | Jz4740_lcd_pclock_negative - | Jz4740_lcd_hsync_negative - | Jz4740_lcd_vsync_negative - | Jz4740_lcd_de_positive), - - .width = 320, - .height = 240, - .bpp = 32, - .frame_rate = 70, - .hsync = 1, - .vsync = 1, - .line_start = 140, - .line_end = 273, - .frame_start = 20, - .frame_end = 1, -}; - -static L4Re::Util::Registry_server<> server; - -int main(void) -{ - /* Initialise and register a new server object. */ - - Panel_server server_obj(&panel, sizeof(panel)); - server.registry()->register_obj(&server_obj, "panel"); - - /* Enter the IPC server loop. */ - - server.loop(); - return 0; -} diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/server/Makefile --- a/pkg/devices/panel/src/server/Makefile Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -PKGDIR ?= ../../.. -L4DIR ?= $(PKGDIR)/../.. - -TARGET = libdevice_panel_server.o.a -PC_FILENAME := libdevice-panel-server - -SRC_CC := panel-server.cc - -PRIVATE_INCDIR += $(PKGDIR)/panel/include - -REQUIRES_LIBS := l4re_c l4re_c-util - -include $(L4DIR)/mk/lib.mk diff -r 4087e1c2b12a -r c63bf8382951 pkg/devices/panel/src/server/panel-server.cc --- a/pkg/devices/panel/src/server/panel-server.cc Mon May 28 23:44:25 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* - * Common panel server functionality. - * - * (c) 2018 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#include "panel-client.h" -#include "panel-server.h" -#include "panel-ops.h" - -#include -#include -#include -#include - -/* Handle invocations. */ - -int -Panel_server::dispatch(l4_umword_t obj, L4::Ipc::Iostream &ios) -{ - l4_msgtag_t tag; - - (void) obj; - ios >> tag; - - switch (tag.label()) - { - case L4::Meta::Protocol: - return L4::Util::handle_meta_request(ios); - - case Panel_op_get_panel: - ios << L4::Ipc::buf_cp_out((uint8_t *) _panel, _size); - return L4_EOK; - - default: - return -L4_EBADPROTO; - } -} diff -r 4087e1c2b12a -r c63bf8382951 tools/checkconfig.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/checkconfig.sh Tue May 29 00:25:45 2018 +0200 @@ -0,0 +1,57 @@ +#!/bin/sh + +if ! which realpath > /dev/null ; then + echo "Please install the realpath program." 1>&2 + exit 1 +fi + +THISDIR=`dirname "$0"` +DIRNAME=`realpath "$THISDIR/.."` +PROGNAME=`basename "$0"` + +if [ "$1" = '--help' ] || [ ! "$1" ] ; then + cat 1>&2 < | + +Update platform-specific files for the indicated platform type. If a build +directory is specified, try and obtain a configured platform type and use that +to update the files. + +This program updates files in the distribution. They must then be installed +using the install program: + +$THISDIR/install.sh +EOF + exit 1 +fi + +# Check for a build directory and obtain a platform type. + +if [ -e "$1" ] && [ -e "$1/.config.platform" ] ; then + PLATFORM=`grep -e 'CONFIG_PLATFORM_TYPE=' "$1/.config.platform" | sed 's/^.*"\(.*\)".*$/\1/'` + +# Check for a recognised platform type. + +elif grep -q -F -e "$1" "$DIRNAME/conf/landfall-examples/platforms.txt" ; then + PLATFORM="$1" + +# Show an error for anything else. + +else + cat 1>&2 < "$PANELCONF"