powerpc: Correct USB support for GE Fanuc SBC610

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, October 15, 2008 - 12:03 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a969e7...
Commit:     a969e76a7101bf5f3d369563df1ca1253dd6131b
Parent:     0161dca52d950676d727336cef1441ea2bcfba98
Author:     Martyn Welch <martyn.welch@gefanuc.com>
AuthorDate: Mon Sep 29 13:35:15 2008 +0100
Committer:  Kumar Gala <galak@kernel.crashing.org>
CommitDate: Mon Sep 29 09:25:47 2008 -0500

    powerpc: Correct USB support for GE Fanuc SBC610
    
    Support for the SBC610 VPX Single Board Computer from GE Fanuc (PowerPC
    MPC8641D).
    
    Fixup to correctly reconfigure USB, provided by an NEC uPD720101, after
    device is reset. This requires a set of chip specific registers in the
    devices configuration space to be correctly written, enabling all ports
    and switching the device to use an external 48-MHz Oscillator.
    
    Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/platforms/86xx/gef_sbc610.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index 8a9dee2..ee21500 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -12,6 +12,8 @@
  *
  * Based on: mpc86xx_hpcn.c (MPC86xx HPCN board specific routines)
  * Copyright 2006 Freescale Semiconductor Inc.
+ *
+ * NEC fixup adapted from arch/mips/pci/fixup-lm2e.c
  */
 
 #include <linux/stddef.h>
@@ -75,6 +77,21 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
 }
 
+static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev)
+{
+	unsigned int val;
+
+	printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
+
+	/* Ensure ports 1, 2, 3, 4 & 5 are enabled */
+	pci_read_config_dword(pdev, 0xe0, &val);
+	pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x5);
+
+	/* System clock is 48-MHz Oscillator and EHCI Enabled. */
+	pci_write_config_dword(pdev, 0xe4, 1 << 5);
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB,
+	gef_sbc610_nec_fixup);
 
 /*
  * Called very early, device-tree isn't unflattened
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
powerpc: Correct USB support for GE Fanuc SBC610, Linux Kernel Mailing ..., (Wed Oct 15, 12:03 pm)