Lines Matching +full:data +full:- +full:addr
1 // SPDX-License-Identifier: GPL-2.0
27 } __packed data = {req, offset, cc, status}; in zpci_err_insn() local
29 zpci_err_hex(&data, sizeof(data)); in zpci_err_insn()
64 static inline u8 __rpcit(u64 fn, u64 addr, u64 range, u8 *status) in __rpcit() argument
66 register u64 __addr asm("2") = addr; in __rpcit()
71 " .insn rre,0xb9d30000,%[fn],%[addr]\n" in __rpcit()
75 : [addr] "d" (__addr), "d" (__range) in __rpcit()
81 int zpci_refresh_trans(u64 fn, u64 addr, u64 range) in zpci_refresh_trans() argument
86 cc = __rpcit(fn, addr, range, &status); in zpci_refresh_trans()
92 zpci_err_insn(cc, status, addr, range); in zpci_refresh_trans()
95 return -ENOMEM; in zpci_refresh_trans()
97 return (cc) ? -EIO : 0; in zpci_refresh_trans()
104 return -EIO; in __zpci_set_irq_ctrl()
114 static inline int ____pcilg(u64 *data, u64 req, u64 offset, u8 *status) in ____pcilg() argument
118 int cc = -ENXIO; in ____pcilg()
122 " .insn rre,0xb9d20000,%[data],%[req]\n" in ____pcilg()
127 : [cc] "+d" (cc), [data] "=d" (__data), [req] "+d" (__req) in ____pcilg()
131 *data = __data; in ____pcilg()
135 static inline int __pcilg(u64 *data, u64 req, u64 offset, u8 *status) in __pcilg() argument
142 *data = __data; in __pcilg()
147 int __zpci_load(u64 *data, u64 req, u64 offset) in __zpci_load() argument
153 cc = __pcilg(data, req, offset, &status); in __zpci_load()
161 return (cc > 0) ? -EIO : cc; in __zpci_load()
165 static inline int zpci_load_fh(u64 *data, const volatile void __iomem *addr, in zpci_load_fh() argument
168 struct zpci_iomap_entry *entry = &zpci_iomap_start[ZPCI_IDX(addr)]; in zpci_load_fh()
169 u64 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, len); in zpci_load_fh()
171 return __zpci_load(data, req, ZPCI_OFFSET(addr)); in zpci_load_fh()
174 static inline int __pcilg_mio(u64 *data, u64 ioaddr, u64 len, u8 *status) in __pcilg_mio() argument
176 register u64 addr asm("2") = ioaddr; in __pcilg_mio()
178 int cc = -ENXIO; in __pcilg_mio()
182 " .insn rre,0xb9d60000,%[data],%[ioaddr]\n" in __pcilg_mio()
187 : [cc] "+d" (cc), [data] "=d" (__data), "+d" (r3) in __pcilg_mio()
188 : [ioaddr] "d" (addr) in __pcilg_mio()
191 *data = __data; in __pcilg_mio()
195 int zpci_load(u64 *data, const volatile void __iomem *addr, unsigned long len) in zpci_load() argument
201 return zpci_load_fh(data, addr, len); in zpci_load()
203 cc = __pcilg_mio(data, (__force u64) addr, len, &status); in zpci_load()
205 zpci_err_insn(cc, status, 0, (__force u64) addr); in zpci_load()
207 return (cc > 0) ? -EIO : cc; in zpci_load()
212 static inline int __pcistg(u64 data, u64 req, u64 offset, u8 *status) in __pcistg() argument
216 int cc = -ENXIO; in __pcistg()
219 " .insn rre,0xb9d00000,%[data],%[req]\n" in __pcistg()
225 : "d" (__offset), [data] "d" (data) in __pcistg()
231 int __zpci_store(u64 data, u64 req, u64 offset) in __zpci_store() argument
237 cc = __pcistg(data, req, offset, &status); in __zpci_store()
245 return (cc > 0) ? -EIO : cc; in __zpci_store()
249 static inline int zpci_store_fh(const volatile void __iomem *addr, u64 data, in zpci_store_fh() argument
252 struct zpci_iomap_entry *entry = &zpci_iomap_start[ZPCI_IDX(addr)]; in zpci_store_fh()
253 u64 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, len); in zpci_store_fh()
255 return __zpci_store(data, req, ZPCI_OFFSET(addr)); in zpci_store_fh()
258 static inline int __pcistg_mio(u64 data, u64 ioaddr, u64 len, u8 *status) in __pcistg_mio() argument
260 register u64 addr asm("2") = ioaddr; in __pcistg_mio()
262 int cc = -ENXIO; in __pcistg_mio()
265 " .insn rre,0xb9d40000,%[data],%[ioaddr]\n" in __pcistg_mio()
271 : [data] "d" (data), [ioaddr] "d" (addr) in __pcistg_mio()
277 int zpci_store(const volatile void __iomem *addr, u64 data, unsigned long len) in zpci_store() argument
283 return zpci_store_fh(addr, data, len); in zpci_store()
285 cc = __pcistg_mio(data, (__force u64) addr, len, &status); in zpci_store()
287 zpci_err_insn(cc, status, 0, (__force u64) addr); in zpci_store()
289 return (cc > 0) ? -EIO : cc; in zpci_store()
294 static inline int __pcistb(const u64 *data, u64 req, u64 offset, u8 *status) in __pcistb() argument
296 int cc = -ENXIO; in __pcistb()
299 " .insn rsy,0xeb00000000d0,%[req],%[offset],%[data]\n" in __pcistb()
305 : [offset] "d" (offset), [data] "Q" (*data) in __pcistb()
311 int __zpci_store_block(const u64 *data, u64 req, u64 offset) in __zpci_store_block() argument
317 cc = __pcistb(data, req, offset, &status); in __zpci_store_block()
325 return (cc > 0) ? -EIO : cc; in __zpci_store_block()
333 u64 req = ZPCI_CREATE_REQ(entry->fh, entry->bar, len); in zpci_write_block_fh()
339 static inline int __pcistb_mio(const u64 *data, u64 ioaddr, u64 len, u8 *status) in __pcistb_mio() argument
341 int cc = -ENXIO; in __pcistb_mio()
344 " .insn rsy,0xeb00000000d4,%[len],%[ioaddr],%[data]\n" in __pcistb_mio()
350 : [ioaddr] "d" (ioaddr), [data] "Q" (*data) in __pcistb_mio()
369 return (cc > 0) ? -EIO : cc; in zpci_write_block()