blob: 41551ae85c9cdad48442cf2bdae7d167d854a899 [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 <common.h>
10#include <dm.h>
11#include <axi.h>
12
13int 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
24int 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
35UCLASS_DRIVER(axi) = {
36 .id = UCLASS_AXI,
37 .name = "axi",
38 .post_bind = dm_scan_fdt_dev,
39 .flags = DM_UC_FLAG_SEQ_ALIAS,
40};