mbox series

[0/4] Qualcomm smartphone support

Message ID 20240831-qcom-phones-v1-0-08614edd8e35@linaro.org
Headers show
Series Qualcomm smartphone support | expand

Message

Caleb Connolly Aug. 31, 2024, 4:48 p.m. UTC
Improve support for running U-Boot on Qualcomm smartphones, with:

* A boot menu which can be entered by holding power during boot
* Hang on panic (so errors can be read on the display)
* Serial gadget which can be enabled by holding volume down or via
  boot menu

In its current form, U-Boot's boot menu is perfectly adequate, however
once an option is picked U-Boot will just drop to the CLI again.

On a phone (with no keyboard), dropping to the CLI effectively makes the
device unusable until manually rebooted, since there is no way to run
any commands...

To rectify this, let's revive CONFIG_BOOT_RETRY for the
hush parser and make it run the contents of "bootcmd", as well as
re-reading the value of the bootretry environment variable. In tandem,
this provides for a flexible menu system which we can enter and exit.
See qcom-phone.env in patch 1 for more details.

Finally, provide some rough-ish documentation to describe how Qualcomm
phone support works and outline some debugging steps for when UART and
the framebuffer are unavailable.

This series depends on CONFIG_REMAP_PHONE_KEYS [1] to enable navigating the
boot menu when using upstream DT.

[1]: https://lore.kernel.org/u-boot/20240714194948.1271135-1-caleb.connolly@linaro.org/

---
Caleb Connolly (4):
      board/qualcomm: introduce phone config
      cli_hush: run bootmenu on retry
      bootretry: check for bootretry variable changes
      doc: board/qualcomm: describe phone support and bringup

 board/qualcomm/qcom-phone.config |  12 ++++
 board/qualcomm/qcom-phone.env    |  49 ++++++++++++++++
 boot/bootretry.c                 |   2 +
 common/cli_hush.c                |   2 +-
 common/cli_hush_upstream.c       |   2 +-
 doc/board/qualcomm/board.rst     |   5 ++
 doc/board/qualcomm/index.rst     |   1 +
 doc/board/qualcomm/phones.rst    | 122 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 193 insertions(+), 2 deletions(-)
---
change-id: 20240831-qcom-phones-c789d14de657
base-commit: f0ec3e608902ca1f573e5b7017da6bc804483f55

// Caleb (they/them)

Comments

Caleb Connolly Oct. 2, 2024, 2:52 p.m. UTC | #1
On Sat, 31 Aug 2024 17:48:50 +0100, Caleb Connolly wrote:
> Improve support for running U-Boot on Qualcomm smartphones, with:
> 
> * A boot menu which can be entered by holding power during boot
> * Hang on panic (so errors can be read on the display)
> * Serial gadget which can be enabled by holding volume down or via
>   boot menu
> 
> [...]

Applied, thanks!

[1/4] board/qualcomm: introduce phone config
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/bcb278fbc218
[2/4] cli_hush: run bootmenu on retry
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/963c141c3195
[3/4] bootretry: check for bootretry variable changes
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/c2147f6b396f
[4/4] doc: board/qualcomm: describe phone support and bringup
      https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/12901f5bff70

Best regards,
Caleb Connolly Oct. 4, 2024, 12:43 p.m. UTC | #2
On 02/10/2024 16:52, Caleb Connolly wrote:
> 
> On Sat, 31 Aug 2024 17:48:50 +0100, Caleb Connolly wrote:
>> Improve support for running U-Boot on Qualcomm smartphones, with:
>>
>> * A boot menu which can be entered by holding power during boot
>> * Hang on panic (so errors can be read on the display)
>> * Serial gadget which can be enabled by holding volume down or via
>>    boot menu
>>
>> [...]
> 
> Applied, thanks!

This was a bit pre-emptive, resending this series to get acks from Tom 
and Simon.
> 
> [1/4] board/qualcomm: introduce phone config
>        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/bcb278fbc218
> [2/4] cli_hush: run bootmenu on retry
>        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/963c141c3195
> [3/4] bootretry: check for bootretry variable changes
>        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/c2147f6b396f
> [4/4] doc: board/qualcomm: describe phone support and bringup
>        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/12901f5bff70
> 
> Best regards,