blob: fa2475cbaf4e34bec018eebc59631fb97b51a87d [file] [log] [blame]
Mario Six573b1b92018-08-09 14:51:16 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2017
4 * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
5 */
6
Patrick Delaunay81313352021-04-27 11:02:19 +02007#define LOG_CATEGORY UCLASS_AXI
8
Mario Six573b1b92018-08-09 14:51:16 +02009#include <dm.h>
10#include <axi.h>
11
12int 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
23int 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
34UCLASS_DRIVER(axi) = {
35 .id = UCLASS_AXI,
36 .name = "axi",
37 .post_bind = dm_scan_fdt_dev,
38 .flags = DM_UC_FLAG_SEQ_ALIAS,
39};