Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2506
-gerrit
commit 27e1474304fc60c8304308e74472a4c5b8654b25 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Mon Feb 25 14:49:52 2013 +0200
Drop mem_base_post
Add a field .decode in filter to control if it operates on a set of fixed addresses or a range.
Change-Id: I7bf7c323a339427357b3fc69dc2e2a84c14c3dd8 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- SerialICE/simba/core_io.lua | 32 ++++++++++++++++++-------------- SerialICE/simba/hooks.lua | 3 ++- SerialICE/simba/i82801.lua | 3 ++- SerialICE/simba/mmio.lua | 6 ++++-- 4 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/SerialICE/simba/core_io.lua b/SerialICE/simba/core_io.lua index 0b823cc..4234239 100644 --- a/SerialICE/simba/core_io.lua +++ b/SerialICE/simba/core_io.lua @@ -1,3 +1,7 @@ + +F_FIXED = 1 +F_RANGE = 2 + -- ********************************************************** --
@@ -46,10 +50,19 @@ function mem_undefined(f, action) end
function mem_post(f, action) - if (action.write) then - printk(f, action, "write%s %08x <= %s", size_suffix(action.size), action.addr, size_data(action.size, action.data)) - else - printk(f, action, " read%s %08x => %s", size_suffix(action.size), action.addr, 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, "write%s %08x <= %s", size_suffix(action.size), action.addr, size) + else + printk(f, action, " read%s %08x => %s", size_suffix(action.size), action.addr, size) + end + elseif f.decode == F_RANGE then + if (action.write) then + printk(f, action, "[%08x] <= %s", bit32.band(action.addr, (f.size - 1)), size) + else + printk(f, action, "[%08x] => %s", bit32.band(action.addr, (f.size - 1)), size) + end end if action.to_hw then printf(" *") @@ -58,21 +71,12 @@ function mem_post(f, action) return true end
-function mem_base_post(f, action) - if (action.write) then - printk(f, action, "[%08x] <= %s\n", bit32.band(action.addr, (f.size - 1)), size_data(action.size, action.data)) - else - printk(f, action, "[%08x] => %s\n", bit32.band(action.addr, (f.size - 1)), size_data(action.size, action.data)) - end - return true -end - - filter_mem_fallback = { id = -1, name = "MEM", pre = mem_undefined, post = mem_post, + decode = F_FIXED, base = 0x0, size = 0x100000000 } diff --git a/SerialICE/simba/hooks.lua b/SerialICE/simba/hooks.lua index fa61ab4..c7cc736 100644 --- a/SerialICE/simba/hooks.lua +++ b/SerialICE/simba/hooks.lua @@ -168,7 +168,8 @@ function generic_mmio_bar(bar) local f = {} f.id = -1 f.pre = handle_action - f.post = mem_base_post + f.post = mem_post + f.decode = F_RANGE f.hide = true f.name = bar.name f.size = bar.size diff --git a/SerialICE/simba/i82801.lua b/SerialICE/simba/i82801.lua index ddc9a6e..28b506f 100644 --- a/SerialICE/simba/i82801.lua +++ b/SerialICE/simba/i82801.lua @@ -149,7 +149,8 @@ filter_ich7_tpm = { id = -1, name = "ICH7 TPM", pre = mem_target_only, - post = mem_base_post, + post = mem_post, + decode = F_RANGE, base = 0xfed40000, size = 0x00001000, hide = true diff --git a/SerialICE/simba/mmio.lua b/SerialICE/simba/mmio.lua index 695315f..681953b 100644 --- a/SerialICE/simba/mmio.lua +++ b/SerialICE/simba/mmio.lua @@ -20,7 +20,8 @@ filter_lapic = { id = -1, name = "LAPIC", pre = mem_lapic, - post = mem_base_post, + post = mem_post, + decode = F_RANGE, hide = true, base = 0xfee00000, size = 0x00010000, @@ -31,7 +32,8 @@ filter_ioapic = { id = -1, name = "IOAPIC", pre = mem_target_only, - post = mem_base_post, + post = mem_post, + decode = F_RANGE, hide = true, base = 0xfec00000, size = 0x00010000,