From patchwork Mon Mar 31 12:23:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877276 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722509wrs; Mon, 31 Mar 2025 05:23:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULyQoSkdZjxIJg+x8t2s/CypNDL8sVZ84YMGDD0+6v6RnXtIzR1rCzfwtvUJb4yKDoObSfaQ==@linaro.org X-Google-Smtp-Source: AGHT+IEhDJ11hMlWSNkgODxnGRWabiM5khKiV77y45q7U5ekWcp17FLEK0a28T2i3ZR+p2WTEiai X-Received: by 2002:a05:6102:2d0a:b0:4bb:b809:36c0 with SMTP id ada2fe7eead31-4c6d39b2254mr5076533137.20.1743423839201; Mon, 31 Mar 2025 05:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423839; cv=none; d=google.com; s=arc-20240605; b=kopx2sPxLARI3DYMEhPmKkEIZjADmZCOcM/YqSiSK7g1FNZswFRbX60zRvNioDdtiT t3RkN2c/eo/jp0BweTgHkJQH/vNj5nnFE4IUv1/zwNSpnUJOf/rJZRB6wHlpOoDF7tMK /ZgPSHgy/TvEwuFMJQweRodCxu9g757WT2M7meR+vg9lc4WxvwwUzwYHPULCEebeF6u1 mqP3YpziqQhtRHf1Xuxt1rhYtey5ANidK8qyLQGjDEZrf5+oCUtmeWKgQXuzhERYmXSO rrzXGzApJC4YjzkIz4/uIun2V1w1sIe0oeMObrUlDBOA7ADZ7LWf0UFIzNtgmlsJVNej T8ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=we7PibkephOQgPlnnIohr624gD+OOIg7UHnG+7S2GSc=; fh=NJPw5RbWCcvVYjiJQZApDFJtVgtQgR+3TfYnrSn0azQ=; b=Y5mCA/CCF12stZqznV6ajmjkFt6Lfvm1+cTVi7b209lMpXMTfCe0khNyKami3piz2T q6AprlEVHvdpk+3rEght/B+GKHO3cwNCaDR9oW5R4zseUGh/1FPSUk87qLKMUmZqriLI Bd2vLKvR0vWBxCwVm84WQpstd76d/4DpbyMkvfDA3rvypWgC3Y+8GvKIEa0Ir9Liinry XxbE1BJlbItqsqC9Gs99znU32BAwTMd3gvGlsDeG104CZcz69z7sIB5E1rF4xMEyr+IH ZKD8DBIJp+c4s2I52GinRUJ1uzpV5YiPiMvrBKFpymJV/QtdsyPSYwTlb8fmXZTP+JCE Twyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1LZ+FLg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id ada2fe7eead31-4c6bfe3b2aesi1579765137.364.2025.03.31.05.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d1LZ+FLg; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C14C68171B; Mon, 31 Mar 2025 14:23:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="d1LZ+FLg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF35481E6C; Mon, 31 Mar 2025 14:23:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AD30581703 for ; Mon, 31 Mar 2025 14:23:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-39c1ef4ae3aso230669f8f.1 for ; Mon, 31 Mar 2025 05:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423825; x=1744028625; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=we7PibkephOQgPlnnIohr624gD+OOIg7UHnG+7S2GSc=; b=d1LZ+FLg2fdJ4Yi2GNr9sSZHy/sobDenlmS+7hNcu+YJlTVgCUIQED1H5tfiTMeE2N q9ThRy0vVfFqIzIaCoeAHwNzcCrmiKD9NlKg2goOv3t49ydK6f2dkeWhx8d0u7yMRKmt QOO3qhUjxFvPa1EFb1MjUp9Uf2TiYfO1bOAevc+n5muepWJ2jGd49sPk1jwH0fFieNxB ESF5BOxf6xjxvPCK3Nv1AndAIBehqNAu3GO3eMh4i4cHxRenYQG7TgdsIUuiwDabfrgy Q8UzUomUMTaezgWEQlH1taQQB3Y3QuYekGjcinv1JJTkFv/cyRiCXqSa2YZnH+7oV0Fm 9jRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423825; x=1744028625; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=we7PibkephOQgPlnnIohr624gD+OOIg7UHnG+7S2GSc=; b=YzcNQb8BXDmpVCIpe4Je6ak1m1SnqeDGune+LjKeNo44uTqK4jRgMqdJN9Xi8LQNMG GcFUmsiZs/fzo54RURPDLy4XvHyupPZxKLzU+Q/uTFsqNebHpRjJ5ZTKEek1R/BUYPna BKeJv0ZGVB7KN5AvBiEZK3JSvr6OB9Eo4FzhwS/8ptbvegaIYLq0Ph/KXf663DyZHE4e Fl3WeJTzHMhnXeRNcOzyEk7+tCdC5J/YKe9z6dVMmJpRso3i+EzpZ71P12hrsiiTN1j0 8nhxi5NfTvMm1w8FRiHSQ5lGPVqrJOFhGoDRhXgZcYUFYKlKotkntgVq5kDexgxOLx2p CxAg== X-Forwarded-Encrypted: i=1; AJvYcCXg8atWtrt7tyPgwAga0ZcUNEdnXc5AdEFf9XbWRsANBW+U9Ufy9Pi7+q5c44R93X9LlQnPRUU=@lists.denx.de X-Gm-Message-State: AOJu0YwH5MmJ6j96CZT2KgEI+tnKlFfgC9x0FwUzkYsXsor+ZYxUtajT 6x/J/XrtuXoABbaufHi4BAlDTnQe21i1raiIduFIUtDdLe6/n9hfSpN0VBsMxMA= X-Gm-Gg: ASbGncsZI+CjcLVOwW7ii6piP7AUDJkcenlZyqgOROkkQfoxrfROGoPaUh5QHE9HKkZ 32iK/m3aP2HBDrrANHvNypeYODf48kxhM8BbSQRMkJdmGy+iuoVL+sP303hhwWeDvtXEbIxC9JS vLk8ryWpsjN6XigcFiwpTXPveT7LH/kukvw8BsQZOJX9fY20aezHfcOys62oQZkm/klwTxU4Yxy 7L7xEBxzLumV/5pRdTIXDCvF/2c2L5u9146VgzkA/vBX1nizWOsXRWQmNi4LPMCgeOOv0JbagZl ITTbF8jkF3v5pJ6MKQbEBglJchWr7PKY+74G4Wg5BJ0AgjmBITr16RAPENiaEbXooCEpWg/heUc wz/oajZH9dgXZ X-Received: by 2002:adf:b652:0:b0:39c:1f02:44d8 with SMTP id ffacd0b85a97d-39c1f024554mr1353608f8f.4.1743423825008; Mon, 31 Mar 2025 05:23:45 -0700 (PDT) Received: from toyger.tail248178.ts.net (i5E863BED.versanet.de. [94.134.59.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b60a9ddsm11315562f8f.0.2025.03.31.05.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:44 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:18 +0200 Subject: [PATCH v4 1/6] board/qualcomm: introduce phone config MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-1-f52e57d3b8c6@linaro.org> References: <20250331-qcom-phones-v4-0-f52e57d3b8c6@linaro.org> In-Reply-To: <20250331-qcom-phones-v4-0-f52e57d3b8c6@linaro.org> To: Caleb Connolly , Neil Armstrong , Tom Rini , Sumit Garg , Ramon Fried , Jorge Ramirez-Ortiz , Sumit Garg Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de, Simon Glass , Danila Tikhonov , Jens Reidel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4059; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=ZSSOLzZkZoQcy0pdLHHbFaldbtKdpjA4S1ZYfRGANHQ=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olMVx5ubDgOfKXfzLNH6DYNnVDobEQ7SbOg0 jCRkC1JPWKJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTAAKCRAFgzErGV9k tk4+D/94Dw0Bu2vdD8IMpuToB/ySNxuO0BWuHIm6OSjiCeuns4cvdR9Nomkkbhg7oEK/5J+E75I HrZlPMUCFkXUHqqMf80/kKpVIM8Tgei6FH/qzkkT5wOojd2Z+tXhKHZxOs92eEakH7jDCoJMBio cB4TQDngeaiJkDSILMO+5+3sKB985urT1H+kB0pZMsrJzB3iCVjSoveqPm5IfjN1bsr2TUwKFmG CayoSNgd7aYDCoEoQMvrIB8nzy8L1JjoUhrHK+amaF91xB5iCKdjuFjEbvthTnfiqJ/J4FOO3Wm I566ViUvkWL185YEqhX7aWDzoYfjsGoq+d9FEDM6FtEZ0OxPMdc2ZtL/IQ9nlLUMz8RnNiwVM/t yhyFVI6UEThNOLSmnLis4Ca4uFank0dCJijLQOQWGMCnxeuAFHGAWnyoBGKqMLNjLodbEygUYNg PtdbrtcUl+H2p+4xemFFwmjqiF2CW0KCrinldEi5Zp/mDOnyp02WZADwhr6Ve0+cnjfcXHpvZnX j8Vh3UNzs83Hfqo+Y1tIQ+78MR5BMKMBs6JyvcSeLeSZuT+JNzP4rIdwy3uAfiOuRWMf4qz68qH Ry3mxgyz/R8YC9dk7qtGPxofoazRc8uN7bhpkVdUno6MPM2hUJXcSXKQBUant/apRUNIpQUJVSx OJo9zwyYCgUeaVA== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly --- 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 +# the boot menu +button_cmd_0_name=Volume Down +button_cmd_0=run menucmd