2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 #ifndef _SCIC_SDS_PORT_REGISTERS_H_
57 #define _SCIC_SDS_PORT_REGISTERS_H_
60 * This file contains a set of macros that assist in reading the SCU hardware
67 * scu_transport_layer_read() -
69 * Macro to read the transport layer register associated with this port object.
71 #define scu_transport_layer_read(port, reg) \
73 scic_sds_port_get_controller(port), \
74 (port)->transport_layer_registers->reg \
78 * scu_transport_layer_write() -
80 * Macro to write the transport layer register associated with this port object.
82 #define scu_transport_layer_write(port, reg, value) \
84 scic_sds_port_get_controller(port), \
85 (port)->transport_layer_registers->reg, \
90 * scu_port_task_scheduler_read() -
92 * Macro to read the port task scheduler register associated with this port
95 #define scu_port_task_scheduler_read(port, reg) \
97 scic_sds_port_get_controller(port), \
98 (port)->port_task_scheduler_registers->reg \
102 * scu_port_task_scheduler_write() -
104 * Macro to write the port task scheduler register associated with this port
107 #define scu_port_task_scheduler_write(port, reg, value) \
109 scic_sds_port_get_controller(port), \
110 (port)->port_task_scheduler_registers->reg, \
114 #define scu_port_viit_register_write(port, reg, value) \
116 scic_sds_port_get_controller(port), \
117 (port)->viit_registers->reg, \
122 * ****************************************************************************
123 * * Transport Layer registers controlled by the port object
124 * **************************************************************************** */
129 * This macro reads the Transport layer control register
131 #define SCU_TLCR_READ(port) \
132 scu_transport_layer_read(port, control)
137 * This macro writes the Transport layer control register
139 #define SCU_TLCR_WRITE(port, value) \
140 scu_transport_layer_write(port, control, value)
143 * SCU_TLADTR_READ() -
145 * This macro reads the Transport layer address translation register
147 #define SCU_TLADTR_READ(port) \
148 scu_transport_layer_read(port, address_translation)
151 * SCU_TLADTR_WRITE() -
153 * This macro writes the Transport layer address translation register
155 #define SCU_TLADTR_WRITE(port) \
156 scu_transport_layer_write(port, address_translation, value)
159 * SCU_STPTLDARNI_WRITE() -
161 * This macro writes the STP Transport Layer Direct Attached RNi register.
163 #define SCU_STPTLDARNI_WRITE(port, index) \
164 scu_transport_layer_write(port, stp_rni, index)
167 * SCU_STPTLDARNI_READ() -
169 * This macro reads the STP Transport Layer Direct Attached RNi register.
171 #define SCU_STPTLDARNI_READ(port) \
172 scu_transport_layer_read(port, stp_rni)
175 * ****************************************************************************
176 * * Port Task Scheduler registers controlled by the port object
177 * **************************************************************************** */
180 * SCU_PTSxCR_READ() -
182 * Macro to read the port task scheduler control register
184 #define SCU_PTSxCR_READ(port) \
185 scu_port_task_scheduler_read(port, control)
188 * SCU_PTSxCR_WRITE() -
190 * Macro to write the port task scheduler control regsister
192 #define SCU_PTSxCR_WRITE(port, value) \
193 scu_port_task_scheduler_write(port, control, value)
196 * ****************************************************************************
197 * * Port PE Configuration registers
198 * **************************************************************************** */
201 * SCU_PCSPExCR_WRITE() -
203 * Macro to write the PE Port Configuration Register
205 #define SCU_PCSPExCR_WRITE(port, phy_id, value) \
207 scic_sds_port_get_controller(port), \
208 (port)->port_pe_configuration_register[phy_id], \
213 * SCU_PCSPExCR_READ() -
215 * Macro to read the PE Port Configuration Regsiter
217 #define SCU_PCSPExCR_READ(port, phy_id) \
219 scic_sds_port_get_controller(port), \
220 (port)->port_pe_configuration_register[phy_id] \
223 #endif /* _SCIC_SDS_PORT_REGISTERS_H_ */