132be2accSGreg Ungerer /****************************************************************************/ 232be2accSGreg Ungerer 332be2accSGreg Ungerer /* 432be2accSGreg Ungerer * m54xxpci.h -- ColdFire 547x and 548x PCI bus support 532be2accSGreg Ungerer * 632be2accSGreg Ungerer * (C) Copyright 2011, Greg Ungerer <gerg@uclinux.org> 732be2accSGreg Ungerer * 832be2accSGreg Ungerer * This file is subject to the terms and conditions of the GNU General Public 932be2accSGreg Ungerer * License. See the file COPYING in the main directory of this archive 1032be2accSGreg Ungerer * for more details. 1132be2accSGreg Ungerer */ 1232be2accSGreg Ungerer 1332be2accSGreg Ungerer /****************************************************************************/ 1432be2accSGreg Ungerer #ifndef M54XXPCI_H 1532be2accSGreg Ungerer #define M54XXPCI_H 1632be2accSGreg Ungerer /****************************************************************************/ 1732be2accSGreg Ungerer 1832be2accSGreg Ungerer /* 1932be2accSGreg Ungerer * The core set of PCI support registers are mapped into the MBAR region. 2032be2accSGreg Ungerer */ 2132be2accSGreg Ungerer #define PCIIDR (CONFIG_MBAR + 0xb00) /* PCI device/vendor ID */ 2232be2accSGreg Ungerer #define PCISCR (CONFIG_MBAR + 0xb04) /* PCI status/command */ 2332be2accSGreg Ungerer #define PCICCRIR (CONFIG_MBAR + 0xb08) /* PCI class/revision */ 2432be2accSGreg Ungerer #define PCICR1 (CONFIG_MBAR + 0xb0c) /* PCI configuration 1 */ 2532be2accSGreg Ungerer #define PCIBAR0 (CONFIG_MBAR + 0xb10) /* PCI base address 0 */ 2632be2accSGreg Ungerer #define PCIBAR1 (CONFIG_MBAR + 0xb14) /* PCI base address 1 */ 2732be2accSGreg Ungerer #define PCICCPR (CONFIG_MBAR + 0xb28) /* PCI cardbus CIS pointer */ 2832be2accSGreg Ungerer #define PCISID (CONFIG_MBAR + 0xb2c) /* PCI subsystem IDs */ 2932be2accSGreg Ungerer #define PCIERBAR (CONFIG_MBAR + 0xb30) /* PCI expansion ROM */ 3032be2accSGreg Ungerer #define PCICPR (CONFIG_MBAR + 0xb34) /* PCI capabilities pointer */ 3132be2accSGreg Ungerer #define PCICR2 (CONFIG_MBAR + 0xb3c) /* PCI configuration 2 */ 3232be2accSGreg Ungerer 3332be2accSGreg Ungerer #define PCIGSCR (CONFIG_MBAR + 0xb60) /* Global status/control */ 3432be2accSGreg Ungerer #define PCITBATR0 (CONFIG_MBAR + 0xb64) /* Target base translation 0 */ 3532be2accSGreg Ungerer #define PCITBATR1 (CONFIG_MBAR + 0xb68) /* Target base translation 1 */ 3632be2accSGreg Ungerer #define PCITCR (CONFIG_MBAR + 0xb6c) /* Target control */ 3732be2accSGreg Ungerer #define PCIIW0BTAR (CONFIG_MBAR + 0xb70) /* Initiator window 0 */ 3832be2accSGreg Ungerer #define PCIIW1BTAR (CONFIG_MBAR + 0xb74) /* Initiator window 1 */ 3932be2accSGreg Ungerer #define PCIIW2BTAR (CONFIG_MBAR + 0xb78) /* Initiator window 2 */ 4032be2accSGreg Ungerer #define PCIIWCR (CONFIG_MBAR + 0xb80) /* Initiator window config */ 4132be2accSGreg Ungerer #define PCIICR (CONFIG_MBAR + 0xb84) /* Initiator control */ 4232be2accSGreg Ungerer #define PCIISR (CONFIG_MBAR + 0xb88) /* Initiator status */ 4332be2accSGreg Ungerer #define PCICAR (CONFIG_MBAR + 0xbf8) /* Configuration address */ 4432be2accSGreg Ungerer 4532be2accSGreg Ungerer #define PCITPSR (CONFIG_MBAR + 0x8400) /* TX packet size */ 4632be2accSGreg Ungerer #define PCITSAR (CONFIG_MBAR + 0x8404) /* TX start address */ 4732be2accSGreg Ungerer #define PCITTCR (CONFIG_MBAR + 0x8408) /* TX transaction control */ 4832be2accSGreg Ungerer #define PCITER (CONFIG_MBAR + 0x840c) /* TX enables */ 4932be2accSGreg Ungerer #define PCITNAR (CONFIG_MBAR + 0x8410) /* TX next address */ 5032be2accSGreg Ungerer #define PCITLWR (CONFIG_MBAR + 0x8414) /* TX last word */ 5132be2accSGreg Ungerer #define PCITDCR (CONFIG_MBAR + 0x8418) /* TX done counts */ 5232be2accSGreg Ungerer #define PCITSR (CONFIG_MBAR + 0x841c) /* TX status */ 5332be2accSGreg Ungerer #define PCITFDR (CONFIG_MBAR + 0x8440) /* TX FIFO data */ 5432be2accSGreg Ungerer #define PCITFSR (CONFIG_MBAR + 0x8444) /* TX FIFO status */ 5532be2accSGreg Ungerer #define PCITFCR (CONFIG_MBAR + 0x8448) /* TX FIFO control */ 5632be2accSGreg Ungerer #define PCITFAR (CONFIG_MBAR + 0x844c) /* TX FIFO alarm */ 5732be2accSGreg Ungerer #define PCITFRPR (CONFIG_MBAR + 0x8450) /* TX FIFO read pointer */ 5832be2accSGreg Ungerer #define PCITFWPR (CONFIG_MBAR + 0x8454) /* TX FIFO write pointer */ 5932be2accSGreg Ungerer 6032be2accSGreg Ungerer #define PCIRPSR (CONFIG_MBAR + 0x8480) /* RX packet size */ 6132be2accSGreg Ungerer #define PCIRSAR (CONFIG_MBAR + 0x8484) /* RX start address */ 6232be2accSGreg Ungerer #define PCIRTCR (CONFIG_MBAR + 0x8488) /* RX transaction control */ 6332be2accSGreg Ungerer #define PCIRER (CONFIG_MBAR + 0x848c) /* RX enables */ 6432be2accSGreg Ungerer #define PCIRNAR (CONFIG_MBAR + 0x8490) /* RX next address */ 6532be2accSGreg Ungerer #define PCIRDCR (CONFIG_MBAR + 0x8498) /* RX done counts */ 6632be2accSGreg Ungerer #define PCIRSR (CONFIG_MBAR + 0x849c) /* RX status */ 6732be2accSGreg Ungerer #define PCIRFDR (CONFIG_MBAR + 0x84c0) /* RX FIFO data */ 6832be2accSGreg Ungerer #define PCIRFSR (CONFIG_MBAR + 0x84c4) /* RX FIFO status */ 6932be2accSGreg Ungerer #define PCIRFCR (CONFIG_MBAR + 0x84c8) /* RX FIFO control */ 7032be2accSGreg Ungerer #define PCIRFAR (CONFIG_MBAR + 0x84cc) /* RX FIFO alarm */ 7132be2accSGreg Ungerer #define PCIRFRPR (CONFIG_MBAR + 0x84d0) /* RX FIFO read pointer */ 7232be2accSGreg Ungerer #define PCIRFWPR (CONFIG_MBAR + 0x84d4) /* RX FIFO write pointer */ 7332be2accSGreg Ungerer 7432be2accSGreg Ungerer #define PACR (CONFIG_MBAR + 0xc00) /* PCI arbiter control */ 75*e803d4bdSPaul Bolle #define PASR (CONFIG_MBAR + 0xc04) /* PCI arbiter status */ 7632be2accSGreg Ungerer 7732be2accSGreg Ungerer /* 7832be2accSGreg Ungerer * Definitions for the Global status and control register. 7932be2accSGreg Ungerer */ 8032be2accSGreg Ungerer #define PCIGSCR_PE 0x20000000 /* Parity error detected */ 8132be2accSGreg Ungerer #define PCIGSCR_SE 0x10000000 /* System error detected */ 8232be2accSGreg Ungerer #define PCIGSCR_XCLKBIN 0x07000000 /* XLB2CLKIN mask */ 8332be2accSGreg Ungerer #define PCIGSCR_PEE 0x00002000 /* Parity error intr enable */ 8432be2accSGreg Ungerer #define PCIGSCR_SEE 0x00001000 /* System error intr enable */ 8532be2accSGreg Ungerer #define PCIGSCR_RESET 0x00000001 /* Reset bit */ 8632be2accSGreg Ungerer 8732be2accSGreg Ungerer /* 8832be2accSGreg Ungerer * Bit definitions for the PCICAR configuration address register. 8932be2accSGreg Ungerer */ 9032be2accSGreg Ungerer #define PCICAR_E 0x80000000 /* Enable config space */ 9132be2accSGreg Ungerer #define PCICAR_BUSN 16 /* Move bus bits */ 9232be2accSGreg Ungerer #define PCICAR_DEVFNN 8 /* Move devfn bits */ 9332be2accSGreg Ungerer #define PCICAR_DWORDN 0 /* Move dword bits */ 9432be2accSGreg Ungerer 9532be2accSGreg Ungerer /* 9632be2accSGreg Ungerer * The initiator windows hold the memory and IO mapping information. 9732be2accSGreg Ungerer * This macro creates the register values from the desired addresses. 9832be2accSGreg Ungerer */ 9932be2accSGreg Ungerer #define WXBTAR(hostaddr, pciaddr, size) \ 10032be2accSGreg Ungerer (((hostaddr) & 0xff000000) | \ 10132be2accSGreg Ungerer ((((size) - 1) & 0xff000000) >> 8) | \ 10232be2accSGreg Ungerer (((pciaddr) & 0xff000000) >> 16)) 10332be2accSGreg Ungerer 10432be2accSGreg Ungerer #define PCIIWCR_W0_MEM 0x00000000 /* Window 0 is memory */ 10532be2accSGreg Ungerer #define PCIIWCR_W0_IO 0x08000000 /* Window 0 is IO */ 10632be2accSGreg Ungerer #define PCIIWCR_W0_MRD 0x00000000 /* Window 0 memory read */ 10732be2accSGreg Ungerer #define PCIIWCR_W0_MRDL 0x02000000 /* Window 0 memory read line */ 10832be2accSGreg Ungerer #define PCIIWCR_W0_MRDM 0x04000000 /* Window 0 memory read mult */ 10932be2accSGreg Ungerer #define PCIIWCR_W0_E 0x01000000 /* Window 0 enable */ 11032be2accSGreg Ungerer 11132be2accSGreg Ungerer #define PCIIWCR_W1_MEM 0x00000000 /* Window 0 is memory */ 11232be2accSGreg Ungerer #define PCIIWCR_W1_IO 0x00080000 /* Window 0 is IO */ 11332be2accSGreg Ungerer #define PCIIWCR_W1_MRD 0x00000000 /* Window 0 memory read */ 11432be2accSGreg Ungerer #define PCIIWCR_W1_MRDL 0x00020000 /* Window 0 memory read line */ 11532be2accSGreg Ungerer #define PCIIWCR_W1_MRDM 0x00040000 /* Window 0 memory read mult */ 11632be2accSGreg Ungerer #define PCIIWCR_W1_E 0x00010000 /* Window 0 enable */ 11732be2accSGreg Ungerer 11832be2accSGreg Ungerer /* 11932be2accSGreg Ungerer * Bit definitions for the PCIBATR registers. 12032be2accSGreg Ungerer */ 12132be2accSGreg Ungerer #define PCITBATR0_E 0x00000001 /* Enable window 0 */ 12232be2accSGreg Ungerer #define PCITBATR1_E 0x00000001 /* Enable window 1 */ 12332be2accSGreg Ungerer 12432be2accSGreg Ungerer /* 12532be2accSGreg Ungerer * PCI arbiter support definitions and macros. 12632be2accSGreg Ungerer */ 12732be2accSGreg Ungerer #define PACR_INTMPRI 0x00000001 12832be2accSGreg Ungerer #define PACR_EXTMPRI(x) (((x) & 0x1f) << 1) 12932be2accSGreg Ungerer #define PACR_INTMINTE 0x00010000 13032be2accSGreg Ungerer #define PACR_EXTMINTE(x) (((x) & 0x1f) << 17) 13132be2accSGreg Ungerer #define PACR_PKMD 0x40000000 13232be2accSGreg Ungerer #define PACR_DS 0x80000000 13332be2accSGreg Ungerer 13432be2accSGreg Ungerer #define PCICR1_CL(x) ((x) & 0xf) /* Cacheline size field */ 13532be2accSGreg Ungerer #define PCICR1_LT(x) (((x) & 0xff) << 8) /* Latency timer field */ 13632be2accSGreg Ungerer 13732be2accSGreg Ungerer /****************************************************************************/ 13832be2accSGreg Ungerer #endif /* M54XXPCI_H */ 139