Lines Matching +full:data +full:- +full:addr
1 // SPDX-License-Identifier: GPL-2.0
12 #include <asm/asm-extable.h>
32 u64 addr; member
41 struct zpci_err_insn_data data = { in zpci_err_insn_req() local
45 zpci_err_hex_level(lvl, &data, sizeof(data)); in zpci_err_insn_req()
49 u64 addr, u64 len) in zpci_err_insn_addr() argument
51 struct zpci_err_insn_data data = { in zpci_err_insn_addr() local
53 .addr = addr, .len = len}; in zpci_err_insn_addr()
55 zpci_err_hex_level(lvl, &data, sizeof(data)); in zpci_err_insn_addr()
99 static inline u8 __rpcit(u64 fn, u64 addr, u64 range, u8 *status) in __rpcit() argument
101 union register_pair addr_range = {.even = addr, .odd = range}; in __rpcit()
114 int zpci_refresh_trans(u64 fn, u64 addr, u64 range) in zpci_refresh_trans() argument
120 cc = __rpcit(fn, addr, range, &status); in zpci_refresh_trans()
124 zpci_err_insn_addr(1, 'R', cc, status, addr, range); in zpci_refresh_trans()
131 zpci_err_insn_addr(0, 'R', cc, status, addr, range); in zpci_refresh_trans()
133 zpci_err_insn_addr(1, 'R', cc, status, addr, range); in zpci_refresh_trans()
136 return -ENOMEM; in zpci_refresh_trans()
138 return (cc) ? -EIO : 0; in zpci_refresh_trans()
145 return -EIO; in zpci_set_irq_ctrl()
156 static inline int ____pcilg(u64 *data, u64 req, u64 offset, u8 *status) in ____pcilg() argument
164 " .insn rre,0xb9d20000,%[data],%[req_off]\n" in ____pcilg()
169 : CC_OUT(cc, cc), [data] "=d" (__data), in ____pcilg()
174 *data = __data; in ____pcilg()
175 return exception ? -ENXIO : CC_TRANSFORM(cc); in ____pcilg()
178 static inline int __pcilg(u64 *data, u64 req, u64 offset, u8 *status) in __pcilg() argument
185 *data = __data; in __pcilg()
190 int __zpci_load(u64 *data, u64 req, u64 offset) in __zpci_load() argument
197 cc = __pcilg(data, req, offset, &status); in __zpci_load()
212 return (cc > 0) ? -EIO : cc; in __zpci_load()
216 static inline int zpci_load_fh(u64 *data, const volatile void __iomem *addr, in zpci_load_fh() argument
219 struct zpci_iomap_entry *entry = &zpci_iomap_start[ZPCI_IDX(addr)]; in zpci_load_fh()
220 u64 req = ZPCI_CREATE_REQ(READ_ONCE(entry->fh), entry->bar, len); in zpci_load_fh()
222 return __zpci_load(data, req, ZPCI_OFFSET(addr)); in zpci_load_fh()
225 static inline int __pcilg_mio(u64 *data, u64 ioaddr, u64 len, u8 *status) in __pcilg_mio() argument
233 " .insn rre,0xb9d60000,%[data],%[ioaddr_len]\n" in __pcilg_mio()
238 : CC_OUT(cc, cc), [data] "=d" (__data), in __pcilg_mio()
243 *data = __data; in __pcilg_mio()
244 return exception ? -ENXIO : CC_TRANSFORM(cc); in __pcilg_mio()
247 int zpci_load(u64 *data, const volatile void __iomem *addr, unsigned long len) in zpci_load() argument
253 return zpci_load_fh(data, addr, len); in zpci_load()
255 cc = __pcilg_mio(data, (__force u64) addr, len, &status); in zpci_load()
257 zpci_err_insn_addr(0, 'L', cc, status, (__force u64) addr, len); in zpci_load()
259 return (cc > 0) ? -EIO : cc; in zpci_load()
264 static inline int __pcistg(u64 data, u64 req, u64 offset, u8 *status) in __pcistg() argument
271 " .insn rre,0xb9d00000,%[data],%[req_off]\n" in __pcistg()
277 : [data] "d" (data) in __pcistg()
280 return exception ? -ENXIO : CC_TRANSFORM(cc); in __pcistg()
283 int __zpci_store(u64 data, u64 req, u64 offset) in __zpci_store() argument
290 cc = __pcistg(data, req, offset, &status); in __zpci_store()
305 return (cc > 0) ? -EIO : cc; in __zpci_store()
309 static inline int zpci_store_fh(const volatile void __iomem *addr, u64 data, in zpci_store_fh() argument
312 struct zpci_iomap_entry *entry = &zpci_iomap_start[ZPCI_IDX(addr)]; in zpci_store_fh()
313 u64 req = ZPCI_CREATE_REQ(READ_ONCE(entry->fh), entry->bar, len); in zpci_store_fh()
315 return __zpci_store(data, req, ZPCI_OFFSET(addr)); in zpci_store_fh()
318 static inline int __pcistg_mio(u64 data, u64 ioaddr, u64 len, u8 *status) in __pcistg_mio() argument
325 " .insn rre,0xb9d40000,%[data],%[ioaddr_len]\n" in __pcistg_mio()
331 : [data] "d" (data) in __pcistg_mio()
334 return exception ? -ENXIO : CC_TRANSFORM(cc); in __pcistg_mio()
337 int zpci_store(const volatile void __iomem *addr, u64 data, unsigned long len) in zpci_store() argument
343 return zpci_store_fh(addr, data, len); in zpci_store()
345 cc = __pcistg_mio(data, (__force u64) addr, len, &status); in zpci_store()
347 zpci_err_insn_addr(0, 'S', cc, status, (__force u64) addr, len); in zpci_store()
349 return (cc > 0) ? -EIO : cc; in zpci_store()
354 static inline int __pcistb(const u64 *data, u64 req, u64 offset, u8 *status) in __pcistb() argument
360 " .insn rsy,0xeb00000000d0,%[req],%[offset],%[data]\n" in __pcistb()
366 : [offset] "d" (offset), [data] "Q" (*data) in __pcistb()
369 return exception ? -ENXIO : CC_TRANSFORM(cc); in __pcistb()
372 int __zpci_store_block(const u64 *data, u64 req, u64 offset) in __zpci_store_block() argument
379 cc = __pcistb(data, req, offset, &status); in __zpci_store_block()
394 return (cc > 0) ? -EIO : cc; in __zpci_store_block()
402 u64 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, len); in zpci_write_block_fh()
408 static inline int __pcistb_mio(const u64 *data, u64 ioaddr, u64 len, u8 *status) in __pcistb_mio() argument
414 " .insn rsy,0xeb00000000d4,%[len],%[ioaddr],%[data]\n" in __pcistb_mio()
420 : [ioaddr] "d" (ioaddr), [data] "Q" (*data) in __pcistb_mio()
423 return exception ? -ENXIO : CC_TRANSFORM(cc); in __pcistb_mio()
439 return (cc > 0) ? -EIO : cc; in zpci_write_block()