Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Fixes for system controllers for Atlas/Malta core cards.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Maciej W. Rozycki and committed by
Ralf Baechle
aa0980b8 bec0204d

+297 -218
+40 -21
arch/mips/mips-boards/generic/init.c
··· 1 1 /* 2 - * Carsten Langgaard, carstenl@mips.com 3 - * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. 2 + * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc. 3 + * All rights reserved. 4 + * Authors: Carsten Langgaard <carstenl@mips.com> 5 + * Maciej W. Rozycki <macro@mips.com> 4 6 * 5 7 * This program is free software; you can distribute it and/or modify it 6 8 * under the terms of the GNU General Public License (Version 2) as ··· 24 22 #include <linux/string.h> 25 23 #include <linux/kernel.h> 26 24 27 - #include <asm/io.h> 28 25 #include <asm/bootinfo.h> 26 + #include <asm/gt64120.h> 27 + #include <asm/io.h> 28 + #include <asm/system.h> 29 + 29 30 #include <asm/mips-boards/prom.h> 30 31 #include <asm/mips-boards/generic.h> 31 - #ifdef CONFIG_MIPS_GT64120 32 - #include <asm/gt64120.h> 33 - #endif 34 - #include <asm/mips-boards/msc01_pci.h> 35 32 #include <asm/mips-boards/bonito64.h> 36 - #ifdef CONFIG_MIPS_MALTA 33 + #include <asm/mips-boards/msc01_pci.h> 34 + 37 35 #include <asm/mips-boards/malta.h> 38 - #endif 39 36 40 37 #ifdef CONFIG_KGDB 41 38 extern int rs_kgdb_hook(int, int); ··· 226 225 227 226 void __init prom_init(void) 228 227 { 228 + u32 start, map, mask, data; 229 + 229 230 prom_argc = fw_arg0; 230 231 _prom_argv = (int *) fw_arg1; 231 232 _prom_envp = (int *) fw_arg2; ··· 269 266 #else 270 267 GT_WRITE(GT_PCI0_CMD_OFS, 0); 271 268 #endif 269 + /* Fix up PCI I/O mapping if necessary (for Atlas). */ 270 + start = GT_READ(GT_PCI0IOLD_OFS); 271 + map = GT_READ(GT_PCI0IOREMAP_OFS); 272 + if ((start & map) != 0) { 273 + map &= ~start; 274 + GT_WRITE(GT_PCI0IOREMAP_OFS, map); 275 + } 272 276 273 - #ifdef CONFIG_MIPS_MALTA 274 277 set_io_port_base(MALTA_GT_PORT_BASE); 275 - #else 276 - set_io_port_base((unsigned long)ioremap(0, 0x20000000)); 277 - #endif 278 278 break; 279 279 280 280 case MIPS_REVISION_CORID_CORE_EMUL_BON: ··· 306 300 BONITO_BONGENCFG_BYTESWAP; 307 301 #endif 308 302 309 - #ifdef CONFIG_MIPS_MALTA 310 303 set_io_port_base(MALTA_BONITO_PORT_BASE); 311 - #else 312 - set_io_port_base((unsigned long)ioremap(0, 0x20000000)); 313 - #endif 314 304 break; 315 305 316 306 case MIPS_REVISION_CORID_CORE_MSC: ··· 314 312 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 315 313 _pcictrl_msc = (unsigned long)ioremap(MIPS_MSC01_PCI_REG_BASE, 0x2000); 316 314 315 + mb(); 316 + MSC_READ(MSC01_PCI_CFG, data); 317 + MSC_WRITE(MSC01_PCI_CFG, data & ~MSC01_PCI_CFG_EN_BIT); 318 + wmb(); 319 + 320 + /* Fix up lane swapping. */ 317 321 #ifdef CONFIG_CPU_LITTLE_ENDIAN 318 322 MSC_WRITE(MSC01_PCI_SWAP, MSC01_PCI_SWAP_NOSWAP); 319 323 #else ··· 328 320 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF | 329 321 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF); 330 322 #endif 323 + /* Fix up target memory mapping. */ 324 + MSC_READ(MSC01_PCI_BAR0, mask); 325 + MSC_WRITE(MSC01_PCI_P2SCMSKL, mask & MSC01_PCI_BAR0_SIZE_MSK); 331 326 332 - #ifdef CONFIG_MIPS_MALTA 327 + /* Don't handle target retries indefinitely. */ 328 + if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) == 329 + MSC01_PCI_CFG_MAXRTRY_MSK) 330 + data = (data & ~(MSC01_PCI_CFG_MAXRTRY_MSK << 331 + MSC01_PCI_CFG_MAXRTRY_SHF)) | 332 + ((MSC01_PCI_CFG_MAXRTRY_MSK - 1) << 333 + MSC01_PCI_CFG_MAXRTRY_SHF); 334 + 335 + wmb(); 336 + MSC_WRITE(MSC01_PCI_CFG, data); 337 + mb(); 338 + 333 339 set_io_port_base(MALTA_MSC_PORT_BASE); 334 - #else 335 - set_io_port_base((unsigned long)ioremap(0, 0x20000000)); 336 - #endif 337 340 break; 338 341 339 342 default:
+123 -35
arch/mips/mips-boards/generic/pci.c
··· 1 1 /* 2 - * Carsten Langgaard, carstenl@mips.com 3 - * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 2 + * Copyright (C) 1999, 2000, 2004, 2005 MIPS Technologies, Inc. 3 + * All rights reserved. 4 + * Authors: Carsten Langgaard <carstenl@mips.com> 5 + * Maciej W. Rozycki <macro@mips.com> 4 6 * 5 7 * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 6 8 * ··· 21 19 * 22 20 * MIPS boards specific PCI support. 23 21 */ 24 - #include <linux/config.h> 25 22 #include <linux/types.h> 26 23 #include <linux/pci.h> 27 24 #include <linux/kernel.h> 28 25 #include <linux/init.h> 29 26 30 - #include <asm/mips-boards/generic.h> 31 27 #include <asm/gt64120.h> 28 + 29 + #include <asm/mips-boards/generic.h> 32 30 #include <asm/mips-boards/bonito64.h> 33 31 #include <asm/mips-boards/msc01_pci.h> 34 - #ifdef CONFIG_MIPS_MALTA 35 - #include <asm/mips-boards/malta.h> 36 - #endif 37 32 38 33 static struct resource bonito64_mem_resource = { 39 34 .name = "Bonito PCI MEM", 40 - .start = 0x10000000UL, 41 - .end = 0x1bffffffUL, 42 35 .flags = IORESOURCE_MEM, 43 36 }; 44 37 45 38 static struct resource bonito64_io_resource = { 46 - .name = "Bonito IO MEM", 47 - .start = 0x00002000UL, /* avoid conflicts with YAMON allocated I/O addresses */ 39 + .name = "Bonito PCI I/O", 40 + .start = 0x00000000UL, 48 41 .end = 0x000fffffUL, 49 42 .flags = IORESOURCE_IO, 50 43 }; 51 44 52 45 static struct resource gt64120_mem_resource = { 53 - .name = "GT64120 PCI MEM", 54 - .start = 0x10000000UL, 55 - .end = 0x1bdfffffUL, 46 + .name = "GT-64120 PCI MEM", 56 47 .flags = IORESOURCE_MEM, 57 48 }; 58 49 59 50 static struct resource gt64120_io_resource = { 60 - .name = "GT64120 IO MEM", 61 - #ifdef CONFIG_MIPS_ATLAS 62 - .start = 0x18000000UL, 63 - .end = 0x181fffffUL, 64 - #endif 65 - #ifdef CONFIG_MIPS_MALTA 66 - .start = 0x00002000UL, 67 - .end = 0x001fffffUL, 68 - #endif 51 + .name = "GT-64120 PCI I/O", 69 52 .flags = IORESOURCE_IO, 70 53 }; 71 54 72 55 static struct resource msc_mem_resource = { 73 56 .name = "MSC PCI MEM", 74 - .start = 0x10000000UL, 75 - .end = 0x1fffffffUL, 76 57 .flags = IORESOURCE_MEM, 77 58 }; 78 59 79 60 static struct resource msc_io_resource = { 80 - .name = "MSC IO MEM", 81 - .start = 0x00002000UL, 82 - .end = 0x007fffffUL, 61 + .name = "MSC PCI I/O", 83 62 .flags = IORESOURCE_IO, 84 63 }; 85 64 ··· 72 89 .pci_ops = &bonito64_pci_ops, 73 90 .io_resource = &bonito64_io_resource, 74 91 .mem_resource = &bonito64_mem_resource, 75 - .mem_offset = 0x10000000UL, 76 92 .io_offset = 0x00000000UL, 77 93 }; 78 94 ··· 79 97 .pci_ops = &gt64120_pci_ops, 80 98 .io_resource = &gt64120_io_resource, 81 99 .mem_resource = &gt64120_mem_resource, 82 - .mem_offset = 0x00000000UL, 83 - .io_offset = 0x00000000UL, 84 100 }; 85 101 86 - static struct pci_controller msc_controller = { 102 + static struct pci_controller msc_controller = { 87 103 .pci_ops = &msc_pci_ops, 88 104 .io_resource = &msc_io_resource, 89 105 .mem_resource = &msc_mem_resource, 90 - .mem_offset = 0x10000000UL, 91 - .io_offset = 0x00000000UL, 92 106 }; 93 107 94 108 void __init mips_pcibios_init(void) 95 109 { 96 110 struct pci_controller *controller; 111 + unsigned long start, end, map, start1, end1, map1, map2, map3, mask; 97 112 98 113 switch (mips_revision_corid) { 99 114 case MIPS_REVISION_CORID_QED_RM5261: ··· 109 130 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */ 110 131 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/ 111 132 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/ 112 - GT_PCI0_CFGADDR_CONFIGEN_BIT ); 133 + GT_PCI0_CFGADDR_CONFIGEN_BIT); 113 134 114 135 /* Perform the write */ 115 136 GT_WRITE(GT_PCI0_CFGDATA_OFS, CPHYSADDR(MIPS_GT_BASE)); 137 + 138 + /* Set up resource ranges from the controller's registers. */ 139 + start = GT_READ(GT_PCI0M0LD_OFS); 140 + end = GT_READ(GT_PCI0M0HD_OFS); 141 + map = GT_READ(GT_PCI0M0REMAP_OFS); 142 + end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK); 143 + start1 = GT_READ(GT_PCI0M1LD_OFS); 144 + end1 = GT_READ(GT_PCI0M1HD_OFS); 145 + map1 = GT_READ(GT_PCI0M1REMAP_OFS); 146 + end1 = (end1 & GT_PCI_HD_MSK) | (start1 & ~GT_PCI_HD_MSK); 147 + /* Cannot support multiple windows, use the wider. */ 148 + if (end1 - start1 > end - start) { 149 + start = start1; 150 + end = end1; 151 + map = map1; 152 + } 153 + mask = ~(start ^ end); 154 + /* We don't support remapping with a discontiguous mask. */ 155 + BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) && 156 + mask != ~((mask & -mask) - 1)); 157 + gt64120_mem_resource.start = start; 158 + gt64120_mem_resource.end = end; 159 + gt64120_controller.mem_offset = (start & mask) - (map & mask); 160 + /* Addresses are 36-bit, so do shifts in the destinations. */ 161 + gt64120_mem_resource.start <<= GT_PCI_DCRM_SHF; 162 + gt64120_mem_resource.end <<= GT_PCI_DCRM_SHF; 163 + gt64120_mem_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1; 164 + gt64120_controller.mem_offset <<= GT_PCI_DCRM_SHF; 165 + 166 + start = GT_READ(GT_PCI0IOLD_OFS); 167 + end = GT_READ(GT_PCI0IOHD_OFS); 168 + map = GT_READ(GT_PCI0IOREMAP_OFS); 169 + end = (end & GT_PCI_HD_MSK) | (start & ~GT_PCI_HD_MSK); 170 + mask = ~(start ^ end); 171 + /* We don't support remapping with a discontiguous mask. */ 172 + BUG_ON((start & GT_PCI_HD_MSK) != (map & GT_PCI_HD_MSK) && 173 + mask != ~((mask & -mask) - 1)); 174 + gt64120_io_resource.start = map & mask; 175 + gt64120_io_resource.end = (map & mask) | ~mask; 176 + gt64120_controller.io_offset = 0; 177 + /* Addresses are 36-bit, so do shifts in the destinations. */ 178 + gt64120_io_resource.start <<= GT_PCI_DCRM_SHF; 179 + gt64120_io_resource.end <<= GT_PCI_DCRM_SHF; 180 + gt64120_io_resource.end |= (1 << GT_PCI_DCRM_SHF) - 1; 116 181 117 182 controller = &gt64120_controller; 118 183 break; ··· 164 141 case MIPS_REVISION_CORID_BONITO64: 165 142 case MIPS_REVISION_CORID_CORE_20K: 166 143 case MIPS_REVISION_CORID_CORE_EMUL_BON: 144 + /* Set up resource ranges from the controller's registers. */ 145 + map = BONITO_PCIMAP; 146 + map1 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO0) >> 147 + BONITO_PCIMAP_PCIMAP_LO0_SHIFT; 148 + map2 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO1) >> 149 + BONITO_PCIMAP_PCIMAP_LO1_SHIFT; 150 + map3 = (BONITO_PCIMAP & BONITO_PCIMAP_PCIMAP_LO2) >> 151 + BONITO_PCIMAP_PCIMAP_LO2_SHIFT; 152 + /* Combine as many adjacent windows as possible. */ 153 + map = map1; 154 + start = BONITO_PCILO0_BASE; 155 + end = 1; 156 + if (map3 == map2 + 1) { 157 + map = map2; 158 + start = BONITO_PCILO1_BASE; 159 + end++; 160 + } 161 + if (map2 == map1 + 1) { 162 + map = map1; 163 + start = BONITO_PCILO0_BASE; 164 + end++; 165 + } 166 + bonito64_mem_resource.start = start; 167 + bonito64_mem_resource.end = start + 168 + BONITO_PCIMAP_WINBASE(end) - 1; 169 + bonito64_controller.mem_offset = start - 170 + BONITO_PCIMAP_WINBASE(map); 171 + 167 172 controller = &bonito64_controller; 168 173 break; 169 174 170 175 case MIPS_REVISION_CORID_CORE_MSC: 171 176 case MIPS_REVISION_CORID_CORE_FPGA2: 172 177 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 178 + /* Set up resource ranges from the controller's registers. */ 179 + MSC_READ(MSC01_PCI_SC2PMBASL, start); 180 + MSC_READ(MSC01_PCI_SC2PMMSKL, mask); 181 + MSC_READ(MSC01_PCI_SC2PMMAPL, map); 182 + msc_mem_resource.start = start & mask; 183 + msc_mem_resource.end = (start & mask) | ~mask; 184 + msc_controller.mem_offset = (start & mask) - (map & mask); 185 + 186 + MSC_READ(MSC01_PCI_SC2PIOBASL, start); 187 + MSC_READ(MSC01_PCI_SC2PIOMSKL, mask); 188 + MSC_READ(MSC01_PCI_SC2PIOMAPL, map); 189 + msc_io_resource.start = map & mask; 190 + msc_io_resource.end = (map & mask) | ~mask; 191 + msc_controller.io_offset = 0; 192 + ioport_resource.end = ~mask; 193 + 194 + /* If ranges overlap I/O takes precedence. */ 195 + start = start & mask; 196 + end = start | ~mask; 197 + if ((start >= msc_mem_resource.start && 198 + start <= msc_mem_resource.end) || 199 + (end >= msc_mem_resource.start && 200 + end <= msc_mem_resource.end)) { 201 + /* Use the larger space. */ 202 + start = max(start, msc_mem_resource.start); 203 + end = min(end, msc_mem_resource.end); 204 + if (start - msc_mem_resource.start >= 205 + msc_mem_resource.end - end) 206 + msc_mem_resource.end = start - 1; 207 + else 208 + msc_mem_resource.start = end + 1; 209 + } 210 + 173 211 controller = &msc_controller; 174 212 break; 175 213 default: 176 214 return; 177 215 } 178 216 217 + if (controller->io_resource->start < 0x00001000UL) /* FIXME */ 218 + controller->io_resource->start = 0x00001000UL; 219 + 220 + iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ 179 221 ioport_resource.end = controller->io_resource->end; 180 222 181 223 register_pci_controller (controller);
+4 -10
arch/mips/pci/ops-bonito64.c
··· 1 1 /* 2 - * Carsten Langgaard, carstenl@mips.com 3 - * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 2 + * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. 3 + * All rights reserved. 4 + * Authors: Carsten Langgaard <carstenl@mips.com> 5 + * Maciej W. Rozycki <macro@mips.com> 4 6 * 5 7 * This program is free software; you can distribute it and/or modify it 6 8 * under the terms of the GNU General Public License (Version 2) as ··· 19 17 * 20 18 * MIPS boards specific PCI support. 21 19 */ 22 - #include <linux/config.h> 23 20 #include <linux/types.h> 24 21 #include <linux/pci.h> 25 22 #include <linux/kernel.h> ··· 57 56 /* We number bus 0 devices from 0..21 */ 58 57 return -1; 59 58 } 60 - 61 - #ifdef CONFIG_MIPS_BOARDS_GEN 62 - if ((busnum == 0) && (PCI_SLOT(devfn) == 17)) { 63 - /* MIPS Core boards have Bonito connected as device 17 */ 64 - return -1; 65 - } 66 - #endif 67 59 68 60 /* Clear cause register bits */ 69 61 BONITO_PCICMD |= (BONITO_PCICMD_MABORT_CLR |
+4 -6
arch/mips/pci/ops-gt64120.c
··· 1 1 /* 2 - * Carsten Langgaard, carstenl@mips.com 3 - * Copyright (C) 1999, 2000 MIPS Technologies, Inc. All rights reserved. 2 + * Copyright (C) 1999, 2000, 2004 MIPS Technologies, Inc. 3 + * All rights reserved. 4 + * Authors: Carsten Langgaard <carstenl@mips.com> 5 + * Maciej W. Rozycki <macro@mips.com> 4 6 * 5 7 * This program is free software; you can distribute it and/or modify it 6 8 * under the terms of the GNU General Public License (Version 2) as ··· 44 42 { 45 43 unsigned char busnum = bus->number; 46 44 u32 intr; 47 - 48 - if ((busnum == 0) && (PCI_SLOT(devfn) == 0)) 49 - /* Galileo itself is devfn 0, don't move it around */ 50 - return -1; 51 45 52 46 if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0))) 53 47 return -1; /* Because of a bug in the galileo (for slot 31). */
+5 -26
arch/mips/pci/ops-msc.c
··· 21 21 * MIPS boards specific PCI support. 22 22 * 23 23 */ 24 - #include <linux/config.h> 25 24 #include <linux/types.h> 26 25 #include <linux/pci.h> 27 26 #include <linux/kernel.h> ··· 48 49 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) 49 50 { 50 51 unsigned char busnum = bus->number; 51 - unsigned char type; 52 52 u32 intr; 53 - 54 - #ifdef CONFIG_MIPS_BOARDS_GEN 55 - if ((busnum == 0) && (PCI_SLOT(devfn) == 17)) { 56 - /* MIPS Core boards have SOCit connected as device 17 */ 57 - return -1; 58 - } 59 - #endif 60 53 61 54 /* Clear status register bits. */ 62 55 MSC_WRITE(MSC01_PCI_INTSTAT, 63 56 (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT)); 64 57 65 - /* Setup address */ 66 - if (busnum == 0) 67 - type = 0; /* Type 0 */ 68 - else 69 - type = 1; /* Type 1 */ 70 - 71 58 MSC_WRITE(MSC01_PCI_CFGADDR, 72 59 ((busnum << MSC01_PCI_CFGADDR_BNUM_SHF) | 73 - (PCI_SLOT(devfn) << MSC01_PCI_CFGADDR_DNUM_SHF) 74 - | (PCI_FUNC(devfn) << 75 - MSC01_PCI_CFGADDR_FNUM_SHF) | ((where / 76 - 4) << 77 - MSC01_PCI_CFGADDR_RNUM_SHF) 78 - | (type))); 60 + (PCI_SLOT(devfn) << MSC01_PCI_CFGADDR_DNUM_SHF) | 61 + (PCI_FUNC(devfn) << MSC01_PCI_CFGADDR_FNUM_SHF) | 62 + ((where / 4) << MSC01_PCI_CFGADDR_RNUM_SHF))); 79 63 80 64 /* Perform access */ 81 65 if (access_type == PCI_ACCESS_WRITE) ··· 68 86 69 87 /* Detect Master/Target abort */ 70 88 MSC_READ(MSC01_PCI_INTSTAT, intr); 71 - if (intr & (MSC01_PCI_INTCFG_MA_BIT | 72 - MSC01_PCI_INTCFG_TA_BIT)) { 89 + if (intr & (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT)) { 73 90 /* Error occurred */ 74 91 75 92 /* Clear bits */ 76 - MSC_READ(MSC01_PCI_INTSTAT, intr); 77 93 MSC_WRITE(MSC01_PCI_INTSTAT, 78 - (MSC01_PCI_INTCFG_MA_BIT | 79 - MSC01_PCI_INTCFG_TA_BIT)); 94 + (MSC01_PCI_INTCFG_MA_BIT | MSC01_PCI_INTCFG_TA_BIT)); 80 95 81 96 return -1; 82 97 }
+121 -120
include/asm-mips/mips-boards/msc01_pci.h
··· 1 1 /* 2 2 * PCI Register definitions for the MIPS System Controller. 3 3 * 4 - * Carsten Langgaard, carstenl@mips.com 5 - * Copyright (C) 2002 MIPS Technologies, Inc. All rights reserved. 4 + * Copyright (C) 2002, 2005 MIPS Technologies, Inc. All rights reserved. 5 + * Authors: Carsten Langgaard <carstenl@mips.com> 6 + * Maciej W. Rozycki <macro@mips.com> 6 7 * 7 8 * This file is subject to the terms and conditions of the GNU General Public 8 9 * License. See the file "COPYING" in the main directory of this archive ··· 30 29 #define MSC01_PCI_CFGADDR_OFS 0x0610 31 30 #define MSC01_PCI_CFGDATA_OFS 0x0618 32 31 #define MSC01_PCI_IACK_OFS 0x0620 33 - #define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ 34 - #define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ 35 - #define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ 36 - #define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ 37 - #define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ 38 - #define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ 39 - #define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ 40 - #define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ 41 - #define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ 42 - #define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ 43 - #define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ 44 - #define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ 45 - #define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ 46 - #define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ 47 - #define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ 48 - #define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ 32 + #define MSC01_PCI_HEAD0_OFS 0x2000 /* DevID, VendorID */ 33 + #define MSC01_PCI_HEAD1_OFS 0x2008 /* Status, Command */ 34 + #define MSC01_PCI_HEAD2_OFS 0x2010 /* Class code, RevID */ 35 + #define MSC01_PCI_HEAD3_OFS 0x2018 /* bist, header, latency */ 36 + #define MSC01_PCI_HEAD4_OFS 0x2020 /* BAR 0 */ 37 + #define MSC01_PCI_HEAD5_OFS 0x2028 /* BAR 1 */ 38 + #define MSC01_PCI_HEAD6_OFS 0x2030 /* BAR 2 */ 39 + #define MSC01_PCI_HEAD7_OFS 0x2038 /* BAR 3 */ 40 + #define MSC01_PCI_HEAD8_OFS 0x2040 /* BAR 4 */ 41 + #define MSC01_PCI_HEAD9_OFS 0x2048 /* BAR 5 */ 42 + #define MSC01_PCI_HEAD10_OFS 0x2050 /* CardBus CIS Ptr */ 43 + #define MSC01_PCI_HEAD11_OFS 0x2058 /* SubSystem ID, -VendorID */ 44 + #define MSC01_PCI_HEAD12_OFS 0x2060 /* ROM BAR */ 45 + #define MSC01_PCI_HEAD13_OFS 0x2068 /* Capabilities ptr */ 46 + #define MSC01_PCI_HEAD14_OFS 0x2070 /* reserved */ 47 + #define MSC01_PCI_HEAD15_OFS 0x2078 /* Maxl, ming, intpin, int */ 49 48 #define MSC01_PCI_BAR0_OFS 0x2220 50 49 #define MSC01_PCI_CFG_OFS 0x2380 51 50 #define MSC01_PCI_SWAP_OFS 0x2388 ··· 87 86 #define MSC01_PCI_P2SCMAPL_MAP_SHF 24 88 87 #define MSC01_PCI_P2SCMAPL_MAP_MSK 0xff000000 89 88 90 - #define MSC01_PCI_INTCFG_RST_SHF 10 91 - #define MSC01_PCI_INTCFG_RST_MSK 0x00000400 92 - #define MSC01_PCI_INTCFG_RST_BIT 0x00000400 93 - #define MSC01_PCI_INTCFG_MWE_SHF 9 94 - #define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 95 - #define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 96 - #define MSC01_PCI_INTCFG_DTO_SHF 8 97 - #define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 98 - #define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 99 - #define MSC01_PCI_INTCFG_MA_SHF 7 100 - #define MSC01_PCI_INTCFG_MA_MSK 0x00000080 101 - #define MSC01_PCI_INTCFG_MA_BIT 0x00000080 102 - #define MSC01_PCI_INTCFG_TA_SHF 6 103 - #define MSC01_PCI_INTCFG_TA_MSK 0x00000040 104 - #define MSC01_PCI_INTCFG_TA_BIT 0x00000040 105 - #define MSC01_PCI_INTCFG_RTY_SHF 5 106 - #define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 107 - #define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 108 - #define MSC01_PCI_INTCFG_MWP_SHF 4 109 - #define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 110 - #define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 111 - #define MSC01_PCI_INTCFG_MRP_SHF 3 112 - #define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 113 - #define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 114 - #define MSC01_PCI_INTCFG_SWP_SHF 2 115 - #define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 116 - #define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 117 - #define MSC01_PCI_INTCFG_SRP_SHF 1 118 - #define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 119 - #define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 120 - #define MSC01_PCI_INTCFG_SE_SHF 0 121 - #define MSC01_PCI_INTCFG_SE_MSK 0x00000001 122 - #define MSC01_PCI_INTCFG_SE_BIT 0x00000001 89 + #define MSC01_PCI_INTCFG_RST_SHF 10 90 + #define MSC01_PCI_INTCFG_RST_MSK 0x00000400 91 + #define MSC01_PCI_INTCFG_RST_BIT 0x00000400 92 + #define MSC01_PCI_INTCFG_MWE_SHF 9 93 + #define MSC01_PCI_INTCFG_MWE_MSK 0x00000200 94 + #define MSC01_PCI_INTCFG_MWE_BIT 0x00000200 95 + #define MSC01_PCI_INTCFG_DTO_SHF 8 96 + #define MSC01_PCI_INTCFG_DTO_MSK 0x00000100 97 + #define MSC01_PCI_INTCFG_DTO_BIT 0x00000100 98 + #define MSC01_PCI_INTCFG_MA_SHF 7 99 + #define MSC01_PCI_INTCFG_MA_MSK 0x00000080 100 + #define MSC01_PCI_INTCFG_MA_BIT 0x00000080 101 + #define MSC01_PCI_INTCFG_TA_SHF 6 102 + #define MSC01_PCI_INTCFG_TA_MSK 0x00000040 103 + #define MSC01_PCI_INTCFG_TA_BIT 0x00000040 104 + #define MSC01_PCI_INTCFG_RTY_SHF 5 105 + #define MSC01_PCI_INTCFG_RTY_MSK 0x00000020 106 + #define MSC01_PCI_INTCFG_RTY_BIT 0x00000020 107 + #define MSC01_PCI_INTCFG_MWP_SHF 4 108 + #define MSC01_PCI_INTCFG_MWP_MSK 0x00000010 109 + #define MSC01_PCI_INTCFG_MWP_BIT 0x00000010 110 + #define MSC01_PCI_INTCFG_MRP_SHF 3 111 + #define MSC01_PCI_INTCFG_MRP_MSK 0x00000008 112 + #define MSC01_PCI_INTCFG_MRP_BIT 0x00000008 113 + #define MSC01_PCI_INTCFG_SWP_SHF 2 114 + #define MSC01_PCI_INTCFG_SWP_MSK 0x00000004 115 + #define MSC01_PCI_INTCFG_SWP_BIT 0x00000004 116 + #define MSC01_PCI_INTCFG_SRP_SHF 1 117 + #define MSC01_PCI_INTCFG_SRP_MSK 0x00000002 118 + #define MSC01_PCI_INTCFG_SRP_BIT 0x00000002 119 + #define MSC01_PCI_INTCFG_SE_SHF 0 120 + #define MSC01_PCI_INTCFG_SE_MSK 0x00000001 121 + #define MSC01_PCI_INTCFG_SE_BIT 0x00000001 123 122 124 - #define MSC01_PCI_INTSTAT_RST_SHF 10 125 - #define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 126 - #define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 127 - #define MSC01_PCI_INTSTAT_MWE_SHF 9 128 - #define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 129 - #define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 130 - #define MSC01_PCI_INTSTAT_DTO_SHF 8 131 - #define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 132 - #define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 133 - #define MSC01_PCI_INTSTAT_MA_SHF 7 134 - #define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 135 - #define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 136 - #define MSC01_PCI_INTSTAT_TA_SHF 6 137 - #define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 138 - #define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 139 - #define MSC01_PCI_INTSTAT_RTY_SHF 5 140 - #define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 141 - #define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 142 - #define MSC01_PCI_INTSTAT_MWP_SHF 4 143 - #define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 144 - #define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 145 - #define MSC01_PCI_INTSTAT_MRP_SHF 3 146 - #define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 147 - #define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 148 - #define MSC01_PCI_INTSTAT_SWP_SHF 2 149 - #define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 150 - #define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 151 - #define MSC01_PCI_INTSTAT_SRP_SHF 1 152 - #define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 153 - #define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 154 - #define MSC01_PCI_INTSTAT_SE_SHF 0 155 - #define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 156 - #define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 123 + #define MSC01_PCI_INTSTAT_RST_SHF 10 124 + #define MSC01_PCI_INTSTAT_RST_MSK 0x00000400 125 + #define MSC01_PCI_INTSTAT_RST_BIT 0x00000400 126 + #define MSC01_PCI_INTSTAT_MWE_SHF 9 127 + #define MSC01_PCI_INTSTAT_MWE_MSK 0x00000200 128 + #define MSC01_PCI_INTSTAT_MWE_BIT 0x00000200 129 + #define MSC01_PCI_INTSTAT_DTO_SHF 8 130 + #define MSC01_PCI_INTSTAT_DTO_MSK 0x00000100 131 + #define MSC01_PCI_INTSTAT_DTO_BIT 0x00000100 132 + #define MSC01_PCI_INTSTAT_MA_SHF 7 133 + #define MSC01_PCI_INTSTAT_MA_MSK 0x00000080 134 + #define MSC01_PCI_INTSTAT_MA_BIT 0x00000080 135 + #define MSC01_PCI_INTSTAT_TA_SHF 6 136 + #define MSC01_PCI_INTSTAT_TA_MSK 0x00000040 137 + #define MSC01_PCI_INTSTAT_TA_BIT 0x00000040 138 + #define MSC01_PCI_INTSTAT_RTY_SHF 5 139 + #define MSC01_PCI_INTSTAT_RTY_MSK 0x00000020 140 + #define MSC01_PCI_INTSTAT_RTY_BIT 0x00000020 141 + #define MSC01_PCI_INTSTAT_MWP_SHF 4 142 + #define MSC01_PCI_INTSTAT_MWP_MSK 0x00000010 143 + #define MSC01_PCI_INTSTAT_MWP_BIT 0x00000010 144 + #define MSC01_PCI_INTSTAT_MRP_SHF 3 145 + #define MSC01_PCI_INTSTAT_MRP_MSK 0x00000008 146 + #define MSC01_PCI_INTSTAT_MRP_BIT 0x00000008 147 + #define MSC01_PCI_INTSTAT_SWP_SHF 2 148 + #define MSC01_PCI_INTSTAT_SWP_MSK 0x00000004 149 + #define MSC01_PCI_INTSTAT_SWP_BIT 0x00000004 150 + #define MSC01_PCI_INTSTAT_SRP_SHF 1 151 + #define MSC01_PCI_INTSTAT_SRP_MSK 0x00000002 152 + #define MSC01_PCI_INTSTAT_SRP_BIT 0x00000002 153 + #define MSC01_PCI_INTSTAT_SE_SHF 0 154 + #define MSC01_PCI_INTSTAT_SE_MSK 0x00000001 155 + #define MSC01_PCI_INTSTAT_SE_BIT 0x00000001 157 156 158 157 #define MSC01_PCI_CFGADDR_BNUM_SHF 16 159 158 #define MSC01_PCI_CFGADDR_BNUM_MSK 0x00ff0000 ··· 168 167 #define MSC01_PCI_CFGDATA_DATA_MSK 0xffffffff 169 168 170 169 /* The defines below are ONLY valid for a MEM bar! */ 171 - #define MSC01_PCI_BAR0_SIZE_SHF 4 172 - #define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 173 - #define MSC01_PCI_BAR0_P_SHF 3 174 - #define MSC01_PCI_BAR0_P_MSK 0x00000008 175 - #define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK 176 - #define MSC01_PCI_BAR0_D_SHF 1 177 - #define MSC01_PCI_BAR0_D_MSK 0x00000006 178 - #define MSC01_PCI_BAR0_T_SHF 0 179 - #define MSC01_PCI_BAR0_T_MSK 0x00000001 180 - #define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK 170 + #define MSC01_PCI_BAR0_SIZE_SHF 4 171 + #define MSC01_PCI_BAR0_SIZE_MSK 0xfffffff0 172 + #define MSC01_PCI_BAR0_P_SHF 3 173 + #define MSC01_PCI_BAR0_P_MSK 0x00000008 174 + #define MSC01_PCI_BAR0_P_BIT MSC01_PCI_BAR0_P_MSK 175 + #define MSC01_PCI_BAR0_D_SHF 1 176 + #define MSC01_PCI_BAR0_D_MSK 0x00000006 177 + #define MSC01_PCI_BAR0_T_SHF 0 178 + #define MSC01_PCI_BAR0_T_MSK 0x00000001 179 + #define MSC01_PCI_BAR0_T_BIT MSC01_PCI_BAR0_T_MSK 181 180 182 181 183 - #define MSC01_PCI_CFG_RA_SHF 17 184 - #define MSC01_PCI_CFG_RA_MSK 0x00020000 185 - #define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK 186 - #define MSC01_PCI_CFG_G_SHF 16 187 - #define MSC01_PCI_CFG_G_MSK 0x00010000 188 - #define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK 189 - #define MSC01_PCI_CFG_EN_SHF 15 190 - #define MSC01_PCI_CFG_EN_MSK 0x00008000 191 - #define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK 192 - #define MSC01_PCI_CFG_MAXRTRY_SHF 0 193 - #define MSC01_PCI_CFG_MAXRTRY_MSK 0x000000ff 182 + #define MSC01_PCI_CFG_RA_SHF 17 183 + #define MSC01_PCI_CFG_RA_MSK 0x00020000 184 + #define MSC01_PCI_CFG_RA_BIT MSC01_PCI_CFG_RA_MSK 185 + #define MSC01_PCI_CFG_G_SHF 16 186 + #define MSC01_PCI_CFG_G_MSK 0x00010000 187 + #define MSC01_PCI_CFG_G_BIT MSC01_PCI_CFG_G_MSK 188 + #define MSC01_PCI_CFG_EN_SHF 15 189 + #define MSC01_PCI_CFG_EN_MSK 0x00008000 190 + #define MSC01_PCI_CFG_EN_BIT MSC01_PCI_CFG_EN_MSK 191 + #define MSC01_PCI_CFG_MAXRTRY_SHF 0 192 + #define MSC01_PCI_CFG_MAXRTRY_MSK 0x00000fff 194 193 195 194 #define MSC01_PCI_SWAP_IO_SHF 18 196 195 #define MSC01_PCI_SWAP_IO_MSK 0x000c0000 ··· 207 206 * FIXME - are these macros specific to Malta and co or to the MSC? If the 208 207 * latter, they should be moved elsewhere. 209 208 */ 210 - #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 209 + #define MIPS_MSC01_PCI_REG_BASE 0x1bd00000 211 210 212 211 extern unsigned long _pcictrl_msc; 213 212 ··· 220 219 * Registers absolute addresses 221 220 */ 222 221 223 - #define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) 224 - #define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) 225 - #define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) 226 - #define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) 227 - #define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) 228 - #define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) 229 - #define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) 230 - #define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) 231 - #define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) 232 - #define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) 233 - #define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) 234 - #define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) 235 - #define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) 222 + #define MSC01_PCI_ID (MSC01_PCI_REG_BASE + MSC01_PCI_ID_OFS) 223 + #define MSC01_PCI_SC2PMBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMBASL_OFS) 224 + #define MSC01_PCI_SC2PMMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMSKL_OFS) 225 + #define MSC01_PCI_SC2PMMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PMMAPL_OFS) 226 + #define MSC01_PCI_SC2PIOBASL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOBASL_OFS) 227 + #define MSC01_PCI_SC2PIOMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMSKL_OFS) 228 + #define MSC01_PCI_SC2PIOMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_SC2PIOMAPL_OFS) 229 + #define MSC01_PCI_P2SCMSKL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMSKL_OFS) 230 + #define MSC01_PCI_P2SCMAPL (MSC01_PCI_REG_BASE + MSC01_PCI_P2SCMAPL_OFS) 231 + #define MSC01_PCI_INTCFG (MSC01_PCI_REG_BASE + MSC01_PCI_INTCFG_OFS) 232 + #define MSC01_PCI_INTSTAT (MSC01_PCI_REG_BASE + MSC01_PCI_INTSTAT_OFS) 233 + #define MSC01_PCI_CFGADDR (MSC01_PCI_REG_BASE + MSC01_PCI_CFGADDR_OFS) 234 + #define MSC01_PCI_CFGDATA (MSC01_PCI_REG_BASE + MSC01_PCI_CFGDATA_OFS) 236 235 #define MSC01_PCI_IACK (MSC01_PCI_REG_BASE + MSC01_PCI_IACK_OFS) 237 236 #define MSC01_PCI_HEAD0 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD0_OFS) 238 237 #define MSC01_PCI_HEAD1 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD1_OFS) ··· 249 248 #define MSC01_PCI_HEAD12 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 250 249 #define MSC01_PCI_HEAD13 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 251 250 #define MSC01_PCI_HEAD14 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 252 - #define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 251 + #define MSC01_PCI_HEAD15 (MSC01_PCI_REG_BASE + MSC01_PCI_HEAD11_OFS) 253 252 #define MSC01_PCI_BAR0 (MSC01_PCI_REG_BASE + MSC01_PCI_BAR0_OFS) 254 253 #define MSC01_PCI_CFG (MSC01_PCI_REG_BASE + MSC01_PCI_CFG_OFS) 255 254 #define MSC01_PCI_SWAP (MSC01_PCI_REG_BASE + MSC01_PCI_SWAP_OFS)