axi-uclass.c 780 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2017
  4. * Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
  5. */
  6. #define LOG_CATEGORY UCLASS_AXI
  7. #include <common.h>
  8. #include <dm.h>
  9. #include <axi.h>
  10. int axi_read(struct udevice *dev, ulong address, void *data,
  11. enum axi_size_t size)
  12. {
  13. struct axi_ops *ops = axi_get_ops(dev);
  14. if (!ops->read)
  15. return -ENOSYS;
  16. return ops->read(dev, address, data, size);
  17. }
  18. int axi_write(struct udevice *dev, ulong address, void *data,
  19. enum axi_size_t size)
  20. {
  21. struct axi_ops *ops = axi_get_ops(dev);
  22. if (!ops->write)
  23. return -ENOSYS;
  24. return ops->write(dev, address, data, size);
  25. }
  26. UCLASS_DRIVER(axi) = {
  27. .id = UCLASS_AXI,
  28. .name = "axi",
  29. .post_bind = dm_scan_fdt_dev,
  30. .flags = DM_UC_FLAG_SEQ_ALIAS,
  31. };