config.mk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # Compiler flags
  10. platform-cppflags-y =
  11. platform-cflags-y =
  12. platform-asflags-y =
  13. platform-ldflags-y =
  14. # Command for platform specific "make run"
  15. platform-runcmd = qemu-system-riscv$(PLATFORM_RISCV_XLEN) -M virt -m 256M \
  16. -nographic -bios $(build_dir)/platform/generic/firmware/fw_payload.elf
  17. # Blobs to build
  18. FW_TEXT_START=0x80000000
  19. FW_DYNAMIC=y
  20. FW_JUMP=y
  21. ifeq ($(PLATFORM_RISCV_XLEN), 32)
  22. # This needs to be 4MB aligned for 32-bit system
  23. FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000)))
  24. else
  25. # This needs to be 2MB aligned for 64-bit system
  26. FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000)))
  27. endif
  28. FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000)))
  29. FW_PAYLOAD=y
  30. ifeq ($(PLATFORM_RISCV_XLEN), 32)
  31. # This needs to be 4MB aligned for 32-bit system
  32. FW_PAYLOAD_OFFSET=0x400000
  33. else
  34. # This needs to be 2MB aligned for 64-bit system
  35. FW_PAYLOAD_OFFSET=0x200000
  36. endif
  37. FW_PAYLOAD_FDT_ADDR=$(FW_JUMP_FDT_ADDR)