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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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