Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: pci: Add pci_fixup_pcic to pci of landisk

This adds a pci setting revision for landisk.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Nobuhiro Iwamatsu and committed by
Paul Mundt
9ca04434 0d6ae8fa

+26 -2
+26 -2
arch/sh/drivers/pci/fixups-landisk.c
··· 1 1 /* 2 - * arch/sh/drivers/pci/ops-landisk.c 2 + * arch/sh/drivers/pci/fixups-landisk.c 3 3 * 4 4 * PCI initialization for the I-O DATA Device, Inc. LANDISK board 5 5 * 6 6 * Copyright (C) 2006 kogiidena 7 + * Copyright (C) 2010 Nobuhiro Iwamatsu 7 8 * 8 9 * May be copied or modified under the terms of the GNU General Public 9 10 * License. See linux/COPYING for more information. ··· 15 14 #include <linux/delay.h> 16 15 #include <linux/pci.h> 17 16 #include "pci-sh4.h" 17 + 18 + #define PCIMCR_MRSET_OFF 0xBFFFFFFF 19 + #define PCIMCR_RFSH_OFF 0xFFFFFFFB 18 20 19 21 int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) 20 22 { ··· 30 26 int irq = ((slot + pin - 1) & 0x3) + 5; 31 27 32 28 if ((slot | (pin - 1)) > 0x3) { 33 - printk("PCI: Bad IRQ mapping request for slot %d pin %c\n", 29 + printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n", 34 30 slot, pin - 1 + 'A'); 35 31 return -1; 36 32 } 37 33 return irq; 34 + } 35 + 36 + int pci_fixup_pcic(struct pci_channel *chan) 37 + { 38 + unsigned long bcr1, mcr; 39 + 40 + bcr1 = __raw_readl(SH7751_BCR1); 41 + bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ 42 + pci_write_reg(chan, bcr1, SH4_PCIBCR1); 43 + 44 + mcr = __raw_readl(SH7751_MCR); 45 + mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; 46 + pci_write_reg(chan, mcr, SH4_PCIMCR); 47 + 48 + pci_write_reg(chan, 0x0c000000, SH7751_PCICONF5); 49 + pci_write_reg(chan, 0xd0000000, SH7751_PCICONF6); 50 + pci_write_reg(chan, 0x0c000000, SH4_PCILAR0); 51 + pci_write_reg(chan, 0x00000000, SH4_PCILAR1); 52 + 53 + return 0; 38 54 }