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 From patchwork Mon Mar 31 12:23:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877277 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722593wrs; Mon, 31 Mar 2025 05:24:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVW3sqHvBRaEq8ZPibbPL2kXgtrjjANgjQyA4ulU1zdreTed1SdBF4E1PhW8kF9+H2ToFkagA==@linaro.org X-Google-Smtp-Source: AGHT+IHnu0W3ywhO9a6Heq7Pm9K9m9pMRle7PjJpif+WNCyhiY+q5x7IPQ3c9Mtlv+1RNuFO3Xcn X-Received: by 2002:a05:6102:dce:b0:4b6:5e0f:6ddc with SMTP id ada2fe7eead31-4c6d38cb374mr4519969137.14.1743423848575; Mon, 31 Mar 2025 05:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423848; cv=none; d=google.com; s=arc-20240605; b=M2nWnqoxpo7O+SYKQFIGZE927ipxuV0Qp9wdFfkKMGhED/amh0tlvrqAN+cElziSTh KiNZ3vceSFdlr91XJPpNAtDCj0bmU4+vmvQ6o+qZtjX+KfjaB9xiJkzRBWYA4Q+KTurD vdCWSnIapg3ArEWw0Y9oI4rz9XTG/7uT81wdjI1xDdCeCBYUgd9Rz7sAaU1mKKjRm+J6 DGXBSkfuKXc2BBdA3YPTmQXL2z/3DBu7FUhXjFtDIeEtPIxXZTEZxWAem3m4QWVXHXYi tHexYbuBuVF4SSFoRppDTkE85sVCqVHAN0MY2tM1FfS3A4qJzU9BbSHZ8SSjdwzTNhjO /DJA== 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=y5HnO3ARwXycwrnN5wj9aHaMHyZouMgqtvcsy/Rw0dM=; fh=U4jUG95Vt2W2zoXDx+4ya9kd5IogbPl1lM8t61+lAl8=; b=YHVaojNvy7Yke5xxJgwNuHcEY/jmrzUW1ojIf1SPgDw3tsLcTiQjoCYBxR/5n4RkDU g1eoV2AYIDOrqxiQHUy35WfEibZL+0oYMk6cTYdsOCtwC6pvvSYQRtQX6DcVXrv9SB93 JuBVejWBn+4V7W++27aDBSMyYUVM+fRdhgU51nJmejVsrvHFPkqXoNhu3o88shf9ytbr m/9imG+f9tc34eEwvDwBjmSgQrgw8jv6GrI5mVdp4qQNUhv3HzW6ozU2AM7/bCf1xvkr e9rmgfbaensiJBt8dJ7ad2tPulLB/i3qYIfXm4izWG3UkD+dgi2LwizHl8afFvoFx/e0 v8rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o6O/sIHz"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ada2fe7eead31-4c6d33ae3d2si1012710137.402.2025.03.31.05.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:24:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o6O/sIHz"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 1BE1981ECD; Mon, 31 Mar 2025 14:23:51 +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="o6O/sIHz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7416A81ED8; Mon, 31 Mar 2025 14:23:49 +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-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 62D098129B for ; Mon, 31 Mar 2025 14:23:47 +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-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cfb6e9031so40488695e9.0 for ; Mon, 31 Mar 2025 05:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423827; x=1744028627; 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=y5HnO3ARwXycwrnN5wj9aHaMHyZouMgqtvcsy/Rw0dM=; b=o6O/sIHz2f2ei9viHBdK1TE9tohO1yi207F/lT0U5u/XnWr1SHPbre5oBgelFwDdLx uYlfN1UX4mzpgUekT70EonvVnfCVciFQIGw9OgjaRmK0to6ttoIweiT4Ibn0vmwPjO6s Kee8PEaVLS/UV1ptB8X7WG61l45neQt8hOBr9fkIE8NFdPAJpsbS1DvmamZXuQUAmNqr 6RdEBgXqs+5FDBIINmkAJfka5v8UVH4Y3rquyKBpLmQG4Sx4EjmlnR0b1aYhD6nziFCg uOTDRSlhROTSHIg3269Cu2Dy7AkVsrQY3ZrI3Nd8lDtjUcWewwPVghTluOUgnugTugl9 dDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423827; x=1744028627; 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=y5HnO3ARwXycwrnN5wj9aHaMHyZouMgqtvcsy/Rw0dM=; b=XihxhLo2gxKUrBRQ5+Zs/u/dDleaIqzawfN2BQV3eLm2JUftKtenpuoPSa/Dxrhf8Q aCWCWMI5h0C/W6CFDVqExPTt86HGwpcEPSbDW41WGbL3VKyr7eA2xyiqLp4ggpNhtvOG hrx2DG4gwvKQPuPfz8sZs7mcrXl7YboMNeH/5PVYSKKgUOeHajLEQz/y3RoFsZQ93r6I ChrKvsGMQVFJi23Qh2sYgulH5DpuesPuLJcpeULa08/ka9PQ8BNEdsR0ZFzgjrIKzr+n GoI6WdZD7yr8Tclj1Q/xVV4ogpsDkPuhBOInmpcuSvvnstdmUIWYhrX2Max8tKgA6fiR a+LQ== X-Forwarded-Encrypted: i=1; AJvYcCV4ybOzTyhvecPVuxZbtH9Ex2IorQoz3i93LANa9rTAh81bF6kPNC7fn+VLh3OglecQXPa/R1s=@lists.denx.de X-Gm-Message-State: AOJu0YxEHwdJTDELyvw+aXu4zXrbY+wS+LIODOLNtp8Lncpj5tlRVoXq j8OVc/CTKxvBrmMOA+2dXI453atzZJ1+oQHSEwl4368kSDrmP4LgRxD5QtOCUvk= X-Gm-Gg: ASbGncv7ZsrRQSZc3eZSCxjnn76LWWpRJTqReRl/+zkc8InghafWNUVrXdozwyWcLL8 ghMIVEruXoTiUdHD5uASMiro38VoJjChcuuT31xruVL7ZEPLLzLgfjmZc9R+I8iDeGlKLCsuv/A zupA1VIQXLPRB1X1lvWo5OYrmLkNxLuavNwQ4/cL5gLCmwqS+zzu2WGGDhVQVt6owuT51c35xP7 jhr+lSx9BUSLZR6qC6+lP99eP08Caqx17JQTtN2nkIsnhP3f9bSYG3Fjo0YB0JLP4oUx4xuxMdI QwsrxROSU28IlPQC4sTTyk1rkopkx6BZxrxWHcSk/3zN45KdlOL4bTvH88JIqKukEKjd3cvQTI4 e18bkUjXdesgL X-Received: by 2002:a05:600c:46d1:b0:43c:f8fe:dd82 with SMTP id 5b1f17b1804b1-43db624aed9mr77516975e9.18.1743423826816; Mon, 31 Mar 2025 05:23:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:45 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:19 +0200 Subject: [PATCH v4 2/6] cli_hush: support running bootcmd on boot retry MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-2-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, Danila Tikhonov , Jens Reidel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2568; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=Kg+TGtcWBIAVSrHbJr7RKzreMrTNFioGuDeGTnelsAE=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olNNTzE1n0ekiTG6UWirWVxZ7JmgxXP+16dB 2bRN+0SdFOJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTQAKCRAFgzErGV9k tkf6EACe+57VWAiCerp/qAT3gSAy3AKnpVzI04wmo7EW421sDtGpbh7baR4dcwAZGj1AOODNccY 19ztJh+5f3zTv95yqip1Fbi1luacmHd5k4JxgPIkq69jj0bzb6fhU38ea9aE3GGgKUb/QV7Lgyc EJ8iD8ve5rfum29o+n/DbIHCW1/6iWYxtUotYXVKmTx4zlYtHVSXgq9HYmj1QFY9/ojYwnWYhJ/ uXR4NpfQWs+eYjo8NtIpFIQCnbzoIqoJ5IKSc1y4SikfQNNyrjaXX6kttL0hWZL+ydgusDkQv8Z 0Zn3/N1qeAtg19MqxbNBzgqCs2K7w9kIV+luKOVE7ZuJcw1mYP+U0ssW21ABS4NTglMlljbsLRJ 2/aYaco8udcVFC5ioUG3Ptb7ltlrSSJr1yX4VPgbkjZTCpxa18huV4KpDsQmfLsScpAVzIx+Sb3 WsKQRZXvoZBw5v3jSupDKK608xPefzPmdXmydb63vcaUQcAmMsj+5KrSPVRC6GfMA19qLepSPM6 R2d5PPGXJKbIZrSiyHczoivJqenQCpLO3dVTXgHOVoKbJ3xFltroUkMWKbnAOe/VIx18vZa6eGr y2WNPE+EJb5C8er8YMlwWDClWKzCMGeIKM86LyIZmJAd+leAsx6j3ajdZf6Cyl4Xp+IrJyhxZtd 8GC2vL0EPlSYoaQ== 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 Introduce a new config option: RETRY_BOOTCMD. When enabled this causes hush shell to re-run "bootcmd" when the auto-boot counter times out. Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly --- boot/Kconfig | 7 +++++++ common/cli_hush.c | 6 ++++-- common/cli_hush_upstream.c | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index c09a98c3233ceb1c68024a193d7dafdce6b83903..4db13dcb9a51940c358f754d9ff91e88bebd96b1 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1711,8 +1711,15 @@ config RESET_TO_RETRY help After the countdown timed out, the board will be reset to restart again. +config RETRY_BOOTCMD + bool "Run bootcmd on retry" + depends on BOOT_RETRY && HUSH_PARSER && !RESET_TO_RETRY + help + If this option is enabled, the "bootcmd" will be run after the + countdown times out. + endmenu menu "Image support" diff --git a/common/cli_hush.c b/common/cli_hush.c index 9f437ae5f475e2f33041485e88d72c9bb71ab309..7bd6943d3ed65bb24c709af0b195825a26d65f39 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -1027,10 +1027,12 @@ static void get_user_input(struct in_str *i) if (n == -2) { puts("\nTimeout waiting for command\n"); # ifdef CONFIG_RESET_TO_RETRY do_reset(NULL, 0, 0, NULL); -# else -# error "This currently only works with CONFIG_RESET_TO_RETRY enabled" +# elif IS_ENABLED(CONFIG_RETRY_BOOTCMD) + strcpy(console_buffer, "run bootcmd\n"); +# else +# error "This only works with CONFIG_RESET_TO_RETRY or CONFIG_BOOT_RETRY_COMMAND enabled" # endif } #endif if (n == -1 ) { diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index ab5aa5f9b36a91e09f8fcfcbb8b31afa0892e6bc..748ef60ac90b8af8052631c7ad3a6aed2629140b 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -2906,10 +2906,12 @@ static void get_user_input(struct in_str *i) if (n == -2) { puts("\nTimeout waiting for command\n"); # ifdef CONFIG_RESET_TO_RETRY do_reset(NULL, 0, 0, NULL); -# else -# error "This currently only works with CONFIG_RESET_TO_RETRY enabled" +# elif IS_ENABLED(CONFIG_RETRY_BOOTCMD) + strcpy(console_buffer, "run bootcmd\n"); +# else +# error "This only works with CONFIG_RESET_TO_RETRY or CONFIG_BOOT_RETRY_COMMAND enabled" # endif } # endif if (n == -1 ) { From patchwork Mon Mar 31 12:23:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877278 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722654wrs; Mon, 31 Mar 2025 05:24:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUsnSh3Or+SX7mh7Hs2LzvpDo4ojrKjFCVpjygvGXUcc/Y9ohS7CsTcCXM06yuhn47lKkVnuw==@linaro.org X-Google-Smtp-Source: AGHT+IET7tnWAxy4VsYqs8qPhxi+APBmJVNnkmv53GCLGtV3Z1CU5n0kdl0geLUAmKjrSudajqak X-Received: by 2002:a05:6102:5489:b0:4c3:7f7:92f4 with SMTP id ada2fe7eead31-4c6d3862fabmr3820144137.6.1743423857746; Mon, 31 Mar 2025 05:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423857; cv=none; d=google.com; s=arc-20240605; b=eHSlWozdoeIv2j+682qzkAMDbp3U0HQ0vpw/fj7Cx0Q5o9h8IH8Sbqwy9zAVmJO/iD JzXcVzElYqpPXmbozDXJL3nu9r0lqEcBrQPmYdUiV8zSjMNZtNOPemN6FTaG2nhy6kK0 TD+KNg8qzKfzlxjhb4CVsKdTVZHV1Hv6lS4G2XQs2MGWsCcqoO1o3KgXbYRPOeBNxsg3 wUnGSe5uRDBVqICqPA8op/3wZhRc86zzj59nMoVZn76H1d8lhAUNXCPXVjkT119s9xI8 EhMWyIvty9H6pBMkIzRHl5xR78poQDFYRK+sHAAwVSsgmRlLzsyQmtXjhzIsMp4CqbBY iJcw== 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=CJneWbuZmLBZW2m1oElNfYskRR5fwWXGKOiA6LQp6V0=; fh=rWSmxuopRxVygxaMeb5FNNuEYobIZV/RLodmOFlXFlI=; b=EScLbO1iZsfngFUMV+i5iWhMAKOYbWpQ9gU0YSZn6oLBmXxUhsUabgWzNH36C0Ick7 1n16xVqxsJKlehlCkQ8AAcVAfPdGAKBOI9HcrZwCd0Ep51GNKevhoeGpmDKovwoSo+J4 zEmH9MpqP9uZmjOHT0UboHP/irYf4gJK3xUfLejkUmDoUMniZ1bJVSw2JZVEuNMD1759 y6Zlz8gOXFlLkR/yDHHwpBZVzJf3t9T6F/0hlwYoT2TLaJ/nhupAjBYVVSUAoZWKZzTS fnqg1b20vl8/wQpJC5nTz1CnyrfFSg+l8JREURkQKDoj//iYK2l2Gjxqf42WmtDP6p3o ATHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KrWj8eri; 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-4c6bfe14d45si1558649137.295.2025.03.31.05.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:24:17 -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=KrWj8eri; 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 7009F81E6C; Mon, 31 Mar 2025 14:23:53 +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="KrWj8eri"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 15B908144A; Mon, 31 Mar 2025 14:23:51 +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-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) (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 0EBB581ECA for ; Mon, 31 Mar 2025 14:23:49 +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-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43d2d952eb1so29826555e9.1 for ; Mon, 31 Mar 2025 05:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423828; x=1744028628; 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=CJneWbuZmLBZW2m1oElNfYskRR5fwWXGKOiA6LQp6V0=; b=KrWj8eria89Ve/ygF5v6Pk2Mk6z9LB99O1XconO6lwiam3lZKN1BpAr9bL4KmUHH7W c6ROnM19tES4kx0TxAmN6kRwQ3C63HiRo/O2Ob7klC64U7VUjjYswpTLyk2EdAbF7ujR W4HryFIN2YpBo19Z+v+rese59Bg624VGl+n0A2IrJ0KFqtoo6SWacLxhgyMA5JaPTCbU RY8ci/6xeJ8V2aSZN1WHLJqpuz0s40ujLvn/2KDZ14pBaQIV1mdZN/U0Y82ffV6pQy7u cBV7t3bI47eG2SLmPRsQWXB+Y0mcCClsRqSG+oqzs/2OYT3k1ZHWLo+IqnIzALx6UvgI 9/Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423828; x=1744028628; 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=CJneWbuZmLBZW2m1oElNfYskRR5fwWXGKOiA6LQp6V0=; b=DKgd/ToZ0MNnluTS8a80z7PxID96/MKfLbb7izmGXz/zYaElav3h/f7uFY9lzb/BXf t06vd2T08tHjN7d2auTU+oqXieopTt97CB1fC0QDN1b0BRVT3sfDyB6U0+y/mTBXQmjG XjCZzdMw/jtOxNL8DMC0Zs7DKcoCnvRpbEoKncrtEejjNjkGlVTsQyXhZEgVy43g5fqX 4Az4G0ZibHxcGcNYc0Dyo42WtCR6fKJlH+MH3K+Y50y118fAvRFocgfutrjdKLNuC8rE TtXcRIUxTa2xUT21nvUoswFA5ylIbTOLZoBRQB9EPmmPY0lOKlCFr1ClOTtRkpoCInlJ dlsw== X-Forwarded-Encrypted: i=1; AJvYcCXeAa3UsJXtSIy4czfE1RimyjqUuTZLIW3pwCVEzKSM/Df9aN891S/MNVbMvvsC+J87PDdjLss=@lists.denx.de X-Gm-Message-State: AOJu0Yzbiyt6LJ+G/lLojtgZKDqD+kh8xBuPMSvlozuH9lT11GtXo7DM USMdUEDhjsEMLBjvfVsvo+X9gCOL6fo3HdipS+ln7vYACWaf6azqu8YOZAD+mXI= X-Gm-Gg: ASbGncusJd9Eq7UnsM7L47cTjGLykndzvg//uFULYXudh0Lxkbm7YvD72B+uKuKqFBA 3JD6zeqD/jKzIWfrMhXbHBwlrtTW5VkczLo2c1AFxYie+mf3asfp5n1GV63CF1m4DNPolqD2Lt3 AgFqKUD32jC38YPhn/FUeTyJYUHmJWvGQjy9C4s9yduuaMitQAdXSL5i9ItFwJj/sWS4KE6nIiA FqngL99NlVyLCXeBmNe2J7KQheaLyeasBqZX1DEO+DV6tSeXNHZBB8j4Efgria6x3vJ/dQDNhCK 3B1aE7JNjwnD61RhZcauB3wbAhcKG1HFqlp+JON3Gris5YDrVVm9pKtWLXmxPDDlJqTUpYwn2M0 HmfnEvSs9H0G9 X-Received: by 2002:a05:6000:22c8:b0:391:481a:5e75 with SMTP id ffacd0b85a97d-39c120dee91mr6238302f8f.22.1743423828445; Mon, 31 Mar 2025 05:23:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:47 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:20 +0200 Subject: [PATCH v4 3/6] bootretry: check for bootretry variable changes MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-3-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, Danila Tikhonov , Jens Reidel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1387; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=jwuZYBuJJ+ldxaKDFAWY5XTPAL8LwWLq3I/2ci0eJHc=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olNDItYx8ayWIVRlSHfF792o8gGQqh4QTLpM nAxlIu5+k2JAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTQAKCRAFgzErGV9k ttjeD/4pjcnL6ArvpghLbsXvkTaiTInG3EK9CJawZGZfhZxA3fGs9PfVOm0MmVZlF8t9qaSc+ew UxNL4eHArlbZKYVgU9jWhvnVpCvebPtIdCDuJ2i+qJt830SHO39qSt46h9KcXpktBp7fBAl5JUE 35xeyUNr/kOGn65ZjRICEbFVYnc4y05cmWof/i3lAc8T/LcaCZugRIZ3eGyMawtvEFyFB06bSqN w/QlTDMS6fWIPXqZRGEfmNy3BLhmVwYAVyYyarsmSMgDlQ5QMnlbxphMgY1pyWt6p80kIOVbvC/ 4+5BcrCJsLdrpvT2FyFWR4IEPPqEJzdqLW5t3Kr/yhC2g8gj0XK2RUJFFTUBhB2JVQ9EdXOxAZO U3Xxva+KPkI5vGWi1uuTcsHBCkF6FPTEAOfVWgw36NwXWN6P/IiE8UBRC/ahCRf/a1T7l+Yvs7J OtQB6QHhE2bJplhvWqq43A8ghHMCjAE4LBjZQbUOZCG4OTHmuEpMNB2KrVp03x76TpshWAX1jrd AcTBpPJgIBlypNUDI9Om3BYCygRafH9qEAbjdwqwsNToOnaoe8KSjoZoif6J5hjgTifDorubxz3 JLxmLpYg9CgbCfndskMy8TJUJ2KUpSekYPY6ptBFFlGrxo9QnMWpVmywlLmIj/gJCaBpqrSGmCi OLX2l9GL+XTstkw== 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 To enable more complex sequencing of the bootmenu, autoboot, and bootretry, handle changes to the bootretry variable between tries. This makes it possible to turn bootretry off (e.g. to drop to a shell) and then back on again. This makes it possible to have a persistent bootmenu (the only way to navigate U-Boot on devices like smartphones which lack a physical keyboard) by having bootcmd be defined to launch the bootmenu. This allows for menu options like enabling USB mass storage gadget to return back to the boot menu once the gadget is shut down. Reviewed-by: Tom Rini Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly --- boot/bootretry.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootretry.c b/boot/bootretry.c index 587b2de7d6b08db07e1dea512a834cb5590c2d12..a60767eaa2ee51970e4695e487ce5651575079ba 100644 --- a/boot/bootretry.c +++ b/boot/bootretry.c @@ -36,8 +36,10 @@ void bootretry_init_cmd_timeout(void) * reset command line timeout to retry_time seconds */ void bootretry_reset_cmd_timeout(void) { + /* Parse changes to bootretry */ + bootretry_init_cmd_timeout(); endtime = endtick(retry_time); } int bootretry_tstc_timeout(void) From patchwork Mon Mar 31 12:23:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877279 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722710wrs; Mon, 31 Mar 2025 05:24:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW79rNsIhiZcZzlTDjOyvqXLpHNrpQUSq0ql69zXZL4PHY9QetZnD6uFn+6O6uKahltzqEUQA==@linaro.org X-Google-Smtp-Source: AGHT+IESbWk1YfGdkgl2E7701Fqo2UjZ0oZ4NBJGYyHhnbeV801fd95YmzpIwDEt5C4DgwqATMAL X-Received: by 2002:a05:6102:3e12:b0:4c5:904d:f358 with SMTP id ada2fe7eead31-4c6d39a3f92mr4918080137.23.1743423866295; Mon, 31 Mar 2025 05:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423866; cv=none; d=google.com; s=arc-20240605; b=UNfo9qfYAZ+sRR49AjeVIpJU2ZQkb+pYrS9pUX5AdCLRcXejaHqjTiQd+5gp4p7Sau xyS6OGWDEwnkZFry6dTBam+avqHLPKoHoki6cEUUBJQX8qG0CLmzPyQ6t9kxr06c4zLA 2J8FlBCtVktkjJ8Jzh7GWb4WaBa5t2cV0qxgctGguRmz+kCZxp7fnVE/9W2URpsiN+kI LLuMbx18ckn0PjgQ6gdaaSSwvbZKHTVrUmcB4bl0F2RTsPXBLYwtk39JEdnaiZvgPo33 gBMSPuV1gSi4Cj1kGfd/LhIVwkaRaBDqW0YldpKPhjsDJvBW9fxsjUfzYPst4hitfE3+ Nb/Q== 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=9l6TBguCI+1TQM24o3298QYvGo7auXO+JB/eGhaygm0=; fh=i0ZLEiOFtr+X/rcBry+UE8X6WBPRv+ZFHRHJzHHqKUY=; b=KFZo115aiPSwklFMMa35a0C0lYQXBeqn5pquPObGZiLU0Z7G3Gmg1EjgK7Bsz+rTZy b744qYSj7fSS/KeEW4da4CgXt1vmFfZ26xyfmLuZZkbHfkiBIgmvEaqG36mwUog7kfMy +qS7/5JGm+4pPdXTVOK0UntK1QWcuxtkC/6pFPeNwavEEhck5ZYcBAYdu/rN7/DpucFw Qb6L7ih+ncVose1OQfXbZPB72gDIRXWBdWMmJIW7LcB3Pufi6NRDGMcgmqt1N/ooyyX9 sj0l4xaIGaukArK+SiPGdDGGJd4EvqWzQXuc1dRpGZijsp1/dIs/DwZx2/mn5GGX8se/ yjUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c7SFILlo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ada2fe7eead31-4c6bfe774dasi1622268137.520.2025.03.31.05.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c7SFILlo; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 C102681F44; Mon, 31 Mar 2025 14:23:54 +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="c7SFILlo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5466181E6C; Mon, 31 Mar 2025 14:23:53 +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-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 C16F68129B for ; Mon, 31 Mar 2025 14:23:50 +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-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43ce71582e9so30533155e9.1 for ; Mon, 31 Mar 2025 05:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423830; x=1744028630; 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=9l6TBguCI+1TQM24o3298QYvGo7auXO+JB/eGhaygm0=; b=c7SFILloEUGUmgQygKyb4vRImnBo1ixAnioEMJinv4Nh/ys99B/3QF8dsbO5N5Ngcc iweexEWqDoZbFTx7OeZlwnXWkgRSWzrVdzur38Gnx2gHS6ZqFO/Pp0sxSXvaui81Ckpw 5mMPnOAMkiYbZocfXmfMpjgBh9OlydrvZg7ho0BEB2v3B38LbZwkz7NX6k1FfGkDRolC dRWYkT8t5GL81i05WtXlSNML6S8egeN1avrIofVN3HBB/QscYQuJIaFJqsLYgOEH+KCX CyNOo93Wld31pB77g54aXg2AcHFMZegMimQHA92Iqa5A/RLaZuEoXyA9BOLQzZE/5gCy bqkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423830; x=1744028630; 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=9l6TBguCI+1TQM24o3298QYvGo7auXO+JB/eGhaygm0=; b=ZtumZFF9j6A7c5enkOO4toIiJ5kY9rvBAH0zMatqvSRJMGOq7ZlOKd+j7/2hgk7xkQ NGNz35eNFHVmXx+t1D3m1+4linXUQ7tFU1GEgympYQfI7k+UHjckMUr6lvC1/d0LjVy1 QlW3Ijosh24kWrmBN2v9h520EJLLqz0ZQfO2xp3SPNNavO5yrmy6YiMPEfha6HtjYbzX J6AQ7h24DHBBxxRPGRyK81RYbSVrlKLhuaPHPzfg5fOJIrL0HRCIOaK2w71lIdPC+ogy 1gtPpP3IOGjNXmMcrC5SWZtFZC71v8v494iiarpqCaZbUn8Tmz396AA84X1/HLY0Ie20 kP2A== X-Forwarded-Encrypted: i=1; AJvYcCU2p8NZ4xeMXSucZtg2sxnKB1SWswrzYEohYrBHxXsB4xOxRt//WSiNy9oT3lKsGkzuP43IAEY=@lists.denx.de X-Gm-Message-State: AOJu0Yz9m0f06pQkeWiAAtHuiZ72OXOb4UyadIzWMrudzYDuswe5dVjV 9DqEDuNF5mJSEsm5P9fGAY/KvuS6BREnlz9YGBWk4HN1d4eLAmCdzfEA0S6Jwv0= X-Gm-Gg: ASbGncu41p4Mo57S4LyDYZCr8y0NK1ORzxbt6bYmf2GD7N84LF/kLf8Knw9O1r92yq6 go8cIr61EU6WCmyWurmZnBvnkRllFORLMYQtv6B+lIdKY2x0s77kgPIRbPEUnvC2BBmpZmx8itE AOeOXM6F1Dcu55qKb1LrliZeoNY8KluCUqEt9anRcvgeaYWU2DPNMIJUreKM8Mq6fbiYsBLoXoJ 0xizF4z+Du+Zl11uDuMAF9ZvEHyvlgA6j32V38RgSXRMmpS1t8viXS0E1yWAYJ/SEZuMRRsoWxh 297MCuJM+VJf46uXYRyi9zoSnP6o9knjjH+ODO7XqsVkgLwDu9t8chbypC0WNwzCtgA/7M0Rf2K E8ye58MQD4uw4 X-Received: by 2002:a05:600c:8705:b0:43d:2313:7b4a with SMTP id 5b1f17b1804b1-43db61b33b9mr98011265e9.3.1743423830115; Mon, 31 Mar 2025 05:23:50 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:49 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:21 +0200 Subject: [PATCH v4 4/6] doc: board/qualcomm: describe phone support and bringup MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-4-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=8765; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=DlcpebobFqNsX/YsiAYa59rna6gYYXDwYSAb2tmpk84=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olNbJBBphgSBfxbLV3v+0pSjAQBfeFx4j6Qu j9FgBfXDaOJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTQAKCRAFgzErGV9k tkAoD/0coqyGzqDtYAhFPO89U7SHlltv/AG3+IO0nZXkfvaTRakPcUFUUwhEvIsTkSS0QKMW34v JwUyWB8USkUfrTW+EZMluQ8EgsPXGsjiGGtIifSXzqj6va/0Rca/yNNUfI0jzXiXSY3qgr8XdNo lDuqv6alfdy6vmwe7cto6t392c5tYTmWvXj3QISeWBu/L2JaGV8wMhZxNR8PmbIu8AkB8BE61p+ egBZaJYNKLYFHSe6sPylphjJBfTJL7+EC0fB19+w7A1rY3Lmlo6AuBAWESImanKV5L4CCz12X3O MauEz1L72lgZ9Q5JHuK7QfDz2m6AnYXvUhlVeNV+yHC9hNbRu5OvQ9LV1lLkTx+lRlNGCRkTV6v qC4hmQRgmaNSfN/P9eCcdJFIWri7b5PT4HeV0iIGF8aO3QxbZ4XiK37hrszB5u2M6l1wG9M/Ru3 nr8ncGENFF3AsHrZmQqwrIhjsCQRIvzEO8yzBnutqnBnGhAlY0pgNCHxdmnkLrgRZ1fTo1IWz8c 201FfBn+1bjzHk7hga55KHZC+cFtzawSTMA157JBEYVZZz7knvmPbBcmD9Y0YOwVJJ4xTwWFCF/ 3kMajzlPXZkGe6krmiEcDXs/OD9DTVPDWpmFVjhUZz9zn9KKhpwe3FhhwkRIF25s2TaRoeh24u5 WVVeDgpmZ1CmukA== 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 Add some documentation which attempts to describe Qualcomm smartphone support with the qcom-phone.config fragment, as well as a high level debugging guide for diagnosing U-Boot issues when UART and framebuffer are unavailable. Reviewed-by: Simon Glass Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly --- doc/board/qualcomm/board.rst | 5 ++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/phones.rst | 144 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) diff --git a/doc/board/qualcomm/board.rst b/doc/board/qualcomm/board.rst index 4d793209f9e31e6447c696ccd07af206dba99645..003d59a18ebd3f19db568fa59e9fd06906e209f2 100644 --- a/doc/board/qualcomm/board.rst +++ b/doc/board/qualcomm/board.rst @@ -89,8 +89,13 @@ Or for db410c (and other boards not supported by the generic target):: make CROSS_COMPILE=aarch64-linux-gnu- O=.output dragonboard410c_defconfig make O=.output -j$(nproc) +Or for smartphones:: + + make CROSS_COMPILE=aarch64-linux-gnu- O=.output qcom_defconfig qcom-phone.config + make O=.output -j$(nproc) + - gzip u-boot:: gzip u-boot-nodtb.bin diff --git a/doc/board/qualcomm/index.rst b/doc/board/qualcomm/index.rst index 66bc922033a2e30a472db5b5c7dc6c8511f50ed8..e2fcbfa19c2fff36c8551823ca4a53a5fdc7fa9a 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -8,6 +8,7 @@ Qualcomm dragonboard410c rb3gen2 board + phones debugging rdp diff --git a/doc/board/qualcomm/phones.rst b/doc/board/qualcomm/phones.rst new file mode 100644 index 0000000000000000000000000000000000000000..1d27196cf54018b393f3cbc914d0cd26e7f0d8dd --- /dev/null +++ b/doc/board/qualcomm/phones.rst @@ -0,0 +1,144 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Caleb Connolly + +====================================== +Booting U-Boot on Qualcomm smartphones +====================================== + +About this +---------- + +This page attempts to the describe U-Boot support for Qualcomm phones, as a user guide but also a +technical introduction to How Stuff Works to help new porters. + +In broad strokes, U-Boot should boot if the SoC is supported, and the device is already capable of +booting an upstream Linux kernel. + +The list of supported Qualcomm SoCs changes often, for now it is best to look in +``drivers/clk/qcom/`` to get a rough idea. + +For building instructions, see :doc:`board`. + +Phone bringup +------------- + +It is usually easier to get Linux booting first, there are many good resources for this such as the +`postmarketOS wiki`_. Once the device can boot Linux with logs on the display and ideally USB gadget +support, it is highly likely that U-Boot will boot as well. + +For logs on display, you should have a simple framebuffer node defined in your DT, newer devices +require that this follow the downstream naming scheme (that the DTB is compiled with labels enabled +and the framebuffer reserved-memory region is labelled ``cont_splash``). Once this is working in +Linux it should also work in U-Boot. + +In practise, U-Boot still has many more papercuts than Linux, which can be sticking points when +porting a new device. In particular, drivers failing to bind/probe (especially pre-relocation) can +be tricky to debug without UART since U-Boot will simply panic with no way to inform you of +the error. As a result, bringing up a new device can be quite frustrating, but there are quite a few +things you can try. + +The phone config +^^^^^^^^^^^^^^^^ + +Since most phones lack a physical keyboard or serial port, a special config fragment and environment +file can be used to provide a more seamless experience. This can be enabled by generating the config +with:: + + make CROSS_COMPILE=aarch64-linux-gnu- O=.output qcom_defconfig qcom-phone.config + +The config and associated environment file can be found in board/qualcomm/. The main changes are: + +- Panic on hang (so the panic message can be read on the display) +- Boot retry (to automatically open and re-open the bootmenu) +- A boot menu with helpful shortcuts (including USB console gadget) +- Launch the boot menu if power is held during boot or on boot failure + +Fastboot mode +------------- + +U-Boot's fastboot implementation is much more limited than Qualcomm's, and currently does not have a +backend for UFS storage. If your device uses eMMC or has an sdcard slot, fastboot will use that by +default. + +You may need to run the fastboot command on your PC as root since the USB product/vendor ID may not +match the android udev rules. + +You can also use fastboot to run arbitrary U-Boot commands with ``fastboot oem run`` + +Retrieving early logs +^^^^^^^^^^^^^^^^^^^^^ + +U-Boot is configured to save it's internal log to a buffer, this can help with debugging some driver +bind/probe issues. If your device can boot and has working USB, you can enable fastboot mode (either +via the U-Boot menu or by adding ``run fastboot`` to the end of the ``preboot=`` config in +``board/qualcomm/qcom-phone.env``). + +You can then retrieve U-Boot's log buffer with the ``fastboot oem log`` command on your PC. + +Hang/crash bisection +-------------------- + +Without a way to get logs, we can still get quite far with only a few bits of information: what +happens when you ``fastboot boot u-boot.img``? + +Does the device disconnect? +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This can be verified by watching ``dmesg -w``. If it stays connected, it likely means the boot image +doesn't match what the bootloader expected, use ``unpack_bootimg`` to compare it with a known-good +boot image (ideally one with an upstream kernel). + +Does the device hang? +^^^^^^^^^^^^^^^^^^^^^ + +If it stays on a black screen and does nothing, then that's a hang! Since ``qcom-phone.config`` +enables CONFIG_PANIC_HANG, this likely means that you're successfully executing U-Boot code (yay!), +but something is causing a panic. + +It could also be due to a bad memory or register access triggering a secure interrupt, it's worth +waiting for around a minute to see if the device eventually reboots or goes to crashdump mode. You +can also disable CONFIG_PANIC_HANG and see if that causes the device to reboot instead, if so then +it is definitely a U-Boot panic. + +With enough time and patience, it should be possible to narrow down the cause of the panic by +inserting calls to ``reset_cpu()`` (with CONFIG_PANIC_HANG enabled). Then if the device resets you +know it executed the ``reset_cpu()`` call. + +A good place to start is ``board_fdt_blob_setup()`` in ``arch/arm/mach-snapdragon/board.c``, this +function is called extremely early so adding a reset call is a good way to validate that U-Boot is +definitely running. + +You can then do a binary search starting from the end of ``board_init_f()`` / start of +``board_init_r()`` and work from there using the init sequences for reference. + +The Qualcomm RAM parsing code is a likely culprit, as ABL is known to sometimes give bogus entries +in the memory node which can trip U-Boot up. + +To rule out crashes that might be caused by specific drivers, it's a good idea to disable them and +re-enable them one by one. Here is a non-exhaustive list of drivers to disable: + +- pinctrl +- mmc +- scsi/ufs +- usb (dwc3) +- phy (usb, ufs) +- clk (remove clock references from your framebuffer node in DT) + +Ideally, it would be possible to use the framebuffer as an early console / debug output, at the time +of writing there are out of tree patches for this but they haven't been submitted upstream yet. + +Does the device reboot or go to crashdump mode? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +On many devices crashdump mode is disabled, so they will reboot instead (maybe after some delay). +The same approach as suggested above can be used to figure out where the crash occurs. + +If the device is rebooting, you can insert calls to ``hang()`` instead of ``reset_cpu()`` when +following the instructions above. + +The most likely cause of a crashdump is the pinctrl/gpio driver or the SMMU driver, ensure that the +``apps_smmu`` node in your SoCs devicetree file has one of its compatible strings referenced in +``drivers/iommu/qcom-hyp-smmu.c``, you can also try disabling the pinctrl driver for your SoC (or +``CONFIG_PINCTRL`` altogether). + +.. _`postmarketOS wiki`: https://wiki.postmarketos.org/wiki/Mainlining From patchwork Mon Mar 31 12:23:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877280 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722791wrs; Mon, 31 Mar 2025 05:24:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMdBdHK9meFsDTbJurCtUTFlG0p96eABpiIfxCvIRSMZF8yRAHEav4zbbe9hvan3hCGkWIEw==@linaro.org X-Google-Smtp-Source: AGHT+IE1169LQeP0zCzM8rdCDHPL+t+8AnQszuREs67QV/2E9odvKf73NeSoNwIjE3Y65/QHDSS1 X-Received: by 2002:a05:6122:218b:b0:520:51a4:b81c with SMTP id 71dfb90a1353d-5261d478794mr4191637e0c.6.1743423875834; Mon, 31 Mar 2025 05:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423875; cv=none; d=google.com; s=arc-20240605; b=hCEGVMV7xgLEli9cASRbEFSS8G91fJc4FQWQOFpwtviJKIkxFbqaa4hNL08q6uGF6l 7FiQ75SlOFqO64Z7xdcXLorsDrC8s9Kc66Or8Ea2VB6QCNeWEDe8VckOX6zUx/+T13Ro LnffVMsF0IFnNgb/vUPO1vTSgwXwBYtB8kfrKnTwOZ/zJkyszPcKxHfX3I7KS+wRRjn9 63ik6UGVUj0/a+32DGXA/kw2jWM45zfGXVeP4vptF5JVpKZArhjP4OKD1dmoY6nTgeXf R+w2QBPk7tXnacRJP7m3BE37xsE0pg/jCyZFZD196hjxZIzOmSVFHPSAcPT1BOOyiDEC hR4Q== 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=Zidw17LZzOK8ylbcZWh7b80v6c7K27Jrs7l8fmBwM94=; fh=7QX1FfKbm7p25v0xg/8cwvM2+AesqalQ3Jmvo/h9Zbc=; b=US1lx5iFtgpjrtr31FT5oYFgxiCoD5owypSIz/g5bHg94nx6cLBJoO9TLHQzPcvhvq sgW7ttYQkNPwmBkEYABTwZenRu5yC0gnvMvbqqtL5nS3Zsi3ErLAlWg6bpAPvNT3+jFq Hqh8fJgYXC1j44zXjhtwLYw+FZBMs9MbYDYf+QOpF7z2/92owccvuEFhUii6w54ceemW iW8+b1jx9IZsy1p0N/Pd4iEl+a29YyD2ZrQU/yOSc97P8EvwFcubPzkLGwxxcnJkpuQj DcIWawE/4xG0aQo0YKmDZ2pnQLZJwQngr74o/09p4QqlrEif8XnXdX69GkzFLrjCkNcT Lf5A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YPS3/YYn"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 71dfb90a1353d-5260eae2ec7si1713354e0c.185.2025.03.31.05.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:24:35 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YPS3/YYn"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 179B681FC0; Mon, 31 Mar 2025 14:23:55 +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="YPS3/YYn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8922281F95; Mon, 31 Mar 2025 14:23:54 +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-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (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 7B1F581F32 for ; Mon, 31 Mar 2025 14:23:52 +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-x431.google.com with SMTP id ffacd0b85a97d-39c1ef4ae3aso230728f8f.1 for ; Mon, 31 Mar 2025 05:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423832; x=1744028632; 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=Zidw17LZzOK8ylbcZWh7b80v6c7K27Jrs7l8fmBwM94=; b=YPS3/YYnvIMH5QGsJ+ms4ICj9pmrlD8Xcr/1OqmflA9d7tdj3rZY/Ng6jW7In6tw0N xJngEG/ecjfHoQf8t1QdkAYk50WTmIjpONwqrk4gmKS4kXn/2Iiek1926zaz5Mw1vZGP TAkhoAoSlKPJugz528nfqeI50ZsAbExpAkcZjCGy9+sBYincLQtPRP82G3tbI+TIRpqi rYVvY6F32r+f3+kxCitFp3iyiEaeQnhr3/NQ0HaTgUd3QX4UmEDVo58xRz07zBreTJuZ Dun19L8Df2knt2IvieBPBakA6dwJELelmp46TaBZqrwDxA/L3dLWjnf2kmlYRVRxZ/O+ fD1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423832; x=1744028632; 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=Zidw17LZzOK8ylbcZWh7b80v6c7K27Jrs7l8fmBwM94=; b=HiFPDnJr/iADTPhmnItIGoGbnvCXfxhr9NEmYpeKHPq6kRcMvPrxVn2c5HBZbmRF5J oL5Xqc1cDRLnhsiCeR6HVbQxhzl7JKI9NuznGIzSh6R5DAXvigQkxSaiKkC9cVyILKxk mO8rXL9jYl4B5wClq6TqtVWkmFbY1xTS5nKsztpSHePcarz021bQ/Xi4lchG7uz0zvZ0 wIAaQAAJQmo9L2L4P9FQH1H9K65s8RVyc+m2pax6e14CsnQbRvV7efZp9TgBstxQASjg JZtQDcaD6V0uwh+nzvD8gYs2LfZr2gcT82le6Po0JfRyfu0CDDoSIfS2YuKFPJlhfCEE /cDA== X-Forwarded-Encrypted: i=1; AJvYcCUqBieskIje8xyUvqT4VY0/pe48iomnep9N8CjPQnPtz2rEE9f2wyU+a/CbkzDtLCLF6qQCrw8=@lists.denx.de X-Gm-Message-State: AOJu0YxkKZ4RQ3OsTKgppqbCcn4AV9pDmEh//Y2FAbQOXqgz3YGvnK38 iOunaqRFgdA9OhbrD4vLUyRG+6RoJ7k0EqPwFLAC0eYCUF1h7L+X/NOLHL6RWbk= X-Gm-Gg: ASbGnctIK+X40+GPlK9XtptXzPngQsbaDn2jwRNSAOOVjyU/lBGCxwze1MZ8UhYnfWL D7WU0x+uiYMunhQ8UtGqI+AzoS2T/lc4HEt3VTZseY4+94YYTaNtlsIhj1ecPhHVqn2YsUo0D53 uubrd6CAROfnU2i1IYc/kLdXDM5le5qPNA48m2Qs0Rj7uzb9v3c/H6rmMtcLKM1WLBZjokBayV/ YjtyxNp02y8Qk3L4Weo4Nhac3Q9Vb4iWhWYlPr5X2kntfqcZLZfGZUhD9y4NCG/Tyn6rV/uc4us Y5GR/WxoBEuHmhJeD7+UopIlY3E06fnT7CsWRAodUpyNCz/eIuauRxRViXzIlSeM2kpcYAgOCGN MFqZ6zxIrt3jC X-Received: by 2002:a05:6000:2405:b0:39c:140c:308 with SMTP id ffacd0b85a97d-39c140c036cmr5733307f8f.3.1743423831975; Mon, 31 Mar 2025 05:23:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:50 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:22 +0200 Subject: [PATCH v4 5/6] button: qcom-pmic: prettify and standardise button labels MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-5-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, Danila Tikhonov , Jens Reidel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2972; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=fa+Rh9AbOBv8xk5ShaDK49XevY729gSpcGXWYyQnEok=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olN98VOFQ9gocXfeRhX1aEHwFBu4Yl8HRvNT FJAc0ktodmJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTQAKCRAFgzErGV9k tpT4D/9W1r85BZ238Kt+6v7JmaRFZutT0iRo09XVjXzfKZEYQm1JgabxZyti/jsnmarniStMgHw DfNWfd02n1IVbI/i6MkJuPmOvhQWcLJAgiqjpPPgzJLbKYLcHoowWkP8P0XRRJTEg3pqsbHi7/h sHvfOhrT4zLlUU4TbqodytGcSKbjkWALfjy2UQTW/XKSCcsrf3JyBb7OUKHHPsqLT2wF4Q6q7JQ IdYz3hm+ABXA94nbPZ5K1F/Art6LLFBP3NcSrlBg5qyt/k7ALhlzzIObrueRouSz4hJKkfUipcX nTlmUiebWO+tHgTTxS0rvf8tAOn6xdbotirZp+tNvq72Xdec2ChPGBsgcGNACkOF8p2mouEJXGM /9yctxYUCpg4XAdoTAskkFTznShgfpcIqj5p7B8djo3LrwwcuENnq/YJyPA1CM/9rZjvm5DOF4e pbS61VTwUmrueLpKa7224luunECs6YuEI+M3mSvyjVWH+SL0b8x6bmd2slD1FwHki5qowfm7T2j Yf6xUzbbbnwiY23dBOmw06YrhJlqj6oGPTj7EjfiNDRC2TTQfxRUqljTsFpYWZpO7eLUbI5aC5L dKug1eVFstkOfuWPx6wKxNpT/NBKIboJ+v5X7+zbmcIo8kzxRMwTiqZDj+65YYjajh/CvW31S2D 8Jrza+HQc19e8Yw== 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 Boards using gpio-keys for volume buttons label them "Volume Down", let's match that here, and make the power button nicer too. This simplifies configuring button_cmds in a board-agnostic way. Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- board/qualcomm/dragonboard410c/dragonboard410c.c | 2 +- board/qualcomm/dragonboard820c/dragonboard820c.c | 2 +- drivers/button/button-qcom-pmic.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c index fcbf2c3fe60f21bae1c6d64b542a4d9867c33826..d0d82489f53c4f31b7b08bcf6e4269730027874a 100644 --- a/board/qualcomm/dragonboard410c/dragonboard410c.c +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c @@ -71,9 +71,9 @@ int misc_init_r(void) struct udevice *btn; int ret; enum button_state_t state; - ret = button_get_by_label("vol_down", &btn); + ret = button_get_by_label("Volume Down", &btn); if (ret < 0) { printf("Couldn't find power button!\n"); return ret; } diff --git a/board/qualcomm/dragonboard820c/dragonboard820c.c b/board/qualcomm/dragonboard820c/dragonboard820c.c index d3333a59db01caa940224a99df6b43a3375cacf8..12a9273ec4b9d240bc2eaed2834d5265290153ec 100644 --- a/board/qualcomm/dragonboard820c/dragonboard820c.c +++ b/board/qualcomm/dragonboard820c/dragonboard820c.c @@ -105,9 +105,9 @@ int misc_init_r(void) struct udevice *btn; int ret; enum button_state_t state; - ret = button_get_by_label("pwrkey", &btn); + ret = button_get_by_label("Power Button", &btn); if (ret < 0) { printf("Couldn't find power button!\n"); return ret; } diff --git a/drivers/button/button-qcom-pmic.c b/drivers/button/button-qcom-pmic.c index f9f0948ae095f433e35ecfc0f98741ab1a850742..e3bb9bd758aca819b3a10aac84787e703c55d36a 100644 --- a/drivers/button/button-qcom-pmic.c +++ b/drivers/button/button-qcom-pmic.c @@ -72,27 +72,27 @@ static const struct qcom_pmic_btn_data qcom_pmic_btn_data_table[] = { { .compatible = "qcom,pm8941-pwrkey", .status_bit = PON_KPDPWR_N_SET, .code = KEY_ENTER, - .label = "pwrkey", + .label = "Power Button", }, { .compatible = "qcom,pm8941-resin", .status_bit = PON_RESIN_N_SET, .code = KEY_DOWN, - .label = "vol_down", + .label = "Volume Down", }, { .compatible = "qcom,pmk8350-pwrkey", .status_bit = PON_GEN3_KPDPWR_N_SET, .code = KEY_ENTER, - .label = "pwrkey", + .label = "Power Button", }, { .compatible = "qcom,pmk8350-resin", .status_bit = PON_GEN3_RESIN_N_SET, .code = KEY_DOWN, - .label = "vol_down", + .label = "Volume Down", }, }; static const struct qcom_pmic_btn_data *button_qcom_pmic_match(ofnode node) From patchwork Mon Mar 31 12:23:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 877281 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1722861wrs; Mon, 31 Mar 2025 05:24:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW9IviD5EWvcoYsGgvGbhncBj91gnbUle5hqyop3z5E1SGOkdyqLswVChs7A1/7lMgtwJ3d6Q==@linaro.org X-Google-Smtp-Source: AGHT+IHSZiOd5OAAb7z8i6Iz6T6oVawEj/nEaLpoozdIxaDuJ0EytwwmfSOml+I+v+NiiBZNoWHu X-Received: by 2002:a05:6102:5793:b0:4bb:d062:430 with SMTP id ada2fe7eead31-4c6d35e5e67mr5213404137.0.1743423884610; Mon, 31 Mar 2025 05:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743423884; cv=none; d=google.com; s=arc-20240605; b=U/CeDGm72EOiDTRCttnIoGNCur/dawC4OkX3sb/XR8grKCPMb4PUu+0dAzqIz/dNDF QNOGBpN8/gSfiQt8Ge68Qpp8IBb6FypAQqRrnERifOYpB3A/29kTNgF32Bx+IUy7H69m ueCxtb+Btt3LJt5CQ1NFyS88dTZ0RVn79CpaJEjMUdduCTP3+/tIDUdyWFHhpq5s8aFk vDtJfyvMdynF/K04BEQr8jTow1LHxwhIAj0Ym71a1JHB6AImYwL40fsw4oRnEkOM/GcF XHKUopENY+/3zVV9Gu1kBf2yAwiO3Rh0fOxRuSc5nWu3PLJbP/hRemwwQ6dLiZP3eWZy jhfA== 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=n4ZX1kYeWbkWD3oGSfpMiI13LVZvhkUoF6CId8hdoas=; fh=K6zGMbMv9ESwG0QhBdcCJObxFpbl/TtLdlQ0ZBkW4Yg=; b=W9cXyztFnEG1YbLyaJs8QjKvyg0eodaZkkQjAhkgLk54qeM/xD9440EcrYg5HClpWi GzJQpbfG3LTPcuAz51gplnTuYoUxhqcCoj5ZB6VagHCLH5oq3Edg9lx0Ea/lP7We+L7t cjws9MeOcjz9gImZXyR9Z3MdXtJ8x4wdmIl4sHXqAOo6+PZKgm6nRsNSnJdMhMuH7klo OZ7KOVNBqRHSNU8l1/3y+EkSHsViUOrTrTeK2YrmthdMRnujRcPetoaouyrtz8ZXFtD3 Hai+3BLwYc+SXXqCyhKGROamO8oTq2Fx48o/hQt0CXVcUkJGbVDXyLRsJUbaIXoqWF6L 2lsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iFVKVcjV; 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-4c6d2f45a90si1044679137.99.2025.03.31.05.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:24:44 -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=iFVKVcjV; 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 5FE9B81E1C; Mon, 31 Mar 2025 14:23:58 +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="iFVKVcjV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88C498129B; Mon, 31 Mar 2025 14:23:56 +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-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 02B8E81F7B for ; Mon, 31 Mar 2025 14:23:54 +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-x435.google.com with SMTP id ffacd0b85a97d-39c1ef4ae3aso230744f8f.1 for ; Mon, 31 Mar 2025 05:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743423833; x=1744028633; 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=n4ZX1kYeWbkWD3oGSfpMiI13LVZvhkUoF6CId8hdoas=; b=iFVKVcjVpZQ5jrsGqfqg6WS/rIDuuV4mrlimHiGBrxy5rhUmp+99fSx4ogJ6SVSXbt JVz9HnSrplIlgjFpyxSHM4eRYnLPoNLv22jNz6YJ04UKl35nL6IgkY15cRz8leC/vEZL nqdc4sR+/l7oNK7GHpMuAZJ+kTatj/wLkGc0h9xpsfSNSOqUFnlgRfgg1Ou/E9GGF2xl U7Q55G2fa4+MVs3D09QCA3qOX1zyA5zvO1t6B/YWPGjf7Fk31eVVo8gkwnCqU4wZBp2J zNNI+MCWnr1j4S2TQgWPHdahNnsxe8BAMr6Kx93ZT4WiyfaZOqh2Eq5a2MusdBtN4TOo 8D+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743423833; x=1744028633; 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=n4ZX1kYeWbkWD3oGSfpMiI13LVZvhkUoF6CId8hdoas=; b=FJ+koi/iOrq5DPSmxh9iwc00HvMdxKZF9BJWoaB/smA1ZBYrdpxmb/PQ6mpT0YspD/ Gi4MK4J+r+qcUVx9FL0YloYK4J/sPQ8Y1UbwCumuCdf6gmvWsFh0yNRm0XmvySE7nhwA Sh0RO1MKOmKaZieK7Ka/NA758U4XaMaLDLd0oWjJLW9HSkIAoZiybg1sHKnVyjAG7gf2 gLhT5uoh9n3RkfDmq6Jz53v7jPNq/QUaqL5hcBQletTcsxiXpxfMuY0eT4yYqScRgpFX CWZ3WtqwD0592ujs7g0U08FVAj2fvot6umpd0AIuIhFTKIBVTHT/iZaPZ211iutZG3xA nFHQ== X-Forwarded-Encrypted: i=1; AJvYcCUi+D/ZpByHDF7b7CtYyZumiV5mPv0OgxUKc1oVD87a4qs1Jdu9gs6MECrt/eKQpOsDGGxUuqs=@lists.denx.de X-Gm-Message-State: AOJu0YxzyY7qRQPCsiTsuD5cuNcNpn7pt1p1DBUuznOy27j1nqpy0M9V xoVb2NfIrz8AS0um2mGJdow8sZ/eZ1qfFCtLqNf1/q3teTdcVnaR/FFPJ8/SQLs= X-Gm-Gg: ASbGnctPWFiM0KYSRDAH55eSKxP2k9aFlgTCKIQtBnvfmjZeAc9nMxX1DhhpRHO6Rf4 XPMQf1TfRPaiD0IMfL+NiF8+etuabreas7V2Dro9CS9w3Xef/wYGi6y9ik3QwjiHkuK8ACyc9Wp 5iVxwB2i6+VVT7vPqk7Se2kSPbgPJEwE5I/VVVme8YLPYCoLbdMIonxudoopu55yNywvLTe36oI 8cudWgbpQRwgN0kl+FP12+Lulz3AZ1w7gmylFc1W+lBzLswFs4nMlPPEBCPv/b0QrcsMDAti0Eh a/VgAN5ePoekQqAVQUTgtWSYP0QtFwTzLFvATRXpA0g1+cNuzZEWvYy827sGXDxK4n6qmaLA9nA Cz443IkdU7jjr X-Received: by 2002:a05:6000:4284:b0:39b:32fc:c025 with SMTP id ffacd0b85a97d-39c0bf23245mr10798173f8f.2.1743423833487; Mon, 31 Mar 2025 05:23:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 05:23:52 -0700 (PDT) From: Caleb Connolly Date: Mon, 31 Mar 2025 14:23:23 +0200 Subject: [PATCH v4 6/6] button: make button_get_by_label() case insensitive MIME-Version: 1.0 Message-Id: <20250331-qcom-phones-v4-6-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, Danila Tikhonov , Jens Reidel X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1206; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=2RKQbKocfiqQwaU+bvLnopzJWPshiwiyW6dFzJC7TEE=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn6olNiOkrgLYnte1f54S66ItVyRqkOu9uxlUXR 3S0mTMO6XGJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ+qJTQAKCRAFgzErGV9k tkX0EACLNQwTJKTL/ON7jZYO90MTAl30+eHcShBOAB/lGPtapc6pyHRgxJs+pWqDZq2mbkPxrbo iw5YFnfkb+nB1DgJZv1AkEsbWy3ly1Z4rYGU9u7jJAZgfmLh/ztQIoxoB+OZK+qHbrrJxTD1Xzq zdt1mokAOtoVDgC+PHFWTF9KzGEkc8TsRgb0Bw/9bi7VrJbNWhouuy51G1jXft6rWlOxzyUrxL/ B7q8hDfxel+lAtS1QEPSsBe7BT3Mr9PNozjOGv+kH628uIqTLkeBAKgCVdSkp45oHb0s0FhSVkR rDt6zLya7fDNTOEBWGUoaDeMy4zc3xmXs2jJbGKQpfyGNA6FolTR2RUuNmsx2ibxGtN0MCkYM86 2tLkToB7hewXWmfOMCI0fs3AZEhFomE8DBwFFNPB7pLhHmsUEKsyfeKKWWTW+TrTPAsjQAHDffz xybX1WJObrlreNKhOKTFDUHnwwIAxYpmepaMpOOSSR293jZqaN3k6tF9EhEJvxhtp2VDuqWvSkv EYtOSorisgZpS0pLHuw1fU0JY/LE5p7Rvp6CsyVk312iO9156YwGJKheOy4kPp34k+ZJFSZ+ihR wGyYhyqGjmp1adEfO71iltNoDz6VWexmK/pQHl6ObkNwJ4RHAl8ZskDni9hwk3Mu8sWf74y1BLf 6qKzt2iPoZnvQ1A== 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 This function is already doing a fuzzy match, since there are no guarantees that a given label is unique. Ignoring case makes it much easier to catch "Volume down" or "Volume Down" in board-agnostic code. Tested-by: Danila Tikhonov # google-sunfish Tested-by: Jens Reidel # xiaomi-davinci Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/button/button-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/button/button-uclass.c b/drivers/button/button-uclass.c index 729983d58701867f7ea18e9b5f87e7404bca3dce..025917887e80f2fe9cbd3777e04035d20fa34713 100644 --- a/drivers/button/button-uclass.c +++ b/drivers/button/button-uclass.c @@ -20,9 +20,9 @@ int button_get_by_label(const char *label, struct udevice **devp) uclass_id_foreach_dev(UCLASS_BUTTON, dev, uc) { struct button_uc_plat *uc_plat = dev_get_uclass_plat(dev); /* Ignore the top-level button node */ - if (uc_plat->label && !strcmp(label, uc_plat->label)) + if (uc_plat->label && !strcasecmp(label, uc_plat->label)) return uclass_get_device_tail(dev, 0, devp); } return -ENODEV;