diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-03-25 00:13:57 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-25 00:13:57 +0000 |
commit | a31d4fd99d645529ddf35a1ede3ce62a443c094b (patch) | |
tree | 1f17beddf38d327a7d7bd130ce7de60e212056e8 /sim/bfin/dv-bfin_gpio.c | |
parent | b72cc8e145a9df3d9b5fe215f89e8dfc4430f84b (diff) | |
download | fsf-binutils-gdb-a31d4fd99d645529ddf35a1ede3ce62a443c094b.zip fsf-binutils-gdb-a31d4fd99d645529ddf35a1ede3ce62a443c094b.tar.gz fsf-binutils-gdb-a31d4fd99d645529ddf35a1ede3ce62a443c094b.tar.bz2 |
sim: bfin: add hw tracing to gpio/sic port events
Makes it a lot easier to find out what's going on with interrupt lines
if the ports have tracing output.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/bfin/dv-bfin_gpio.c')
-rw-r--r-- | sim/bfin/dv-bfin_gpio.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/sim/bfin/dv-bfin_gpio.c b/sim/bfin/dv-bfin_gpio.c index e9b79a8..6847b52 100644 --- a/sim/bfin/dv-bfin_gpio.c +++ b/sim/bfin/dv-bfin_gpio.c @@ -203,10 +203,16 @@ bfin_gpio_port_event (struct hw *me, int my_port, struct hw *source, lets us assume only those two values below. */ level = !!level; + HW_TRACE ((me, "pin %i set to %i", my_port, level)); + /* Only screw with state if this pin is set as an input, and the input is actually enabled. */ if ((port->dir & bit) || !(port->inen & bit)) - return; + { + HW_TRACE ((me, "ignoring level/int due to DIR=%i INEN=%i", + !!(port->dir & bit), !!(port->inen & bit))); + return; + } /* Get the old pin state for calculating an interrupt. */ olvl = !!(port->data & bit); @@ -224,28 +230,48 @@ bfin_gpio_port_event (struct hw *me, int my_port, struct hw *source, { /* Both edges. */ if (olvl == nlvl) - return; + { + HW_TRACE ((me, "ignoring int due to EDGE=%i BOTH=%i lvl=%i->%i", + !!(port->edge & bit), !!(port->both & bit), + olvl, nlvl)); + return; + } } else { /* Just one edge. */ if (!(((port->polar & bit) && olvl > nlvl) || (!(port->polar & bit) && olvl < nlvl))) - return; + { + HW_TRACE ((me, "ignoring int due to EDGE=%i POLAR=%i lvl=%i->%i", + !!(port->edge & bit), !!(port->polar & bit), + olvl, nlvl)); + return; + } } } else { /* Pin is level triggered. */ if (nlvl == !!(port->polar & bit)) - return; + { + HW_TRACE ((me, "ignoring int due to EDGE=%i POLAR=%i lvl=%i", + !!(port->edge & bit), !!(port->polar & bit), nlvl)); + return; + } } /* If the masks allow it, push the interrupt even higher. */ if (port->maska & bit) - hw_port_event (me, 0, 1); + { + HW_TRACE ((me, "pin %i triggered an int via mask a", my_port)); + hw_port_event (me, 0, 1); + } if (port->maskb & bit) - hw_port_event (me, 1, 1); + { + HW_TRACE ((me, "pin %i triggered an int via mask b", my_port)); + hw_port_event (me, 1, 1); + } } static void |