sysreset_microblaze.c 724 B

1234567891011121314151617181920212223242526272829303132
  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. #include <linux/stringify.h>
  11. static int microblaze_sysreset_request(struct udevice *dev,
  12. enum sysreset_t type)
  13. {
  14. puts("Microblaze soft reset sysreset\n");
  15. __asm__ __volatile__ (
  16. "mts rmsr, r0;" \
  17. "brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR));
  18. return -EINPROGRESS;
  19. }
  20. static struct sysreset_ops microblaze_sysreset = {
  21. .request = microblaze_sysreset_request,
  22. };
  23. U_BOOT_DRIVER(sysreset_microblaze) = {
  24. .id = UCLASS_SYSRESET,
  25. .name = "mb_soft_reset",
  26. .ops = &microblaze_sysreset,
  27. };