~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 41551ae85c9cdad48442cf2bdae7d167d854a899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: GPL-2.0+
/*
 * (C) Copyright 2017
 * Mario Six,  Guntermann & Drunck GmbH, mario.six@gdsys.cc
 */

#define LOG_CATEGORY UCLASS_AXI

#include <common.h>
#include <dm.h>
#include <axi.h>

int axi_read(struct udevice *dev, ulong address, void *data,
	     enum axi_size_t size)
{
	struct axi_ops *ops = axi_get_ops(dev);

	if (!ops->read)
		return -ENOSYS;

	return ops->read(dev, address, data, size);
}

int axi_write(struct udevice *dev, ulong address, void *data,
	      enum axi_size_t size)
{
	struct axi_ops *ops = axi_get_ops(dev);

	if (!ops->write)
		return -ENOSYS;

	return ops->write(dev, address, data, size);
}

UCLASS_DRIVER(axi) = {
	.id		= UCLASS_AXI,
	.name		= "axi",
	.post_bind	= dm_scan_fdt_dev,
	.flags		= DM_UC_FLAG_SEQ_ALIAS,
};