11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * arch/sh/drivers/pci/fixups-rts7751r2d.c 31da177e4SLinus Torvalds * 41da177e4SLinus Torvalds * RTS7751R2D PCI fixups 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds * Copyright (C) 2003 Lineo uSolutions, Inc. 71da177e4SLinus Torvalds * Copyright (C) 2004 Paul Mundt 81da177e4SLinus Torvalds * 91da177e4SLinus Torvalds * This file is subject to the terms and conditions of the GNU General Public 101da177e4SLinus Torvalds * License. See the file "COPYING" in the main directory of this archive 111da177e4SLinus Torvalds * for more details. 121da177e4SLinus Torvalds */ 13959f85f8SPaul Mundt #include "pci-sh4.h" 141da177e4SLinus Torvalds 151da177e4SLinus Torvalds #define PCIMCR_MRSET_OFF 0xBFFFFFFF 161da177e4SLinus Torvalds #define PCIMCR_RFSH_OFF 0xFFFFFFFB 171da177e4SLinus Torvalds 181da177e4SLinus Torvalds int pci_fixup_pcic(void) 191da177e4SLinus Torvalds { 201da177e4SLinus Torvalds unsigned long bcr1, mcr; 211da177e4SLinus Torvalds 22*e036eaa6SMagnus Damm bcr1 = ctrl_inl(SH7751_BCR1); 231da177e4SLinus Torvalds bcr1 |= 0x40080000; /* Enable Bit 19 BREQEN, set PCIC to slave */ 24959f85f8SPaul Mundt pci_write_reg(bcr1, SH4_PCIBCR1); 251da177e4SLinus Torvalds 261da177e4SLinus Torvalds /* Enable all interrupts, so we known what to fix */ 27959f85f8SPaul Mundt pci_write_reg(0x0000c3ff, SH4_PCIINTM); 28959f85f8SPaul Mundt pci_write_reg(0x0000380f, SH4_PCIAINTM); 291da177e4SLinus Torvalds 30959f85f8SPaul Mundt pci_write_reg(0xfb900047, SH7751_PCICONF1); 31959f85f8SPaul Mundt pci_write_reg(0xab000001, SH7751_PCICONF4); 321da177e4SLinus Torvalds 33*e036eaa6SMagnus Damm mcr = ctrl_inl(SH7751_MCR); 341da177e4SLinus Torvalds mcr = (mcr & PCIMCR_MRSET_OFF) & PCIMCR_RFSH_OFF; 35959f85f8SPaul Mundt pci_write_reg(mcr, SH4_PCIMCR); 361da177e4SLinus Torvalds 37959f85f8SPaul Mundt pci_write_reg(0x0c000000, SH7751_PCICONF5); 38959f85f8SPaul Mundt pci_write_reg(0xd0000000, SH7751_PCICONF6); 39959f85f8SPaul Mundt pci_write_reg(0x0c000000, SH4_PCILAR0); 40959f85f8SPaul Mundt pci_write_reg(0x00000000, SH4_PCILAR1); 41959f85f8SPaul Mundt 421da177e4SLinus Torvalds return 0; 431da177e4SLinus Torvalds } 44