forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/arch/mips/sgi-ip27/ip27-hubio.c
....@@ -1,7 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc.
34 * Copyright (C) 2004 Christoph Hellwig.
4
- * Released under GPL v2.
55 *
66 * Support functions for the HUB ASIC - mostly PIO mapping related.
77 */
....@@ -11,7 +11,9 @@
1111 #include <linux/mmzone.h>
1212 #include <asm/sn/addrs.h>
1313 #include <asm/sn/arch.h>
14
-#include <asm/sn/hub.h>
14
+#include <asm/sn/agent.h>
15
+#include <asm/sn/io.h>
16
+#include <asm/xtalk/xtalk.h>
1517
1618
1719 static int force_fire_and_forget = 1;
....@@ -25,10 +27,9 @@
2527 * @size: size of the PIO mapping
2628 *
2729 **/
28
-unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget,
30
+unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget,
2931 unsigned long xtalk_addr, size_t size)
3032 {
31
- nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
3233 unsigned i;
3334
3435 /* use small-window mapping if possible */
....@@ -44,7 +45,7 @@
4445
4546 xtalk_addr &= ~(BWIN_SIZE-1);
4647 for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) {
47
- if (test_and_set_bit(i, hub_data(cnode)->h_bigwin_used))
48
+ if (test_and_set_bit(i, hub_data(nasid)->h_bigwin_used))
4849 continue;
4950
5051 /*
....@@ -63,7 +64,7 @@
6364 * after we write it.
6465 */
6566 IIO_ITTE_PUT(nasid, i, HUB_PIO_MAP_TO_MEM, widget, xtalk_addr);
66
- (void) HUB_L(IIO_ITTE_GET(nasid, i));
67
+ __raw_readq(IIO_ITTE_GET(nasid, i));
6768
6869 return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE);
6970 }
....@@ -83,7 +84,7 @@
8384 */
8485 static void hub_setup_prb(nasid_t nasid, int prbnum, int credits)
8586 {
86
- iprb_t prb;
87
+ union iprb_u prb;
8788 int prb_offset;
8889
8990 /*
....@@ -135,8 +136,8 @@
135136 **/
136137 static void hub_set_piomode(nasid_t nasid)
137138 {
138
- hubreg_t ii_iowa;
139
- hubii_wcr_t ii_wcr;
139
+ u64 ii_iowa;
140
+ union hubii_wcr_u ii_wcr;
140141 unsigned i;
141142
142143 ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS);
....@@ -171,13 +172,12 @@
171172 *
172173 * @hub: hubinfo structure for our hub
173174 */
174
-void hub_pio_init(cnodeid_t cnode)
175
+void hub_pio_init(nasid_t nasid)
175176 {
176
- nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode);
177177 unsigned i;
178178
179179 /* initialize big window piomaps for this hub */
180
- bitmap_zero(hub_data(cnode)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
180
+ bitmap_zero(hub_data(nasid)->h_bigwin_used, HUB_NUM_BIG_WINDOW);
181181 for (i = 0; i < HUB_NUM_BIG_WINDOW; i++)
182182 IIO_ITTE_DISABLE(nasid, i);
183183