diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-09-05 23:14:07 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-09-05 23:16:27 +0200 |
| commit | f40b15d0cbe726e72652fcd8ff775d08b19affda (patch) | |
| tree | c1ba87d1be4dedea86825e45c30e4ee19a9b21e3 /utils/hwstub/tools/lua/stmp/lcdif.lua | |
| parent | f13cad4c8ef0dae4393682d7da294ce63f0eb7f7 (diff) | |
| download | rockbox-f40b15d0cbe726e72652fcd8ff775d08b19affda.zip rockbox-f40b15d0cbe726e72652fcd8ff775d08b19affda.tar.gz rockbox-f40b15d0cbe726e72652fcd8ff775d08b19affda.tar.bz2 rockbox-f40b15d0cbe726e72652fcd8ff775d08b19affda.tar.xz | |
hwstub: improve lcdif, digtctl, add sony nwz-e370
Change-Id: I5316cc9fd9addfca8a674628695fed1c1bf9269f
Diffstat (limited to 'utils/hwstub/tools/lua/stmp/lcdif.lua')
| -rw-r--r-- | utils/hwstub/tools/lua/stmp/lcdif.lua | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/utils/hwstub/tools/lua/stmp/lcdif.lua b/utils/hwstub/tools/lua/stmp/lcdif.lua index 0878cb1..a2f085e 100644 --- a/utils/hwstub/tools/lua/stmp/lcdif.lua +++ b/utils/hwstub/tools/lua/stmp/lcdif.lua @@ -29,6 +29,18 @@ function STMP.lcdif.set_reset(val) end end +function STMP.lcdif.set_databus_width(bus_width) + local v = 0 + if bus_width == 8 then + v = 1 + elseif bus_width == 18 then + v = 2 + elseif bus_width == 24 then + v = 3 + end + HW.LCDIF.CTRL.LCD_DATABUS_WIDTH.write(v) +end + function STMP.lcdif.set_word_length(bus_width) if STMP.is_stmp3600() or STMP.is_stmp3700() then if bus_width == 8 then @@ -37,7 +49,15 @@ function STMP.lcdif.set_word_length(bus_width) HW.LCDIF.CTRL.WORD_LENGTH.clr() end else - error("STMP.lcdif.set_word_length: unimplemented") + local v = 0 + if bus_width == 8 then + v = 1 + elseif bus_width == 18 then + v = 2 + elseif bus_width == 24 then + v = 3 + end + HW.LCDIF.CTRL.WORD_LENGTH.write(v) end end @@ -49,7 +69,11 @@ function STMP.lcdif.get_word_length() return 16 end else - error("STMP.lcdif.get_word_length: unimplemented") + local v = HW.LCDIF.CTRL.WORD_LENGTH.read() + if v == 0 then return 16 + elseif v == 1 then return 8 + elseif v == 2 then return 18 + else return 24 end end end @@ -62,7 +86,11 @@ function STMP.lcdif.set_data_swizzle(swizzle) error("unimplemented") end end - HW.LCDIF.CTRL.DATA_SWIZZLE.write(v) + if STMP.is_stmp3600() or STMP.is_stmp3700() then + HW.LCDIF.CTRL.DATA_SWIZZLE.write(v) + else + HW.LCDIF.CTRL.INPUT_DATA_SWIZZLE.write(v) + end end function STMP.lcdif.is_busy() @@ -73,6 +101,11 @@ function STMP.lcdif.is_busy() end end +function STMP.lcdif.wait_ready() + while HW.LCDIF.CTRL.RUN.read() == 1 do + end +end + function STMP.lcdif.send_pio(data_mode, data) local wl = STMP.lcdif.get_word_length() if data_mode then @@ -81,8 +114,16 @@ function STMP.lcdif.send_pio(data_mode, data) HW.LCDIF.CTRL.DATA_SELECT.clr() end STMP.debug(string.format("lcdif: count = %d", #data)) + if STMP.is_imx233() then + HW.LCDIF.CTRL.LCDIF_MASTER.clr() + end HW.LCDIF.CTRL.RUN.clr() - HW.LCDIF.CTRL.COUNT.write(#data) + if STMP.is_stmp3600() or STMP.is_stmp3700() then + HW.LCDIF.CTRL.COUNT.write(#data) + else + HW.LCDIF.TRANSFER_COUNT.V_COUNT.write(1) + HW.LCDIF.TRANSFER_COUNT.H_COUNT.write(#data) + end HW.LCDIF.CTRL.RUN.set() local i = 1 while i <= #data do @@ -97,4 +138,5 @@ function STMP.lcdif.send_pio(data_mode, data) while STMP.lcdif.is_busy() do STMP.debug("lcdif: fifo full") end HW.LCDIF.DATA.write(v) end + STMP.lcdif.wait_ready() end
\ No newline at end of file |