U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Day <me@samcday.com>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>, Sumit Garg <sumit.garg@kernel.org>,
	Ramon Fried <rfried.dev@gmail.com>,
	Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com>
Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de,
	Simon Glass <sjg@chromium.org>,
	Danila Tikhonov <danila@jiaxyga.com>,
	Jens Reidel <adrian@mainlining.org>
Subject: Re: [PATCH v4 1/6] board/qualcomm: introduce phone config
Date: Thu, 03 Apr 2025 06:59:37 +0000	[thread overview]
Message-ID: <D8WT5EXUI8OY.2UDUBQXGBSQR3@samcday.com> (raw)
In-Reply-To: <20250331-qcom-phones-v4-1-f52e57d3b8c6@linaro.org>

G'day Caleb,

On Mon Mar 31, 2025 at 2:23 PM CEST, Caleb Connolly wrote:
> Phones don't have keyboards! Introduce a phone-specific config fragment
> and associated environment file to make U-Boot more useful on these
> devices. This allows for navigating via the buttons and enabling
> various USB gadget modes or displaying info about U-Boot.
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
> Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  board/qualcomm/qcom-phone.config | 29 +++++++++++++++++++++++++
>  board/qualcomm/qcom-phone.env    | 47 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 76 insertions(+)
>
> diff --git a/board/qualcomm/qcom-phone.config b/board/qualcomm/qcom-phone.config
> new file mode 100644
> index 0000000000000000000000000000000000000000..913c91757c1d77b79b5997597917f9ac002049fb
> --- /dev/null
> +++ b/board/qualcomm/qcom-phone.config
> @@ -0,0 +1,29 @@
> +# Settings for phones
> +CONFIG_DEFAULT_ENV_FILE="board/qualcomm/qcom-phone.env"
> +# Hang on panic so the error message can be read
> +CONFIG_PANIC_HANG=y
> +# We use pause in various places to allow text to be read
> +# before it scrolls off the screen
> +CONFIG_CMD_PAUSE=y
> +CONFIG_BOOT_RETRY=y
> +CONFIG_BOOT_RETRY_TIME=1
> +CONFIG_BUTTON_REMAP_PHONE_KEYS=y
> +CONFIG_RETRY_BOOTCMD=y
> +CONFIG_FASTBOOT_BUF_ADDR=0x1A000000
> +CONFIG_USB_FUNCTION_FASTBOOT=y
> +CONFIG_USB_FUNCTION_ACM=y
> +CONFIG_CMD_UMS_ABORT_KEYED=y
> +
> +# Record all console output and let it be dumped via fastboot
> +CONFIG_CONSOLE_RECORD=y
> +CONFIG_CONSOLE_RECORD_INIT_F=y
> +CONFIG_CONSOLE_RECORD_OUT_SIZE=0x6000
> +CONFIG_FASTBOOT_CMD_OEM_CONSOLE=y
> +
> +# Only MMC is supported by fastboot currently, but this is still useful.
> +CONFIG_FASTBOOT_FLASH=y
> +CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> +CONFIG_FASTBOOT_OEM_RUN=y
> +
> +# Many phones don't actually define a serial port in their DTS
> +# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
> diff --git a/board/qualcomm/qcom-phone.env b/board/qualcomm/qcom-phone.env
> new file mode 100644
> index 0000000000000000000000000000000000000000..6750b6daaed8695faa2fbe1546c1582713f7d56f
> --- /dev/null
> +++ b/board/qualcomm/qcom-phone.env
> @@ -0,0 +1,47 @@
> +bootdelay=0
> +bootretry=1
> +stdin=serial,button-kbd
> +stdout=serial,vidconsole
> +stderr=serial,vidconsole
> +
> +# Fastboot is keen to use the address from kconfig, but we
> +# allocate its buffer at runtime.
> +fastboot=fastboot -l $fastboot_addr_r usb 0
> +
> +# Always probe for UFS storage, though it should be done by board code.
> +preboot=scsi scan
> +
> +# Shortcut to enable USB serial gadget and disable bootretry
> +serial_gadget=setenv stdin serial,button-kbd,usbacm; \
> +	setenv stdout serial,vidconsole,usbacm; \
> +	setenv stderr serial,vidconsole,usbacm; \
> +	setenv bootretry -1; \
> +	echo Enabled U-Boot console serial gadget
> +
> +# bootretry will run this command over and over, if we fail once
> +# then bail out to the boot menu instead (with a pause to read
> +# the error message)
> +bootcmd=bootefi bootmgr; pause; run menucmd
> +
> +# When entering the menu (either from button press or failed boot)
> +# remap bootcmd so it will re-open the menu and we won't get stuck
> +# at the console with no way to type
> +menucmd=setenv bootcmd run menucmd; bootmenu -1
> +
> +# Pause is used so the output can be read on the display
> +bootmenu_0=Boot=bootefi bootmgr; pause
> +bootmenu_1=Enable serial console gadget=run serial_gadget
> +bootmenu_2=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0
> +bootmenu_3=Enable fastboot mode=run fastboot
> +# Disabling bootretry means we'll just drop the shell
> +bootmenu_4=Drop to shell=setenv bootretry -1
> +bootmenu_5=Reset device=reset
> +bootmenu_6=Dump clocks=clk dump; pause
> +bootmenu_7=Dump environment=printenv; pause
> +bootmenu_8=Board info=bdinfo; pause
> +bootmenu_9=Dump bootargs=fdt print /chosen bootargs; pause
> +
> +# Allow holding the power button while U-Boot loads to enter

Comment should mention vol-down rather than pwrkey. I also noticed that
the cover letter still mentions the vol-down serial gadget path which is
dropped now.

Cheers,
-Sam

> +# the boot menu
> +button_cmd_0_name=Volume Down
> +button_cmd_0=run menucmd



  reply	other threads:[~2025-04-03  6:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 12:23 [PATCH v4 0/6] Better smartphone support (Qualcomm) Caleb Connolly
2025-03-31 12:23 ` [PATCH v4 1/6] board/qualcomm: introduce phone config Caleb Connolly
2025-04-03  6:59   ` Sam Day [this message]
2025-03-31 12:23 ` [PATCH v4 2/6] cli_hush: support running bootcmd on boot retry Caleb Connolly
2025-03-31 12:23 ` [PATCH v4 3/6] bootretry: check for bootretry variable changes Caleb Connolly
2025-03-31 12:23 ` [PATCH v4 4/6] doc: board/qualcomm: describe phone support and bringup Caleb Connolly
2025-03-31 12:23 ` [PATCH v4 5/6] button: qcom-pmic: prettify and standardise button labels Caleb Connolly
2025-04-01  8:40   ` Neil Armstrong
2025-03-31 12:23 ` [PATCH v4 6/6] button: make button_get_by_label() case insensitive Caleb Connolly
2025-04-01  8:41   ` Neil Armstrong
2025-04-11 13:36 ` [PATCH v4 0/6] Better smartphone support (Qualcomm) Caleb Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D8WT5EXUI8OY.2UDUBQXGBSQR3@samcday.com \
    --to=me@samcday.com \
    --cc=adrian@mainlining.org \
    --cc=caleb.connolly@linaro.org \
    --cc=danila@jiaxyga.com \
    --cc=jorge.ramirez.ortiz@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=rfried.dev@gmail.com \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@kernel.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox