📄 platforminit.c
字号:
/******************************************************************************
**
** COPYRIGHT (C) 2000, 2001 Intel Corporation.
**
** This software as well as the software described in it is furnished under
** license and may only be used or copied in accordance with the terms of the
** license. The information in this file is furnished for informational use
** only, is subject to change without notice, and should not be construed as
** a commitment by Intel Corporation. Intel Corporation assumes no
** responsibility or liability for any errors or inaccuracies that may appear
** in this document or any software that may be provided in association with
** this document.
** Except as permitted by such license, no part of this document may be
** reproduced, stored in a retrieval system, or transmitted in any form or by
** any means without the express written consent of Intel Corporation.
**
** FILENAME: platformInit.c
**
** PURPOSE: This module contains platform initialization routines.
**
** $LAST MODIFIED: 01/12/2001
******************************************************************************/
/*
*******************************************************************************
* HEADER FILES
*******************************************************************************
*/
#include "systypes.h"
#include "dm_errors.h"
#include "mallocx.h"
#include "cotulla.h"
#include "platform.h"
#include "platformInit.h"
#include "boardControl.h"
#include "intelFlashAPI.h"
#include "xllp_ethernet.h"
#include "EthernetCntr.h"
#include "XsIntCtrlApi.h"
#include "boardIntCtrlApi.h"
#include "XsIntCtrlApi.h"
#include "XsDmaApi.h"
#include "UCB1400_Touch.h"
#include "Ad7873_Touch.h"
#include "Ac97MixerRegsApi.h"
#include "XsAc97CtrlApi.h"
#include "Ac97Api.h"
/*
*******************************************************************************
*
* FUNCTION:
* PlatformSWInit
*
* DESCRIPTION:
* This routine calls the software initialization entry points for all the
* supported device drivers on Mainstone.
*
* INPUT PARAMETERS:
* None.
*
* RETURNS:
* None.
*
* GLOBAL EFFECTS:
* The Mainstone device drivers are initialized and ready to setup the
* hardware devices.
*
* ASSUMPTIONS:
* The device driver initialization is intended to initialize only the driver
* not the hardware. Hardware initialization should be done in the routine
* PlatformHWSetup.
*
* CALLS:
* All Mainstone device driver software initialization routines.
*
* CALLED BY:
*
* PROTOTYPE:
* VOID PlatformSWInit(VOID);
*
*******************************************************************************
*/
void PlatformSWInit (void)
{
// Initialize memory allocation area
mallocxSWInit();
// Call software initialization routines for the drivers for
// all Cotulla peripherals
XsMainSWInit();
// Initialize board's interrupt controller driver.
BoardIcSWInit();
// Initialize flash driver.
// FlashSWInit();
// Initialize the LAN91C111 driver.
EthernetSWInit();
// Initialize AC97 CODEC
Ac97SWInit();
// Initialize AC97 Touch device
TS_SWInit();
// Initialize SSP Touch device
TSad_SWInit();
}
/*
*******************************************************************************
*
* FUNCTION:
* PlatformHWSetup
*
* DESCRIPTION:
* This routine calls the hardware setup entry points for all the supported
* device drivers on Mainstone.
*
* INPUT PARAMETERS:
* None.
*
* RETURNS:
* Success: 0 (ERR_NONE)
* Failure: NonZero: Error code from a subroutine
*
* GLOBAL EFFECTS:
* The Mainstone hardware devices are put into a known initialized state.
*
* ASSUMPTIONS:
* The device driver hardware setup is intended to initialize device hardware.
* Software initialization should be done in the routine PlatformSWInit.
*
* CALLS:
* All Mainstone device driver hardware setup routines.
*
* CALLED BY:
*
* PROTOTYPE:
* UINT32 PlatformHWSetup(VOID)
*
*******************************************************************************
*/
UINT32 PlatformHWSetup()
{
UINT32 status;
// HW setup for all main processor peripherals that are always used.
status = XsMainHWSetup();
if (status != ERR_NONE) return status;
// Initialize board's interrupt controller
status = BoardIcHWSetup();
if (status != ERR_NONE) return status;
return ERR_NONE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -