2 * PMC-Sierra MSP board specific pci_ops
4 * Copyright 2001 MontaVista Software Inc.
5 * Copyright 2005-2007 PMC-Sierra, Inc
7 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
9 * Much of the code is derived from the original DDB5074 port by
10 * Geert Uytterhoeven <geert@linux-m68k.org>
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
19 #define PCI_COUNTERS 1
21 #include <linux/types.h>
22 #include <linux/pci.h>
23 #include <linux/interrupt.h>
25 #if defined(CONFIG_PROC_FS) && defined(PCI_COUNTERS)
26 #include <linux/proc_fs.h>
27 #include <linux/seq_file.h>
28 #endif /* CONFIG_PROC_FS && PCI_COUNTERS */
30 #include <linux/kernel.h>
31 #include <linux/init.h>
33 #include <asm/byteorder.h>
34 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
35 #include <asm/mipsmtregs.h>
39 #include <msp_cic_int.h>
42 #include <msp_regops.h>
44 #define PCI_ACCESS_READ 0
45 #define PCI_ACCESS_WRITE 1
47 #if defined(CONFIG_PROC_FS) && defined(PCI_COUNTERS)
48 static char proc_init
;
49 extern struct proc_dir_entry
*proc_bus_pci_dir
;
50 unsigned int pci_int_count
[32];
52 static void pci_proc_init(void);
54 /*****************************************************************************
56 * FUNCTION: show_msp_pci_counts
57 * _________________________________________________________________________
59 * DESCRIPTION: Prints the count of how many times each PCI
60 * interrupt has asserted. Can be invoked by the
63 * INPUTS: m - synthetic file construction data
68 ****************************************************************************/
69 static int show_msp_pci_counts(struct seq_file
*m
, void *v
)
72 unsigned int intcount
, total
= 0;
74 for (i
= 0; i
< 32; ++i
) {
75 intcount
= pci_int_count
[i
];
77 seq_printf(m
, "[%d] = %u\n", i
, intcount
);
82 seq_printf(m
, "total = %u\n", total
);
86 /*****************************************************************************
88 * FUNCTION: gen_pci_cfg_wr_show
89 * _________________________________________________________________________
91 * DESCRIPTION: Generates a configuration write cycle for debug purposes.
92 * The IDSEL line asserted and location and data written are
93 * immaterial. Just want to be able to prove that a
94 * configuration write can be correctly generated on the
95 * PCI bus. Intent is that this function by invocable from
96 * the /proc filesystem.
98 * INPUTS: m - synthetic file construction data
101 * RETURNS: 0 or error
103 ****************************************************************************/
104 static int gen_pci_cfg_wr_show(struct seq_file
*m
, void *v
)
106 unsigned char where
= 0; /* Write to static Device/Vendor ID */
107 unsigned char bus_num
= 0; /* Bus 0 */
108 unsigned char dev_fn
= 0xF; /* Arbitrary device number */
109 u32 wr_data
= 0xFF00AA00; /* Arbitrary data */
110 struct msp_pci_regs
*preg
= (void *)PCI_BASE_REG
;
114 seq_puts(m
, "PMC MSP PCI: Beginning\n");
116 if (proc_init
== 0) {
121 seq_puts(m
, "PMC MSP PCI: Before Cfg Wr\n");
124 * Generate PCI Configuration Write Cycle
127 /* Clear cause register bits */
128 preg
->if_status
= ~(BPCI_IFSTATUS_BC0F
| BPCI_IFSTATUS_BC1F
);
130 /* Setup address that is to appear on PCI bus */
131 preg
->config_addr
= BPCI_CFGADDR_ENABLE
|
132 (bus_num
<< BPCI_CFGADDR_BUSNUM_SHF
) |
133 (dev_fn
<< BPCI_CFGADDR_FUNCTNUM_SHF
) |
136 value
= cpu_to_le32(wr_data
);
138 /* Launch the PCI configuration write cycle */
139 *PCI_CONFIG_SPACE_REG
= value
;
142 * Check if the PCI configuration cycle (rd or wr) succeeded, by
143 * checking the status bits for errors like master or target abort.
145 intr
= preg
->if_status
;
147 seq_puts(m
, "PMC MSP PCI: After Cfg Wr\n");
151 /*****************************************************************************
153 * FUNCTION: pci_proc_init
154 * _________________________________________________________________________
156 * DESCRIPTION: Create entries in the /proc filesystem for debug access.
164 ****************************************************************************/
165 static void pci_proc_init(void)
167 proc_create_single("pmc_msp_pci_rd_cnt", 0, NULL
, show_msp_pci_counts
);
168 proc_create_single("pmc_msp_pci_cfg_wr", 0, NULL
, gen_pci_cfg_wr_show
);
170 #endif /* CONFIG_PROC_FS && PCI_COUNTERS */
172 /*****************************************************************************
174 * STRUCT: pci_io_resource
175 * _________________________________________________________________________
177 * DESCRIPTION: Defines the address range that pciauto() will use to
178 * assign to the I/O BARs of PCI devices.
180 * Use the start and end addresses of the MSP7120 PCI Host
181 * Controller I/O space, in the form that they appear on the
182 * PCI bus AFTER MSP7120 has performed address translation.
184 * For I/O accesses, MSP7120 ignores OATRAN and maps I/O
185 * accesses into the bottom 0xFFF region of address space,
186 * so that is the range to put into the pci_io_resource
189 * In MSP4200, the start address was 0x04 instead of the
190 * expected 0x00. Will just assume there was a good reason
193 * NOTES: Linux, by default, will assign I/O space to the lowest
194 * region of address space. Since MSP7120 and Linux,
195 * by default, have no offset in between how they map, the
196 * io_offset element of pci_controller struct should be set
199 * name - String used for a meaningful name.
201 * start - Start address of MSP7120's I/O space, as MSP7120 presents
202 * the address on the PCI bus.
204 * end - End address of MSP7120's I/O space, as MSP7120 presents
205 * the address on the PCI bus.
207 * flags - Attributes indicating the type of resource. In this case,
208 * indicate I/O space.
210 ****************************************************************************/
211 static struct resource pci_io_resource
= {
212 .name
= "pci IO space",
215 .flags
= IORESOURCE_IO
/* I/O space */
218 /*****************************************************************************
220 * STRUCT: pci_mem_resource
221 * _________________________________________________________________________
223 * DESCRIPTION: Defines the address range that pciauto() will use to
224 * assign to the memory BARs of PCI devices.
226 * The .start and .end values are dependent upon how address
227 * translation is performed by the OATRAN regiser.
229 * The values to use for .start and .end are the values
230 * in the form they appear on the PCI bus AFTER MSP7120 has
231 * performed OATRAN address translation.
234 * name - String used for a meaningful name.
236 * start - Start address of MSP7120's memory space, as MSP7120 presents
237 * the address on the PCI bus.
239 * end - End address of MSP7120's memory space, as MSP7120 presents
240 * the address on the PCI bus.
242 * flags - Attributes indicating the type of resource. In this case,
243 * indicate memory space.
245 ****************************************************************************/
246 static struct resource pci_mem_resource
= {
247 .name
= "pci memory space",
248 .start
= MSP_PCI_SPACE_BASE
,
249 .end
= MSP_PCI_SPACE_END
,
250 .flags
= IORESOURCE_MEM
/* memory space */
253 /*****************************************************************************
255 * FUNCTION: bpci_interrupt
256 * _________________________________________________________________________
258 * DESCRIPTION: PCI status interrupt handler. Updates the count of how
259 * many times each status bit has been set, then clears
260 * the status bits. If the appropriate macros are defined,
261 * these counts can be viewed via the /proc filesystem.
263 * INPUTS: irq - unused
269 * RETURNS: PCIBIOS_SUCCESSFUL - success
271 ****************************************************************************/
272 static irqreturn_t
bpci_interrupt(int irq
, void *dev_id
)
274 struct msp_pci_regs
*preg
= (void *)PCI_BASE_REG
;
275 unsigned int stat
= preg
->if_status
;
277 #if defined(CONFIG_PROC_FS) && defined(PCI_COUNTERS)
279 for (i
= 0; i
< 32; ++i
) {
283 #endif /* PROC_FS && PCI_COUNTERS */
285 /* printk("PCI ISR: Status=%08X\n", stat); */
287 /* write to clear all asserted interrupts */
288 preg
->if_status
= stat
;
293 /*****************************************************************************
295 * FUNCTION: msp_pcibios_config_access
296 * _________________________________________________________________________
298 * DESCRIPTION: Performs a PCI configuration access (rd or wr), then
299 * checks that the access succeeded by querying MSP7120's
303 * access_type - kind of PCI configuration cycle to perform
304 * (read or write). Legal values are
305 * PCI_ACCESS_WRITE and PCI_ACCESS_READ.
307 * bus - pointer to the bus number of the device to
308 * be targeted for the configuration cycle.
309 * The only element of the pci_bus structure
310 * used is bus->number. This argument determines
311 * if the configuration access will be Type 0 or
312 * Type 1. Since MSP7120 assumes itself to be the
313 * PCI Host, any non-zero bus->number generates
316 * devfn - this is an 8-bit field. The lower three bits
317 * specify the function number of the device to
318 * be targeted for the configuration cycle, with
319 * all three-bit combinations being legal. The
320 * upper five bits specify the device number,
321 * with legal values being 10 to 31.
323 * where - address within the Configuration Header
326 * data - for write accesses, contains the data to
330 * data - for read accesses, contains the value read.
332 * RETURNS: PCIBIOS_SUCCESSFUL - success
333 * -1 - access failure
335 ****************************************************************************/
336 int msp_pcibios_config_access(unsigned char access_type
,
342 struct msp_pci_regs
*preg
= (void *)PCI_BASE_REG
;
343 unsigned char bus_num
= bus
->number
;
344 unsigned char dev_fn
= (unsigned char)devfn
;
347 static char pciirqflag
;
349 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
350 unsigned int vpe_status
;
353 #if defined(CONFIG_PROC_FS) && defined(PCI_COUNTERS)
354 if (proc_init
== 0) {
358 #endif /* CONFIG_PROC_FS && PCI_COUNTERS */
361 * Just the first time this function invokes, allocate
362 * an interrupt line for PCI host status interrupts. The
363 * allocation assigns an interrupt handler to the interrupt.
365 if (pciirqflag
== 0) {
366 ret
= request_irq(MSP_INT_PCI
,/* Hardcoded internal MSP7120 wiring */
376 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
381 * Clear PCI cause register bits.
383 * In Polo, the PCI Host had a dedicated DMA called the
384 * Block Copy (not to be confused with the general purpose Block
385 * Copy Engine block). There appear to have been special interrupts
386 * for this Block Copy, called Block Copy 0 Fault (BC0F) and
387 * Block Copy 1 Fault (BC1F). MSP4200 and MSP7120 don't have this
388 * dedicated Block Copy block, so these two interrupts are now
389 * marked reserved. In case the Block Copy is resurrected in a
390 * future design, maintain the code that treats these two interrupts
393 * Write to clear all interrupts in the PCI status register, aside
394 * from BC0F and BC1F.
396 preg
->if_status
= ~(BPCI_IFSTATUS_BC0F
| BPCI_IFSTATUS_BC1F
);
398 /* Setup address that is to appear on PCI bus */
399 preg
->config_addr
= BPCI_CFGADDR_ENABLE
|
400 (bus_num
<< BPCI_CFGADDR_BUSNUM_SHF
) |
401 (dev_fn
<< BPCI_CFGADDR_FUNCTNUM_SHF
) |
404 /* IF access is a PCI configuration write */
405 if (access_type
== PCI_ACCESS_WRITE
) {
406 value
= cpu_to_le32(*data
);
407 *PCI_CONFIG_SPACE_REG
= value
;
409 /* ELSE access is a PCI configuration read */
410 value
= le32_to_cpu(*PCI_CONFIG_SPACE_REG
);
415 * Check if the PCI configuration cycle (rd or wr) succeeded, by
416 * checking the status bits for errors like master or target abort.
418 intr
= preg
->if_status
;
420 /* Clear config access */
421 preg
->config_addr
= 0;
423 /* IF error occurred */
424 if (intr
& ~(BPCI_IFSTATUS_BC0F
| BPCI_IFSTATUS_BC1F
)) {
425 /* Clear status bits */
426 preg
->if_status
= ~(BPCI_IFSTATUS_BC0F
| BPCI_IFSTATUS_BC1F
);
428 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
435 #if defined(CONFIG_PMC_MSP7120_GW) || defined(CONFIG_PMC_MSP7120_EVAL)
439 return PCIBIOS_SUCCESSFUL
;
442 /*****************************************************************************
444 * FUNCTION: msp_pcibios_read_config_byte
445 * _________________________________________________________________________
447 * DESCRIPTION: Read a byte from PCI configuration address spac
448 * Since the hardware can't address 8 bit chunks
449 * directly, read a 32-bit chunk, then mask off extraneous
452 * INPUTS bus - structure containing attributes for the PCI bus
453 * that the read is destined for.
454 * devfn - device/function combination that the read is
456 * where - register within the Configuration Header space
459 * OUTPUTS val - read data
461 * RETURNS: PCIBIOS_SUCCESSFUL - success
462 * -1 - read access failure
464 ****************************************************************************/
466 msp_pcibios_read_config_byte(struct pci_bus
*bus
,
474 * If the config access did not complete normally (e.g., underwent
475 * master abort) do the PCI compliant thing, which is to supply an
478 if (msp_pcibios_config_access(PCI_ACCESS_READ
, bus
, devfn
,
484 *val
= (data
>> ((where
& 3) << 3)) & 0x0ff;
486 return PCIBIOS_SUCCESSFUL
;
489 /*****************************************************************************
491 * FUNCTION: msp_pcibios_read_config_word
492 * _________________________________________________________________________
494 * DESCRIPTION: Read a word (16 bits) from PCI configuration address space.
495 * Since the hardware can't address 16 bit chunks
496 * directly, read a 32-bit chunk, then mask off extraneous
499 * INPUTS bus - structure containing attributes for the PCI bus
500 * that the read is destined for.
501 * devfn - device/function combination that the read is
503 * where - register within the Configuration Header space
506 * OUTPUTS val - read data
508 * RETURNS: PCIBIOS_SUCCESSFUL - success
509 * PCIBIOS_BAD_REGISTER_NUMBER - bad register address
510 * -1 - read access failure
512 ****************************************************************************/
514 msp_pcibios_read_config_word(struct pci_bus
*bus
,
521 /* if (where & 1) */ /* Commented out non-compliant code.
522 * Should allow word access to configuration
523 * registers, with only exception being when
524 * the word access would wrap around into
527 if ((where
& 3) == 3) {
529 return PCIBIOS_BAD_REGISTER_NUMBER
;
533 * If the config access did not complete normally (e.g., underwent
534 * master abort) do the PCI compliant thing, which is to supply an
537 if (msp_pcibios_config_access(PCI_ACCESS_READ
, bus
, devfn
,
543 *val
= (data
>> ((where
& 3) << 3)) & 0x0ffff;
545 return PCIBIOS_SUCCESSFUL
;
548 /*****************************************************************************
550 * FUNCTION: msp_pcibios_read_config_dword
551 * _________________________________________________________________________
553 * DESCRIPTION: Read a double word (32 bits) from PCI configuration
556 * INPUTS bus - structure containing attributes for the PCI bus
557 * that the read is destined for.
558 * devfn - device/function combination that the read is
560 * where - register within the Configuration Header space
563 * OUTPUTS val - read data
565 * RETURNS: PCIBIOS_SUCCESSFUL - success
566 * PCIBIOS_BAD_REGISTER_NUMBER - bad register address
567 * -1 - read access failure
569 ****************************************************************************/
571 msp_pcibios_read_config_dword(struct pci_bus
*bus
,
578 /* Address must be dword aligned. */
581 return PCIBIOS_BAD_REGISTER_NUMBER
;
585 * If the config access did not complete normally (e.g., underwent
586 * master abort) do the PCI compliant thing, which is to supply an
589 if (msp_pcibios_config_access(PCI_ACCESS_READ
, bus
, devfn
,
597 return PCIBIOS_SUCCESSFUL
;
600 /*****************************************************************************
602 * FUNCTION: msp_pcibios_write_config_byte
603 * _________________________________________________________________________
605 * DESCRIPTION: Write a byte to PCI configuration address space.
606 * Since the hardware can't address 8 bit chunks
607 * directly, a read-modify-write is performed.
609 * INPUTS bus - structure containing attributes for the PCI bus
610 * that the write is destined for.
611 * devfn - device/function combination that the write is
613 * where - register within the Configuration Header space
615 * val - value to write
619 * RETURNS: PCIBIOS_SUCCESSFUL - success
620 * -1 - write access failure
622 ****************************************************************************/
624 msp_pcibios_write_config_byte(struct pci_bus
*bus
,
631 /* read config space */
632 if (msp_pcibios_config_access(PCI_ACCESS_READ
, bus
, devfn
,
636 /* modify the byte within the dword */
637 data
= (data
& ~(0xff << ((where
& 3) << 3))) |
638 (val
<< ((where
& 3) << 3));
640 /* write back the full dword */
641 if (msp_pcibios_config_access(PCI_ACCESS_WRITE
, bus
, devfn
,
645 return PCIBIOS_SUCCESSFUL
;
648 /*****************************************************************************
650 * FUNCTION: msp_pcibios_write_config_word
651 * _________________________________________________________________________
653 * DESCRIPTION: Write a word (16-bits) to PCI configuration address space.
654 * Since the hardware can't address 16 bit chunks
655 * directly, a read-modify-write is performed.
657 * INPUTS bus - structure containing attributes for the PCI bus
658 * that the write is destined for.
659 * devfn - device/function combination that the write is
661 * where - register within the Configuration Header space
663 * val - value to write
667 * RETURNS: PCIBIOS_SUCCESSFUL - success
668 * PCIBIOS_BAD_REGISTER_NUMBER - bad register address
669 * -1 - write access failure
671 ****************************************************************************/
673 msp_pcibios_write_config_word(struct pci_bus
*bus
,
680 /* Fixed non-compliance: if (where & 1) */
681 if ((where
& 3) == 3)
682 return PCIBIOS_BAD_REGISTER_NUMBER
;
684 /* read config space */
685 if (msp_pcibios_config_access(PCI_ACCESS_READ
, bus
, devfn
,
689 /* modify the word within the dword */
690 data
= (data
& ~(0xffff << ((where
& 3) << 3))) |
691 (val
<< ((where
& 3) << 3));
693 /* write back the full dword */
694 if (msp_pcibios_config_access(PCI_ACCESS_WRITE
, bus
, devfn
,
698 return PCIBIOS_SUCCESSFUL
;
701 /*****************************************************************************
703 * FUNCTION: msp_pcibios_write_config_dword
704 * _________________________________________________________________________
706 * DESCRIPTION: Write a double word (32-bits) to PCI configuration address
709 * INPUTS bus - structure containing attributes for the PCI bus
710 * that the write is destined for.
711 * devfn - device/function combination that the write is
713 * where - register within the Configuration Header space
715 * val - value to write
719 * RETURNS: PCIBIOS_SUCCESSFUL - success
720 * PCIBIOS_BAD_REGISTER_NUMBER - bad register address
721 * -1 - write access failure
723 ****************************************************************************/
725 msp_pcibios_write_config_dword(struct pci_bus
*bus
,
730 /* check that address is dword aligned */
732 return PCIBIOS_BAD_REGISTER_NUMBER
;
735 if (msp_pcibios_config_access(PCI_ACCESS_WRITE
, bus
, devfn
,
739 return PCIBIOS_SUCCESSFUL
;
742 /*****************************************************************************
744 * FUNCTION: msp_pcibios_read_config
745 * _________________________________________________________________________
747 * DESCRIPTION: Interface the PCI configuration read request with
748 * the appropriate function, based on how many bytes
749 * the read request is.
751 * INPUTS bus - structure containing attributes for the PCI bus
752 * that the write is destined for.
753 * devfn - device/function combination that the write is
755 * where - register within the Configuration Header space
757 * size - in units of bytes, should be 1, 2, or 4.
759 * OUTPUTS val - value read, with any extraneous bytes masked
762 * RETURNS: PCIBIOS_SUCCESSFUL - success
765 ****************************************************************************/
767 msp_pcibios_read_config(struct pci_bus
*bus
,
774 if (msp_pcibios_read_config_byte(bus
, devfn
, where
, val
)) {
777 } else if (size
== 2) {
778 if (msp_pcibios_read_config_word(bus
, devfn
, where
, val
)) {
781 } else if (size
== 4) {
782 if (msp_pcibios_read_config_dword(bus
, devfn
, where
, val
)) {
790 return PCIBIOS_SUCCESSFUL
;
793 /*****************************************************************************
795 * FUNCTION: msp_pcibios_write_config
796 * _________________________________________________________________________
798 * DESCRIPTION: Interface the PCI configuration write request with
799 * the appropriate function, based on how many bytes
800 * the read request is.
802 * INPUTS bus - structure containing attributes for the PCI bus
803 * that the write is destined for.
804 * devfn - device/function combination that the write is
806 * where - register within the Configuration Header space
808 * size - in units of bytes, should be 1, 2, or 4.
809 * val - value to write
813 * RETURNS: PCIBIOS_SUCCESSFUL - success
816 ****************************************************************************/
818 msp_pcibios_write_config(struct pci_bus
*bus
,
825 if (msp_pcibios_write_config_byte(bus
, devfn
,
826 where
, (u8
)(0xFF & val
))) {
829 } else if (size
== 2) {
830 if (msp_pcibios_write_config_word(bus
, devfn
,
831 where
, (u16
)(0xFFFF & val
))) {
834 } else if (size
== 4) {
835 if (msp_pcibios_write_config_dword(bus
, devfn
, where
, val
)) {
842 return PCIBIOS_SUCCESSFUL
;
845 /*****************************************************************************
847 * STRUCTURE: msp_pci_ops
848 * _________________________________________________________________________
850 * DESCRIPTION: structure to abstract the hardware specific PCI
851 * configuration accesses.
854 * read - function for Linux to generate PCI Configuration reads.
855 * write - function for Linux to generate PCI Configuration writes.
857 ****************************************************************************/
858 struct pci_ops msp_pci_ops
= {
859 .read
= msp_pcibios_read_config
,
860 .write
= msp_pcibios_write_config
863 /*****************************************************************************
865 * STRUCTURE: msp_pci_controller
866 * _________________________________________________________________________
868 * Describes the attributes of the MSP7120 PCI Host Controller
871 * pci_ops - abstracts the hardware specific PCI configuration
874 * mem_resource - address range pciauto() uses to assign to PCI device
877 * mem_offset - offset between how MSP7120 outbound PCI memory
878 * transaction addresses appear on the PCI bus and how Linux
879 * wants to configure memory BARs of the PCI devices.
880 * MSP7120 does nothing funky, so just set to zero.
882 * io_resource - address range pciauto() uses to assign to PCI device
885 * io_offset - offset between how MSP7120 outbound PCI I/O
886 * transaction addresses appear on the PCI bus and how
887 * Linux defaults to configure I/O BARs of the PCI devices.
888 * MSP7120 maps outbound I/O accesses into the bottom
889 * bottom 4K of PCI address space (and ignores OATRAN).
890 * Since the Linux default is to configure I/O BARs to the
891 * bottom 4K, no special offset is needed. Just set to zero.
893 ****************************************************************************/
894 static struct pci_controller msp_pci_controller
= {
895 .pci_ops
= &msp_pci_ops
,
896 .mem_resource
= &pci_mem_resource
,
898 .io_map_base
= MSP_PCI_IOSPACE_BASE
,
899 .io_resource
= &pci_io_resource
,
903 /*****************************************************************************
905 * FUNCTION: msp_pci_init
906 * _________________________________________________________________________
908 * DESCRIPTION: Initialize the PCI Host Controller and register it with
909 * Linux so Linux can seize control of the PCI bus.
911 ****************************************************************************/
912 void __init
msp_pci_init(void)
914 struct msp_pci_regs
*preg
= (void *)PCI_BASE_REG
;
917 /* Extract Device ID */
918 id
= read_reg32(PCI_JTAG_DEVID_REG
, 0xFFFF) >> 12;
920 /* Check if JTAG ID identifies MSP7120 */
921 if (!MSP_HAS_PCI(id
)) {
922 printk(KERN_WARNING
"PCI: No PCI; id reads as %x\n", id
);
927 * Enable flushing of the PCI-SDRAM queue upon a read
928 * of the SDRAM's Memory Configuration Register.
930 *(unsigned long *)QFLUSH_REG_1
= 3;
932 /* Configure PCI Host Controller. */
933 preg
->if_status
= ~0; /* Clear cause register bits */
934 preg
->config_addr
= 0; /* Clear config access */
935 preg
->oatran
= MSP_PCI_OATRAN
; /* PCI outbound addr translation */
936 preg
->if_mask
= 0xF8BF87C0; /* Enable all PCI status interrupts */
938 /* configure so inb(), outb(), and family are functional */
939 set_io_port_base(MSP_PCI_IOSPACE_BASE
);
941 /* Tell Linux the details of the MSP7120 PCI Host Controller */
942 register_pci_controller(&msp_pci_controller
);
947 /* Disable PCI channel */
948 printk(KERN_WARNING
"PCI: no host PCI bus detected\n");