Skip to content

Commit 9ca0443

Browse files
iwamatsupmundt
authored andcommitted
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>
1 parent 0d6ae8f commit 9ca0443

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

‎arch/sh/drivers/pci/fixups-landisk.c‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/*
2-
* arch/sh/drivers/pci/ops-landisk.c
2+
* arch/sh/drivers/pci/fixups-landisk.c
33
*
44
* PCI initialization for the I-O DATA Device, Inc. LANDISK board
55
*
66
* Copyright (C) 2006 kogiidena
7+
* Copyright (C) 2010 Nobuhiro Iwamatsu
78
*
89
* May be copied or modified under the terms of the GNU General Public
910
* License. See linux/COPYING for more information.
@@ -15,6 +16,9 @@
1516
#include <linux/pci.h>
1617
#include "pci-sh4.h"
1718

19+
#define PCIMCR_MRSET_OFF 0xBFFFFFFF
20+
#define PCIMCR_RFSH_OFF 0xFFFFFFFB
21+
1822
int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
1923
{
2024
/*
@@ -26,9 +30,29 @@ int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin)
2630
int irq = ((slot + pin - 1) & 0x3) + 5;
2731

2832
if ((slot | (pin - 1)) > 0x3) {
29-
printk("PCI: Bad IRQ mapping request for slot %d pin %c\n",
33+
printk(KERN_WARNING "PCI: Bad IRQ mapping request for slot %d pin %c\n",
3034
slot, pin - 1 + 'A');
3135
return -1;
3236
}
3337
return irq;
3438
}
39+
40+
int pci_fixup_pcic(struct pci_channel *chan)
41+
{
42+
unsigned long bcr1, mcr;
43+
44+
bcr1 = __raw_readl(SH7751_BCR1);
45+
bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */
46+
pci_write_reg(chan, bcr1, SH4_PCIBCR1);
47+
48+
mcr = __raw_readl(SH7751_MCR);
49+
mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF;
50+
pci_write_reg(chan, mcr, SH4_PCIMCR);
51+
52+
pci_write_reg(chan, 0x0c000000, SH7751_PCICONF5);
53+
pci_write_reg(chan, 0xd0000000, SH7751_PCICONF6);
54+
pci_write_reg(chan, 0x0c000000, SH4_PCILAR0);
55+
pci_write_reg(chan, 0x00000000, SH4_PCILAR1);
56+
57+
return 0;
58+
}

0 commit comments

Comments
 (0)