1 /* SPDX-License-Identifier: GPL-2.0+ */
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
17 * struct axi_ops - driver operations for AXI uclass
19 * Drivers should support these operations unless otherwise noted. These
20 * operations are intended to be used by uclass code, not directly from
25 * read() - Read a single value from a specified address on a AXI bus
27 * @dev: AXI bus to read from.
28 * @address: The address to read from.
29 * @data: Pointer to a variable that takes the data value read
30 * from the address on the AXI bus.
31 * @size: The size of the data to be read.
32 * @return 0 if OK, -ve on error.
34 int (*read)(struct udevice *dev, ulong address, void *data,
35 enum axi_size_t size);
38 * write() - Write a single value to a specified address on a AXI bus
40 * @dev: AXI bus to write to.
41 * @address: The address to write to.
42 * @data: Pointer to the data value to be written to the address
44 * @size: The size of the data to write.
45 * @return 0 if OK, -ve on error.
47 int (*write)(struct udevice *dev, ulong address, void *data,
48 enum axi_size_t size);
51 #define axi_get_ops(dev) ((struct axi_ops *)(dev)->driver->ops)
54 * axi_read() - Read a single value from a specified address on a AXI bus
56 * @dev: AXI bus to read from.
57 * @address: The address to read from.
58 * @data: Pointer to a variable that takes the data value read from the
59 * address on the AXI bus.
60 * @size: The size of the data to write.
61 * @return 0 if OK, -ve on error.
63 int axi_read(struct udevice *dev, ulong address, void *data,
64 enum axi_size_t size);
67 * axi_write() - Write a single value to a specified address on a AXI bus
69 * @dev: AXI bus to write to.
70 * @address: The address to write to.
71 * @data: Pointer to the data value to be written to the address on the
73 * @size: The size of the data to write.
74 * @return 0 if OK, -ve on error.
76 int axi_write(struct udevice *dev, ulong address, void *data,
77 enum axi_size_t size);