mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 0/3] Fixes for WolfVision board code library and PF5 mainboard code
@ 2024-05-15  8:00 Michael Riesch
  2024-05-15  8:00 ` [PATCH master 1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code Michael Riesch
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Riesch @ 2024-05-15  8:00 UTC (permalink / raw)
  To: barebox; +Cc: Michael Riesch

Habidere,

This series is a follow-up to 
https://lore.barebox.org/barebox/20240412-feature-wolfvision-pf5-v2-0-7e277cc8831b@wolfvision.net/
and fixes a few things. I tried to reply to said thread and announce a
v3, but I just found that this reply never hit the list for ... reasons.

Anyway, here are the fixes. Do you think they can be applied directly
to master?

Looking forward to your comments!

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
Michael Riesch (3):
      arm: boards: add pr_fmt() prefix to wolfvision pf5 board code
      common: boards: move dependencies to wolfvision board code library
      common: boards: wolfvision: fix handling of overlays parameter

 arch/arm/boards/wolfvision-pf5/board.c | 3 +++
 arch/arm/mach-rockchip/Kconfig         | 2 --
 common/boards/Kconfig                  | 2 ++
 common/boards/wolfvision/common.c      | 5 ++++-
 4 files changed, 9 insertions(+), 3 deletions(-)
---
base-commit: 593248cde35ddedcb27c0791c621e6a4403d7068
change-id: 20240515-b4-pf5-fixup-1c0f8b592313

Best regards,
-- 
Michael Riesch <michael.riesch@wolfvision.net>




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

* [PATCH master 1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code
  2024-05-15  8:00 [PATCH master 0/3] Fixes for WolfVision board code library and PF5 mainboard code Michael Riesch
@ 2024-05-15  8:00 ` Michael Riesch
  2024-05-15  8:00 ` [PATCH master 2/3] common: boards: move dependencies to wolfvision board code library Michael Riesch
  2024-05-15  8:00 ` [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter Michael Riesch
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Riesch @ 2024-05-15  8:00 UTC (permalink / raw)
  To: barebox; +Cc: Michael Riesch

Add pr_fmt() message prefix to WolfVision PF5 board code.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 arch/arm/boards/wolfvision-pf5/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/wolfvision-pf5/board.c b/arch/arm/boards/wolfvision-pf5/board.c
index 797f51bc2e..5a2f4201ba 100644
--- a/arch/arm/boards/wolfvision-pf5/board.c
+++ b/arch/arm/boards/wolfvision-pf5/board.c
@@ -4,6 +4,9 @@
  *
  * Copyright (C) 2024 WolfVision GmbH.
  */
+
+#define pr_fmt(fmt) "WolfVision PF5: " fmt
+
 #include <common.h>
 #include <deep-probe.h>
 #include <globalvar.h>

-- 
2.34.1




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

* [PATCH master 2/3] common: boards: move dependencies to wolfvision board code library
  2024-05-15  8:00 [PATCH master 0/3] Fixes for WolfVision board code library and PF5 mainboard code Michael Riesch
  2024-05-15  8:00 ` [PATCH master 1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code Michael Riesch
@ 2024-05-15  8:00 ` Michael Riesch
  2024-05-15  8:00 ` [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter Michael Riesch
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Riesch @ 2024-05-15  8:00 UTC (permalink / raw)
  To: barebox; +Cc: Michael Riesch

Since hardware ID detection has been moved to the WolfVision board code
library, move the Kconfig dependencies as well.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 arch/arm/mach-rockchip/Kconfig | 2 --
 common/boards/Kconfig          | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index f373624f5c..e7c0c634aa 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -117,9 +117,7 @@ config MACH_RADXA_CM3
 
 config MACH_WOLFVISION_PF5
 	select ARCH_RK3568
-	select AIODEV
 	select BOARD_WOLFVISION
-	select ROCKCHIP_SARADC
 	bool "WolfVision PF5 mainboard"
 	help
 	  Say Y here if you are using a WolfVision PF5 mainboard
diff --git a/common/boards/Kconfig b/common/boards/Kconfig
index a2a51155ea..586a54d7ca 100644
--- a/common/boards/Kconfig
+++ b/common/boards/Kconfig
@@ -17,3 +17,5 @@ config BOARD_TQ
 
 config BOARD_WOLFVISION
 	bool
+	select AIODEV
+	select ROCKCHIP_SARADC

-- 
2.34.1




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

* [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter
  2024-05-15  8:00 [PATCH master 0/3] Fixes for WolfVision board code library and PF5 mainboard code Michael Riesch
  2024-05-15  8:00 ` [PATCH master 1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code Michael Riesch
  2024-05-15  8:00 ` [PATCH master 2/3] common: boards: move dependencies to wolfvision board code library Michael Riesch
@ 2024-05-15  8:00 ` Michael Riesch
  2024-05-15  8:32   ` Michael Riesch
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Riesch @ 2024-05-15  8:00 UTC (permalink / raw)
  To: barebox; +Cc: Michael Riesch

If the char **overlays parameter to wolfvision_rk3568_detect_hw is NULL,
the overlay file names are not collected.

If overlays points to a NULL pointer, it is initialized properly with
an empty string. This is convenient as the call to
    globalvar_set("of.overlay.filepattern", my_resulting_string);
that usually follows actually resets the global filepattern variable
from its default "*" to "". Thereby, a paradoxical situation in which no
extensions are detected but all available overlays are applied (due to "*")
is avoided.

Nevertheless, it is still possible to pass an existing string to this
method and let the method append overlay file names.

Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
---
 common/boards/wolfvision/common.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
index f483918cec..6cb76250dd 100644
--- a/common/boards/wolfvision/common.c
+++ b/common/boards/wolfvision/common.c
@@ -20,7 +20,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
 {
 	int ret;
 
-	if (overlay->filename) {
+	if (overlay->filename && files) {
 		if (*files) {
 			char *old = *files;
 			*files = basprintf("%s %s", old, overlay->filename);
@@ -115,6 +115,9 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
 	if (ret)
 		return ret;
 
+	if (overlays && !*overlays)
+		*overlays = basprintf("");
+
 	for (i = 0; i < num_extensions; i++) {
 		const struct wv_rk3568_extension *extension = &extensions[i];
 		const struct wv_overlay *overlay;

-- 
2.34.1




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

* Re: [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter
  2024-05-15  8:00 ` [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter Michael Riesch
@ 2024-05-15  8:32   ` Michael Riesch
  2024-05-15  9:14     ` Ahmad Fatoum
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Riesch @ 2024-05-15  8:32 UTC (permalink / raw)
  To: Barebox List

Hi all,

On 5/15/24 10:00, Michael Riesch wrote:
> If the char **overlays parameter to wolfvision_rk3568_detect_hw is NULL,
> the overlay file names are not collected.
> 
> If overlays points to a NULL pointer, it is initialized properly with
> an empty string. This is convenient as the call to
>     globalvar_set("of.overlay.filepattern", my_resulting_string);
> that usually follows actually resets the global filepattern variable
> from its default "*" to "". Thereby, a paradoxical situation in which no
> extensions are detected but all available overlays are applied (due to "*")
> is avoided.
> 
> Nevertheless, it is still possible to pass an existing string to this
> method and let the method append overlay file names.
> 
> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
> ---
>  common/boards/wolfvision/common.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
> index f483918cec..6cb76250dd 100644
> --- a/common/boards/wolfvision/common.c
> +++ b/common/boards/wolfvision/common.c
> @@ -20,7 +20,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
>  {
>  	int ret;
>  
> -	if (overlay->filename) {
> +	if (overlay->filename && files) {
>  		if (*files) {
>  			char *old = *files;
>  			*files = basprintf("%s %s", old, overlay->filename);
> @@ -115,6 +115,9 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
>  	if (ret)
>  		return ret;
>  
> +	if (overlays && !*overlays)
> +		*overlays = basprintf("");

Hm, apparently this gives a compiler warning "warning: zero-length
gnu_printf format string [-Wformat-zero-length]".

... = basprintf("%s", ""); ???

Best regards,
Michael

> +
>  	for (i = 0; i < num_extensions; i++) {
>  		const struct wv_rk3568_extension *extension = &extensions[i];
>  		const struct wv_overlay *overlay;
> 



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

* Re: [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter
  2024-05-15  8:32   ` Michael Riesch
@ 2024-05-15  9:14     ` Ahmad Fatoum
  2024-05-15 10:28       ` Michael Riesch
  0 siblings, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2024-05-15  9:14 UTC (permalink / raw)
  To: Michael Riesch, Barebox List

On 15.05.24 10:32, Michael Riesch wrote:
> Hi all,
> 
> On 5/15/24 10:00, Michael Riesch wrote:
>> If the char **overlays parameter to wolfvision_rk3568_detect_hw is NULL,
>> the overlay file names are not collected.
>>
>> If overlays points to a NULL pointer, it is initialized properly with
>> an empty string. This is convenient as the call to
>>     globalvar_set("of.overlay.filepattern", my_resulting_string);
>> that usually follows actually resets the global filepattern variable
>> from its default "*" to "". Thereby, a paradoxical situation in which no
>> extensions are detected but all available overlays are applied (due to "*")
>> is avoided.
>>
>> Nevertheless, it is still possible to pass an existing string to this
>> method and let the method append overlay file names.
>>
>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>> ---
>>  common/boards/wolfvision/common.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
>> index f483918cec..6cb76250dd 100644
>> --- a/common/boards/wolfvision/common.c
>> +++ b/common/boards/wolfvision/common.c
>> @@ -20,7 +20,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
>>  {
>>  	int ret;
>>  
>> -	if (overlay->filename) {
>> +	if (overlay->filename && files) {
>>  		if (*files) {
>>  			char *old = *files;
>>  			*files = basprintf("%s %s", old, overlay->filename);
>> @@ -115,6 +115,9 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
>>  	if (ret)
>>  		return ret;
>>  
>> +	if (overlays && !*overlays)
>> +		*overlays = basprintf("");
> 
> Hm, apparently this gives a compiler warning "warning: zero-length
> gnu_printf format string [-Wformat-zero-length]".
> 
> ... = basprintf("%s", ""); ???

xstrdup("")

> 
> Best regards,
> Michael
> 
>> +
>>  	for (i = 0; i < num_extensions; i++) {
>>  		const struct wv_rk3568_extension *extension = &extensions[i];
>>  		const struct wv_overlay *overlay;
>>
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




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

* Re: [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter
  2024-05-15  9:14     ` Ahmad Fatoum
@ 2024-05-15 10:28       ` Michael Riesch
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Riesch @ 2024-05-15 10:28 UTC (permalink / raw)
  To: Ahmad Fatoum, Barebox List

Hi Ahmad,

On 5/15/24 11:14, Ahmad Fatoum wrote:
> On 15.05.24 10:32, Michael Riesch wrote:
>> Hi all,
>>
>> On 5/15/24 10:00, Michael Riesch wrote:
>>> If the char **overlays parameter to wolfvision_rk3568_detect_hw is NULL,
>>> the overlay file names are not collected.
>>>
>>> If overlays points to a NULL pointer, it is initialized properly with
>>> an empty string. This is convenient as the call to
>>>     globalvar_set("of.overlay.filepattern", my_resulting_string);
>>> that usually follows actually resets the global filepattern variable
>>> from its default "*" to "". Thereby, a paradoxical situation in which no
>>> extensions are detected but all available overlays are applied (due to "*")
>>> is avoided.
>>>
>>> Nevertheless, it is still possible to pass an existing string to this
>>> method and let the method append overlay file names.
>>>
>>> Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net>
>>> ---
>>>  common/boards/wolfvision/common.c | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/common/boards/wolfvision/common.c b/common/boards/wolfvision/common.c
>>> index f483918cec..6cb76250dd 100644
>>> --- a/common/boards/wolfvision/common.c
>>> +++ b/common/boards/wolfvision/common.c
>>> @@ -20,7 +20,7 @@ int wolfvision_apply_overlay(const struct wv_overlay *overlay, char **files)
>>>  {
>>>  	int ret;
>>>  
>>> -	if (overlay->filename) {
>>> +	if (overlay->filename && files) {
>>>  		if (*files) {
>>>  			char *old = *files;
>>>  			*files = basprintf("%s %s", old, overlay->filename);
>>> @@ -115,6 +115,9 @@ int wolfvision_rk3568_detect_hw(const struct wv_rk3568_extension *extensions,
>>>  	if (ret)
>>>  		return ret;
>>>  
>>> +	if (overlays && !*overlays)
>>> +		*overlays = basprintf("");
>>
>> Hm, apparently this gives a compiler warning "warning: zero-length
>> gnu_printf format string [-Wformat-zero-length]".
>>
>> ... = basprintf("%s", ""); ???
> 
> xstrdup("")

Well if you insist on a straight-forward elegant solution... :-)

v2 coming up soon!

Thanks and regards,
Michael

> 
>>
>> Best regards,
>> Michael
>>
>>> +
>>>  	for (i = 0; i < num_extensions; i++) {
>>>  		const struct wv_rk3568_extension *extension = &extensions[i];
>>>  		const struct wv_overlay *overlay;
>>>
>>
>>
> 



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

end of thread, other threads:[~2024-05-15 10:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-15  8:00 [PATCH master 0/3] Fixes for WolfVision board code library and PF5 mainboard code Michael Riesch
2024-05-15  8:00 ` [PATCH master 1/3] arm: boards: add pr_fmt() prefix to wolfvision pf5 board code Michael Riesch
2024-05-15  8:00 ` [PATCH master 2/3] common: boards: move dependencies to wolfvision board code library Michael Riesch
2024-05-15  8:00 ` [PATCH master 3/3] common: boards: wolfvision: fix handling of overlays parameter Michael Riesch
2024-05-15  8:32   ` Michael Riesch
2024-05-15  9:14     ` Ahmad Fatoum
2024-05-15 10:28       ` Michael Riesch

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