From patchwork Fri Oct 4 12:46:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 832725 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp755384wra; Fri, 4 Oct 2024 05:47:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUdECoTvLNxglYAwikrLj/vlCZyMZsH8vLsEO3Pkv6Tvcx9z9Sk9elL90ku+jnkrw7K3YQlhg==@linaro.org X-Google-Smtp-Source: AGHT+IFHvBkPS92LeD1nMKKWPmf+yUcJtkNFjpp83KxU8zIfwBo8taR01kXflJ68ZTBDCXhhX2Ui X-Received: by 2002:a05:6602:15c2:b0:82a:2ad1:d622 with SMTP id ca18e2360f4ac-834f7f042f8mr219869839f.16.1728046052090; Fri, 04 Oct 2024 05:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728046052; cv=none; d=google.com; s=arc-20240605; b=hf3AZ5o57OPXMFuAYA6aJHagdO65GvniowGQxQZTDcXKPtGB4GNISC7KkHjogKOTWu sZLr4hxnNZNa3fDp1zJifM18gz/dzGCWJDebWU108zbSU02Wvysbssqz+yNMos8WI1PO UJ2EWNxox/U8LG8VKJTxb1yxcUfgwcJHRL9ryxRWzEEMzIoUF6JE0sI4gnlOcdQKQr0E 4wKN2+ATRt6l1TNxfrRLaRZJdjDraPRscEFSAN0BcIN+qvx4xaYlLjOhb0h7lvVScWvx +M9W57TEuX2GIJXuCJ9fTT4JP+R4zQYdNqvyAjYPB7KlO2zSDB59iMSzbjaRJmm48xv+ sR5A== 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=Vn2+BfheutMf+l9eZe69ihwSZBxCdMOQTK106+Jm50Y=; fh=+IeMgDBhgNZdH/0BNhoqeQicweeaurDow2QT/Y/8l2s=; b=WIZHx4dphEgYN7QF7LD95xjp7jz8e2BuU1ewn5yUyv2VEgcw0wom2/uZ/4fMA1o6Wc rHaHxxfal6SgTUE+TAqvw6JkU4yYSOxf4HAs5YYQsjr3Z6OV3NuInV8atJitMriIrbgd Ns0CBHag5BimbUkMRON9D098LsQaqeaTs2iMWnh97Kvkia8kH8dJpvFabWpK/TR4u5oF 4CIbOUsqPMkDgwmNW578wyRlkDbCdfhYRa8Guo0P2VZAMBwPxg/N44mNo76/yXk9jcIJ 6TYMioQTyLXi3ArTHztFicWOk1gdAQHVutUruEbtKMbSZnqG+9hbvIPhGUbXdQh4I5i5 HVIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsiwWcYD; 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 ca18e2360f4ac-834efe90326si156539339f.149.2024.10.04.05.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:47:32 -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=LsiwWcYD; 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 D5D8C88F95; Fri, 4 Oct 2024 14:47:06 +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="LsiwWcYD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 88D0588E7A; Fri, 4 Oct 2024 14:47:05 +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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 8F4BA88CD9 for ; Fri, 4 Oct 2024 14:46: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=caleb.connolly@linaro.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-37cc846fbc4so1614149f8f.2 for ; Fri, 04 Oct 2024 05:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728046018; x=1728650818; 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=Vn2+BfheutMf+l9eZe69ihwSZBxCdMOQTK106+Jm50Y=; b=LsiwWcYDfdQnv7KzRN57whywXQwEKGbINYxhJ45fm9OQBVWnfFMNROoo3U+eC/dmFE RUzLCsef7K9jKy0id7cg4LvdNw0iN2XmMoBzzopvxj0IdvSm0+GEq0jsWhMbzNsGtFsM j3jZ7PpxIj+8OK2fantOKyryr1Jx6QXox1/UBqo5eQBNsHMXk49/4cI20y622QujP92E bj/O2cgnCt0hwndLXSDyEqhgYWXn35hTC9CCeg29UWBSZV1lX4uw5/7kHXV2n/OrTYzy La9XHVKCfdWH6koa2bJdDoeQpbRXloFakTKxhFf/cGL2JXKmS2YZnC0HscsPby1F39/p 6Eog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728046018; x=1728650818; 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=Vn2+BfheutMf+l9eZe69ihwSZBxCdMOQTK106+Jm50Y=; b=uqJ8wZ/8eew5FPmsgmbM1lP1S98LEZnAgyLR6243vNSyoWYzHVqe2zRol2sKrJuTp5 iO+1Y0DYOun7Ay9K5fqBwXLe0o1eGt5jn29ewKgCneeW4/1UOULU8+Y8TGsJ1PhhgWLs KSlWyemInj3EObcgPohHKSI1FRnAPy9JM45A4OQQEhEk/9xlwlzRcamz1Npb2thNH95J KhYANVY4kUQb4GdbMGD+1qBdwc25KIMhe071RRrI9UFaan9YQeE4gem0mQsqZYSp9EbC qOGK1TIx74FgvcfLoFIeAfFurj8cSUB5H9GTL6cjIOQkzbaw0AXs9zs5QXLU/PAZ5V8Y 7tvw== X-Forwarded-Encrypted: i=1; AJvYcCWITBhMSSiSbxud9kJ1g5E3FJJiBSj2l2xBm3Imrk74bPifK7iJp4aVfv7rgMX3MikJxOJX3Qg=@lists.denx.de X-Gm-Message-State: AOJu0Yz1Mwa2wwmWBjVVdGznDxKgzeE5zSo/leh4BCfXraq1GXJt5K8e 9xfjR2ENUiv8tNPrQ+ZYAlvx+6aqM3OWJs/AAja50PPo+/aawDiUBtIdAGg2HF0= X-Received: by 2002:a5d:4587:0:b0:37c:d2c7:70a5 with SMTP id ffacd0b85a97d-37d0eae68demr1682233f8f.57.1728046017877; Fri, 04 Oct 2024 05:46:57 -0700 (PDT) Received: from [192.168.2.2] ([82.195.86.106]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d116asm3177348f8f.90.2024.10.04.05.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:46:57 -0700 (PDT) From: Caleb Connolly Date: Fri, 04 Oct 2024 14:46:50 +0200 Subject: [PATCH v2 1/4] board/qualcomm: introduce phone config MIME-Version: 1.0 Message-Id: <20241004-qcom-phones-v2-1-c7ab67ac3043@linaro.org> References: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> In-Reply-To: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini , Simon Glass Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=3156; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=oaxI/EQz3tOWK4aTm6eAN5u+sr/5yFWJiMS39p/B9h4=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm/+O99EHIDPkb2geiMmBYbaNUfXVpbX+f6ZdHG bYrDabJpfuJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZv/jvQAKCRAFgzErGV9k thJ1EACHy6OGsqshwi1XEtWkUEfPNiXQf31vHhk5U+Egjxd7HgwZW6ClutpFIvHk1NOLlY9iiVm zswTcx5muhGPaPAaZS2SwVVCPHNNqxzpr9gBIGIFGHTLhi/r9oI1VYqPxog7L6o6ZzkeHFmRzuK SAfAnjdH+2G7eM/ppdhgpg0j7A2Zme+ZNXb7/LOeTAatEyjbhVA6Tqoe5CMkbYAXCnbaN7LJCX7 5mam5NKXlIzA6LXHBAZmWLV3bh7P7dd9N9sGFFCMZr0ooi3O0iWx8Cfg3DG3M5tYsGLqbkzhSb/ 1GtUpDBAfy7Rgh7s1o8V3NeZg9Uja6xdQ0VFMmgWCS/4/qvvxk9qXT0OGNJdTb2nrtwWlbFBA7I 6yfan5s8AZQAN5QbvzF/TyJGSRHKAHRiIQY0Up9lmCST58CCwdeeLnFL/JO29h33ZJ3p+ElUC1J QOES1sAFc3Mk/0REnepYWufHncQgY2fdsrgT6JNAuTsNJSrZOjBRavqcvOy1NEXyytZaRgTkXvz AvR6qruedJQGqshhNA6DquRWw7nMuLG0r6eeiYePOjKPq0n++u9HwxaLKaVycAl0k3YBxE0BeBX 6qLMTuyDZ3giLuQ/VbEFaujCH2OZCvm229IwpFhK4n/gjZMrfNSttoCHJ5b+5u6Hjh6YWjf8k+H OR4x5oZ6XVcM4Ew== 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. Signed-off-by: Caleb Connolly --- board/qualcomm/qcom-phone.config | 12 ++++++++++ board/qualcomm/qcom-phone.env | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/board/qualcomm/qcom-phone.config b/board/qualcomm/qcom-phone.config new file mode 100644 index 000000000000..388d4c3e7398 --- /dev/null +++ b/board/qualcomm/qcom-phone.config @@ -0,0 +1,12 @@ +# Settings for phones +CONFIG_USE_DEFAULT_ENV_FILE=y +CONFIG_DEFAULT_ENV_FILE="board/qualcomm/qcom-phone.env" +CONFIG_PANIC_HANG=y +CONFIG_CMD_PAUSE=y +CONFIG_BOOTSTD=y +CONFIG_BOOT_RETRY=y +CONFIG_BOOT_RETRY_TIME=1 +CONFIG_BUTTON_REMAP_PHONE_KEYS=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 000000000000..2a0791c888c6 --- /dev/null +++ b/board/qualcomm/qcom-phone.env @@ -0,0 +1,49 @@ +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 + +# 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=ums 0 scsi 0 +bootmenu_3=Reset device=reset +bootmenu_4=Dump clocks=clk dump; pause +bootmenu_5=Dump environment=printenv; pause +bootmenu_6=Board info=bdinfo; pause +bootmenu_7=Dump bootargs=fdt print /chosen bootargs; pause +bootmenu_8=Enable fastboot mode=run fastboot +# Disabling bootretry means we'll just drop the shell +bootmenu_9=Drop to shell=setenv bootretry -1 + +# Allow holding the power button while U-Boot loads to enter +# the boot menu +button_cmd_0_name=pwrkey +button_cmd_0=run menucmd + +# Hold volume down to drop to a shell with the USB serial gadget +# enabled for debugging +button_cmd_1_name=Volume down +button_cmd_1=run serial_gadget From patchwork Fri Oct 4 12:46:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 832723 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp755247wra; Fri, 4 Oct 2024 05:47:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU4Gqa7eACwlkGsfBmSEgcuXnFHG/iGrs4SBaGBeAT2Vn7xiQNDZKU2GFCwGuF82OPNq1mRaw==@linaro.org X-Google-Smtp-Source: AGHT+IG3JsSI0GRHfBsFu4SKavgcyYWJT8kj/1r0yqyGhHUTeiUWt+FHn0mSZCKF/UR5VdJPLWZj X-Received: by 2002:a05:6e02:160f:b0:3a0:98cd:3754 with SMTP id e9e14a558f8ab-3a3759779acmr24152025ab.4.1728046030795; Fri, 04 Oct 2024 05:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728046030; cv=none; d=google.com; s=arc-20240605; b=JMcU6BU4ChH3wxUFMjcQ+xItyVAIHdKYbwLC+JI9KecIqSk83GY6WH4IZkPL0oHwqh nGbyGEfpajmRcHPphwJAjmSz1yUcJmjSSFN16Bb1SyTXe8wD6NE4Hijse0SsVO2MHApg ofCvjsKT+BV2hJCuD0+A8CD7opC69t8euIsvWjalNCfW0Sd+vRh91YfWCY4XRPlfsRv0 ufNTZrkILsVFVzM1qno+TQtOIzzsXPk+/88i5nWpMHUNQqCOHqi+V2J6urPSqIQ6wVFR dF1TD8nMOS5SvorUR+odLUPvuKrDV1ysUUMNcYOr5V7s/1tumAVqxFVaP2lsNAvSF+/U hIXA== 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=u9KLP5FOx6Bo0jaIjsv0hlcKIHeF9LooYOlxMGvfKw0=; fh=1mnCm+fclrhtaddsAGiRjT88g6tISg+VtSNsJiQBDrs=; b=QrxyAj8QXt5W6WAogA4pYc0M11c5dIhpmdoHswr9A/pYvpk8k6QDIFOPMeZ/Y/0Zxf vB5S0DMcQqGQ8F74DVP5me/61XdCKhyYSSq/C9soYaiHw/O6mYzNDV5P/zAlsBI3WCtO 1szzVwHv0rPqGCDhVXdKrrCO6Gi48zL0Ctmy/I9pyYVns6fSrshGoggq3H4rXAXMfq5R n+e1+M00dAqeuOvbYlW0cb6WA+0mYsuTDgh3Mg2tt51g41aZiApSXicFjiIQ2xQBcI3R GB6CBJs5Y5/fuBMlxNuNoRmhbDGe5iis4J1ePc4XOmR14B/8HtQ8FVJpIsD422gUUjN0 QyBw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=clCquY+a; 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 e9e14a558f8ab-3a3713a35b7si15993015ab.49.2024.10.04.05.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:47:10 -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=clCquY+a; 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 12F3988D16; Fri, 4 Oct 2024 14:47:04 +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="clCquY+a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFA8588D06; Fri, 4 Oct 2024 14:47:02 +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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 C19FE88CD9 for ; Fri, 4 Oct 2024 14:47:00 +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-x42a.google.com with SMTP id ffacd0b85a97d-37cd8a5aac9so1236160f8f.2 for ; Fri, 04 Oct 2024 05:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728046020; x=1728650820; 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=u9KLP5FOx6Bo0jaIjsv0hlcKIHeF9LooYOlxMGvfKw0=; b=clCquY+ajcj1+mO5koSZZcOd8R8IM1PQzcb1QOZ24TnmKddYWwE0aaVR1X5hSRntJh GRS81f+AnfaM0kaTLx6ThYLxMVyfIW1iSnQVKH6m52mqaOc01YuNyfBf3MOrUf7iIQUD 6UaaFG9CI7flG4oGeZactlUFKN+vRCofBlfyHbLwFMnTVtxjmm1HMCQP/MtE9v904hBZ w/lxUd+X+90dw8uwqytAg9lckB+4k3wMhULr7vMHVP2X0DIVvfhGUzRKCHOAzBlLXgZt uePBCZzEuI9tD9AlFGdbRQ0TAAPdb03/BAoDSEKYAgDVG5YFQqd+BOnzPBiXz7j6IFY+ 7wJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728046020; x=1728650820; 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=u9KLP5FOx6Bo0jaIjsv0hlcKIHeF9LooYOlxMGvfKw0=; b=orL3IYbeJpDuE6+Wov7cTYLJdffbkeE1QU9zJWcz2wULBbyLVsqvIHf8thnxYFhbc3 P1286KiSR9dbParcIu0lWKUdXJHBrhuMWUeNc3qUCl4YhYBz1xdx/xrQ5MpQ9of9kg9y NGz51l6g0DbTy9u8bx1dwtXuZ5XtfzIP7hsodVx0HH2f4enRbfxCGkKJN5KDNgZoiFr5 ejtWUUV4jWraQGi2eiSv3+JDarp0oRdWagfw085qOUeq9dos6HTYq6PLjriR/nmmzwol KneVHEMGsqbI5AK1eM4JUhOXwL9qlmfs/ob6xgG2i+5809s3URq11dAhWihNPbAFnugW JpXQ== X-Forwarded-Encrypted: i=1; AJvYcCVZmI8R4Ao2ajQzPeIUKfhzdV8LPm/7Ws324TMbB9vi8TPOVQRs/dMIG7IsI2sno5V9s8ppp1U=@lists.denx.de X-Gm-Message-State: AOJu0YwTY/aigW9//1fKgDjfm+HKz3BTw1rqpyvApDJY5fwrgH/+12M7 BENhrei/ru/oA/Cl36fz0ZeyAKLoHqVo5RZejcJewrdMr3ZZcUWjwbnDowLNuMg= X-Received: by 2002:adf:a18e:0:b0:37c:d54c:a41 with SMTP id ffacd0b85a97d-37d0e7d53f9mr1316725f8f.54.1728046020246; Fri, 04 Oct 2024 05:47:00 -0700 (PDT) Received: from [192.168.2.2] ([82.195.86.106]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d116asm3177348f8f.90.2024.10.04.05.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:46:59 -0700 (PDT) From: Caleb Connolly Date: Fri, 04 Oct 2024 14:46:51 +0200 Subject: [PATCH v2 2/4] cli_hush: run bootmenu on retry MIME-Version: 1.0 Message-Id: <20241004-qcom-phones-v2-2-c7ab67ac3043@linaro.org> References: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> In-Reply-To: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini , Simon Glass Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1352; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=kaYQI0zyLNvzBPqx8uuUc47F/KfM0yjRzhQDdSMXTC8=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm/+O9k7bID+/pHr1nyRwpnzZ6oHBudXIIQ8371 Kfa+gmrxpGJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZv/jvQAKCRAFgzErGV9k tpGPD/wNYklsuf0HENyk/cYeQv8CJjIOOtg0dyMrZqiF5swpBvYXdgNtO+SLGkHeTGy2Rsuzp+m +kY/SSxbTPbcaBoJYLvD21d2RIYmgXuY4Ht4C2I/7N7wjRCKIKen++4BBCaVc5P678uIRTd3zrQ RuhaNrJ+UP7pV/HdbcloWb1eYwTFU5YOmYAZuWRVX4jNn4rWoETvu9WCO2d4WkC4p2hM4wNI8wW zXQ+OLmRDxGWGjJP1TYhDzqU17x55rR9Rmp1dX1JiwaLFGQ/hOT8LKxg16igQReLDPk3oGTZEls fjKX6RFDAKsXFdNaGLzonKcwtNBLUDWdMNjjh3MVC+Kb6wc2cTn/U4OYmN8ge/CJpXwmjLYsVRu Qd96xEwE7gvDtIpRTceFWODW3Khgfqt4JHn+WArS4nVF5fVR8qvgJzHZfPgOUR7XJLLwUvCW3Dc sI/am6E0gnTbIyP+TFx3q9o1QdBeh93glOOx6TgZgAE7oCfR1M+ZXS5m0JQ7B1kHZttRTLXkfz7 qXxseSu/RtAc+4QhfJZzZsIIN6SaPkqh3ox4ScSPf8Mj2g+Q6DNB7GPEU5UQIP3u1Gtn3iAw82b YEyWyicQP1fn8w86zldt/3ffr4DYaXic268EI4ti+kn5a52L3XiuaJkckOvzPzv7fVmTxDc3p1V XQMeQSbQM85oQ7Q== 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 When CONFIG_BOOT_RETRY is enabled, make hush shell always run the bootcmd. This is an improvement over failing to build. Signed-off-by: Caleb Connolly --- common/cli_hush.c | 2 +- common/cli_hush_upstream.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cli_hush.c b/common/cli_hush.c index a6a8edce1f43..3c6fd6f00a1d 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -1028,9 +1028,9 @@ static void get_user_input(struct in_str *i) 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" + strcpy(console_buffer, "run bootcmd\n"); # endif } #endif if (n == -1 ) { diff --git a/common/cli_hush_upstream.c b/common/cli_hush_upstream.c index ab5aa5f9b36a..93eb0d85a95a 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -2907,9 +2907,9 @@ static void get_user_input(struct in_str *i) 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" + strcpy(console_buffer, "run bootcmd\n"); # endif } # endif if (n == -1 ) { From patchwork Fri Oct 4 12:46:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 832724 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp755322wra; Fri, 4 Oct 2024 05:47:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUES1rZJ2YfSxmRL061aN+lOiC7s36wn2jccNMJENPpjOkKx+qUSd320GEn0cdBYqg6pKtVQg==@linaro.org X-Google-Smtp-Source: AGHT+IHsPEwf2rJ2HOgZvM+qQEskUebwGZnSfSkdTkrHoQQNXjTxYsD3VXhlGgMlR1cfCccg32YH X-Received: by 2002:a05:6602:3fc4:b0:82d:821:969d with SMTP id ca18e2360f4ac-834f7d67ed7mr247502939f.9.1728046042192; Fri, 04 Oct 2024 05:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728046042; cv=none; d=google.com; s=arc-20240605; b=Xhxdk6IJPrYo14Mny7PhWOG0GjGvWlnQCpx9oTX7QHx6y77hQi5OlvepTyp8sTaI+2 mRS6jbmWlSG9AQEStY32Malx4x/NcMvkpw6H+F/Rv0vSVYDSYjBIfpcZh21axeAyDD4k 0f6CAeVqAUFDc2G7dOCDQcTOp/TazMFq1htT6n2GOsSUJ2zbVmXfFgHwjjHRWvQNeAwq 35Eliqw/y/4/R61C8OwQDB44lAREL2bQKUx5RMG7KjLRvViqP6kVoUKwUWt0rChNKfZe gYBWL5QJfKQflUAUi4JtUCesrpz+qOUFFHVzfArLFg/JxmHka4XDGdyuiHPkfRgoj5r5 JCRg== 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=j7yg/K63bTckbXZjnzgr8WwMPKXmfjLKJbA5QWoIgDI=; fh=qav408OTbJk29WLdagtxR8aOhmE8awIOcYQ0KVjgArY=; b=ZuzYPNzwv5uj67clSKAiLH6OEivgYgszMEstmOQifof2r/XQIbyAcpKWeHIhpCBYNm aS+592o3k0NMqqIg63LjI+GqlCFy3R0eWnIxljZ6BrUdi5y341Ovwuk7/MI7leWrAVGZ Rl8U8NVw02ZTCsaI6o4A6yPlYuNYoO93NWRmuoKfuDd9nhCsC7ZOkpNh5J0jx4oaGw2t cefe2N/gltDxGcMcN5PIs0wiOO8GsBlzKP3MLMlcIJ92RGJYhLONmS5L5QkIcr/jXXZt iCdf22Z+OswN0v7AN8aQk6rVh36uJNk/UdXzvpx9aLHggYMADeJwVhq3etX1d8yjEKkp kQOg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qNt8ABRJ; 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 8926c6da1cb9f-4db55a63171si1685893173.127.2024.10.04.05.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:47:22 -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=qNt8ABRJ; 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 748D288DA9; Fri, 4 Oct 2024 14:47:05 +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="qNt8ABRJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3090988DA9; Fri, 4 Oct 2024 14:47:04 +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,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 40EDD88CEB for ; Fri, 4 Oct 2024 14:47:02 +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-37cea34cb57so1376948f8f.0 for ; Fri, 04 Oct 2024 05:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728046022; x=1728650822; 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=j7yg/K63bTckbXZjnzgr8WwMPKXmfjLKJbA5QWoIgDI=; b=qNt8ABRJLuCSes6HasFu3EHK4wB5MnBGa9Lmw7J9SvmJzqO72HPoDJ9bcd+Kn9UG9Z XSTN4cc47RO2qs6hK31SjdXH5hyilANc06Hq2zWeicLtRRebWtTe2m7FxA1hnjVeaYEJ 6AZ9+vd8wOpi/QVkdQ44lQuchLBL6eWqZcmZWPFx6rqPr0vjBxcgLQe7dZxmO8zzALOe QdSmWvcbENupYv/1ot5g5fVOrvrX28Hy5jwRhmqIWWGWyzfVUShxVGBFtn7HmAtrye2h 3hw4L8+v79jUcZDPSxQBzEmfrXFit0RmRfkgArIoeHak1USh9Reydfio4ODK2uxQN/jG CwNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728046022; x=1728650822; 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=j7yg/K63bTckbXZjnzgr8WwMPKXmfjLKJbA5QWoIgDI=; b=f02BWnT518KK1J2/H1y65wkvlTKU+PFKi/I/qhUl+2nX+G7oM+HZn11qoTQ+fGDgyB 6CiVlaMiE5TjHcWlWDHh7g5cJAr9MBV7gioTtvCisbfjrKRgU7m52kk8xfUvVz4RLOT7 IYzfLxXdc8/x3buYl6UGQpGgsjJZn3g3MQow8RYtb8uh1pdw1VJcWbmATeYfmFMgUdYi uuCUdIZZFrNtsBt2WMqtY8WmELrYYnFrSK++7TyUNoIwO6dA/c2cM8+UXu4R2daCrcxp mltje4CDhCpD8NNn4e40yleL60JYnV/vN6FxrYj5JGSLBwuMfBSsOToJG924COxLCf4p KQeA== X-Forwarded-Encrypted: i=1; AJvYcCV1p+f3js7nQbH/45NtScIJ/qd1FQh1SGjsP7L3PzskMJst3/pVrk3b60hQGFQ1y6kV1tkcL0M=@lists.denx.de X-Gm-Message-State: AOJu0Yz91fz8aWT/n6Nqk1rIQlOSfXR/0np5Dj7DxeudUI+ZX3mkkdPs 12RRNkJcmqHfjJLq44X3o2Rq+NOhe1CKP+Duhp3gjTPQyXxmGiHwfT4lmUE4+Xo= X-Received: by 2002:a5d:5ccf:0:b0:374:c949:836d with SMTP id ffacd0b85a97d-37d0e7b9d9emr1650035f8f.37.1728046021653; Fri, 04 Oct 2024 05:47:01 -0700 (PDT) Received: from [192.168.2.2] ([82.195.86.106]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d116asm3177348f8f.90.2024.10.04.05.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:47:01 -0700 (PDT) From: Caleb Connolly Date: Fri, 04 Oct 2024 14:46:52 +0200 Subject: [PATCH v2 3/4] bootretry: check for bootretry variable changes MIME-Version: 1.0 Message-Id: <20241004-qcom-phones-v2-3-c7ab67ac3043@linaro.org> References: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> In-Reply-To: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini , Simon Glass Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1156; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=nU03hvEw0ouppXvKET2WJ2tdYr2DZyukndQI6MSww20=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm/+O9coKoUybq/TVOhWwYdsUGCD5RR7BfUe/81 GcP87CHqAeJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZv/jvQAKCRAFgzErGV9k tiblD/4jtVlZPiOAK0H7+EXMzfK+Ouh+C8b8emYiPd2QeL59KPTrGCeJBMcv20ZfCllCzgK0qhC M1n/hMeq1iLyFfNMZJpeIKkYXYLLYzc4JBfZf7N+F5RfcYs4aoRnWg++Rdkv4R1tzDRwTH5YAex TxppuxYZ72SwLVJHth22s6i5BpIBUeXbAlciBCo65FSaqRREJJtQd0vRNuSINZ2G68w7ahp+dxQ oU+/VEcmmDwANuBYeMEptAqFMs0NqfeZiFGPX0f1qGY6UwABMKtDSauZb8L9njGBE91fWkg5XAR w27Z7gC8j/uEq2SfgLP1rkoWN8QURR5nFpiVCnPw2nfxIVeN9fm1Th5WVfBI8HAUWdF0x7JlzVP jJWemXu2S8vjIvKgYz/qv16vsiQOk/Zo7hMTKg9fv1lv/RMRd0/WXGXFzKF3+gTmyC+S5MoHA6r YTB0R0LgijNBMh0mse+FS/tDurgKu+w89aTEeFrw+LGy6c2XtNeJ5KEE7o8oyJsLgi2bPZUgLCN wMgvtjzkuPmWuLXmKhZ9xFUGiEUICeeES6XrTAYwUPyKzUn5gLpgWSPU1JtyGaVoVq4UmMiaOLR 9Z+1THnMVdpJfo6DCPJQrZnGhkwXrx3ds/2btgbDCqgKafjrwgevDz6yfXV1qqG6dorbBggy9VP LN3bKpXUMAyIAXg== 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. Signed-off-by: Caleb Connolly Reviewed-by: Tom Rini --- boot/bootretry.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootretry.c b/boot/bootretry.c index 587b2de7d6b0..a60767eaa2ee 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 Fri Oct 4 12:46:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 832726 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp755853wra; Fri, 4 Oct 2024 05:48:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwFGo+HUhXcnCS3o13R1SM8ZH9bwnks7Uma6iLsRw+zwFIErv08cum2mRxTCTNHEKnbt2/1g==@linaro.org X-Google-Smtp-Source: AGHT+IEvRsEhRmpIMY1mYCTPb3UhR9sNabN0dg5GozF6HfRmhMpdHeYc3hlU4gv9i+25qGXkeer2 X-Received: by 2002:a05:6602:6d0a:b0:82c:ee6d:a7ee with SMTP id ca18e2360f4ac-834f7c59901mr260387139f.2.1728046116862; Fri, 04 Oct 2024 05:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728046116; cv=none; d=google.com; s=arc-20240605; b=aMEJnnsUlWMcAYokxlLx67SNtxLoHHrtW4Sb7Kl5B2FwMOBghTxmViP9flmF8AfGA8 lWIAY3DyOfWeae7w3BvA9fdhTQggqARqJ9tCQOY76E9SRTQ1rFjqgcs9mK9S7p7050+o LjaYgvudneFlH8fTzRh+pVltDRhCnZalfMtco0UQfMMjscNXY/2J7Z5T9q7wsSks6VMj gWqEE52CSKrnCxR9BGOVNQ49Ndaf64e+8c3LOy+rMo03Xnf2gf0+x9lJrTaWP1J+BybZ yyu+u233lx9+3XL1UstC8p2U0lSlWgo9wwhghLMxSK4f8NFl/9v4rAQ99wlxM3SguTEQ TCYQ== 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=d+1OvLCmZvn94f1gK8YJOptrAwZ13GYK0JjDSDyj8hE=; fh=pSOWhcI3oA6tWttFpWY1SuU95lWzEO4I9BeWj0VCMh8=; b=YRQzbIOuU39X3oTZUf/ZzlUaXiTBYZBMNDZ33p2T143AdhOazsCbhSIAyb0WN89TvJ SxgMsDGLwouvMj91LTDPQWCkawTRyKEyYhsg4up4vAA1BQFKKfiqs7tAjIHJ8YIZB1Sq TYKQQwgRzrer92WZ4NFOCHhibwcEkjAEkwlBt2rER0W0SXqwHhmedG5PRmWe7IUb3mqw pc0qvRTVyqulqReLPvkyopJ56F1F2Ttarv1hw+qZ2mjTd3v2V6N6vyxsqSVUU13GFHqC q5cdvjDmm0cWfR9FKLdskT8iwQs9tgzAD7IWvosaDEsPeN9GUJfdtrfB+ON/ZkX8Ml4K vYcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rjIGiqJh; 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 ca18e2360f4ac-834efe61e48si160460839f.119.2024.10.04.05.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:48:36 -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=rjIGiqJh; 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 7B32488FBB; Fri, 4 Oct 2024 14:47:14 +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="rjIGiqJh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B235E807F4; Fri, 4 Oct 2024 14:47:10 +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,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 0DA7188F6B for ; Fri, 4 Oct 2024 14:47:06 +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-37cdac05af9so1986705f8f.0 for ; Fri, 04 Oct 2024 05:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728046025; x=1728650825; 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=d+1OvLCmZvn94f1gK8YJOptrAwZ13GYK0JjDSDyj8hE=; b=rjIGiqJhuGv2GaiasfvCq3Ze92CB46xYadWQfb5henRGUXhzgkaIw1GTjcURcXf0+p JV0QLMuZuSvEsKM0N12qlML6ytEcBXFCFtQd9EHY5eNey6cujtI7fxvfZnckLKyeOFKr eA4oNK9if6m94vD6d9mKvGN5Gd7bYQRAkyzjeOjIT1dOetu1YYcPr0xAQWWPXI7F2def 1VkyttEVNxnQbW7V9oN/p3557XHCLqiDZcxJk/8sTL/05zVfyPGxI8zWYpjh3w7Nkjdi Crv9DUcwoe6HpI0rkC+bpTH7P7MQkFU3x0NCYa/SrD/5uIdPsIC0J2NEYr//Co8Ny6vb oaTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728046025; x=1728650825; 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=d+1OvLCmZvn94f1gK8YJOptrAwZ13GYK0JjDSDyj8hE=; b=xNdQksHrsiHnFkXvieXQ+KG3Dw9mjLaRNHB/qlIoW/QFP4XMOUpoMEZhIGl/VQ+ZHR FiJdwFqZBO9tSxqpwgnyKKfLLC1mnou71WjjrGqGbKaL5wXm4EPArkaRHJnZYlFHZCxk vcScC8N0sYjCXMKZEU3XpDN3bMdfJtevAj6axl9p7AXCQRmJI+q7EK0EDEBeJZUwWq5q 4i2Q1IOdBTaceLKG3o5VmmMlsZcQhZvNEeSpg6+3bQAatN1uR4z9RTfh+U2w9zIr3WuL AaKEkkOqB23LuzOfwduVnAXkYqhsw7RYW4kfYfwVNxRfuiprx+w9lNACUR+Yupt1aQ+h sfnA== X-Forwarded-Encrypted: i=1; AJvYcCUTOg+fdnxfFdg83GJog3tZL9UXzRrmN12uZsSZBAHHzR+Wk6aQVrNi8oaiP8k2oUrp3u2zuDg=@lists.denx.de X-Gm-Message-State: AOJu0YzJ4ZaOT4ma6zgSSl/ENORoVzAea7HRAI91ywkQ4OTyqF79xUmq lftfWkDd9BPnJJEqxoTq9KEDi5vdDw7NlKdSpW8wyrSChdNo7bKGHeAjQDLMDqo= X-Received: by 2002:a5d:5f54:0:b0:37c:cfdc:19ba with SMTP id ffacd0b85a97d-37d0e751784mr3137021f8f.28.1728046025386; Fri, 04 Oct 2024 05:47:05 -0700 (PDT) Received: from [192.168.2.2] ([82.195.86.106]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d082d116asm3177348f8f.90.2024.10.04.05.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 05:47:04 -0700 (PDT) From: Caleb Connolly Date: Fri, 04 Oct 2024 14:46:53 +0200 Subject: [PATCH v2 4/4] doc: board/qualcomm: describe phone support and bringup MIME-Version: 1.0 Message-Id: <20241004-qcom-phones-v2-4-c7ab67ac3043@linaro.org> References: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> In-Reply-To: <20241004-qcom-phones-v2-0-c7ab67ac3043@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini , Simon Glass Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=7389; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=kpwQOXvTFy95nqRCsvLD4VSf7Qar+mdPKA65ALDt0/E=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm/+O9lutJpHRBQKHC0Yb4JmW8uqqx8KBZnTRGs KSgV+7l656JAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZv/jvQAKCRAFgzErGV9k tmR5EACF5yh47sFtBAdoGT8u6OdAQwnzBHsswhbY1yUundonr2dAeSf+19WoCugq+nKA72sDRze 7XsrkaguCs88W3J4uEP8BBbGlpV1U5PfS7u8QtrY3tcJjxy34JwEaCBJ5ImURvecYhNYGPZfMk1 XhXT7puCNrj8eqz0GHLBC4Jqsmk0Id4ZAd9ug9B0fZGeVBPky9Mk+1zNK3EIq0U9/iNlyAKsU8v CB7lA0Sa1G/k5SjwSJoWlLy/7VFQ8hpc7wwe/YxCq0HAWnoMZwV8xllLyWAYBFiWMo9zjQNSBPp RwthMCuhZ4+uRo7lleonQ2zCmKoVu/GOWSL7P4C2I1gRRMUgeSexseth7qLGLUIEb0rXJgh4Dd3 nf/IOkGkiL0Pu061vmDqOFk/zYKOb3bn40onQAGH7n3uxc1uSaMAHIHV+HZCsHzJX0q07fQTHPU rz+wHvsYDgphgazmoBPbY/Xddm4fW/803FkKktIc9+0r3vUj1jAqxor7QGRyBOrTcbMnumL7V/e meoIiS+UQtHdR/3qPunUByeziHsGaPUDdONt7+32v65dIrhx5taimuebbKrK/NwfC+6OOaxkiUA ZkiUevSxS9X66eDDQ1pka3yS0sC1b8bLurqwKKvlHcRbUZawkrTMpxQpkuPTLOSvTVz3Hb5l5xS UsRW0kw+voYkaYA== 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. Signed-off-by: Caleb Connolly --- doc/board/qualcomm/board.rst | 5 ++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/phones.rst | 122 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) diff --git a/doc/board/qualcomm/board.rst b/doc/board/qualcomm/board.rst index 4d793209f9e3..003d59a18ebd 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 8c7969987a97..db59b81134b8 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -9,4 +9,5 @@ Qualcomm dragonboard410c rb3gen2 board debugging + phones diff --git a/doc/board/qualcomm/phones.rst b/doc/board/qualcomm/phones.rst new file mode 100644 index 000000000000..0726f782b675 --- /dev/null +++ b/doc/board/qualcomm/phones.rst @@ -0,0 +1,122 @@ +.. 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 near-impossible 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 + +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``. 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? +^^^^^^^^^^^^^^^^^^^^^ + +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()``. You can then determine where execution stops by seeing if the +device hangs or resets. + +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. We should eventually handle all of these correctly +upstream. + +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 +- 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