init.c 1.7 KB

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