18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * EDAC defs for Marvell MV64x60 bridge chip 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Author: Dave Jiang <djiang@mvista.com> 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * 2007 (c) MontaVista Software, Inc. This file is licensed under 78c2ecf20Sopenharmony_ci * the terms of the GNU General Public License version 2. This program 88c2ecf20Sopenharmony_ci * is licensed "as is" without any warranty of any kind, whether express 98c2ecf20Sopenharmony_ci * or implied. 108c2ecf20Sopenharmony_ci * 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci#ifndef _MV64X60_EDAC_H_ 138c2ecf20Sopenharmony_ci#define _MV64X60_EDAC_H_ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#define MV64x60_REVISION " Ver: 2.0.0" 168c2ecf20Sopenharmony_ci#define EDAC_MOD_STR "MV64x60_edac" 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci#define mv64x60_printk(level, fmt, arg...) \ 198c2ecf20Sopenharmony_ci edac_printk(level, "MV64x60", fmt, ##arg) 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define mv64x60_mc_printk(mci, level, fmt, arg...) \ 228c2ecf20Sopenharmony_ci edac_mc_chipset_printk(mci, level, "MV64x60", fmt, ##arg) 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci/* CPU Error Report Registers */ 258c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_ADDR_LO 0x00 /* 0x0070 */ 268c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_ADDR_HI 0x08 /* 0x0078 */ 278c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_DATA_LO 0x00 /* 0x0128 */ 288c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_DATA_HI 0x08 /* 0x0130 */ 298c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_PARITY 0x10 /* 0x0138 */ 308c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_CAUSE 0x18 /* 0x0140 */ 318c2ecf20Sopenharmony_ci#define MV64x60_CPU_ERR_MASK 0x20 /* 0x0148 */ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define MV64x60_CPU_CAUSE_MASK 0x07ffffff 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* SRAM Error Report Registers */ 368c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_CAUSE 0x08 /* 0x0388 */ 378c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_ADDR_LO 0x10 /* 0x0390 */ 388c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_ADDR_HI 0x78 /* 0x03f8 */ 398c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_DATA_LO 0x18 /* 0x0398 */ 408c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_DATA_HI 0x20 /* 0x03a0 */ 418c2ecf20Sopenharmony_ci#define MV64X60_SRAM_ERR_PARITY 0x28 /* 0x03a8 */ 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci/* SDRAM Controller Registers */ 448c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_CONFIG 0x00 /* 0x1400 */ 458c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_DATA_HI 0x40 /* 0x1440 */ 468c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_DATA_LO 0x44 /* 0x1444 */ 478c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_ECC_RCVD 0x48 /* 0x1448 */ 488c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_ECC_CALC 0x4c /* 0x144c */ 498c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_ADDR 0x50 /* 0x1450 */ 508c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_ECC_CNTL 0x54 /* 0x1454 */ 518c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ERR_ECC_ERR_CNT 0x58 /* 0x1458 */ 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_REGISTERED 0x20000 548c2ecf20Sopenharmony_ci#define MV64X60_SDRAM_ECC 0x40000 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#ifdef CONFIG_PCI 578c2ecf20Sopenharmony_ci/* 588c2ecf20Sopenharmony_ci * Bit 0 of MV64x60_PCIx_ERR_MASK does not exist on the 64360 and because of 598c2ecf20Sopenharmony_ci * errata FEr-#11 and FEr-##16 for the 64460, it should be 0 on that chip as 608c2ecf20Sopenharmony_ci * well. IOW, don't set bit 0. 618c2ecf20Sopenharmony_ci */ 628c2ecf20Sopenharmony_ci#define MV64X60_PCIx_ERR_MASK_VAL 0x00a50c24 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci/* Register offsets from PCIx error address low register */ 658c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_ADDR_LO 0x00 668c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_ADDR_HI 0x04 678c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_ATTR 0x08 688c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_CMD 0x10 698c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_CAUSE 0x18 708c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERROR_MASK 0x1c 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERR_SWrPerr 0x0002 738c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERR_SRdPerr 0x0004 748c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERR_MWrPerr 0x0020 758c2ecf20Sopenharmony_ci#define MV64X60_PCI_ERR_MRdPerr 0x0040 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define MV64X60_PCI_PE_MASK (MV64X60_PCI_ERR_SWrPerr | \ 788c2ecf20Sopenharmony_ci MV64X60_PCI_ERR_SRdPerr | \ 798c2ecf20Sopenharmony_ci MV64X60_PCI_ERR_MWrPerr | \ 808c2ecf20Sopenharmony_ci MV64X60_PCI_ERR_MRdPerr) 818c2ecf20Sopenharmony_ci 828c2ecf20Sopenharmony_cistruct mv64x60_pci_pdata { 838c2ecf20Sopenharmony_ci int pci_hose; 848c2ecf20Sopenharmony_ci void __iomem *pci_vbase; 858c2ecf20Sopenharmony_ci char *name; 868c2ecf20Sopenharmony_ci int irq; 878c2ecf20Sopenharmony_ci int edac_idx; 888c2ecf20Sopenharmony_ci}; 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci#endif /* CONFIG_PCI */ 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_cistruct mv64x60_mc_pdata { 938c2ecf20Sopenharmony_ci void __iomem *mc_vbase; 948c2ecf20Sopenharmony_ci int total_mem; 958c2ecf20Sopenharmony_ci char *name; 968c2ecf20Sopenharmony_ci int irq; 978c2ecf20Sopenharmony_ci int edac_idx; 988c2ecf20Sopenharmony_ci}; 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_cistruct mv64x60_cpu_pdata { 1018c2ecf20Sopenharmony_ci void __iomem *cpu_vbase[2]; 1028c2ecf20Sopenharmony_ci char *name; 1038c2ecf20Sopenharmony_ci int irq; 1048c2ecf20Sopenharmony_ci int edac_idx; 1058c2ecf20Sopenharmony_ci}; 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_cistruct mv64x60_sram_pdata { 1088c2ecf20Sopenharmony_ci void __iomem *sram_vbase; 1098c2ecf20Sopenharmony_ci char *name; 1108c2ecf20Sopenharmony_ci int irq; 1118c2ecf20Sopenharmony_ci int edac_idx; 1128c2ecf20Sopenharmony_ci}; 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#endif 115