aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-17 07:37:16 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-17 07:37:16 -0400
commit62c7ae87cb5962d3dfaa6d916a15e4faa9e07363 (patch)
tree3ab00d7c857edeb864b204bf041444fb4197af9b /arch/sh/drivers/pci/pci-sh7780.c
parenta6d377b6969235a3b5a6e87bdcef387d0976b41c (diff)
sh: pci: Start unifying the SH7780 PCIC initialization.
This starts moving out the common initialization bits from the various fixup paths in to the shared init path. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/pci/pci-sh7780.c')
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 07c5529a273b..f02d9dfcf252 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -1,19 +1,12 @@
1/* 1/*
2 * Low-Level PCI Support for the SH7780 2 * Low-Level PCI Support for the SH7780
3 * 3 *
4 * Dustin McIntire (dustin@sensoria.com) 4 * Copyright (C) 2005 - 2009 Paul Mundt
5 * Derived from arch/i386/kernel/pci-*.c which bore the message:
6 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
7 *
8 * Ported to the new API by Paul Mundt <lethal@linux-sh.org>
9 * With cleanup by Paul van Gool <pvangool@mimotech.com>
10 *
11 * May be copied or modified under the terms of the GNU General Public
12 * License. See linux/COPYING for more information.
13 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
14 */ 9 */
15#undef DEBUG
16
17#include <linux/types.h> 10#include <linux/types.h>
18#include <linux/kernel.h> 11#include <linux/kernel.h>
19#include <linux/init.h> 12#include <linux/init.h>
@@ -117,13 +110,8 @@ int __init pcibios_init_platform(void)
117 110
118 pci_cache_line_size = pci_read_reg(chan, SH7780_PCICLS) / 4; 111 pci_cache_line_size = pci_read_reg(chan, SH7780_PCICLS) / 4;
119 112
120 /* set the command/status bits to: 113 /*
121 * Wait Cycle Control + Parity Enable + Bus Master + 114 * Set IO and Mem windows to local address
122 * Mem space enable
123 */
124 pci_write_reg(chan, 0x00000046, SH7780_PCICMD);
125
126 /* Set IO and Mem windows to local address
127 * Make PCI and local address the same for easy 1 to 1 mapping 115 * Make PCI and local address the same for easy 1 to 1 mapping
128 */ 116 */
129 pci_write_reg(chan, sh7780_pci_map.window0.size - 0xfffff, SH4_PCILSR0); 117 pci_write_reg(chan, sh7780_pci_map.window0.size - 0xfffff, SH4_PCILSR0);
@@ -131,9 +119,33 @@ int __init pcibios_init_platform(void)
131 pci_write_reg(chan, sh7780_pci_map.window0.base, SH4_PCILAR0); 119 pci_write_reg(chan, sh7780_pci_map.window0.base, SH4_PCILAR0);
132 pci_write_reg(chan, sh7780_pci_map.window0.base, SH7780_PCIMBAR0); 120 pci_write_reg(chan, sh7780_pci_map.window0.base, SH7780_PCIMBAR0);
133 121
122 pci_write_reg(chan, 0x0000380f, SH4_PCIAINTM);
123
124 /* Set up standard PCI config registers */
125 __raw_writew(0xFB00, chan->reg_base + SH7780_PCISTATUS);
126 __raw_writew(0x0047, chan->reg_base + SH7780_PCICMD);
127 __raw_writew(0x1912, chan->reg_base + SH7780_PCISVID);
128 __raw_writew(0x0001, chan->reg_base + SH7780_PCISID);
129
130 __raw_writeb(0x00, chan->reg_base + SH7780_PCIPIF);
131
134 /* Apply any last-minute PCIC fixups */ 132 /* Apply any last-minute PCIC fixups */
135 pci_fixup_pcic(chan); 133 pci_fixup_pcic(chan);
136 134
135 pci_write_reg(chan, 0xfd000000, SH7780_PCIMBR0);
136 pci_write_reg(chan, 0x00fc0000, SH7780_PCIMBMR0);
137
138#ifdef CONFIG_32BIT
139 pci_write_reg(chan, 0xc0000000, SH7780_PCIMBR2);
140 pci_write_reg(chan, 0x20000000 - SH7780_PCI_IO_SIZE, SH7780_PCIMBMR2);
141#endif
142
143 /* Set IOBR for windows containing area specified in pci.h */
144 pci_write_reg(chan, chan->io_resource->start & ~(SH7780_PCI_IO_SIZE-1),
145 SH7780_PCIIOBR);
146 pci_write_reg(chan, ((SH7780_PCI_IO_SIZE-1) & (7<<18)),
147 SH7780_PCIIOBMR);
148
137 /* SH7780 init done, set central function init complete */ 149 /* SH7780 init done, set central function init complete */
138 /* use round robin mode to stop a device starving/overruning */ 150 /* use round robin mode to stop a device starving/overruning */
139 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO; 151 word = SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO;