axi-uclass.c 747 B

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