plf_io.h
来自「eCos操作系统源码」· C头文件 代码 · 共 267 行 · 第 1/2 页
H
267 行
#ifndef CYGONCE_PLF_IO_H#define CYGONCE_PLF_IO_H//=============================================================================//// plf_io.h//// Platform specific IO support////=============================================================================//####ECOSGPLCOPYRIGHTBEGIN####// -------------------------------------------// This file is part of eCos, the Embedded Configurable Operating System.// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.//// eCos is free software; you can redistribute it and/or modify it under// the terms of the GNU General Public License as published by the Free// Software Foundation; either version 2 or (at your option) any later version.//// eCos is distributed in the hope that it will be useful, but WITHOUT ANY// WARRANTY; without even the implied warranty of MERCHANTABILITY or// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License// for more details.//// You should have received a copy of the GNU General Public License along// with eCos; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.//// As a special exception, if other files instantiate templates or use macros// or inline functions from this file, or you compile this file and link it// with other works to produce a work based on this file, this file does not// by itself cause the resulting work to be covered by the GNU General Public// License. However the source code for this file must still be made available// in accordance with section (3) of the GNU General Public License.//// This exception does not invalidate any other reasons why a work based on// this file might be covered by the GNU General Public License.//// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.// at http://sources.redhat.com/ecos/ecos-license/// -------------------------------------------//####ECOSGPLCOPYRIGHTEND####//=============================================================================//#####DESCRIPTIONBEGIN####//// Author(s): hmt, jskov // Contributors: hmt, jskov// Date: 1999-08-09// Purpose: Intel EBSA285 PCI IO support macros// Description: // Usage: #include <cyg/hal/plf_io.h>//// Note: Based on information in // "21285 Core Logic for SA-110 Microprocessor"//####DESCRIPTIONEND####////=============================================================================#include <pkgconf/hal_arm_ebsa285.h>#include <cyg/hal/hal_ebsa285.h>#include <cyg/hal/hal_io.h> // IO macros#include <cyg/hal/hal_platform_ints.h> // Interrupt vectors// Memory map is 1-1#define CYGARC_PHYSICAL_ADDRESS(_x_) (_x_)// The PCI resources required by the EBSA are hardcoded to the lowest// addresses in the PCI address space, thus:// PCI Memory Space#define EBSA_SDRAM_PCI_ADDR 0#define EBSA_SDRAM_PCI_SIZE (CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE)#define EBSA_CSR_MEM_PCI_ADDR (EBSA_SDRAM_PCI_SIZE)#define EBSA_CSR_MEM_PCI_SIZE 0x80// PCI IO Space#define EBSA_CSR_IO_PCI_ADDR 0#define EBSA_CSR_IO_PCI_SIZE 0x80// Incidentally I now understand why it's necessary to force PCI reset// (2000-08-07) - with RedBoot in ROM, the RAM app was unconditionally// reinitializing the PCI bus when it was already initialized, without// resetting it. We cannot play the same game here as with// hal_platform_setup.h - I tried - because otherwise the net cannot// re-initialize itself; the scan for devices fails.// Initialize the PCI bus.#define HAL_PCI_INIT() \ CYG_MACRO_START \ cyg_uint32 __tmp, __tmp2; \ \ /* Assert PCI_reset */ \ HAL_READ_UINT32(SA110_CONTROL, __tmp); \ __tmp &= ~SA110_CONTROL_RST_I; \ HAL_WRITE_UINT32(SA110_CONTROL, __tmp); \ \ /* Disable PCI Outbound interrupts */ \ /* (according to 7-14 SA110_OUT_INT_MASK is not accessible */ \ /* by SA-100) */ \ HAL_WRITE_UINT32(SA110_OUT_INT_STATUS, \ SA110_OUT_INT_STATUS_DOORBELL_INT \ |SA110_OUT_INT_STATUS_OUTBOUND_INT); \ \ /* Disable Doorbells */ \ HAL_WRITE_UINT32(SA110_DOORBELL_PCI_MASK, 0); \ HAL_WRITE_UINT32(SA110_DOORBELL_SA_MASK, 0); \ \ /* Map high PCI address bits to 0 */ \ HAL_WRITE_UINT32(SA110_PCI_ADDR_EXT, 0); \ \ /* Interrupt ID to 1 */ \ HAL_WRITE_UINT16(SA110_PCI_CFG_INT_LINE, 0x0100); \ \ /* Remove PCI_reset */ \ HAL_READ_UINT32(SA110_CONTROL, __tmp); \ __tmp |= SA110_CONTROL_RST_I; \ HAL_WRITE_UINT32(SA110_CONTROL, __tmp); \ \ /* Open a window to SDRAM from PCI address space */ \ HAL_WRITE_UINT32(SA110_SDRAM_BASE_ADDRESS_MASK, \ ((CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_SIZE-1) & 0xfffc0000)); \ HAL_WRITE_UINT32(SA110_SDRAM_BASE_ADDRESS_OFFSET, \ CYGHWR_HAL_ARM_EBSA285_PCI_MEM_MAP_BASE); \ \ /* Only init PCI if central function is set and */ \ /* standalone bit is cleared */ \ HAL_READ_UINT32(SA110_CONTROL, __tmp); \ HAL_READ_UINT32(SA110_XBUS_XCS2, __tmp2); \ if ((__tmp & SA110_CONTROL_CFN) == SA110_CONTROL_CFN \ && (__tmp2 & SA110_XBUS_XCS2_PCI_DISABLE) == 0) { \ \ /* Don't respond to any commands */ \ HAL_WRITE_UINT16(SA110_PCI_CFG_COMMAND, 0); \ \
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?