sifive_fu540.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * SPDX-License-Identifier: BSD-2-Clause
  3. *
  4. * Copyright (c) 2020 Western Digital Corporation or its affiliates.
  5. *
  6. * Authors:
  7. * Anup Patel <anup.patel@wdc.com>
  8. */
  9. #include <platform_override.h>
  10. #include <sbi_utils/fdt/fdt_helper.h>
  11. #include <sbi_utils/fdt/fdt_fixup.h>
  12. static u64 sifive_fu540_tlbr_flush_limit(const struct fdt_match *match)
  13. {
  14. /*
  15. * The sfence.vma by virtual address does not work on
  16. * SiFive FU540 so we return remote TLB flush limit as zero.
  17. */
  18. return 0;
  19. }
  20. static int sifive_fu540_fdt_fixup(void *fdt, const struct fdt_match *match)
  21. {
  22. /*
  23. * SiFive Freedom U540 has an erratum that prevents S-mode software
  24. * to access a PMP protected region using 1GB page table mapping, so
  25. * always add the no-map attribute on this platform.
  26. */
  27. fdt_reserved_memory_nomap_fixup(fdt);
  28. return 0;
  29. }
  30. static const struct fdt_match sifive_fu540_match[] = {
  31. { .compatible = "sifive,fu540" },
  32. { .compatible = "sifive,fu540g" },
  33. { .compatible = "sifive,fu540-c000" },
  34. { .compatible = "sifive,hifive-unleashed-a00" },
  35. { },
  36. };
  37. const struct platform_override sifive_fu540 = {
  38. .match_table = sifive_fu540_match,
  39. .tlbr_flush_limit = sifive_fu540_tlbr_flush_limit,
  40. .fdt_fixup = sifive_fu540_fdt_fixup,
  41. };