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

📄 rheabridge.h

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 H
📖 第 1 页 / 共 2 页
字号:
/*
===============================================================================
//            TEXAS INSTRUMENTS INCORPORATED PROPRIETARY INFORMATION           
//                                                                             
//   Property of Texas Instruments 
//   For  Unrestricted  Internal  Use  Only 
//   Unauthorized reproduction and/or distribution is strictly prohibited.  
//   This product is protected under copyright law and trade secret law 
//   as an unpublished work.  
//   Created 1999, (C) Copyright 1999 Texas Instruments.  All rights reserved.
//
//   Filename       	: Rhea_Bridge.h
//
//   Description    	: Header file for the rhea bridge module
//
//   Project        	: ARM925ST
//
//   Author         	: Francis Huguenin  fhugueni@tif.ti.com
//
===============================================================================
*/
#ifndef _RHEA_BRIDGE_HH
#define _RHEA_BRIDGE_HH
 
#include "top.h"
#define RHEA_ADDR_MASK	0x0000FFFF  /* Mask address to extract 16 LSB */

/*
-----------------------------------------------------------------------------
   ASSEMBLER EXTERNAL FUNCTIONS 
 NAME        : INT_SetSupervisor, INT_SetUser
 DESCRIPTION : Set respectively to Supervisor mode and to User Mode
 PARAMETERS  : None
 RETURN VALUE: None
 LIMITATIONS : Call INT_SetSupervisor before setting the control registers
               since the Write access to all registers can only be done in
               supervisor mode
               Call INT_SetUser once the setting of control registers is done
               to goback the the normall mode i.e. user
-----------------------------------------------------------------------------
*/


typedef enum 
{
  RHEA_STROBE0_CHIP_SELECT_0  = 0,
  RHEA_STROBE0_CHIP_SELECT_1  = 1,
  RHEA_STROBE0_CHIP_SELECT_2  = 2,
  RHEA_STROBE0_CHIP_SELECT_3  = 3,
  RHEA_STROBE0_CHIP_SELECT_4  = 4,
  RHEA_STROBE0_CHIP_SELECT_5  = 5,
  RHEA_STROBE0_CHIP_SELECT_6  = 6,
  RHEA_STROBE0_CHIP_SELECT_7  = 7,
  RHEA_STROBE0_CHIP_SELECT_8  = 8,
  RHEA_STROBE0_CHIP_SELECT_9  = 9,
  RHEA_STROBE0_CHIP_SELECT_10 = 10,
  RHEA_STROBE0_CHIP_SELECT_11 = 11,
  RHEA_STROBE0_CHIP_SELECT_12 = 12,
  RHEA_STROBE0_CHIP_SELECT_13 = 13,
  RHEA_STROBE0_CHIP_SELECT_14 = 14,
  RHEA_STROBE0_CHIP_SELECT_15 = 15,
  RHEA_STROBE0_CHIP_SELECT_16 = 16,
  RHEA_STROBE0_CHIP_SELECT_17 = 17,
  RHEA_STROBE0_CHIP_SELECT_18 = 18,
  RHEA_STROBE0_CHIP_SELECT_19 = 19,
  RHEA_STROBE0_CHIP_SELECT_20 = 20,
  RHEA_STROBE0_CHIP_SELECT_21 = 21,
  RHEA_STROBE0_CHIP_SELECT_22 = 22,
  RHEA_STROBE0_CHIP_SELECT_23 = 23,
  RHEA_STROBE0_CHIP_SELECT_24 = 24,
  RHEA_STROBE0_CHIP_SELECT_25 = 25,
  RHEA_STROBE0_CHIP_SELECT_26 = 26,
  RHEA_STROBE0_CHIP_SELECT_27 = 27
} RHEA_Strobe0ChipSelect_t;


typedef enum 
{
  RHEA_STROBE1_CHIP_SELECT_0  = 0,
  RHEA_STROBE1_CHIP_SELECT_1  = 1,
  RHEA_STROBE1_CHIP_SELECT_2  = 2,
  RHEA_STROBE1_CHIP_SELECT_3  = 3,
  RHEA_STROBE1_CHIP_SELECT_4  = 4,
  RHEA_STROBE1_CHIP_SELECT_5  = 5,
  RHEA_STROBE1_CHIP_SELECT_6  = 6,
  RHEA_STROBE1_CHIP_SELECT_7  = 7,
  RHEA_STROBE1_CHIP_SELECT_8  = 8,
  RHEA_STROBE1_CHIP_SELECT_9  = 9,
  RHEA_STROBE1_CHIP_SELECT_10 = 10,
  RHEA_STROBE1_CHIP_SELECT_11 = 11,
  RHEA_STROBE1_CHIP_SELECT_12 = 12,
  RHEA_STROBE1_CHIP_SELECT_13 = 13,
  RHEA_STROBE1_CHIP_SELECT_14 = 14,
  RHEA_STROBE1_CHIP_SELECT_15 = 15,
  RHEA_STROBE1_CHIP_SELECT_16 = 16,
  RHEA_STROBE1_CHIP_SELECT_17 = 17,
  RHEA_STROBE1_CHIP_SELECT_18 = 18,
  RHEA_STROBE1_CHIP_SELECT_19 = 19,
  RHEA_STROBE1_CHIP_SELECT_20 = 20,
  RHEA_STROBE1_CHIP_SELECT_21 = 21,
  RHEA_STROBE1_CHIP_SELECT_22 = 22,
  RHEA_STROBE1_CHIP_SELECT_23 = 23,
  RHEA_STROBE1_CHIP_SELECT_24 = 24,
  RHEA_STROBE1_CHIP_SELECT_25 = 25,
  RHEA_STROBE1_CHIP_SELECT_26 = 26,
  RHEA_STROBE1_CHIP_SELECT_27 = 27,
  RHEA_STROBE1_CHIP_SELECT_28 = 28,
  RHEA_STROBE1_CHIP_SELECT_29 = 29,
  RHEA_STROBE1_CHIP_SELECT_30 = 30,
  RHEA_STROBE1_CHIP_SELECT_31 = 31
} RHEA_Strobe1ChipSelect_t;


/*
--------------------------------------------------------------------------------
  AccessFactor_t                                                               -
                                                                               -
  The programmable access factor attach to the fast and slow strobe 0 and 1    -
  is adjusted according to the peripheral speed which allows slow as faster    -
  peripheral to answer on the rhea bus                                         -
    value 0 => the strobe is just a copy of the bridge clock                   -
          n => the strobe lasts 2*n clock cycles                               -
--------------------------------------------------------------------------------
*/
typedef  enum 
{
  RHEA_FACTOR0_STROBE =0x0, RHEA_FACTOR1_STROBE =0x1, 
  RHEA_FACTOR2_STROBE =0x2, RHEA_FACTOR3_STROBE =0x3,
  RHEA_FACTOR4_STROBE =0x4, RHEA_FACTOR5_STROBE =0x5, 
  RHEA_FACTOR6_STROBE =0x6, RHEA_FACTOR7_STROBE =0x7,
  RHEA_FACTOR8_STROBE =0x8, RHEA_FACTOR9_STROBE =0x9, 
  RHEA_FACTOR10_STROBE=0xA, RHEA_FACTOR11_STROBE=0xB,
  RHEA_FACTOR12_STROBE=0xC, RHEA_FACTOR13_STROBE=0xD, 
  RHEA_FACTOR14_STROBE=0xE, RHEA_FACTOR15_STROBE=0xF
} RHEA_AccessFactorStrobe_t;



/*
--------------------------------------------------------------------------------
 NAME        : RHEA_GetStrobe0CsAddress                                        -
               RHEA_GetStrobe1CsAddress                                        -
 DESCRIPTION : Get the address of the Chip Select for the strobe 0 and 1       -
 PARAMETERS  : ChipSelect                                                      -
 RETURN VALUE: Address                                                         -
 LIMITATIONS : None                                                            -
--------------------------------------------------------------------------------
*/
/*
UWORD32 RHEA_GetStrobe0CsAddress(RHEA_Strobe0ChipSelect_t ChipSelect);
UWORD32 RHEA_GetStrobe1CsAddress(RHEA_Strobe1ChipSelect_t ChipSelect);
*/
/*
--------------------------------------------------------------------------------
 NAME        : RHEA_InitCtrolReg                                               -
 DESCRIPTION : Set the access factors and the timeout into control register    -
 PARAMETERS  :                                                                 -
   -Division Factor to allow access slow peripheral                            -
    by reducing access frequency => value 0 the strobe lasts 1 clock cycle     -
                                     value n the strobe lasts 2*n clock cycles -
       FactorStrobe0: Division Factor of Fast strobe                           -
       FactorStrobe1: Division Factor of Slow strobe                           -
   -TimeOutValue: Maximum time a peripheral can stall the processor expressed  -
                  in a number of bridge_clock in the range 0..256 for a bridge -
                  clock of 50Mhz, a bridge clock last 0,02us which gives a     -
                  maximum timeout of 5.12 us                                   -
 RETURN VALUE: None                                                            -
 LIMITATIONS : Supervisor mode only                                            -
--------------------------------------------------------------------------------
*/ 
void RHEA_InitCtrolReg(const RHEA_AccessFactorStrobe_t FactorStrobe0, 
                       const RHEA_AccessFactorStrobe_t FactorStrobe1, 
                       const UWORD8                       TimeOutValue);

/*
--------------------------------------------------------------------------------
 NAME        : RHEA_SetTimeOut                                                 -
 DESCRIPTION : Set the timeout into control register                           -
 PARAMETERS  :                                                                 -
   -TimeOutValue: Maximum time a peripheral can stall the processor expressed  -
                  in a number of bridge_clock in the range 0..256 for a bridge -
                  clock of 50Mhz, a bridge clock last 0,02us which gives a     -
                  maximum timeout of 5.12 us                                   -
 RETURN VALUE: None                                                            -
 LIMITATIONS : Supervisor mode only                                            -
--------------------------------------------------------------------------------
*/ 
void RHEA_SetTimeOut(const UWORD8 TimeOutValue);


/*
----------------------------------------------------------------------
 NAME        : RHEA_ReadCtrolReg                                     -
 DESCRIPTION : Get access factors and timeout from control register  -
 PARAMETERS  :                                                       -
   FactorStrobe0: Division Factor of Fast strobe                     -
   FactorStrobe1: Division Factor of Slow strobe                     -
   TimeOut      : Maximum time a peripheral can stall the processor  -
                  expressed in a number of bridge_clock range 0..256 -
                  For a bridge clock of 50Mhz, a bridge clock lasts  -
                  0,02us which gives a maximum timeout of 5.12 us    -
 RETURN VALUE: None                                                  -
 LIMITATIONS : None                                                  -
----------------------------------------------------------------------
*/ 
void RHEA_ReadCtrolReg(RHEA_AccessFactorStrobe_t *const FactorStrobe0, 
                       RHEA_AccessFactorStrobe_t *const FactorStrobe1, 
                       UWORD8                       *const TimeOut);




/*
----------------------------------------------------------------------------
 NAME        : RHEA_SetPostedWrite                                         -
 DESCRIPTION : Init ARM Rhea control register to enable or not buffering   -
               (i.e. ARM posted-write) for the fast and slow strobes       -
               To enable Posted_Write ARM memory interface ,               -
               i.e make the Rhea Bridge buffering the data sent by the ARM -
               Notification only when abort                                -
                                                                           -
 PARAMETERS  :                                                             -
   EnableWriteBufferStrobe0, EnableWriteBufferStrobe1:                     -
     Specify for each strobe fast and slow whether buffering is enabled    -
     or not to allow ARM post-writed                                       -
 RETURN VALUE: None                                                        -
 LIMITATIONS : Supervisor mode only                                        -
----------------------------------------------------------------------------
*/ 
typedef enum { RHEA_DISABLE_WRITE_BUFFER_STROBE0 = 0, 
               RHEA_ENABLE_WRITE_BUFFER_STROBE0  = 1} WriteBufferStrobe0_t;
typedef enum { RHEA_DISABLE_WRITE_BUFFER_STROBE1 = 0, 
               RHEA_ENABLE_WRITE_BUFFER_STROBE1  = 1} WriteBufferStrobe1_t;
void RHEA_SetPostedWrite(const WriteBufferStrobe0_t WriteBufferStrobe0, 
                         const WriteBufferStrobe1_t WriteBufferStrobe1);


/*
---------------------------------------------------------------------------
 NAME        : RHEA_ReadArmRheaCtrolReg                                   -
 DESCRIPTION : Get from Arm Rhea ctrol register Write Enable for 2 strobes-
                                                                          -
 PARAMETERS  : WriteBufferStrobe0,WriteBufferStrobe11                     -
                 Specify for each strobe fast and slow whether buffering  -
                 is enabled or not to allow ARM post-writed               -
 RETURN VALUE: None                                                       -
 LIMITATIONS : None                                                       -
---------------------------------------------------------------------------
*/ 
void RHEA_ReadArmRheaCtrolReg(WriteBufferStrobe0_t *const WriteBufferStrobe0, 
                              WriteBufferStrobe1_t *const WriteBufferStrobe1);





/*
---------------------------------------------------------------------------
 NAME        : RHEA_InitBusAllocReg                                       -
 DESCRIPTION : Init Rhea Bus Alloc register                               -
               1) to define the Rhea bus priority between ARM and DMA     -
               2) to enable or not the rhea priority feature              -
                                                                          -
 PARAMETERS  :                                                            -
   RheaPriority: define the priority value                                -
     0        = ARM has priority                                          -
     n [1..7] = DMA ctroller has priority for max n consecutive accesses  -
                                                                          -
    RheaPriorityToggle: Enable the rhea priority                          -
      0 => RheaPriority bits used by the rhea bus allocation              -
      1 => In exception mode (IRQ and FIQ) ARM and DMA have same priority -
                                                                          -
 RETURN VALUE: None                                                       -

⌨️ 快捷键说明

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