OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [m68knommu/] [platform/] [68EZ328/] [config.c] - Blame information for rev 1781

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *  linux/arch/$(ARCH)/platform/$(PLATFORM)/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
 
12
#include <stdarg.h>
13
#include <linux/config.h>
14
#include <linux/types.h>
15
#include <linux/kernel.h>
16
#include <linux/mm.h>
17
#include <linux/tty.h>
18
#include <linux/console.h>
19
 
20
#include <asm/setup.h>
21
#include <asm/system.h>
22
#include <asm/pgtable.h>
23
#include <asm/irq.h>
24
#include <asm/machdep.h>
25
#ifdef CONFIG_UCSIMM
26
#include "ucsimm/bootstd.h"
27
#endif
28
#ifdef CONFIG_PILOT
29
#include "PalmV/romfs.h"
30
#endif
31
#include <asm/MC68EZ328.h>
32
 
33
extern void register_console(void (*proc)(const char *));
34
 
35
void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
36
{
37
  /* Restart mode, Enable int, 32KHz, Enable timer */
38
  TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_32KHZ | TCTL_TEN;
39
  /* Set prescaler (Divide 32KHz by 32)*/
40
  TPRER = 31;
41
  /* Set compare register  32Khz / 32 / 10 = 100 */
42
  TCMP = 10;
43
 
44
  request_irq(IRQ_MACHSPEC | 1, timer_routine, IRQ_FLG_LOCK, "timer", NULL);
45
}
46
 
47
void BSP_tick(void)
48
{
49
        /* Reset Timer1 */
50
        TSTAT &= 0;
51
}
52
 
53
unsigned long BSP_gettimeoffset (void)
54
{
55
  return 0;
56
}
57
 
58
void BSP_gettod (int *yearp, int *monp, int *dayp,
59
                   int *hourp, int *minp, int *secp)
60
{
61
}
62
 
63
int BSP_hwclk(int op, struct hwclk_time *t)
64
{
65
  if (!op) {
66
    /* read */
67
  } else {
68
    /* write */
69
  }
70
  return 0;
71
}
72
 
73
int BSP_set_clock_mmss (unsigned long nowtime)
74
{
75
#if 0
76
  short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
77
 
78
  tod->second1 = real_seconds / 10;
79
  tod->second2 = real_seconds % 10;
80
  tod->minute1 = real_minutes / 10;
81
  tod->minute2 = real_minutes % 10;
82
#endif
83
  return 0;
84
}
85
 
86
void BSP_reset (void)
87
{
88
  cli();
89
  asm volatile ("
90
    moveal #0x10c00000, %a0;
91
    moveb #0, 0xFFFFF300;
92
    moveal 0(%a0), %sp;
93
    moveal 4(%a0), %a0;
94
    jmp (%a0);
95
    ");
96
}
97
 
98
unsigned char *cs8900a_hwaddr;
99
static int errno;
100
 
101
#ifdef CONFIG_UCSIMM
102
_bsc0(char *, getserialnum)
103
_bsc1(unsigned char *, gethwaddr, int, a)
104
_bsc1(char *, getbenv, char *, a)
105
#endif
106
 
107
void config_BSP(char *command, int len)
108
{
109
  unsigned char *p;
110
#ifdef CONFIG_68328_SERIAL
111
  extern void console_print_68328(const char * b);
112
  register_console(console_print_68328);
113
#endif  
114
 
115
  printk("\n68EZ328 DragonBallEZ support (C) 1999 Rt-Control, Inc\n");
116
 
117
#ifdef CONFIG_UCSIMM
118
  printk("uCsimm serial string [%s]\n",getserialnum());
119
  p = cs8900a_hwaddr = gethwaddr(0);
120
  printk("uCsimm hwaddr %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
121
         p[0],
122
         p[1],
123
         p[2],
124
         p[3],
125
         p[4],
126
         p[5]);
127
 
128
  p = getbenv("APPEND");
129
  if (p) strcpy(p,command);
130
  else command[0] = 0;
131
#endif
132
 
133
  mach_sched_init      = BSP_sched_init;
134
  mach_tick            = BSP_tick;
135
  mach_gettimeoffset   = BSP_gettimeoffset;
136
  mach_gettod          = BSP_gettod;
137
  mach_hwclk           = NULL;
138
  mach_set_clock_mmss  = NULL;
139
  mach_mksound         = NULL;
140
  mach_reset           = BSP_reset;
141
  mach_debug_init      = NULL;
142
 
143
  config_M68EZ328_irq();
144
}

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.