diff --git a/config/Config-images.in b/config/Config-images.in index 50b887556..4223e45b9 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -198,15 +198,15 @@ menu "Target Images" default "" config GRUB_IMAGES - bool "Build GRUB images (Linux x86 or x86_64 host only)" + bool "Build GRUB images" depends on TARGET_x86 depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 default n config GRUB_EFI_IMAGES - bool "Build GRUB EFI images (Linux x86 or x86_64 host only)" - depends on TARGET_x86 || TARGET_armvirt + bool "Build GRUB EFI images" + depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 if TARGET_x86 select PACKAGE_grub2-efi if TARGET_x86 @@ -276,7 +276,7 @@ menu "Target Images" config VMDK_IMAGES bool "Build VMware image files (VMDK)" - depends on TARGET_x86 || TARGET_armvirt + depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 depends on GRUB_IMAGES || GRUB_EFI_IMAGES default y select PACKAGE_kmod-e1000 @@ -289,7 +289,7 @@ menu "Target Images" config TARGET_IMAGES_GZIP bool "GZip images" - depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta + depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 || TARGET_malta default y comment "Image Options" @@ -308,6 +308,7 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MiB)" depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS + default 232 if TARGET_loongarch64 default 400 if TARGET_x86 default 160 help diff --git a/include/target.mk b/include/target.mk index e579fdb1c..426801b92 100644 --- a/include/target.mk +++ b/include/target.mk @@ -262,6 +262,11 @@ ifeq ($(DUMP),1) CPU_TYPE ?= riscv64 CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc endif + ifeq ($(ARCH),loongarch64) + CPU_TYPE ?= generic + CPU_CFLAGS := -O2 -pipe + CPU_CFLAGS_generic:=-march=loongarch64 + endif ifneq ($(CPU_TYPE),) ifndef CPU_CFLAGS_$(CPU_TYPE) $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)