aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/pci/pci-sh7780.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-04-17 03:38:00 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-17 03:38:00 -0400
commitc66c1d79a94a7a302e2dc6c93da40902423eac3e (patch)
treee29bf59d813f623b3a71f5ccb2d0f8ac16fec051 /arch/sh/drivers/pci/pci-sh7780.c
parentab78cbcf6877334fc20868b7df7887349e2e01c8 (diff)
sh: pci: Set pci_cache_line_size on SH7780 via the PCICLS register.
The SH7780 PCIC contains a read-only cache line size register that we can derive pci_cache_line_size from. So, make sure that the software idea of the cache line size actually matches the host controller's idea. 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.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index 19bac2168f4f..fa73b0d15888 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -22,15 +22,6 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include "pci-sh4.h" 23#include "pci-sh4.h"
24 24
25/*
26 * Initialization. Try all known PCI access methods. Note that we support
27 * using both PCI BIOS and direct access: in such cases, we use I/O ports
28 * to access config space.
29 *
30 * Note that the platform specific initialization (BSC registers, and memory
31 * space mapping) will be called via the platform defined function
32 * pcibios_init_platform().
33 */
34int __init sh7780_pci_init(struct pci_channel *chan) 25int __init sh7780_pci_init(struct pci_channel *chan)
35{ 26{
36 unsigned int id; 27 unsigned int id;
@@ -70,19 +61,31 @@ int __init sh7780_pci_init(struct pci_channel *chan)
70 if ((ret = sh4_pci_check_direct(chan)) != 0) 61 if ((ret = sh4_pci_check_direct(chan)) != 0)
71 return ret; 62 return ret;
72 63
64 /*
65 * Platform specific initialization (BSC registers, and memory space
66 * mapping) will be called via the platform defined function
67 * pcibios_init_platform().
68 */
73 return pcibios_init_platform(); 69 return pcibios_init_platform();
74} 70}
75 71
72extern u8 pci_cache_line_size;
73
76int __init sh7780_pcic_init(struct pci_channel *chan, 74int __init sh7780_pcic_init(struct pci_channel *chan,
77 struct sh4_pci_address_map *map) 75 struct sh4_pci_address_map *map)
78{ 76{
79 u32 word; 77 u32 word;
80 78
79 /*
80 * Set the class and sub-class codes.
81 */
81 __raw_writeb(PCI_CLASS_BRIDGE_HOST >> 8, 82 __raw_writeb(PCI_CLASS_BRIDGE_HOST >> 8,
82 chan->reg_base + SH7780_PCIBCC); 83 chan->reg_base + SH7780_PCIBCC);
83 __raw_writeb(PCI_CLASS_BRIDGE_HOST & 0xff, 84 __raw_writeb(PCI_CLASS_BRIDGE_HOST & 0xff,
84 chan->reg_base + SH7780_PCISUB); 85 chan->reg_base + SH7780_PCISUB);
85 86
87 pci_cache_line_size = pci_read_reg(chan, SH7780_PCICLS) / 4;
88
86 /* set the command/status bits to: 89 /* set the command/status bits to:
87 * Wait Cycle Control + Parity Enable + Bus Master + 90 * Wait Cycle Control + Parity Enable + Bus Master +
88 * Mem space enable 91 * Mem space enable