| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc. |
|---|
| 3 | 4 | * Copyright (C) 2004 Christoph Hellwig. |
|---|
| 4 | | - * Released under GPL v2. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * Support functions for the HUB ASIC - mostly PIO mapping related. |
|---|
| 7 | 7 | */ |
|---|
| .. | .. |
|---|
| 11 | 11 | #include <linux/mmzone.h> |
|---|
| 12 | 12 | #include <asm/sn/addrs.h> |
|---|
| 13 | 13 | #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> |
|---|
| 15 | 17 | |
|---|
| 16 | 18 | |
|---|
| 17 | 19 | static int force_fire_and_forget = 1; |
|---|
| .. | .. |
|---|
| 25 | 27 | * @size: size of the PIO mapping |
|---|
| 26 | 28 | * |
|---|
| 27 | 29 | **/ |
|---|
| 28 | | -unsigned long hub_pio_map(cnodeid_t cnode, xwidgetnum_t widget, |
|---|
| 30 | +unsigned long hub_pio_map(nasid_t nasid, xwidgetnum_t widget, |
|---|
| 29 | 31 | unsigned long xtalk_addr, size_t size) |
|---|
| 30 | 32 | { |
|---|
| 31 | | - nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); |
|---|
| 32 | 33 | unsigned i; |
|---|
| 33 | 34 | |
|---|
| 34 | 35 | /* use small-window mapping if possible */ |
|---|
| .. | .. |
|---|
| 44 | 45 | |
|---|
| 45 | 46 | xtalk_addr &= ~(BWIN_SIZE-1); |
|---|
| 46 | 47 | 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)) |
|---|
| 48 | 49 | continue; |
|---|
| 49 | 50 | |
|---|
| 50 | 51 | /* |
|---|
| .. | .. |
|---|
| 63 | 64 | * after we write it. |
|---|
| 64 | 65 | */ |
|---|
| 65 | 66 | 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)); |
|---|
| 67 | 68 | |
|---|
| 68 | 69 | return NODE_BWIN_BASE(nasid, widget) + (xtalk_addr % BWIN_SIZE); |
|---|
| 69 | 70 | } |
|---|
| .. | .. |
|---|
| 83 | 84 | */ |
|---|
| 84 | 85 | static void hub_setup_prb(nasid_t nasid, int prbnum, int credits) |
|---|
| 85 | 86 | { |
|---|
| 86 | | - iprb_t prb; |
|---|
| 87 | + union iprb_u prb; |
|---|
| 87 | 88 | int prb_offset; |
|---|
| 88 | 89 | |
|---|
| 89 | 90 | /* |
|---|
| .. | .. |
|---|
| 135 | 136 | **/ |
|---|
| 136 | 137 | static void hub_set_piomode(nasid_t nasid) |
|---|
| 137 | 138 | { |
|---|
| 138 | | - hubreg_t ii_iowa; |
|---|
| 139 | | - hubii_wcr_t ii_wcr; |
|---|
| 139 | + u64 ii_iowa; |
|---|
| 140 | + union hubii_wcr_u ii_wcr; |
|---|
| 140 | 141 | unsigned i; |
|---|
| 141 | 142 | |
|---|
| 142 | 143 | ii_iowa = REMOTE_HUB_L(nasid, IIO_OUTWIDGET_ACCESS); |
|---|
| .. | .. |
|---|
| 171 | 172 | * |
|---|
| 172 | 173 | * @hub: hubinfo structure for our hub |
|---|
| 173 | 174 | */ |
|---|
| 174 | | -void hub_pio_init(cnodeid_t cnode) |
|---|
| 175 | +void hub_pio_init(nasid_t nasid) |
|---|
| 175 | 176 | { |
|---|
| 176 | | - nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); |
|---|
| 177 | 177 | unsigned i; |
|---|
| 178 | 178 | |
|---|
| 179 | 179 | /* 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); |
|---|
| 181 | 181 | for (i = 0; i < HUB_NUM_BIG_WINDOW; i++) |
|---|
| 182 | 182 | IIO_ITTE_DISABLE(nasid, i); |
|---|
| 183 | 183 | |
|---|