diff options
author | Dan Williams <dan.j.williams@intel.com> | 2007-05-02 12:59:44 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-03 09:02:48 -0400 |
commit | e90ddd813df7897af34226ed1cd442f7a182816e (patch) | |
tree | 1ecf08c0aa9d71d54019fc84876a07898352b641 /include/asm-arm/hardware | |
parent | fa543f005de175080640266ca536d45b4b0b1a61 (diff) |
[ARM] 4348/4: iop3xx: Give Linux control over PCI initialization
Currently the iop3xx platform support code assumes that RedBoot is the
bootloader and has already initialized the ATU. Linux should handle this
initialization for three reasons:
1/ The memory map that RedBoot sets up is not optimal (page_to_dma and
virt_to_phys return different addresses). The effect of this is that using
the dma mapping API for the internal bus dma units generates pci bus
addresses that are incorrect for the internal bus.
2/ Not all iop platforms use RedBoot
3/ If the ATU is already initialized it indicates that the iop is an add-in
card in another host, it does not own the PCI bus, and should not be
re-initialized.
Changelog:
* rather than change nr_controllers to zero, simply do not call
pci_common_init
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/hardware')
-rw-r--r-- | include/asm-arm/hardware/iop3xx.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index 15141a9caca8..ebbcd9be3fe5 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h | |||
@@ -28,6 +28,7 @@ | |||
28 | extern void gpio_line_config(int line, int direction); | 28 | extern void gpio_line_config(int line, int direction); |
29 | extern int gpio_line_get(int line); | 29 | extern int gpio_line_get(int line); |
30 | extern void gpio_line_set(int line, int value); | 30 | extern void gpio_line_set(int line, int value); |
31 | extern int init_atu; | ||
31 | #endif | 32 | #endif |
32 | 33 | ||
33 | 34 | ||
@@ -103,6 +104,21 @@ extern void gpio_line_set(int line, int value); | |||
103 | #define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2) | 104 | #define IOP3XX_PCIXCMD (volatile u16 *)IOP3XX_REG_ADDR(0x01e2) |
104 | #define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4) | 105 | #define IOP3XX_PCIXSR (volatile u32 *)IOP3XX_REG_ADDR(0x01e4) |
105 | #define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec) | 106 | #define IOP3XX_PCIIRSR (volatile u32 *)IOP3XX_REG_ADDR(0x01ec) |
107 | #define IOP3XX_PCSR_OUT_Q_BUSY (1 << 15) | ||
108 | #define IOP3XX_PCSR_IN_Q_BUSY (1 << 14) | ||
109 | #define IOP3XX_ATUCR_OUT_EN (1 << 1) | ||
110 | |||
111 | #define IOP3XX_INIT_ATU_DEFAULT 0 | ||
112 | #define IOP3XX_INIT_ATU_DISABLE -1 | ||
113 | #define IOP3XX_INIT_ATU_ENABLE 1 | ||
114 | |||
115 | #ifdef CONFIG_IOP3XX_ATU | ||
116 | #define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\ | ||
117 | IOP3XX_INIT_ATU_ENABLE : init_atu) | ||
118 | #else | ||
119 | #define iop3xx_get_init_atu(x) (init_atu == IOP3XX_INIT_ATU_DEFAULT ?\ | ||
120 | IOP3XX_INIT_ATU_DISABLE : init_atu) | ||
121 | #endif | ||
106 | 122 | ||
107 | /* Messaging Unit */ | 123 | /* Messaging Unit */ |
108 | #define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) | 124 | #define IOP3XX_IMR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0310) |
@@ -253,14 +269,12 @@ extern void gpio_line_set(int line, int value); | |||
253 | /* | 269 | /* |
254 | * IOP3XX I/O and Mem space regions for PCI autoconfiguration | 270 | * IOP3XX I/O and Mem space regions for PCI autoconfiguration |
255 | */ | 271 | */ |
256 | #define IOP3XX_PCI_MEM_WINDOW_SIZE 0x04000000 | 272 | #define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 |
257 | #define IOP3XX_PCI_LOWER_MEM_PA 0x80000000 | ||
258 | #define IOP3XX_PCI_LOWER_MEM_BA (*IOP3XX_OMWTVR0) | ||
259 | 273 | ||
260 | #define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000 | 274 | #define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000 |
261 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 | 275 | #define IOP3XX_PCI_LOWER_IO_PA 0x90000000 |
262 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 | 276 | #define IOP3XX_PCI_LOWER_IO_VA 0xfe000000 |
263 | #define IOP3XX_PCI_LOWER_IO_BA (*IOP3XX_OIOWTVR) | 277 | #define IOP3XX_PCI_LOWER_IO_BA 0x90000000 |
264 | #define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\ | 278 | #define IOP3XX_PCI_UPPER_IO_PA (IOP3XX_PCI_LOWER_IO_PA +\ |
265 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | 279 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) |
266 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ | 280 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ |