objects.mk 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. # Objects to build
  18. platform-objs-y += platform.o
  19. platform-objs-y += platform_override_modules.o
  20. # Blobs to build
  21. FW_TEXT_START=0x80000000
  22. FW_DYNAMIC=y
  23. FW_JUMP=y
  24. ifeq ($(PLATFORM_RISCV_XLEN), 32)
  25. # This needs to be 4MB aligned for 32-bit system
  26. FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x400000)))
  27. else
  28. # This needs to be 2MB aligned for 64-bit system
  29. FW_JUMP_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x200000)))
  30. endif
  31. FW_JUMP_FDT_ADDR=$(shell printf "0x%X" $$(($(FW_TEXT_START) + 0x2200000)))
  32. FW_PAYLOAD=y
  33. ifeq ($(PLATFORM_RISCV_XLEN), 32)
  34. # This needs to be 4MB aligned for 32-bit system
  35. FW_PAYLOAD_OFFSET=0x400000
  36. else
  37. # This needs to be 2MB aligned for 64-bit system
  38. FW_PAYLOAD_OFFSET=0x200000
  39. endif
  40. FW_PAYLOAD_FDT_ADDR=$(FW_JUMP_FDT_ADDR)