fixups-se7780.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * arch/sh/drivers/pci/fixups-se7780.c
  3. *
  4. * HITACHI UL Solution Engine 7780 PCI fixups
  5. *
  6. * Copyright (C) 2003 Lineo uSolutions, Inc.
  7. * Copyright (C) 2004 - 2006 Paul Mundt
  8. * Copyright (C) 2006 Nobuhiro Iwamatsu
  9. *
  10. * This file is subject to the terms and conditions of the GNU General Public
  11. * License. See the file "COPYING" in the main directory of this archive
  12. * for more details.
  13. */
  14. #include <linux/pci.h>
  15. #include "pci-sh4.h"
  16. #include <asm/io.h>
  17. int pci_fixup_pcic(void)
  18. {
  19. ctrl_outl(0x00000001, SH7780_PCI_VCR2);
  20. /* Enable all interrupts, so we know what to fix */
  21. pci_write_reg(0x0000C3FF, SH7780_PCIIMR);
  22. pci_write_reg(0x0000380F, SH7780_PCIAINTM);
  23. /* Set up standard PCI config registers */
  24. ctrl_outw(0xFB00, PCI_REG(SH7780_PCISTATUS));
  25. ctrl_outw(0x0047, PCI_REG(SH7780_PCICMD));
  26. ctrl_outb( 0x00, PCI_REG(SH7780_PCIPIF));
  27. ctrl_outb( 0x00, PCI_REG(SH7780_PCISUB));
  28. ctrl_outb( 0x06, PCI_REG(SH7780_PCIBCC));
  29. ctrl_outw(0x1912, PCI_REG(SH7780_PCISVID));
  30. ctrl_outw(0x0001, PCI_REG(SH7780_PCISID));
  31. pci_write_reg(0x08000000, SH7780_PCIMBAR0); /* PCI */
  32. pci_write_reg(0x08000000, SH7780_PCILAR0); /* SHwy */
  33. pci_write_reg(0x07F00001, SH7780_PCILSR); /* size 128M w/ MBAR */
  34. pci_write_reg(0x00000000, SH7780_PCIMBAR1);
  35. pci_write_reg(0x00000000, SH7780_PCILAR1);
  36. pci_write_reg(0x00000000, SH7780_PCILSR1);
  37. pci_write_reg(0xAB000801, SH7780_PCIIBAR);
  38. /*
  39. * Set the MBR so PCI address is one-to-one with window,
  40. * meaning all calls go straight through... use ifdef to
  41. * catch erroneous assumption.
  42. */
  43. pci_write_reg(0xFD000000 , SH7780_PCIMBR0);
  44. pci_write_reg(0x00FC0000 , SH7780_PCIMBMR0); /* 16M */
  45. /* Set IOBR for window containing area specified in pci.h */
  46. pci_write_reg(PCIBIOS_MIN_IO & ~(SH7780_PCI_IO_SIZE-1), SH7780_PCIIOBR);
  47. pci_write_reg((SH7780_PCI_IO_SIZE-1) & (7 << 18), SH7780_PCIIOBMR);
  48. pci_write_reg(0xA5000C01, SH7780_PCICR);
  49. return 0;
  50. }