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

Subversion Repositories ao68000

[/] [ao68000/] [trunk/] [tests/] [soc_for_linux_on_terasic_de2_70/] [software/] [linux-2.6.33.1-ao68000/] [arch/] [m68knommu/] [platform/] [ao68000/] [config.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 alfik
/***************************************************************************/
2
 
3
/*
4
 *  linux/arch/m68knommu/platform/ao68000/config.c
5
 *
6
 *  Copyright (C) 1993 Hamish Macdonald
7
 *  Copyright (C) 1999 D. Jeff Dionne
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
 * VZ Support/Fixes             Evan Stawnyczy <e@lineo.ca>
14
 */
15
 
16
/***************************************************************************/
17
 
18
#include <linux/types.h>
19
#include <linux/kernel.h>
20
#include <asm/system.h>
21
#include <asm/machdep.h>
22
 
23
 
24
// EARLY PRINTK from arch/arm/kernel/early_printk.c ---------------------------------
25
#include <linux/console.h>
26
#include <linux/init.h>
27
 
28
//extern void printch(int);
29
 
30
static void early_write(const char *s, unsigned n)
31
{
32
        volatile char *uart = (char *)0xE0000000;
33
 
34
        while(n-- > 0) {
35
                uart[0] = s[0];
36
                s++;
37
        }
38
}
39
 
40
static void early_console_write(struct console *con, const char *s, unsigned n)
41
{
42
        early_write(s, n);
43
}
44
 
45
static struct console early_console = {
46
        .name =         "earlycon",
47
        .write =        early_console_write,
48
        .flags =        CON_PRINTBUFFER | CON_BOOT,
49
        .index =        -1,
50
};
51
 
52
asmlinkage void early_printk(const char *fmt, ...)
53
{
54
        char buf[512];
55
        int n;
56
        va_list ap;
57
 
58
        va_start(ap, fmt);
59
        n = vscnprintf(buf, sizeof(buf), fmt, ap);
60
        early_write(buf, n);
61
        va_end(ap);
62
}
63
 
64
static int __init setup_early_printk(char *buf)
65
{
66
        // blockes if called in (in_interrupt()) in kernel/printk.c
67
        register_console(&early_console);
68
        return 0;
69
}
70
//------------------------------------------------------------------------------------------
71
 
72
 
73
/***************************************************************************/
74
 
75
void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec)
76
{
77
        *year = *mon = *day = 1;
78
        *hour = 2;
79
        *min = 3;
80
        *sec = 4;
81
}
82
 
83
/***************************************************************************/
84
 
85
void m68328_reset (void)
86
{
87
  local_irq_disable();
88
  while(1) { ; }
89
}
90
 
91
/***************************************************************************/
92
 
93
void config_BSP(char *command, int len)
94
{
95
//  setup_early_printk(command);
96
 
97
  printk(KERN_INFO "\nAO68000 support Aleksander Osman <alfik@poczta.fm>\n");
98
 
99
  mach_gettod = m68328_timer_gettod;
100
  mach_reset = m68328_reset;
101
}
102
 
103
/***************************************************************************/
104
 
105
static irqreturn_t hw_tick(int irq, void *dummy)
106
{
107
        return arch_timer_interrupt(irq, dummy);
108
}
109
 
110
/***************************************************************************/
111
 
112
static struct irqaction ao68000_timer_irq = {
113
        .name    = "timer",
114
        .flags   = IRQF_DISABLED | IRQF_TIMER,
115
        .handler = hw_tick,
116
};
117
 
118
/***************************************************************************/
119
 
120
 
121
void hw_timer_init(void)
122
{
123
        /* set ISR */
124
        setup_irq(0x01, &ao68000_timer_irq);
125
}
126
 
127
/***************************************************************************/

powered by: WebSVN 2.1.0

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