linux-mips
[Top] [All Lists]

[PATCH 1/9] MIPS: DB1200: Set Config[OD] for improved stability.

To: Linux-MIPS <linux-mips@linux-mips.org>
Subject: [PATCH 1/9] MIPS: DB1200: Set Config[OD] for improved stability.
From: Manuel Lauss <manuel.lauss@googlemail.com>
Date: Sun, 8 May 2011 10:42:12 +0200
Cc: Florian Fainelli <florian@openwrt.org>, Wolfgang Grandegger <wg@grandegger.com>, Manuel Lauss <manuel.lauss@googlemail.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=J4RKxbs9181p595Cd4T/UEI8Iim0Rs4bzKCl7bY0Dg8=; b=ICRet7yKvanqqGRL9COADppiHXdrcqhiYwFbvus9l9AM7u5ZTmuOaK3h3Yj05GJZ1w ReT1tUz06wJdUau16vwr7YuhKqPCx7Zc/zKQQiXENBQzVuSAqqcOnzxesLJ7bOuxhzor kEEcWZN5p78jwhYQZBEHqmHNIl+IdPis2Xb/Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ZSDIkOnU4GQPSaB/v1qygLqSE88vp5JwEYNc+n7DtvVEyfpRhR+m4NefylUaOguE9m GMnFKO5aJ+Ds6OVAzPRBGjE1ywpd3p8ZJPBaeU5/sL/MyzXEmUtyz/lCAjrBJrjrPSdk KGbugF4OFOpPSvjaU2Rhl+V1bHmvfXTWZBJhU=
In-reply-to: <1304844140-3259-1-git-send-email-manuel.lauss@googlemail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1304844140-3259-1-git-send-email-manuel.lauss@googlemail.com>
Sender: linux-mips-bounce@linux-mips.org
Setting Config[OD] gets rid of a _LOT_ of spurious CPLD interrupts,
but also decreases overall performance a bit.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
Resend of a patch I submitted earlier.
V2: fix up issues pointed out by Sergei Shtylyov.

 arch/mips/alchemy/common/setup.c           |    4 ++--
 arch/mips/alchemy/devboards/db1200/setup.c |    7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 561e5da..1b887c8 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -52,8 +52,6 @@ void __init plat_mem_setup(void)
        /* this is faster than wasting cycles trying to approximate it */
        preset_lpj = (est_freq >> 1) / HZ;
 
-       board_setup();  /* board specific setup */
-
        if (au1xxx_cpu_needs_config_od())
                /* Various early Au1xx0 errata corrected by this */
                set_c0_config(1 << 19); /* Set Config[OD] */
@@ -61,6 +59,8 @@ void __init plat_mem_setup(void)
                /* Clear to obtain best system bus performance */
                clear_c0_config(1 << 19); /* Clear Config[OD] */
 
+       board_setup();  /* board specific setup */
+
        /* IO/MEM resources. */
        set_io_port_base(0);
        ioport_resource.start = IOPORT_RESOURCE_START;
diff --git a/arch/mips/alchemy/devboards/db1200/setup.c 
b/arch/mips/alchemy/devboards/db1200/setup.c
index 4a89800..1dac4f2 100644
--- a/arch/mips/alchemy/devboards/db1200/setup.c
+++ b/arch/mips/alchemy/devboards/db1200/setup.c
@@ -23,6 +23,13 @@ void __init board_setup(void)
        unsigned long freq0, clksrc, div, pfc;
        unsigned short whoami;
 
+       /* Set Config[OD] (disable overlapping bus transaction):
+        * This gets rid of a _lot_ of spurious interrupts (especially
+        * wrt. IDE); but incurs ~10% performance hit in some
+        * cpu-bound applications.
+        */
+       set_c0_config(1 << 19);
+
        bcsr_init(DB1200_BCSR_PHYS_ADDR,
                  DB1200_BCSR_PHYS_ADDR + DB1200_BCSR_HEXLED_OFS);
 
-- 
1.7.5.rc3


<Prev in Thread] Current Thread [Next in Thread>