m68VZ328.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /***************************************************************************/
  2. /*
  3. * m68VZ328.c - 68VZ328 specific config
  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/init.h>
  15. #include <linux/types.h>
  16. #include <linux/kernel.h>
  17. #include <linux/kd.h>
  18. #include <linux/netdevice.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/irq.h>
  21. #include <linux/rtc.h>
  22. #include <asm/pgtable.h>
  23. #include <asm/machdep.h>
  24. #include <asm/MC68VZ328.h>
  25. #include <asm/bootstd.h>
  26. #ifdef CONFIG_INIT_LCD
  27. #include "bootlogo-vz.h"
  28. #endif
  29. /***************************************************************************/
  30. int m68328_hwclk(int set, struct rtc_time *t);
  31. /***************************************************************************/
  32. /* Init Drangon Engine hardware */
  33. /***************************************************************************/
  34. #if defined(CONFIG_DRAGEN2)
  35. static void m68vz328_reset(void)
  36. {
  37. local_irq_disable();
  38. #ifdef CONFIG_INIT_LCD
  39. PBDATA |= 0x20; /* disable CCFL light */
  40. PKDATA |= 0x4; /* disable LCD controller */
  41. LCKCON = 0;
  42. #endif
  43. __asm__ __volatile__(
  44. "reset\n\t"
  45. "moveal #0x04000000, %a0\n\t"
  46. "moveal 0(%a0), %sp\n\t"
  47. "moveal 4(%a0), %a0\n\t"
  48. "jmp (%a0)"
  49. );
  50. }
  51. static void __init init_hardware(char *command, int size)
  52. {
  53. #ifdef CONFIG_DIRECT_IO_ACCESS
  54. SCR = 0x10; /* allow user access to internal registers */
  55. #endif
  56. /* CSGB Init */
  57. CSGBB = 0x4000;
  58. CSB = 0x1a1;
  59. /* CS8900 init */
  60. /* PK3: hardware sleep function pin, active low */
  61. PKSEL |= PK(3); /* select pin as I/O */
  62. PKDIR |= PK(3); /* select pin as output */
  63. PKDATA |= PK(3); /* set pin high */
  64. /* PF5: hardware reset function pin, active high */
  65. PFSEL |= PF(5); /* select pin as I/O */
  66. PFDIR |= PF(5); /* select pin as output */
  67. PFDATA &= ~PF(5); /* set pin low */
  68. /* cs8900 hardware reset */
  69. PFDATA |= PF(5);
  70. { int i; for (i = 0; i < 32000; ++i); }
  71. PFDATA &= ~PF(5);
  72. /* INT1 enable (cs8900 IRQ) */
  73. PDPOL &= ~PD(1); /* active high signal */
  74. PDIQEG &= ~PD(1);
  75. PDIRQEN |= PD(1); /* IRQ enabled */
  76. #ifdef CONFIG_INIT_LCD
  77. /* initialize LCD controller */
  78. LSSA = (long) screen_bits;
  79. LVPW = 0x14;
  80. LXMAX = 0x140;
  81. LYMAX = 0xef;
  82. LRRA = 0;
  83. LPXCD = 3;
  84. LPICF = 0x08;
  85. LPOLCF = 0;
  86. LCKCON = 0x80;
  87. PCPDEN = 0xff;
  88. PCSEL = 0;
  89. /* Enable LCD controller */
  90. PKDIR |= 0x4;
  91. PKSEL |= 0x4;
  92. PKDATA &= ~0x4;
  93. /* Enable CCFL backlighting circuit */
  94. PBDIR |= 0x20;
  95. PBSEL |= 0x20;
  96. PBDATA &= ~0x20;
  97. /* contrast control register */
  98. PFDIR |= 0x1;
  99. PFSEL &= ~0x1;
  100. PWMR = 0x037F;
  101. #endif
  102. }
  103. /***************************************************************************/
  104. /* Init RT-Control uCdimm hardware */
  105. /***************************************************************************/
  106. #elif defined(CONFIG_UCDIMM)
  107. static void m68vz328_reset(void)
  108. {
  109. local_irq_disable();
  110. asm volatile (
  111. "moveal #0x10c00000, %a0;\n\t"
  112. "moveb #0, 0xFFFFF300;\n\t"
  113. "moveal 0(%a0), %sp;\n\t"
  114. "moveal 4(%a0), %a0;\n\t"
  115. "jmp (%a0);\n"
  116. );
  117. }
  118. unsigned char *cs8900a_hwaddr;
  119. static int errno;
  120. _bsc0(char *, getserialnum)
  121. _bsc1(unsigned char *, gethwaddr, int, a)
  122. _bsc1(char *, getbenv, char *, a)
  123. static void __init init_hardware(char *command, int size)
  124. {
  125. char *p;
  126. printk(KERN_INFO "uCdimm serial string [%s]\n", getserialnum());
  127. p = cs8900a_hwaddr = gethwaddr(0);
  128. printk(KERN_INFO "uCdimm hwaddr %pM\n", p);
  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 init_hardware(char *command, int size)
  141. {
  142. }
  143. /***************************************************************************/
  144. #endif
  145. /***************************************************************************/
  146. void __init 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_sched_init = hw_timer_init;
  151. mach_hwclk = m68328_hwclk;
  152. mach_reset = m68vz328_reset;
  153. }
  154. /***************************************************************************/