^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # ===========================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # Post-link MIPS pass
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) # ===========================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # 1. Check that Loongson3 LL/SC workarounds are applied correctly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) # 2. Insert relocations into vmlinux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) PHONY := __archpost
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) __archpost:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) -include include/config/auto.conf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) include scripts/Kbuild.include
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) CMD_LS3_LLSC = arch/mips/tools/loongson3-llsc-check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) quiet_cmd_ls3_llsc = LLSCCHK $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) cmd_ls3_llsc = $(CMD_LS3_LLSC) $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) CMD_RELOCS = arch/mips/boot/tools/relocs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) quiet_cmd_relocs = RELOCS $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) cmd_relocs = $(CMD_RELOCS) $@
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) # `@true` prevents complaint when there is nothing to be done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) vmlinux: FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) @true
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) ifeq ($(CONFIG_CPU_LOONGSON3_WORKAROUNDS),y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) $(call if_changed,ls3_llsc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) ifeq ($(CONFIG_RELOCATABLE),y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) $(call if_changed,relocs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) %.ko: FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) @true
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) clean:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) @true
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) PHONY += FORCE clean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) FORCE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) .PHONY: $(PHONY)