From: <gerg@snapgear.com>
To: linux-m68k@vger.kernel.org, uclinux-dev@uclinux.org
Cc: Greg Ungerer <gerg@uclinux.org>
Subject: [PATCH 20/23] m68knommu: simplify the 5407 UART setup code
Date: Thu, 23 Feb 2012 14:34:52 +1000 [thread overview]
Message-ID: <1329971695-2203-21-git-send-email-gerg@snapgear.com> (raw)
In-Reply-To: <1329971695-2203-1-git-send-email-gerg@snapgear.com>
From: Greg Ungerer <gerg@uclinux.org>
Simplify the UART setup code so that it no longer loops for each UART
present. Just make it do all the work it needs in a single function.
This will make the code easier to share when we move to a single set
of platform data for ColdFire UARTs.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
arch/m68k/platform/5407/config.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/arch/m68k/platform/5407/config.c b/arch/m68k/platform/5407/config.c
index 0f3515e..33d857d 100644
--- a/arch/m68k/platform/5407/config.c
+++ b/arch/m68k/platform/5407/config.c
@@ -44,26 +44,17 @@ static struct platform_device *m5407_devices[] __initdata = {
/***************************************************************************/
-static void __init m5407_uart_init_line(int line, int irq)
-{
- if (line == 0) {
- writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
- writeb(irq, MCFUART_BASE0 + MCFUART_UIVR);
- mcf_mapirq2imr(irq, MCFINTC_UART0);
- } else if (line == 1) {
- writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
- writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
- mcf_mapirq2imr(irq, MCFINTC_UART1);
- }
-}
-
static void __init m5407_uarts_init(void)
{
- const int nrlines = ARRAY_SIZE(m5407_uart_platform);
- int line;
-
- for (line = 0; (line < nrlines); line++)
- m5407_uart_init_line(line, m5407_uart_platform[line].irq);
+ /* UART0 interrupt setup */
+ writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
+ writeb(MCF_IRQ_UART0, MCFUART_BASE0 + MCFUART_UIVR);
+ mcf_mapirq2imr(MCF_IRQ_UART0, MCFINTC_UART0);
+
+ /* UART1 interrupt setup */
+ writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
+ writeb(MCF_IRQ_UART1, MCFUART_BASE1 + MCFUART_UIVR);
+ mcf_mapirq2imr(MCF_IRQ_UART1, MCFINTC_UART1);
}
/***************************************************************************/
--
1.7.0.4
next prev parent reply other threads:[~2012-02-23 4:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-23 4:34 [PATCH 00/23] m68knommu: clean up and merge common ColdFire UART code gerg
2012-02-23 4:34 ` [PATCH 01/23] m68knommu: make 5206 UART platform addressing consistent gerg
2012-02-23 4:34 ` [PATCH 02/23] m68knommu: make 520x " gerg
2012-02-23 4:34 ` [PATCH 03/23] m68knommu: make 523x " gerg
2012-02-23 4:34 ` [PATCH 04/23] m68knommu: make 5249 " gerg
2012-02-23 4:34 ` [PATCH 05/23] m68knommu: make 5272 " gerg
2012-02-23 4:34 ` [PATCH 06/23] m68knommu: make 527x " gerg
2012-02-23 4:34 ` [PATCH 07/23] m68knommu: make 5307 " gerg
2012-02-23 4:34 ` [PATCH 08/23] m68knommu: make 528x " gerg
2012-02-23 4:34 ` [PATCH 09/23] m68knommu: make 532x " gerg
2012-02-23 4:34 ` [PATCH 10/23] m68knommu: make 5407 " gerg
2012-02-23 4:34 ` [PATCH 11/23] m68knommu: make 54xx " gerg
2012-02-23 4:34 ` [PATCH 12/23] m68knommu: simplify the 5206 UART setup code gerg
2012-02-23 4:34 ` [PATCH 13/23] m68knommu: simplify the 520x " gerg
2012-02-23 4:34 ` [PATCH 14/23] m68knommu: simplify the 5249 " gerg
2012-02-23 4:34 ` [PATCH 15/23] m68knommu: simplify the 5272 " gerg
2012-02-23 4:34 ` [PATCH 16/23] m68knommu: simplify the 527x " gerg
2012-02-23 4:34 ` [PATCH 17/23] m68knommu: simplify the 528x " gerg
2012-02-23 4:34 ` [PATCH 18/23] m68knommu: simplify the 5307 " gerg
2012-02-23 4:34 ` [PATCH 19/23] m68knommu: simplify the 532x " gerg
2012-02-23 4:34 ` gerg [this message]
2012-02-23 4:34 ` [PATCH 21/23] m68knommu: simplify the 54xx " gerg
2012-02-23 4:34 ` [PATCH 22/23] m68knommu: merge common ColdFire UART platform " gerg
2012-02-23 4:34 ` [PATCH 23/23] m68knommu: merge common ColdFire UART IRQ setup gerg
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=1329971695-2203-21-git-send-email-gerg@snapgear.com \
--to=gerg@snapgear.com \
--cc=gerg@uclinux.org \
--cc=linux-m68k@vger.kernel.org \
--cc=uclinux-dev@uclinux.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