config.c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /***************************************************************************/
  2. /*
  3. * linux/arch/m68knommu/platform/68VZ328/config.c
  4. *
  5. * Copyright (C) 1993 Hamish Macdonald
  6. * Copyright (C) 1999 D. Jeff Dionne
  7. * Copyright (C) 2001 Georges Menie, Ken Desmet
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file COPYING in the main directory of this archive
  11. * for more details.
  12. */
  13. /***************************************************************************/
  14. #include <linux/types.h>
  15. #include <linux/kernel.h>
  16. #include <linux/kd.h>
  17. #include <linux/netdevice.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/irq.h>
  20. #include <asm/system.h>
  21. #include <asm/pgtable.h>
  22. #include <asm/machdep.h>
  23. #include <asm/MC68VZ328.h>
  24. #include <asm/bootstd.h>
  25. #ifdef CONFIG_INIT_LCD
  26. #include "bootlogo.h"
  27. #endif
  28. /***************************************************************************/
  29. void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec);
  30. /***************************************************************************/
  31. /* Init Drangon Engine hardware */
  32. /***************************************************************************/
  33. #if defined(CONFIG_DRAGEN2)
  34. static void m68vz328_reset(void)
  35. {
  36. local_irq_disable();
  37. #ifdef CONFIG_INIT_LCD
  38. PBDATA |= 0x20; /* disable CCFL light */
  39. PKDATA |= 0x4; /* disable LCD controller */
  40. LCKCON = 0;
  41. #endif
  42. __asm__ __volatile__(
  43. "reset\n\t"
  44. "moveal #0x04000000, %a0\n\t"
  45. "moveal 0(%a0), %sp\n\t"
  46. "moveal 4(%a0), %a0\n\t"
  47. "jmp (%a0)"
  48. );
  49. }
  50. static void init_hardware(char *command, int size)
  51. {
  52. #ifdef CONFIG_DIRECT_IO_ACCESS
  53. SCR = 0x10; /* allow user access to internal registers */
  54. #endif
  55. /* CSGB Init */
  56. CSGBB = 0x4000;
  57. CSB = 0x1a1;
  58. /* CS8900 init */
  59. /* PK3: hardware sleep function pin, active low */
  60. PKSEL |= PK(3); /* select pin as I/O */
  61. PKDIR |= PK(3); /* select pin as output */
  62. PKDATA |= PK(3); /* set pin high */
  63. /* PF5: hardware reset function pin, active high */
  64. PFSEL |= PF(5); /* select pin as I/O */
  65. PFDIR |= PF(5); /* select pin as output */
  66. PFDATA &= ~PF(5); /* set pin low */
  67. /* cs8900 hardware reset */
  68. PFDATA |= PF(5);
  69. { int i; for (i = 0; i < 32000; ++i); }
  70. PFDATA &= ~PF(5);
  71. /* INT1 enable (cs8900 IRQ) */
  72. PDPOL &= ~PD(1); /* active high signal */
  73. PDIQEG &= ~PD(1);
  74. PDIRQEN |= PD(1); /* IRQ enabled */
  75. #ifdef CONFIG_INIT_LCD
  76. /* initialize LCD controller */
  77. LSSA = (long) screen_bits;
  78. LVPW = 0x14;
  79. LXMAX = 0x140;
  80. LYMAX = 0xef;
  81. LRRA = 0;
  82. LPXCD = 3;
  83. LPICF = 0x08;
  84. LPOLCF = 0;
  85. LCKCON = 0x80;
  86. PCPDEN = 0xff;
  87. PCSEL = 0;
  88. /* Enable LCD controller */
  89. PKDIR |= 0x4;
  90. PKSEL |= 0x4;
  91. PKDATA &= ~0x4;
  92. /* Enable CCFL backlighting circuit */
  93. PBDIR |= 0x20;
  94. PBSEL |= 0x20;
  95. PBDATA &= ~0x20;
  96. /* contrast control register */
  97. PFDIR |= 0x1;
  98. PFSEL &= ~0x1;
  99. PWMR = 0x037F;
  100. #endif
  101. }
  102. /***************************************************************************/
  103. /* Init RT-Control uCdimm hardware */
  104. /***************************************************************************/
  105. #elif defined(CONFIG_UCDIMM)
  106. static void m68vz328_reset(void)
  107. {
  108. local_irq_disable();
  109. asm volatile (
  110. "moveal #0x10c00000, %a0;\n\t"
  111. "moveb #0, 0xFFFFF300;\n\t"
  112. "moveal 0(%a0), %sp;\n\t"
  113. "moveal 4(%a0), %a0;\n\t"
  114. "jmp (%a0);\n"
  115. );
  116. }
  117. unsigned char *cs8900a_hwaddr;
  118. static int errno;
  119. _bsc0(char *, getserialnum)
  120. _bsc1(unsigned char *, gethwaddr, int, a)
  121. _bsc1(char *, getbenv, char *, a)
  122. static void init_hardware(char *command, int size)
  123. {
  124. char *p;
  125. printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
  126. p = cs8900a_hwaddr = gethwaddr(0);
  127. printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
  128. p[0], p[1], p[2], p[3], p[4], p[5]);
  129. p = getbenv("APPEND");
  130. if (p)
  131. strcpy(p, command);
  132. else
  133. command[0] = 0;
  134. }
  135. /***************************************************************************/
  136. #else
  137. static void m68vz328_reset(void)
  138. {
  139. }
  140. static void init_hardware(char *command, int size)
  141. {
  142. }
  143. /***************************************************************************/
  144. #endif
  145. /***************************************************************************/
  146. void config_BSP(char *command, int size)
  147. {
  148. printk(KERN_INFO "68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
  149. init_hardware(command, size);
  150. mach_gettod = m68328_timer_gettod;
  151. mach_reset = m68vz328_reset;
  152. }
  153. /***************************************************************************/