diff options
Diffstat (limited to 'utils/hwstub/tools/lua/jz.lua')
-rw-r--r-- | utils/hwstub/tools/lua/jz.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/hwstub/tools/lua/jz.lua b/utils/hwstub/tools/lua/jz.lua new file mode 100644 index 0000000000..ab2cb8658f --- /dev/null +++ b/utils/hwstub/tools/lua/jz.lua | |||
@@ -0,0 +1,26 @@ | |||
1 | --- | ||
2 | --- Chip Identification | ||
3 | --- | ||
4 | JZ = { info = {} } | ||
5 | |||
6 | local h = HELP:create_topic("JZ") | ||
7 | h:add("This table contains the abstraction of the different device blocks for the JZ.") | ||
8 | h:add("It allows one to use higher-level primitives rather than poking at register directly.") | ||
9 | |||
10 | hh = h:create_topic("debug") | ||
11 | hh:add("STMP.debug(...) prints some debug output if JZ.debug_on is true and does nothing otherwise.") | ||
12 | |||
13 | JZ.debug_on = false | ||
14 | |||
15 | function STMP.debug(...) | ||
16 | if STMP.debug_on then print(...) end | ||
17 | end | ||
18 | |||
19 | -- init | ||
20 | function JZ.init() | ||
21 | local desc = string.format("jz%04x%c", hwstub.dev.jz.chipid, hwstub.dev.jz.rev) | ||
22 | desc = desc:lower() | ||
23 | if not hwstub.soc:select(desc) then | ||
24 | print("Looking for soc " .. desc .. ": not found. Please load a soc by hand.") | ||
25 | end | ||
26 | end | ||