mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-16 05:50:19 +00:00
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [SSB] Initialise dma_mask for SSB_BUSTYPE_SSB devices [MIPS] BCM47xx: Fix build error due to missing PCI functions [MIPS] IP27: Switch to dynamic interrupt routing avoding panic on error. [MIPS] au1000: Make sure GPIO value is zero or one
This commit is contained in:
commit
0f873d5fb6
@ -48,7 +48,7 @@ static void au1xxx_gpio2_write(unsigned gpio, int value)
|
||||
{
|
||||
gpio -= AU1XXX_GPIO_BASE;
|
||||
|
||||
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
|
||||
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
|
||||
}
|
||||
|
||||
static int au1xxx_gpio2_direction_input(unsigned gpio)
|
||||
@ -62,7 +62,7 @@ static int au1xxx_gpio2_direction_output(unsigned gpio, int value)
|
||||
{
|
||||
gpio -= AU1XXX_GPIO_BASE;
|
||||
gpio2->dir |= 0x01 << gpio;
|
||||
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | (value << gpio);
|
||||
gpio2->output = (GPIO2_OUTPUT_ENABLE_MASK << gpio) | ((!!value) << gpio);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ obj-$(CONFIG_SOC_TX3927) += ops-tx3927.o
|
||||
obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
|
||||
obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
|
||||
obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o
|
||||
obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o
|
||||
|
||||
#
|
||||
# These are still pretty much in the old state, watch, go blind.
|
||||
|
60
arch/mips/pci/pci-bcm47xx.c
Normal file
60
arch/mips/pci/pci-bcm47xx.c
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Aurelien Jarno <aurelien@aurel32.net>
|
||||
*
|
||||
* 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 SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* 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.,
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/ssb/ssb.h>
|
||||
|
||||
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pcibios_plat_dev_init(struct pci_dev *dev)
|
||||
{
|
||||
int res;
|
||||
u8 slot, pin;
|
||||
|
||||
res = ssb_pcibios_plat_dev_init(dev);
|
||||
if (res < 0) {
|
||||
printk(KERN_ALERT "PCI: Failed to init device %s\n",
|
||||
pci_name(dev));
|
||||
return res;
|
||||
}
|
||||
|
||||
pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
|
||||
slot = PCI_SLOT(dev->devfn);
|
||||
res = ssb_pcibios_map_irq(dev, slot, pin);
|
||||
|
||||
/* IRQ-0 and IRQ-1 are software interrupts. */
|
||||
if (res < 2) {
|
||||
printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n",
|
||||
pci_name(dev));
|
||||
return res;
|
||||
}
|
||||
|
||||
dev->irq = res;
|
||||
return 0;
|
||||
}
|
||||
|
@ -143,25 +143,47 @@ int __cpuinit bridge_probe(nasid_t nasid, int widget_id, int masterwid)
|
||||
*/
|
||||
int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
|
||||
{
|
||||
struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus);
|
||||
int irq = bc->pci_int[slot];
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (irq == -1) {
|
||||
irq = bc->pci_int[slot] = request_bridge_irq(bc);
|
||||
if (irq < 0)
|
||||
panic("Can't allocate interrupt for PCI device %s\n",
|
||||
pci_name(dev));
|
||||
/* Most MIPS systems have straight-forward swizzling needs. */
|
||||
static inline u8 bridge_swizzle(u8 pin, u8 slot)
|
||||
{
|
||||
return (((pin - 1) + slot) % 4) + 1;
|
||||
}
|
||||
|
||||
static inline struct pci_dev *bridge_root_dev(struct pci_dev *dev)
|
||||
{
|
||||
while (dev->bus->parent) {
|
||||
/* Move up the chain of bridges. */
|
||||
dev = dev->bus->self;
|
||||
}
|
||||
|
||||
irq_to_bridge[irq] = bc;
|
||||
irq_to_slot[irq] = slot;
|
||||
|
||||
return irq;
|
||||
return dev;
|
||||
}
|
||||
|
||||
/* Do platform specific device initialization at pci_enable_device() time */
|
||||
int pcibios_plat_dev_init(struct pci_dev *dev)
|
||||
{
|
||||
struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus);
|
||||
struct pci_dev *rdev = bridge_root_dev(dev);
|
||||
int slot = PCI_SLOT(rdev->devfn);
|
||||
int irq;
|
||||
|
||||
irq = bc->pci_int[slot];
|
||||
if (irq == -1) {
|
||||
irq = request_bridge_irq(bc);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
bc->pci_int[slot] = irq;
|
||||
}
|
||||
|
||||
irq_to_bridge[irq] = bc;
|
||||
irq_to_slot[irq] = slot;
|
||||
|
||||
dev->irq = irq;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -471,6 +471,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
|
||||
#endif
|
||||
break;
|
||||
case SSB_BUSTYPE_SSB:
|
||||
dev->dma_mask = &dev->coherent_dma_mask;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user