init.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * arch/mips/vr41xx/nec-cmbvr4133/init.c
  3. *
  4. * PROM library initialisation code for NEC CMB-VR4133 board.
  5. *
  6. * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> and
  7. * Jun Sun <jsun@mvista.com, or source@mvista.com> and
  8. * Alex Sapkov <asapkov@ru.mvista.com>
  9. *
  10. * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
  11. * the terms of the GNU General Public License version 2. This program
  12. * is licensed "as is" without any warranty of any kind, whether express
  13. * or implied.
  14. *
  15. * Support for NEC-CMBVR4133 in 2.6
  16. * Manish Lachwani (mlachwani@mvista.com)
  17. */
  18. #ifdef CONFIG_ROCKHOPPER
  19. #include <asm/io.h>
  20. #include <linux/pci.h>
  21. #define PCICONFDREG 0xaf000c14
  22. #define PCICONFAREG 0xaf000c18
  23. void disable_pcnet(void)
  24. {
  25. u32 data;
  26. /*
  27. * Workaround for the bug in PMON on VR4133. PMON leaves
  28. * AMD PCNet controller (on Rockhopper) initialized and running in
  29. * bus master mode. We have do disable it before doing any
  30. * further initialization. Or we get problems with PCI bus 2
  31. * and random lockups and crashes.
  32. */
  33. writel((2 << 16) |
  34. (PCI_DEVFN(1,0) << 8) |
  35. (0 & 0xfc) |
  36. 1UL,
  37. PCICONFAREG);
  38. data = readl(PCICONFDREG);
  39. writel((2 << 16) |
  40. (PCI_DEVFN(1,0) << 8) |
  41. (4 & 0xfc) |
  42. 1UL,
  43. PCICONFAREG);
  44. data = readl(PCICONFDREG);
  45. writel((2 << 16) |
  46. (PCI_DEVFN(1,0) << 8) |
  47. (4 & 0xfc) |
  48. 1UL,
  49. PCICONFAREG);
  50. data &= ~4;
  51. writel(data, PCICONFDREG);
  52. }
  53. #endif