1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2017, 2018
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
13 * enum axi_size_t - Determine size of AXI transfer
14 * @AXI_SIZE_8: AXI sransfer is 8-bit wide
15 * @AXI_SIZE_16: AXI sransfer is 16-bit wide
16 * @AXI_SIZE_32: AXI sransfer is 32-bit wide
26 * 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.
33 * Return: 0 if OK, -ve on error.
35 int (*read)(struct udevice *dev, ulong address, void *data,
36 enum axi_size_t size);
39 * 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.
46 * Return 0 if OK, -ve on error.
48 int (*write)(struct udevice *dev, ulong address, void *data,
49 enum axi_size_t size);
52 #define axi_get_ops(dev) ((struct axi_ops *)(dev)->driver->ops)
55 * 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.
62 * Return: 0 if OK, -ve on error.
64 int axi_read(struct udevice *dev, ulong address, void *data,
65 enum axi_size_t size);
68 * 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.
75 * Return: 0 if OK, -ve on error.
77 int axi_write(struct udevice *dev, ulong address, void *data,
78 enum axi_size_t size);
82 * read() - Read a single value from a specified address on a AXI bus
83 * @dev: AXI bus to read from.
84 * @address: The address to read from.
85 * @data: Pointer to a variable that takes the data value read
86 * from the address on the AXI bus.
87 * @size: The size of the data to be read.
89 * Return: 0 if OK, -ve on error.
91 int (*read)(struct udevice *dev, ulong address, void *data,
92 enum axi_size_t size);
95 * write() - Write a single value to a specified address on a AXI bus
96 * @dev: AXI bus to write to.
97 * @address: The address to write to.
98 * @data: Pointer to the data value to be written to the address
100 * @size: The size of the data to write.
102 * Return: 0 if OK, -ve on error.
104 int (*write)(struct udevice *dev, ulong address, void *data,
105 enum axi_size_t size);
108 * get_store() - Get address of internal storage of a emulated AXI
110 * @dev: Emulated AXI device to get the pointer of the internal
112 * @storep: Pointer to the internal storage of the emulated AXI
115 * Return: 0 if OK, -ve on error.
117 int (*get_store)(struct udevice *dev, u8 **storep);