diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-12 14:14:30 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-11-12 14:14:30 +0100 |
commit | ec4fa0333c41aebb16e7106b1e9f583eb54aa26c (patch) | |
tree | d9ab85549426807d5a62593bf1031905dbb739c6 | |
parent | dd6b8427f9b4e3d1a13ed81005f9020394001d0c (diff) | |
download | rockbox-ec4fa0333c41aebb16e7106b1e9f583eb54aa26c.tar.gz rockbox-ec4fa0333c41aebb16e7106b1e9f583eb54aa26c.zip |
hwstub: add code to dump STMP rom
Change-Id: I083024662f3c085f7bcd2f85b0a68de85725b0f3
-rw-r--r-- | utils/hwstub/tools/lua/stmp.lua | 3 | ||||
-rw-r--r-- | utils/hwstub/tools/lua/stmp/rom.lua | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/utils/hwstub/tools/lua/stmp.lua b/utils/hwstub/tools/lua/stmp.lua index ea1cde9c6d..2af4d18525 100644 --- a/utils/hwstub/tools/lua/stmp.lua +++ b/utils/hwstub/tools/lua/stmp.lua | |||
@@ -77,4 +77,5 @@ require "stmp/pinctrl" | |||
77 | require "stmp/lcdif" | 77 | require "stmp/lcdif" |
78 | require "stmp/pwm" | 78 | require "stmp/pwm" |
79 | require "stmp/clkctrl" | 79 | require "stmp/clkctrl" |
80 | require "stmp/i2c" \ No newline at end of file | 80 | require "stmp/i2c" |
81 | require "stmp/rom" | ||
diff --git a/utils/hwstub/tools/lua/stmp/rom.lua b/utils/hwstub/tools/lua/stmp/rom.lua new file mode 100644 index 0000000000..fbba75bb3c --- /dev/null +++ b/utils/hwstub/tools/lua/stmp/rom.lua | |||
@@ -0,0 +1,16 @@ | |||
1 | --- | ||
2 | --- ROM | ||
3 | --- | ||
4 | STMP.rom = {} | ||
5 | |||
6 | -- if path is nil, create a generic path that depends on stmp version and rom version | ||
7 | function STMP.rom.dump(path) | ||
8 | local name = path | ||
9 | if name == nil then | ||
10 | name = string.format("stmp%04x_ta%d.bin", hwstub.dev.stmp.chipid, hwstub.dev.stmp.rev + 1) | ||
11 | end | ||
12 | local file = io.open(name, "wb") | ||
13 | file:write(DEV.read(0xffff0000, 0x10000)) | ||
14 | file:close() | ||
15 | print("Dumping ROM to " .. name) | ||
16 | end | ||