Skip to content

Commit

Permalink
uboot-mediatek: unbreak build with binman
Browse files Browse the repository at this point in the history
swig has been installed on the buildbots a while a ago and
Petr Štetiar got a fix for the pylibfdt error. Use that and re-enable
the builds for mt7620 and mt7621.
Refresh patches while at it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Jul 13, 2022
1 parent 7659ee1 commit e0e74d8
Show file tree
Hide file tree
Showing 32 changed files with 71 additions and 325 deletions.
4 changes: 0 additions & 4 deletions package/boot/uboot-mediatek/Makefile
Expand Up @@ -33,7 +33,6 @@ define U-Boot/mt7620_rfb
BUILD_TARGET:=ramips
BUILD_SUBTARGET:=mt7620
UBOOT_IMAGE:=u-boot-with-spl.bin
DEPENDS:=@BROKEN
endef

define U-Boot/mt7620_mt7530_rfb
Expand All @@ -43,7 +42,6 @@ define U-Boot/mt7620_mt7530_rfb
BUILD_TARGET:=ramips
BUILD_SUBTARGET:=mt7620
UBOOT_IMAGE:=u-boot-with-spl.bin
DEPENDS:=@BROKEN
endef

define U-Boot/mt7621_rfb
Expand All @@ -53,7 +51,6 @@ define U-Boot/mt7621_rfb
BUILD_TARGET:=ramips
BUILD_SUBTARGET:=mt7621
UBOOT_IMAGE:=u-boot-mt7621.bin
DEPENDS:=@BROKEN
endef

define U-Boot/mt7621_nand_rfb
Expand All @@ -63,7 +60,6 @@ define U-Boot/mt7621_nand_rfb
BUILD_TARGET:=ramips
BUILD_SUBTARGET:=mt7621
UBOOT_IMAGE:=u-boot-mt7621.bin
DEPENDS:=@BROKEN
endef

define U-Boot/mt7622_rfb1
Expand Down
Expand Up @@ -16,9 +16,6 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
1 file changed, 142 insertions(+)
create mode 100644 arch/mips/include/asm/mipsmtregs.h

diff --git a/arch/mips/include/asm/mipsmtregs.h b/arch/mips/include/asm/mipsmtregs.h
new file mode 100644
index 0000000000..ba82e2bd97
--- /dev/null
+++ b/arch/mips/include/asm/mipsmtregs.h
@@ -0,0 +1,142 @@
Expand Down Expand Up @@ -164,6 +161,3 @@ index 0000000000..ba82e2bd97
+#define TCHALT_H (_ULCAST_(1))
+
+#endif
--
2.36.1

Expand Up @@ -12,8 +12,6 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
arch/mips/include/asm/cm.h | 67 ++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)

diff --git a/arch/mips/include/asm/cm.h b/arch/mips/include/asm/cm.h
index 99ddbccd80..5cc8c09621 100644
--- a/arch/mips/include/asm/cm.h
+++ b/arch/mips/include/asm/cm.h
@@ -8,9 +8,23 @@
Expand Down Expand Up @@ -111,6 +109,3 @@ index 99ddbccd80..5cc8c09621 100644
#ifndef __ASSEMBLY__

#include <asm/io.h>
--
2.36.1

Expand Up @@ -13,8 +13,6 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
arch/mips/cpu/u-boot-spl.lds | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds
index 28ea4f2a48..f88754ab56 100644
--- a/arch/mips/cpu/u-boot-spl.lds
+++ b/arch/mips/cpu/u-boot-spl.lds
@@ -13,7 +13,9 @@ SECTIONS
Expand All @@ -35,6 +33,3 @@ index 28ea4f2a48..f88754ab56 100644

_image_binary_end = .;

--
2.36.1

Expand Up @@ -19,11 +19,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
arch/mips/lib/cache.c | 43 ++++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)

diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index 79e638844b..89a2ac209f 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -282,4 +282,24 @@ static inline void instruction_hazard_barrier(void)
@@ -282,4 +282,24 @@ static inline void instruction_hazard_ba
: "=&r"(tmp));
}

Expand All @@ -48,8 +46,6 @@ index 79e638844b..89a2ac209f 100644
+#endif /* CONFIG_SYS_NONCACHED_MEMORY */
+
#endif /* _ASM_SYSTEM_H */
diff --git a/arch/mips/lib/cache.c b/arch/mips/lib/cache.c
index ec652f0fba..d23b38d6b9 100644
--- a/arch/mips/lib/cache.c
+++ b/arch/mips/lib/cache.c
@@ -6,6 +6,7 @@
Expand Down Expand Up @@ -106,6 +102,3 @@ index ec652f0fba..d23b38d6b9 100644
+ return CKSEG1ADDR(next);
+}
+#endif /* CONFIG_SYS_NONCACHED_MEMORY */
--
2.36.1

Expand Up @@ -63,9 +63,6 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
create mode 100644 arch/mips/mach-mtmips/mt7621/tpl/tpl.c
create mode 100644 include/configs/mt7621.h

diff --git a/arch/mips/dts/mt7621-u-boot.dtsi b/arch/mips/dts/mt7621-u-boot.dtsi
new file mode 100644
index 0000000000..c5a8aa357f
--- /dev/null
+++ b/arch/mips/dts/mt7621-u-boot.dtsi
@@ -0,0 +1,111 @@
Expand Down Expand Up @@ -180,9 +177,6 @@ index 0000000000..c5a8aa357f
+ };
+ };
+};
diff --git a/arch/mips/dts/mt7621.dtsi b/arch/mips/dts/mt7621.dtsi
new file mode 100644
index 0000000000..c32b6095e9
--- /dev/null
+++ b/arch/mips/dts/mt7621.dtsi
@@ -0,0 +1,349 @@
Expand Down Expand Up @@ -535,8 +529,6 @@ index 0000000000..c32b6095e9
+ #size-cells = <0>;
+ };
+};
diff --git a/arch/mips/mach-mtmips/Kconfig b/arch/mips/mach-mtmips/Kconfig
index 151b004603..d46be503a2 100644
--- a/arch/mips/mach-mtmips/Kconfig
+++ b/arch/mips/mach-mtmips/Kconfig
@@ -9,6 +9,7 @@ config SYS_MALLOC_F_LEN
Expand Down Expand Up @@ -630,8 +622,6 @@ index 151b004603..d46be503a2 100644
source "arch/mips/mach-mtmips/mt7628/Kconfig"

endmenu
diff --git a/arch/mips/mach-mtmips/Makefile b/arch/mips/mach-mtmips/Makefile
index 4909b47ef2..19f1e07033 100644
--- a/arch/mips/mach-mtmips/Makefile
+++ b/arch/mips/mach-mtmips/Makefile
@@ -1,9 +1,13 @@
Expand All @@ -648,8 +638,6 @@ index 4909b47ef2..19f1e07033 100644
obj-$(CONFIG_SOC_MT7620) += mt7620/
+obj-$(CONFIG_SOC_MT7621) += mt7621/
obj-$(CONFIG_SOC_MT7628) += mt7628/
diff --git a/arch/mips/mach-mtmips/cpu.c b/arch/mips/mach-mtmips/cpu.c
index a4b5cff61d..f1e9022738 100644
--- a/arch/mips/mach-mtmips/cpu.c
+++ b/arch/mips/mach-mtmips/cpu.c
@@ -16,7 +16,7 @@ DECLARE_GLOBAL_DATA_PTR;
Expand All @@ -661,9 +649,6 @@ index a4b5cff61d..f1e9022738 100644

return 0;
}
diff --git a/arch/mips/mach-mtmips/mt7621/Kconfig b/arch/mips/mach-mtmips/mt7621/Kconfig
new file mode 100644
index 0000000000..37d512c68f
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/Kconfig
@@ -0,0 +1,95 @@
Expand Down Expand Up @@ -762,9 +747,6 @@ index 0000000000..37d512c68f
+ default "mediatek" if BOARD_MT7621_RFB || BOARD_MT7621_NAND_RFB
+
+endif
diff --git a/arch/mips/mach-mtmips/mt7621/Makefile b/arch/mips/mach-mtmips/mt7621/Makefile
new file mode 100644
index 0000000000..bf1b0bb688
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/Makefile
@@ -0,0 +1,14 @@
Expand All @@ -782,9 +764,6 @@ index 0000000000..bf1b0bb688
+
+obj-y += sram_init.o
+endif
diff --git a/arch/mips/mach-mtmips/mt7621/init.c b/arch/mips/mach-mtmips/mt7621/init.c
new file mode 100644
index 0000000000..d21848ad23
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/init.c
@@ -0,0 +1,246 @@
Expand Down Expand Up @@ -1034,9 +1013,6 @@ index 0000000000..d21848ad23
+ while (1)
+ writel(SYS_RST, sysc + SYSCTL_RSTCTL_REG);
+}
diff --git a/arch/mips/mach-mtmips/mt7621/mt7621.h b/arch/mips/mach-mtmips/mt7621/mt7621.h
new file mode 100644
index 0000000000..916cc993b4
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/mt7621.h
@@ -0,0 +1,229 @@
Expand Down Expand Up @@ -1269,9 +1245,6 @@ index 0000000000..916cc993b4
+#endif
+
+#endif /* _MT7621_H_ */
diff --git a/arch/mips/mach-mtmips/mt7621/serial.c b/arch/mips/mach-mtmips/mt7621/serial.c
new file mode 100644
index 0000000000..0ccc71dc75
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/serial.c
@@ -0,0 +1,23 @@
Expand All @@ -1298,9 +1271,6 @@ index 0000000000..0ccc71dc75
+ clrbits_32(base + SYSCTL_GPIOMODE_REG, UART3_MODE_M);
+#endif
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/Makefile b/arch/mips/mach-mtmips/mt7621/spl/Makefile
new file mode 100644
index 0000000000..ebe54e79b9
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/Makefile
@@ -0,0 +1,9 @@
Expand All @@ -1313,9 +1283,6 @@ index 0000000000..ebe54e79b9
+obj-y += serial.o
+obj-y += launch.o
+obj-y += launch_ll.o
diff --git a/arch/mips/mach-mtmips/mt7621/spl/cps.c b/arch/mips/mach-mtmips/mt7621/spl/cps.c
new file mode 100644
index 0000000000..779e646c12
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/cps.c
@@ -0,0 +1,153 @@
Expand Down Expand Up @@ -1472,9 +1439,6 @@ index 0000000000..779e646c12
+ gic_init();
+ cm_init(cm_base);
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/dram.c b/arch/mips/mach-mtmips/mt7621/spl/dram.c
new file mode 100644
index 0000000000..100adfb93a
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/dram.c
@@ -0,0 +1,153 @@
Expand Down Expand Up @@ -1631,9 +1595,6 @@ index 0000000000..100adfb93a
+ new_stage_bin->ddr_pll_cfg = DDR_FREQ_PARAM;
+ new_stage_bin->baudrate = CONFIG_BAUDRATE;
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/dram.h b/arch/mips/mach-mtmips/mt7621/spl/dram.h
new file mode 100644
index 0000000000..7322c58276
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/dram.h
@@ -0,0 +1,39 @@
Expand Down Expand Up @@ -1676,9 +1637,6 @@ index 0000000000..7322c58276
+#endif
+
+#endif /* _MT7621_DRAM_H_ */
diff --git a/arch/mips/mach-mtmips/mt7621/spl/launch.c b/arch/mips/mach-mtmips/mt7621/spl/launch.c
new file mode 100644
index 0000000000..37c20a5f56
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/launch.c
@@ -0,0 +1,100 @@
Expand Down Expand Up @@ -1782,9 +1740,6 @@ index 0000000000..37c20a5f56
+ break;
+ }
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/launch.h b/arch/mips/mach-mtmips/mt7621/spl/launch.h
new file mode 100644
index 0000000000..f34250d605
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/launch.h
@@ -0,0 +1,52 @@
Expand Down Expand Up @@ -1840,9 +1795,6 @@ index 0000000000..f34250d605
+#define LAUNCHPERIOD 10000
+
+#endif /* _LAUNCH_H_ */
diff --git a/arch/mips/mach-mtmips/mt7621/spl/launch_ll.S b/arch/mips/mach-mtmips/mt7621/spl/launch_ll.S
new file mode 100644
index 0000000000..32d28c7539
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/launch_ll.S
@@ -0,0 +1,339 @@
Expand Down Expand Up @@ -2185,9 +2137,6 @@ index 0000000000..32d28c7539
+_vpe1_init_done:
+ jr ra
+ END(boot_vpe1)
diff --git a/arch/mips/mach-mtmips/mt7621/spl/serial.c b/arch/mips/mach-mtmips/mt7621/spl/serial.c
new file mode 100644
index 0000000000..5cf093a078
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/serial.c
@@ -0,0 +1,24 @@
Expand Down Expand Up @@ -2215,9 +2164,6 @@ index 0000000000..5cf093a078
+#endif /* CONFIG_CONS_INDEX */
+#endif /* CONFIG_SPL_SERIAL */
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/spl.c b/arch/mips/mach-mtmips/mt7621/spl/spl.c
new file mode 100644
index 0000000000..71d01aa7f5
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/spl.c
@@ -0,0 +1,95 @@
Expand Down Expand Up @@ -2316,9 +2262,6 @@ index 0000000000..71d01aa7f5
+
+ return addr;
+}
diff --git a/arch/mips/mach-mtmips/mt7621/spl/start.S b/arch/mips/mach-mtmips/mt7621/spl/start.S
new file mode 100644
index 0000000000..3cad3567e7
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/spl/start.S
@@ -0,0 +1,226 @@
Expand Down Expand Up @@ -2548,9 +2491,6 @@ index 0000000000..3cad3567e7
+ move ra, zero
+
+ END(_start)
diff --git a/arch/mips/mach-mtmips/mt7621/sram_init.S b/arch/mips/mach-mtmips/mt7621/sram_init.S
new file mode 100644
index 0000000000..03b9eab10b
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/sram_init.S
@@ -0,0 +1,22 @@
Expand All @@ -2576,19 +2516,13 @@ index 0000000000..03b9eab10b
+
+ jr ra
+ END(mips_sram_init)
diff --git a/arch/mips/mach-mtmips/mt7621/tpl/Makefile b/arch/mips/mach-mtmips/mt7621/tpl/Makefile
new file mode 100644
index 0000000000..471ad74249
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/tpl/Makefile
@@ -0,0 +1,4 @@
+
+extra-y += start.o
+
+obj-y += tpl.o
diff --git a/arch/mips/mach-mtmips/mt7621/tpl/start.S b/arch/mips/mach-mtmips/mt7621/tpl/start.S
new file mode 100644
index 0000000000..19b09f7251
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/tpl/start.S
@@ -0,0 +1,161 @@
Expand Down Expand Up @@ -2753,9 +2687,6 @@ index 0000000000..19b09f7251
+ nop
+
+ END(_start)
diff --git a/arch/mips/mach-mtmips/mt7621/tpl/tpl.c b/arch/mips/mach-mtmips/mt7621/tpl/tpl.c
new file mode 100644
index 0000000000..2a828907a3
--- /dev/null
+++ b/arch/mips/mach-mtmips/mt7621/tpl/tpl.c
@@ -0,0 +1,144 @@
Expand Down Expand Up @@ -2903,9 +2834,6 @@ index 0000000000..2a828907a3
+ for (;;)
+ ;
+}
diff --git a/include/configs/mt7621.h b/include/configs/mt7621.h
new file mode 100644
index 0000000000..dac6aa4afb
--- /dev/null
+++ b/include/configs/mt7621.h
@@ -0,0 +1,65 @@
Expand Down Expand Up @@ -2974,6 +2902,3 @@ index 0000000000..dac6aa4afb
+#define CONFIG_SYS_UBOOT_BASE 0
+
+#endif /* __CONFIG_MT7621_H */
--
2.36.1

0 comments on commit e0e74d8

Please sign in to comment.