1/*- 2 * Copyright (c) 2003-2009 RMI Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * RMI_BSD |
30 * $FreeBSD: head/sys/mips/rmi/msgring.h 213377 2010-10-03 04:33:58Z jchandra $ |
31 */ 32#ifndef _RMI_MSGRING_H_ 33#define _RMI_MSGRING_H_ 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/types.h> 38 --- 127 unchanged lines hidden (view full) --- 166#define MSGRNG_STNID_PCIE_3 119 167#define MSGRNG_STNID_XLS_PK0 121 168 169#define MSGRNG_CODE_MAC 0 170#define MSGRNG_CODE_XGMAC 2 171#define MSGRNG_CODE_SEC 0 172#define MSGRNG_CODE_BOOT_WAKEUP 200 173#define MSGRNG_CODE_SPI4 3 |
174 |
175#define msgrng_read_status() read_c2_register32(MSGRNG_MSG_STATUS_REG, 0) |
176#define msgrng_read_config() read_c2_register32(MSGRNG_MSG_CONFIG_REG, 0) 177#define msgrng_write_config(v) write_c2_register32(MSGRNG_MSG_CONFIG_REG, 0, v) |
178#define msgrng_read_bucksize(b) read_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b) 179#define msgrng_write_bucksize(b, v) write_c2_register32(MSGRNG_MSG_BUCKSIZE_REG, b, v) |
180#define msgrng_read_cc(r, s) read_c2_register32(r, s) 181#define msgrng_write_cc(r, v, s) write_c2_register32(r, s, v) 182 183#define msgrng_load_rx_msg0() read_c2_register64(MSGRNG_RX_BUF_REG, 0) 184#define msgrng_load_rx_msg1() read_c2_register64(MSGRNG_RX_BUF_REG, 1) 185#define msgrng_load_rx_msg2() read_c2_register64(MSGRNG_RX_BUF_REG, 2) 186#define msgrng_load_rx_msg3() read_c2_register64(MSGRNG_RX_BUF_REG, 3) 187 --- 126 unchanged lines hidden (view full) --- 314 *stid = (status & 0x7f0000) >> 16; 315 msg->msg0 = msgrng_load_rx_msg0(); 316 msg->msg1 = msgrng_load_rx_msg1(); 317 msg->msg2 = msgrng_load_rx_msg2(); 318 msg->msg3 = msgrng_load_rx_msg3(); 319 return (0); 320} 321 |
322#define MSGRNG_STN_RX_QSIZE 256 323#define MSGRNG_NSTATIONS 128 324#define MSGRNG_CORE_NBUCKETS 8 |
325 326struct stn_cc { 327 unsigned short counters[16][8]; 328}; 329 330struct bucket_size { |
331 unsigned short bucket[MSGRNG_NSTATIONS]; |
332}; 333 334extern struct bucket_size bucket_sizes; 335 336extern struct stn_cc cc_table_cpu_0; 337extern struct stn_cc cc_table_cpu_1; 338extern struct stn_cc cc_table_cpu_2; 339extern struct stn_cc cc_table_cpu_3; --- 15 unchanged lines hidden (view full) --- 355extern struct stn_cc xls_cc_table_cpu_3; 356extern struct stn_cc xls_cc_table_gmac0; 357extern struct stn_cc xls_cc_table_gmac1; 358extern struct stn_cc xls_cc_table_cmp; 359extern struct stn_cc xls_cc_table_pcie; 360extern struct stn_cc xls_cc_table_dma; 361extern struct stn_cc xls_cc_table_sec; 362 |
363typedef void (*msgring_handler)(int, int, int, int, struct msgrng_msg *, void *); 364int register_msgring_handler(int startb, int endb, msgring_handler action, 365 void *arg); |
366uint32_t xlr_msgring_handler(uint8_t bucket_mask, uint32_t max_messages); 367void xlr_msgring_cpu_init(void); 368void xlr_msgring_config(void); 369 370#endif |