public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] board: amlogic: vim3: fix phy-names property setup
@ 2021-07-13  6:48 Artem Lapkin
  2021-07-26  7:35 ` Neil Armstrong
  2021-07-27  8:29 ` Neil Armstrong
  0 siblings, 2 replies; 3+ messages in thread
From: Artem Lapkin @ 2021-07-13  6:48 UTC (permalink / raw)
  To: narmstrong
  Cc: u-boot, u-boot-amlogic, khilman, christianshewitt,
	martin.blumenstingl, art, nick, gouwa

phy-names was improperly implemented resulting in an inoperable USB-OTG
port.

- phy-names = "usb2-phy0\0\0usb2-phy1\0";
+ phy-names = "usb2-phy0\0usb2-phy1";

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 board/amlogic/vim3/vim3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c
index c8ebd676..6a67a39c 100644
--- a/board/amlogic/vim3/vim3.c
+++ b/board/amlogic/vim3/vim3.c
@@ -109,8 +109,8 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd)
 		}
 
 		/* Update PHY names (mandatory to disable USB3.0) */
-		len = strlcpy(data, "usb2-phy0", 32) + 1;
-		len += strlcpy(&data[len], "usb2-phy1", 32 - len) + 1;
+		len = strlcpy(data, "usb2-phy0", 32);
+		len += strlcpy(&data[len], "usb2-phy1", 32 - len);
 		ret = fdt_setprop(blob, node, "phy-names", data, len);
 		if (ret < 0) {
 			printf("vim3: failed to update usb phy names property (%d)\n", ret);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] board: amlogic: vim3: fix phy-names property setup
  2021-07-13  6:48 [PATCH] board: amlogic: vim3: fix phy-names property setup Artem Lapkin
@ 2021-07-26  7:35 ` Neil Armstrong
  2021-07-27  8:29 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2021-07-26  7:35 UTC (permalink / raw)
  To: Artem Lapkin
  Cc: u-boot, u-boot-amlogic, khilman, christianshewitt,
	martin.blumenstingl, art, nick, gouwa

On 13/07/2021 08:48, Artem Lapkin wrote:
> phy-names was improperly implemented resulting in an inoperable USB-OTG
> port.
> 
> - phy-names = "usb2-phy0\0\0usb2-phy1\0";
> + phy-names = "usb2-phy0\0usb2-phy1";
> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>  board/amlogic/vim3/vim3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c
> index c8ebd676..6a67a39c 100644
> --- a/board/amlogic/vim3/vim3.c
> +++ b/board/amlogic/vim3/vim3.c
> @@ -109,8 +109,8 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd)
>  		}
>  
>  		/* Update PHY names (mandatory to disable USB3.0) */
> -		len = strlcpy(data, "usb2-phy0", 32) + 1;
> -		len += strlcpy(&data[len], "usb2-phy1", 32 - len) + 1;
> +		len = strlcpy(data, "usb2-phy0", 32);
> +		len += strlcpy(&data[len], "usb2-phy1", 32 - len);
>  		ret = fdt_setprop(blob, node, "phy-names", data, len);
>  		if (ret < 0) {
>  			printf("vim3: failed to update usb phy names property (%d)\n", ret);
> 

Good catch,

Acked-by: Neil Armstrong <narmstrong@baylibre.com>

Neil

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] board: amlogic: vim3: fix phy-names property setup
  2021-07-13  6:48 [PATCH] board: amlogic: vim3: fix phy-names property setup Artem Lapkin
  2021-07-26  7:35 ` Neil Armstrong
@ 2021-07-27  8:29 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2021-07-27  8:29 UTC (permalink / raw)
  To: Artem Lapkin
  Cc: u-boot, u-boot-amlogic, khilman, christianshewitt,
	martin.blumenstingl, art, nick, gouwa

On 13/07/2021 08:48, Artem Lapkin wrote:
> phy-names was improperly implemented resulting in an inoperable USB-OTG
> port.
> 
> - phy-names = "usb2-phy0\0\0usb2-phy1\0";
> + phy-names = "usb2-phy0\0usb2-phy1";
> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>  board/amlogic/vim3/vim3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/board/amlogic/vim3/vim3.c b/board/amlogic/vim3/vim3.c
> index c8ebd676..6a67a39c 100644
> --- a/board/amlogic/vim3/vim3.c
> +++ b/board/amlogic/vim3/vim3.c
> @@ -109,8 +109,8 @@ int meson_ft_board_setup(void *blob, struct bd_info *bd)
>  		}
>  
>  		/* Update PHY names (mandatory to disable USB3.0) */
> -		len = strlcpy(data, "usb2-phy0", 32) + 1;
> -		len += strlcpy(&data[len], "usb2-phy1", 32 - len) + 1;
> +		len = strlcpy(data, "usb2-phy0", 32);
> +		len += strlcpy(&data[len], "usb2-phy1", 32 - len);
>  		ret = fdt_setprop(blob, node, "phy-names", data, len);
>  		if (ret < 0) {
>  			printf("vim3: failed to update usb phy names property (%d)\n", ret);
> 


Applied to u-boot-amlogic,

Thanks,
Neil

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-27  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-13  6:48 [PATCH] board: amlogic: vim3: fix phy-names property setup Artem Lapkin
2021-07-26  7:35 ` Neil Armstrong
2021-07-27  8:29 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox