init.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #include <linux/config.h>
  19. #ifdef CONFIG_ROCKHOPPER
  20. #include <asm/io.h>
  21. #include <linux/pci.h>
  22. #define PCICONFDREG 0xaf000c14
  23. #define PCICONFAREG 0xaf000c18
  24. void disable_pcnet(void)
  25. {
  26. u32 data;
  27. /*
  28. * Workaround for the bug in PMON on VR4133. PMON leaves
  29. * AMD PCNet controller (on Rockhopper) initialized and running in
  30. * bus master mode. We have do disable it before doing any
  31. * further initialization. Or we get problems with PCI bus 2
  32. * and random lockups and crashes.
  33. */
  34. writel((2 << 16) |
  35. (PCI_DEVFN(1,0) << 8) |
  36. (0 & 0xfc) |
  37. 1UL,
  38. PCICONFAREG);
  39. data = readl(PCICONFDREG);
  40. writel((2 << 16) |
  41. (PCI_DEVFN(1,0) << 8) |
  42. (4 & 0xfc) |
  43. 1UL,
  44. PCICONFAREG);
  45. data = readl(PCICONFDREG);
  46. writel((2 << 16) |
  47. (PCI_DEVFN(1,0) << 8) |
  48. (4 & 0xfc) |
  49. 1UL,
  50. PCICONFAREG);
  51. data &= ~4;
  52. writel(data, PCICONFDREG);
  53. }
  54. #endif