diff options
Diffstat (limited to 'arch/sh/drivers/pci/fixups-sdk7780.c')
| -rw-r--r-- | arch/sh/drivers/pci/fixups-sdk7780.c | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/arch/sh/drivers/pci/fixups-sdk7780.c b/arch/sh/drivers/pci/fixups-sdk7780.c index 2f8863099dd1..250b0edd7365 100644 --- a/arch/sh/drivers/pci/fixups-sdk7780.c +++ b/arch/sh/drivers/pci/fixups-sdk7780.c | |||
| @@ -5,55 +5,48 @@ | |||
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2003 Lineo uSolutions, Inc. | 6 | * Copyright (C) 2003 Lineo uSolutions, Inc. |
| 7 | * Copyright (C) 2004 - 2006 Paul Mundt | 7 | * Copyright (C) 2004 - 2006 Paul Mundt |
| 8 | * Copyright (C) 2006 Nobuhiro Iwamatsu | ||
| 8 | * | 9 | * |
| 9 | * This file is subject to the terms and conditions of the GNU General Public | 10 | * This file is subject to the terms and conditions of the GNU General Public |
| 10 | * License. See the file "COPYING" in the main directory of this archive | 11 | * License. See the file "COPYING" in the main directory of this archive |
| 11 | * for more details. | 12 | * for more details. |
| 12 | */ | 13 | */ |
| 13 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
| 15 | #include <linux/io.h> | ||
| 14 | #include "pci-sh4.h" | 16 | #include "pci-sh4.h" |
| 15 | #include <asm/io.h> | ||
| 16 | 17 | ||
| 17 | int pci_fixup_pcic(void) | 18 | /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ |
| 19 | static char sdk7780_irq_tab[4][16] __initdata = { | ||
| 20 | /* INTA */ | ||
| 21 | { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
| 22 | /* INTB */ | ||
| 23 | { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
| 24 | /* INTC */ | ||
| 25 | { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
| 26 | /* INTD */ | ||
| 27 | { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, | ||
| 28 | }; | ||
| 29 | |||
| 30 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | ||
| 31 | { | ||
| 32 | return sdk7780_irq_tab[pin-1][slot]; | ||
| 33 | } | ||
| 34 | int pci_fixup_pcic(struct pci_channel *chan) | ||
| 18 | { | 35 | { |
| 19 | ctrl_outl(0x00000001, SH7780_PCI_VCR2); | ||
| 20 | |||
| 21 | /* Enable all interrupts, so we know what to fix */ | 36 | /* Enable all interrupts, so we know what to fix */ |
| 22 | pci_write_reg(0x0000C3FF, SH7780_PCIIMR); | 37 | pci_write_reg(chan, 0x0000C3FF, SH7780_PCIIMR); |
| 23 | pci_write_reg(0x0000380F, SH7780_PCIAINTM); | ||
| 24 | 38 | ||
| 25 | /* Set up standard PCI config registers */ | 39 | /* Set up standard PCI config registers */ |
| 26 | pci_write_reg(0xFB00, SH7780_PCISTATUS); | 40 | pci_write_reg(chan, 0x08000000, SH7780_PCIMBAR0); /* PCI */ |
| 27 | pci_write_reg(0x0047, SH7780_PCICMD); | 41 | pci_write_reg(chan, 0x08000000, SH4_PCILAR0); /* SHwy */ |
| 28 | pci_write_reg(0x00, SH7780_PCIPIF); | 42 | pci_write_reg(chan, 0x07F00001, SH4_PCILSR0); /* size 128M w/ MBAR */ |
| 29 | pci_write_reg(0x00, SH7780_PCISUB); | ||
| 30 | pci_write_reg(0x06, SH7780_PCIBCC); | ||
| 31 | pci_write_reg(0x1912, SH7780_PCISVID); | ||
| 32 | pci_write_reg(0x0001, SH7780_PCISID); | ||
| 33 | |||
| 34 | pci_write_reg(0x08000000, SH7780_PCIMBAR0); /* PCI */ | ||
| 35 | pci_write_reg(0x08000000, SH7780_PCILAR0); /* SHwy */ | ||
| 36 | pci_write_reg(0x07F00001, SH7780_PCILSR); /* size 128M w/ MBAR */ | ||
| 37 | |||
| 38 | pci_write_reg(0x00000000, SH7780_PCIMBAR1); | ||
| 39 | pci_write_reg(0x00000000, SH7780_PCILAR1); | ||
| 40 | pci_write_reg(0x00000000, SH7780_PCILSR1); | ||
| 41 | |||
| 42 | pci_write_reg(0xAB000801, SH7780_PCIIBAR); | ||
| 43 | |||
| 44 | /* | ||
| 45 | * Set the MBR so PCI address is one-to-one with window, | ||
| 46 | * meaning all calls go straight through... use ifdef to | ||
| 47 | * catch erroneous assumption. | ||
| 48 | */ | ||
| 49 | pci_write_reg(0xFD000000 , SH7780_PCIMBR0); | ||
| 50 | pci_write_reg(0x00FC0000 , SH7780_PCIMBMR0); /* 16M */ | ||
| 51 | 43 | ||
| 52 | /* Set IOBR for window containing area specified in pci.h */ | 44 | pci_write_reg(chan, 0x00000000, SH7780_PCIMBAR1); |
| 53 | pci_write_reg(PCIBIOS_MIN_IO & ~(SH7780_PCI_IO_SIZE-1), SH7780_PCIIOBR); | 45 | pci_write_reg(chan, 0x00000000, SH4_PCILAR1); |
| 54 | pci_write_reg((SH7780_PCI_IO_SIZE-1) & (7 << 18), SH7780_PCIIOBMR); | 46 | pci_write_reg(chan, 0x00000000, SH4_PCILSR1); |
| 55 | 47 | ||
| 56 | pci_write_reg(0xA5000C01, SH7780_PCICR); | 48 | pci_write_reg(chan, 0xAB000801, SH7780_PCIIBAR); |
| 49 | pci_write_reg(chan, 0xA5000C01, SH4_PCICR); | ||
| 57 | 50 | ||
| 58 | return 0; | 51 | return 0; |
| 59 | } | 52 | } |
