From patchwork Sat Aug 31 16:48: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: 824407 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp1278222wrs; Sat, 31 Aug 2024 09:49:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVH6F9rr3S4X5r7TqVgBuXjXuGVQlxKaWBA5WkDlZsOloDFLNvcHHJHxj7A306UAA30KZbbJg==@linaro.org X-Google-Smtp-Source: AGHT+IHHfiQyOUozExfFhTXQVu26NOTh+Qc55VrtrR5qbhepjtnfn9awJCOrg5WxYHJKSvQHtkNq X-Received: by 2002:adf:fa52:0:b0:374:babf:ac4f with SMTP id ffacd0b85a97d-374babfacacmr1842721f8f.12.1725122948146; Sat, 31 Aug 2024 09:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725122948; cv=none; d=google.com; s=arc-20160816; b=Wkos07c+QIcGe4N1YWngedDcVPpnQNQ8moPf90Yxpmz73F2NcfVy6CpymE3tOeCqqC BWpKfIvJtQdnSuKwg0bOH1xFac86FjUhDupGbrPCDqlBMDEd5QsKbNtdhLZIevZxed1m i/XsWqeHgGvYuF/HI4bS9+pHhmLDY2iwDN1wy2uInh9ByhuvtksZrmc35JHFia2A+DmT /YGnpdzUPhNZh+WVTl8E9Lk4JLOwFs/ECi/dgUvi9AiiH68zJUIwjrwkG0NYI0tFE0xt WGS7KVyQV3zefERQqBycpesH6lMJj8zqJHtFNu0izGXjhiPKDYBEIjcdxB9MEwGiy+02 YX7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=i24W4kkDll46qQStjY9GdsUEz7ArP6BCj1Z9xp5I/wA=; fh=6REkyxFagUuo/mj0Q1+eD0riKXlba3XC61HSt53K7u0=; b=F3RHdM4aJJXDSAg+qpBPhQ+CBxDsOWViOHcqsMMdeejoF9AhWGW7nJm+T3rLGCa5ZS tEyFh+nDgSHaUEd1irWIwy3VGj8G3k3+/RnoxLgpOLxV7Vc0u+zSN2KcXqDXE4jnPqyb CzeT2VUe27tVOxIo3a1ByNkB0at2atNTspeh5G4e68brLNUFE5ghZXJPhf5IJFmQCeZe h7NH832ZqCsMZYfnFi7CSMUM1hvHBdWsAsTKgK50Guanetf+ffdvCYXDiSEyaF0bVDSo kGCzQlddZhuo2mSJuRal4QgZ1nvISgG5Mr+JLr3lizv0py+K+4FOdH/qR7EdPV+L+uGZ I7hw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S6PGrbuX; 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 ffacd0b85a97d-3749ef9c4b7si2760345f8f.657.2024.08.31.09.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:49: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=S6PGrbuX; 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 8385588D83; Sat, 31 Aug 2024 18:49: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=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="S6PGrbuX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AED0588835; Sat, 31 Aug 2024 18:48:57 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 A781388AAC for ; Sat, 31 Aug 2024 18:48: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=caleb.connolly@linaro.org Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42bb9d719d4so17605495e9.3 for ; Sat, 31 Aug 2024 09:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725122935; x=1725727735; 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=i24W4kkDll46qQStjY9GdsUEz7ArP6BCj1Z9xp5I/wA=; b=S6PGrbuXO29TMknP6JNX9VzAT8gLVHLdRhkE4pbPUaNZoGDZpT/6hTyE6wIHbN8VkA gsAAX9weekr/fHv0nrQCKuo7D7yKd813dLlPc3bgrKBzx1u2te0b0VWq8npMPHOAm3Ps 44LQdWUNiYoW5zb9pmqGrGtpTHx8E9MVFG7KSVuZ7BERS2A4C2ZVmIVxze7Dk51IxQnn ZaLs3I63i6EQ3RC4ZWtRfXK2VR36TA5KqU+e372A5IdHFUgGqK1Hgvgpnp4VcCqIjJpe yM/gsV4iBLWePSLKZIiEp3HYpFhXqmr03KWGJEUhA6DQJHKhVQrb22GH61QyZruslaSX WsPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725122935; x=1725727735; 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=i24W4kkDll46qQStjY9GdsUEz7ArP6BCj1Z9xp5I/wA=; b=sE2SxH+rNO8dwpAFIky34V5eDNUkgdw2fZ4g9icmuzCnihOXo05UsGLM6nFFK4uaWn IgnN7cCMuLQRywLFbnKvIUW7pReFtPVdbA6uCUuQpQSPGFkiyjq3U07jgbzFymY9Z8oC vRAiCU1XhuU3eqjaHkbO5q0T0x7HJH04xjHHhS2Dr5asilhWv4/NGVFsVFTS1UV3/xSK +yJe4+y0ZJtBrdqBBh49WBShFNvwZe5RGh1L/CFk+RPq3UoAbh7GE53lJisv9ibIz59l SJURK25VuFMR4ACdzrcEl3r8MfjfDEibjbTnFp7o7ekxU6cT9QOUojyYrQNKDKwzQ5mX xTPA== X-Forwarded-Encrypted: i=1; AJvYcCUyKhRpqItqmppdWd6+Vox6CFLf2qwWp6CV02uCika4hwufG9jZlYm2czzWIKUS3L9uCMf6S7w=@lists.denx.de X-Gm-Message-State: AOJu0Yyxf7I8jguwO/lJ5X+FLETPpk7zcZTiYgQaysGuEuqPCNrdIyPF YoMCD8gJ9MgeAS739I1pS18utM9blGxOf102bufcK73gKx0GZyEiyQ5SwGpSFRU= X-Received: by 2002:a05:600c:3c88:b0:42b:ac94:692c with SMTP id 5b1f17b1804b1-42bb0205b6amr78691475e9.0.1725122935164; Sat, 31 Aug 2024 09:48:55 -0700 (PDT) Received: from [172.18.168.79] (ip-185-104-138-67.ptr.icomera.net. [185.104.138.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba6425a77sm116699105e9.45.2024.08.31.09.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:48:54 -0700 (PDT) From: Caleb Connolly Date: Sat, 31 Aug 2024 17:48:51 +0100 Subject: [PATCH 1/4] board/qualcomm: introduce phone config MIME-Version: 1.0 Message-Id: <20240831-qcom-phones-v1-1-08614edd8e35@linaro.org> References: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> In-Reply-To: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini 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=3149; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=/498lubALH9NHF/IT2J0k0n671CVhRDgQSpw0A6WbdY=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm00lzI1iexdsUXcKjltQG/PFTmBVeYTtustnjX ERxN0PP0ZSJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZtNJcwAKCRAFgzErGV9k ttslD/0YWQIc0jJxhuip16AIK5CAMkmJTiSGvDWbEl70EJ0unCeG8G9AvhUHawetENzV+j4syR9 3ouu3e38/XgptDCAeeuVh38jkJrj6TICiWHpakMJQXgnveTr5gfu7jcMR0C3pthrq5Oeb/sCSBS +CEIJrLr+68j3nPkDuYyvcSY77jHcoLg9SqQv00hZ7D2FePkNqyg67rL1Rhz9Z4MuXjSgs9xmBs A8AcBmyzgCAyML6pBS3hWJIIeFPBZrVf/AZ+UkmxlSrVn98zflstSXRdwijFlzqjm2r1LTGBhLG 3y3Sq50Kn7FBl0cx3ADsDPWiOuAhePKZTI4QczaiNgCgNf6eqA0yVA8SqR6e6Qic96ehcznlbjD RwdJ9ZeS9C8XOEFo1PbGsnEVLyfWbAA0q8CL9Dg0ZTgxaHysnlpJ6KIvOJTcUEcRk0kUrNZftWh EUVqxW4EPTyuG0SBcO8g1VCiHt7+Z35N6wxZKb6AEkN89TaySssLtX8Bi9/6lkyAdlPxv1Kb8CK 5/8WlT2iNxyJI819sFhS0m1x4Z8pycDRuZPeMni1CfW+l7ENadSLMXRSRn73K5Xo6kJxOAq7fg9 ji0wlsgkFC6MAofhwoMFLAKzIjYxorgFUHv+g0eB3qnp3hA4Y0JA90MXAd5GMNmEsNs6OZ8ExpK /HZgKwRAIqxttyQ== 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..4639e19a3df2 --- /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_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 Sat Aug 31 16:48: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: 824408 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp1278277wrs; Sat, 31 Aug 2024 09:49:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWcDDMLDmhsBdzI6cdr32WRdmKUtV0i49FEbAaVc6CMbV4S+a3uPvyH5ZHuHE5xJg++qvG7gA==@linaro.org X-Google-Smtp-Source: AGHT+IFTyhx5llYJAvVIuPGG0vV8s74+6VjtywtpUPTRCZKr95LOtHzSjcsP9x3tLjeBq3wMe2wI X-Received: by 2002:a05:6000:1b0e:b0:374:c5e9:623e with SMTP id ffacd0b85a97d-374c5e962abmr32099f8f.43.1725122957050; Sat, 31 Aug 2024 09:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725122957; cv=none; d=google.com; s=arc-20160816; b=OuDSv0Cyav9e+hfBxk5elY0yekVFnMWpFM93w+bBPar9RSvb7NmidYpd83CvvFsVJt BURNcVlcsEAyggENwHxxhmm+O9AjwEkn/SwIf9RG9OEkgh0kI3mZ3nhOlGYK2JJlFR4o mFH+2+pRIb/v1c3rMe/oZN+P9912c8d3OIc1tq68OELXbj2/jQE87gZUCRpHjitKAPLH GHPEygYqh9gsXsJ5jA2ZGq3pgIv39RuYO0nua9fOczRyU8Qxelmy5BZSClxPBszKw2g6 HbpO3exnU1ArdILwH9+KUnX+8LY1SYRcVWyEl4ZCcFRm2axnWoH5EAB6GkzlYcJY7qTw Gvig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=LrvnTQsxvFwoXqsZC/SfNcIrTWnVQoEbBzFM3YuH1Hg=; fh=HgthaZ9rVTJVp4EamcB5L08g/GaFE+65f/XCktYPvFY=; b=UL2iCTXGKAWI2D/yCMdS9vCIjW/GpQLRVEz1sbM8TLYpU5Wvfl1kLhkSHr+4ks/djK vNAiCO8dK4sQycNCDO2y3bnYTnJ5hfHj5ejoNpURoRt65IOeQBKEbo2qFntHpVCHGXh6 f38PWFVKJ74uzxGpUkjUDZZ7HIclc+SNYSPOVO5D33TyErvFYyFHzkO4sHMu8i34EDQx s7JX29FdeOn8dAj+OrHfcoByS2hG48P8vfsOSDekeoBSq2huBGlRNv31EZeT6JzQY/4u c5xaiO+tmmWJJlC9KiZ3gfS2tXyXnDzDJ4EpP8Wre52Y5UQm68pi4fXni4thEXa5g3v3 IVEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X3oy8te8; 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 ffacd0b85a97d-374c3cd74fdsi265479f8f.921.2024.08.31.09.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:49: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=X3oy8te8; 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 1C28888D8B; Sat, 31 Aug 2024 18:49:01 +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="X3oy8te8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC6F688D83; Sat, 31 Aug 2024 18:48:58 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 F1C1188D6A for ; Sat, 31 Aug 2024 18:48:56 +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-x32f.google.com with SMTP id 5b1f17b1804b1-42bac9469e8so23496625e9.3 for ; Sat, 31 Aug 2024 09:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725122936; x=1725727736; 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=LrvnTQsxvFwoXqsZC/SfNcIrTWnVQoEbBzFM3YuH1Hg=; b=X3oy8te8ieOnLB/59ZDmTM2+gmIJJVfa1Wc4LKX7ZDgIcNaLROGY85eOZhbr5vihel OtZkUFakjepjftkIgzggT0H4gVNhgFsbnO3aVlckXtyiHljkTtIqULhvl3FRdXBmR8Mn hm1WzKmmw/wOz5vdKNhXR9CBjYDbbkfG18hBd6pa+tH/PalyfJ/7frUXzq/Bi5yIqhCX /TQSDT3FC363cslYurGz+saX19jii/asejGy/TaRs5zg7WPgYUEhdSDeFyF2lBYZTRBF 4sO3bHuAkU9cHcFPi2NEflx1RRmhWarNI5dN2kBf72DWWD92uhsizO358jeaQUJXDVvT Wp/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725122936; x=1725727736; 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=LrvnTQsxvFwoXqsZC/SfNcIrTWnVQoEbBzFM3YuH1Hg=; b=cGDtT62clwrYko53dzv+fS7cgdNFSArRRcXT95sgV8b+lk5hNhZdbb2OXOTebSAuMW nrzwxvjsGX537IFZB6eSgzbI2ac6jgXf+UTGN0YvmevsDo5MFw7udy2m3l+JGu2d0ctw jP1fyVpPFKqrySnx1B9GJC9Otp6xLrX+W1FrOfoRgn9CEvrIxR58bAuwi5wk0oUTq4Ym dJ3X0+EO9hK1M0+A5ybenvBzBfn87jzWELgNfPRfGlYpUej0bs39U16sm8QuG/sA94El 7nKrBz6zI7ngfSxIhrF7LfdEJ3u0TKSujRajgXQl7uOM+2YId7Xw0ejV0fGgrCFRyzUb Ougw== X-Forwarded-Encrypted: i=1; AJvYcCX87dpI6aFRbsUglYl8tvSMEt7Hl6N/jjhDbK9LH24lrWMSLzrRuH8qQMvLXK+oUHcQCFu6EBU=@lists.denx.de X-Gm-Message-State: AOJu0YzYn0t5e7V8Z4kCjH1nDmUELE1gQVI3vMokRAiou/0tuxp2CSbn c7lbSohhh1/wuqOBbLAuPI13RwRTzf4Fc2wyqSA7Br4obrH5iqVBoCdA03N5KVY= X-Received: by 2002:a05:600c:3596:b0:426:629f:154e with SMTP id 5b1f17b1804b1-42bb02d970dmr57173565e9.30.1725122936380; Sat, 31 Aug 2024 09:48:56 -0700 (PDT) Received: from [172.18.168.79] (ip-185-104-138-67.ptr.icomera.net. [185.104.138.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba6425a77sm116699105e9.45.2024.08.31.09.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:48:55 -0700 (PDT) From: Caleb Connolly Date: Sat, 31 Aug 2024 17:48:52 +0100 Subject: [PATCH 2/4] cli_hush: run bootmenu on retry MIME-Version: 1.0 Message-Id: <20240831-qcom-phones-v1-2-08614edd8e35@linaro.org> References: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> In-Reply-To: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini 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=Tk/BYM4KIUxtJwibvCUVvpBmrYkey4gF7acrjTZP84E=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm00l0E7Y1YyMiF2zt6bIDY5oRdqSiG1e/YmjXx vz6JPjA9CWJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZtNJdAAKCRAFgzErGV9k toIVD/9D4vVJjM45g95hdiWIiNqgjmwprQQmdA5hbAUfqBhfgq4RimrwONllE7VHPay6jzfqP6a SBgPt9spHHf6cDlS3EOWTMd08u5+mf0GjwnOdQB153y0ptJruq9J+08FOzyl89cUG2vXihHSLqw FrmJqiQcrxaXHjmsIcWrHwRiEF9HCoWaeuLCtSAXcogNpKlTFZIu6h0X9CMrOtuFoz3ds887y7S Dhf3RJMwsUblYJ6I6maZOb9CpUoZEEwi+WIGae5fMdWCLFndV0NFdsezcYZ870UINOTn4DIhLM4 /kZNIhAnY91kvt9qwdobph/j0cOHR20a1BJ0Zwglg5r+G7bkTnOEvPu/Iwrhqx4inGMiHXJHvRQ Avw4assGYyV7N0gHSZHdZvmiTKu1yYJS8YUho0vRCXh9J125pDXweSZSKIHsYVlUeT5LJGkoObg PYYmisSQtepWiqECw5j6EB5ykbYuC9+6zY7WOu90zAlTW4WX/zMPOSIzIa3tgN3kAPXudDAResJ UGS0iA9HDDureLqAWvzvZbTgJ+lHfY/gczy8qxpq0STd7fnGdURncjiO1J7vkUVlIbwN5AEauQd /9pj8cX1p1GFwXx0+3mgw8M2ZoFyC7WF4Ddt4UGqwxky4J/a9FfJHIQQQLoUczkrI4mW158AGFP lUWM5MpicY/ZGQw== 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 7874b399d141..c28f4a92123d 100644 --- a/common/cli_hush_upstream.c +++ b/common/cli_hush_upstream.c @@ -2897,9 +2897,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 Sat Aug 31 16:48: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: 824409 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp1278312wrs; Sat, 31 Aug 2024 09:49:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8Gy985K/IGgSHZNECqKlkTi0HfBRpA9eYoLMKbm2hkijK2SQL9Xwj0m+8f5Arx31LDj9/ug==@linaro.org X-Google-Smtp-Source: AGHT+IHA5D+dA53q4ip507VuSu9XvFUpB18mUMkBCR17RGCVidZ39FGnAz6xwD9bLn9I3OTQ5R1N X-Received: by 2002:a05:600c:1d1d:b0:426:5269:1a50 with SMTP id 5b1f17b1804b1-42bbb205a6bmr40280285e9.11.1725122966713; Sat, 31 Aug 2024 09:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725122966; cv=none; d=google.com; s=arc-20240605; b=VDE/h9g2EFbAk5b5yn3AlejvEJC7GKeveUvqLQ3SUQ1Tx/BNzNSPpAsJG+ZeWpCqED YxZ/PFAo2xdlNC1Q5sPFjZvL5k0gq+9DqwkxR2i9Va6e3iHeNTwFx8dMAXSNOgCgOcn7 X46mA2qaTdYXRt7DaHigGBKC3H6iUzbaFFzCrZoA0AgAWhC5BxXtcDtXLMv7g+OAb8y+ BUbjP9vt0KBmICRYPMn7n5yAIFCeAQi236eWH9hXA2phKsk54jN1lj8gax16G6YxXT/k C3wd+Dbp+aFndtEOMyFTwe/fSehm+kUWWFxhnP5PDOGWCIZO/hYAWabORebHaBprETUi 5+zg== 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=wbclZtwb1rxDRYxAqkLn9bT4IZ8BeBKgjxYwlFmqLO0=; fh=IZR1J8za+TbtnoPC1L4bBTQaqhI/qVu9DRMn3xTDANU=; b=kP18QhqXFadvUM9s47dR0cBfNFwUGgsDN3sBq1eu4CWXiaUV4KxwDfqUj6BWW2n5M/ cCpBL/RKzD3nkfD6f6gmoVVbh4mB/WMwtH+VsKNIZJ9xxDVzX46aNqQDqq6ys+Ay1D2X CyBcX9HdkOGmo4dwOw9xYEYOAOK0ruk6M/RRhYzRJCUwO1c6s+vfr4cc+jJrnXP6fas8 SuY6OFMqpn0yQXzi0rGbzjbmLhnZNcyE5WHJZ+gQovjV4x6BkUPfc6pi6JJ1JDOYqkW/ 9iGvJ6IwfgNk8vwcLjwY7TNhdyqZ7nWBUlxnv6vyPUy3IVWntULDeSmbv52r5hiu1cZ2 w3LQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rVea2JnW; 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 5b1f17b1804b1-42bb4ec4ffesi32645605e9.198.2024.08.31.09.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:49: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=rVea2JnW; 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 7F33D88D8A; Sat, 31 Aug 2024 18:49:03 +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="rVea2JnW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6301288D83; Sat, 31 Aug 2024 18:49:00 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 70ED888D82 for ; Sat, 31 Aug 2024 18:48: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-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42bb81e795bso22028145e9.1 for ; Sat, 31 Aug 2024 09:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725122938; x=1725727738; 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=wbclZtwb1rxDRYxAqkLn9bT4IZ8BeBKgjxYwlFmqLO0=; b=rVea2JnWQwQhR/fDtIPqs6fSu81EOPf6xDf69WXvSvvdeFzap2loJrpbfnkxUwdiKB 30TPQOP8aoWC/DUnh29GjfaImUmP9rtICpumQSk2LayfnNmCH3+ABb3dFdnC5sbtpIIC jWNEPylz9yHFkWx9Z3LzFzPSAfbkM48dWXMRhyrV0evYt0ZjkgxTFqabehFhlawZatlT zQT9Z7DUMGgJR8MHbq+pJmzEULVSKk+fMeJ1gn6OtQPSfhfVQ97CrZLijBZzZIc/VARE YcY7HJjNQTWZwZa1l29BHMUAK2YhDUyLkJ+WoFH5SyK7mSb0hjIChFu5SWvHuFihqT2N j4bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725122938; x=1725727738; 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=wbclZtwb1rxDRYxAqkLn9bT4IZ8BeBKgjxYwlFmqLO0=; b=emnPANYx2AKDpftEpwdwQ3yxnaXc1l7mJjlMxSRT5GsFi9xXikhWm+XlaJbO6OjPP9 T2gwk54tZPvnUbZobIMlFyriz4I763pGYEckcgQ3Ucpb9+Js25JVT6f60JLUmNqfpm4b YLoCY/FGmaoApZJoyemUPsUo5Zp027F2TKgJZ2x8ONcdrEf0rH4ulNICq0Xe8pvtH0+V kcMvSJPcUJ9kh/uHoHbpY8uhf37NWzLIgDiKYx6UlFClOH4Ire4IVLC7h4jx6UHDRPmi ZXrQF4GQrUuuDIWrDV19Ykb13J8Tn4O0BOywSBaVgKOgGliJloyaaU4IoDr/KKz8j3m8 cXGQ== X-Forwarded-Encrypted: i=1; AJvYcCUUmn4aSU2dEGUSfuxNFfN2PiSBrBR/OXhvdkdbajaIuhjei4OzzZ70bH/vpkxRI1QA1xSkPtA=@lists.denx.de X-Gm-Message-State: AOJu0Yw/mM+FJ0EiDhWp6+aWuEokjRih60V2BLCs+BfBDoFUcF09futn Bq7SyhekCjyzMX+pxQH173rTE2p4O9zLW1iYtjGb7fUuPuTIGNfGEhp1umyo+tQFDvkGx8gZ11o oIwI= X-Received: by 2002:a05:600c:4683:b0:427:ac40:d4b1 with SMTP id 5b1f17b1804b1-42bbb436e2emr44396615e9.27.1725122937721; Sat, 31 Aug 2024 09:48:57 -0700 (PDT) Received: from [172.18.168.79] (ip-185-104-138-67.ptr.icomera.net. [185.104.138.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba6425a77sm116699105e9.45.2024.08.31.09.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:48:57 -0700 (PDT) From: Caleb Connolly Date: Sat, 31 Aug 2024 17:48:53 +0100 Subject: [PATCH 3/4] bootretry: check for bootretry variable changes MIME-Version: 1.0 Message-Id: <20240831-qcom-phones-v1-3-08614edd8e35@linaro.org> References: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> In-Reply-To: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini 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=0H8n+0j/GEL2grXCaQaQ4ZqsFCay3wzebXIywJAd20c=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm00l0u+qiQdQVcUA9sKP+sf+p1MM+eDBQVERcJ tUcRjv2rZ+JAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZtNJdAAKCRAFgzErGV9k tmfvD/9ce2jCClWsvWJ4/7aNWEeHojbVWwhY27mbMaBFceL3XmB6lkCgMn7akwQhuZ0QEP1WeFq 8GXn2xYcwKPhSRcs6h5yLlLWS8NkKsUduIQv6g4EQKEfYbf3KfQP77vjCQT6p17q0wxerJvOBlC 0e+e4YLP9cJRMQwL/hr7hOYpEuxIxM18llx3tXwaK6427WWlBfvsDoo6EISWKPTh5vr4zBf3Q4O t4meIKY2sjDG0O9dKFzYPVneSqcF8n8u7m68q0HWX9ysd+lVBn2cIr67fPSoxLtUvS3BnIvPT75 pIEHwQBkI9V97OD66wqNQUyLi8sZgXUt042ob2JFsQ2famX1lkhwKpCw9Xz1yqLkwSisGKsfJj+ H5cCZvhTrxr1HLWUdlOpOldMLZbiAs51U08ZDWJ05tXBMHcw6PCcFaqm0ZMUV3aLeC+li0svriR /p1F8M8yQQxQEKpPkNahcYH5CODWKkHhjjNH9+zGSOztFXoQU8OApX/SVubignNuU7rXOd7O/m7 LDesp8vCPPdyeIch2te+igliF1jtJWBytTwzG7yhZmwD2yZ6KIX7lg4b2YA43NRxWWHaeLawBFS eQ5Owynr3u+5p+bAo2h3S2rJEksjbCQwvrUcpdpve+5mHS0hp+ld9GS4CVW8KbKto+gV66Lt/yD +1AFgpVDfJqoLOQ== 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 --- 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 Sat Aug 31 16:48:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 824410 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c1:0:b0:367:895a:4699 with SMTP id p1csp1278352wrs; Sat, 31 Aug 2024 09:49:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX35XnlhD0//kpRql5w4d9NvDilxuylYK0CxIgzALtDbNiXhqvxZWw6pFl2PwRsFRUMdjMJIw==@linaro.org X-Google-Smtp-Source: AGHT+IFs1O8nU6TBfZNl3sFMvG69bh+AR9iGX2iSgzwMPmP/vHitngKQoKIqhsUUuZIIUTb0SoJm X-Received: by 2002:a05:600c:5110:b0:424:ad14:6b79 with SMTP id 5b1f17b1804b1-42bb01aa1f2mr71285345e9.8.1725122976427; Sat, 31 Aug 2024 09:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725122976; cv=none; d=google.com; s=arc-20240605; b=SpKns3N5KouZjyya2BqKNTTMtnB9z3fSmTxxghsUjVcSYmrAHqdm6UtCXljBmeF0JD +2Xkjh+2ISz8gQHVqGtJagbc1seuz/3fVy66xsuqIPxNjtMICpIBLlnmvDfZonENoMsG YmlXfSCHEcwFdiwWD/YqcivTkPN3kgN8XiNy6Iyi5Z0YzwtUsiYT0tYZKhyUnpXOA1yB Livlzh/FBgpRD1efelCOMbiNoFGUXHVmb/EXdx8fnFWebDFV+J44ed55NvNsC8Okw5Qh 8DszPTR0BYAK+xEmq+4REkINLDfUmJ5YkoRkUM8pJat6zlfflbJlrybQlKuOJSTpOhMT X6Ow== 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=oKfpWRguJHD+jXwfwlBIWenXJmpbT25T0w0dd9vvlao=; fh=OKfxBV7bvVZ5HgV//GIXUbryhrRuOZ3A/mHEtprIO2M=; b=lBfp7ZmhAVRTz7LF9dorqYj+hyU2+Dyw60xzDwXWSjmLZdhVPFhKJRddWwtFvhdq7u w9HbFjV61jv6VDHJ3cRZuEMLpowLyVNnAMmnhEQVeyDrAdxYNZL4saOmBe1cPiFIPrNw p96XU3D4V/gFAwyk3d01OjBKbLnxmusRfa/c7zHuBvnUOYmjFUQbSAjZWge+EJJVZ7He /L6C7H+2wNJzd0WFBl+9ElA3gDc3CEabVNsCg9sxZ5ipMx3BQEWH/L4zTwgBrgp0RazV c5+8q8nPDYnGPpkejD+1N3+njkHbVmZEAHJqrKSMTpt5gmUvXGOB55pmiSQWkNlb6wF5 1Rqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qaju6DEr; 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 5b1f17b1804b1-42bb6defab0si29715455e9.50.2024.08.31.09.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:49: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=Qaju6DEr; 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 D262D88DA1; Sat, 31 Aug 2024 18:49:03 +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="Qaju6DEr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1DF6F88D8E; Sat, 31 Aug 2024 18:49: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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (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 A4EBF87DC7 for ; Sat, 31 Aug 2024 18:48:59 +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-x331.google.com with SMTP id 5b1f17b1804b1-42bbd16fcf2so13804345e9.2 for ; Sat, 31 Aug 2024 09:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725122939; x=1725727739; 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=oKfpWRguJHD+jXwfwlBIWenXJmpbT25T0w0dd9vvlao=; b=Qaju6DErV3j8u+nBdNFLPWNCDN/9iCuJ0cOF/6AynWb1uZ3YLKc3JXlB0ZO0Ro5DF8 Utf/E6GrTTfhkaAQv4mxk1g8+oHkRhjJnzBF7cxMZcZUpW+bokiw0YLh3+1v/r//Bd+X 7YtFhvNkPgooo0CmAsFr4EjSww/4jBBLTgMiLX1dpCPe0tpQBDk6kjdKi7kYMOlZA5zm vN5zqho0xKapxkEEXGPZkmasMCePSw3rx0kPLGTg3UK0Qk2EA3Q/7JSfeZAnLKwm8P4n cHkV7OefpGp1U2WVjJNtUIER1tAovDqUHhj3OtV5SZV5+EoE8MtxLmkI8aQzBLBW99Ez axzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725122939; x=1725727739; 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=oKfpWRguJHD+jXwfwlBIWenXJmpbT25T0w0dd9vvlao=; b=djBp2OpnL69Q3c5CFrTbc/s2adFNcwTAvqqCbvlYHSReGq4dmjYNyFAkoam4Y95fjy I+SqFjr4n2TiuLuSKvUYU2k4/GWlrtZ9Am609F4lPYalbFmta10xxzEGg5mqI4/AG+Wk fi6bP3pnc2Aydqd7R7dTO7I95/o8CDFIle4xjFRPLZum0oIS8Wcu32mkfhu1H5IJc9Ju eY7aqbP+2DPy3JfdufAZt417f4Tu6w0PCjWTfkYL6Dp7O9bcOmyqKMBiIL0g4rMmvx1x HVNCSnVtDTwCOBBX0RuDfOS19WvyuYAOfZI9c6W+7YUoGv4uqFYvuHkDmxwVpIKJU90x UP3A== X-Forwarded-Encrypted: i=1; AJvYcCXyOE5aN/sxZjVwYxKf/rYZtAJQTXt6M31Sx/OwAFxQpDhFDlYd0lk9DxDBUEVoJjDzkl8OxlI=@lists.denx.de X-Gm-Message-State: AOJu0Ywh54bzIVqhBh8KMxR1JT1ID5YvHx9NE78Zeu6PedgudKE1HTKr Si6mQgJuADKQU8flFhb05F1U90Fv+KRA+DftFa0j8I9iX7BEAJbaGGUCxDYrmvM= X-Received: by 2002:a05:600c:154a:b0:428:1b0d:8657 with SMTP id 5b1f17b1804b1-42bb01c1136mr71492375e9.22.1725122938895; Sat, 31 Aug 2024 09:48:58 -0700 (PDT) Received: from [172.18.168.79] (ip-185-104-138-67.ptr.icomera.net. [185.104.138.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba6425a77sm116699105e9.45.2024.08.31.09.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 09:48:58 -0700 (PDT) From: Caleb Connolly Date: Sat, 31 Aug 2024 17:48:54 +0100 Subject: [PATCH 4/4] doc: board/qualcomm: describe phone support and bringup MIME-Version: 1.0 Message-Id: <20240831-qcom-phones-v1-4-08614edd8e35@linaro.org> References: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> In-Reply-To: <20240831-qcom-phones-v1-0-08614edd8e35@linaro.org> To: Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini 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=7379; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=AKDusgfxS6Tm1yZ/1J43dGM/5/VHn9rXIsI/ZnHv/6k=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBm00l0xvLzKHCxRVoxSW0tjqGng0ff2NxK7iPny WO02i28ZISJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZtNJdAAKCRAFgzErGV9k tj7XD/wOqWJTLLzQQRX4cIMA4m16C3yttKGPFM2AqCSYn073w/7TbLT1fYdWwLcGvOChMCHQQSS z2nrj7pTFlMp5xfKFKMgzg1MvXqIN8HSWLpvdxGMPN2DQja4f/1j6iBQRNI0Y1N2AizRqF3rJnv s9rngnWMS8Qdu2oeB9JdQtmowAFPhxtOzvM7W/IamsMrAyH1368M4QPKClsNbyeKEqPubJ8u6vH B221yCMfJYNgORhzdBIvfgS3j3m2ycrAdk6phR1rAWL5M1aHaL3DE01HC+AVEFSANDqjbPqfmzV i0fPHqEfV2V0a16skRYZqvjb4KUOR7bVzPuMqxs0wT42zNX877h6sWwuUi6ve3jy2T1ebNuD3rD r3upVdax0JCVpUibd++AHWAsSPtzLUHL18sT3qsrjCoKChbOnaYXFka2xrmMatgdVwDrcUUrhZf I3TvjA+lc0g4fb9CnbR7EeKSAFHhQeNQPtxcVY7bwV0u7uX8rp6yuIQY29t93BzrrPsfP7AcyBc p73wPoH8rniyUqIiwKuRrM1IaHNBZx71YyuWiBuw0Ev/UyMSFbKnqFKAuXn8uVEl9gZYiJSmrJv C5e0mYbKkHkLzh21Gbvfs0fc+WI6Wn/esoQsgjsgah/JG6dS3KSBeRMlAhexfCn8COS8rfRZpK0 Hp3Xudd2y2Wl5/g== 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 4955274a39bc..690d80c4ab1b 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -8,4 +8,5 @@ Qualcomm dragonboard410c 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