config.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * linux/arch/m68knommu/platform/68VZ328/ucdimm/config.c
  3. *
  4. * Copyright (C) 1993 Hamish Macdonald
  5. * Copyright (C) 1999 D. Jeff Dionne
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file COPYING in the main directory of this archive
  9. * for more details.
  10. */
  11. #include <stdarg.h>
  12. #include <linux/config.h>
  13. #include <linux/types.h>
  14. #include <linux/kernel.h>
  15. #include <linux/mm.h>
  16. #include <linux/tty.h>
  17. #include <linux/console.h>
  18. #include <asm/setup.h>
  19. #include <asm/system.h>
  20. #include <asm/pgtable.h>
  21. #include <asm/irq.h>
  22. #include <asm/machdep.h>
  23. #include <asm/MC68VZ328.h>
  24. #include <asm/bootstd.h>
  25. void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
  26. {
  27. /* Restart mode, Enable int, 32KHz, Enable timer */
  28. TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
  29. /* Set prescaler (Divide 32KHz by 32)*/
  30. TPRER = 31;
  31. /* Set compare register 32Khz / 32 / 10 = 100 */
  32. TCMP = 10;
  33. request_irq(TMR_IRQ_NUM, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
  34. }
  35. void BSP_tick(void)
  36. {
  37. /* Reset Timer1 */
  38. TSTAT &= 0;
  39. }
  40. unsigned long BSP_gettimeoffset (void)
  41. {
  42. return 0;
  43. }
  44. void BSP_gettod (int *yearp, int *monp, int *dayp,
  45. int *hourp, int *minp, int *secp)
  46. {
  47. }
  48. int BSP_hwclk(int op, struct hwclk_time *t)
  49. {
  50. if (!op) {
  51. /* read */
  52. } else {
  53. /* write */
  54. }
  55. return 0;
  56. }
  57. int BSP_set_clock_mmss (unsigned long nowtime)
  58. {
  59. #if 0
  60. short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
  61. tod->second1 = real_seconds / 10;
  62. tod->second2 = real_seconds % 10;
  63. tod->minute1 = real_minutes / 10;
  64. tod->minute2 = real_minutes % 10;
  65. #endif
  66. return 0;
  67. }
  68. void BSP_reset (void)
  69. {
  70. local_irq_disable();
  71. asm volatile ("
  72. moveal #0x10c00000, %a0;
  73. moveb #0, 0xFFFFF300;
  74. moveal 0(%a0), %sp;
  75. moveal 4(%a0), %a0;
  76. jmp (%a0);
  77. ");
  78. }
  79. unsigned char *cs8900a_hwaddr;
  80. static int errno;
  81. _bsc0(char *, getserialnum)
  82. _bsc1(unsigned char *, gethwaddr, int, a)
  83. _bsc1(char *, getbenv, char *, a)
  84. void config_BSP(char *command, int len)
  85. {
  86. unsigned char *p;
  87. printk(KERN_INFO "\n68VZ328 DragonBallVZ support (c) 2001 Lineo, Inc.\n");
  88. printk(KERN_INFO "uCdimm serial string [%s]\n",getserialnum());
  89. p = cs8900a_hwaddr = gethwaddr(0);
  90. printk(KERN_INFO "uCdimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
  91. p[0], p[1], p[2], p[3], p[4], p[5]);
  92. p = getbenv("APPEND");
  93. if (p) strcpy(p,command);
  94. else command[0] = 0;
  95. mach_sched_init = BSP_sched_init;
  96. mach_tick = BSP_tick;
  97. mach_gettimeoffset = BSP_gettimeoffset;
  98. mach_gettod = BSP_gettod;
  99. mach_reset = BSP_reset;
  100. }