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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [sh/] [kernel/] [setup_7751se.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 * linux/arch/sh/kernel/setup_7751se.c
3
 *
4
 * Copyright (C) 2000  Kazumoto Kojima
5
 *
6
 * Hitachi SolutionEngine Support.
7
 *
8
 * Modified for 7751 Solution Engine by
9
 * Ian da Silva and Jeremy Siegel, 2001.
10
 */
11
 
12
#include <linux/config.h>
13
#include <linux/init.h>
14
#include <linux/irq.h>
15
 
16
#include <linux/hdreg.h>
17
#include <linux/ide.h>
18
#include <asm/io.h>
19
#include <asm/hitachi_7751se.h>
20
 
21
/*
22
 * Configure the Super I/O chip
23
 */
24
#if 0
25
/* Leftover code from regular Solution Engine, for reference. */
26
/* The SH7751 Solution Engine has a different SuperIO. */
27
static void __init smsc_config(int index, int data)
28
{
29
        outb_p(index, INDEX_PORT);
30
        outb_p(data, DATA_PORT);
31
}
32
 
33
static void __init init_smsc(void)
34
{
35
        outb_p(CONFIG_ENTER, CONFIG_PORT);
36
        outb_p(CONFIG_ENTER, CONFIG_PORT);
37
 
38
        /* FDC */
39
        smsc_config(CURRENT_LDN_INDEX, LDN_FDC);
40
        smsc_config(ACTIVATE_INDEX, 0x01);
41
        smsc_config(IRQ_SELECT_INDEX, 6); /* IRQ6 */
42
 
43
        /* IDE1 */
44
        smsc_config(CURRENT_LDN_INDEX, LDN_IDE1);
45
        smsc_config(ACTIVATE_INDEX, 0x01);
46
        smsc_config(IRQ_SELECT_INDEX, 14); /* IRQ14 */
47
 
48
        /* AUXIO (GPIO): to use IDE1 */
49
        smsc_config(CURRENT_LDN_INDEX, LDN_AUXIO);
50
        smsc_config(GPIO46_INDEX, 0x00); /* nIOROP */
51
        smsc_config(GPIO47_INDEX, 0x00); /* nIOWOP */
52
 
53
        /* COM1 */
54
        smsc_config(CURRENT_LDN_INDEX, LDN_COM1);
55
        smsc_config(ACTIVATE_INDEX, 0x01);
56
        smsc_config(IO_BASE_HI_INDEX, 0x03);
57
        smsc_config(IO_BASE_LO_INDEX, 0xf8);
58
        smsc_config(IRQ_SELECT_INDEX, 4); /* IRQ4 */
59
 
60
        /* COM2 */
61
        smsc_config(CURRENT_LDN_INDEX, LDN_COM2);
62
        smsc_config(ACTIVATE_INDEX, 0x01);
63
        smsc_config(IO_BASE_HI_INDEX, 0x02);
64
        smsc_config(IO_BASE_LO_INDEX, 0xf8);
65
        smsc_config(IRQ_SELECT_INDEX, 3); /* IRQ3 */
66
 
67
        /* RTC */
68
        smsc_config(CURRENT_LDN_INDEX, LDN_RTC);
69
        smsc_config(ACTIVATE_INDEX, 0x01);
70
        smsc_config(IRQ_SELECT_INDEX, 8); /* IRQ8 */
71
 
72
        /* XXX: PARPORT, KBD, and MOUSE will come here... */
73
        outb_p(CONFIG_EXIT, CONFIG_PORT);
74
}
75
#endif
76
 
77
/*
78
 * Initialize IRQ setting
79
 */
80
void __init init_7751se_IRQ(void)
81
{
82
 
83
  /* Leave old Solution Engine code in for reference. */
84
#if defined(CONFIG_SH_SOLUTION_ENGINE)
85
        /*
86
         * Super I/O (Just mimic PC):
87
         *  1: keyboard
88
         *  3: serial 0
89
         *  4: serial 1
90
         *  5: printer
91
         *  6: floppy
92
         *  8: rtc
93
         * 12: mouse
94
         * 14: ide0
95
         */
96
        make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-14);
97
        make_ipr_irq(12, BCR_ILCRA, 1, 0x0f-12);
98
        make_ipr_irq( 8, BCR_ILCRB, 1, 0x0f- 8);
99
        make_ipr_irq( 6, BCR_ILCRC, 3, 0x0f- 6);
100
        make_ipr_irq( 5, BCR_ILCRC, 2, 0x0f- 5);
101
        make_ipr_irq( 4, BCR_ILCRC, 1, 0x0f- 4);
102
        make_ipr_irq( 3, BCR_ILCRC, 0, 0x0f- 3);
103
        make_ipr_irq( 1, BCR_ILCRD, 3, 0x0f- 1);
104
 
105
        make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); /* LAN */
106
 
107
        make_ipr_irq( 0, BCR_ILCRE, 3, 0x0f- 0); /* PCIRQ3 */
108
        make_ipr_irq(11, BCR_ILCRE, 2, 0x0f-11); /* PCIRQ2 */
109
        make_ipr_irq( 9, BCR_ILCRE, 1, 0x0f- 9); /* PCIRQ1 */
110
        make_ipr_irq( 7, BCR_ILCRE, 0, 0x0f- 7); /* PCIRQ0 */
111
 
112
        /* #2, #13 are allocated for SLOT IRQ #1 and #2 (for now) */
113
        /* NOTE: #2 and #13 are not used on PC */
114
        make_ipr_irq(13, BCR_ILCRG, 1, 0x0f-13); /* SLOTIRQ2 */
115
        make_ipr_irq( 2, BCR_ILCRG, 0, 0x0f- 2); /* SLOTIRQ1 */
116
 
117
#elif defined(CONFIG_SH_7751_SOLUTION_ENGINE)
118
 
119
        make_ipr_irq(13, BCR_ILCRD, 3, 2);
120
 
121
        /* Add additional calls to make_ipr_irq() as drivers are added
122
         * and tested.
123
         */
124
#endif
125
 
126
}
127
 
128
 
129
/*
130
 * Initialize the board
131
 */
132
void __init setup_7751se(void)
133
{
134
        /* Call init_smsc() replacement to set up SuperIO. */
135
        /* XXX: RTC setting comes here */
136
}

powered by: WebSVN 2.1.0

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