| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: breg_virt.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/1 $ |
|---|
| 12 | * $brcm_Date: 5/21/04 8:54p $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/basemodules/reg/breg_virt.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/1 5/21/04 8:54p vsilyaev |
|---|
| 21 | * PR 11175: Merged into the integration branch |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/BCM7411/2 5/17/04 6:55p vsilyaev |
|---|
| 24 | * Fixed #if/#endif order |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/BCM7411/1 5/14/04 7:16p vsilyaev |
|---|
| 27 | * Virtual register interface, supports all possible buses. |
|---|
| 28 | * |
|---|
| 29 | ***************************************************************************/ |
|---|
| 30 | |
|---|
| 31 | /*= Module Overview ******************************************************** |
|---|
| 32 | This module supplies the function required to access any type of registers. |
|---|
| 33 | Before any registers can be accessed an appropriate register handle should |
|---|
| 34 | be created (normally done at system init time). This register handle is |
|---|
| 35 | then given to any modules that require access to the corresponding set of registers. |
|---|
| 36 | ***************************************************************************/ |
|---|
| 37 | |
|---|
| 38 | #ifndef BREG_VIRT_H |
|---|
| 39 | #define BREG_VIRT_H |
|---|
| 40 | |
|---|
| 41 | #ifdef __cplusplus |
|---|
| 42 | extern "C" { |
|---|
| 43 | #endif |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | /* |
|---|
| 47 | Summary: |
|---|
| 48 | This is an opaque handle that is used for memory mapped register functions. |
|---|
| 49 | */ |
|---|
| 50 | typedef struct BREG_Virt_Impl *BREG_Virt_Handle; |
|---|
| 51 | |
|---|
| 52 | /* |
|---|
| 53 | Summary: |
|---|
| 54 | This function writes 32 bits to a register. |
|---|
| 55 | |
|---|
| 56 | Description: |
|---|
| 57 | Although this fuction will never return an error it will assert if the |
|---|
| 58 | RegHandle is invalid. |
|---|
| 59 | */ |
|---|
| 60 | void BREG_Virt_Write32( |
|---|
| 61 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 62 | uint32_t reg, /* Register offset to write */ |
|---|
| 63 | uint32_t data /* Data value to write to register */ |
|---|
| 64 | ); |
|---|
| 65 | |
|---|
| 66 | /* |
|---|
| 67 | Summary: |
|---|
| 68 | This function writes 16 bits to a register. |
|---|
| 69 | |
|---|
| 70 | Description: |
|---|
| 71 | Although this fuction will never return an error it will assert if the |
|---|
| 72 | RegHandle is invalid |
|---|
| 73 | */ |
|---|
| 74 | void BREG_Virt_Write16( |
|---|
| 75 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 76 | uint32_t reg, /* Register offset to write */ |
|---|
| 77 | uint16_t data /* Data value to write to register */ |
|---|
| 78 | ); |
|---|
| 79 | |
|---|
| 80 | /* |
|---|
| 81 | Summary: |
|---|
| 82 | This function writes 8 bits to a register. |
|---|
| 83 | |
|---|
| 84 | Description: |
|---|
| 85 | Although this fuction will never return an error it will assert if the |
|---|
| 86 | RegHandle is invalid. |
|---|
| 87 | */ |
|---|
| 88 | void BREG_Virt_Write8( |
|---|
| 89 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 90 | uint32_t reg, /* Register offset to write */ |
|---|
| 91 | uint8_t data /* Data value to write to register */ |
|---|
| 92 | ); |
|---|
| 93 | |
|---|
| 94 | /* |
|---|
| 95 | Summary: |
|---|
| 96 | This function reads 32 bits from a register. |
|---|
| 97 | |
|---|
| 98 | Description: |
|---|
| 99 | Although this fuction cannot return an error it will assert if the |
|---|
| 100 | RegHandle is invalid. |
|---|
| 101 | */ |
|---|
| 102 | uint32_t BREG_Virt_Read32( |
|---|
| 103 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 104 | uint32_t reg /* Register offset to read */ |
|---|
| 105 | ); |
|---|
| 106 | |
|---|
| 107 | /* |
|---|
| 108 | Summary: |
|---|
| 109 | This function reads 16 bits from a register. |
|---|
| 110 | |
|---|
| 111 | Description: |
|---|
| 112 | Although this fuction cannot return an error it will assert if the |
|---|
| 113 | RegHandle is invalid. |
|---|
| 114 | */ |
|---|
| 115 | uint16_t BREG_Virt_Read16( |
|---|
| 116 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 117 | uint16_t reg /* Register offset to read */ |
|---|
| 118 | ); |
|---|
| 119 | |
|---|
| 120 | /* |
|---|
| 121 | Summary: |
|---|
| 122 | This function reads 8 bits from a register. |
|---|
| 123 | |
|---|
| 124 | Description: |
|---|
| 125 | Although this fuction cannot return an error it will assert if the |
|---|
| 126 | RegHandle is invalid. |
|---|
| 127 | */ |
|---|
| 128 | uint8_t BREG_Virt_Read8( |
|---|
| 129 | BREG_Virt_Handle RegHandle, /* Register handle created by BREG_CreateRegHandle() */ |
|---|
| 130 | uint8_t reg /* Register offset to read */ |
|---|
| 131 | ); |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | #ifdef __cplusplus |
|---|
| 135 | } |
|---|
| 136 | #endif |
|---|
| 137 | |
|---|
| 138 | #endif |
|---|
| 139 | /* End of File */ |
|---|