summaryrefslogtreecommitdiffstats
path: root/arch/loongarch/boot
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-05-31 18:04:11 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2022-06-03 20:09:27 +0800
commitfa96b57c149061f71a70bd6582d995f6424fbbf4 (patch)
tree05a9289473af2f3d9192f1d8aeeefb6b4f16eefb /arch/loongarch/boot
parent439057ec3b748b1ff61855d09859f369493e22d8 (diff)
downloadlinux-stable-fa96b57c149061f71a70bd6582d995f6424fbbf4.tar.gz
linux-stable-fa96b57c149061f71a70bd6582d995f6424fbbf4.tar.bz2
linux-stable-fa96b57c149061f71a70bd6582d995f6424fbbf4.zip
LoongArch: Add build infrastructure
Add Kbuild, Makefile, Kconfig and link script for LoongArch build infrastructure. Reviewed-by: Guo Ren <guoren@kernel.org> Reviewed-by: WANG Xuerui <git@xen0n.name> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/boot')
-rw-r--r--arch/loongarch/boot/.gitignore2
-rw-r--r--arch/loongarch/boot/Makefile16
-rw-r--r--arch/loongarch/boot/dts/Makefile4
3 files changed, 22 insertions, 0 deletions
diff --git a/arch/loongarch/boot/.gitignore b/arch/loongarch/boot/.gitignore
new file mode 100644
index 000000000000..49423ee96ef3
--- /dev/null
+++ b/arch/loongarch/boot/.gitignore
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+vmlinux*
diff --git a/arch/loongarch/boot/Makefile b/arch/loongarch/boot/Makefile
new file mode 100644
index 000000000000..0125b17edc98
--- /dev/null
+++ b/arch/loongarch/boot/Makefile
@@ -0,0 +1,16 @@
+#
+# arch/loongarch/boot/Makefile
+#
+# Copyright (C) 2020-2022 Loongson Technology Corporation Limited
+#
+
+drop-sections := .comment .note .options .note.gnu.build-id
+strip-flags := $(addprefix --remove-section=,$(drop-sections)) -S
+OBJCOPYFLAGS_vmlinux.efi := -O binary $(strip-flags)
+
+targets := vmlinux
+quiet_cmd_strip = STRIP $@
+ cmd_strip = $(STRIP) -s -o $@ $<
+
+$(obj)/vmlinux: vmlinux FORCE
+ $(call if_changed,strip)
diff --git a/arch/loongarch/boot/dts/Makefile b/arch/loongarch/boot/dts/Makefile
new file mode 100644
index 000000000000..5f1f55e911ad
--- /dev/null
+++ b/arch/loongarch/boot/dts/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+dtstree := $(srctree)/$(src)
+
+dtb-y := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))