diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-02-25 14:50:06 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2013-02-25 19:26:05 +0100 |
commit | fc91d65aefb95900153277849949822d2f065677 (patch) | |
tree | d75231ea2c78bb22ad22d1fc335656ce5d08e8d3 | |
parent | 899e7c1b4da9e38a6e5c3b4b56cc5b6bc5d6dd21 (diff) |
Drop io_base_post
Add a field .decode in filter to control if it operates on
a set of fixed addresses or a range.
Change-Id: I56a1403dcd0fd887dec6ff9cb3b2b603ed1ce285
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/2507
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rw-r--r-- | SerialICE/simba/core_io.lua | 27 | ||||
-rw-r--r-- | SerialICE/simba/hooks.lua | 3 |
2 files changed, 16 insertions, 14 deletions
diff --git a/SerialICE/simba/core_io.lua b/SerialICE/simba/core_io.lua index 4234239..5781b5a 100644 --- a/SerialICE/simba/core_io.lua +++ b/SerialICE/simba/core_io.lua @@ -13,19 +13,19 @@ function io_undefined(f, action) end function io_post(f, action) - if (action.write) then - printk(f, action, "out%s %04x <= %s\n", size_suffix(action.size), action.addr, size_data(action.size, action.data)) - else - printk(f, action, " in%s %04x => %s\n", size_suffix(action.size), action.addr, size_data(action.size, action.data)) - end - return true -end - -function io_base_post(f, action) - if (action.write) then - printk(f, action, "[%04x] <= %s\n", action.addr - f.base, size_data(action.size, action.data)) - else - printk(f, action, "[%04x] => %s\n", action.addr - f.base, size_data(action.size, action.data)) + local size = size_data(action.size, action.data) + if not f.decode or f.decode == F_FIXED then + if (action.write) then + printk(f, action, "out%s %04x <= %s\n", size_suffix(action.size), action.addr, size) + else + printk(f, action, " in%s %04x => %s\n", size_suffix(action.size), action.addr, size) + end + elseif f.decode == F_RANGE then + if (action.write) then + printk(f, action, "[%04x] <= %s\n", action.addr - f.base, size) + else + printk(f, action, "[%04x] => %s\n", action.addr - f.base, size) + end end return true end @@ -35,6 +35,7 @@ filter_io_fallback = { name = "IO", pre = io_undefined, post = io_post, + decode = F_FIXED, base = 0x0, size = 0x10000, } diff --git a/SerialICE/simba/hooks.lua b/SerialICE/simba/hooks.lua index c7cc736..29f574a 100644 --- a/SerialICE/simba/hooks.lua +++ b/SerialICE/simba/hooks.lua @@ -149,7 +149,8 @@ function generic_io_bar(bar) local f = {} f.id = -1 f.pre = handle_action - f.post = io_base_post + f.post = io_post + f.decode = F_RANGE f.hide = true f.name = bar.name f.size = bar.size |