From patchwork Thu Aug 8 23:59:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817728 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74352wrv; Thu, 8 Aug 2024 16:59:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVlR4qiWFuNOpV4c4wgLRx7y30ZetLMX4/DawBj+in2GULttLIjgTIBH7YYjRfSrpxhDtWSTUuMjH3vkbn80cbq X-Google-Smtp-Source: AGHT+IFiG5WSEJEhQ2jgQ6LIXL1TVsmU0sRzVALP9p/fVuJ9FTpWXqcmkqy6+kQlmDaKpP1SnE1i X-Received: by 2002:a17:907:f71d:b0:a7a:9144:e242 with SMTP id a640c23a62f3a-a8090c6eb5fmr249109766b.27.1723161591757; Thu, 08 Aug 2024 16:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161591; cv=none; d=google.com; s=arc-20160816; b=O8sbm5WLw3zWgcQ4rfSKyY6SPjy9zBznWsVnTyg/PlQFRNCXeeMXz3MC4ySjNCjiyt lxI8W2i/hMIFyt3rUjMtwCo+3TTeOA86sOWmW9/1kVfIHx1OeQ4tdeMsDyn6T1Jxx1Qn osotEIu96VRjrZo3P3HO3l7QIkSqA4IMstvM6jlaUiKcjzB5X0+A4nJAs5bSMKULky3y as5dT4nJnLFvpcMHbYkV6xrTC5BADimNnox3mtB/ohgzA4wfyITyo8b1ryKbXw1O7wHm CkNgO28KOIMihrFDyEr8Sa39AIf5nP09XCx7YYdrXyET4rOBQVbNHqx6GpynNi4Ze7C5 3DTg== 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=es/KIY6CL6KY9XX8tCEPp9SwT/zLGIVmiGJ0iXx4Zf8=; fh=TKYixcwmYIF/qL66Pe+gcP1Q7qmGjZFe8C77YX3jtmk=; b=TZ8xxMlXZmMfCfqi2xky0f0+/vce9fcl+5AuXurOqq+/ynGNLcqZxE7WkO33iEeuHo l6KFqyw82WIVwBs84mpXlnyxyvCnPLyC43PhMZ/bFwdvH73OdXESY5bdqkzEPqsWS+xT Nywy70zypN804QvtbGJHHLIeED6eILQPyNG1iPgJ+65kLXJAMVO/tnj73RMedcK2lDFf GTrKIascOmwRTGBCNz9hRE/Y4+wNh2RVL8I6cKwsZxI9HikBZ8lIIzvMK2m6Z3C28BvN fbaTOMWHqoVVCm7smYAI5AveYCJ5haBmcMwFVzdCW4KMAHHkYH0p9YgkD8FgGhD2FbaU th4g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uZGDcl+a; 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 a640c23a62f3a-a7dc9eb6b43si878762966b.673.2024.08.08.16.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:51 -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=uZGDcl+a; 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 03ADC88AF4; Fri, 9 Aug 2024 01:59:42 +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="uZGDcl+a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EE9A882F0; Fri, 9 Aug 2024 01:59:41 +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-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 8866A887E6 for ; Fri, 9 Aug 2024 01:59:39 +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-ej1-x62e.google.com with SMTP id a640c23a62f3a-a7a9e25008aso184103666b.0 for ; Thu, 08 Aug 2024 16:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161579; x=1723766379; 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=es/KIY6CL6KY9XX8tCEPp9SwT/zLGIVmiGJ0iXx4Zf8=; b=uZGDcl+aetekt5v8hAf/PBRbuGXqL/sWKGeQpZVICsVD/JWQZtHZVSIuaTvgLGG9s4 u8mUua+OtgOmaWzmiA7qAmTOON3k4tzqxBCpKhdam/0hH/YZLpSIosFGdrTR7R8U9jXi 24RFtL2e+dU1P4o1F4h8vjaAOiFJiPqBlcCByMLyrlymxXL4tVag5YJRvlfv3l+s5CkI lSub4gO6CysWd0B2iYvFPQXpNpSIN02uMYFiG3J4V0np8CZEEgRLZJhSeF62/xU47BG+ t+sBWTwkf4GLFvI5UKUzBoAvAtmbCSoSeLKoyLbw6OS6yIHoJn7wzpSfxxOMEsEptZ0J KjJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161579; x=1723766379; 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=es/KIY6CL6KY9XX8tCEPp9SwT/zLGIVmiGJ0iXx4Zf8=; b=V0zzmbLZSgJPPdDm4JW8XVkyO+baNMQDC33vMaihHVEq/uOvzLCUn1GXtROx7v+wxn sZTPOAbWWUARJ3z/F+iMi4TGzuPzKz9xqyv5sd/6jO3pqIIASL211xtwg6/avq9hD7n8 lB9JicjuL+SoM5lykZNRNdbfSWgbPYQvCJ9ZDp3Ur/U2HelqauCnIln+YDdTM8fy8NAV 5UBvhnTzQwyxoQVVVpeAIEvUcahcvgfK+PBoiIsh+d0jQpH2/qnVQ3PqW5hpfGqBZeuK 8mZDuDDzOa+529xvDlsy6mTuctnGOmm35b8i6ib6owjFCPxVVREMrEiWjfku3o/OtSbv odpw== X-Forwarded-Encrypted: i=1; AJvYcCX/0iiISNot/yYJlqiuj9P8xTWKwNB1O5RGs1WbWbsKyD1FqJsWAZ0tvCnTLAAuMtozRLph27pqNiZVQr6rvFKty9lj/g== X-Gm-Message-State: AOJu0YwF/WJAQuTHlxjt6E2hK6cEvxqQssfxNOvk4uSHU62ImyUMPf/0 fGnBBCWBHlAHZAi0SQyjKmYnM4YeouXyXq88SuiKQ1PslQgYLu1a2ryuXL9r9Js= X-Received: by 2002:a17:907:e627:b0:a7a:9144:e254 with SMTP id a640c23a62f3a-a8090beb7d4mr231932566b.10.1723161578701; Thu, 08 Aug 2024 16:59:38 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:38 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:24 +0200 Subject: [PATCH 01/11] mach-snapdragon: refactor board_fdt_blob_setup() MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-1-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=2791; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=AYiBDIfhJ3LhiwbAt77sIqn/keoGsEaX+pWza/Rdc5Q=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvnvaBE/O7x6V0nIUgyFs1ZB9SbJRas9oIRs vb8tZr+2HyJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k tgunD/97SYatgSHizLC67D0jr3gkS3A4uN2Zrs2FBc3qHKoPFnDM0h65XBzADHs2/l8X45qJLGp 4g95YhfqRCpjlFTsPvGtOe3jndPtjB8kebmlz2o3SfCgfAHch+Xs73J99cKjGP0sD6rgRwTB7m0 RIgSyCxS8ZtxkEJ6P9jSStb4lm0Xp8Q4bACqoHdR8A/br/dAd6766H7iQxLY6s9R38Q6ukLsu2Q ZqbF1rCH8A8C3nf8W7MUAgJ2Uuv6bVffFHe9VtPMsYUIIMrRdEEF9vL3+np7dr0ZtxzJIbcWpTD 1vtUq41nklCy+GyS+82p7BprAU/sbfYD+kuMSQH6sDLtlD9FTKk5114vNPFwO7Tl872hMnPNeEe 23CCgNjmhzwDF5Hy5xxhuFd02XheXzw/0IcwH/hAKPIoKl8Dl1gf94bnu0SWyVMdFvHlWY87L2g /FN8auxPbduyygB5ZYz9VmWM5LOBgOwfXb/faFeu6b5/pMwKFQfMQ4jAt9zjoWBVRHbPYQ2iHPB CeA82e8ziwBRgJXcRmDKjix4LXNr5Sbb5aDzJQNOa3Z6uDCfTdkgRMqP5z7KS109wrQoFBiZkZm h3bAyI/+snqRaqvoN9jEDZUkrH8UpaHWkCOUIWYGwgOnVO2uhQx+OYk2CoxeOy0iGoheGLbdASE ayC9HLmDEa/bdWg== 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 If U-Boot has a DTB built in (appended to the image directly) then this was likely intentional, we should prioritise it over one provided by ABL (if there was one). Make this behaviour explicit, and panic if no valid DTB could be found anywhere. Returning an error is not useful in this case as U-Boot would just crash later in a more confusing way. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index b439a19ec7eb..2881de28a0a3 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -17,8 +17,9 @@ #include #include #include #include +#include #include #include #include #include @@ -84,28 +85,37 @@ static void show_psci_version(void) PSCI_VERSION_MAJOR(res.a0), PSCI_VERSION_MINOR(res.a0)); } +/* We support booting U-Boot with an internal DT when running as a first-stage bootloader + * or for supporting quirky devices where it's easier to leave the downstream DT in place + * to improve ABL compatibility. Otherwise, we use the DT provided by ABL. + */ void *board_fdt_blob_setup(int *err) { - phys_addr_t fdt; - /* Return DTB pointer passed by ABL */ + struct fdt_header *fdt; + bool internal_valid, external_valid; + *err = 0; - fdt = get_prev_bl_fdt_addr(); + fdt = (struct fdt_header *)get_prev_bl_fdt_addr(); + external_valid = fdt && !fdt_check_header(fdt); + internal_valid = !fdt_check_header(gd->fdt_blob); /* - * If we bail then the board will simply not boot, instead let's - * try and use the FDT built into U-Boot if there is one... - * This avoids having a hard dependency on the previous stage bootloader + * There is no point returning an error here, U-Boot can't do anything useful in this situation. + * Bail out while we can still print a useful error message. */ + if (!internal_valid && !external_valid) + panic("Internal FDT is invalid and no external FDT was provided! (fdt=%#llx)\n", + (phys_addr_t)fdt); - if (IS_ENABLED(CONFIG_OF_SEPARATE) && (!fdt || fdt != ALIGN(fdt, SZ_4K) || - fdt_check_header((void *)fdt))) { - debug("%s: Using built in FDT, bootloader gave us %#llx\n", __func__, fdt); + if (internal_valid) { + debug("Using built in FDT\n"); return (void *)gd->fdt_blob; + } else { + debug("Using external FDT\n"); + return (void *)fdt; } - - return (void *)fdt; } void reset_cpu(void) { From patchwork Thu Aug 8 23:59:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817729 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74390wrv; Thu, 8 Aug 2024 17:00:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVIykApDseBlgQPB3K5xplV4QcP5w7WLDYHZNFZiuT8cS/xtTzLIG55+crHm5fTPcRCgu6ulrtRszai7JaI6jvt X-Google-Smtp-Source: AGHT+IFV8YaHN3CL6fxOPs1Jgf6qgXxFt7xET52MQVGDOOd2uBgx00qc384cD3OCvOuYwTwhN1k+ X-Received: by 2002:a17:907:d2c9:b0:a7d:e5b1:bf65 with SMTP id a640c23a62f3a-a8090c835f8mr234144466b.21.1723161601463; Thu, 08 Aug 2024 17:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161601; cv=none; d=google.com; s=arc-20160816; b=NuMqsd9yp6tzewsEeaPE7ulI0scGJXSoB90opJeJc0TJt8Mr2ZDec9HnazAflQeBea O/lc0hmQk8AUEsUazTW/09RAyOwEUHWjAiwvlWBG+1+T42aEdY/GL4TmWW0v2PWCZk4h L2oKOMUhMr4YlgySbwXEDaYzRWWCGyI65UER6t9RfIshyPRrTlMWnWcm41F8Kl+j0xzj GXTUPUzztEt9EN37Ha3RnnTOAd0RkqudXBrqRO/DpypqUAqEaUuwkGWjVZjujLeyr6Qy yq8EDpDWThcMw+eevXPsXZf4dhuQNez+6vAYbV7wJEnTkSIrtz6ekmWQjI8J3wyaKA4W 8iCw== 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=oQVAqXN0aVyCZrOfA+KR9HiRdoiW3c0WHFlddx70NvA=; fh=uc35hmoW4mcWkwUPNI8RqE/hnYxHnXT4Y5ygB9T/GCY=; b=w5WwlyyZsEaRslX66nthN/6fKBtw0GdS0wnwFhUicdsZ7HmyHyfNTWDvcciDU9N8Nv 5jxoVaEvElpyLsw9+WEPt4vOeVmB+3zWHYKfNZVkTycOvgREfZMhoeCwohHKm/ghmXIL QEcc/mv0UBd/W/1y2WQtAwZWQaVpsoRcy+pM/cFuftNBlKsWn2r7+JEtw5znDac63Tvf ic+rezDRBAJDgM8ESTzsnqgdDUZ54b/T2LQJaxqNLsgHvBDLCwFMAXx1X8GDUAnY9gZb oui+FdPkqvshlN8LOgHpTfoGyNp6T1QLLXE7Psgx40Rz/dAjFYy0KPFDlZeHv6rHVgTg 2mqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QZ6s5N9z; 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 a640c23a62f3a-a7dc9bd4a53si811788166b.60.2024.08.08.17.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:00:01 -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=QZ6s5N9z; 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 7050988A44; Fri, 9 Aug 2024 01:59:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="QZ6s5N9z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AE4FA88B86; Fri, 9 Aug 2024 01:59:42 +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-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 A1A90888E7 for ; Fri, 9 Aug 2024 01:59:40 +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-ej1-x632.google.com with SMTP id a640c23a62f3a-a7aa212c1c9so208752666b.2 for ; Thu, 08 Aug 2024 16:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161580; x=1723766380; 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=oQVAqXN0aVyCZrOfA+KR9HiRdoiW3c0WHFlddx70NvA=; b=QZ6s5N9zJmaHjYBXs9pKwFbzYJ8AFEufXgDFlynKgXMDfjzhjq4tB1P/gVB2pTlTAd CSEWPcqTKwoMIDKncVShu9F2Q79n9gRONNvrElMF0q2VA5DnWvN4JyZ4X1kprPh/nSHw DH99HuWrwalELMEu5lu5C/h6HM/LtRaQP6ddU/mUoaQkucperJSb5BZ9P+0z/H/aBDe6 4n8CihZGCT4lm7Z9/VpOVeJTQOc3lbhL7uFq7fsbGa0Ag56UNXEJ5ilJneOlSUuEaP8f wLnIRyjkzq8H9GXFBo026rNtrIFdAi7qAD6MWkcu+gSewNEcDJyjENZfrFIYttltSiKL 7PYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161580; x=1723766380; 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=oQVAqXN0aVyCZrOfA+KR9HiRdoiW3c0WHFlddx70NvA=; b=rnx6aeFvvhd3XG/2x5aIKmiCDZFTOgyBv5Ex9EYuJAEaNthTmAyCgdcLlpy8lgJoMC 5wgOAEYogGesI0mYv5LSPJuIbfQ5u2X5ng2OD27GGXUZIBQ/FWTHndO5y6zubiPYfl44 fR5tc4ElMDwo6b9DwnHNkUSsiHqMHIN80lee5IrzDWOAy7RvMQAxu8d+5QFbjZrOM391 2VDSqANR7WX33MKmDSRdT9TJxZDb0mzap30piNPh2n537vxsjVBhByv6u4H/S+hrv7BA jTeTKBEtbpYU6I5ddViu5DvWHOl4w/SyioTFPT5tP/PZgDQPQdK+jOlKnHPOcJD0zGqj F/ww== X-Forwarded-Encrypted: i=1; AJvYcCVL3LohNzfvPomz+4gMH5mS96gGv+5aCprLFwO3eC21F+mo4V/gY5w/cWMKwJCsaCwkzIMdi3xKfMoLv1QKAZVWoT7hmw== X-Gm-Message-State: AOJu0YwsjtAHULaQNuUjQnj7lHBLKyPZoyOb0jnqlh7gmHBX9IfjxlgH +urimVwPEr5PmMUwqN0Yo7jYnahrR5wNtRarRFassgzgZRJVD6XCe4lsAk7hluE= X-Received: by 2002:a17:907:972a:b0:a7a:9447:3e8c with SMTP id a640c23a62f3a-a8090c26d34mr267576066b.3.1723161579733; Thu, 08 Aug 2024 16:59:39 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:39 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:25 +0200 Subject: [PATCH 02/11] mach-snapdragon: parse memory ourselves MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-2-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=5361; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=kqxRPDy9dXNXEcM3z+9hPiRV/NLkk7TQTnMS9KRVQ7E=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvnJ3o8Tu8g9YPA3ivY444BimnqudncPPeSe AvBiHLJNbuJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k tqI2D/9OKBAIzMWSIn0oG9JREW63XIntQs7PQNVLLVE3nkkCiubWzQVHbXrAtf53ARoikVcj/FW PUMBCEmOc4x128K5t7WfBsemh+xI4MwRczxDpbWS0c7B190ncyX1Ul0orO0qHhMncTw4kGad6er RGnrv2uA4Z6fXpaID/x6kNZia00iaChWrmRDIyYUKbY/8kVFKTWEE0w/zHGy8W2kMB4Z8W3w8Ld JLerfRY5jrhOg/qyv9jIIYJao9S7xtWyGjZAtkSc8cn877qsFAyS93h49GwCzhvgUPmB1xt2eu9 Y+SegNHnRahmGZDLw2+WOkLQeMpDr5AA6J1obY57LtkYzXZjRfUHLulk5gd01DliOJ+hpGGvMq5 nwYw/c+1dQ2npnHaxt3fbbH8tJZljxBMmSR8IScxpOCfhxT7c2JNMhDHGFUq8bskVbBAY4GIoI7 848eJoZoZgyc/2FPfwmVV0DgSOtR7tG/OA9UElfvb4laqAOZpKrXvwYHDl/qOdix3BNRS2VbRbr eclYudTcX3jp5fpzxiLTBSekvOs0RvDT51g8bpYXaD8cLXrDIDR8HohaJRKFcbaSYsNQplQP6rV d4OSi1HXNojMQfgadS3NLbumlzH2MU2iOtbe9q9X+BrN5TCtDmubXhsNiNuq4UgGgN4oSywMALv bp6uxjZK6HIn5JA== 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 The generic memory parsing code in U-Boot lacks a few things that we need on Qualcomm: 1. It sets gd->ram_size and gd->ram_base to represent a single memory block. 2. setup_dest_addr() later relocates U-Boot to ram_base + ram_size, the end of that first memory block. This results in all memory beyond U-Boot being unusable in Linux when booting with EFI. Since the ranges in the memory node may be out of order, the only way for us to correctly determine the relocation address for U-Boot is to parse all memory regions and find the highest valid address. We can't use fdtdec_setup_memory_banksize() since it stores the result in gd->bd which is not yet allocated. Hence, this commit, which implements an optimised parser to read the memory blocks and store them in the .data section where they will survive relocation. We set ram_base and ram_size to describe the entire address space of memory, with the assumption that the last memory region is big enough for U-Boot, its DTB, and heap. On all boards tested so far this seems to be a reasonable assumption. As a nice side effect, our fdt parsing also winds up being faster since we avoid the overhead of checking address/size-cells or populating struct resource. We can safely make these optimisations since we only support ARM64, and trust the reg property to be populated correctly. After relocation, we then populate gd->bd->bi_dram with the data we parsed earlier. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 93 ++++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 2881de28a0a3..8947cf913dff 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -37,11 +37,20 @@ DECLARE_GLOBAL_DATA_PTR; static struct mm_region rbx_mem_map[CONFIG_NR_DRAM_BANKS + 2] = { { 0 } }; struct mm_region *mem_map = rbx_mem_map; +static struct { + phys_addr_t start; + phys_size_t size; +} prevbl_ddr_banks[CONFIG_NR_DRAM_BANKS] __section(".data") = { 0 }; + int dram_init(void) { - return fdtdec_setup_mem_size_base(); + /* + * gd->ram_base / ram_size have been setup already + * in qcom_parse_memory(). + */ + return 0; } static int ddr_bank_cmp(const void *v1, const void *v2) { @@ -57,25 +66,73 @@ static int ddr_bank_cmp(const void *v1, const void *v2) return (res1->start >> 24) - (res2->start >> 24); } +/* This has to be done post-relocation since gd->bd isn't preserved */ +static void qcom_configure_bi_dram(void) +{ + int i; + + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { + gd->bd->bi_dram[i].start = prevbl_ddr_banks[i].start; + gd->bd->bi_dram[i].size = prevbl_ddr_banks[i].size; + } +} + int dram_init_banksize(void) { - int ret; - - ret = fdtdec_setup_memory_banksize(); - if (ret < 0) - return ret; - - if (CONFIG_NR_DRAM_BANKS < 2) - return 0; - - /* Sort our RAM banks -_- */ - qsort(gd->bd->bi_dram, CONFIG_NR_DRAM_BANKS, sizeof(gd->bd->bi_dram[0]), ddr_bank_cmp); + qcom_configure_bi_dram(); return 0; } +static void qcom_parse_memory(void) +{ + ofnode node; + const fdt64_t *memory; + int memsize; + phys_addr_t ram_end = 0; + int i, j, banks; + + node = ofnode_path("/memory"); + if (!ofnode_valid(node)) { + log_err("No memory node found in device tree!\n"); + return; + } + memory = ofnode_read_prop(node, "reg", &memsize); + if (!memory) { + log_err("No memory configuration was provided by the previous bootloader!\n"); + return; + } + + banks = min(memsize / (2 * sizeof(u64)), (ulong)CONFIG_NR_DRAM_BANKS); + + if (memsize / sizeof(u64) > CONFIG_NR_DRAM_BANKS * 2) + log_err("Provided more than the max of %d memory banks\n", CONFIG_NR_DRAM_BANKS); + + if (banks > CONFIG_NR_DRAM_BANKS) + log_err("Provided more memory banks than we can handle\n"); + + for (i = 0, j = 0; i < banks * 2; i += 2, j++) { + prevbl_ddr_banks[j].start = get_unaligned_be64(&memory[i]); + prevbl_ddr_banks[j].size = get_unaligned_be64(&memory[i + 1]); + /* SM8650 boards sometimes have empty regions! */ + if (!prevbl_ddr_banks[j].size) { + j--; + continue; + } + ram_end = max(ram_end, prevbl_ddr_banks[j].start + prevbl_ddr_banks[j].size); + } + + /* Sort our RAM banks -_- */ + qsort(prevbl_ddr_banks, banks, sizeof(prevbl_ddr_banks[0]), ddr_bank_cmp); + + gd->ram_base = prevbl_ddr_banks[0].start; + gd->ram_size = ram_end - gd->ram_base; + debug("ram_base = %#011lx, ram_size = %#011llx, ram_end = %#011llx\n", + gd->ram_base, gd->ram_size, ram_end); +} + static void show_psci_version(void) { struct arm_smccc_res res; @@ -109,13 +166,21 @@ void *board_fdt_blob_setup(int *err) (phys_addr_t)fdt); if (internal_valid) { debug("Using built in FDT\n"); - return (void *)gd->fdt_blob; } else { debug("Using external FDT\n"); - return (void *)fdt; + /* So we can use it before returning */ + gd->fdt_blob = fdt; } + + /* + * Parse the /memory node while we're here, + * this makes it easy to do other things early. + */ + qcom_parse_memory(); + + return (void *)gd->fdt_blob; } void reset_cpu(void) { From patchwork Thu Aug 8 23:59:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817913 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74448wrv; Thu, 8 Aug 2024 17:00:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUvUNiFJ0dk5vys+gtbC3xqRGmi/KWMlbgfPrBRU4Th0ZJNHHEsVAugqq8OsIN5MxJb4d+eikd3lK+wcimZ2kY1 X-Google-Smtp-Source: AGHT+IHm0VszqxZhW2GKzVTSD4wksfpevT21vjffOJAHZAHOssmCvVhAc1gzxobXIw0EFWnTbYQM X-Received: by 2002:a05:6512:33cc:b0:52e:934c:8e76 with SMTP id 2adb3069b0e04-530e58764fbmr2396438e87.41.1723161613742; Thu, 08 Aug 2024 17:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161613; cv=none; d=google.com; s=arc-20160816; b=wec7204sHa/IONHHmwfpy03Hj9ZqD271Zsk96J2Bmo0InujKx0Nog42eh1E9DKUt4Z JGP17QAB4kjKvx371X0uxs95b01gqq1iYoNJpcfzBG28aXRAP5wyoHSZxubiSWpXw/zD GYC+rBu92p+shQgB0eRsOe0hX/6GGfH98paF4EDoS3sWlEmmmUZ3aHlZWn3cUkx4FM9W NG2LUB821DvQpmVFiQ4bBtpNy+kqleyaP7ioToeSOQattnf4+9zxRnknTY2uWA3u82FV /MvcpFIunTUTysbvw7MdmdTFr1YCZQFlc0xMNUjnD9Qdr1O59qsg7bQWuHqNwiApUNgU LOVg== 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=T2jxdT5TJqlzYD4qhi6mySWaYqGibrqoaMU+j+BJxIE=; fh=hJ+wzm3FeYgVl7e5B9Zv8FdnIWI9syJKVj221cqf3wg=; b=w5BOKl8VEwEergooDaoT2ps+fOhthoscc71jVeaTeutAlKM2kcEwMm4HeX9z0t9CuR wfqt9YBhnrPyleDNzaCMyZ8Hs+b39rKfBbxT2HZeOMOzEXdjz31eyOswoMNrZiQZpjuV PtGAyGqaUUdUE3rG66/J5orNgSy9rvqRtSB/1UluV8xJm0cnLsKX6wB3l36tptYWUhwE cE2cNqvuYNn+yFr9KASmTNvmUTdOj9vLzoKVZ+uKKth4kXWqby7dOrSd2WUF7aYmZZLo DJrKVesbemjuCnDbbRMzVVNARAtdhj/E8fFHbqIp8VW3pOHloby1uHQKQoZ5+4SJ9pOq 8PNg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQ1lp092; 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 a640c23a62f3a-a7dc9bd219esi871946866b.76.2024.08.08.17.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:00:13 -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=SQ1lp092; 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 DA04688B99; Fri, 9 Aug 2024 01:59:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="SQ1lp092"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7455A88B86; Fri, 9 Aug 2024 01:59:43 +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-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) (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 7DA8088A2F for ; Fri, 9 Aug 2024 01:59:41 +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-lf1-x129.google.com with SMTP id 2adb3069b0e04-52f0277daa5so2090817e87.0 for ; Thu, 08 Aug 2024 16:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161581; x=1723766381; 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=T2jxdT5TJqlzYD4qhi6mySWaYqGibrqoaMU+j+BJxIE=; b=SQ1lp092VvcsqYDp7/hrEZGRoMd+qhDcOMl0qSPZ7+n1QJAsssOdu/UC7jZGaIXQYU pZHAXC9v7PjbvrruytXaY8pUXiQBuks/wakaNeJLkoqTFt+BVLYQMu79/iuge5NK3VUi /UXsIMlQt40HpGEUxNqQmVtZqC7z9jgkEiXK3sqdZyDr9kmXFrhPYTUW8DabnLTa9Y7G ZLhopGm2dCRezivkNdfI7bJBoiAq9Dnwk0h5W6baMLLtMwl2BPV23Kz0jrXryj9MXD8D FMjGAzLqojhcE5ORE5ankZX/YO7dzMFC/81LeJ0UqOA9CZ9Gs5DHPzc6UUltjSAtHHi7 YAgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161581; x=1723766381; 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=T2jxdT5TJqlzYD4qhi6mySWaYqGibrqoaMU+j+BJxIE=; b=GR/MrIN51b+YN9fepE6I3JX9+i+b9G2inNZZRmI6GgRK9snyjkJTaF2D1D2ZzJIHeI xObQP7h9yW46OTqV3oQ/+32VqVYAn+fr0BYE2KoAQYg4rqPQX5FGwmYS5YxFB2N3bIqC d1GLsmEo1p1N6W5lzJOoYHiehld8zIJ8ZEhtgbWPY/h3UBTVqCOrDzAmvB7ub2+to6j3 RGIKFoT283oRb6PmUXqMnXnChWCj27azQ52TMpXlJJMUIEdjAfqORHfpZMu3eAGxPnRl zUgfREMjN2pRFZbJDSnnQXf21oCveKD7Ny0xDFa+BC4uTH7990oCQ52+58W7mJwVYIbN ++Ww== X-Forwarded-Encrypted: i=1; AJvYcCUYZnmlNKiFp3lRNYSaIZlSJXE4ynyizA1L6IHq1HW/x1arO5RmcqH23h5FOjiDFnm1LmVzD8IWP1676lFVGAfTrtPAqw== X-Gm-Message-State: AOJu0Yzcp1a1h3/KYJivr7M4IKkDTqltWXTQV50RNUtQh6XbXw48ATsZ 3IzRklU56eMKdoRWLKRzq/gXsAB+NvhecWaxDbJDLPGpp2KEweHXDMBipCkxHKQ= X-Received: by 2002:a05:6512:124f:b0:52e:7f09:aaae with SMTP id 2adb3069b0e04-530e583c51fmr2280017e87.27.1723161580691; Thu, 08 Aug 2024 16:59:40 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:40 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:26 +0200 Subject: [PATCH 03/11] mach-snapdragon: use 1MiB for get_page_table_size() MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-3-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=665; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=TJ5EUTi1DoAU1mw1jeKa69a8U2IgtUNZwwNOXmXlMYc=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvn81P/rvlkfDkwmqdoVfkmk/SkkfML8o+pN eFkbhUgfsmJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k tr06D/9wXi4/gN0PbseL/qKRK4rjzl4rxntpgzA23udmB16pmCFJxXApA43+A04MtgDRgmuXj3M aUNBG/fEBOWTLH12AVqR7KrEh8ah/kU8x6NYTSa3lXd025vy5OvMTsLd6PJK+GZB4MhcVLj+dwp Nxvhi5LQWqWnlJ0ruUDDxNZvJn3Yq35+12gR/xpNtlem6IJLkKJF4Mr5fXX7UiOjpXnzcjxzxtA CS2ERKzqZ9F7RwX9QJbHNoruPcfk0ju7LVPfcqU/9DFfWyqXLuPMMBZe1EOtgjeFOxvMnNY06te ujPBZZCABY+0tn0n8JVvvI0fXALcBhWeIG1S0CTc28CKkSgQE7wysXfUEsw4g6wR3+DVM97xcrV e1sEjMnS6DFfb5kqBqllvDLT4aB7NfSv9A93XNsIYrpO8GhHyDLtuQEqG3IqQhMtPq73CJsMoBs F9NJI9K/ccf6SFP6j1GQgVh0r7VNxDZb5GiofvQ2/2sf0+YT5v46mftw6l5h1kY1gWcSYdEUPRw pTEiKzyf0SuCqVw3kKaX70FjMgTrPDaos8iHj2nrxGJQar2+ZvOFPCbRvuMq71eF7mcKOADGvAm d/LYhHTlcUTwB2wb8zPd1/WmH9HB7rdPwK9O+0to7P8kZasoaLByg2hQKA67k0chDVktMB/YteF sogJBPLQK82LBSQ== 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 From: Neil Armstrong With 14+ entries in the memory map, we need quite a bit more space for the page tables. Signed-off-by: Neil Armstrong --- arch/arm/mach-snapdragon/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 8947cf913dff..0e8234a62b28 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -416,9 +416,9 @@ static void build_mem_map(void) } u64 get_page_table_size(void) { - return SZ_64K; + return SZ_1M; } static int fdt_cmp_res(const void *v1, const void *v2) { From patchwork Thu Aug 8 23:59:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817919 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74532wrv; Thu, 8 Aug 2024 17:00:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUcTcOu0znmrYQl+atofFcaZetIPzTwtoYLTsmXWPE3zGW6v9l/94lRpBIakUpMFCQTbCz30g==@linaro.org X-Google-Smtp-Source: AGHT+IGkhNwy8pJdxXqPe5OvqMTttN1aFnv8wPM2RVKR9mNNRIqpLukmJuoGZPFR6d6T+8/QyINf X-Received: by 2002:a17:907:7f20:b0:a77:cb7d:f356 with SMTP id a640c23a62f3a-a8090e41c42mr284909666b.51.1723161626166; Thu, 08 Aug 2024 17:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161626; cv=none; d=google.com; s=arc-20160816; b=ZtE5+AUXrSnCIsMWI7tO+G6wZpt8XMrJmcUoU2oCCYaYkKXrR34d6IxKdsBZfiio7Q LNwGZdae1SKe+uL2xfmP6rwE5flx6qHvmhdLonkiF49sJwEdfMrr0P8rAjYb6SAMLmwY +m3eoEuKG2yJN+NbGZ3ipv8zeDAiMbmuaS9JtGcPfvH4XRDTzn2nrAsmycTn3GwyLTiy pC616hIkkJuqcbA00Z7PJYL0dZ79c9HZPNPz2Rp+6FhYc2ujR0v/qwFwPe6fDJ7d9pDL UZb3ezcrczgC3NC3kbS4lXV6WyWinbgTx/PDnNzH+p66ZfsVyD7XAS3MFPklYgQC6iM2 1ZTQ== 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=bEI1hdBBKDi+4MatAn/dUEamBwISGLtYgDhR8T/D6ME=; fh=m0WzRrvIgdDPKkwIhVcKPpIRJcmaSA/cB4LK6nrU3a4=; b=QlyIn179G1FH8jC5llFODQf7ZVyg66nsmBkGRzeFpVWQW0TnlCbhZLP5XnMcn62Dm6 UI8hSowHt8MEL0R4MNl4NBmHOrhQKYW1d4l+zF4X10WeRQlbwYOZltzVkW+9F0MJUfiv 0BbO39G5e4/A3x5Oz03wcDUZ4bEcYreQgMD6/w9Ix+KlOZS5o1643j3D9mqla6SuGKz0 MiuNSzO8Ys4Cbi/GlMdgbI09rhsKuU4bdCDzgmWJwSbDq/ng9YksATlJIlWy6MK8Ko4J UMoJYdHLlQrvSLMegJXo119T/sMJNG0Py9Cw2w2BpboIOdJpwoWEoJaYiZYJke24NmRs 5uSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TkZYdGkR; 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 a640c23a62f3a-a7dc9f2b10csi885092366b.832.2024.08.08.17.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:00: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=TkZYdGkR; 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 52A51887E6; Fri, 9 Aug 2024 01:59:46 +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="TkZYdGkR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5893A887E6; Fri, 9 Aug 2024 01:59:44 +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-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 5824188B63 for ; Fri, 9 Aug 2024 01:59:42 +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-ej1-x631.google.com with SMTP id a640c23a62f3a-a7a9a369055so147650166b.3 for ; Thu, 08 Aug 2024 16:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161582; x=1723766382; 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=bEI1hdBBKDi+4MatAn/dUEamBwISGLtYgDhR8T/D6ME=; b=TkZYdGkRvmVcCuxiKspfAm6k1V79iFK0AY6UQS2M/z1KKPnqR4YZFDDeke5Zc4YTwn Gvs6+8FL1cFpGIELdCo7bFMqcM7LrqAK6y5NFxGNeuehhKNKLP0zVPQgdK92BPEgYcKJ S/iSLiyAj1ehVcwMhhdwNj9OFnx53DBl81Hw8+16n6ngb+D1h6kmXVq1bRFpzpYniEWX vp589O/RqT7pVE+aDJ7uG9ShawszAsWbTGhhZw7+zhbR2o57Ct2houMkjW4u02VOBemM X6IBO5MUKK95NxGzFs/KPvKR1APYww6r6C74lPD8khI6/NUnAlRSzm7rGFAzSnTqnC2G X8DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161582; x=1723766382; 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=bEI1hdBBKDi+4MatAn/dUEamBwISGLtYgDhR8T/D6ME=; b=s6sx1xAvIM+L4sU5DYGGTSHAPtX307ESX1+TtzC0Hfseowsstj3NytNKWFEBvrTg3R AtNPrmYEgZ2lBuBRR/EncIiI1iG7pXsSFzRg5XeAAkBenIr/d16qDO0lMjUMfbenR2kL mUWQyrtSKTkJJC2SEVzbdRdRDgOxS1DCFfGNXdyqcpKpC6Pi33KODE9TrI5niHrLDbWq d9AOh/BMlm6zhmF8MaNC3vBPQj39lFyFweHTYn5qB7Vmk2Tu4uWZK7hkDRuquz9KgLa2 fSqdLIXI1AJsH7EdqK8/8Bx/Z2pPkQhs1WHQtbNPkczCytjsHvXJIWADvakkYPGGKLoB W06Q== X-Forwarded-Encrypted: i=1; AJvYcCXUqKWn04CP7iUFPt2jSW4j9PiUp0zruwyTVrRnSkEICU1Z+p4Ny/FCgpLFmUWTh4gkyDU3A6Y=@lists.denx.de X-Gm-Message-State: AOJu0YzuTqX8b+wJfOsubX083v7Jwm5R+7ewTjTF568H5zSH+INrVQcH cPDJxvK+0mWfNNQrwKGhyU7UzKFju49Tkm5RCHoLw/cUU09Zjt9c1FtSl0VMZdM= X-Received: by 2002:a17:906:bc21:b0:a7a:9d1e:3b25 with SMTP id a640c23a62f3a-a8090d914c0mr243104066b.30.1723161581685; Thu, 08 Aug 2024 16:59:41 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:41 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:27 +0200 Subject: [PATCH 04/11] mach-snapdragon: set serial number MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-4-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=2518; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=yVYnfDMvE8yc0UL37TJQeHQnigVoARCzVu/AFvgzM+I=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvnsQ06RuZ6+DvV5fOdN7N/V7tMOFxxiJbLO 5RgoyeMLJqJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k thbVEACd5pMVQBXIxJYTJRSBmjWN1UwoT6efGh/roD0sqeyTcBqlSRdd6FMhk9aSp9EnhnQ/X/l sksZvaP33XgnLWf9toZCvbi6NlxhbdBXNS5vM/7BXSEECziTmPtpd/ajka3DAA8LQkHXeDTsHxa 30EozmWKMnUfurTpZ4XIhAtySnTFL9hb9E5fF0n4V2lG7mn3U6eWm7LGXh/isY/7hFkDAGEyYQJ 3NLNwSbKtWvhYYN8OsuC/7y/1ikQnvrelWGZ75YI3aq9EzZ0P8jrbDZBvkWQXc19w420Pl8sIDG I8GapWn0F3CoG15qIjm/RioNp2w/w/0eX1FYpR2eCTNI8hiN4vIjrH4AKm/1ssuJAf0PZJYquev xKQo0J3tt1PXC4Aw6ltjVRl4tezZuYmoL1mI52NOjq1oGsYKT/p09+l7IIE5ggm59CC9um/JmGO kojbPI8pol8+KocAThN4xoU8F9ZQmQJWdIrOdUIqpvdzw04JcGUfXxtPqYp2kNLsaZVUX6EmUAh dutvsZAjAJ4NXXXJpZJRm3+VU7Fipri2B7pUFEQmVczEAcoi/8kQCXPhKSnUQ3O9YnrxfDlPAm6 nl2U9JLnphtRwUTboi5uqqC7J6uwVgR7TPIDBmHfHB8RLcFyRjTEhjCo9WwTpRkCYpfBModP8nZ j0aQrZVy/HwLHRQ== 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 In the typical case where we chainload from ABL, the serial number is available in the DT bootargs. Read it out and set the serial# environment variable so that it can be used by fastboot. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 62 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 0e8234a62b28..36335627f4ff 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -243,8 +243,68 @@ int board_init(void) qcom_board_init(); return 0; } +/** + * out_len includes the trailing null space + */ +static int get_cmdline_option(const char *cmdline, const char *key, char *out, int out_len) +{ + const char *p, *p_end; + int len; + + p = strstr(cmdline, key); + if (!p) + return -ENOENT; + + p += strlen(key); + p_end = strstr(p, " "); + if (!p_end) + return -ENOENT; + + len = p_end - p; + if (len > out_len) + len = out_len; + + strncpy(out, p, len); + out[len] = '\0'; + + return 0; +} + +/* The bootargs are populated by the previous stage bootloader */ +static const char *get_cmdline(void) +{ + ofnode node; + static const char *cmdline = NULL; + + if (cmdline) + return cmdline; + + node = ofnode_path("/chosen"); + if (!ofnode_valid(node)) + return NULL; + + cmdline = ofnode_read_string(node, "bootargs"); + + return cmdline; +} + +void qcom_set_serialno(void) +{ + const char *cmdline = get_cmdline(); + char serial[32]; + + if (!cmdline) { + log_debug("Failed to get bootargs\n"); + return; + } + + get_cmdline_option(cmdline, "androidboot.serialno=", serial, sizeof(serial)); + if (serial[0] != '\0') + env_set("serial#", serial); +} + /* Sets up the "board", and "soc" environment variables as well as constructing the devicetree * path, with a few quirks to handle non-standard dtb filenames. This is not meant to be a * comprehensive solution to automatically picking the DTB, but aims to be correct for the * majority case. For most devices it should be possible to make this algorithm work by @@ -341,8 +401,10 @@ static void configure_env(void) /* Now build the full path name */ snprintf(dt_path, sizeof(dt_path), "qcom/%s-%s.dtb", env_get("soc"), env_get("board")); env_set("fdtfile", dt_path); + + qcom_set_serialno(); } void __weak qcom_late_init(void) { From patchwork Thu Aug 8 23:59:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817920 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74631wrv; Thu, 8 Aug 2024 17:00:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhEyZQR/ZYnHFwAEZ4kuyjja7j8AzBwSibpu8F1h/mqEKEwaHksVXi6z6FMHsqLxb38G0Q1UsN8nPIUDvkrkBM X-Google-Smtp-Source: AGHT+IFI7ATeQC90CyzTq2uAK2pHB+TVAuJ3uu2wqIP1XYmifb3DDBBjvmjP8yb93YtValqLPTW2 X-Received: by 2002:a05:6402:13d2:b0:5a2:2ecc:2f0 with SMTP id 4fb4d7f45d1cf-5bbb21f4b64mr3002988a12.1.1723161638925; Thu, 08 Aug 2024 17:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161638; cv=none; d=google.com; s=arc-20160816; b=KaIKbA9kgltAAq8Gp3KXv46iK6f8II/1/fR3a3CD46YDn15pSWTU/Id5HdDRvJlGOU 5Mpp54Ch815mqTdBYE0M7Ge2Xi7XZSRuUPHwmFPp5coPzOt53hNeBdjyiKoUmG+8mQRh pmttjRzznxEzQwqeiTWo2IivVJH3IYVKpYuaJeC7TTGmXT+kBLyN63RtqqzTY12StYCN 67NxvvDX5ONoVzWZfXleZ706PGFn/k0ksjVs5Ly869DvoFVom9bH3AzHLupJ6di6cfrj IWp1L3VLCrgC9+5VStu19vNQJnipjPdONlOiWF9t4G/O3qD2eVlsjTH2Nd6JSHCUPMCP RNmQ== 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=jkesOsPwyP4uWMXO4nnoUtJ7UJX/bGz56xyNc2GQDEc=; fh=Us+ITUfmjfWbl3vCggedOUDXLsrY7TtJQj7ag3ozXt8=; b=uyGeht/zo06jDTd76sNdny7u9NEM+N9K4k2ea7206NsiOKXssbtbNmT+sawsqi30tj k+bcuS6DdpPR3Ui6O6mBetO6MfzDZgNHDLN6HkRkG0orb7z5JveyDs07oU7YydTE6G/M 62eeBng2BdEnq9wRGxGmuOQ9sPmPf7LVZrd21y/JXdC5RmYDaDo4mlcPnBg83DTgXdkm H1pj8M2VeqeMlu8QbnowfcQFdatbWRu7MuCW9vdF3lHWwYuy2HkOEQoN3n02WL5eb9Rz g5SP5Ugq2M5iNXGRl28Kbek2Zq9kq/Evb67KGzSaMKBAQMJnfPb2SvfnEDYZaQrwGZyN B+eg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DFCi6Hok; 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 4fb4d7f45d1cf-5bbb85069dbsi815167a12.290.2024.08.08.17.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:00:38 -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=DFCi6Hok; 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 C17C188B9B; Fri, 9 Aug 2024 01:59:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="DFCi6Hok"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44F7288A44; Fri, 9 Aug 2024 01:59:45 +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-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 59EF387A09 for ; Fri, 9 Aug 2024 01:59:43 +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-ej1-x629.google.com with SMTP id a640c23a62f3a-a7a8e73b29cso160112766b.3 for ; Thu, 08 Aug 2024 16:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161583; x=1723766383; 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=jkesOsPwyP4uWMXO4nnoUtJ7UJX/bGz56xyNc2GQDEc=; b=DFCi6HokQXGTh+RuTXcq7zD/L1vf+wVC/ytjubni8nwMS7CzwnEgqcj+si2TI85uzM 5OVK9wz2gQz2+putaGXzgbwD1pE4mjVN4xE0RwSyvtN/RQUKeuymYIl2+iqEaTPouVPb dtoelYEJ66TFva+SZa81PIRPdv3Vn2L747nNVosZEsEmzUS1nCqTqJPn6AJZUCtW2Lb2 yo2BnPDcmXNOSpV3VPFBHWnlHu8B3yt+GbAS9pkEaUcP3hHHu4FftdtfLkwGSNjclFtR BSt0G+4QPl5TB4roo54xI4z7dDTQbLKhlItoKmlrX6Vi1lPFy0/ddTzDJQ1icBXWvfnN hZzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161583; x=1723766383; 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=jkesOsPwyP4uWMXO4nnoUtJ7UJX/bGz56xyNc2GQDEc=; b=kGHGPYAIbWVKjqA01CpKZsJKCxnVTeG84zfQQFSc9skmR4h0oqtbPFoqXK4EJsBLlc uIavo/7fVBjhhYrorMg1Ye3X2WYCNCUcG0asoS8Rqig26qGFXAknGoRoR4mm2lRTo0Yx b5xUqjkvcBafPjyuS++5HBoyi2befNUOAaKs5Uy9FH32lL8jO8/x26B1QACuZzHwDSp2 5D88g3gz/k+zUpj22LkZd+Pe6OuGBnYkazgtuy77VnNNPNHc6ODGDVk6tc4+2TyqV5o2 UgtC/TQT2Q1TKf6+t13+wHfdtGsyIu6o9JOPGVs/HXgdbaPJ7Gi5+EaMnE3e2hXcANFk +VKg== X-Forwarded-Encrypted: i=1; AJvYcCUzKNSUUj16yR9GaUugAZRbivF+gMRc0ibXiQnlvsmUelSWQbHybtjOnMspkw5dSFBjiGuKLAS3JfQEcNE4cUyecn+XcA== X-Gm-Message-State: AOJu0YyOcJ3NITDxjyCJDTZgJ+Ppcd6ImzIKxhcY30bCIe3qTNC4tIRb i0xHuGOytb8JgDUp7Xg5tIo/rxY2WvG4uIHOx+S4mJukkJfCv9h8i3JSRYVR42JmDcK4y+w3Ot1 I X-Received: by 2002:a17:906:7943:b0:a79:fbf0:8106 with SMTP id a640c23a62f3a-a8090c32544mr284643866b.6.1723161582795; Thu, 08 Aug 2024 16:59:42 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:42 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:28 +0200 Subject: [PATCH 05/11] mach-snapdragon: allocate fastboot buffer dynamically MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-5-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=1488; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=QEEmnRtKXeaUbPt4b6LOBPWMVC6ST33UIa7LHVKtDzo=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvnqkkV18/QFmW5I+AnVBC1Hfhd9fIjcyAfJ SVBc3NEiGeJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k to6YD/4hTTKm5lHm1Demrpt1IemV0WvdPORjNm76h+x0eEqMnd9GmlD8RgYSJAdBnd/B0yZEGxk NAPtrntg0+9Ip/+h9v9uJDiBVqq6AnqNOfciQ9hkL0mIVeXUCF+BPMriJHe5ynUZb62ZJNhZpZ0 h+84E0iFgJU/WVyUrkFJJQK2+wFIOSjZBtOfb3I+z/NIlF/5e+PlIi7252zDgX2mbX4KzPinbTx GogI1/Usg73jR+eAzLq9pNCzWlhQILP/Q1vW0cjZNHVdd6NoaziBgQ2YHLd5mNk8RvOeIygerJf m7VGGxbnDqJtVHiavoA+a3s+RVMQ0BIFoArzCNIDY6E/68TPj7+s/c3RJ+FBC8kubh1HSJtrMLc iO4tgF/KPwZnrrg7qa9GekwwzAI/an4tU2qnQReT+FjhJ3VQv7jYa8ZSSWbBTtrAQ9Bz5SytI7h dDuf8WuJDXPBJp9jVHQ8ndfkdgBTp1r6e+ZDoSCWTE95zrhTAUNN9ChErnhYLlcMG+su5tkP0Z+ lGsCzXN7hAMKd/OvRpxX42VsNti3kD8IjzAmQp/JtXv8vTcIX3577xppUmkbrnHlX348etgFY2I 4W/lqkBa4Y6etukBv3kskHJ568Dl15M2dwYFC5dQ2jK52/K3f0abCoFZ3Yk1QhmeTbuGpdXD6HM 4GiJh1lo6lTRFgg== 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 We don't know at build time where a sensible place for this is, allocate it at runtime like the other variables. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 36335627f4ff..37925c40f36f 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -410,8 +410,13 @@ void __weak qcom_late_init(void) { } #define KERNEL_COMP_SIZE SZ_64M +#ifdef CONFIG_FASTBOOT_BUF_SIZE +#define FASTBOOT_BUF_SIZE CONFIG_FASTBOOT_BUF_SIZE +#else +#define FASTBOOT_BUF_SIZE 0 +#endif #define addr_alloc(lmb, size) lmb_alloc(lmb, size, SZ_2M) /* Stolen from arch/arm/mach-apple/board.c */ @@ -426,8 +431,10 @@ int board_late_init(void) status |= env_set_hex("kernel_addr_r", addr_alloc(&lmb, SZ_128M)); status |= env_set_hex("ramdisk_addr_r", addr_alloc(&lmb, SZ_128M)); status |= env_set_hex("kernel_comp_addr_r", addr_alloc(&lmb, KERNEL_COMP_SIZE)); status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE); + if (IS_ENABLED(CONFIG_FASTBOOT)) + status |= env_set_hex("fastboot_addr_r", addr_alloc(&lmb, FASTBOOT_BUF_SIZE)); status |= env_set_hex("scriptaddr", addr_alloc(&lmb, SZ_4M)); status |= env_set_hex("pxefile_addr_r", addr_alloc(&lmb, SZ_4M)); status |= env_set_hex("fdt_addr_r", addr_alloc(&lmb, SZ_2M)); From patchwork Thu Aug 8 23:59:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817921 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74752wrv; Thu, 8 Aug 2024 17:00:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVQbN67LHwKkQM2DoT3hR088gu8l26FkmMSGsDcc7Jm6uiCjMmm0VCJhzjdjBKVLqpgNP21iA==@linaro.org X-Google-Smtp-Source: AGHT+IEscv8Q365ePsK5myQV5Ws/K/mYReUjbXzr/Oe8nq/u9zPAzFIzEJVEX66CP0SoJIUb/4su X-Received: by 2002:a05:6402:3547:b0:5a2:eeeb:9470 with SMTP id 4fb4d7f45d1cf-5bbb21d7018mr2123162a12.18.1723161652551; Thu, 08 Aug 2024 17:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161652; cv=none; d=google.com; s=arc-20160816; b=ROXLhEEB2Vk0pmZo2UmxCAFBHlE5/DlcpRZuRfBUOBiDifec2gJg96IUPgB7k42g+u zn5+t3KW3loJvP4dR2bvw9neL/fAo4Unjep4mTCB8IMKCH1R8VbI/C2UfIOGdIoDS3tO 6q8vmtGtyP0werBiLvSs9dW9uvDs/fvX5yfezkh6zXGRL6G4bz8/ER1fGAY9GffFgGOx x9e5haoZ7pRAFqTdnDVrPdr+Wg9islhdB1dQycn5v2UKIpZTrHng8wf6nWZ4sQmhR2Wj PxEltYGZCuVGjz3uKQb/O7ftRg5NfXQm0W1WjVy+KgoApwICin/RLTDD+ZCsqq6HtMhK nLAA== 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=3G9RhTpI8+/3NayuP0N2elh0qwR/6mBQ4VCSAEH8Kz0=; fh=DHL2wbB9EVfoC57A8eiou9PaiRSmw/d+WwZCT85UT44=; b=vgY782VZoUtnG5v1yCjAvueiKVmoDJDMD04SXq2xCwd0OhcK7ugnm3idv3Zo4SEKnV 7/5/hZscQ4B5w2/Tp+QDjj23h715vVN7Kn+AZ2bB5bnmuphqrPGJbn0H57eG+WL+pFog /G+rsnOaY4i4okEINvckswqc1jXxviUtAhJl6/RCMUBm2PWlHxCeuAPyJcLteRsvfmeY cnMqUeeNs9Hw3HFthxJvdGSQnBn2MX5mj5PDPNDY6K5WwS8HLp8Y/IG4IH+iHpb1Ew/4 Bv6YQRChBCUogOGrhg0ZiFvm/lfnTGops4Y9gulMdoayyE4VY5zFmP1Rx/OQGb2ML1yz Qt+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KDyyJfZz; 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 4fb4d7f45d1cf-5bbb2d299c5si1392403a12.458.2024.08.08.17.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:00:52 -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=KDyyJfZz; 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 3A25688BCB; Fri, 9 Aug 2024 01:59:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KDyyJfZz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F35788BC1; Fri, 9 Aug 2024 01:59:46 +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-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (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 660A888A2F for ; Fri, 9 Aug 2024 01:59:44 +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-ej1-x631.google.com with SMTP id a640c23a62f3a-a728f74c23dso172278666b.1 for ; Thu, 08 Aug 2024 16:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161584; x=1723766384; 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=3G9RhTpI8+/3NayuP0N2elh0qwR/6mBQ4VCSAEH8Kz0=; b=KDyyJfZzo3RTKfmwRFixePsxIMRnITdSr6hRYGSQr9r+cYtxHTxzZEfRzdhquFcRYH YOvRYurm0flmV4A5qfGFbJuApNEJdiAuP8qQRbfCVKNn6L/UxWROREP3MDwiy/VD50ms dU1SMBRYmJrT1w98i2EckCC+zNlGeLTD6e9DdbKFaUI2Zu39KmZCRFFkww5WVR/CtM4a WNCc9EK8wwyC+t3P8kcm44WGuPwNQT0Fhx1r9i0hadMrXBSJ8a/UyuzFU2HFPhxMBK+G 11+CqPBRM8OvliFGLtrGMNr3TerNfW35h9m9C+MqtGkgZL8VcszNuErN7S5KF9pzKznC 9Wrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161584; x=1723766384; 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=3G9RhTpI8+/3NayuP0N2elh0qwR/6mBQ4VCSAEH8Kz0=; b=ShIUO7YiouRsYeOeAhaMyNpzzjt/Qx4p0O1bnz/WOOEruYmLKe+iZwElbq4SUv2m1u /Ny3haL4Qm4tA2pVrrLhgCnYUxYgdjK4dUJ0I28EaX1eUUzPdNTbDQiwfF8LV5nahDHo S1ZXE8pTtE2jKy27pRzr/geju4FcbrSt5sqCkxLpz9o9DUae9ZfNxlg5NaXE+gPD+0Hq xLCjZmwWm6WehBrC+ELIBByTZvEE360P2npDEY++M0rDF63Ui1lfd3KgOiEtgGIlCJqf Ifcjg7tPIQ/ygEDYfx/ji1oI53gFLT0IK7fH2K2p9nh3WnvaTu5MGF5oP8W/pRpk7y+u 5pyQ== X-Forwarded-Encrypted: i=1; AJvYcCXyhMjWKB1TSGzWsMthyTTjBn92JrtherdRnyaYirvG59NfReY5zEkmHq9lsDfOT45N7VIGIpc=@lists.denx.de X-Gm-Message-State: AOJu0YysFDxATFeeVeYSpQExPiT7pf68CAX6QFZpZAPXSJpF/XPI/PkZ 5AVzn2ILuy+FhuC8auXRYUqpVe4N/tqdXaTQWpyitGAF6C9dWL+PPINkdsLtDUo= X-Received: by 2002:a17:907:720a:b0:a7a:9a78:4b4e with SMTP id a640c23a62f3a-a8090d9684amr248712466b.40.1723161583766; Thu, 08 Aug 2024 16:59:43 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:43 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:29 +0200 Subject: [PATCH 06/11] mach-snapdragon: populate fallback FDT MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-6-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=1623; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=rg6FOSTIuaN7QQZlGRJ0L5q042tTeo5rq40zvWz8PBE=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvnzLpIzvVAgOqLAMcULso3v/l5UEUOs734y v6wpWR0AhmJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb5wAKCRAFgzErGV9k toswEACk74v98PLIW22JoOOoMB0M0QCQRL+jRBXVgdPw/LvTMae5gFQoMlx38KWf3PiBx4C57Y2 RJ67NpYRP5XYhaaAQonArmUikyDFj6KHcNB1SZIf/THDe51aS8LwUbk1Sx7VZ7S2JTMPwHmdbMG HSOxFG5UNpdFabY/x4jwNxEytHW55Ackr5iNMonMS5gQTLtRTXKtDRP8so+JkHXcYOtxqgnqtlw NcJg1v4XuO8cF8gyp+yEvUWx8z6s/l4JtqpdB/836fo9LsVfEMlK0c9cck9EL8oVJhCdyCxOjXf AiJ+HV9U9/fRKBE+5m03zvO8mMf6X5mSY6F+PY2k/Qk6oqsFlOOAJQ4UqQ5zklvhyvi3bRocu1G XcCwaOz7aohr5bPhkX30GPAyrETSaD4yechkrfKkZRpyXRpQTJexafO502r3saXNpGgG+2EQkAJ Rn36rvgJJyHLiO4mgPxQaX0zPw0l4n3bGWqg+a7ul0uRjyhqdbCSv+QQ96r2E78BCkHSQFJUU49 D9v/k7I/JgqyTBjbExxtTRrY7sxT262CSWhMfz9FMB5i4A7Xv37yASf7dgmT1nzCQYYsQDyWdyb 36K2hXqu7ZHi0ycUV9UYblfYfauFbkRHeL3Dd3V8CkmJ2QF91Z0A49ViMZHJPhZ6tRZrMbSXnra +WU5r0kTNGhhCMA== 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 Set the fdt_addr_r environment variable to a region of LMB allocated memory, and populate it by default with a copy of U-Boots FDT. This will be used for Linux if no other DT is provided. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 37925c40f36f..8c0c7394698b 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -423,8 +423,9 @@ void __weak qcom_late_init(void) int board_late_init(void) { struct lmb lmb; u32 status = 0; + phys_addr_t fdt_addr; lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob); /* We need to be fairly conservative here as we support boards with just 1G of TOTAL RAM */ @@ -435,13 +436,17 @@ int board_late_init(void) if (IS_ENABLED(CONFIG_FASTBOOT)) status |= env_set_hex("fastboot_addr_r", addr_alloc(&lmb, FASTBOOT_BUF_SIZE)); status |= env_set_hex("scriptaddr", addr_alloc(&lmb, SZ_4M)); status |= env_set_hex("pxefile_addr_r", addr_alloc(&lmb, SZ_4M)); - status |= env_set_hex("fdt_addr_r", addr_alloc(&lmb, SZ_2M)); + fdt_addr = addr_alloc(&lmb, SZ_2M); + status |= env_set_hex("fdt_addr_r", fdt_addr); if (status) log_warning("%s: Failed to set run time variables\n", __func__); + /* By default copy U-Boots FDT, it will be used as a fallback */ + memcpy((void *)fdt_addr, (void *)gd->fdt_blob, gd->fdt_size); + configure_env(); qcom_late_init(); return 0; From patchwork Thu Aug 8 23:59:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817922 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74850wrv; Thu, 8 Aug 2024 17:01:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWD02Z/2tOWaiVRGYo5jGZfzR5G6LkqMTRoNbf6kFgE1fSsRHD8EBy+qhrYe3/LsRWVP+YYXIMGMf9/p/rJziZY X-Google-Smtp-Source: AGHT+IHtuE+v7sNJpNhu4M94trI7+DX7rt6DlGSXhjbVYdcUJcAUI7bzP5Uv46/BnzIyWHTsUNpU X-Received: by 2002:a05:6512:114b:b0:52c:dd3d:85af with SMTP id 2adb3069b0e04-530e583c11amr2285267e87.25.1723161665588; Thu, 08 Aug 2024 17:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161665; cv=none; d=google.com; s=arc-20160816; b=TZXkXWv0jVi2WaLjRWplZ2jdhxO/Bginael1JKqSStKlXBA/pM18h9KPIiaOuvWhpn bqSrIW6OQ0RFizXZqf0j2GLdD4GwSBNxZDOhONP7tMEvInNdqNwHYp4M6jwkt8rdcweK D11qeQWhdJ9FqYtCTPSuXht+SFfrAd3RGBUWS5GOTAluUkjY/GOfFIKY2sYVbqmWicuD bhsm/isxs624W8666EWrnvGarxDqKczwL7/GnfjS9R1YnBtPb7JMuRtF9/aXQ6+0QRWu BIlKwenEH1wsEn+6bEgalLifN+/dDumpybjoqeyT83XCWTF7uV+ZVNUePdVAlkgvYNpX V8wQ== 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=k0ESLrS1WTFOEAW/3y23+jWpZgNn4RlJc729y8exhfQ=; fh=7DHs+YVh6wAWbLx/pNKmKZQJUvhgJWKJwnqSkWk6k8g=; b=ObgrUesDqiu5x8wg3S3n4skcewBvGRhTlNhcpQGAYMFuyijHvwJZtJMxzL24uzSySH 3b01IJt95P7KZppDEQvvLRiNSpPUNTWD0Lf2Gc+spE4b+D5kgIo11PAJpvmDF7MbO4EP iAOO7pGoj+gScyCB4mwouS20Tqjg9AAq/9B7hR9aIbxivZaFDwVqn33SERw2DPjILF+w 8Ck23gE1F8sqdrXejCaffxsrPrJefrIVN92clduAsOHI5UuSOwrmZgj7IbzO/CB9DgPE OnS7ELCARhvv6ITWS3IgonwnqBrcBXsjQQIydcmKXhpANkmAsLax9eav84DC4FA2g8nC C4Rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w3uGD7Px; 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 a640c23a62f3a-a7dc9bd28f7si870200766b.98.2024.08.08.17.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:01:05 -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=w3uGD7Px; 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 A4F3288BBB; Fri, 9 Aug 2024 01:59:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="w3uGD7Px"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 521D588BC9; Fri, 9 Aug 2024 01:59:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 682CD87A09 for ; Fri, 9 Aug 2024 01:59:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a7ad02501c3so192569066b.2 for ; Thu, 08 Aug 2024 16:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161585; x=1723766385; 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=k0ESLrS1WTFOEAW/3y23+jWpZgNn4RlJc729y8exhfQ=; b=w3uGD7PxZBCNygIpWP0duflu5MuWs1OHcnDqy2bALODNGU6fz1mYiELdpd/6dcoxz9 ICUzifSLl9JJeDranJSphsCZ1NY5P6a8/J2EqcDULrVob8L1Y54J68/MOKfteIf6wjyI wztrpaOyh5j4IEBr0v3D3wNIrbM4kkP7Sc8/u1MNoXTglQH+y8x6sgMuNtfbsXPWALBW Q53N0eFdoQgPnRUy/Fc/Hv6cf9h3dRuYyJAt0ngI78etTU23wPdTldHgnHTgojLIiHCt cKrTpKZcnBDa9heK9NqhlNmF4OXplTM0059oP19eUDjT0BBY7q2thGYrlOTZNbtmc+Wq CnwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161585; x=1723766385; 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=k0ESLrS1WTFOEAW/3y23+jWpZgNn4RlJc729y8exhfQ=; b=Se+9MQmWCbwwEnnpAc6tJNrT5fQih91MmGa1QioH5QtxqFX2Aq84tkG0V7IYIKXUI1 tjk+LHPtw0Iv0MYf7s10eHPz95GPmsaUcuEIBeMmVTnvO9ZNg3OuhuE2WH4WIb/TdTkF ilWmuOAmB6/ZO52+3xkQ0y3cRQmjMDib7yhqC+64uSkgHsOR8vB0vZ+8rhCcC+5hRNHM JygKC87KXuuaFvqKvQen5eRb6nTCpVP+RYO+tzJ6Ja49aofV/M6cczUzE7rQFmYJDqO4 HFrzsdy9DW3hTkvh0o7/+DQxWzPlQ1dcA40AZdqYx/wZLKJGOyO5ZiOu6RShgjruALul voOA== X-Forwarded-Encrypted: i=1; AJvYcCX82WGag1HCIWeP1PfBDIybW1tw1Ch0WVP5mDF+FHkFgKnfMfXSKHhqVD6bIDeG1wq6LPAwi7o0F1Rg0IzHkcRojXMmbQ== X-Gm-Message-State: AOJu0Yy+YCEA9fFwHSdweP2mjw/DRTxL/9tPoefZGSmmDVza/DZOgehS GpKi6NgRKUY8TIyMTJdPodCJc6i6JH5tBLATuTHu28SmirUFEpDz7VClnHj5kP0= X-Received: by 2002:a17:907:ea1:b0:a75:2495:a6a3 with SMTP id a640c23a62f3a-a8090f03f38mr304491566b.67.1723161584803; Thu, 08 Aug 2024 16:59:44 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:44 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:30 +0200 Subject: [PATCH 07/11] mach-snapdragon: set loadaddr MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-7-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=1986; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=RYwtQiwDCsdlciqjR2RQjWC0/HwaN0JY5loErdjEXF8=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvohVNQmSQ2+FsGoKL2wCaLzEg6TIab3ezQV AcQX4xmMlGJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb6AAKCRAFgzErGV9k tvLKEACD569XhZCokm5e7nXIS1xZ2O8bN5SjE0+T4QcjdRGRVee9rQ70OQhs5XmFpkRW1wI/OaD Hp0JOH639WpNiUH/ipQRYv7HJxtXRAE+BEn1pDNQtal4uG08fP8wmmgGDSBxKNKDUm/9gDIQcE4 i6giY8jjvEjjgQUVtAeFAToJOocK2LAv4DAJI+okoHnh8gI1HAm8uqBJgZgJry+A+floh9m34+R z80HNXTXPI5cz2Ot1d/WuqLSNV36NNHMgaBn2x0l+yU5KFlN1s/F4vDtqXmiOWbzGflkpW5fTMB CeGaWwI7zpxc9eczc1QjCswibtoQOFk4adpL7wIDxbwzK44pOyaQTxEQNyfUidRQRwturDFFdEj xyejaNOs7Z5h0GRoFFhD9SH4U7mxGZS9/R8c1ZSYox/s/DiLa0bjUKBoy/AziPSiP70OrUX/l/K 8npXC+vmKKUXDmYib9cUiZiijO+91VSI7wBc3rhOaNl7XuXbOoRyudF57T4z/XRPOoHr1lITqHK 6oA58b/oEO9sxGvCXSaggwYYjVrJTaa46tKXXftZ266zMEKRBXvqUmo7vqQ5hR3LXJYJ+l+Dnyv fVXJlUGP6Jy3enbxRa9zs8SeRmusDbNT+w4NPUYCLGQMTg3OLgFwtZyBlMn+JMgJlVw/cQic310 HDfwrExyq87TMbA== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean This variable is used by default in some commands, set it to the same as kernel_addr_r. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/board.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 8c0c7394698b..43bff2c5e5f8 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -423,29 +423,31 @@ void __weak qcom_late_init(void) int board_late_init(void) { struct lmb lmb; u32 status = 0; - phys_addr_t fdt_addr; + phys_addr_t addr; lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob); /* We need to be fairly conservative here as we support boards with just 1G of TOTAL RAM */ - status |= env_set_hex("kernel_addr_r", addr_alloc(&lmb, SZ_128M)); + addr = addr_alloc(&lmb, SZ_128M); + status |= env_set_hex("kernel_addr_r", addr); + status |= env_set_hex("loadaddr", addr); status |= env_set_hex("ramdisk_addr_r", addr_alloc(&lmb, SZ_128M)); status |= env_set_hex("kernel_comp_addr_r", addr_alloc(&lmb, KERNEL_COMP_SIZE)); status |= env_set_hex("kernel_comp_size", KERNEL_COMP_SIZE); if (IS_ENABLED(CONFIG_FASTBOOT)) status |= env_set_hex("fastboot_addr_r", addr_alloc(&lmb, FASTBOOT_BUF_SIZE)); status |= env_set_hex("scriptaddr", addr_alloc(&lmb, SZ_4M)); status |= env_set_hex("pxefile_addr_r", addr_alloc(&lmb, SZ_4M)); - fdt_addr = addr_alloc(&lmb, SZ_2M); - status |= env_set_hex("fdt_addr_r", fdt_addr); + addr = addr_alloc(&lmb, SZ_2M); + status |= env_set_hex("fdt_addr_r", addr); if (status) log_warning("%s: Failed to set run time variables\n", __func__); /* By default copy U-Boots FDT, it will be used as a fallback */ - memcpy((void *)fdt_addr, (void *)gd->fdt_blob, gd->fdt_size); + memcpy((void *)addr, (void *)gd->fdt_blob, gd->fdt_size); configure_env(); qcom_late_init(); From patchwork Thu Aug 8 23:59:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817923 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp74938wrv; Thu, 8 Aug 2024 17:01:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXheMa3+ZthShusFTfA8UO5Px7JiXQMngyGDIt+e3CZBO//gZgl3PILMOWjkw3TR67q3qsfZatxdvQKtSUpm5Z X-Google-Smtp-Source: AGHT+IGHu5XKO61G2h8paOXO8s3DlkXqjk7K7ggkxvFVR72VuTLVngSlJkdztYwbrC5RnEjnlzta X-Received: by 2002:a17:907:9815:b0:a77:c26c:a571 with SMTP id a640c23a62f3a-a8090e63227mr246090866b.54.1723161678017; Thu, 08 Aug 2024 17:01:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161678; cv=none; d=google.com; s=arc-20160816; b=MTyeFS80J0SgGo1+RYxdWuxHaCybgKBNk9LUc5tMRgFMxGo6vSW8tnKoIAFydhxGmX Qot57R9+kscKJn8XjJuS+mbeJt0cRVbPqADfmUMYX/MHpeE9OqPFa17BFAAt2cDER9Wv 2ZhTl3ynmJUzPhv0+w2/DNcR8iYPLMUB0vEDZ9UoS4V0LD2AzInEDZ6rTthe2QEBXRP9 2R41cfPVNZgNd30vqD1AIDzc1CoxtCxPtUNN8FApVagBgTNnsNnA5V6rgDcSD3fPgaYv jzmqFsRYmPZmBgpLJiAQJUz1Mp7UKz7YHI6mKmrmD/F06tA2433475oaIoezn+fssPwl tO6w== 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=04osG1A9hoXMWl+0lh8GWl0YeWw+AupZfabTs31eXLM=; fh=+xIkKDx+Mmj0A6lXrJDcGMii5+Waxfn8UPzNwxEgjBE=; b=sFL/EQiMNy1VHFMjGwZ4XHlyIfkxHZUJGHy4gbWbCtuXWFiszMt+PtQ9E/LXkp9kPw K1Y9OlQGaNad7FNSloO/vQSsSoYw/V8b9Paa8RWO2bhBolPfl5fXNMAlBq1dfPDptbQp AmFFmhNoMCE6E2a8cUvAuAvJFlYBTZsB38QEE3s08m9gBxd3E4giUMZbBjAulrKCUiqK P0BN7KUuQHI6BCjov7LoFFuVyk01Fz4T4yHAlnOg7GWF/1HusYQnjDtOzeo1x4ar7L94 D93OaUuusg/PuDgiFeHtzopubspdO9+eLt8Pt0EC4ZwH4a2DMfb/5fNzU+mZSTu9uJ1D Z/hQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cWUMuMcn; 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 a640c23a62f3a-a7dc9eb47e1si868104866b.597.2024.08.08.17.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:01:17 -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=cWUMuMcn; 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 13C3588BCD; Fri, 9 Aug 2024 01:59:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cWUMuMcn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3CA6F88BB6; Fri, 9 Aug 2024 01:59:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 8126A88BC7 for ; Fri, 9 Aug 2024 01:59:46 +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-ej1-x636.google.com with SMTP id a640c23a62f3a-a6265d3ba8fso130412966b.0 for ; Thu, 08 Aug 2024 16:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161586; x=1723766386; 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=04osG1A9hoXMWl+0lh8GWl0YeWw+AupZfabTs31eXLM=; b=cWUMuMcngL8aERXu/MmC8TnPFor98udMMh6CSviDM+zpeOniyxfAzTcgUZCE03l5NN cAaOv3Evvzla2AdMcbofcai6Y5FsitJBbLwnl+om4ZCafQYt/NYrW44vY1Y3zWwhXl+q shTfwyJ/PcBuXpZaBj52GJYlNQMBTKFex3DDfypzfp+gFi6RyTsVZe65ZeyzYyjBu2Vv rbGUfOzLL21YO2W7USgSz8FGtA093sT8rp0c4TwJb7wNIPy4x5N5MVthUCNgLI6U0pC7 bpwKzAkqX1/vFElFRyD2W4btiV6bus83ImkIAOTY/OmAIflZ6/sA+j40CAKgLyQ/Ugm2 aeQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161586; x=1723766386; 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=04osG1A9hoXMWl+0lh8GWl0YeWw+AupZfabTs31eXLM=; b=VIyrtP9q/9eV+b4Jvktxsj44EeP/Xl0/m91B+c1uyJof6YFWqaeEqSMiMk/AHS2cGe jx78fIv3FhPPTJdgVhkj+R4wJqPJwqbmXDKaDLjbiMyVKK/cL7yYjaVnJUpGmN/FNyys fLnnqCiRD0M1WWwED+xRSNd1tFzy3MIh5W00n0ula4kDWQ7GsOz4b2L/jkLN/FQ5OIHA o7hPp7IHIvZoc06llLShyUQhAt6MkKIBo6Z+pxzsKCBN2jfhkDRHa35LpwxBSvqM0uzg FpTaEqf2Hi4/vM2/j1yX7QpYUNAU0brTwnH4AIlQt9jJXAajm7figGBBwWjq+BoM3cSW htfA== X-Forwarded-Encrypted: i=1; AJvYcCUCD6njiPTav9Pg0xsWWosBLCjzxOxRiHI+NU+bG4zWBqiLVYe0Iqfs/LOxxiyTQnY/d8Y5NsX0TkVCxLTHoQiXoeUVKA== X-Gm-Message-State: AOJu0YygQqzfpnZheqaVufqe3y1JANNtac3dI7FZF2WPCD2LJrBzsqHH qO1wGSJf2P5gzdNhNhmJ0X4OY7tL4L2vX+3pVLTMMAv4yYUI3MWvityjNKmB7KM= X-Received: by 2002:a17:907:7290:b0:a79:82c1:a5b2 with SMTP id a640c23a62f3a-a8090c26c00mr263458866b.9.1723161585896; Thu, 08 Aug 2024 16:59:45 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:45 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:31 +0200 Subject: [PATCH 08/11] armv8: mmu: add a way to map additional regions MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-8-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=2205; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=I+9ipfeNdEptTRnpJiTjsZesLVLKr+Y6p2Fs08UVmcU=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvobIeQbqh0IgzdDxxKb8j3yFwz0qz8tMg7y /Hpzc3wsxeJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb6AAKCRAFgzErGV9k tpRnD/9UXoG/5VVqClH6ewJQRSG++InweyM2SovAbUMqhzqPyPyLi1asUQOusORbhGg7wnYYxZ8 5wBWbWL3EKDTl+DlGrGUQq0c4tE3XAHbugyiVuH9ZCtDQFyT4GxOuyecKdrEgHp5vrJHGnKOm71 pqtiK0n4UG67jjnymmCfNDjdX2bmGi1YK2aVJQ87AqTZi/q95oq+KFyStux3imaVfCAefjnwKwG E5il1eoJewzvq4UAatIy7SacErQsSeT5lYbY5RSR1E7EZKzvmALodNaRAq78NE97uOCzFaxiSBB C7XWWWQvUE8iRo5gkJD9sne9DeOGo2xgTq3RHJZ4WSGByyNbIB38uORlN5xJBOeWRo5GBKFZ1IG CXv7qQfgRWLYUmMLI2z1zuSwjxr1qnI6WmKf3gLbCT7v/OM9zVohzFIm2BsG2/tkX3iLUJ9pfH1 2AmliBy8BJw6eo2PcrYbl8MoBnjPmMxOIksX96h5+hCcMt2LuZ1sZHn3yAIoaEWbq9L8S108LVw Xu7Ss268wuW2pEghDtw1rMq+LnrJBBWZtwZo3dXnFIRt6z6q9x1YDyPFs2IQ8Qtt550lDWLwDxi CuBJ795g5mLaLcfAHrYeJfABvfDIT9ISCF2IamVRBN2Kz3qJOKgy1bLMD5kxLYrrIQ1bqHKlc9s d+oM/55l8KObLMA== 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 In some cases we might want to map some memory region after enabling caches. Introduce a new helper for this. Signed-off-by: Caleb Connolly --- arch/arm/cpu/armv8/cache_v8.c | 25 +++++++++++++++++++++++++ arch/arm/include/asm/system.h | 10 ++++++++++ 2 files changed, 35 insertions(+) diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c index c3f8dac648ba..631d9efa5e10 100644 --- a/arch/arm/cpu/armv8/cache_v8.c +++ b/arch/arm/cpu/armv8/cache_v8.c @@ -338,8 +338,33 @@ static void map_range(u64 virt, u64 phys, u64 size, int level, size -= next_size; } } +void mmu_map_region(phys_addr_t addr, u64 size, bool emergency) +{ + u64 va_bits; + int level = 0; + u64 attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE; + + attrs |= PTE_TYPE_BLOCK | PTE_BLOCK_AF; + + get_tcr(NULL, &va_bits); + if (va_bits < 39) + level = 1; + + if (emergency) + map_range(addr, addr, size, level, + (u64 *)gd->arch.tlb_emerg, attrs); + + /* Switch pagetables while we update the primary one */ + __asm_switch_ttbr(gd->arch.tlb_emerg); + + map_range(addr, addr, size, level, + (u64 *)gd->arch.tlb_addr, attrs); + + __asm_switch_ttbr(gd->arch.tlb_addr); +} + static void add_map(struct mm_region *map) { u64 attrs = map->attrs | PTE_TYPE_BLOCK | PTE_BLOCK_AF; u64 va_bits; diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 7e30cac32a09..2237d7d00668 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -276,8 +276,18 @@ void wait_for_wakeup(void); void protect_secure_region(void); void smp_kick_all_cpus(void); void flush_l3_cache(void); + +/** + * mmu_map_region() - map a region of previously unmapped memory. + * Will be mapped MT_NORMAL & PTE_BLOCK_INNER_SHARE. + * + * @start: Start address of the region + * @size: Size of the region + * @emerg: Also map the region in the emergency table + */ +void mmu_map_region(phys_addr_t start, u64 size, bool emerg); void mmu_change_region_attr(phys_addr_t start, size_t size, u64 attrs); /* * smc_call() - issue a secure monitor call From patchwork Thu Aug 8 23:59:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817924 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp75029wrv; Thu, 8 Aug 2024 17:01:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUrLbdD2mMElqjE3As1SFE62ccgHqu3WX6C7HLtcl4/VnM7JeX/igHrxCtA1X2Zq28iO1nNHUWgf+bYzATOucCo X-Google-Smtp-Source: AGHT+IHvMmCiPX9runj/QW+cwk2hAjirOznE/Y2ULfKUGrke7u4XFC5ymmNRAkM5RskRhpJJMxdc X-Received: by 2002:a05:6402:370f:b0:5a1:71b2:e9bd with SMTP id 4fb4d7f45d1cf-5bbb24a27ddmr3122555a12.34.1723161691584; Thu, 08 Aug 2024 17:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161691; cv=none; d=google.com; s=arc-20160816; b=AwEZ0Oy28OldPK4KYcf4BKL8VxdaFd1OgraCSDP0v6SShAAzPjNMDwPTxdhOn9ICxf RgfWnRS03cEwKbZgUZbnQNOb5kYcQSCFeSIYuAPV4TX7+R6QTBXcxUUh5LuQKoTwE9d0 /lAEjbUjtPB4S1CdDr+ShozX2U/xLulMyp7tMTMVTvClrxwmcfJKjjLtCmdp50Q2RPd3 CEj1x/Qmj6qW2iFStzZXuIWl5QPdIKj/N9y7Xpr6YRfvqAYtIDnZLdmG4mYY/SpUMwkK r+7/HVKepjtZKIBV0UzyH4F4VtklYLwnapfqcMPNWe/khv0zScFnFXsL1cNeIktXkqxQ Zykw== 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=2Wqu1Uvyi5YgGGYu3IARDoknlHLGsOsAO8Gfaus/WvU=; fh=I2YawaysAZzXrLuTTNzB2sN9F1GfkXWCMNzuUXgerUM=; b=UKaWh9TqcrXYskiENdU1k9p/JqFqjl5ziiihsqtkUKxu+43C4AzjlMeCSpAb9EZQ8e K4omYyZco23rQB5TmOVsGLaFc/m2Wk5m++vFB1YGsGfBsHNExv1U6Nvtzv2JtTtUlgLJ phYqfO5BlB5Xf832eLkeOcI5yChLts1YF+Vpj8snIDkCfeYgpQCpMGj9dLiCVtwmt2zB c6mLENtMq6UJNvQtB55FTlsd6gi8pudehxyBRnOOsS1e/dMdyA0P0UZw0vFhifwAp0ui XuniIV2xLAeplbKmnHmjJ2kLuLFClsTnH7QL0VvpvJTWvWgmrpYBBB16pk2JusrzNB2W fJuA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YJms0IEE; 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 a640c23a62f3a-a7dc9d6fa01si861357666b.277.2024.08.08.17.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:01:31 -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=YJms0IEE; 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 8353B88BD2; Fri, 9 Aug 2024 01:59:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YJms0IEE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BBD088BBB; Fri, 9 Aug 2024 01:59:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 9B0D587A09 for ; Fri, 9 Aug 2024 01:59:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a7d638a1f27so61983266b.2 for ; Thu, 08 Aug 2024 16:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161587; x=1723766387; 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=2Wqu1Uvyi5YgGGYu3IARDoknlHLGsOsAO8Gfaus/WvU=; b=YJms0IEEqbqWkEoyI2H8H9fRoqx76Otimru/mUuiM8csDTW8ZZyMETyft/RFoR9pfw AbFatuefgdSMbe18mDD+PixHvIfpjPi6nSTdawX1KKg0ByyBtCpN9uTLYEiiAp5kvQ64 +CpmRGl8WOKWLDF8YCes999zGw1YPtRmMXmtJxcFH/sE2CG1CHlzWDAgJ/ReRarBKtcN Pc4MHjvGdOMormgLsFC7zfXDkbomR8Yv7ZHj2acW3sikThZTL/9/NNLB59JMg3T16Ukn kVzG05SgCxffomHgcvaqEHX/CNaE6uA6D3p6pHzuoM475gDpCSLuMXUYwFtFY5MC90Vq xDLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161587; x=1723766387; 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=2Wqu1Uvyi5YgGGYu3IARDoknlHLGsOsAO8Gfaus/WvU=; b=hREn2hB9f23D+6QlDIr3fnPeC+L5YZB50mN6tntXZ8W2SML/QazC1lksevLRHSQ6MM Ajt/Vk0CjshHpUOhaEicbFoNb7jcW3Pxc955E4rO71gTi/7J5D04z3FUfbAd8+qUs/sZ tr/79fjFqt6qTRtdJpKeiXelE9HQajI1LwBZJ7CKl2mrQI4JWBUBKeXocLrNaeBMHr9T cDAKKhcBV9VozfU0BxVCbd5dn9BK+nBGIhRsbEIcU4K78/Nm9nzz3q1JReoNByC5KPSX xSP/VgzGmROh60wAQTfefZy9qPMd1Qry6bvrDsGYKuQqKTsWJpShvI41xXqjZ5nETzAd u29Q== X-Forwarded-Encrypted: i=1; AJvYcCXQFYJlG/Y0oPDQzUiLdZUTHqvsmes2TYgtiH13BvRe6t6no92oymOyXkM4yRPdQDCMmQs9ghsLrMvmG0QuwiNXk7LQjw== X-Gm-Message-State: AOJu0YylIvF9qqLMBiwPHWQGy8TeZK+K1N3TDWfjN9NRNMcJMu4meq8B oFZsKiLpO70ml8ll7kNwyo/q8i2WV3nKmOJkjvcKvch2gzvB1Pnr3LpY825CP8o= X-Received: by 2002:a05:6402:2709:b0:599:4d01:1fb6 with SMTP id 4fb4d7f45d1cf-5bbb23456d1mr3333011a12.16.1723161587044; Thu, 08 Aug 2024 16:59:47 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:46 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:32 +0200 Subject: [PATCH 09/11] soc: qcom: cmd-db: use strncmp() instead of memcmp() MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-9-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=880; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=8CasCoMgEHW8iOYaZ3r4nayrrozqXM5UfR7Wgz5krak=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvorrMBpPnxeoe/4nacEdsDBtDXAcf4CxcKl hdkiNEnjkKJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb6AAKCRAFgzErGV9k ttazD/9osWNfjDkfSe+be0ZZfYlrb6WYFRSqsQ+8K3rZVVYk4AgUofI0/Z76+GRmr549PkxvKyY YSTp8efF73vtrTnke5EuIBUit7+fsfyFCCMSXkQqETOfzsi9LVG4p9D5NBo8rZysEQzra8cpebG 7PfkMK9WSRbpo+wpEDZiU153UA0NAe+0eGjLlsQrCSgZBb0ahI1TsU4ZyuxckIZV7qDCX9ldizl gjmvCkNOUjmkGdcSqmJiLmtxdzuGL9Cy5hj6unF8+ABIqAbc17H7pzwRny0gJNxF7xGOckLNTsk +M0P+iM82fbUmsEXUkMa5lb+ZTfhXw25Cd830eqerH4fwbw3EFA3UmxY5bsA28j/ZY3bb7d4DOi 4OurfLsQwOMRBAwwd+UwIpEwy4XdrBauFE3Yi4r95C0vKiAhSAhbDhNOh8N3/XXHvapk5eWB9N8 3w9rlap8tOKlPthLxYPzjP9h8SDoQoz07+7xDbRm+VFwyAospwZGFBvcyFpbwMX8DRfXdxK3kDp vzPujHd3sYTlCIaNOw5g+gPYxsLlNYoficsrFnRXYeBBO1DpdwptniTE/PtcpVztcfOLVsD7jT7 9876hKrVT0i3+GmY9xMzwuvPCTFrarxwyPCZyrqZGgJwoFCep5herTpFJnH5fANSMt7LPHvPr4E 9nTnLAYXsezv3OQ== 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 memcmp() can cause aborts on some platforms and generally seems to be the wrong approach here. Use strncmp() instead which is more correct. Signed-off-by: Caleb Connolly --- drivers/soc/qcom/cmd-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index 08736ea936ae..c7c5230983d5 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -140,9 +140,9 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh, break; ent = rsc_to_entry_header(rsc_hdr); for (j = 0; j < le16_to_cpu(rsc_hdr->cnt); j++, ent++) { - if (memcmp(ent->id, query, sizeof(ent->id)) == 0) { + if (strncmp(ent->id, query, sizeof(ent->id)) == 0) { if (eh) *eh = ent; if (rh) *rh = rsc_hdr; From patchwork Thu Aug 8 23:59:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817925 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp75129wrv; Thu, 8 Aug 2024 17:01:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXbogHYSLVZEVSpl9OPpwy+2cpcf93h+6HLdxAJaH9ZbFwDEo9ScIOhRBRDu6zgic8WnujxWBQ4IWOgl3Wg+NIU X-Google-Smtp-Source: AGHT+IHIrK+KLImExoVbQZmmZtPFBiKpMQVYA+le8vbDiRrUiRstN5/ztaNP3iNGAprOevshv80w X-Received: by 2002:a2e:9f0f:0:b0:2ef:1f68:ead5 with SMTP id 38308e7fff4ca-2f19de4600bmr20100231fa.26.1723161704304; Thu, 08 Aug 2024 17:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161704; cv=none; d=google.com; s=arc-20160816; b=ZtFVwzhMeJKnYW4Ut0mKLq4EtvtoorRh7ZefSjfLe8uRCvzI9gf5GgLtaIp48HHFvH VIhH5oGADBdSLIfrgxsXwu2fS8pBYQB6/yxiSdxvL0vdkDcKeCdb9hkHYdl5nrRFOPWA 1O8fOUdmM+1PuHxb24xyHUxKvGFA2F7DzifBTbVbqGfCahKpLAYhKYPG6UHejzRHX2Wo TTbFIIEhUPOywP1uZ5fDjylrJ7VaXm/bdBvlv1v0RwXHUWlICEb4eAR/ZHX2tXlHe7u0 moX/ILafu2yofX+Jh9xrbSK0i0xBdlGFCm/qZEwR7/BG3Pi8/0x6Sssx2cXQZZraPUtT U+3A== 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=3n/U7bezp4FdaWE2SHroWzelPoINOlsWsoUiLqRfETo=; fh=nhwpMoYEm6xixb8eS49WQjFXvCvrEuAGjUBVk1HsuUU=; b=QKEvkUYkULtHmJi/sQ63EosObTqQMkCq4uCgpPR/Rx8NnCJnS4wxn+PAxklVJQRRiC E5zqOijAYYzX4HVZRVNUP/CNWINBm0+aDq3mR2ThIoKVmTLeFKzpGjSkokFb2MDlZUX4 pj65F9X5PlDBW43vruziwg9xu9OcpMP25M0v/JKmewNsTeOiCXrLEnIEOYmDqMIVt022 HsOMeeAIb2p4Hn7La75BfR0UumRBemZZNnxqk3fCoyXce7TXLcQWfSuKWL61IvbofhRD emh3EtTfqbdqHFqt6OeTAuLgUj3ebOdwoK3C+tWSIcHLWtT89Skn/l/VXWb7Hz1hxwc6 98ZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CSW68MEQ; 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 4fb4d7f45d1cf-5bbb2d267e3si1312356a12.467.2024.08.08.17.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:01:44 -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=CSW68MEQ; 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 E5BBA888E7; Fri, 9 Aug 2024 01:59:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=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="CSW68MEQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2FA9788BD2; Fri, 9 Aug 2024 01:59:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) (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 3873388BBD for ; Fri, 9 Aug 2024 01:59:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52ef95ec938so1648531e87.3 for ; Thu, 08 Aug 2024 16:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161588; x=1723766388; 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=3n/U7bezp4FdaWE2SHroWzelPoINOlsWsoUiLqRfETo=; b=CSW68MEQMl0AOWLiTF7nhiiCCeekKiQ84wMREHWeS05USUTl+NRlydVHSWfzJ+Gqqs jYgNv9ku7s7TwfqLInjhgtT5cRnTNgZebe5o3YhyxKsR+F9AHHK+3OYyoLxTN+4vYIzz tkcuSoa3uutsdhRag8gyE9ddb95ma+AM51QlLFiQFUpsxSyGrrAe4kRSflyADxFXhoMo 7A+TsF6TWJ/6uGEtpLQAIMmXE+9DpFjBrj34b5SURSYK+SGzwDicaqJGl8HA5i7W2aYJ FK3WAn2eVOs8gTIyp+Pwfx3xBWfAkyo8WjdvRHQBHkkmoW3a6J6y/y64VVl85icx+yVX 7JlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161588; x=1723766388; 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=3n/U7bezp4FdaWE2SHroWzelPoINOlsWsoUiLqRfETo=; b=jVORkFpvX5/uoqFZ1OvoYIaOG9xH/Yg0au9sPS56M3P+M8LyJ6yKmVtD6KISYdAAq8 lVxrZkk7zPH5Jasj1xsxNnx5gy8AUspa2MZHnzebZmOkn5BJOJGTDgUZtfTywIuncP6t 45++vMsGSrbNcD9EGIXVoqZjdc9k5idi6JYhhjSp76iWREhYtE1oy64mU3uSTv9s/uiq P8VATt6mPkDVmMEILlZtajJDhhLJQAbcYqlzZ7hv62B4Vfz6zuEwUUzeFiLC9DBFm1Gq IlTPT0YXI77ncWm9T8n6CyQus0hz7KJsgByLhP9vr1g1ABd3tFFQHhMsuWznK7zK2nmk 897g== X-Forwarded-Encrypted: i=1; AJvYcCVR0/xpAGQ6Y5uC1nsZSFR3zU6qcE1s/tNZInufASJSErrXekuttQuue+AAH2mniXaE1IVFHoe+wTapYKn8CmyKx/eAfQ== X-Gm-Message-State: AOJu0YxtFqE5Yx7hj8LSZSma2jucp6L9mD0amdZAxnAPfLJK4UtJeqzI GCXPYSSNHBpuYZ04byui5Sq4o8ADsvwJotiEcKUMYWExNvDPPyIZ+lCXZl5hwZE= X-Received: by 2002:a05:6512:1149:b0:52c:e012:efad with SMTP id 2adb3069b0e04-530e5817260mr2719648e87.12.1723161588252; Thu, 08 Aug 2024 16:59:48 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:47 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:33 +0200 Subject: [PATCH 10/11] soc: qcom: cmd-db: map cmd-db region MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-10-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=1704; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=nxXveBh4xzdjBB4rEUL354QZZfPHUXxpqjYxKOOFrmc=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvoP3/PhFUqvHIQ+Y6yIcPgWyZmhOqdmZU20 29isu6ChVqJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb6AAKCRAFgzErGV9k tjV2D/4i8IcoFZ+vpYACKNhtBYcgiiLg3Xc/qfFvUVBNC4n01jsZJCXcbXR9kbGmfkoRHlnUk4C ysiBO5le3SlmUs4uycaBe/Sv0jm0vCS+Ma03ipV3w4VhfA75hgOw08oQ+Drtk36GjbOvHrF6eNy YevewpiXAKPKkND/6bsTFR6T9106Zl97hJHWMJzKw5jHN/TtuxZdRHZAMj1t+hlWL93epLZ0udt 3pY4ORiD7PTBotgzZG9kd25Dg5VjngtqzPFwhWabhMcLEsZLkKmNWWRJPZe0q7+TV31j5ikIPoa IMaPw2sphmBbwUmn95k2Omm7738JMno5eqx5I/a8yydQpkj1abuYG9yzWktBAXMQ9FBoD5nwKLO x0osbECrjeYa2P8NwKUqWx25oEkRuknkZl9FTL4vuoXOEo4aTsNGSPI/nk0NrQbpY0fgbcv/Yeg MQQ+rNx6sLNOZMgS/hfHbbimCNjwFQo18OOLYzTk//8nQFv1CEzJ7xGJDrqR7UIj54xxBevEeKN p2TZNd24Oeum3uGcQ01IQtjlfmhZWTW4SbmYn2RE6hM7bFIBsf4fTNumHyvwSCIPFY0+aqgK6I5 jvPwo7inKyqk0sA8z41CmY1y95Nzxg6phwnPGGo9mSNV3GzAgEPnLHidM4h5+dVm/BA/7xHWoT0 KC+3lzYrK+HosGg== 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 On at least SM8650 this region might not be included in the memory map. Use the new mmu_map_region() helper to map it during bind(). Signed-off-by: Caleb Connolly --- drivers/soc/qcom/cmd-db.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index c7c5230983d5..67be18e89f4d 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -5,8 +5,9 @@ */ #define pr_fmt(fmt) "cmd-db: " fmt +#include #include #include #include #include @@ -181,11 +182,12 @@ u32 cmd_db_read_addr(const char *id) return ret < 0 ? 0 : le32_to_cpu(ent->addr); } EXPORT_SYMBOL_GPL(cmd_db_read_addr); -int cmd_db_bind(struct udevice *dev) +static int cmd_db_bind(struct udevice *dev) { void __iomem *base; + fdt_size_t size; ofnode node; if (cmd_db_header) return 0; @@ -193,14 +195,17 @@ int cmd_db_bind(struct udevice *dev) node = dev_ofnode(dev); debug("%s(%s)\n", __func__, ofnode_get_name(node)); - base = (void __iomem *)ofnode_get_addr(node); + base = (void __iomem *)ofnode_get_addr_size(node, "reg", &size); if ((fdt_addr_t)base == FDT_ADDR_T_NONE) { log_err("%s: Failed to read base address\n", __func__); return -ENOENT; } + /* On SM8550/SM8650 and newer SoCs cmd-db might not be mapped */ + mmu_map_region((phys_addr_t)base, (phys_size_t)size, false); + cmd_db_header = base; if (!cmd_db_magic_matches(cmd_db_header)) { log_err("%s: Invalid Command DB Magic\n", __func__); return -EINVAL; From patchwork Thu Aug 8 23:59:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 817926 Delivered-To: patch@linaro.org Received: by 2002:a5d:5711:0:b0:367:895a:4699 with SMTP id a17csp75226wrv; Thu, 8 Aug 2024 17:01:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX1WpWSpV8AEzkdWb+70pE+X+eqMRW9geSTkTadoltQtu4pFB826NGPcY2Y9E0JkZMxWsNDsCFYMoQo73yJSR52 X-Google-Smtp-Source: AGHT+IFmZLY9YsW91aw9tOsymze1Su9tzpVNvHBz9OBmj1ri0BdZ/dN93j6pdFcrZvHqQrKXcY0D X-Received: by 2002:a17:907:f754:b0:a7a:a7b8:ada7 with SMTP id a640c23a62f3a-a8090c6b6b1mr229497366b.24.1723161718249; Thu, 08 Aug 2024 17:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723161718; cv=none; d=google.com; s=arc-20160816; b=moZj8QAQbd1t9e+7dGK8Xc4hsf4bkHpzT3dLquEsxjaQApgwOCAkeBQusx5qYsJ/Cx AahYUUzgsZBhlq5lRhzH2pHVXQ8DEf/UOnMCWvk2Z08Vy4R/W3Si2IYdijdMGYy5ZBY0 QU/IQuZfnww0bhwsMTtkKPV6RaG4wb3i4x04nXVk5ItJjCXp3tli9Tg2zaPAfxQ4pT7t 4vV40I89WvJUbgNZF372nnSOihzXzx4K0yess858+tK5O0S4J9W6oq9WbrCahFFK4RHs k2HrgCD2wUb9GbjB9d2aJ2MMFKGpXEvtXnMB8H9/GnuhrPVIw/bow+ZBgHDrb+zjHo4h Kd3g== 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=WgBJo06YVMb8dLpylgA2lYh9LVLr1cX87NfXKpGySbs=; fh=jAFJP2UXopGeQa94TWbhYxb8xx55rhypwR7PUX+x3NY=; b=hj3MLTtyWUfzgVU+ptdXnHvEWfntQxe/bh1sFO7mFuxYDGPY1BrODVXev0nFt/t3Jh 4hC78+ocnRRW+Rf8dNQALc44OfFounI/PknE4I/LYLguGzg0g9iaXGqFFRQZQ/Lf2zd/ rKzVVuZjcwXweYpQxD2+MV0SymNozf2DXUybkEig5WQFRXU5P+EKaNsk4BPACnGdksit Vr6sjGFOoFemaBUM7DOUfS86Upcui5H5x2vH4pwVfAUyeGbdyC6fQuB1A8bSzveE9Aej XIiCbJ7vZk1C4xRxb9dWbCP1ezBr0sfOpU1u72peKXnmMR6yll+2T7JWmGpgP/oyP5Cr K/KQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qt3PMB4j; 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 a640c23a62f3a-a7dc9ebb78dsi899614566b.676.2024.08.08.17.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 17:01:58 -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=qt3PMB4j; 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 5B0AE88BD6; Fri, 9 Aug 2024 01:59:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qt3PMB4j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 005DF88BD6; Fri, 9 Aug 2024 01:59:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (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 1F92287A09 for ; Fri, 9 Aug 2024 01:59:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-a7a843bef98so170006066b.2 for ; Thu, 08 Aug 2024 16:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723161589; x=1723766389; 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=WgBJo06YVMb8dLpylgA2lYh9LVLr1cX87NfXKpGySbs=; b=qt3PMB4jJA+ECWTmiK/P0x6gTnzi++kmTN2Vipo3DnPdoNouti1qk66ykMjylh9ozf 05+LiqFdbT53hJ4dEQvdW06fkVG1li/KxmyBo06YXw10X86CuwoWBc1h1xZRvunzAr85 jtQW/DTMEblEMKQ+ac+N1jGIjlhRehQuQCq440/HtOm3TAPMMcKq9nzRvjrg397ZYhQ0 keURgvaCOH4X0W/gT/qoZAUxpgDQabiGP7d2DIRhrtlq/q6JISW/2KBOpnCwIKlShjKU f1apw0Ayw3DGI3jG6MAH8oYCLQJOdzENsZWX0PNgOraudee2nv+q8bNp9pBUPfO2nWFc RBZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723161589; x=1723766389; 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=WgBJo06YVMb8dLpylgA2lYh9LVLr1cX87NfXKpGySbs=; b=nZKTuapGZ3e8rLMiWeIabzyU+u6WM24OY1o+cydpCaIAMgp1PZni0eIbe/gXJqMkH5 nweUk8QlNxn1k1iB0b7mzX+ol0crCx5g3i/j4/Wcpm8rM2LCn/hLCVApBdYLQ4cfOTyq PESojF7ZLfe/EOFZNkPGO8wShZQsbYKpCBub2xRYhDRoT6+PTiEc0zNSNoH+NRgAAZ7Y IgVYgJePAKCLdIfBfOIIW5z3W2oicRlKKpJNUG6lwJctiaWiSDr9J07nin1Gfuv/Djud ZVcpS+vLACcVndbnaolt+4bIrpOHjAHCG5Qn3OOA9zoDvHKHWVDsq1SlLSmi1j8ft8dy LD2w== X-Forwarded-Encrypted: i=1; AJvYcCWlW7Y3AsM0H+OcT+iVdgByKoJ3DYaFk0yQhnF4jAL/w+AGf7VKokIj+QA4mR8PLTLKURyjvwNzt2m6OjzqEwT5IhrBWQ== X-Gm-Message-State: AOJu0Yw+bQKUQsWtSYm+toIUkFmAdC8OBF7XfbTDoXEaZJnMwUL8SOp8 Ma/In6flvZIePrEcP9o+JHTXu/413kAmFiVqhk4MEUvuhKfGC130wSJYjlZ7F+E= X-Received: by 2002:a17:906:f58a:b0:a7a:be06:d8e3 with SMTP id a640c23a62f3a-a8090e3cd30mr248174066b.46.1723161589589; Thu, 08 Aug 2024 16:59:49 -0700 (PDT) Received: from [192.168.0.113] ([2a02:8109:aa0d:be00::7424]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7dc9d45423sm784047866b.134.2024.08.08.16.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 16:59:48 -0700 (PDT) From: Caleb Connolly Date: Fri, 09 Aug 2024 01:59:34 +0200 Subject: [PATCH 11/11] qcom_defconfig: bump CONFIG_NR_DRAM_BANKS MIME-Version: 1.0 Message-Id: <20240809-b4-snapdragon-improvements-v1-11-7c353f3e8f74@linaro.org> References: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> In-Reply-To: <20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg 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=916; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=WS7c264fDxhTs31dn5TjMfqe5va8jMKSCBOGcwH9WMQ=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmtVvo0patOiEj1asJ4mCauiOnlwl4pgh/FCUPs 38+JzIMFi6JAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZrVb6AAKCRAFgzErGV9k tiVwEACiJwNkAwqmExVsDMlXJJJltzgZhRPzgY3lWSJNwBL3nrXlmiHF/W+JkU3wQIdRa4AlI4T qMbdIHvJ8SbTgBtYZipUu9/JwUpwYBjTMnoM9UXtlbwb6XeT1GJuVmqov/20oq68ZtZ/YUZ0dyO qPRYR4k8ZurYl8aC4JMtout3MsS1AdRDjqeLZgi15am32yoWiUq4EjkEa2dqOKs9cAj6NrPH9xh nH/84e5zF5hCCcAum5qqU9jTzzG/afHktC0dFrBdbwPa6195w8XGp1umHqascw2CRYbGhXp0U6g 8jA/6C7LvCpguazyrTOYv9YBGfAnvnwAEMpGlTZwpeSgenCNdloRLSTxRvmNTzILnMp2RTVfXJ0 Kh4D9f3Dtg7inP453J8J0FLwAVARX3klwMgE2vuGutcbSV06rJWX7wcWxdzqlRRjM+nbaLYIn0g bYA/QVYYWXCy/1Q2lZ+M18VeNdOGJnHIxz5G7zuKEIZtDvCsMA1LGeMeeiLLcR2sbZh+SLP4dFM Oo5avxk7joxfe2LvxO9sZRqwHUTpFjtX9sratUDLkadjJlOIv63x2IGZCk4aCUeBcK5TDsSMyJt 4ydOTDjBXVxHkt+3UEFrFkwlBhFSiO/4wXlVSPM3eaHeFYBa1VmoQgao7Qp4mJfgYplOI0y/8Bu LbhpyCsyCHSI6JA== 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 Some newer boards end up with a bunch of holes in the memory map due to how Qualcomm's hypervisor and ABL work. The end result is 14+ memory regions. Bump CONFIG_NR_DRAM_BANKS to 24 so we can handle these and any future expansion easily. Yes, this is ridiculous, but there is no other way. Signed-off-by: Caleb Connolly --- configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index 8852e83a52b6..24b71ba7be29 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -2,8 +2,9 @@ CONFIG_ARM=y CONFIG_SKIP_LOWLEVEL_INIT=y CONFIG_POSITION_INDEPENDENT=y CONFIG_SYS_INIT_SP_BSS_OFFSET=1572864 CONFIG_ARCH_SNAPDRAGON=y +CONFIG_NR_DRAM_BANKS=24 CONFIG_DEFAULT_DEVICE_TREE="qcom/sdm845-db845c" CONFIG_SYS_LOAD_ADDR=0xA0000000 CONFIG_BUTTON_CMD=y CONFIG_FIT=y