summaryrefslogtreecommitdiff
path: root/utils/hwstub/tools/lua/pp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils/hwstub/tools/lua/pp.lua')
-rw-r--r--utils/hwstub/tools/lua/pp.lua25
1 files changed, 13 insertions, 12 deletions
diff --git a/utils/hwstub/tools/lua/pp.lua b/utils/hwstub/tools/lua/pp.lua
index f9234780e5..38a4c1d0a2 100644
--- a/utils/hwstub/tools/lua/pp.lua
+++ b/utils/hwstub/tools/lua/pp.lua
@@ -42,16 +42,6 @@ function PP.is_pp500x()
42 return hwstub.dev.pp.chipid >= 0x5000 and hwstub.dev.pp.chipid < 0x5010 42 return hwstub.dev.pp.chipid >= 0x5000 and hwstub.dev.pp.chipid < 0x5010
43end 43end
44 44
45if PP.is_pp611x() then
46 identify("PP611x (aka GoForce6110)", "pp6110", "pp6110")
47elseif PP.is_pp502x() then
48 identify("PP502x", "pp502x", "pp502x")
49elseif PP.is_pp500x() then
50 identify("PP500x", "pp500x", "pp500x")
51else
52 print(string.format("Unable to identify this chip as a PP: chipid=0x%x", hwstub.dev.pp.chipid));
53end
54
55hh = h:create_topic("debug") 45hh = h:create_topic("debug")
56hh:add("PP.debug(...) prints some debug output if PP.debug_on is true and does nothing otherwise.") 46hh:add("PP.debug(...) prints some debug output if PP.debug_on is true and does nothing otherwise.")
57 47
@@ -66,6 +56,17 @@ hh:add("PP.debug(...) prints some debug output if PP.debug_on is true and does n
66 56
67PP.debug_on = false 57PP.debug_on = false
68 58
69if PP.info.chip ~= nil then 59-- init
70 require "pp/gpio" 60function PP.init()
61 if PP.is_pp611x() then
62 identify("PP611x (aka GoForce6110)", "pp6110", "pp6110")
63 elseif PP.is_pp502x() then
64 identify("PP502x", "pp502x", "pp502x")
65 elseif PP.is_pp500x() then
66 identify("PP500x", "pp500x", "pp500x")
67 else
68 print(string.format("Unable to identify this chip as a PP: chipid=0x%x", hwstub.dev.pp.chipid));
69 end
71end 70end
71
72require "pp/gpio"