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 Reviewed-by: Simon Glass --- 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