📄 hal_diag.h
字号:
#ifndef CYGONCE_HAL_HAL_DIAG_H
#define CYGONCE_HAL_HAL_DIAG_H
/*=============================================================================
//
// hal_diag.h
//
// HAL Support for Kernel Diagnostic Routines
//
//=============================================================================
//####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
// Contributors: hmt
// Date: 1999-01-11
// Purpose: HAL Support for Kernel Diagnostic Routines
// Description: Diagnostic routines for use during kernel development.
// Usage: #include <cyg/hal/hal_diag.h>
//
//####DESCRIPTIONEND####
//
//===========================================================================*/
#include <pkgconf/hal.h>
#include <cyg/infra/cyg_type.h>
/*---------------------------------------------------------------------------*/
#define CYGHWR_HAL_SPARC_CPU_CT216X 0xa1000000
#define CYGHWR_HAL_SPARC_CPU_CT909 0xa0000000
#define CYGHWR_HAL_SPARC_CPU_CT909S 0xb0000000
#define CYGHWR_HAL_SPARC_CPU_CT909P 0x30000000
#define CYGHWR_HAL_SPARC_CPU_CT909G 0xd0000000
/*---------------------------------------------------------------------------*/
//#define CYG_DIAG_USE_LEON
/*---------------------------------------------------------------------------*/
#ifdef CYG_DIAG_USE_LEON
/*---------------------------------------------------------------------------*/
/* Register addresses */
#define SPARC_LEON_REG (0x80000000)
#define HAL_CT216_SYS_CONF ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x320))
#define HAL_CT216_SUBVERSION (0xff000000)
#define HAL_CT216X_GPIO_REG (0x80090000)
#define HAL_CT216X_UART_0_REG (0x800a0000)
/* These must be accessed word-wide to work! */
#define HAL_CT216_UART_IO( x ) ((cyg_uint32)(x))
#define HAL_CT216X_GPIO_C_MUX ((volatile cyg_uint32 *)(HAL_CT216X_GPIO_REG + 0x60))
#define HAL_CT216X_UART_0_THR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x00)) // w
#define HAL_CT216X_UART_0_RBR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x00)) // r
#define HAL_CT216X_UART_0_DLL ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x00)) // r/w
#define HAL_CT216X_UART_0_DLH ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x04)) // r/w
#define HAL_CT216X_UART_0_IER ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x04)) // r/w
#define HAL_CT216X_UART_0_FCR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x08)) // w
#define HAL_CT216X_UART_0_IIR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x08)) // r
#define HAL_CT216X_UART_0_LCR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x0c)) // r/w
#define HAL_CT216X_UART_0_MCR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x10)) // r/w
#define HAL_CT216X_UART_0_LSR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x14)) // r
#define HAL_CT216X_UART_0_MSR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x18)) // r
#define HAL_CT216X_UART_0_SCR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x1c)) // r/w
#define HAL_CT216X_UART_0_USR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0x7c)) // r
#define HAL_CT216X_UART_0_CPR ((volatile cyg_uint32 *)(HAL_CT216X_UART_0_REG + 0xf4)) // r
#define HAL_CT216X_UART_FIFO_EN (0x00000001)
#define HAL_CT216X_UART_DLS_5 (0x00000000)
#define HAL_CT216X_UART_DLS_6 (0x00000001)
#define HAL_CT216X_UART_DLS_7 (0x00000002)
#define HAL_CT216X_UART_DLS_8 (0x00000003)
#define HAL_CT216X_UART_DLAB (0x00000080)
#define HAL_CT216X_UART_DR (0x00000001)
#define HAL_CT216X_UART_OE (0x00000002)
#define HAL_CT216X_UART_PE (0x00000004)
#define HAL_CT216X_UART_FE (0x00000008)
#define HAL_CT216X_UART_BI (0x00000010)
#define HAL_CT216X_UART_THRE (0x00000020)
#define HAL_CT216X_UART_TEMT (0x00000040)
#define HAL_CT216X_UART_RFE (0x00000080)
#define HAL_CT216X_UART_BUSY (0x00000001)
#define HAL_CT216X_UART_TFNF (0x00000002)
#define HAL_CT216X_UART_TFE (0x00000004)
#define HAL_CT216X_UART_RFNE (0x00000008)
#define HAL_CT216X_UART_RFF (0x00000010)
#define HAL_LEON_UART_A_RX ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x70))
#define HAL_LEON_UART_A_TX ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x70))
#define HAL_LEON_UART_STATUS ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x74))
#define HAL_LEON_UART_CTRL ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x78))
#define HAL_LEON_UART_RLD ((volatile cyg_uint32 *)(SPARC_LEON_REG + 0x7c))
#define HAL_LEON_UART_RXAMASK (0x00001)
#define HAL_LEON_UART_TXAMASK (0x00004)
#define HAL_LEON_UART_RXEN (0x00000001)
#define HAL_LEON_UART_TXEN (0x00000002)
#define HAL_LEON_UART_PS (0x00000010)
#define HAL_LEON_UART_PE (0x00000020)
/*---------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -