1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2017, 2018
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
10 #include <linux/types.h>
15 * enum axi_size_t - Determine size of AXI transfer
16 * @AXI_SIZE_8: AXI sransfer is 8-bit wide
17 * @AXI_SIZE_16: AXI sransfer is 16-bit wide
18 * @AXI_SIZE_32: AXI sransfer is 32-bit wide
28 * read() - Read a single value from a specified address on a AXI bus
29 * @dev: AXI bus to read from.
30 * @address: The address to read from.
31 * @data: Pointer to a variable that takes the data value read
32 * from the address on the AXI bus.
33 * @size: The size of the data to be read.
35 * Return: 0 if OK, -ve on error.
37 int (*read
)(struct udevice
*dev
, ulong address
, void *data
,
38 enum axi_size_t size
);
41 * write() - Write a single value to a specified address on a AXI bus
42 * @dev: AXI bus to write to.
43 * @address: The address to write to.
44 * @data: Pointer to the data value to be written to the address
46 * @size: The size of the data to write.
48 * Return 0 if OK, -ve on error.
50 int (*write
)(struct udevice
*dev
, ulong address
, void *data
,
51 enum axi_size_t size
);
54 #define axi_get_ops(dev) ((struct axi_ops *)(dev)->driver->ops)
57 * axi_read() - Read a single value from a specified address on a AXI bus
58 * @dev: AXI bus to read from.
59 * @address: The address to read from.
60 * @data: Pointer to a variable that takes the data value read from the
61 * address on the AXI bus.
62 * @size: The size of the data to write.
64 * Return: 0 if OK, -ve on error.
66 int axi_read(struct udevice
*dev
, ulong address
, void *data
,
67 enum axi_size_t size
);
70 * axi_write() - Write a single value to a specified address on a AXI bus
71 * @dev: AXI bus to write to.
72 * @address: The address to write to.
73 * @data: Pointer to the data value to be written to the address on the
75 * @size: The size of the data to write.
77 * Return: 0 if OK, -ve on error.
79 int axi_write(struct udevice
*dev
, ulong address
, void *data
,
80 enum axi_size_t size
);
84 * read() - Read a single value from a specified address on a AXI bus
85 * @dev: AXI bus to read from.
86 * @address: The address to read from.
87 * @data: Pointer to a variable that takes the data value read
88 * from the address on the AXI bus.
89 * @size: The size of the data to be read.
91 * Return: 0 if OK, -ve on error.
93 int (*read
)(struct udevice
*dev
, ulong address
, void *data
,
94 enum axi_size_t size
);
97 * write() - Write a single value to a specified address on a AXI bus
98 * @dev: AXI bus to write to.
99 * @address: The address to write to.
100 * @data: Pointer to the data value to be written to the address
102 * @size: The size of the data to write.
104 * Return: 0 if OK, -ve on error.
106 int (*write
)(struct udevice
*dev
, ulong address
, void *data
,
107 enum axi_size_t size
);
110 * get_store() - Get address of internal storage of a emulated AXI
112 * @dev: Emulated AXI device to get the pointer of the internal
114 * @storep: Pointer to the internal storage of the emulated AXI
117 * Return: 0 if OK, -ve on error.
119 int (*get_store
)(struct udevice
*dev
, u8
**storep
);