linux-mips
[Top] [All Lists]

[PATCH 1/2] MIPS: MTX-1: fix PCI on the MeshCube and related boards

To: linux-mips@linux-mips.org, manuel.lauss@googlemail.com, ralf@linux-mips.org
Subject: [PATCH 1/2] MIPS: MTX-1: fix PCI on the MeshCube and related boards
From: Bruno Randolf <randolf.bruno@googlemail.com>
Date: Mon, 12 Jul 2010 00:40:28 +0900
Cc: florian@openwrt.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:subject:to:from:cc:date :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=UcQOXypIkXuBJum6mqGxdkXnXXh8WXbs7xLGRIi3ZKM=; b=AnXyL9Fy5JYb/LOGGAru8+HvzGWgAZrb7RZFsC4ducFhEWvqBcFAFYgWTZLQ78BtNQ kAJ2IwGoUcYy+HoNkivVwiyOzQF2ICXpQHJng2YBGUePTPMsUhJiXwAndCXHdvnFjmue 02KVCQERXkFIfCNPriR4PbAGhvt3H/Kzr+n94=
Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:to:from:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; b=XEIILNeGD1AcyATcnQgMhUAcR9OyOlkKP9zuG0O/Tdc0StpCRzMaQpZbzuKFnSEEy9 An/x2MFRvOv8W3YsABEgejtxfxa2+B50vYQxBvGFSj+hjHNxLL7d26lf6Sjjs9R2Wa/E gsABV0+vueJOY63wzAdH6NH+1yVN7t3wGKZ7k=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: StGit/0.15
This patch fixes a regression introduced by commit "MIPS: Alchemy: MTX-1: Use
linux gpio api." (bb706b28bbd647c2fd7f22d6bf03a18b9552be05) which broke PCI bus
operation. The problem is caused by alchemy_gpio2_enable() which resets the
GPIO2 block. Two PCI signals (PCI_SERR and PCI_RST) are connected to GPIO2 and
they obviously do not to like the reset. Since GPIO2 is correctly initialized
by the boot monitor (YAMON) it is not necessary to call this function, so just
remove it.

Also replace gpio_set_value() with alchemy_gpio_set_value() to avoid problems
in case gpiolib gets initialized after PCI. And since alchemy gpio_set_value()
calls au_sync() we don't have to au_sync() again later.

Cc: stable@kernel.org
Signed-off-by: Bruno Randolf <br1@einfach.org>
---
 arch/mips/alchemy/mtx-1/board_setup.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/mips/alchemy/mtx-1/board_setup.c 
b/arch/mips/alchemy/mtx-1/board_setup.c
index a9f0336..52d883d 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -67,8 +67,6 @@ static void mtx1_power_off(void)
 
 void __init board_setup(void)
 {
-       alchemy_gpio2_enable();
-
 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
        /* Enable USB power switch */
        alchemy_gpio_direction_output(204, 0);
@@ -117,11 +115,11 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
 
        if (assert && devsel != 0)
                /* Suppress signal to Cardbus */
-               gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
+               alchemy_gpio_set_value(1, 0);   /* set EXT_IO3 OFF */
        else
-               gpio_set_value(1, 1);   /* set EXT_IO3 ON */
+               alchemy_gpio_set_value(1, 1);   /* set EXT_IO3 ON */
 
-       au_sync_udelay(1);
+       udelay(1);
        return 1;
 }
 


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