diff options
Diffstat (limited to 'utils/hwstub/tools/lua/pp.lua')
-rw-r--r-- | utils/hwstub/tools/lua/pp.lua | 25 |
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 |
43 | end | 43 | end |
44 | 44 | ||
45 | if PP.is_pp611x() then | ||
46 | identify("PP611x (aka GoForce6110)", "pp6110", "pp6110") | ||
47 | elseif PP.is_pp502x() then | ||
48 | identify("PP502x", "pp502x", "pp502x") | ||
49 | elseif PP.is_pp500x() then | ||
50 | identify("PP500x", "pp500x", "pp500x") | ||
51 | else | ||
52 | print(string.format("Unable to identify this chip as a PP: chipid=0x%x", hwstub.dev.pp.chipid)); | ||
53 | end | ||
54 | |||
55 | hh = h:create_topic("debug") | 45 | hh = h:create_topic("debug") |
56 | hh:add("PP.debug(...) prints some debug output if PP.debug_on is true and does nothing otherwise.") | 46 | hh: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 | ||
67 | PP.debug_on = false | 57 | PP.debug_on = false |
68 | 58 | ||
69 | if PP.info.chip ~= nil then | 59 | -- init |
70 | require "pp/gpio" | 60 | function 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 | ||
71 | end | 70 | end |
71 | |||
72 | require "pp/gpio" | ||