Mario Six | 573b1b9 | 2018-08-09 14:51:16 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * (C) Copyright 2017 |
| 4 | * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc |
| 5 | */ |
| 6 | |
Patrick Delaunay | 8131335 | 2021-04-27 11:02:19 +0200 | [diff] [blame] | 7 | #define LOG_CATEGORY UCLASS_AXI |
| 8 | |
Mario Six | 573b1b9 | 2018-08-09 14:51:16 +0200 | [diff] [blame] | 9 | #include <dm.h> |
| 10 | #include <axi.h> |
| 11 | |
| 12 | int axi_read(struct udevice *dev, ulong address, void *data, |
| 13 | enum axi_size_t size) |
| 14 | { |
| 15 | struct axi_ops *ops = axi_get_ops(dev); |
| 16 | |
| 17 | if (!ops->read) |
| 18 | return -ENOSYS; |
| 19 | |
| 20 | return ops->read(dev, address, data, size); |
| 21 | } |
| 22 | |
| 23 | int axi_write(struct udevice *dev, ulong address, void *data, |
| 24 | enum axi_size_t size) |
| 25 | { |
| 26 | struct axi_ops *ops = axi_get_ops(dev); |
| 27 | |
| 28 | if (!ops->write) |
| 29 | return -ENOSYS; |
| 30 | |
| 31 | return ops->write(dev, address, data, size); |
| 32 | } |
| 33 | |
| 34 | UCLASS_DRIVER(axi) = { |
| 35 | .id = UCLASS_AXI, |
| 36 | .name = "axi", |
| 37 | .post_bind = dm_scan_fdt_dev, |
| 38 | .flags = DM_UC_FLAG_SEQ_ALIAS, |
| 39 | }; |