summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/tools/hwstub_shell.cpp
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-04-12 00:08:11 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2014-04-12 00:11:13 +0200
commit238be18d0331a7a87e3ea8ea0d24b78e451357cb (patch)
tree31807bf3fd533d2d0d3d4eb0421b08100cc67c25 /utils/hwstub/tools/hwstub_shell.cpp
parent910235b49a754fcd18157dbd22e125a32b482c9d (diff)
downloadrockbox-238be18d0331a7a87e3ea8ea0d24b78e451357cb.tar.gz
rockbox-238be18d0331a7a87e3ea8ea0d24b78e451357cb.zip
hwstub: add proper PP support
- drop support for PP500x: it's very different from other PP and although it would be possible to support them, I don't have one to test the code - make sure only the CPU is started - add PP descriptor to report chip ID and revision - add code in shell and lua to support pp (no register description yet) - compile for ARMv4 because PP502x is an ARM7TDMI Change-Id: I36c4e465dfc2cfdfe7433b2f65cc8f6f0720fe62
Diffstat (limited to 'utils/hwstub/tools/hwstub_shell.cpp')
-rw-r--r--utils/hwstub/tools/hwstub_shell.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/hwstub/tools/hwstub_shell.cpp b/utils/hwstub/tools/hwstub_shell.cpp
index 61cb617509..cdacd81821 100644
--- a/utils/hwstub/tools/hwstub_shell.cpp
+++ b/utils/hwstub/tools/hwstub_shell.cpp
@@ -44,6 +44,7 @@ struct hwstub_version_desc_t g_hwdev_ver;
struct hwstub_layout_desc_t g_hwdev_layout;
struct hwstub_target_desc_t g_hwdev_target;
struct hwstub_stmp_desc_t g_hwdev_stmp;
+struct hwstub_pp_desc_t g_hwdev_pp;
lua_State *g_lua;
/**
@@ -278,6 +279,8 @@ bool my_lua_import_hwstub()
lua_setfield(g_lua, -2, "UNK");
lua_pushinteger(g_lua, HWSTUB_TARGET_STMP);
lua_setfield(g_lua, -2, "STMP");
+ lua_pushinteger(g_lua, HWSTUB_TARGET_PP);
+ lua_setfield(g_lua, -2, "PP");
lua_pushinteger(g_lua, HWSTUB_TARGET_RK27);
lua_setfield(g_lua, -2, "RK27");
lua_setfield(g_lua, -2, "target");
@@ -293,6 +296,15 @@ bool my_lua_import_hwstub()
lua_setfield(g_lua, -2, "package");
lua_setfield(g_lua, -2, "stmp");
}
+ else if(g_hwdev_target.dID == HWSTUB_TARGET_PP)
+ {
+ lua_newtable(g_lua); // pp
+ lua_pushinteger(g_lua, g_hwdev_pp.wChipID);
+ lua_setfield(g_lua, -2, "chipid");
+ lua_pushlstring(g_lua, (const char *)g_hwdev_pp.bRevision, 2);
+ lua_setfield(g_lua, -2, "rev");
+ lua_setfield(g_lua, -2, "pp");
+ }
lua_pushlightuserdata(g_lua, (void *)&hw_read8);
lua_pushcclosure(g_lua, my_lua_readn, 1);
@@ -791,6 +803,17 @@ int main(int argc, char **argv)
goto Lerr;
}
}
+
+ // get PP specific information
+ if(g_hwdev_target.dID == HWSTUB_TARGET_PP)
+ {
+ ret = hwstub_get_desc(g_hwdev, HWSTUB_DT_PP, &g_hwdev_pp, sizeof(g_hwdev_pp));
+ if(ret != sizeof(g_hwdev_pp))
+ {
+ printf("Cannot get pp: %d\n", ret);
+ goto Lerr;
+ }
+ }
/** Init lua */
// create lua state