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 <common.h> |
| 10 | #include <dm.h> |
| 11 | #include <axi.h> |
| 12 | |
| 13 | int axi_read(struct udevice *dev, ulong address, void *data, |
| 14 | enum axi_size_t size) |
| 15 | { |
| 16 | struct axi_ops *ops = axi_get_ops(dev); |
| 17 | |
| 18 | if (!ops->read) |
| 19 | return -ENOSYS; |
| 20 | |
| 21 | return ops->read(dev, address, data, size); |
| 22 | } |
| 23 | |
| 24 | int axi_write(struct udevice *dev, ulong address, void *data, |
| 25 | enum axi_size_t size) |
| 26 | { |
| 27 | struct axi_ops *ops = axi_get_ops(dev); |
| 28 | |
| 29 | if (!ops->write) |
| 30 | return -ENOSYS; |
| 31 | |
| 32 | return ops->write(dev, address, data, size); |
| 33 | } |
| 34 | |
| 35 | UCLASS_DRIVER(axi) = { |
| 36 | .id = UCLASS_AXI, |
| 37 | .name = "axi", |
| 38 | .post_bind = dm_scan_fdt_dev, |
| 39 | .flags = DM_UC_FLAG_SEQ_ALIAS, |
| 40 | }; |