summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/lua/jz.lua
blob: ab2cb8658f4ad4c967178447dbc163ccbe8a6ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
--- 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