3b5545db15a3a99a518504bc793a02f2677771b4
[openwrt/staging/jow.git] /
1 From a80ef99cb308904b82662deb66c5ed7a6ff59928 Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Wed, 3 Mar 2021 11:13:36 +0800
4 Subject: [PATCH 12/21] board: mt7629: enable compression of u-boot to reduce
5 the size of final image
6
7 This patch makes use of the decompression mechanism implemented for mt7628
8 previously to reduce the total image size. Binman will be also removed.
9
10 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
11 ---
12 Makefile | 3 +++
13 arch/arm/dts/mt7629-rfb-u-boot.dtsi | 18 ------------------
14 arch/arm/mach-mediatek/Kconfig | 1 -
15 configs/mt7629_rfb_defconfig | 6 ++++++
16 4 files changed, 9 insertions(+), 19 deletions(-)
17
18 --- a/Makefile
19 +++ b/Makefile
20 @@ -1728,6 +1728,9 @@ u-boot-elf.lds: arch/u-boot-elf.lds prep
21
22 ifeq ($(CONFIG_SPL),y)
23 spl/u-boot-spl-mtk.bin: spl/u-boot-spl
24 +
25 +u-boot-mtk.bin: u-boot-with-spl.bin
26 + $(call if_changed,copy)
27 else
28 MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \
29 -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
30 --- a/arch/arm/dts/mt7629-rfb-u-boot.dtsi
31 +++ b/arch/arm/dts/mt7629-rfb-u-boot.dtsi
32 @@ -5,24 +5,6 @@
33 * Author: Weijie Gao <weijie.gao@mediatek.com>
34 */
35
36 -#include <config.h>
37 -/ {
38 - binman {
39 - filename = "u-boot-mtk.bin";
40 - pad-byte = <0xff>;
41 -
42 -#ifdef CONFIG_SPL
43 - blob {
44 - filename = "spl/u-boot-spl-mtk.bin";
45 - size = <CONFIG_SPL_PAD_TO>;
46 - };
47 -
48 - u-boot-img {
49 - };
50 -#endif
51 - };
52 -};
53 -
54 &infracfg {
55 u-boot,dm-pre-reloc;
56 };
57 --- a/arch/arm/mach-mediatek/Kconfig
58 +++ b/arch/arm/mach-mediatek/Kconfig
59 @@ -36,7 +36,6 @@ config TARGET_MT7629
60 bool "MediaTek MT7629 SoC"
61 select CPU_V7A
62 select SPL
63 - select BINMAN
64 help
65 The MediaTek MT7629 is a ARM-based SoC with a dual-core Cortex-A7
66 including DDR3, crypto engine, 3x3 11n/ac Wi-Fi, Gigabit Ethernet,
67 --- a/configs/mt7629_rfb_defconfig
68 +++ b/configs/mt7629_rfb_defconfig
69 @@ -10,7 +10,11 @@ CONFIG_SPL_TEXT_BASE=0x201000
70 CONFIG_TARGET_MT7629=y
71 CONFIG_SPL_SERIAL_SUPPORT=y
72 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
73 +CONFIG_SPL_STACK_R_ADDR=0x40800000
74 +CONFIG_SPL_PAYLOAD="u-boot-lzma.img"
75 +CONFIG_BUILD_TARGET="u-boot-mtk.bin"
76 CONFIG_DEFAULT_DEVICE_TREE="mt7629-rfb"
77 +CONFIG_SPL_IMAGE="spl/u-boot-spl-mtk.bin"
78 CONFIG_FIT=y
79 CONFIG_FIT_VERBOSE=y
80 CONFIG_BOOTDELAY=3
81 @@ -18,6 +22,7 @@ CONFIG_DEFAULT_FDT_FILE="mt7629-rfb"
82 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
83 # CONFIG_DISPLAY_BOARDINFO is not set
84 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
85 +CONFIG_SPL_STACK_R=y
86 CONFIG_SPL_NOR_SUPPORT=y
87 CONFIG_SPL_WATCHDOG_SUPPORT=y
88 CONFIG_HUSH_PARSER=y
89 @@ -87,4 +92,5 @@ CONFIG_USB_STORAGE=y
90 CONFIG_USB_KEYBOARD=y
91 CONFIG_WDT_MTK=y
92 CONFIG_LZMA=y
93 +CONFIG_SPL_LZMA=y
94 # CONFIG_EFI_LOADER is not set