Subversion Repositories HelenOS

Rev

Rev 4345 | Rev 4347 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4345 Rev 4346
Line 24... Line 24...
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
/** @addtogroup sparc64
29
/** @addtogroup sparc64
30
 * @{
30
 * @{
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#include <arch/drivers/kbd.h>
35
#include <arch/drivers/kbd.h>
36
#include <genarch/ofw/ofw_tree.h>
36
#include <genarch/ofw/ofw_tree.h>
-
 
37
 
-
 
38
#ifdef CONFIG_SUN_KBD
-
 
39
#include <genarch/kbrd/kbrd.h>
-
 
40
#endif
37
#ifdef CONFIG_Z8530
41
#ifdef CONFIG_Z8530
38
#include <genarch/kbd/z8530.h>
42
#include <genarch/drivers/z8530/z8530.h>
39
#endif
43
#endif
40
#ifdef CONFIG_NS16550
44
#ifdef CONFIG_NS16550
41
#include <genarch/kbd/ns16550.h>
45
#include <genarch/drivers/ns16550/ns16550.h>
42
#endif
46
#endif
-
 
47
 
-
 
48
#include <console/console.h>
43
#include <ddi/device.h>
49
#include <ddi/device.h>
44
#include <ddi/irq.h>
50
#include <ddi/irq.h>
45
#include <arch/mm/page.h>
51
#include <arch/mm/page.h>
46
#include <arch/types.h>
52
#include <arch/types.h>
47
#include <align.h>
53
#include <align.h>
Line 49... Line 55...
49
#include <print.h>
55
#include <print.h>
50
#include <sysinfo/sysinfo.h>
56
#include <sysinfo/sysinfo.h>
51
 
57
 
52
kbd_type_t kbd_type = KBD_UNKNOWN;
58
kbd_type_t kbd_type = KBD_UNKNOWN;
53
 
59
 
-
 
60
#ifdef CONFIG_SUN_KBD
-
 
61
 
54
/** Initialize keyboard.
62
/** Initialize keyboard.
55
 *
63
 *
56
 * Traverse OpenFirmware device tree in order to find necessary
64
 * Traverse OpenFirmware device tree in order to find necessary
57
 * info about the keyboard device.
65
 * info about the keyboard device.
58
 *
66
 *
Line 157... Line 165...
157
#ifdef CONFIG_Z8530
165
#ifdef CONFIG_Z8530
158
    case KBD_Z8530:
166
    case KBD_Z8530:
159
        devno = device_assign_devno();
167
        devno = device_assign_devno();
160
        z8530 = (z8530_t *) hw_map(aligned_addr, offset + size) +
168
        z8530 = (z8530_t *) hw_map(aligned_addr, offset + size) +
161
            offset;
169
            offset;
-
 
170
       
162
        (void) z8530_init(z8530, devno, inr, cir, cir_arg);
171
        indev_t *kbrdin_z8530 = z8530_init(z8530, devno, inr, cir, cir_arg);
-
 
172
        if (kbrdin_z8530)
-
 
173
            kbrd_init(kbrdin_z8530);
163
       
174
       
164
        /*
175
        /*
165
         * This is the necessary evil until the userspace drivers are
176
         * This is the necessary evil until the userspace drivers are
166
         * entirely self-sufficient.
177
         * entirely self-sufficient.
167
         */
178
         */
Line 177... Line 188...
177
#ifdef CONFIG_NS16550
188
#ifdef CONFIG_NS16550
178
    case KBD_NS16550:
189
    case KBD_NS16550:
179
        devno = device_assign_devno();
190
        devno = device_assign_devno();
180
        ns16550 = (ns16550_t *) hw_map(aligned_addr, offset + size) +
191
        ns16550 = (ns16550_t *) hw_map(aligned_addr, offset + size) +
181
            offset;
192
            offset;
-
 
193
       
182
        (void) ns16550_init(ns16550, devno, inr, cir, cir_arg);
194
        indev_t *kbrdin_ns16550 = ns16550_init(ns16550, devno, inr, cir, cir_arg);
-
 
195
        if (kbrdin_ns16550)
-
 
196
            kbrd_init(kbrdin_ns16550);
183
       
197
       
184
        /*
198
        /*
185
         * This is the necessary evil until the userspace driver is
199
         * This is the necessary evil until the userspace driver is
186
         * entirely self-sufficient.
200
         * entirely self-sufficient.
187
         */
201
         */
Line 198... Line 212...
198
        printf("Kernel is not compiled with the necessary keyboard "
212
        printf("Kernel is not compiled with the necessary keyboard "
199
            "driver this machine requires.\n");
213
            "driver this machine requires.\n");
200
    }
214
    }
201
}
215
}
202
 
216
 
-
 
217
#endif
-
 
218
 
203
/** @}
219
/** @}
204
 */
220
 */