addrmap.c 801 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <command.h>
  7. #include <addr_map.h>
  8. static int do_addrmap(struct cmd_tbl *cmdtp, int flag, int argc,
  9. char *const argv[])
  10. {
  11. int i;
  12. printf(" vaddr paddr size\n");
  13. printf("================ ================ ================\n");
  14. for (i = 0; i < CONFIG_SYS_NUM_ADDR_MAP; i++) {
  15. if (address_map[i].size == 0)
  16. continue;
  17. printf("%16.8lx %16.8llx %16.8llx\n",
  18. address_map[i].vaddr,
  19. (unsigned long long)address_map[i].paddr,
  20. (unsigned long long)address_map[i].size);
  21. }
  22. return 0;
  23. }
  24. U_BOOT_CMD(
  25. addrmap, 1, 1, do_addrmap,
  26. "List non-identity virtual-physical memory mappings for 32-bit CPUs",
  27. ""
  28. );