Nicholas Beck | 4862ec0 | 2008-01-23 12:50:51 +0900 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/sh/drivers/pci/ops-sdk7780.c |
| 3 | * |
| 4 | * Copyright (C) 2006 Nobuhiro Iwamatsu |
| 5 | * |
| 6 | * PCI initialization for the SDK7780SE03 |
| 7 | * |
| 8 | * May be copied or modified under the terms of the GNU General Public |
| 9 | * 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> |
Paul Mundt | 7639a45 | 2008-10-20 13:02:48 +0900 | [diff] [blame] | 16 | #include <mach/sdk7780.h> |
Nicholas Beck | 4862ec0 | 2008-01-23 12:50:51 +0900 | [diff] [blame] | 17 | #include <asm/io.h> |
| 18 | #include "pci-sh4.h" |
| 19 | |
| 20 | /* IDSEL [16][17][18][19][20][21][22][23][24][25][26][27][28][29][30][31] */ |
| 21 | static char sdk7780_irq_tab[4][16] __initdata = { |
| 22 | /* INTA */ |
| 23 | { 65, 68, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, |
| 24 | /* INTB */ |
| 25 | { 66, 65, -1, 65, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, |
| 26 | /* INTC */ |
| 27 | { 67, 66, -1, 66, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, |
| 28 | /* INTD */ |
| 29 | { 68, 67, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, |
| 30 | }; |
| 31 | |
| 32 | int __init pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) |
| 33 | { |
| 34 | return sdk7780_irq_tab[pin-1][slot]; |
| 35 | } |
| 36 | |
Nicholas Beck | 4862ec0 | 2008-01-23 12:50:51 +0900 | [diff] [blame] | 37 | static struct sh4_pci_address_map sdk7780_pci_map = { |
| 38 | .window0 = { |
| 39 | .base = SH7780_CS2_BASE_ADDR, |
| 40 | .size = 0x04000000, |
| 41 | }, |
| 42 | .window1 = { |
| 43 | .base = SH7780_CS3_BASE_ADDR, |
| 44 | .size = 0x04000000, |
| 45 | }, |
Nicholas Beck | 4862ec0 | 2008-01-23 12:50:51 +0900 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | int __init pcibios_init_platform(void) |
| 49 | { |
| 50 | printk(KERN_INFO "SH7780 PCI: Finished initializing PCI controller\n"); |
Paul Mundt | ab1363a | 2009-04-17 17:07:47 +0900 | [diff] [blame^] | 51 | return sh7780_pcic_init(&sdk7780_pci_map); |
Nicholas Beck | 4862ec0 | 2008-01-23 12:50:51 +0900 | [diff] [blame] | 52 | } |