diff --git a/Config.in b/Config.in index 8de6e1aa87..7b03c7a245 100644 --- a/Config.in +++ b/Config.in @@ -681,6 +681,17 @@ menuconfig TARGET_OPTIONS Most people will answer N. + config USE_MIPS16 + bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS + depends on HAS_MIPS16 + help + If your target CPU does support the MIPS16 instruction set + and you want to use it for packages, enable this option. + MIPS16 produces smaller binaries thus reducing pressure on + caches and TLB. + + Most people will answer N. + source "toolchain/Config.in" source "target/imagebuilder/Config.in" diff --git a/rules.mk b/rules.mk index 59ab50b922..56129917e4 100644 --- a/rules.mk +++ b/rules.mk @@ -63,6 +63,9 @@ endif ifneq ($(filter -mips%r2,$(TARGET_OPTIMIZATION)),) ARCH_SUFFIX:=_r2 endif +ifdef CONFIG_USE_MIPS16 + TARGET_OPTIMIZATION+= -minterlink-mips16 -mips16 +endif ifneq ($(findstring -mips16,$(TARGET_OPTIMIZATION)),) TARGET_ASFLAGS_OVERRIDE:=-mno-mips16 ARCH_SUFFIX:= $(ARCH_SUFFIX)_m16 diff --git a/scripts/metadata.pl b/scripts/metadata.pl index b04cd8cc3d..6249127e3d 100755 --- a/scripts/metadata.pl +++ b/scripts/metadata.pl @@ -174,6 +174,7 @@ sub target_config_features(@) { /ramdisk/ and $ret .= "\tselect USES_INITRAMFS\n"; /powerpc64/ and $ret .= "\tselect powerpc64\n"; /nommu/ and $ret .= "\tselect NOMMU\n"; + /mips16/ and $ret .= "\tselect HAS_MIPS16\n"; } return $ret; } diff --git a/target/Config.in b/target/Config.in index 31f3ced51d..79a91b1afb 100644 --- a/target/Config.in +++ b/target/Config.in @@ -66,6 +66,10 @@ config PROFILE_KCONFIG config NOMMU bool +config HAS_MIPS16 + depends (mips || mipsel || mips64 || mips64el) + bool + # Architecture selection config arm