Skip to content

Commit 58f3dc5

Browse files
committed
Merge tag 'mips-pull-2022-07-13' of https://source.denx.de/u-boot/custodians/u-boot-mips
- MIPS: add drivers and board support for Mediatek MT7621 SoC
2 parents 854d6de + dd6bf53 commit 58f3dc5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5879
-36
lines changed

MAINTAINERS

+8
Original file line numberDiff line numberDiff line change
@@ -1032,15 +1032,23 @@ R: GSS_MTK_Uboot_upstream <[email protected]>
10321032
S: Maintained
10331033
F: arch/mips/mach-mtmips/
10341034
F: arch/mips/dts/mt7620.dtsi
1035+
F: arch/mips/dts/mt7621.dtsi
10351036
F: arch/mips/dts/mt7620-u-boot.dtsi
1037+
F: arch/mips/dts/mt7621-u-boot.dtsi
10361038
F: include/configs/mt7620.h
1039+
F: include/configs/mt7621.h
10371040
F: include/dt-bindings/clock/mt7620-clk.h
1041+
F: include/dt-bindings/clock/mt7621-clk.h
10381042
F: include/dt-bindings/clock/mt7628-clk.h
10391043
F: include/dt-bindings/reset/mt7620-reset.h
1044+
F: include/dt-bindings/reset/mt7621-reset.h
10401045
F: include/dt-bindings/reset/mt7628-reset.h
10411046
F: drivers/clk/mtmips/
10421047
F: drivers/pinctrl/mtmips/
10431048
F: drivers/gpio/mt7620_gpio.c
1049+
F: drivers/mtd/nand/raw/mt7621_nand.c
1050+
F: drivers/mtd/nand/raw/mt7621_nand.h
1051+
F: drivers/mtd/nand/raw/mt7621_nand_spl.c
10441052
F: drivers/net/mt7620-eth.c
10451053
F: drivers/phy/mt7620-usb-phy.c
10461054
F: drivers/reset/reset-mtmips.c

arch/mips/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ head-y := arch/mips/cpu/start.o
44

55
ifeq ($(CONFIG_SPL_BUILD),y)
66
head-$(CONFIG_ARCH_JZ47XX) := arch/mips/mach-jz47xx/start.o
7+
head-$(CONFIG_SOC_MT7621) := arch/mips/mach-mtmips/mt7621/spl/start.o
8+
endif
9+
10+
ifeq ($(CONFIG_TPL_BUILD),y)
11+
head-$(CONFIG_SOC_MT7621) := arch/mips/mach-mtmips/mt7621/tpl/start.o
712
endif
813

914
libs-y += arch/mips/cpu/

arch/mips/cpu/u-boot-spl.lds

+3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ SECTIONS
1313

1414
. = ALIGN(4);
1515
.text : {
16+
__text_start = .;
1617
*(.text*)
18+
__text_end = .;
1719
} > .spl_mem
1820

1921
. = ALIGN(4);
@@ -36,6 +38,7 @@ SECTIONS
3638

3739
. = ALIGN(4);
3840
__image_copy_end = .;
41+
__image_copy_len = __image_copy_end - __text_start;
3942

4043
_image_binary_end = .;
4144

arch/mips/dts/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ dtb-$(CONFIG_BOARD_COMTREND_WAP5813N) += comtrend,wap-5813n.dtb
1616
dtb-$(CONFIG_BOARD_HUAWEI_HG556A) += huawei,hg556a.dtb
1717
dtb-$(CONFIG_BOARD_MT7620_RFB) += mediatek,mt7620-rfb.dtb
1818
dtb-$(CONFIG_BOARD_MT7620_MT7530_RFB) += mediatek,mt7620-mt7530-rfb.dtb
19+
dtb-$(CONFIG_BOARD_MT7621_RFB) += mediatek,mt7621-rfb.dtb
20+
dtb-$(CONFIG_BOARD_MT7621_NAND_RFB) += mediatek,mt7621-nand-rfb.dtb
1921
dtb-$(CONFIG_BOARD_MT7628_RFB) += mediatek,mt7628-rfb.dtb
2022
dtb-$(CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688) += gardena-smart-gateway-mt7688.dtb
2123
dtb-$(CONFIG_BOARD_LINKIT_SMART_7688) += linkit-smart-7688.dtb
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2022 MediaTek Inc. All rights reserved.
4+
*
5+
* Author: Weijie Gao <[email protected]>
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include "mt7621.dtsi"
11+
12+
/ {
13+
compatible = "mediatek,mt7621-nand-rfb", "mediatek,mt7621-soc";
14+
model = "MediaTek MT7621 RFB (NAND)";
15+
16+
aliases {
17+
serial0 = &uart0;
18+
};
19+
20+
chosen {
21+
stdout-path = &uart0;
22+
};
23+
};
24+
25+
&pinctrl {
26+
state_default: pin_state {
27+
nand {
28+
groups = "spi", "sdxc";
29+
function = "nand";
30+
};
31+
32+
gpios {
33+
groups = "i2c", "uart3", "pcie reset";
34+
function = "gpio";
35+
};
36+
37+
wdt {
38+
groups = "wdt";
39+
function = "wdt rst";
40+
};
41+
42+
jtag {
43+
groups = "jtag";
44+
function = "jtag";
45+
};
46+
};
47+
};
48+
49+
&uart0 {
50+
status = "okay";
51+
};
52+
53+
&gpio {
54+
status = "okay";
55+
};
56+
57+
&eth {
58+
status = "okay";
59+
};
60+
61+
&ssusb {
62+
status = "okay";
63+
};
64+
65+
&u3phy {
66+
status = "okay";
67+
};

arch/mips/dts/mediatek,mt7621-rfb.dts

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2022 MediaTek Inc. All rights reserved.
4+
*
5+
* Author: Weijie Gao <[email protected]>
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include "mt7621.dtsi"
11+
12+
/ {
13+
compatible = "mediatek,mt7621-rfb", "mediatek,mt7621-soc";
14+
model = "MediaTek MT7621 RFB (SPI-NOR)";
15+
16+
aliases {
17+
serial0 = &uart0;
18+
spi0 = &spi;
19+
};
20+
21+
chosen {
22+
stdout-path = &uart0;
23+
};
24+
};
25+
26+
&pinctrl {
27+
state_default: pin_state {
28+
gpios {
29+
groups = "i2c", "uart3", "pcie reset";
30+
function = "gpio";
31+
};
32+
33+
wdt {
34+
groups = "wdt";
35+
function = "wdt rst";
36+
};
37+
38+
jtag {
39+
groups = "jtag";
40+
function = "jtag";
41+
};
42+
};
43+
};
44+
45+
&uart0 {
46+
status = "okay";
47+
};
48+
49+
&gpio {
50+
status = "okay";
51+
};
52+
53+
&spi {
54+
status = "okay";
55+
num-cs = <2>;
56+
57+
spi-flash@0 {
58+
#address-cells = <1>;
59+
#size-cells = <1>;
60+
compatible = "jedec,spi-nor";
61+
spi-max-frequency = <25000000>;
62+
reg = <0>;
63+
};
64+
};
65+
66+
&eth {
67+
status = "okay";
68+
};
69+
70+
&mmc {
71+
cap-sd-highspeed;
72+
73+
status = "okay";
74+
};
75+
76+
&ssusb {
77+
status = "okay";
78+
};
79+
80+
&u3phy {
81+
status = "okay";
82+
};

arch/mips/dts/mt7621-u-boot.dtsi

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2022 MediaTek Inc. All rights reserved.
4+
*
5+
* Author: Weijie Gao <[email protected]>
6+
*/
7+
8+
#include <linux/stringify.h>
9+
10+
/ {
11+
binman: binman {
12+
multiple-images;
13+
};
14+
};
15+
16+
&sysc {
17+
u-boot,dm-pre-reloc;
18+
};
19+
20+
&reboot {
21+
u-boot,dm-pre-reloc;
22+
};
23+
24+
&clkctrl {
25+
u-boot,dm-pre-reloc;
26+
};
27+
28+
&rstctrl {
29+
u-boot,dm-pre-reloc;
30+
};
31+
32+
&pinctrl {
33+
u-boot,dm-pre-reloc;
34+
};
35+
36+
&uart0 {
37+
u-boot,dm-pre-reloc;
38+
};
39+
40+
&uart1 {
41+
u-boot,dm-pre-reloc;
42+
};
43+
44+
&uart2 {
45+
u-boot,dm-pre-reloc;
46+
};
47+
48+
&binman {
49+
u-boot-spl-ddr {
50+
align = <4>;
51+
align-size = <4>;
52+
filename = "u-boot-spl-ddr.bin";
53+
pad-byte = <0xff>;
54+
55+
u-boot-spl {
56+
align-end = <4>;
57+
filename = "u-boot-spl.bin";
58+
};
59+
60+
stage_bin {
61+
filename = "mt7621_stage_sram.bin";
62+
type = "blob-ext";
63+
};
64+
};
65+
66+
spl-img {
67+
filename = "u-boot-spl-ddr.img";
68+
69+
mkimage {
70+
#ifdef CONFIG_MT7621_BOOT_FROM_NAND
71+
args = "-T", "mtk_image", "-n", "mt7621=1",
72+
"-a", __stringify(CONFIG_SPL_TEXT_BASE),
73+
"-e", __stringify(CONFIG_SPL_TEXT_BASE);
74+
#else
75+
args = "-A", "mips", "-T", "standalone", "-O", "u-boot",
76+
"-C", "none", "-n", "MT7621 U-Boot SPL",
77+
"-a", __stringify(CONFIG_SPL_TEXT_BASE),
78+
"-e", __stringify(CONFIG_SPL_TEXT_BASE);
79+
#endif
80+
81+
blob {
82+
filename = "u-boot-spl-ddr.bin";
83+
};
84+
};
85+
};
86+
87+
mt7621-uboot {
88+
filename = "u-boot-mt7621.bin";
89+
pad-byte = <0xff>;
90+
91+
#ifndef CONFIG_MT7621_BOOT_FROM_NAND
92+
u-boot-tpl {
93+
align-end = <4>;
94+
filename = "u-boot-tpl.bin";
95+
};
96+
#endif
97+
98+
spl {
99+
#ifdef CONFIG_MT7621_BOOT_FROM_NAND
100+
align-end = <0x1000>;
101+
#endif
102+
filename = "u-boot-spl-ddr.img";
103+
type = "blob";
104+
};
105+
106+
u-boot {
107+
filename = "u-boot-lzma.img";
108+
type = "blob";
109+
};
110+
};
111+
};

0 commit comments

Comments
 (0)