1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2017, 2018
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
11 * enum axi_size_t - Determine size of AXI transfer
12 * @AXI_SIZE_8: AXI sransfer is 8-bit wide
13 * @AXI_SIZE_16: AXI sransfer is 16-bit wide
14 * @AXI_SIZE_32: AXI sransfer is 32-bit wide
24 * read() - Read a single value from a specified address on a AXI bus
25 * @dev: AXI bus to read from.
26 * @address: The address to read from.
27 * @data: Pointer to a variable that takes the data value read
28 * from the address on the AXI bus.
29 * @size: The size of the data to be read.
31 * Return: 0 if OK, -ve on error.
33 int (*read)(struct udevice *dev, ulong address, void *data,
34 enum axi_size_t size);
37 * write() - Write a single value to a specified address on a AXI bus
38 * @dev: AXI bus to write to.
39 * @address: The address to write to.
40 * @data: Pointer to the data value to be written to the address
42 * @size: The size of the data to write.
44 * Return 0 if OK, -ve on error.
46 int (*write)(struct udevice *dev, ulong address, void *data,
47 enum axi_size_t size);
50 #define axi_get_ops(dev) ((struct axi_ops *)(dev)->driver->ops)
53 * axi_read() - Read a single value from a specified address on a AXI bus
54 * @dev: AXI bus to read from.
55 * @address: The address to read from.
56 * @data: Pointer to a variable that takes the data value read from the
57 * address on the AXI bus.
58 * @size: The size of the data to write.
60 * Return: 0 if OK, -ve on error.
62 int axi_read(struct udevice *dev, ulong address, void *data,
63 enum axi_size_t size);
66 * axi_write() - Write a single value to a specified address on a AXI bus
67 * @dev: AXI bus to write to.
68 * @address: The address to write to.
69 * @data: Pointer to the data value to be written to the address on the
71 * @size: The size of the data to write.
73 * Return: 0 if OK, -ve on error.
75 int axi_write(struct udevice *dev, ulong address, void *data,
76 enum axi_size_t size);
80 * read() - Read a single value from a specified address on a AXI bus
81 * @dev: AXI bus to read from.
82 * @address: The address to read from.
83 * @data: Pointer to a variable that takes the data value read
84 * from the address on the AXI bus.
85 * @size: The size of the data to be read.
87 * Return: 0 if OK, -ve on error.
89 int (*read)(struct udevice *dev, ulong address, void *data,
90 enum axi_size_t size);
93 * write() - Write a single value to a specified address on a AXI bus
94 * @dev: AXI bus to write to.
95 * @address: The address to write to.
96 * @data: Pointer to the data value to be written to the address
98 * @size: The size of the data to write.
100 * Return: 0 if OK, -ve on error.
102 int (*write)(struct udevice *dev, ulong address, void *data,
103 enum axi_size_t size);
106 * get_store() - Get address of internal storage of a emulated AXI
108 * @dev: Emulated AXI device to get the pointer of the internal
110 * @storep: Pointer to the internal storage of the emulated AXI
113 * Return: 0 if OK, -ve on error.
115 int (*get_store)(struct udevice *dev, u8 **storep);