From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- arch/ppc64/kernel/iSeries_pci_reset.c | 104 ++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 arch/ppc64/kernel/iSeries_pci_reset.c (limited to 'arch/ppc64/kernel/iSeries_pci_reset.c') diff --git a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c new file mode 100644 index 00000000000..0f785e4584f --- /dev/null +++ b/arch/ppc64/kernel/iSeries_pci_reset.c @@ -0,0 +1,104 @@ +#define PCIFR(...) +/************************************************************************/ +/* File iSeries_pci_reset.c created by Allan Trautman on Mar 21 2001. */ +/************************************************************************/ +/* This code supports the pci interface on the IBM iSeries systems. */ +/* Copyright (C) 20yy */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 2 of the License, or */ +/* (at your option) any later version. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the: */ +/* Free Software Foundation, Inc., */ +/* 59 Temple Place, Suite 330, */ +/* Boston, MA 02111-1307 USA */ +/************************************************************************/ +/* Change Activity: */ +/* Created, March 20, 2001 */ +/* April 30, 2001, Added return codes on functions. */ +/* September 10, 2001, Ported to ppc64. */ +/* End Change Activity */ +/************************************************************************/ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include "pci.h" + +/* + * Interface to toggle the reset line + * Time is in .1 seconds, need for seconds. + */ +int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, + int DelayTime) +{ + unsigned int AssertDelay, WaitDelay; + struct iSeries_Device_Node *DeviceNode = + (struct iSeries_Device_Node *)PciDev->sysdata; + + if (DeviceNode == NULL) { + printk("PCI: Pci Reset Failed, Device Node not found for pci_dev %p\n", + PciDev); + return -1; + } + /* + * Set defaults, Assert is .5 second, Wait is 3 seconds. + */ + if (AssertTime == 0) + AssertDelay = 500; + else + AssertDelay = AssertTime * 100; + + if (DelayTime == 0) + WaitDelay = 3000; + else + WaitDelay = DelayTime * 100; + + /* + * Assert reset + */ + DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), + 0x00, DeviceNode->AgentId, 1); + if (DeviceNode->ReturnCode == 0) { + msleep(AssertDelay); /* Sleep for the time */ + DeviceNode->ReturnCode = + HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), + 0x00, DeviceNode->AgentId, 0); + + /* + * Wait for device to reset + */ + msleep(WaitDelay); + } + if (DeviceNode->ReturnCode == 0) + PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode), + DeviceNode->AgentId); + else { + printk("PCI: Slot 0x%04X.%02X Reset Failed, RCode: %04X\n", + ISERIES_BUS(DeviceNode), DeviceNode->AgentId, + DeviceNode->ReturnCode); + PCIFR("Slot 0x%04X.%02X Reset Failed, RCode: %04X\n", + ISERIES_BUS(DeviceNode), DeviceNode->AgentId, + DeviceNode->ReturnCode); + } + return DeviceNode->ReturnCode; +} +EXPORT_SYMBOL(iSeries_Device_ToggleReset); -- cgit v1.2.3-70-g09d2