Changeset 965dc18 in mainline for kernel/arch/sparc64/src/console.c


Ignore:
Timestamp:
2008-12-05T19:59:03Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49093a4
Parents:
0258e67
Message:

Merge sparc branch to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/console.c

    r0258e67 r965dc18  
    3939#include <arch/drivers/kbd.h>
    4040
     41#include <arch/drivers/sgcn.h>
     42
    4143#ifdef CONFIG_Z8530
    4244#include <genarch/kbd/z8530.h>
     
    5557#include <arch.h>
    5658#include <panic.h>
     59#include <func.h>
    5760#include <print.h>
    5861
    5962#define KEYBOARD_POLL_PAUSE     50000   /* 50ms */
    6063
    61 /** Initialize kernel console to use framebuffer and keyboard directly. */
    62 void standalone_sparc64_console_init(void)
     64/**
     65 * Initialize kernel console to use framebuffer and keyboard directly.
     66 * Called on UltraSPARC machines with standard keyboard and framebuffer.
     67 *
     68 * @param aliases       the "/aliases" OBP node
     69 */
     70static void standard_console_init(ofw_tree_node_t *aliases)
    6371{
    6472        stdin = NULL;
    6573
    66         ofw_tree_node_t *aliases;
    6774        ofw_tree_property_t *prop;
    6875        ofw_tree_node_t *screen;
    6976        ofw_tree_node_t *keyboard;
    70        
    71         aliases = ofw_tree_lookup("/aliases");
    72         if (!aliases)
    73                 panic("Can't find /aliases.\n");
    7477       
    7578        prop = ofw_tree_getprop(aliases, "screen");
     
    9699}
    97100
     101/** Initilize I/O on the Serengeti machine. */
     102static void serengeti_init(void)
     103{
     104        sgcn_init();
     105}
     106
     107/**
     108 * Initialize input/output. Auto-detects the type of machine
     109 * and calls the appropriate I/O init routine.
     110 */
     111void standalone_sparc64_console_init(void)
     112{
     113        ofw_tree_node_t *aliases;
     114        ofw_tree_property_t *prop;
     115       
     116        aliases = ofw_tree_lookup("/aliases");
     117        if (!aliases)
     118                panic("Can't find /aliases.\n");
     119       
     120        /* "def-cn" = "default console" */
     121        prop = ofw_tree_getprop(aliases, "def-cn");
     122       
     123        if ((!prop) || (!prop->value) || (strcmp(prop->value, "/sgcn") != 0)) {
     124                standard_console_init(aliases);
     125        } else {
     126                serengeti_init();
     127        }
     128}
     129
     130
    98131/** Kernel thread for polling keyboard.
    99132 *
     
    130163#endif
    131164#endif
     165#ifdef CONFIG_SGCN
     166                if (kbd_type == KBD_SGCN)
     167                        sgcn_poll();
     168#endif
    132169                thread_usleep(KEYBOARD_POLL_PAUSE);
    133170        }
     
    150187                break;
    151188#endif
     189#ifdef CONFIG_SGCN
     190        case KBD_SGCN:
     191                sgcn_grab();
     192                break;
     193#endif
    152194        default:
    153195                break;
     
    171213                break;
    172214#endif
     215#ifdef CONFIG_SGCN
     216        case KBD_SGCN:
     217                sgcn_release();
     218                break;
     219#endif
    173220        default:
    174221                break;
Note: See TracChangeset for help on using the changeset viewer.