cache_debug.c 768 B

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * The 'sbi' command displays information about the SBI implementation.
  4. *
  5. * Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. #include <asm/arch-fu540/cache.h>
  10. static int do_cache_debug(struct cmd_tbl *cmdtp, int flag, int argc,
  11. char *const argv[])
  12. {
  13. u32 way_enable;
  14. if (argc < 2)
  15. return CMD_RET_USAGE;
  16. way_enable = simple_strtoul(argv[1], NULL, 10);
  17. printf("Input is %d !\n", way_enable);
  18. if (way_enable >= 255)
  19. return CMD_RET_USAGE;
  20. way_enable = cache_enable_ways_debug(way_enable);
  21. printf("Readback is %d !\n", way_enable);
  22. return CMD_RET_SUCCESS;
  23. }
  24. U_BOOT_CMD(
  25. cache_debug, 2, 0, do_cache_debug,
  26. "cache config debug",
  27. "wayenable number"
  28. );