Changeset da74747 in mainline


Ignore:
Timestamp:
2006-08-09T12:24:58Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
287920f
Parents:
e2882a7
Message:

Start reorganization of different keyboard drivers.
What seemed like a screwed i8042 chip appears to be
Zilog 8530.

The repository won't compile now. To be fixed in next commits.

Location:
kernel
Files:
1 added
3 edited
8 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/Makefile.inc

    re2882a7 rda74747  
    6161CONFIG_FB = y
    6262
    63 ## Compile with support for i8042 controller.
     63## Compile with support for z8530 controller.
    6464#
    6565
    66 CONFIG_I8042 = y
    67 CONFIG_I8042_SUN = y
    68 DEFS += -DCONFIG_I8042_SUN
     66CONFIG_Z8530 = y
     67CONFIG_KBD_SUN = y
     68DEFS += -DCONFIG_KBD_SUN
    6969
    7070ARCH_SOURCES = \
     
    8989        arch/$(ARCH)/src/ddi/ddi.c \
    9090        arch/$(ARCH)/src/drivers/tick.c \
    91         arch/$(ARCH)/src/drivers/i8042.c
     91        arch/$(ARCH)/src/drivers/kbd.c
  • kernel/arch/sparc64/include/drivers/z8530.h

    re2882a7 rda74747  
    3333 */
    3434
    35 #ifndef KERN_sparc64_I8042_H_
    36 #define KERN_sparc64_I8042_H_
     35#ifndef KERN_sparc64_Z8530_H_
     36#define KERN_sparc64_Z8530_H_
    3737
    3838#include <arch/types.h>
     
    4646extern volatile uint8_t *kbd_virt_address;
    4747
    48 static inline void i8042_data_write(uint8_t data)
     48static inline void z8530_data_write(uint8_t data)
    4949{
    5050        kbd_virt_address[DATA_REG] = data;
    5151}
    5252
    53 static inline uint8_t i8042_data_read(void)
     53static inline uint8_t z8530_data_read(void)
    5454{
    5555        return kbd_virt_address[DATA_REG];
    5656}
    5757
    58 static inline uint8_t i8042_status_read(void)
     58static inline uint8_t z8530_status_read(void)
    5959{
    6060        return kbd_virt_address[STATUS_REG];
    6161}
    6262
    63 static inline void i8042_command_write(uint8_t command)
     63static inline void z8530_command_write(uint8_t command)
    6464{
    6565        kbd_virt_address[COMMAND_REG] = command;
  • kernel/arch/sparc64/src/console.c

    re2882a7 rda74747  
    5454{
    5555        stdin = NULL;
     56               
     57        fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height,
     58                bootinfo.screen.bpp, bootinfo.screen.scanline, true);
    5659
    5760        if (bootinfo.keyboard.addr)
    5861                kbd_init();
    59                
    60         fb_init(bootinfo.screen.addr, bootinfo.screen.width, bootinfo.screen.height,
    61                 bootinfo.screen.bpp, bootinfo.screen.scanline, true);
    6262}
    6363
  • kernel/arch/sparc64/src/mm/page.c

    re2882a7 rda74747  
    4747}
    4848
     49/** Map memory-mapped device into virtual memory.
     50 *
     51 * So far, only DTLB is used to map devices into memory.
     52 * Chances are that there will be only a limited amount of
     53 * devices that the kernel itself needs to lock in DTLB.
     54 *
     55 * @param physaddr Physical address of the page where the
     56 *                 device is located. Must be at least
     57 *                 page-aligned.
     58 * @param size Size of the device's registers. Must not
     59 *             exceed 4M and must include extra space
     60 *             caused by the alignment.
     61 *
     62 * @return Virtual address of the page where the device is
     63 *         mapped.
     64 */
    4965uintptr_t hw_map(uintptr_t physaddr, size_t size)
    5066{
     
    6985        };
    7086       
     87        ASSERT(ALIGN_UP(physaddr, PAGE_SIZE) == physaddr);
    7188        ASSERT(size <= 4*1024*1024);
    7289       
  • kernel/genarch/include/kbd/i8042.h

    re2882a7 rda74747  
    3333 */
    3434
    35 #ifndef __I8042_H__
    36 #define __I8042_H__
     35#ifndef KERN_I8042_H_
     36#define KERN_I8042_H_
    3737
    38 #ifdef CONFIG_I8042_PC
    39 #include <genarch/i8042/scanc_pc.h>
    40 #endif
    41 #ifdef CONFIG_I8042_SUN
    42 #include <genarch/i8042/scanc_sun.h>
    43 #endif
     38#include <genarch/kbd/scanc_pc.h>
    4439
    4540#define SPECIAL         '?'
  • kernel/genarch/include/kbd/scanc_pc.h

    re2882a7 rda74747  
    3535 */
    3636
    37 #ifndef KERN_I8042_PC_H_
    38 #define KERN_I8042_PC_H_
     37#ifndef KERN_SCANC_PC_H_
     38#define KERN_SCANC_PC_H_
    3939
    4040#define SC_ESC          0x01
  • kernel/genarch/include/kbd/scanc_sun.h

    re2882a7 rda74747  
    3535 */
    3636
    37 #ifndef KERN_I8042_SUN_H_
    38 #define KERN_I8042_SUN_H_
     37#ifndef KERN_SCANC_SUN_H_
     38#define KERN_SCANC_SUN_H_
    3939
    4040#define SC_ESC          0x1d
  • kernel/genarch/include/kbd/z8530.h

    re2882a7 rda74747  
    11/*
    2  * Copyright (C) 2006 Jakub Jermar
     2 * Copyright (C) 2001-2004 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup sparc64
     29/** @addtogroup genarch
    3030 * @{
    3131 */
    32 /** @file
     32/**
     33 * @file
     34 * @brief       Headers for Zilog 8530 serial port / keyboard driver.
    3335 */
    3436
    35 #include <arch/drivers/i8042.h>
    36 #include <genarch/i8042/i8042.h>
    37 #include <arch/boot/boot.h>
    38 #include <arch/types.h>
    39 #include <arch/mm/page.h>
     37#ifndef KERN_Z8530_H_
     38#define KERN_Z8530_H_
    4039
    41 volatile uint8_t *kbd_virt_address = NULL;
     40#include <genarch/kbd/scanc_sun.h>
    4241
    43 void kbd_init()
    44 {
    45         kbd_virt_address = (uint8_t *) hw_map(bootinfo.keyboard.addr, LAST_REG);
    46         i8042_init();
    47 }
     42#define SPECIAL         '?'
     43
     44extern char sc_primary_map[];
     45extern char sc_secondary_map[];
     46
     47extern void z8530_init(void);
     48extern void z8530_poll(void);
     49extern void z8530_grab(void);
     50extern void z8530_release(void);
     51
     52#endif
    4853
    4954/** @}
  • kernel/genarch/src/kbd/scanc_sun.c

    re2882a7 rda74747  
    8282        [0x29] = '=',
    8383        [0x2a] = '`',
    84         [0x2b] = '\b',  /* Backspace */
     84        [0x2b] = '\b',          /* Backspace */
    8585        [0x2c] = SPECIAL,       /* Insert */
    8686        [0x2d] = SPECIAL,
Note: See TracChangeset for help on using the changeset viewer.