2020-09-25 03:32:08

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 0/8] dts updates and fixes for Khadas VIM1 VIM2 VIM3 VIML boards

dts updates and fixes for Khadas VIM1 VIM2 VIM3 VIML boards

Artem Lapkin (8):
arm64: dts: meson: update spifc node on Khadas VIM2
meson-gxm-khadas-vim2
arm64: dts: meson: update leds node on Khadas VIM3/VIM3L boards
meson-khadas-vim3
arm64: dts: meson: update leds node on Khadas VIM3/VIM3L board
meson-khadas-vim3
arm64: dts: meson: remove fixed memory size for Khadas VIM3/VIM3L
meson-khadas-vim3
arm64: dts: meson: remove reset-gpios from ethernet node for VIM2
meson-gxm-khadas-vim2
arm64: dts: meson: disable vrtc for VIM3L boards meson-khadas-vim3
arm64: dts: meson: enable RTC for VIM1 meson-gxl-s905x-khadas-vim
arm64: dts: meson: enable RTC for VIM2 meson-gxm-khadas-vim2

.../amlogic/meson-gxl-s905x-khadas-vim.dts | 2 +-
.../dts/amlogic/meson-gxm-khadas-vim2.dts | 10 +++++-----
.../boot/dts/amlogic/meson-khadas-vim3.dtsi | 19 +++++++++++++++----
3 files changed, 21 insertions(+), 10 deletions(-)

--
2.25.1


2020-09-25 03:32:17

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 1/8] arm64: dts: meson: update spifc node on Khadas VIM2 meson-gxm-khadas-vim2

1) The VIM2 Boards use w25q128 spi chip only not w25q32 or w25q16
it's not really seriously becouse have 'jedec,spi-nor' which
have auto chips identifications

2) max-frequency is 104Mhz

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index bff8ec2c1c7..a6baf865aa2 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -336,12 +336,12 @@ &spifc {
pinctrl-0 = <&nor_pins>;
pinctrl-names = "default";

- w25q32: spi-flash@0 {
+ w25q128: spi-flash@0 {
#address-cells = <1>;
#size-cells = <1>;
- compatible = "winbond,w25q16", "jedec,spi-nor";
+ compatible = "winbond,w25q128fw", "jedec,spi-nor";
reg = <0>;
- spi-max-frequency = <3000000>;
+ spi-max-frequency = <104000000>;
};
};

--
2.25.1

2020-09-25 03:32:23

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 2/8] arm64: dts: meson: update leds node on Khadas VIM3/VIM3L boards meson-khadas-vim3

GPIO_ACTIVE_LOW replaced to GPIO_ACTIVE_HIGH for white and red leds

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 94f75b44650..73783692e30 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -41,13 +41,13 @@ leds {

led-white {
label = "vim3:white:sys";
- gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
+ gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};

led-red {
label = "vim3:red";
- gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>;
+ gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
};
};

--
2.25.1

2020-09-25 03:32:33

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 3/8] arm64: dts: meson: update leds node on Khadas VIM3/VIM3L board meson-khadas-vim3

add aliases names led_white and led_red for white and red leds

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 73783692e30..7e137399257 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -12,6 +12,8 @@ / {
aliases {
serial0 = &uart_AO;
ethernet0 = &ethmac;
+ led_red = &led_red;
+ led_white = &led_white;
};

chosen {
@@ -39,13 +41,13 @@ button-function {
leds {
compatible = "gpio-leds";

- led-white {
+ led_white: led-white {
label = "vim3:white:sys";
gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};

- led-red {
+ led_red: led-red {
label = "vim3:red";
gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
};
--
2.25.1

2020-09-25 03:32:49

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 4/8] arm64: dts: meson: remove fixed memory size for Khadas VIM3/VIM3L meson-khadas-vim3

no need force setup memory size!
VIM3 boards have 2Gb and 4Gb variants
memory size will be automatically defined

mainline uboot works properly in any case
but old vendor uboot works not properly for 4Gb variants

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 7e137399257..3111bf35c0f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -20,10 +20,15 @@ chosen {
stdout-path = "serial0:115200n8";
};

+/* no need force setup memory size!
+ VIM3 boards have 2Gb and 4Gb variants
+ memory size will be automatically defined
+
memory@0 {
device_type = "memory";
reg = <0x0 0x0 0x0 0x80000000>;
};
+*/

adc-keys {
compatible = "adc-keys";
--
2.25.1

2020-09-25 03:33:31

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 6/8] arm64: dts: meson: disable vrtc for VIM3L boards meson-khadas-vim3

vrtc not used for meson-khadas-vim3

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
index 3111bf35c0f..81bb88a76d5 100644
--- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
@@ -284,6 +284,10 @@ &pwm_ef {
pinctrl-names = "default";
};

+&vrtc {
+ status = "disabled";
+};
+
&saradc {
status = "okay";
vref-supply = <&vddao_1v8>;
--
2.25.1

2020-09-25 03:34:53

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 7/8] arm64: dts: meson: enable RTC for VIM1 meson-gxl-s905x-khadas-vim

enable RTC for VIM1 meson-gxl-s905x-khadas-vim

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
index 8bcdffdf55d..354f21d4171 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
@@ -98,7 +98,7 @@ &i2c_B {

rtc: rtc@51 {
/* has to be enabled manually when a battery is connected: */
- status = "disabled";
+ status = "okay";
compatible = "haoyu,hym8563";
reg = <0x51>;
#clock-cells = <0>;
--
2.25.1

2020-09-25 03:34:55

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 8/8] arm64: dts: meson: enable RTC for VIM2 meson-gxm-khadas-vim2

enable RTC for VIM2 meson-gxm-khadas-vim2

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index 70343da2811..76b7e34a9a3 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -229,7 +229,7 @@ &i2c_B {

rtc: rtc@51 {
/* has to be enabled manually when a battery is connected: */
- status = "disabled";
+ status = "okay";
compatible = "haoyu,hym8563";
reg = <0x51>;
#clock-cells = <0>;
--
2.25.1

2020-09-25 03:35:14

by Artem Lapkin

[permalink] [raw]
Subject: [PATCH 5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

1) fix down/up ethernet interface - need remove reset-gpios for ethernet node

`ifconfig eth0 down && ifconfig eth0 up` # didnt works with reset-gpios

2) add max-speed 1Gbit

Signed-off-by: Artem Lapkin <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index a6baf865aa2..70343da2811 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -195,7 +195,7 @@ external_phy: ethernet-phy@0 {

reset-assert-us = <10000>;
reset-deassert-us = <30000>;
- reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
+ max-speed = <1000>;

interrupt-parent = <&gpio_intc>;
/* MAC_INTR on GPIOZ_15 */
--
2.25.1

2020-09-25 07:32:45

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 7/8] arm64: dts: meson: enable RTC for VIM1 meson-gxl-s905x-khadas-vim

Hi Artem,

On Fri, Sep 25, 2020 at 5:31 AM Artem Lapkin <[email protected]> wrote:
>
> enable RTC for VIM1 meson-gxl-s905x-khadas-vim
I think the commit message should always explain *why* the change is
necessary (what problem does it solve?)
for trivial changes the diff itself explains "what" is being changed

[...]
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
> index 8bcdffdf55d..354f21d4171 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
> @@ -98,7 +98,7 @@ &i2c_B {
>
> rtc: rtc@51 {
> /* has to be enabled manually when a battery is connected: */
why do we need to keep this comment?

same feedback applies to patch 8


Best regards,
Martin

2020-09-25 07:38:39

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 4/8] arm64: dts: meson: remove fixed memory size for Khadas VIM3/VIM3L meson-khadas-vim3

Hi Artem,

On Fri, Sep 25, 2020 at 5:31 AM Artem Lapkin <[email protected]> wrote:
>
> no need force setup memory size!
> VIM3 boards have 2Gb and 4Gb variants
> memory size will be automatically defined
>
> mainline uboot works properly in any case
> but old vendor uboot works not properly for 4Gb variants
can you be more specific with what "does not work properly"? is Linux
then only able to use 2GB or is there any other problem?

overall this sounds like a bug in the vendor u-boot to me
I don't see that we have any other Amlogic .dts which needs this hack,
so I'd like to hear the feedback from the device-tree maintainers (for
example Rob) as well


Best regards,
Martin

2020-09-25 07:39:01

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 2/8] arm64: dts: meson: update leds node on Khadas VIM3/VIM3L boards meson-khadas-vim3

On 25/09/2020 05:30, Artem Lapkin wrote:
> GPIO_ACTIVE_LOW replaced to GPIO_ACTIVE_HIGH for white and red leds
>
> Signed-off-by: Artem Lapkin <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> index 94f75b44650..73783692e30 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> @@ -41,13 +41,13 @@ leds {
>
> led-white {
> label = "vim3:white:sys";
> - gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
> + gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
> linux,default-trigger = "heartbeat";
> };
>
> led-red {
> label = "vim3:red";
> - gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>;
> + gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
> };
> };
>
>

This has already been fixed and applied for 5.10:
https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic.git/commit/?h=v5.10/dt64&id=1f9d87d08e4a2299e86f8a1600aedf87ecd3b636

Neil

2020-09-25 07:41:04

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/8] arm64: dts: meson: update leds node on Khadas VIM3/VIM3L board meson-khadas-vim3

Hi,

On 25/09/2020 05:30, Artem Lapkin wrote:
> add aliases names led_white and led_red for white and red leds

Sorry, can you explain why you need these ? They should not be used by the led framework.

>
> Signed-off-by: Artem Lapkin <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> index 73783692e30..7e137399257 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> @@ -12,6 +12,8 @@ / {
> aliases {
> serial0 = &uart_AO;
> ethernet0 = &ethmac;
> + led_red = &led_red;
> + led_white = &led_white;

These aliases are not standard aliases.

> };
>
> chosen {
> @@ -39,13 +41,13 @@ button-function {
> leds {
> compatible = "gpio-leds";
>
> - led-white {
> + led_white: led-white {
> label = "vim3:white:sys";
> gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_HIGH>;
> linux,default-trigger = "heartbeat";
> };
>
> - led-red {
> + led_red: led-red {
> label = "vim3:red";
> gpios = <&gpio_expander 5 GPIO_ACTIVE_HIGH>;
> };
>

Instead you should convert these to the new function/color attributes are described in:
Documentation/devicetree/bindings/leds/common.yaml

{
function = LED_FUNCTION_STATUS;
color = <LED_COLOR_ID_WHITE>;
}

Neil

2020-09-25 07:41:55

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 4/8] arm64: dts: meson: remove fixed memory size for Khadas VIM3/VIM3L meson-khadas-vim3

On 25/09/2020 09:37, Martin Blumenstingl wrote:
> Hi Artem,
>
> On Fri, Sep 25, 2020 at 5:31 AM Artem Lapkin <[email protected]> wrote:
>>
>> no need force setup memory size!
>> VIM3 boards have 2Gb and 4Gb variants
>> memory size will be automatically defined
>>
>> mainline uboot works properly in any case
>> but old vendor uboot works not properly for 4Gb variants
> can you be more specific with what "does not work properly"? is Linux
> then only able to use 2GB or is there any other problem?
>
> overall this sounds like a bug in the vendor u-boot to me
> I don't see that we have any other Amlogic .dts which needs this hack,
> so I'd like to hear the feedback from the device-tree maintainers (for
> example Rob) as well

AFAIK the vendor u-boot updates the memory correctly, what it doesn't is adding
the reserved memory zones.

Neil

>
>
> Best regards,
> Martin
>

2020-09-25 07:43:14

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

Hello Artem,

On Fri, Sep 25, 2020 at 5:31 AM Artem Lapkin <[email protected]> wrote:
>
> 1) fix down/up ethernet interface - need remove reset-gpios for ethernet node
>
> `ifconfig eth0 down && ifconfig eth0 up` # didnt works with reset-gpios
what is the problem that you observe here?
did you investigate further why resetting the PHY changes this?

the problem I see with removing the reset-gpios is that we cannot
fully reset the PHY into a defined state
some of the registers are kept with a soft-reset

> 2) add max-speed 1Gbit
my understanding is that max-speed is needed when (in this case) the
PHY advertises a higher speed than the hardware is actually capable of
(for whatever reason)
what is the problem that you have seen when max-speed was not set?


Best regards,
Martin

2020-09-25 07:45:21

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/8] arm64: dts: meson: update spifc node on Khadas VIM2 meson-gxm-khadas-vim2

On 25/09/2020 05:30, Artem Lapkin wrote:
> 1) The VIM2 Boards use w25q128 spi chip only not w25q32 or w25q16
> it's not really seriously becouse have 'jedec,spi-nor' which
> have auto chips identifications
>
> 2) max-frequency is 104Mhz
>
> Signed-off-by: Artem Lapkin <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> index bff8ec2c1c7..a6baf865aa2 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> @@ -336,12 +336,12 @@ &spifc {
> pinctrl-0 = <&nor_pins>;
> pinctrl-names = "default";
>
> - w25q32: spi-flash@0 {
> + w25q128: spi-flash@0 {
> #address-cells = <1>;
> #size-cells = <1>;
> - compatible = "winbond,w25q16", "jedec,spi-nor";
> + compatible = "winbond,w25q128fw", "jedec,spi-nor";
> reg = <0>;
> - spi-max-frequency = <3000000>;
> + spi-max-frequency = <104000000>;
> };
> };
>
>

Reviewed-by: Neil Armstrong <[email protected]>

2020-09-25 07:46:02

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 6/8] arm64: dts: meson: disable vrtc for VIM3L boards meson-khadas-vim3

Hi,

On 25/09/2020 05:30, Artem Lapkin wrote:
> vrtc not used for meson-khadas-vim3
>
> Signed-off-by: Artem Lapkin <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> index 3111bf35c0f..81bb88a76d5 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-khadas-vim3.dtsi
> @@ -284,6 +284,10 @@ &pwm_ef {
> pinctrl-names = "default";
> };
>
> +&vrtc {
> + status = "disabled";
> +};
> +
> &saradc {
> status = "okay";
> vref-supply = <&vddao_1v8>;
>

The VRTC is one of the default suspend wake-up sources, so why would you disable it ?

If it collides with the real RTC, add aliases to move the vrtc in rtc1 and set the real RTC as rtc0.

» aliases·{
+» » rtc0·=·&rtc0;
+» » rtc1·=·&vrtc;
» };

Neil

2020-09-25 07:54:20

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 1/8] arm64: dts: meson: update spifc node on Khadas VIM2 meson-gxm-khadas-vim2

Hi Artem,

On Fri, Sep 25, 2020 at 5:30 AM Artem Lapkin <[email protected]> wrote:
>
> 1) The VIM2 Boards use w25q128 spi chip only not w25q32 or w25q16
> it's not really seriously becouse have 'jedec,spi-nor' which
> have auto chips identifications
according to the "VIM2 - Transitioning From v1.2 to v1.4" document [0]
(page 7) both board revisions are using different SPI flash sizes
for which board revision are your changes?

> 2) max-frequency is 104Mhz
(note to self: according to the w25q16 datasheet it supports a maximum
clock frequency of 104MHz, so this is fine)


Best regards,
Martin

2020-09-25 08:06:02

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

Hello Artem,

(adding back the mailing-list recipients)

On Fri, Sep 25, 2020 at 9:50 AM Art Nikpal <[email protected]> wrote:
>
> hello
>
> > what is the problem that you observe here?
> > did you investigate further why resetting the PHY changes this?
>
> just try next commands
> ifconfig eth0 down && ifconfig eth0 up
> and ethernet never up again - need full reboot only
this means that "something" is either set up incorrectly in the Linux
kernel or that u-boot does some magic (and the same magic is then
missing in the Linux kernel)
I'll dig out my Khadas VIM2 to test this. what should I look out for
(are there any error messages, dhcp not getting an IP address anymore,
etc.)?

> but if reset-gpios will be remove it works fine already - i have checked it many times
>
> for example VIM3 same didnt use reset-gpios
that's interesting - I'm surprised to see this
I did a quick check and for 15 out of 18 .dts(i) files with RGMII
phy-mode we use the reset-gpios:
$ grep -R 'phy-mode = "rgmii' arch/arm64/boot/dts/amlogic/ | wc -l
18
$ grep -R 'ethernet-phy@0' -A10 arch/arm64/boot/dts/amlogic/ | grep
reset-gpios | wc -l
15

so really I would like to add the reset-gpios to the VIM3 .dtsi as
well once we figured out what's wrong on the VIM2


Best regards,
Martin

2020-09-25 09:00:53

by Jerome Brunet

[permalink] [raw]
Subject: Re: [PATCH 8/8] arm64: dts: meson: enable RTC for VIM2 meson-gxm-khadas-vim2


On Fri 25 Sep 2020 at 05:30, Artem Lapkin <[email protected]> wrote:

> enable RTC for VIM2 meson-gxm-khadas-vim2
>
> Signed-off-by: Artem Lapkin <[email protected]>
> ---
> arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> index 70343da2811..76b7e34a9a3 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
> @@ -229,7 +229,7 @@ &i2c_B {
>
> rtc: rtc@51 {
> /* has to be enabled manually when a battery is connected: */

If going for this change, this comment should have been removed

> - status = "disabled";
> + status = "okay";

Unless the VIMs are provided with a battery by default, I believe this
should be kept disabled and only enabled by the bootloader if necessary.

If you think differently, feel free to resubmit with a complete commit
description and some details as to how this would be an improvement.

> compatible = "haoyu,hym8563";
> reg = <0x51>;
> #clock-cells = <0>;

2020-09-25 11:30:45

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

Hi Artem,

(adding back all Cc recipients - please use "reply all" so they don't get lost)

On Fri, Sep 25, 2020 at 10:18 AM Art Nikpal <[email protected]> wrote:
>
> this means that "something" is either set up incorrectly in the Linux
> kernel or that u-boot does some magic (and the same magic is then
> missing in the Linux kernel)
>
> maybe ;-)
>
> > I'll dig out my Khadas VIM2 to test this. what should I look out for
> (are there any error messages, dhcp not getting an IP address anymore,
> etc.)?
>
> just start your VIM2 board with ethernet
>
> 1) check connection its must works fine for example try ping your default gw
> 2) do `ifconfig eth0 down`
> 3) do `ifconfig eth0 up`
> 4) check your connection again it will be broken and u cant restore it im sure ;-) only reboot
# ping -4 -c2 google.com && ifconfig eth0 down && ifconfig eth0 up &&
sleep 5s && ping -4 -c2 google.com
PING google.com (172.217.22.78) 56(84) bytes of data.
64 bytes from fra15s17-in-f14.1e100.net (172.217.22.78): icmp_seq=1
ttl=114 time=22.4 ms
64 bytes from fra15s17-in-f78.1e100.net (172.217.22.78): icmp_seq=2
ttl=114 time=22.5 ms

--- google.com ping statistics ---
2 [ 127.097495] meson8b-dwmac c9410000.ethernet eth0: Link is Down
packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 22.375/22.415/22.455/0.040 ms
[ 127.170167] meson8b-dwmac c9410000.ethernet eth0: PHY
[0.2009087f:00] driver [RTL8211F Gigabit Ethernet] (irq=38)
[ 127.276459] meson8b-dwmac c9410000.ethernet eth0: No Safety
Features support found
[ 127.278508] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[ 127.285230] meson8b-dwmac c9410000.ethernet eth0: configuring for
phy/rgmii link mode
[ 130.425311] meson8b-dwmac c9410000.ethernet eth0: Link is Up -
1Gbps/Full - flow control rx/tx
PING google.com (172.217.22.78) 56(84) bytes of data.
64 bytes from fra15s17-in-f14.1e100.net (172.217.22.78): icmp_seq=1
ttl=114 time=22.4 ms
64 bytes from fra15s17-in-f78.1e100.net (172.217.22.78): icmp_seq=2
ttl=114 time=22.6 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 22.439/22.512/22.585/0.073 ms

note: the sleep 5s is needed to allow the link to come back up and to
get an IP address via DHCP
also if the output is not easy to read in your email client then I
have also uploaded it here: [0]

can you please show me the output of the debug logs in
rtl8211f_config_init() from drivers/net/phy/realtek.c (for example by
replacing dev_dbg with dev_err)?


Best regards,
Martin


[0] https://curlpaste.com/web/eaqun7

2020-09-28 07:55:55

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/8] arm64: dts: meson: update spifc node on Khadas VIM2 meson-gxm-khadas-vim2

On 25/09/2020 09:51, Martin Blumenstingl wrote:
> Hi Artem,
>
> On Fri, Sep 25, 2020 at 5:30 AM Artem Lapkin <[email protected]> wrote:
>>
>> 1) The VIM2 Boards use w25q128 spi chip only not w25q32 or w25q16
>> it's not really seriously becouse have 'jedec,spi-nor' which
>> have auto chips identifications
> according to the "VIM2 - Transitioning From v1.2 to v1.4" document [0]
> (page 7) both board revisions are using different SPI flash sizes
> for which board revision are your changes?

Indeed, if you changed the flash for the v14 VIM2 board, please:
- move arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts into meson-gxm-khadas-vim2.dtsi leaving only the
root compatible, model and the v12 spi flash model&size into the meson-gxm-khadas-vim2.dts file
- add "khadas,vim2-v14" to amlogic board bindings
- introduce a arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2-v14.dts file adding the
changes (spi flash change, MCU) with a different root compatible & model

Neil

>
>> 2) max-frequency is 104Mhz
> (note to self: according to the w25q16 datasheet it supports a maximum
> clock frequency of 104MHz, so this is fine)
>
>
> Best regards,
> Martin
>

2020-09-28 20:46:17

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

Hi Artem,

On Mon, Sep 28, 2020 at 10:42 AM Art Nikpal <[email protected]> wrote:
>
> OK today i can't reproduce it again on my new equipments ;-)
>
> may be its some specific problem we can try forget about this
uh, this is weird
please let me know if you can reproduce it on your new hardware

thanks for the update :-)


Best regards,
Martin