sysreset_microblaze.c 634 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2018 Xilinx, Inc. - Michal Simek
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <errno.h>
  8. #include <sysreset.h>
  9. #include <linux/err.h>
  10. static int microblaze_sysreset_request(struct udevice *dev,
  11. enum sysreset_t type)
  12. {
  13. puts("Microblaze soft reset sysreset\n");
  14. __asm__ __volatile__ (" mts rmsr, r0;" \
  15. "bra r0");
  16. return -EINPROGRESS;
  17. }
  18. static struct sysreset_ops microblaze_sysreset = {
  19. .request = microblaze_sysreset_request,
  20. };
  21. U_BOOT_DRIVER(sysreset_microblaze) = {
  22. .id = UCLASS_SYSRESET,
  23. .name = "mb_soft_reset",
  24. .ops = &microblaze_sysreset,
  25. };