Skip to contentSkip to conversation

sunxi: fix support board-specific CONFIG_PREBOOT

PATCH Superseded Jonas Smedegaard 2 participants 7 messages Aug 18, 2019 – Feb 27, 2020 Arm/Allwinner sunXi SoC support

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
include/configs/sunxi-common.h +6 -1
index d7133a73fc..2069884b63 100644
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+	"usb start"
+#endif
+#endif
 #define CONSOLE_STDIN_SETTINGS \
-	"preboot=usb start\0" \
 	"stdin=serial,usbkbd\0"
 #else
 #define CONSOLE_STDIN_SETTINGS \
Signature · 1 line
2.23.0.rc1
#1 lore raw

PATCH 2/2 sun50i: a64: A64-Teres-I board detect builtin keyboard

A64-Teres-I board is a laptop which comes with a builtin keyboard. The keyboard+trackpad controller pauses for 2 seconds at a firmware prompt before loading its HID interface.

U-Boot needs to wait equally long to reliably enable the keyboard.

Series-Cc: Jagan Teki <[email protected]>
---

 configs/teres_i_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/teres_i_defconfig +1 -0
index cfd696f8a3..602150a3fb 100644
@@ -8,6 +8,7 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_USB1_VBUS_PIN="PL7"
 CONFIG_I2C0_ENABLE=y
 CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="setenv usb_pgood_delay 2000; usb reset"
 # CONFIG_CMD_FLASH is not set
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
Signature · 1 line
2.23.0.rc1
#2 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

In reply to Jonas Smedegaard
Quoted 19 lines · On Sun, 18 Aug 2019 17:16:06 +0200 Jonas Smedegaard <[email protected]> wrote:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 438

Quoted 7 lines
include/configs/sunxi-common.h +4 -0
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+	"usb start"

Shouldn't this (CONFIG_PREBOOT) be set in the Kconfig?

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 444

Quoted 7 lines
include/configs/sunxi-common.h +2 -1
+#endif
+#endif
 #define CONSOLE_STDIN_SETTINGS \
-	"preboot=usb start\0" \
 	"stdin=serial,usbkbd\0"
 #else
 #define CONSOLE_STDIN_SETTINGS \

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190823/788ac352/attachment.sig>

#3 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

Quoting Lukasz Majewski (2019-08-23 10:37:28)

Quoted 24 lines
Quoted 21 lines · On Sun, 18 Aug 2019 17:16:06 +0200 Jonas Smedegaard <[email protected]> wrote:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644

include/configs/sunxi-common.h +0 -0
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
Quoted 7 lines

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 438

Quoted 5 lines
include/configs/sunxi-common.h +4 -0
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+     "usb start"

Shouldn't this (CONFIG_PREBOOT) be set in the Kconfig?

My changeset ensures that _if_ CONFIG_PREBOOT is set in Kconfig then it is not _also_ set in header file.

Reason for my approach was to keep the changeset minimal.

If my changeset is not acceptable without first/instead fixing the related but arguably different issue of "usb start" being declared in header file, please tell me and I shall try propose a fix for that.

- Jonas

Signature · 11 lines
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190823/c956dfda/attachment.sig>
#4 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

Hi Jonas,

Quoted 33 lines

Quoting Lukasz Majewski (2019-08-23 10:37:28)

Quoted 24 lines
Quoted 21 lines · On Sun, 18 Aug 2019 17:16:06 +0200 Jonas Smedegaard <[email protected]> wrote:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644 --- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h

include/configs/sunxi-common.h +0 -0
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
Quoted 7 lines

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 438

Quoted 5 lines
include/configs/sunxi-common.h +4 -0
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+     "usb start"  

Shouldn't this (CONFIG_PREBOOT) be set in the Kconfig?

Quoted 4 lines

My changeset ensures that _if_ CONFIG_PREBOOT is set in Kconfig then it is not _also_ set in header file.

Reason for my approach was to keep the changeset minimal.

I think I have been misunderstood...

The patch to which you referred in the commit message:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig")

was supposed to move setting of CONFIG_PREBOOT to Kconfig.

As it broke your setup - I proposed that you could add your fix not to sunxi-common.h, but to Kconfig. In that way you would benefit from the patch you refer to.

Quoted 8 lines

If my changeset is not acceptable without first/instead fixing the related but arguably different issue of "usb start" being declared in header file, please tell me and I shall try propose a fix for that.

- Jonas

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190823/c1b74ff4/attachment.sig>

#5 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

Hi Lukasz,

Quoting Lukasz Majewski (2019-08-23 23:05:41)

Quoted 33 lines
Quoted 33 lines

Quoting Lukasz Majewski (2019-08-23 10:37:28)

Quoted 31 lines
Quoted 19 lines · On Sun, 18 Aug 2019 17:16:06 +0200 Jonas Smedegaard <[email protected]> wrote:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644 --- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 438

Quoted 7 lines
include/configs/sunxi-common.h +4 -0
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+     "usb start"  

Shouldn't this (CONFIG_PREBOOT) be set in the Kconfig?

Quoted 6 lines
Quoted 4 lines

My changeset ensures that _if_ CONFIG_PREBOOT is set in Kconfig then it is not _also_ set in header file.

Reason for my approach was to keep the changeset minimal.

I think I have been misunderstood...

Likewise... :-)

Quoted 10 lines

The patch to which you referred in the commit message:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig")

was supposed to move setting of CONFIG_PREBOOT to Kconfig.

As it broke your setup - I proposed that you could add your fix not to sunxi-common.h, but to Kconfig. In that way you would benefit from the patch you refer to.

commit 37304aaf60bf did not break my setup.

This proposed patch _improves_ commit 37304aaf60bf to make it possible to pass CONFIG_USE_PREBOOT in Kconfig on sunxi devices.

In fact, that is the very thing that next patch in this patchset does - which is what fixes my device: My device was broken also before commit 37304aaf60bf.

This patchset still applies when unfuzzed. Should I make a non-change v2 of this patch, or do anyone have other comments on it?

- Jonas

Signature · 11 lines
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200227/ddc13be8/attachment-0001.sig>
#6 lore raw

PATCH 1/2 sunxi: fix support board-specific CONFIG_PREBOOT

Hi Jonas,

Quoted 3 lines

Hi Lukasz,

Quoting Lukasz Majewski (2019-08-23 23:05:41)

Some time has already passed ... :-)

Quoted 58 lines
Quoted 33 lines
Quoted 33 lines

Quoting Lukasz Majewski (2019-08-23 10:37:28)

Quoted 31 lines
Quoted 19 lines · On Sun, 18 Aug 2019 17:16:06 +0200 Jonas Smedegaard <[email protected]> wrote:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") intended to support CONFIG_PREBOOT, but include/configs/sunxi-common.h hardcodes preboot as part of internally defined CONSOLE_STDIN_SETTINGS, silently ignoring any board-specific CONFIG_PREBOOT.

Series-Cc: Jagan Teki <[email protected]>
---

 include/configs/sunxi-common.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/include/configs/sunxi-common.h index d7133a73fc..2069884b63 100644 --- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h

include/configs/sunxi-common.h extern int soft_i2c_gpio_scl; · line 438

Quoted 7 lines
include/configs/sunxi-common.h +4 -0
@@ -432,8 +432,13 @@ extern int soft_i2c_gpio_scl;
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
+#ifdef CONFIG_USE_PREBOOT
+#ifndef CONFIG_PREBOOT
+#define CONFIG_PREBOOT \
+     "usb start"    

Shouldn't this (CONFIG_PREBOOT) be set in the Kconfig?

Quoted 6 lines
Quoted 4 lines

My changeset ensures that _if_ CONFIG_PREBOOT is set in Kconfig then it is not _also_ set in header file.

Reason for my approach was to keep the changeset minimal.

I think I have been misunderstood...

Likewise... :-)

Quoted 10 lines

The patch to which you referred in the commit message:

commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig")

was supposed to move setting of CONFIG_PREBOOT to Kconfig.

As it broke your setup - I proposed that you could add your fix not to sunxi-common.h, but to Kconfig. In that way you would benefit from the patch you refer to.

commit 37304aaf60bf did not break my setup.

This proposed patch _improves_ commit 37304aaf60bf to make it possible to pass CONFIG_USE_PREBOOT in Kconfig on sunxi devices.

Quoted 8 lines

In fact, that is the very thing that next patch in this patchset does
- which is what fixes my device: My device was broken also before commit 37304aaf60bf.

This patchset still applies when unfuzzed. Should I make a non-change v2 of this patch, or do anyone have other comments on it?

If it fixes the issue on your board (and don't break other boards), then prepare v2 on top of newest -master and post the patch (adding sunxi maintainer/custodian to TO).

It shall be applied as a fix before next release.

Quoted 3 lines

- Jonas

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200227/a74cc795/attachment.sig>