rockbox/utils/hwstub/tools/lua/jz.lua
Amaury Pouly 4fd9400458 hwstub/tools/shell: add JZ4760B and Fiio X1 code
The jz code can do several useful things like dumping the IPL and SPL.
The Fiio code can play with backlight and has code do dump the IPL
and SPL with the correct parameters (extracted by reverse engineering).

Change-Id: I317b3174f5db8d38c9a56670c1d45565142ec208
2017-01-24 15:17:46 +01:00

30 lines
No EOL
821 B
Lua

---
--- Chip Identification
---
JZ = { info = {} }
local h = HELP:create_topic("JZ")
h:add("This table contains the abstraction of the different device blocks for the JZ.")
h:add("It allows one to use higher-level primitives rather than poking at register directly.")
hh = h:create_topic("debug")
hh:add("STMP.debug(...) prints some debug output if JZ.debug_on is true and does nothing otherwise.")
JZ.debug_on = false
function STMP.debug(...)
if STMP.debug_on then print(...) end
end
-- init
function JZ.init()
local desc = string.format("jz%04x%c", hwstub.dev.jz.chipid, hwstub.dev.jz.rev)
desc = desc:lower()
if not hwstub.soc:select(desc) then
print("Looking for soc " .. desc .. ": not found. Please load a soc by hand.")
end
end
require "jz/gpio"
require "jz/lcd"
require "jz/nand"