[PATCH v2 30/32] tools: mtk_image: split the code of generating NAND header into a new file

2022-08-31 Thread Weijie Gao
The predefined NAND headers take too much spaces in the mtk_image.c. Moving them into a new file can significantly improve the readability of both mtk_image.c and the new mtk_nand_headers.c. This is a preparation for adding more NAND headers. Reviewed-by: Simon Glass Signed-off-by: Weijie Gao

[PATCH v2 31/32] tools: mtk_image: add support for nand headers used by newer chips

2022-08-31 Thread Weijie Gao
This patch adds more nand headers in two new types: 1. HSM header, used for spi-nand thru SNFI interface 2. SPIM header, used for spi-nand thru spi-mem interface The original nand header is renamed to AP header. Signed-off-by: Weijie Gao --- v2 changes: none --- tools/mtk_image.c| 23

Re: [PATCH v2 28/32] cpu: add basic cpu driver for MediaTek ARM chips

2022-08-31 Thread Weijie Gao
On Wed, 2022-08-31 at 07:46 -0600, Simon Glass wrote: > Hi Weijie, > > On Wed, 31 Aug 2022 at 05:08, Weijie Gao > wrote: > > > > Add basic CPU driver used to retrieve CPU model information. > > > > Signed-off-by: Weijie Gao > > --- > > v

[PATCH v2,RESEND] mmc: mtk-sd: increase the minimum bus frequency

2021-04-20 Thread Weijie Gao
side effects. Signed-off-by: Weijie Gao --- drivers/mmc/mtk-sd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 48a764be82..8599f095bc 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -232,6 +232,8 @@ #define

[PATCH v2,RESEND] mmc: mtk-sd: increase the minimum bus frequency

2021-04-20 Thread Weijie Gao
side effects. Reviewed-by: Jaehoon Chung Signed-off-by: Weijie Gao --- drivers/mmc/mtk-sd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 48a764be82..8599f095bc 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -232,6

[PATCH] arm: dts: medaitek: convert gmac link mode to 2500base-x for mt7986a-bpi-r3-sd

2023-08-03 Thread Weijie Gao
The mt7531 of bpi-r3 is connected to mt7986 with 2.5Gbps HSGMII, not the regular 1Gbps SGMII. Signed-off-by: Weijie Gao --- This is a supplement to commit: aef54ea1 (arm: dts: medaitek: convert gmac link mode to 2500base-x) --- arch/arm/dts/mt7986a-bpi-r3-sd.dts | 4 ++-- 1 file changed, 2

[PATCH 01/60] arm: dts: mt7988-sd-rfb: add SD pin driving settings

2024-01-21 Thread Weijie Gao
Set SD pin driving to 4mA Signed-off-by: Dong Huang Signed-off-by: Weijie Gao --- arch/arm/dts/mt7988-sd-rfb.dts | 2 ++ arch/arm/dts/mt7988.dtsi | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/dts/mt7988-sd-rfb.dts b/arch/arm/dts/mt7988-sd-rfb.dts index a3df37d252

[PATCH 02/60] net: mediatek: add support for adjusting MDIO clock

2024-01-21 Thread Weijie Gao
"ethernet-phy-id31c3.1c12"; ... }; Signed-off-by: Bo-Cun Chen Signed-off-by: Weijie Gao --- drivers/net/mtk_eth.c | 35 +++ drivers/net/mtk_eth.h | 7 +++ 2 files changed, 42 insertions(+) diff --git a/drivers/net/mtk_eth.c b/drivers/net/mt

[PATCH 03/60] net: mediatek: add support for XGMII interface

2024-01-21 Thread Weijie Gao
This patch add XGMII support for connecting 2.5G PHY. Signed-off-by: Bo-Cun Chen Signed-off-by: Weijie Gao --- drivers/net/mtk_eth.c | 22 ++ drivers/net/mtk_eth.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/mtk_eth.c b/drivers/net

[PATCH 1/2] timer: mtk_timer: initialize the timer before use

2021-01-11 Thread Weijie Gao
s the initialization code to avoid them. Signed-off-by: Weijie Gao --- drivers/timer/mtk_timer.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/timer/mtk_timer.c b/drivers/timer/mtk_timer.c index 448a76a7e1..f6b97f868c 100644 --- a/drivers/timer/mtk_timer.c +++ b/drivers/

[PATCH 2/2] dts: mt7622: use accurate clock source fot mtk_timer

2021-01-11 Thread Weijie Gao
The input system clock for mt7622 timer is 10MHz and can be retrieved through the clk driver. Signed-off-by: Weijie Gao --- arch/arm/dts/mt7622.dtsi | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/dts/mt7622.dtsi b/arch/arm/dts/mt7622.dtsi index d888545809

Re: [PATCH 1/2] timer: mtk_timer: initialize the timer before use

2021-01-17 Thread Weijie Gao
On Fri, 2021-01-15 at 17:36 +0100, Matthias Brugger wrote: > On Tue, Jan 12, 2021 at 01:44:02PM +0800, Weijie Gao wrote: > > The timer being used by this driver may have already been used by first > > stage bootloader (e.g. ATF/preloader), and it's settings may differ from >

Re: [PATCH v4 01/23] mips: dts: switch to board defines for dtb for mtmips

2021-01-18 Thread Weijie Gao
On Fri, 2020-11-27 at 21:19 +0100, Daniel Schwierzeck wrote: > Am Donnerstag, den 12.11.2020, 16:35 +0800 schrieb Weijie Gao: > > Previous the dts files for gardena-smart-gateway-mt7688 and > > linkit-smart-7688 are set to be built when mtmips is selected. > > > > Thi

Re: [PATCH v4 01/23] mips: dts: switch to board defines for dtb for mtmips

2021-01-18 Thread Weijie Gao
On Mon, 2021-01-18 at 22:43 +0100, Daniel Schwierzeck wrote: > Am Montag, den 18.01.2021, 15:54 +0800 schrieb Weijie Gao: > > On Fri, 2020-11-27 at 21:19 +0100, Daniel Schwierzeck wrote: > > > Am Donnerstag, den 12.11.2020, 16:35 +0800 schrieb Weijie Gao: > > > > Prev

Re: [PATCH v4 01/23] mips: dts: switch to board defines for dtb for mtmips

2021-01-20 Thread Weijie Gao
On Wed, 2021-01-20 at 16:51 +0100, Daniel Schwierzeck wrote: > Hi Weijie, > > Am Dienstag, den 19.01.2021, 08:58 +0800 schrieb Weijie Gao: > > > > > > > > Hi Daniel, > > > > > > > > Gentle ping > > > > > >

[PATCH] mips: mt7628: fix ddr_type for MT7688KN

2021-02-22 Thread Weijie Gao
The MT7688KN is a multi-chip package with 8MiB DDR1 KGD. So the DDR type from bootstrap register must be ignored, and always be assumed as DDR1. This patch fixes an issue that mt7628_ddr_pad_ldo_config() may be passed with a wrong ddr_type in MT7688KN. Signed-off-by: Weijie Gao --- arch/mips

[PATCH 1/4] pinctrl: mediatek: fix wrong assignment in mtk_get_pin_name

2021-03-04 Thread Weijie Gao
From: Sam Shih This is a bug fix for mtk pinctrl common part. Appearently pins should be used instead of grps in mtk_get_pin_name(). Signed-off-by: Sam Shih --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/med

[PATCH 0/4] Minor fixes for MediaTek pinctrl driver

2021-03-04 Thread Weijie Gao
This patch series provides fixes for MediaTek pinctrl driver common parts and mt7629. Sam Shih (2): pinctrl: mediatek: fix wrong assignment in mtk_get_pin_name pinctrl: mediatek: add get_pin_muxing ops for mediatek pinctrl Weijie Gao (2): pinctrl: mediatek: do not probe gpio driver if not

[PATCH 2/4] pinctrl: mediatek: add get_pin_muxing ops for mediatek pinctrl

2021-03-04 Thread Weijie Gao
From: Sam Shih This patch add get_pin_muxing support for mediatek pinctrl drivers Signed-off-by: Sam Shih --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/media

[PATCH 3/4] pinctrl: mediatek: do not probe gpio driver if not enabled

2021-03-04 Thread Weijie Gao
support is enabled. Signed-off-by: Weijie Gao --- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index b2212c2559..264c6458c9

[PATCH 4/4] pinctrl: mt7629: add jtag function and pin group

2021-03-04 Thread Weijie Gao
The EPHY LEDs of mt7629 can be used as JTAG. This patch adds the jtag pin group to the pinctrl driver. Signed-off-by: Weijie Gao --- drivers/pinctrl/mediatek/pinctrl-mt7629.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7629.c b/drivers/pinctrl

[PATCH] configs: mt7622: use ARMv8 Generic Timer instead of mtk_timer

2021-03-04 Thread Weijie Gao
It's better to use the generic timer which is correctly initialized by the ATF. The generic timer has higher resolution than the mtk_timer. Signed-off-by: Weijie Gao --- configs/mt7622_rfb_defconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/configs/mt7622_rfb_defconfig b/co

[PATCH] dts: mt7629: enable JTAG pins by default

2021-03-04 Thread Weijie Gao
The EPHY LEDs belongs to the built-in FE switch of MT7629, which is barely used. These LED pins on reference boards are used as JTAG socket. So it's a good idea to change the default state to JTAG, and this will make it convenience for debugging. Signed-off-by: Weijie Gao --- arch/ar

[PATCH] mmc: mtk-sd: increase the minimum bus frequency

2021-03-04 Thread Weijie Gao
side effects. Signed-off-by: Weijie Gao --- drivers/mmc/mtk-sd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 3b9c12266a..1e1726ef31 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -232,6 +232,8 @@ #define

[PATCH] serial: mtk: rewrite the setbrg function

2021-03-04 Thread Weijie Gao
f baud <= 576000, highspeed-2 mode will be used c) any bauds > 576000, highspeed-3 mode will be used 2. If baud clock <= 12MHz Forced highspeed-3 mode a) If baud <= 115200, calculates the divisor using DIV_ROUND_CLOSEST b) any bauds > 115200, the same as 1. c) Sign

[PATCH] board: mt7629: enable compression of u-boot to reduce the size of final image

2021-03-04 Thread Weijie Gao
This patch makes use of the decompression mechanism implemented for mt7628 previously to reduce the total image size. Binman will be also removed. Signed-off-by: Weijie Gao --- Makefile| 3 +++ arch/arm/dts/mt7629-rfb-u-boot.dtsi | 18 -- arch/arm

[PATCH] configs: mt7622: enable debug uart for mt7622_rfb_defconfig

2021-03-04 Thread Weijie Gao
Enable debug uart for mt7622_rfb_defconfig Signed-off-by: Weijie Gao --- configs/mt7622_rfb_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/mt7622_rfb_defconfig b/configs/mt7622_rfb_defconfig index 12f529158c..c12ce5cc0a 100644 --- a/configs/mt7622_rfb_defconfig +++ b

Re: [PATCH] mmc: mtk-sd: increase the minimum bus frequency

2021-03-04 Thread Weijie Gao
On Fri, 2021-03-05 at 11:44 +0900, Jaehoon Chung wrote: > Dear Waijie, > > On 3/5/21 11:30 AM, Weijie Gao wrote: > > With a 48MHz input clock, the lowest bus frequency can be as low as > > 4800 / (4 * 4095) = 2930Hz. Such an extremely low frequency will cause >

[PATCH] mips: mt7628: fix the displayed DDR type of mt7628

2021-03-04 Thread Weijie Gao
The MT7688KN is a multi-chip package with 8MiB DDR1 KGD. So the DDR type from bootstrap register must be ignored, and always be assumed as DDR1. This patch fixes the displayed DDR type of mt7628. Signed-off-by: Weijie Gao --- arch/mips/mach-mtmips/mt7628/init.c | 3 +++ 1 file changed, 3

Re: [PATCH] mips: mt7628: fix ddr_type for MT7688KN

2021-03-04 Thread Weijie Gao
On Fri, 2021-02-26 at 12:23 +0100, Stefan Roese wrote: > Hi Weijie, > > On 23.02.21 08:12, Weijie Gao wrote: > > The MT7688KN is a multi-chip package with 8MiB DDR1 KGD. So the DDR type > > from bootstrap register must be ignored, and always be assumed as DDR1. > > &g

[PATCH v2] mmc: mtk-sd: increase the minimum bus frequency

2021-03-04 Thread Weijie Gao
side effects. Signed-off-by: Weijie Gao --- drivers/mmc/mtk-sd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 3b9c122..626a4d3 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -232,6 +232,8 @@ #define

[PATCH] tools: mtk_image: add an option to set device header offset

2021-03-08 Thread Weijie Gao
This patch adds an option which allows setting the device header offset. This is useful if this tool is used to generate ATF BL2 image of mt7622 for SD cards. Signed-off-by: Weijie Gao --- tools/mtk_image.c | 50 --- 1 file changed, 47 insertions

Re: [PATCH v5] Add support for SoM "VoCore2".

2020-02-12 Thread Weijie Gao
board.c > - Added network setup. > - Removed project-specific code. > - Move back environment to SPI NOR. > - Changes to environment default settings. > - Rebase on current u-boot-mips/testing > > Changes in v4: > - Reverted some overzealous DTS cleaning. > - Added su

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 11:18 +0100, Simon Goldschmidt wrote: > On Wed, Feb 12, 2020 at 9:57 AM Weijie Gao wrote: > > > > On Wed, 2020-02-12 at 09:22 +0100, Simon Goldschmidt wrote: > > > On Wed, Feb 12, 2020 at 8:49 AM Weijie Gao > > > wrote: > >

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

2020-02-13 Thread Weijie Gao
On Thu, 2020-02-13 at 08:48 +0100, Simon Goldschmidt wrote: > On Wed, Feb 12, 2020 at 10:43 AM Weijie Gao wrote: > > > > This patch series are divided into two parts: > > > > The main part is to rewrite the whole architecture code of mt7628: > > * Lock parts of

Re: [PATCH v5] Add support for SoM "VoCore2".

2020-02-17 Thread Weijie Gao
On Mon, 2020-02-17 at 14:22 +0100, Mauro Condarelli wrote: > Hi Daniel, > a gentle reminder... > > I was unable to comply with a few of Your remarks (see below), > What should I do? > Submit v6 as is or do You have specific instructions? > > Thanks a lot > Mauro > > On 2/12/20 11:01 PM, Mauro Co

Re: [PATCH v3 1/9] dm: core: Add function to get child count of ofnode or device

2020-04-14 Thread Weijie Gao
ead.h | 13 + > 4 files changed, 37 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v3 2/9] test: dm: add test item for ofnode_get_child_count()

2020-04-14 Thread Weijie Gao
> v2: > a new patch to test ofnode_get_child_count() suggested by Simon > --- > arch/sandbox/dts/test.dts | 18 ++ > test/dm/ofnode.c | 21 + > 2 files changed, 39 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v3 3/9] phy: phy-mtk-tphy: add support USB phys

2020-04-15 Thread Weijie Gao
ivers/phy/phy-mtk-tphy.c | 227 +++-- > 1 file changed, 218 insertions(+), 9 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v3 4/9] phy: phy-mtk-tphy: add support new version

2020-04-15 Thread Weijie Gao
ged, 63 insertions(+), 5 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v3 5/9] phy: phy-mtk-tphy: add a new reference clock

2020-04-15 Thread Weijie Gao
sistent with PHY IP's, change > the da_ref for analog phy and ref clock for digital phy. > > Signed-off-by: Chunfeng Yun > --- > v2~v3: no changes > --- > drivers/phy/phy-mtk-tphy.c | 21 ++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v3 6/9] xhci: mediatek: Add support for MTK xHCI host controller

2020-04-15 Thread Weijie Gao
+ > 3 files changed, 371 insertions(+) > create mode 100644 drivers/usb/host/xhci-mtk.c > Reviewed-by: Weijie Gao

Re: [PATCH v3 7/9] arm: dts: mt7629: add usb related nodes

2020-04-15 Thread Weijie Gao
arch/arm/dts/mt7629.dtsi| 41 + > 2 files changed, 49 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v3 9/9] dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller

2020-04-15 Thread Weijie Gao
rtions(+) > create mode 100644 doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt > Reviewed-by: Weijie Gao

Re: [PATCH v5 02/14] test: dm: add test item for ofnode_get_child_count()

2020-04-15 Thread Weijie Gao
add reviewed-by Simon > > v2: > a new patch to test ofnode_get_child_count() suggested by Simon > --- > arch/sandbox/dts/test.dts | 18 ++ > test/dm/ofnode.c | 21 + > 2 files changed, 39 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v5 01/14] dm: core: Add function to get child count of ofnode or device

2020-04-15 Thread Weijie Gao
+ > include/dm/read.h | 13 +++++ > 4 files changed, 37 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v5 04/14] test: dm: phy: add a test item for the phy_bulk API

2020-04-15 Thread Weijie Gao
+++ > 2 files changed, 40 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v5 03/14] phy: Add get/enable/disable for a bulk of phys

2020-04-15 Thread Weijie Gao
ivers. > > Signed-off-by: Chunfeng Yun > --- > v5: no changes > > v4: new patch > --- > drivers/phy/phy-uclass.c | 80 > include/generic-phy.h| 66 + > 2 files changed, 146 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v5 05/14] usb: dwc3: use the phy bulk API to get phys

2020-04-15 Thread Weijie Gao
s/usb/dwc3/dwc3-generic.c | 7 ++- > include/dwc3-uboot.h| 11 ++--- > 3 files changed, 17 insertions(+), 84 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 07/14] phy: phy-mtk-tphy: add support USB phys

2020-04-15 Thread Weijie Gao
ivers/phy/phy-mtk-tphy.c | 227 +++-- > 1 file changed, 218 insertions(+), 9 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 10/14] xhci: mediatek: Add support for MTK xHCI host controller

2020-04-15 Thread Weijie Gao
nsertions(+) > create mode 100644 drivers/usb/host/xhci-mtk.c > Reviewed-by: Weijie Gao

Re: [PATCH v5 09/14] phy: phy-mtk-tphy: add a new reference clock

2020-04-15 Thread Weijie Gao
sistent with PHY IP's, change > the da_ref for analog phy and ref clock for digital phy. > > Signed-off-by: Chunfeng Yun > --- > v2~v5: no changes > --- > drivers/phy/phy-mtk-tphy.c | 21 ++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 12/14] dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks

2020-04-15 Thread Weijie Gao
2~v5: no changes > --- > doc/device-tree-bindings/phy/phy-mtk-tphy.txt | 78 --- > 1 file changed, 68 insertions(+), 10 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 06/14] usb: dwc2_udc_otg: use the phy bulk API to get phys

2020-04-15 Thread Weijie Gao
changed, 12 insertions(+), 78 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 08/14] phy: phy-mtk-tphy: add support new version

2020-04-15 Thread Weijie Gao
ged, 63 insertions(+), 5 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH v5 14/14] MAINTAINERS: MediaTek: add USB related files

2020-04-15 Thread Weijie Gao
On Fri, 2020-04-10 at 13:45 +0800, Chunfeng Yun wrote: > Add dt-binding files of xhci-mtk and phys, C files of > phys. > > Signed-off-by: Chunfeng Yun > --- > v5: new patch > --- > MAINTAINERS | 3 +++ > 1 file changed, 3 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v5 13/14] dt-bindings: usb: mtk-xhci: Add binding for MediaTek xHCI host controller

2020-04-15 Thread Weijie Gao
rtions(+) > create mode 100644 doc/device-tree-bindings/usb/mediatek,mtk-xhci.txt > Reviewed-by: Weijie Gao

Re: [PATCH v5 11/14] arm: dts: mt7629: add usb related nodes

2020-04-15 Thread Weijie Gao
arch/arm/dts/mt7629.dtsi| 41 + > 2 files changed, 49 insertions(+) > Reviewed-by: Weijie Gao

Re: [PATCH v3 8/9] dt-bindings: phy-mtk-tphy: add properties of address mapping and clocks

2020-04-15 Thread Weijie Gao
2~v3: no changes > --- > doc/device-tree-bindings/phy/phy-mtk-tphy.txt | 78 --- > 1 file changed, 68 insertions(+), 10 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH 1/3] mips: mt76x8: ddr_cal: Rename dqs_test_valid() to dqs_test_error()

2020-04-15 Thread Weijie Gao
t; Also change the return type to bool and return "true" or "false". > > Signed-off-by: Stefan Roese > Cc: Weijie Gao > Cc: Daniel Schwierzeck > --- > arch/mips/mach-mtmips/ddr_cal.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > Reviewed-by: Weijie Gao

Re: [PATCH 2/3] mips: mt76x8: ddr_cal: Change types from u32 to int in dqs_find_min/max

2020-04-15 Thread Weijie Gao
On Fri, 2020-03-06 at 15:14 +0100, Stefan Roese wrote: > This change is made to enable comparison of integer variables, which > might be negative in the next patch. No functional change is intended > in this patch. > > Signed-off-by: Stefan Roese > Cc: Weijie Gao > C

Re: [PATCH 3/3] mips: mt76x8: ddr_cal: Correct dqs_find_min/max implementations

2020-04-15 Thread Weijie Gao
> this patch uses the same approach of a for loop in both functions making > it easier to read and maintain. > > Since the variables are integers now, we can use min()/max(), which > handles the wrap around case for fieldval=0: return (0 - 1). > >

Re: reset command doesn't work on MT7628 (CPU: MediaTek MT7628A ver:1 eco:2)

2020-08-12 Thread Weijie Gao
Hi Andrew, According to my past experience, I believe this is caused by the W25Q256 NOR flash. Your bootlog shows that it's booted with SPI-NOR 3-Byte Addr, and your board is using W25Q256 which requires 4-byte address access when accessing the higher 16MB memory array. According to the datashee

Re: [RFC] Vocore2 MMC needs clock patches

2020-01-20 Thread Weijie Gao
On Tue, 2020-01-21 at 00:55 +0100, Mauro Condarelli wrote: > Hi Weijie, > I attach my, apparently working, port to VoCore2 SoM. > > These patchsets are on top of Your 21 patch rewrite of MT7628 board, > > While the first patchset is relatively straightforward, but does not include > MMC handling,

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

2020-01-21 Thread Weijie Gao
This patch series are divided into two parts: The main part is to rewrite the whole architecture code of mt7628: * Lock parts of the d-cache for initial stack so the rest of the code can be reimplemented in C. * Memory controller & DDR initialization have been fully written to support detectin

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

2020-01-21 Thread Weijie Gao
-by: Daniel Schwierzeck Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v2: 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 v3 05/20] sysreset: add reset controller based reboot driver

2020-01-21 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 v2

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

2020-01-21 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 v2: none --- arch/mips/cpu/start.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

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

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

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

2020-01-21 Thread Weijie Gao
: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v2: 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 100644 --- a/arch/mips

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

2020-01-21 Thread Weijie Gao
This patch enables CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips boards. Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v2: none --- configs/gardena-smart-gateway-mt7688-ram_defconfig | 1 + configs/gardena-smart-gateway-mt7688_defconfig | 1 + configs

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

2020-01-21 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 v2: none

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

2020-01-21 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 v2: none --- arch/mips/mach-m

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

2020-01-21 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: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v2: none --- arch/mips/cpu/u-boot-spl.lds | 2 ++ 1 file changed, 2

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

2020-01-21 Thread Weijie Gao
This patch adds a new pinmux for UART2, which shares the pins with SPIS. Signed-off-by: Weijie Gao --- Changes since v2: new patch --- 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 409695b5c7

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

2020-01-21 Thread Weijie Gao
This patch enables LZMA decompression support for SPL build Reviewed-by: Tom Rini Signed-off-by: Weijie Gao --- Changes since v2: 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 v3 13/20] mips: add an option to enable u_boot_list section for SPL loaders in u-boot-spl.lds

2020-01-21 Thread Weijie Gao
enabled. Reviewed-by: Daniel Schwierzeck Signed-off-by: Weijie Gao --- Changes since v2: move SPL_LOADER_SUPPORT to arch/mips/Kconfig --- 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

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

2020-01-21 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 v2: none --- tools/binman/README.entries | 15 ++ tools/binman/etype/u_boot_lzma_img.py | 28 +++ 2 files changed, 43

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

2020-01-21 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. Signed-off-by: Weijie Gao --- Changes since v2: new --- common

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

2020-01-21 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 v2: * Move spi related files to previous patch --- arch/mips/mach

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

2020-01-21 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: Daniel Schwierzeck Reviewed-by: Simon Glass Signed-off-by: Weijie Gao --- Changes since v2: none --- Makefile | 13

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

2020-01-21 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 v2: none --- arch/mips/dts/Makefile| 1 + arch/mips/dts/mediatek,mt7628-rfb.dts | 67

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

2020-01-21 Thread Weijie Gao
spl loader is added to support uncompress the payload. Signed-off-by: Weijie Gao --- Changes since v2: * Remove spl_load.c and move its feature to common spl_nor.c * Add u-boot,dm-pre-reloc to u-boot-mt7628.dtsi --- Makefile| 9 arch/mips/Kcon

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

2020-01-21 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 v2: none --- arch/mips/Kconfig | 30 + arch/mips/include/asm/u-boot-mips.h | 2 ++ arch/mips/lib/bootm.c

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

2020-01-21 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 v2: none --- arch/mips/mach-mtmips/Kconfig

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

2020-01-21 Thread Weijie Gao
I'm having a holiday from tomorrow to Jan 30th and I may not reply during the holiday. Sincerely On Tue, 2020-01-21 at 16:17 +0800, Weijie Gao wrote: > This patch series are divided into two parts: > > The main part is to rewrite the whole architecture code of mt7628: > * Lo

Re: [PATCH v3] Add support for SoM "VoCore2".

2020-01-27 Thread Weijie Gao
router in the world. > >> > >> Details about this SoM can be found at "https://vocore.io/v2.html";. > >> > >> Signed-off-by: Mauro Condarelli > >> --- > >> > >> Changes in v3: > >> - based on top of Weijie

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

2020-02-11 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 v4 01/20] mips: add support to restore exception vector base before booting linux

2020-02-11 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 v4 00/20] Refactor the architecture parts of mt7628

2020-02-11 Thread Weijie Gao
dd a test for binman etype u-boot-lzma-img to make sure binman passes 100% code coverage * Rename SPL-enabled output file name to u-boot-mips.bin Weijie Gao (20): mips: add support to restore exception vector base before booting linux mips: mtmips: add predefined i-cache/d-cache size

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

2020-02-11 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 v4 09/20] mips: add a option to support not reserving malloc space on initial stack

2020-02-11 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 v4 14/20] lib: enable lzma decompression support for SPL build

2020-02-11 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 v4 16/20] tools: binman: add etype file for u-boot-lzma-img

2020-02-11 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 v4 15/20] Makefile: add support to generate LZMA compressed u-boot image

2020-02-11 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 v4 17/20] spl: nor: add lzma decompression support for legacy image

2020-02-11 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 v4 20/20] mips: mtmips: add support for mt7628-rfb

2020-02-11 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: none --- arch/mips/dts/Makefile| 1 + arch/mips/dts/mediatek,mt7628

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

2020-02-11 Thread Weijie Gao
spl loader is added to support uncompress the payload. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- Changes since v3: rename output file to u-boot-mips.bin --- Makefile| 9 arch/mips/Kconfig | 3 ++ arch/mips/dts/mt762

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

2020-02-11 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: none --- arch/mips/mach-mtmips

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

2020-02-12 Thread Weijie Gao
On Wed, 2020-02-12 at 08:55 +0100, Stefan Roese wrote: > Hi Weijie, > > On 12.02.20 08:49, Weijie Gao wrote: > > This patch adds SPL support for mtmips platform. The lowlevel architecture > > is split into SPL and the rest parts are built into a memory loadable > > u-

<    1   2   3   4   5   6   7   8   >