From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: John Stultz <john.stultz@linaro.org>
Cc: linux-kernel@vger.kernel.org,
Nicolas Pitre <nicolas.pitre@linaro.org>,
Russell King <linux@arm.linux.org.uk>,
Arnd Bergmann <arnd@arndb.de>,
Anton Vorontsov <anton.vorontsov@linaro.org>,
Jason Wessel <jason.wessel@windriver.com>,
Andrew Morton <akpm@linux-foundation.org>,
kernel-team@android.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger
Date: Fri, 10 May 2013 16:17:10 +0200 [thread overview]
Message-ID: <20130510161710.45b18866@skate> (raw)
In-Reply-To: <1368144651-11250-4-git-send-email-john.stultz@linaro.org>
Dear John Stultz,
On Thu, 9 May 2013 17:10:51 -0700, John Stultz wrote:
> +static void kgdb_fiq_select(bool on)
> +{
> + void __iomem *sel = kgdb_irq_base + VIC_INT_SELECT;
> + u32 msk = 1 << kgdb_irq;
> + u32 val;
> +
> + pr_debug("rerouting VIC vector %d to %s\n", kgdb_irq,
> + on ? "FIQ" : "IRQ");
> +
> + val = readl(sel);
> + val &= ~msk;
> + if (on)
> + val |= msk;
> + writel(val, sel);
> +}
> +
> +static bool kgdb_is_fiq_rised(void)
Shouldn't this function be kgdb_is_fiq_raised() ?
> +{
> + return readl(kgdb_irq_base + VIC_FIQ_STATUS) & (1 << kgdb_irq);
> +}
> +
> +static int __init kgdb_fiq_init(void)
> +{
> + kgdb_irq_base = __io_address(VERSATILE_VIC_BASE);
> + kgdb_irq += INT_UARTINT0;
> + WARN_ON(kgdb_irq > INT_UARTINT2);
> +
> + return kgdb_register_fiq(kgdb_fiq_select, kgdb_is_fiq_rised);
> +}
> +console_initcall(kgdb_fiq_init);
Also, this code that uses hardcoded addresses and IRQ numbers doesn't
seem to play really well with the DT. I was considering toying around
with this thing on the mach-mvebu platform, but don't have those
hardcoded addresses and IRQs, and the register offsets of the IRQ
controller driver are not exposed in an header file. Shouldn't IRQ
controller driver be exposing a the fiq_select() functionality instead?
Like a new flag for irq_chip->irq_set_type(), or a completely new hook
irq_chip->irq_set_mode() or something like that?
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2013-05-10 14:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 0:10 [PATCH 0/3] ARM: KDB FIQ debugger John Stultz
2013-05-10 0:10 ` [PATCH 1/3] ARM: Move some macros from entry-armv to entry-header John Stultz
2013-05-10 0:10 ` [PATCH 2/3] ARM: Add KGDB/KDB FIQ debugger generic code John Stultz
2013-05-10 0:10 ` [PATCH 3/3] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger John Stultz
2013-05-10 14:17 ` Thomas Petazzoni [this message]
2013-05-17 23:55 ` Anton Vorontsov
-- strict thread matches above, loose matches on Subject: below --
2013-01-07 1:22 [PATCH resend 0/3] ARM: KDB " Anton Vorontsov
2013-01-07 1:23 ` [PATCH 3/3] ARM: versatile: Make able to use UART ports for KGDB " Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130510161710.45b18866@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=arnd@arndb.de \
--cc=jason.wessel@windriver.com \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.pitre@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox