⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 superio.c

📁 文件内包含了nuclues的内核代码和针对Power PC的编译器。需要用VirtNet生成一个虚拟网卡才可使用
💻 C
字号:
/************************************************************************/
/*                                                                      */
/*       Copyright (c) 2001 by Accelerated Technology, Inc.             */
/*                                                                      */
/*  PROPRIETARY RIGHTS of Accelerated Technology are  involved in       */
/*  the subject matter of this material.  All manufacturing,            */
/*  reproduction, use, and sales rights pertaining to this subject      */
/*  matter are  governed by the license agreement.  The recipient of    */
/*     this software implicitly accepts the terms of the license.       */
/*                                                                      */
/*                                                                      */
/************************************************************************/
/************************************************************************/
/* FILE NAME                              VERSION                       */
/*                                                                      */
/*        superio.c              Nucleus PLUS\MPC8245\Diab C/C++ 1.13.1 */
/*                                                                      */
/*                                                                      */
/* DESCRIPTION                                                          */
/*                                                                      */
/*        Support services for the National Semiconductor PC87308VUL    */
/*        SuperI/O Enhanced Sidewinder Lit Plug and Play Compatible     */
/*        Chip.                                                         */
/*                                                                      */
/*                                                                      */
/* DATA STRUCTURES                                                      */
/*                                                                      */
/*        none                                                          */
/*                                                                      */
/* FUNCTIONS                                                            */
/*                                                                      */
/*        sio_Init                                                      */
/*                                                                      */
/* DEPENDENCIES                                                         */
/*        NA                                                            */
/*                                                                      */
/* HISTORY                                                              */
/*                                                                      */
/*        NAME              DATE                    REMARKS             */
/*                                                                      */
/*      T. Weller        12\19\2001       Created inital version 1.13.1 */
/************************************************************************/

#include "superio.h"


/*
  $Id: yk.c,v 1.12 1999/09/23 23:31:15 garym Exp $
        Copyright Motorola, Inc. 1993, 1994, 1999
    ALL RIGHTS RESERVED

    You are hereby granted a copyright license to use, modify, and 
    distribute the SOFTWARE so long as this entire notice is retained 
    without alteration in any modified and/or redistributed versions, 
    and that such modified versions are clearly identified as such.  
    No licenses are granted by implication, estoppel or otherwise under 
    any patents or trademarks of Motorola, Inc.

    The SOFTWARE is provided on an "AS IS" basis and without warranty.  
    To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS 
    ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED 
    WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
    PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH 
    REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS 
    THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS. 

    To the maximum extent permitted by applicable law, IN NO EVENT SHALL 
    MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER 
    (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF 
    BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS 
    INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR 
    INABILITY TO USE THE SOFTWARE.   Motorola assumes no responsibility 
    for the maintenance and support of the SOFTWARE.  */

/************************************************************************/
/* sio_Init                                                             */
/*                                                                      */
/*                                                                      */
/* DESCRIPTION                                                          */
/*                                                                      */
/*    Performs initialization of the SuperI/O controller.               */
/*                                                                      */
/************************************************************************/
void sio_Init()
{
    char* Defaults;
    char NS308_defaults[] = {   /* Default Array Change for your system */

    LDN,                LDN_5,      /* 5: Serial Port #2 */
    ACTIVATE,           0,          /* Off */
    PBASE_IO_ADDR_U,    0x02,       /* I/O Base = 0x2f8 */
    PBASE_IO_ADDR_L,    0xf8,
    PINTRPT_SEL,        4,          /* Set IRQ level 1 */
    PINTRPT_TYPE,       2,          /* edge, high */
    ACTIVATE,           0,          /* Disabled */

    LDN,                LDN_6,      /* 6: Serial Port #1 */
    ACTIVATE,           0,          /* Off */
    PBASE_IO_ADDR_U,    0x03,       /* I/O Base = 0x3f8 */
    PBASE_IO_ADDR_L,    0xf8,   
    PINTRPT_SEL,        5,          /* Set IRQ level 2 */
    PINTRPT_TYPE,       2,          /* edge, high */
    ACTIVATE,           1,          /* On */

    LDN,                LDN_8,      /* 8: APC */
    ACTIVATE,           0,          /* Off */

#ifdef XIO_SUPPORT
    LDN,                LDN_0,      /* 0: AT Keyboard */
    ACTIVATE,           1,          /* Enable */
#endif

    CSCONFIG_INDX,      0,
    CSCONFIG_DATA,      0x00,
    CSCONFIG_INDX,      1,
    CSCONFIG_DATA,      0x76,
    CSCONFIG_INDX,      2,
    CSCONFIG_DATA,      0x30,
    CSCONFIG_INDX,      4,
    CSCONFIG_DATA,      0x00,
    CSCONFIG_INDX,      5,
    CSCONFIG_DATA,      0x75,
    CSCONFIG_INDX,      6,
    CSCONFIG_DATA,      0x30,
    CSCONFIG_INDX,      8,
    CSCONFIG_DATA,      0x00,
    CSCONFIG_INDX,      9,
    CSCONFIG_DATA,      0x74,
    CSCONFIG_INDX,      10,
    CSCONFIG_DATA,      0x30,

    0,0 };


    Defaults = NS308_defaults;
    while ((*Defaults != 0)  ||  (*(Defaults+1) != 0)) {
        SIO_OUTBYTE( (char *) IO_Index, *Defaults    );  
        SIO_OUTBYTE( (char *) IO_Data,  *(Defaults+1)); 
        Defaults+=2;    /*port,value */
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -