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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [or32/] [board/] [config.c] - Blame information for rev 666

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

Line No. Rev Author Line
1 666 simons
/*
2
 *  linux/arch/$(ARCH)/platform/$(PLATFORM)/config.c
3
 *
4
 * This file is subject to the terms and conditions of the GNU General Public
5
 * License.  See the file COPYING in the main directory of this archive
6
 * for more details.
7
 *
8
 * Based on m68knommu/platform/xx/config.c
9
 */
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
 
19
#include <asm/system.h>
20
#include <asm/pgtable.h>
21
#include <asm/irq.h>
22
#include <asm/machdep.h>
23
 
24
extern void register_console(void (*proc)(const char *));
25
 
26
/* Tick timer period */
27
unsigned long tick_period = SYS_TICK_PER;
28
 
29
void BSP_sched_init(void (*timer_routine)(int, void *, struct pt_regs *))
30
{
31
  /* Set counter period, enable timer and interrupt */
32
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (SYS_TICK_PER & SPR_TTMR_PERIOD));
33
}
34
 
35
void BSP_tick(void)
36
{
37
  mtspr(SPR_TTMR, SPR_TTMR_IE | SPR_TTMR_RT | (SYS_TICK_PER & SPR_TTMR_PERIOD));
38
}
39
 
40
unsigned long BSP_gettimeoffset (void)
41
{
42
  return 0;
43
}
44
 
45
void BSP_gettod (int *yearp, int *monp, int *dayp,
46
                   int *hourp, int *minp, int *secp)
47
{
48
}
49
 
50
int BSP_hwclk(int op, struct hwclk_time *t)
51
{
52
  if (!op) {
53
    /* read */
54
  } else {
55
    /* write */
56
  }
57
  return 0;
58
}
59
 
60
int BSP_set_clock_mmss (unsigned long nowtime)
61
{
62
#if 0
63
  short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
64
 
65
  tod->second1 = real_seconds / 10;
66
  tod->second2 = real_seconds % 10;
67
  tod->minute1 = real_minutes / 10;
68
  tod->minute2 = real_minutes % 10;
69
#endif
70
  return 0;
71
}
72
 
73
void BSP_reset (void)
74
{
75
  cli();
76
}
77
 
78
void config_BSP(char *command, int len)
79
{
80
  mach_sched_init      = BSP_sched_init;
81
  mach_tick            = BSP_tick;
82
  mach_gettimeoffset   = BSP_gettimeoffset;
83
  mach_gettod          = BSP_gettod;
84
  mach_hwclk           = NULL;
85
  mach_set_clock_mmss  = NULL;
86
  mach_mksound         = NULL;
87
  mach_reset           = BSP_reset;
88
  mach_debug_init      = NULL;
89
}

powered by: WebSVN 2.1.0

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