[PATCH v4 04/20] mips: start.S: avoid overwriting outside gd when clearing global data in stack

2020-02-12 Thread Weijie Gao
cause an exception. To solve this, [PTR_ADDIU t0, PTRSIZE] should be placed before the BLT instruction. Reviewed-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/cpu/start.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v4 10/20] mips: mtmips: rewrite lowlevel codes of mt7628

2020-02-12 Thread Weijie Gao
SK(11, 8)) >> 8, val & GENMASK(3, 0)); - - val = (readl(sysc_base + MT76XX_SYSCFG0_OFFS) & GENMASK(3, 1)) >> 1; - printf("Boot from %s\n", boot_str[val]); +#endif return 0; } diff --git a/arch/mips/mach-mtmips/ddr_cal.c b/arch/mips/mach-mtmips/ddr

[PATCH v4 05/20] sysreset: add reset controller based reboot driver

2020-02-12 Thread Weijie Gao
Some chips provide their sysreset function in reset controller, which is normally a bit written to 1 to perform the sysreset. This patch adds a new sysreset driver to take advantage of it. Reviewed-by: Daniel Schwierzeck Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v3

[PATCH v4 08/20] mips: add a mtmips-specific field to architecture-specific global data

2020-02-12 Thread Weijie Gao
: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/include/asm/global_data.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index 7b4ad083ba..4c30fab871

[PATCH v4 11/20] dts: mtmips: add alternative pinmux node for uart2

2020-02-12 Thread Weijie Gao
This patch adds a new pinmux for UART2, which shares the pins with SPIS. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/dts/mt7628a.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/dts/mt7628a.dtsi b/arch/mips/dts

[PATCH v4 12/20] mips: enable support for appending dtb to spl binary

2020-02-12 Thread Weijie Gao
_image_binary_end is currently missing in u-boot-spl.lds. This patch adds _image_binary_end to u-boot-spl.lds to make sure linking u-boot-spl will not fail. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/cpu/u-boot-spl.lds | 2

[PATCH v4 13/20] mips: add an option to enable u_boot_list section for SPL loaders in u-boot-spl.lds

2020-02-12 Thread Weijie Gao
enabled. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/Kconfig| 6 ++ arch/mips/cpu/u-boot-spl.lds | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips

[PATCH v4 03/20] mips: add an option to support initialize SRAM for initial stack

2020-02-12 Thread Weijie Gao
-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/Kconfig | 9 + arch/mips/cpu/start.S | 7 +++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 5e20feeefb..bf30a56101

[PATCH v4 02/20] mips: mtmips: add predefined i-cache/d-cache size and linesize

2020-02-12 Thread Weijie Gao
Both mt7620 and mt7628 has the same cache configuration. There is no need to use CONFIG_SYS_CACHE_SIZE_AUTO to probe it at runtime. Add them into Kconfig to reduce some code size. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/mach-mtmips/Kconfig

Re: [PATCH v4 17/20] spl: nor: add lzma decompression support for legacy image

2020-02-12 Thread Weijie Gao
On Wed, 2020-02-12 at 09:22 +0100, Simon Goldschmidt wrote: > On Wed, Feb 12, 2020 at 8:49 AM Weijie Gao wrote: > > > > This patch adds support for decompressing LZMA compressed u-boot payload in > > legacy uImage format. > > > > Using this patch together with

[PATCH v5 01/20] mips: add support to restore exception vector base before booting linux

2020-02-12 Thread Weijie Gao
exception vector base to its previous value, or a user configured value before booting linux kernel. Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/Kconfig | 30 + arch/mips/include/asm/u-boot-mips.h

[PATCH v5 00/20] Refactor the architecture parts of mt7628

2020-02-12 Thread Weijie Gao
dd a test for binman etype u-boot-lzma-img to make sure binman passes 100% code coverage * Use u-boot-with-spl.bin for SPL-enabled output file * Remove unused code from spl_nor loader. Weijie Gao (20): mips: add support to restore exception vector base before booting linux mips: mtmips:

[PATCH v5 04/20] mips: start.S: avoid overwriting outside gd when clearing global data in stack

2020-02-12 Thread Weijie Gao
cause an exception. To solve this, [PTR_ADDIU t0, PTRSIZE] should be placed before the BLT instruction. Reviewed-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/cpu/start.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v5 02/20] mips: mtmips: add predefined i-cache/d-cache size and linesize

2020-02-12 Thread Weijie Gao
Both mt7620 and mt7628 has the same cache configuration. There is no need to use CONFIG_SYS_CACHE_SIZE_AUTO to probe it at runtime. Add them into Kconfig to reduce some code size. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/mach-mtmips/Kconfig

[PATCH v5 05/20] sysreset: add reset controller based reboot driver

2020-02-12 Thread Weijie Gao
Some chips provide their sysreset function in reset controller, which is normally a bit written to 1 to perform the sysreset. This patch adds a new sysreset driver to take advantage of it. Reviewed-by: Daniel Schwierzeck Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v3

[PATCH v5 08/20] mips: add a mtmips-specific field to architecture-specific global data

2020-02-12 Thread Weijie Gao
: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/include/asm/global_data.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index 7b4ad083ba..4c30fab871

[PATCH v5 03/20] mips: add an option to support initialize SRAM for initial stack

2020-02-12 Thread Weijie Gao
-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/Kconfig | 9 + arch/mips/cpu/start.S | 7 +++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 5e20feeefb..bf30a56101

[PATCH v5 06/20] mips: mtmips: make use of sysreset-resetctrl for mt7628 soc

2020-02-12 Thread Weijie Gao
This patch replaces sysreset-syscon with sysreset-resetctrl for mt7628 soc. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/dts/mt7628a.dtsi | 10 +- arch/mips/mach-mtmips/Kconfig

[PATCH v5 10/20] mips: mtmips: rewrite lowlevel codes of mt7628

2020-02-12 Thread Weijie Gao
SK(11, 8)) >> 8, val & GENMASK(3, 0)); - - val = (readl(sysc_base + MT76XX_SYSCFG0_OFFS) & GENMASK(3, 1)) >> 1; - printf("Boot from %s\n", boot_str[val]); +#endif return 0; } diff --git a/arch/mips/mach-mtmips/ddr_cal.c b/arch/mips/mach-mtmips/ddr

[PATCH v5 09/20] mips: add a option to support not reserving malloc space on initial stack

2020-02-12 Thread Weijie Gao
The initial stack on some platforms is too small to hold a large malloc space. This patch adds a option to allow these platforms not reserving the malloc space on initial stack. These platforms should set the malloc base after DRAM is usable. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao

[PATCH v5 07/20] configs: enable CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips boards

2020-02-12 Thread Weijie Gao
This patch enables CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips boards. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- configs/gardena-smart-gateway-mt7688-ram_defconfig | 1 + configs/gardena-smart-gateway

[PATCH v5 12/20] mips: enable support for appending dtb to spl binary

2020-02-12 Thread Weijie Gao
_image_binary_end is currently missing in u-boot-spl.lds. This patch adds _image_binary_end to u-boot-spl.lds to make sure linking u-boot-spl will not fail. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/cpu/u-boot-spl.lds | 2

[PATCH v5 11/20] dts: mtmips: add alternative pinmux node for uart2

2020-02-12 Thread Weijie Gao
This patch adds a new pinmux for UART2, which shares the pins with SPIS. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/dts/mt7628a.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/dts/mt7628a.dtsi b/arch/mips/dts

[PATCH v5 14/20] lib: enable lzma decompression support for SPL build

2020-02-12 Thread Weijie Gao
This patch enables LZMA decompression support for SPL build Reviewed-by: Stefan Roese Reviewed-by: Tom Rini Signed-off-by: Weijie Gao --- Changes since v3: none --- lib/Kconfig | 5 + lib/Makefile | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index

[PATCH v5 16/20] tools: binman: add etype file for u-boot-lzma-img

2020-02-12 Thread Weijie Gao
This patch adds etype u-boot-lzma-img for binman. README.entries is also updated. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: add a test to make sure 100% code coverage --- tools/binman/README.entries | 15 tools/binman/etype

[PATCH v5 13/20] mips: add an option to enable u_boot_list section for SPL loaders in u-boot-spl.lds

2020-02-12 Thread Weijie Gao
enabled. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v3: none --- arch/mips/Kconfig| 6 ++ arch/mips/cpu/u-boot-spl.lds | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips

[PATCH v5 17/20] spl: nor: add lzma decompression support for legacy image

2020-02-12 Thread Weijie Gao
This patch adds support for decompressing LZMA compressed u-boot payload in legacy uImage format. Using this patch together with u-boot-lzma.img is useful for NOR flashes as they can reduce the size and load time of u-boot payload. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao

[PATCH v5 18/20] mips: mtmips: add SPL support

2020-02-12 Thread Weijie Gao
spl loader is added to support uncompress the payload. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: generate output file using u-boot-with-spl.bin --- Makefile| 6 +++ arch/mips/Kconfig | 3 ++ arch/mips/

[PATCH v5 15/20] Makefile: add support to generate LZMA compressed u-boot image

2020-02-12 Thread Weijie Gao
This patch adds support for generating LZMA compressed u-boot image. The compressed image can be used for SPL to reduce the size of the u-boot binary. Reviewed-by: Stefan Roese Reviewed-by: Daniel Schwierzeck Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v3: none

[PATCH v5 20/20] mips: mtmips: add support for mt7628-rfb

2020-02-12 Thread Weijie Gao
This patch adds support for mt7628 reference board. SPL_DM and DT are not enabled for SPL to save about 17KiB for u-boot-spl.bin. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: add CONFIG_SPL_PAD_TO=0 to make sure no padding added --- arch/mips/dts/Makefile

[PATCH v5 19/20] mips: mtmips: enable SPL for all boards

2020-02-12 Thread Weijie Gao
This patch enables SPL for all mtmips boards. And also remove defconfig files which are intend to build ram bootable u-boot files. SPL_DM and OF_CONTROL are enabled for both boards. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: add CONFIG_SPL_PAD_TO=0 to make sure

[PATCH 02/18] mips: mtmips: move mt7628 related Kconfig into mt7628 subdirectory

2020-10-16 Thread Weijie Gao
This patch is a preparation for add a new soc fot mtmips. Move all mt7628 related Kconfig (boards and UART selection) into mt7628 subdirectory and make sure the top directory of mtmips contains only selection for SoCs. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/Kconfig| 53

[PATCH 03/18] mips: mtmips: fix dram size detection in dram_init

2020-10-16 Thread Weijie Gao
CONFIG_SYS_SDRAM_BASE points to cached memory, i.e. KSEG0, which is not suitable for detecting memory size. Replace CONFIG_SYS_SDRAM_BASE with KSEG1, and make dram_init() always do memory size detection in any stage. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/cpu.c | 5 ++--- 1 file

[PATCH 01/18] mips: dts: switch to board defines for dtb for mtmips

2020-10-16 Thread Weijie Gao
igned-off-by: Weijie Gao --- arch/mips/dts/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index dc85901dca..e82f96d4e4 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -1,8 +1,5 @@ # SPDX-Li

[PATCH 00/18] Add support for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
drivers which are useful in u-boot, like usb, sdhc, ethernet, spi and serial. Booting from NAND is currently unsupported. Thanks, Weijie Weijie Gao (18): mips: dts: switch to board defines for dtb for mtmips mips: mtmips: move mt7628 related Kconfig into mt7628 subdirectory mips: mtmips: fix

[PATCH 06/18] mips: mtmips: add two reference boards for mt7620

2020-10-16 Thread Weijie Gao
The mt7620_rfb board supports integrated 10/100M PHYs plus two external giga PHYs. It also has 8MB SPI-NOR, mini PCI-e x1 slot, SDHC and USB. The mt7620_mt7530_rfb boards supports an external MT7530 giga switch and a 16MB SPI-NOR flash. Signed-off-by: Weijie Gao --- arch/mips/dts/Makefile

[PATCH 04/18] mips: mtmips: add support to initialize SDRAM

2020-10-16 Thread Weijie Gao
This patch adds support for mtmips SoCs to initialize the SDRAM. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/ddr_init.c | 59 arch/mips/mach-mtmips/include/mach/ddr.h | 4 ++ 2 files changed, 63 insertions(+) diff --git a/arch/mips/mach-mtmips

[PATCH 05/18] mips: mtmips: add support for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds support for MediaTek MT7620 SoC. All files are dedicated for u-boot. Signed-off-by: Weijie Gao --- arch/mips/dts/mt7620-u-boot.dtsi | 38 +++ arch/mips/dts/mt7620.dtsi | 302 ++ arch/mips/mach-mtmips/Kconfig | 22

[PATCH 08/18] serial: add uart driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
registers (DLL and DLM). The driver can be built without DM which is useful for tiny SPL. Signed-off-by: Weijie Gao --- drivers/serial/Kconfig | 20 ++ drivers/serial/Makefile| 1 + drivers/serial/serial.c| 2 + drivers/serial/serial_mt7620.c | 350

[PATCH 07/18] configs: mtmips: refresh for mt7628 based boards

2020-10-16 Thread Weijie Gao
Since mt7620 is added into Kconfig, the CONFIG_SOC_MT7628=y which is omitted by default must be added back, otherwise make xxx_defconfig for these boards will be configured for mt7620 platform. Signed-off-by: Weijie Gao --- configs/gardena-smart-gateway-mt7688_defconfig | 1 + configs/linkit

[PATCH 09/18] clk: add clock driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds a clock driver for MediaTek MT7620 SoC. This driver provides clock gate control as well as getting clock frequency for CPU/SYS/XTAL and some peripherals. Signed-off-by: Weijie Gao --- drivers/clk/mtmips/Makefile| 1 + drivers/clk/mtmips/clk-mt7620.c| 154

[PATCH 10/18] reset: mtmips: add reset controller support for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds reset controller bits definition header file for MediaTek MT7620 SoC Signed-off-by: Weijie Gao --- include/dt-bindings/reset/mt7620-reset.h | 35 1 file changed, 35 insertions(+) create mode 100644 include/dt-bindings/reset/mt7620-reset.h diff --git a

[PATCH 14/18] spi: add spi controller support for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
register groups cannot operates simulataneously so they are implemented as one controller. Signed-off-by: Weijie Gao --- drivers/spi/Kconfig | 7 + drivers/spi/Makefile | 1 + drivers/spi/mt7620_spi.c | 277 +++ 3 files changed, 285 insertions

[PATCH 11/18] pinctrl: mtmips: add support for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds pinctrl support for MediaTek MT7620 SoC. The MT7620 SoC supports only pinmux. Signed-off-by: Weijie Gao --- drivers/pinctrl/mtmips/Kconfig | 9 ++ drivers/pinctrl/mtmips/Makefile | 1 + drivers/pinctrl/mtmips/pinctrl-mt7620.c | 199

[PATCH 13/18] gpio: add GPIO controller driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds GPIO controller driver for MediaTek MT7620 SoC Signed-off-by: Weijie Gao --- drivers/gpio/Kconfig | 8 ++ drivers/gpio/Makefile | 1 + drivers/gpio/mt7620_gpio.c | 146 + 3 files changed, 155 insertions(+) create mode 100644

[PATCH 12/18] watchdog: add watchdog driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds watchdog support for the Mediatek MT7620 SoC Signed-off-by: Weijie Gao --- drivers/watchdog/Kconfig | 7 ++ drivers/watchdog/Makefile | 1 + drivers/watchdog/mt7620_wdt.c | 119 ++ 3 files changed, 127 insertions(+) create mode

[PATCH 17/18] mmc: mtk-sd: add pad control settings for MediaTek MT7620/MT76x8 SoCs

2020-10-16 Thread Weijie Gao
mt7622 is added. Signed-off-by: Weijie Gao --- drivers/mmc/mtk-sd.c | 122 +-- 1 file changed, 119 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 30fe7a0aa2..f3f0d5b7e2 100644 --- a/drivers/mmc/mtk-sd.c +++ b

[PATCH 18/18] MAINTAINERS: add maintainer for MediaTek MIPS platform

2020-10-16 Thread Weijie Gao
Update maintainer for MediaTek MIPS platform Signed-off-by: Weijie Gao --- MAINTAINERS | 23 +++ 1 file changed, 23 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index fb9ba37984..f9a7a2c4b7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -790,6 +790,29 @@ F: drivers

[PATCH 15/18] phy: add USB PHY driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
This patch adds USB PHY driver for MediaTek MT7620 SoC Signed-off-by: Weijie Gao --- drivers/phy/Kconfig | 7 +++ drivers/phy/Makefile | 1 + drivers/phy/mt7620-usb-phy.c | 108 +++ 3 files changed, 116 insertions(+) create mode 100644

[PATCH 16/18] net: add ethernet driver for MediaTek MT7620 SoC

2020-10-16 Thread Weijie Gao
the intergrited FE PHY, or the xMII. Port 5 always connects to the xMII. Port 6 is the CPU port. This driver supports MT7530 giga switch connects to port 5. Signed-off-by: Weijie Gao --- drivers/net/Kconfig | 12 + drivers/net/Makefile |1 + drivers/net/mt7620-eth.c | 1222

[PATCH 04/16] mips: add an option to support customized get_tbclk()

2020-01-07 Thread Weijie Gao
() is used before setting up CPU frequency, it will be very inaccurate. This patch adds an option to allow a mach to define its own get_tbclk(). Signed-off-by: Weijie Gao --- arch/mips/Kconfig| 8 arch/mips/cpu/time.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/arch/mips

[PATCH 05/16] mips: add an option to support initialize SRAM for initial stack

2020-01-07 Thread Weijie Gao
-by: Weijie Gao --- arch/mips/Kconfig | 9 + arch/mips/cpu/start.S | 7 +++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 52afbf79c5..015a7f6358 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -402,6 +402,15 @@ config

[PATCH 02/16] mips: add support to restore exception vector base before booting linux

2020-01-07 Thread Weijie Gao
exception vector base to 0x8000 before booting linux kernel. Signed-off-by: Weijie Gao --- arch/mips/Kconfig | 13 + arch/mips/lib/bootm.c | 9 + 2 files changed, 22 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a3ae603044..4688717593 100644

[PATCH 03/16] mips: mtmips: add predefined i-cache/d-cache size and linesize

2020-01-07 Thread Weijie Gao
Both mt7620 and mt7628 has the same cache configuration. There is no need to use CONFIG_SYS_CACHE_SIZE_AUTO to probe it at runtime. Add them into Kconfig to reduce some code size. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/Kconfig | 12 1 file changed, 12 insertions

[PATCH 01/16] configs: mtmips: add missing board selection for gardena-smart-gateway-mt7688

2020-01-07 Thread Weijie Gao
The two defconfig files for gardena-smart-gateway-mt7688 are missing CONFIG_BOARD_GARDENA_SMART_GATEWAY_MT7688. This will cause a compilation issue when adding a new board in front of gardena in Kconfig. This patch fixes this issue by adding this config to defconfig files. Signed-off-by: Weijie

[PATCH 06/16] mips: start.S: avoid overwriting outside gd when clearing global data in stack

2020-01-07 Thread Weijie Gao
cause an exception. To solve this, [PTR_ADDIU t0, PTRSIZE] should be placed before the BLT instruction. Signed-off-by: Weijie Gao --- arch/mips/cpu/start.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S index f9805fa000

[PATCH 08/16] mips: mtmips: rewrite lowlevel codes of mt7628

2020-01-07 Thread Weijie Gao
gned-off-by: Weijie Gao --- arch/mips/dts/mt7628a.dtsi| 76 +--- arch/mips/include/asm/global_data.h | 3 + arch/mips/mach-mtmips/Kconfig | 71 +--- arch/mips/mach-mtmips/Makefile| 7 +- arch/mips/mach-mtmips/cpu.c

[PATCH 11/16] lib: enable lzma decompression support for SPL build

2020-01-07 Thread Weijie Gao
This patch enables LZMA decompression support for SPL build Signed-off-by: Weijie Gao --- lib/Kconfig | 5 + lib/Makefile | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index 965cf7bc03..2f38e37802 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -418,6

[PATCH 10/16] mips: unconditionally enable u_boot_list section in u-boot-spl.lds

2020-01-07 Thread Weijie Gao
u_boot_list is not only used by DM, but also by some SPL image load methods such as spl_nor.c. This patch removes CONFIG_SPL_DM surrounding the u_boot_list section to make sure SPL image load methods can be correctly built into u-boot without DM enabled. Signed-off-by: Weijie Gao --- arch/mips

[PATCH 09/16] mips: dts: rename mt7628a.dtsi to mt7628.dtsi

2020-01-07 Thread Weijie Gao
Actually mt7628a.dtsi can be used for both MT7628A/N/K, so just rename it to a common name. Signed-off-by: Weijie Gao --- arch/mips/dts/gardena-smart-gateway-mt7688.dts | 2 +- arch/mips/dts/linkit-smart-7688.dts| 2 +- arch/mips/dts/{mt7628a.dtsi => mt7628.dtsi}| 2 +- 3 fi

[PATCH 12/16] Makefile: add support to generate LZMA compressed u-boot image

2020-01-07 Thread Weijie Gao
This patch adds support for generating LZMA compressed u-boot image. The compressed image can be used for SPL to reduce the size of the u-boot binary. Signed-off-by: Weijie Gao --- Makefile | 13 + 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index e20a206239

[PATCH 15/16] mips: mtmips: enable SPL for all boards

2020-01-07 Thread Weijie Gao
This patch enables SPL for all mtmips boards. And also remove defconfig files which are intend to build ram bootable u-boot files. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/Kconfig | 26 --- board/gardena/smart-gateway-mt7688/board.c| 2 + ...gardena-smart

[PATCH 16/16] mips: mtmips: add support for mt7628-rfb

2020-01-07 Thread Weijie Gao
This patch adds support for mt7628 reference board Signed-off-by: Weijie Gao --- arch/mips/dts/Makefile| 1 + arch/mips/dts/mediatek,mt7628-rfb-u-boot.dtsi | 24 + arch/mips/dts/mediatek,mt7628-rfb.dts | 67 arch/mips/mach-mtmips/Kconfig

[PATCH 14/16] mips: mtmips: add SPL support

2020-01-07 Thread Weijie Gao
eed to add a separate config for it. Signed-off-by: Weijie Gao --- Makefile | 9 + arch/mips/Kconfig| 2 ++ arch/mips/dts/mt7628-u-boot.dtsi | 25 + arch/mips/mach-mtmips/Kconfig| 4 arch/mips/mach-mtmips/Makef

[PATCH 13/16] tools: binman: add etype file for u-boot-lzma-img

2020-01-07 Thread Weijie Gao
This patch adds etype u-boot-lzma-img for binman Signed-off-by: Weijie Gao --- tools/binman/etype/u_boot_lzma_img.py | 27 +++ 1 file changed, 27 insertions(+) create mode 100644 tools/binman/etype/u_boot_lzma_img.py diff --git a/tools/binman/etype/u_boot_lzma_img.py

[PATCH 00/16] Refactor the architecture parts of mt7628

2020-01-07 Thread Weijie Gao
the compressed image. Weijie Gao (16): configs: mtmips: add missing board selection for gardena-smart-gateway-mt7688 mips: add support to restore exception vector base before booting linux mips: mtmips: add predefined i-cache/d-cache size and linesize mips: add an option to sup

[PATCH 07/16] sysreset: add reset controller based reboot driver

2020-01-07 Thread Weijie Gao
Some chips provide their sysreset function in reset controller, which is normally a bit written to 1 to perform the sysreset. This patch adds a new sysreset driver to take advantage of it. Signed-off-by: Weijie Gao --- drivers/sysreset/Kconfig | 6 drivers/sysreset/Makefile

Re: [PATCH 11/16] lib: enable lzma decompression support for SPL build

2020-01-09 Thread Weijie Gao
On Wed, 2020-01-08 at 08:22 +0100, Heinrich Schuchardt wrote: > > On 1/8/20 4:01 AM, Weijie Gao wrote: > > This patch enables LZMA decompression support for SPL build > > > > Signed-off-by: Weijie Gao > > --- > > lib/Kconfig | 5 + > > l

Re: [PATCH 02/16] mips: add support to restore exception vector base before booting linux

2020-01-09 Thread Weijie Gao
On Wed, 2020-01-08 at 15:29 +0100, Daniel Schwierzeck wrote: > > Am 08.01.20 um 04:00 schrieb Weijie Gao: > > In U-Boot the exception vector base will be moved to top of memory, to be > > used to display register dump when exception occurs. > > > > But some old l

Re: [PATCH 04/16] mips: add an option to support customized get_tbclk()

2020-01-09 Thread Weijie Gao
On Wed, 2020-01-08 at 15:32 +0100, Daniel Schwierzeck wrote: > > Am 08.01.20 um 04:01 schrieb Weijie Gao: > > Some systems boot up at a very low CPU frequency and set up a higher CPU > > frequency in lowlevel initialization. > > > > Currently

Re: [PATCH 10/16] mips: unconditionally enable u_boot_list section in u-boot-spl.lds

2020-01-09 Thread Weijie Gao
On Wed, 2020-01-08 at 17:11 +0100, Daniel Schwierzeck wrote: > > Am 08.01.20 um 04:01 schrieb Weijie Gao: > > u_boot_list is not only used by DM, but also by some SPL image load methods > > such as spl_nor.c. > > > > This patch removes CONFIG_SPL_DM surround

Re: [PATCH 08/16] mips: mtmips: rewrite lowlevel codes of mt7628

2020-01-09 Thread Weijie Gao
On Wed, 2020-01-08 at 16:56 +0100, Daniel Schwierzeck wrote: > > Am 08.01.20 um 04:01 schrieb Weijie Gao: > > This patch rewrites the mtmips architecture with the following changes: > > > > 1. Move MT7628 soc parts into a subfolder. > > 2. Lock parts of D-C

Re: [PATCH 00/16] Refactor the architecture parts of mt7628

2020-01-09 Thread Weijie Gao
Hi Stefan, On Thu, 2020-01-09 at 08:52 +0100, Stefan Roese wrote: > Hi Weijie, > > On 08.01.20 03:59, Weijie Gao wrote: > > This patch series are divided into two parts: > > > > The main part is to rewrite the whole architecture code of mt7628: > > 1. Lock parts

Re: [PATCH v2 2/2] Port to new board "VoCore2"

2020-01-09 Thread Weijie Gao
Hi Mauro, As far as I know MT7628 only has a hw crypto engine. I have only the same programming guide as yours so I can't tell you what does the "RESV1 Select Random Generator mode" mean. Best Regards, Weijie On Wed, 2020-01-08 at 14:37 +0100, Daniel Schwierzeck wrote: > +cc Weijie > > On 1/7

Re: [PATCH 11/16] lib: enable lzma decompression support for SPL build

2020-01-10 Thread Weijie Gao
On Thu, 2020-01-09 at 12:45 -0500, Tom Rini wrote: > On Thu, Jan 09, 2020 at 04:10:12PM +0800, Weijie Gao wrote: > > On Wed, 2020-01-08 at 08:22 +0100, Heinrich Schuchardt wrote: > > > > > > On 1/8/20 4:01 AM, Weijie Gao wrote: > > > > This patch enables L

Re: [PATCH 00/16] Refactor the architecture parts of mt7628

2020-01-10 Thread Weijie Gao
On Thu, 2020-01-09 at 13:36 +0100, Stefan Roese wrote: > Hi Weijie, > > On 09.01.20 09:49, Weijie Gao wrote: > > On Thu, 2020-01-09 at 08:52 +0100, Stefan Roese wrote: > >> Hi Weijie, > >> > >> On 08.01.20 03:59, Weijie Gao wrote: > >

[PATCH v2 07/21] configs: enable CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips boards

2020-01-16 Thread Weijie Gao
This patch enables CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips boards. Signed-off-by: Weijie Gao --- Changes since v1: Splitted from another patch. --- configs/gardena-smart-gateway-mt7688-ram_defconfig | 1 + configs/gardena-smart-gateway-mt7688_defconfig | 1 + configs/linkit

[PATCH v2 00/21] Refactor the architecture parts of mt7628

2020-01-16 Thread Weijie Gao
RTs for SPL. 9. Rewrite u_boot_lzma_img.py. Weijie Gao (21): mips: add support to restore exception vector base before booting linux mips: mtmips: add predefined i-cache/d-cache size and linesize mips: add an option to support initialize SRAM for initial stack mips: start.S: avoid overw

[PATCH v2 06/21] mips: mtmips: make use of sysreset-resetctrl for mt7628 soc

2020-01-16 Thread Weijie Gao
This patch replaces sysreset-syscon with sysreset-resetctrl for mt7628 soc. Signed-off-by: Weijie Gao --- Changes since v1: splitted from another patch. --- arch/mips/dts/mt7628a.dtsi | 10 +- arch/mips/mach-mtmips/Kconfig | 1 + configs

[PATCH v2 03/21] mips: add an option to support initialize SRAM for initial stack

2020-01-16 Thread Weijie Gao
-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v1: none --- arch/mips/Kconfig | 9 + arch/mips/cpu/start.S | 7 +++ 2 files changed, 16 insertions(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 5e20feeefb..bf30a56101

[PATCH v2 02/21] mips: mtmips: add predefined i-cache/d-cache size and linesize

2020-01-16 Thread Weijie Gao
Both mt7620 and mt7628 has the same cache configuration. There is no need to use CONFIG_SYS_CACHE_SIZE_AUTO to probe it at runtime. Add them into Kconfig to reduce some code size. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v1: none --- arch/mips/mach-mtmips/Kconfig

[PATCH v2 04/21] mips: start.S: avoid overwriting outside gd when clearing global data in stack

2020-01-16 Thread Weijie Gao
cause an exception. To solve this, [PTR_ADDIU t0, PTRSIZE] should be placed before the BLT instruction. Reviewed-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v1: none --- arch/mips/cpu/start.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v2 05/21] sysreset: add reset controller based reboot driver

2020-01-16 Thread Weijie Gao
Some chips provide their sysreset function in reset controller, which is normally a bit written to 1 to perform the sysreset. This patch adds a new sysreset driver to take advantage of it. Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v1: none --- drivers/sysreset

[PATCH v2 11/21] dts: mtmips: remove all unusable nodes and properties from mt7628s.dtsi

2020-01-16 Thread Weijie Gao
This patch removes all unused and unusable nodes and properties from mt7628s.dtsi. Signed-off-by: Weijie Gao --- Changes since v1: splitted from another patch --- arch/mips/dts/mt7628a.dtsi | 68 -- 1 file changed, 68 deletions(-) diff --git a/arch/mips/dts

[PATCH v2 12/21] dts: mtmips: add u-boot, dm-pre-reloc for some nodes in mt7628a.dtsi

2020-01-16 Thread Weijie Gao
To enable DM support in SPL, some necessary nodes must be reserved for serial, clk, sysreset and other drivers. This patch adds u-boot,dm-pre-reloc for these nodes. Signed-off-by: Weijie Gao --- Changes since v1: newly added --- arch/mips/dts/mt7628a.dtsi | 12 1 file changed, 12

[PATCH v2 14/21] mips: enable support for appending dtb to spl binary

2020-01-16 Thread Weijie Gao
_image_binary_end is currently missing in u-boot-spl.lds. This patch adds _image_binary_end to u-boot-spl.lds to make sure linking u-boot-spl will not fail. Signed-off-by: Weijie Gao --- Changes since v1: newly added --- arch/mips/cpu/u-boot-spl.lds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch

[PATCH v2 08/21] mips: add a mtmips-specific field to architecture-specific global data

2020-01-16 Thread Weijie Gao
: Weijie Gao --- Changes since v1: splitted from another patch. --- arch/mips/include/asm/global_data.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h index 7b4ad083ba..4c30fab871 100644 --- a/arch/mips/include/asm

[PATCH v2 13/21] dts: mtmips: add alternative pinmux node for uart2

2020-01-16 Thread Weijie Gao
This patch adds a new pinmux for UART2, which shares the pins with SPIS. Signed-off-by: Weijie Gao --- Changes since v1: newly added --- arch/mips/dts/mt7628a.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/dts/mt7628a.dtsi b/arch/mips/dts/mt7628a.dtsi index 744594c45a

[PATCH v2 15/21] mips: add an option to enable u_boot_list section for SPL loaders in u-boot-spl.lds

2020-01-16 Thread Weijie Gao
enabled. Signed-off-by: Weijie Gao --- Changes since v1: uses a new config instead of removing CONFIG_SPL_DM --- arch/mips/cpu/u-boot-spl.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/cpu/u-boot-spl.lds b/arch/mips/cpu/u-boot-spl.lds index e467491639

[PATCH v2 16/21] lib: enable lzma decompression support for SPL build

2020-01-16 Thread Weijie Gao
This patch enables LZMA decompression support for SPL build Reviewed-by: Tom Rini Signed-off-by: Weijie Gao --- Changes since v1: none --- lib/Kconfig | 5 + lib/Makefile | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/Kconfig b/lib/Kconfig index d040a87d26..6e491c3552 100644

[PATCH v2 17/21] Makefile: add support to generate LZMA compressed u-boot image

2020-01-16 Thread Weijie Gao
This patch adds support for generating LZMA compressed u-boot image. The compressed image can be used for SPL to reduce the size of the u-boot binary. Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v1: none --- Makefile | 13 + 1 file changed, 13 insertions

[PATCH v2 20/21] mips: mtmips: enable SPL for all boards

2020-01-16 Thread Weijie Gao
This patch enables SPL for all mtmips boards. And also remove defconfig files which are intend to build ram bootable u-boot files. SPL_DM and OF_CONTROL are enabled for both boards. Signed-off-by: Weijie Gao --- Changes since v1: enabled DM & DT support, enabled compression support ---

[PATCH v2 18/21] tools: binman: add etype file for u-boot-lzma-img

2020-01-16 Thread Weijie Gao
This patch adds etype u-boot-lzma-img for binman. README.entries is also updated. Signed-off-by: Weijie Gao --- Changes since v1: updated README.entries, modified copyright and description. --- tools/binman/README.entries | 15 ++ tools/binman/etype/u_boot_lzma_img.py | 28

[PATCH v2 21/21] mips: mtmips: add support for mt7628-rfb

2020-01-16 Thread Weijie Gao
This patch adds support for mt7628 reference board. SPL_DM and DT are not enabled for SPL to save about 17KiB for u-boot-spl.bin. Signed-off-by: Weijie Gao --- Changes since v1: moved spl loader to another patch. --- arch/mips/dts/Makefile| 1 + arch/mips/dts/mediatek,mt7628

[PATCH v2 19/21] mips: mtmips: add SPL support

2020-01-16 Thread Weijie Gao
spl loader is added to support uncompress the payload. Signed-off-by: Weijie Gao --- Changes since v1: move spl loader into this patch. add full pinmux for all three uarts. add optional DM & DT support. --- Makefile| 9 ++ arch/mips/

[PATCH v2 10/21] mips: mtmips: rewrite lowlevel codes of mt7628

2020-01-16 Thread Weijie Gao
detection for DDR1 and DDR2. 6. Use accurate CPU clock depending on the input xtal frequency for timer and delay functions. Note: print_cpuinfo() has incompatible parts with MT7620 so it's moved into mt7628 subfolder. Signed-off-by: Weijie Gao --- Changes since v1: moved some changes t

[PATCH v2 01/21] mips: add support to restore exception vector base before booting linux

2020-01-16 Thread Weijie Gao
exception vector base to its previous value, or a user configured value before booting linux kernel. Signed-off-by: Weijie Gao --- Changes since v1: Moved core operations to trap_restore() in arch/mips/lib/traps.c. Save previous ebase instead of using 0x8000 directly. Add options to use

[PATCH v2 09/21] mips: add a option to support not reserving malloc space on initial stack

2020-01-18 Thread Weijie Gao
The initial stack on some platforms is too small to hold a large malloc space. This patch adds a option to allow these platforms not reserving the malloc space on initial stack. These platforms should set the malloc base after DRAM is usable. Signed-off-by: Weijie Gao --- Changes since v1: newly

Re: [PATCH v2 00/21] Refactor the architecture parts of mt7628

2020-01-18 Thread Weijie Gao
On Fri, 2020-01-17 at 15:40 +0100, Stefan Roese wrote: > Hi Weijie, > > I've added another of my mail addresses to cc (m...@roese.nl) as the > sending to the other 2 addresses does not seem to work. > > On 17.01.20 08:45, Weijie Gao wrote: > > This patch seri

Re: [PATCH v2 11/21] dts: mtmips: remove all unusable nodes and properties from mt7628s.dtsi

2020-01-18 Thread Weijie Gao
On Fri, 2020-01-17 at 15:42 +0100, Stefan Roese wrote: > On 17.01.20 08:45, Weijie Gao wrote: > > This patch removes all unused and unusable nodes and properties from > > mt7628s.dtsi. > > > > Signed-off-by: Weijie Gao > > --- > > Changes since v1: splitt

<    1   2   3   4   5   6   7   8   >