Path: blob/master/arch/sh/drivers/pci/fixups-landisk.c
10819 views
/*1* arch/sh/drivers/pci/fixups-landisk.c2*3* PCI initialization for the I-O DATA Device, Inc. LANDISK board4*5* Copyright (C) 2006 kogiidena6* Copyright (C) 2010 Nobuhiro Iwamatsu7*8* May be copied or modified under the terms of the GNU General Public9* License. See linux/COPYING for more information.10*/11#include <linux/kernel.h>12#include <linux/types.h>13#include <linux/init.h>14#include <linux/delay.h>15#include <linux/pci.h>16#include "pci-sh4.h"1718#define PCIMCR_MRSET_OFF 0xBFFFFFFF19#define PCIMCR_RFSH_OFF 0xFFFFFFFB2021int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)22{23/*24* slot0: pin1-4 = irq5,6,7,825* slot1: pin1-4 = irq6,7,8,526* slot2: pin1-4 = irq7,8,5,627* slot3: pin1-4 = irq8,5,6,728*/29int irq = ((slot + pin - 1) & 0x3) + 5;3031if ((slot | (pin - 1)) > 0x3) {32printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n",33slot, pin - 1 + 'A');34return -1;35}36return irq;37}3839int pci_fixup_pcic(struct pci_channel *chan)40{41unsigned long bcr1, mcr;4243bcr1 = __raw_readl(SH7751_BCR1);44bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */45pci_write_reg(chan, bcr1, SH4_PCIBCR1);4647mcr = __raw_readl(SH7751_MCR);48mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;49pci_write_reg(chan, mcr, SH4_PCIMCR);5051pci_write_reg(chan, 0x0c000000, SH7751_PCICONF5);52pci_write_reg(chan, 0xd0000000, SH7751_PCICONF6);53pci_write_reg(chan, 0x0c000000, SH4_PCILAR0);54pci_write_reg(chan, 0x00000000, SH4_PCILAR1);5556return 0;57}585960