From patchwork Fri Mar 15 15:10:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780511 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp252601wrs; Fri, 15 Mar 2024 08:10:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1CvhBnaFVaaqLPQnjL609m9wf6ppkGZLpQP4Iggx6JgU7h1WP6ChSoVoh5GQgdg2NbdfoMeK2O5PJlNMdNx/i X-Google-Smtp-Source: AGHT+IF1di4kYur39cKbW6Tq7it4rQeUrHc/CXajJIsv5EPb8VS7+NJ/F4YgTw5isY213Rnqnkhp X-Received: by 2002:a05:600c:1d81:b0:413:fff2:a868 with SMTP id p1-20020a05600c1d8100b00413fff2a868mr1922138wms.29.1710515445846; Fri, 15 Mar 2024 08:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515445; cv=none; d=google.com; s=arc-20160816; b=FZvjCQOradBhpVs9lhF7bLtIlajZMRUiTUvrqlrngmhFpdbkvc4XAntvbhszMAQZX2 VtrTHoZ+lpFrJwJcMofZnhe4uV7V6t1UZlVCJWC3d29KG1fNFycPESS2C6gr+hGcSKdt B7QcAK4Q9oIxPMQVzb2VUliNTN9kUL43ePcU6bgfC4ypcJidngtrVDJged4cU2gGyohp NxKABeo5QynBNuBwHTvCwV29TsZULeS+7VmxeibAmpJi5zk/8gj4B+0h/zL6Z8kFA/fY s0Wf8AZSXOjfCvZx7ymXAJbD0Q6Ffa+v6QC0FXjjqVxUiwamctmvKkmnQOR78UtV0tGF cKjQ== 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=FqBLktASesX4FD9xMZHc+cynW/CmSAI3p7Tkt8KuoKQ=; fh=d4E/HI+bVm3xBknIHr8qwsldMVqwTsS3rriTMMP/Q9c=; b=d9CBCyZ7SG6f/ewbYTcKxUFhTdKBQuSJfb03/cq5GKDr6yPm6srIExbpfLQSe5nVrr b5FlT/kVuvsB/k7c6IYVtlCWAiwfMtyScWAzdsujGMpLyDdIXufcZfOqO/vkH1IODi+o Bg18hjVzk9DZhuP1h4SAMeg0G7C49C/gj5JBYe1gtr2tmA0AiOCQKbkC/I19UCMswH41 HHlJnzilBkrlUJ8Bt846zku8WJme+VKUfpQFQuHwC9sHrsHHSg03WAC/3HLtMNzwl2R0 qjNff7CstK/9//nn4NFw2uv5y9E6EPwoZ9npEq35EOY3A7cqnGxNteNMRm+qMM4kplOI Piyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YCwMPg1I; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id e4-20020adfe384000000b0033e4f1adf78si1739146wrm.282.2024.03.15.08.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:45 -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=YCwMPg1I; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EAC78801A; Fri, 15 Mar 2024 16:10:35 +0100 (CET) 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="YCwMPg1I"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DAEA8801A; Fri, 15 Mar 2024 16:10:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 0FE3A87FF1 for ; Fri, 15 Mar 2024 16:10:31 +0100 (CET) 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-x133.google.com with SMTP id 2adb3069b0e04-513d23be0b6so2081479e87.0 for ; Fri, 15 Mar 2024 08:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515430; x=1711120230; 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=FqBLktASesX4FD9xMZHc+cynW/CmSAI3p7Tkt8KuoKQ=; b=YCwMPg1IpOLO+n6OX4hwsfv4QxUy2eZvH144YHnQHH4bBVIAL/e4KNa3onPiyjJO3B YdLjJYCsaAGsyaU5qZXOWrIbCWVuPXOV+uFT/JeijhCGjAiuC/uoKetGf94ua/XOQleu WvtgKKZNtYsVyTyPzP0R7+Y49BwBtc+whlDw0yZFvfrfSkiKrr+j/bj7ZqWF7cJmdasm fX4/cCi5lPBossfrSTHpgYY5JtfYWAMx4BeizNfikjv9ANjclwZ3WTUynQ6wPICFCIig TCMmJ+P1YQludvUwHvS4qhVEKWnGp8Y4OqOSKinCudZXAOhRKekCHVs6Rs7+Z9SxRHJa EKtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515430; x=1711120230; 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=FqBLktASesX4FD9xMZHc+cynW/CmSAI3p7Tkt8KuoKQ=; b=O3naHIdCtjXXLMWj5XIE+FOj205o/cYe1xmj7WWy3po7bMlZx1bBy+4peNIuUQH/0W EqON0B5X4Kky4huTvs8yLAuJ4SNR9LjEdannNL0xtAVD+Gkx0mtzUpwMuKN+EfJQECL+ B8MoamyhBQctZECI6YSWtRNfLfK7ZlbCniow6pjmQEINO4wVP4V2nztUCRt1s5PVkNyQ l9QHI3PXGFexiUbhI0gFUBCvMkGMBQkmPnJ2BzxuTRVvzRrKgfyey6VWko/zlT5LvzPx zis6c62yrIqzcckdzHhrFZNZ/f2iXn9X7QpGeuCM7jS/Kx1Lmxjs1mhADekwjTczs8V4 n1Nw== X-Gm-Message-State: AOJu0Yz9i26Hh9uZijSEhga5OO8Znc0pRG2bFZXBE4MateA0Ukgvw1mz wdevuQM3KTdF6f23Si5VgDi0ERDf0VizqWOLIY2gbmKyBy49/id3S+KMq1BMV2nUhAswO1tQU6O U X-Received: by 2002:a05:6512:54e:b0:513:c17b:1426 with SMTP id h14-20020a056512054e00b00513c17b1426mr3437849lfl.11.1710515430023; Fri, 15 Mar 2024 08:10:30 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:29 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:10 +0000 Subject: [PATCH v2 01/14] mailmap: update Bhupesh's email address MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-1-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de, Bhupesh Sharma X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1108; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=Gph7f+aNqWx3oubVdCe0jYXNtcC+/SvMrfdaVbbbDAE=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY8cH5TuLpR8fCVexpOxR3DC44vn3rWaX5/794msy a8ifzXWjlIWBkEOBlkxRRbxE8ssm9ZettfYvuACzBxWJpAhDFycAjCRmUYM/5Tnh3c6uc28pcwm vGtTi7UN0wGPdQ5crfb3Vh72mD9RyIjhf+IZ5x/tatYnthaf8WIu3iEpJ3SCRzRIh/3GurURT4X 3ewEA 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 Update Bhupesh's email to his new one. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- Cc: Bhupesh Sharma --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index d1f08f3eca8a..f6e0847b2168 100644 --- a/.mailmap +++ b/.mailmap @@ -29,8 +29,9 @@ Ashok Reddy Soma Atish Patra Bharat Kumar Gogada Bharat Kumar Gogada Bhargava Sreekantappa Gayathri +Bhupesh Sharma Bin Meng Boris Brezillon Boris Brezillon Christian Kohn From patchwork Fri Mar 15 15:10:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780512 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp252722wrs; Fri, 15 Mar 2024 08:10:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpIY3IzG+BFuhK+q1eV6jxJdw6W9RVZ5RIsCoE2l/XcAnxc56tjRZqDv5IIw8c/VJ9fi8q5Wu/KTdc5KD/qf+k X-Google-Smtp-Source: AGHT+IE8D/JhLPOoTLSYZXNFCUGrEW4z4AR4jmDdfmUBeUZ/3a8pJQYIjlq8svuACmUW++pqKZRQ X-Received: by 2002:a5d:4990:0:b0:33e:c070:686c with SMTP id r16-20020a5d4990000000b0033ec070686cmr2619058wrq.45.1710515456348; Fri, 15 Mar 2024 08:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515456; cv=none; d=google.com; s=arc-20160816; b=r4mpvp76CXYxYWzXzcQGtxA+9q9qqsPXZChfyRI8cPM4jeZq9mVkpHNNrJ8fk6/56L K+yySV+gC99opjqWeCSQEvwCQjOZwKsiNZitC1tWsk/rJ0CsR5Td6rRdZsIaxHi7NTBe 7qxsypiicF5q3HPYD6ScFULyiViiTMa/KkRGd5ljvuDA4zREUJMRWPS2WGZkKLZBCPn7 pdLSPES7ymuHKU7yZUDuVAZnsGzW/lbBuM4+c6wT7ov8BEYOjrjEnNNVDHIIsvzFNbGF 9HUZa8HypBOCdxhgEcnHUAPNODL8oUXzY/yKCoUvEi/GyvhvCApS9gTb3jzSHGnOwJ6n RTCg== 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=g6mWag3Pi0kWshdhpN9Ua0MKGgBjEmDiXuTezGTIVCc=; fh=IUJzsJXR8tzOhtgP/Qm7FzQrRAC2ZStJPTaXNXY0swo=; b=DHaPxOejaY9yKQ5WzWGwulcGSgQQJMO/E0KrccUhouQk8xYyJ61YxmHggjUse/PdwY ulriAHKWfpKzOza7R7IAjtjA8eujbygvdcM/u5byWSiJHjZFB4y4CESOpKWPqn52mjAP nn4D8vHvg+Y8TfZba6dtgriQuPnj3YMfQmr2STc6B48FUJHxcwo262O2U3wiaHPAzjiN U60UgRHkDTXDZMbCOdY974zTeb/u7itdALAxswv4KxxGpZLoGyqwOLwl+URJXdB8mYEO WtgZ7GtmXjWiZK+O3HfVDgns/1xenqWvCVwK/5xfIETCpkMZaY7rlilqNz8+umioGEpx andA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m4zqtDZL; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id q6-20020adff506000000b0033e790fc3d7si1763011wro.583.2024.03.15.08.10.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:56 -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=m4zqtDZL; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D9DC28800B; Fri, 15 Mar 2024 16:10:38 +0100 (CET) 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="m4zqtDZL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 86C8E8802B; Fri, 15 Mar 2024 16:10:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DAF8588001 for ; Fri, 15 Mar 2024 16:10:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-41400332525so6770565e9.0 for ; Fri, 15 Mar 2024 08:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515431; x=1711120231; 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=g6mWag3Pi0kWshdhpN9Ua0MKGgBjEmDiXuTezGTIVCc=; b=m4zqtDZLvRztH+o8BjWqKYnyrvSdWe78xo0GzTU/L5XzSLFN2uRO0ZQK0QLx3fbccY 4Uj7J8FHXPqv+vyfK0/sgWMTO7cnj0DCbeL6SgF81Z26mdYKl81POyAjCjdo3jWF/72I pVTS+fmu/zYmRnMa6U2OED/UeSw+22OgEhTh9kdJAzIHOOKAA3wpDz65FAkI3KgGdKwM Q4/Mma+/sJOSJgBenJzTUo2l/hxgpoAuBOc6mavgjno8/jXO3AoZ4ik3g2xNZK0ql7VG DIBO0PDZGN9lRtuEgBn8g+VHFoNMbLPji6ktgqU+0Z+UrEdCUUWGQQE8pgZCOJshT4o3 jrng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515431; x=1711120231; 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=g6mWag3Pi0kWshdhpN9Ua0MKGgBjEmDiXuTezGTIVCc=; b=pkiDgjQBEI/3xUpr2/SaNiwlrgNxwswZ3G9jIadEuBmbiBSqArYgDozig+13Mzmz4d 2LvAgIRI8x+9+HPDzcgmxuemIyBnSRfc/ou1ZyLAhPUXvS1S/TBe4srwrklg+R7Bh9BW kPsIXJmkX+zP8eCtKa8g25t5ry0tADizNq32kdZO5IcoAIrWRsyx7yRh0XsZr6UHeHng cozbdHmIAXpOp918ZMfPQlmLb2jyKRHEboRQzFsX6+/erbvkjdabdgvjTlaKzEeEb6i2 RH+MFMZ+JvX2EcPBbPDO8tYjoOPkHkT0MioM1uGfk3pdBmUlHIpLwvj0BqkuaywIhmiv unxQ== X-Gm-Message-State: AOJu0YxzrfhMw3MBcl8ZL9LDVRb4Z21QSBdZxbCeYaLuaR+n83ZOD77a 5tnHt6araZJWb0bemfjqHKDoKrbLoJlUdtnhvm8Td6qEXdVnSGYXx6ek3sHHlq4IiRi5eU9OkIA q X-Received: by 2002:adf:e253:0:b0:33e:d244:4870 with SMTP id bl19-20020adfe253000000b0033ed2444870mr1661183wrb.59.1710515431036; Fri, 15 Mar 2024 08:10:31 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:30 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:11 +0000 Subject: [PATCH v2 02/14] phy: qcom: add Qualcomm QUSB2 USB PHY driver MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-2-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de, Bhupesh Sharma , Bhupesh Sharma X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=14855; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=2N7jc6PfWuEQfGhtx0f5pYAPd9Ykl627THeMqJkhbUo=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY/sSxhatXyfr8z9W1emdmJXWovwm5XdH3Z/jK+8t +XaaZf7HaUsDIIcDLJiiiziJ5ZZNq29bK+xfcEFmDmsTCBDGLg4BWAiX1sYGXYq7On6E9Yz74bt Id+/N4Ilnvw9fePFNnuHw6X67jvmnvjI8IeD/8Iq8eP1sxT0ApJm+VoUT7dOmrzvd5WG5fHfFyY 2ZrcDAA== 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: Bhupesh Sharma The Snapdragon 845 and several other Qualcomm SoCs feature this USB high-speed phy. Add a driver for it based on the Linux driver, with support for the SDM845, and the QCM2290 and SM6115 SoCs which will gain support in U-Boot in future patches. Signed-off-by: Bhupesh Sharma [code cleanup, switch to clk_bulk] Signed-off-by: Caleb Connolly --- drivers/phy/qcom/Kconfig | 7 + drivers/phy/qcom/Makefile | 1 + drivers/phy/qcom/phy-qcom-qusb2.c | 468 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 476 insertions(+) diff --git a/drivers/phy/qcom/Kconfig b/drivers/phy/qcom/Kconfig index f4ca174805a4..361dfb6e1126 100644 --- a/drivers/phy/qcom/Kconfig +++ b/drivers/phy/qcom/Kconfig @@ -11,8 +11,15 @@ config PHY_QCOM_IPQ4019_USB depends on PHY && ARCH_IPQ40XX help Support for the USB PHY-s on Qualcomm IPQ40xx SoC-s. +config PHY_QCOM_QUSB2 + tristate "Qualcomm USB QUSB2 PHY driver" + depends on PHY && ARCH_SNAPDRAGON + help + Enable this to support the Super-Speed USB transceiver on various + Qualcomm chipsets. + config PHY_QCOM_USB_HS_28NM tristate "Qualcomm 28nm High-Speed PHY" depends on PHY && ARCH_SNAPDRAGON help diff --git a/drivers/phy/qcom/Makefile b/drivers/phy/qcom/Makefile index 2113f178c0c7..f6af985666a4 100644 --- a/drivers/phy/qcom/Makefile +++ b/drivers/phy/qcom/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o +obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o obj-$(CONFIG_PHY_QCOM_USB_HS_28NM) += phy-qcom-usb-hs-28nm.o obj-$(CONFIG_PHY_QCOM_USB_SS) += phy-qcom-usb-ss.o diff --git a/drivers/phy/qcom/phy-qcom-qusb2.c b/drivers/phy/qcom/phy-qcom-qusb2.c new file mode 100644 index 000000000000..5b654403a181 --- /dev/null +++ b/drivers/phy/qcom/phy-qcom-qusb2.c @@ -0,0 +1,468 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2023 Bhupesh Sharma + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define QUSB2PHY_PLL 0x0 +#define QUSB2PHY_PLL_TEST 0x04 +#define CLK_REF_SEL BIT(7) + +#define QUSB2PHY_PLL_TUNE 0x08 +#define QUSB2PHY_PLL_USER_CTL1 0x0c +#define QUSB2PHY_PLL_USER_CTL2 0x10 +#define QUSB2PHY_PLL_AUTOPGM_CTL1 0x1c +#define QUSB2PHY_PLL_PWR_CTRL 0x18 + +/* QUSB2PHY_PLL_STATUS register bits */ +#define PLL_LOCKED BIT(5) + +/* QUSB2PHY_PLL_COMMON_STATUS_ONE register bits */ +#define CORE_READY_STATUS BIT(0) + +/* QUSB2PHY_PORT_POWERDOWN register bits */ +#define CLAMP_N_EN BIT(5) +#define FREEZIO_N BIT(1) +#define POWER_DOWN BIT(0) + +/* QUSB2PHY_PWR_CTRL1 register bits */ +#define PWR_CTRL1_VREF_SUPPLY_TRIM BIT(5) +#define PWR_CTRL1_CLAMP_N_EN BIT(1) + +#define QUSB2PHY_REFCLK_ENABLE BIT(0) + +#define PHY_CLK_SCHEME_SEL BIT(0) + +/* QUSB2PHY_INTR_CTRL register bits */ +#define DMSE_INTR_HIGH_SEL BIT(4) +#define DPSE_INTR_HIGH_SEL BIT(3) +#define CHG_DET_INTR_EN BIT(2) +#define DMSE_INTR_EN BIT(1) +#define DPSE_INTR_EN BIT(0) + +/* QUSB2PHY_PLL_CORE_INPUT_OVERRIDE register bits */ +#define CORE_PLL_EN_FROM_RESET BIT(4) +#define CORE_RESET BIT(5) +#define CORE_RESET_MUX BIT(6) + +/* QUSB2PHY_IMP_CTRL1 register bits */ +#define IMP_RES_OFFSET_MASK GENMASK(5, 0) +#define IMP_RES_OFFSET_SHIFT 0x0 + +/* QUSB2PHY_PLL_BIAS_CONTROL_2 register bits */ +#define BIAS_CTRL2_RES_OFFSET_MASK GENMASK(5, 0) +#define BIAS_CTRL2_RES_OFFSET_SHIFT 0x0 + +/* QUSB2PHY_CHG_CONTROL_2 register bits */ +#define CHG_CTRL2_OFFSET_MASK GENMASK(5, 4) +#define CHG_CTRL2_OFFSET_SHIFT 0x4 + +/* QUSB2PHY_PORT_TUNE1 register bits */ +#define HSTX_TRIM_MASK GENMASK(7, 4) +#define HSTX_TRIM_SHIFT 0x4 +#define PREEMPH_WIDTH_HALF_BIT BIT(2) +#define PREEMPHASIS_EN_MASK GENMASK(1, 0) +#define PREEMPHASIS_EN_SHIFT 0x0 + +/* QUSB2PHY_PORT_TUNE2 register bits */ +#define HSDISC_TRIM_MASK GENMASK(1, 0) +#define HSDISC_TRIM_SHIFT 0x0 + +#define QUSB2PHY_PLL_ANALOG_CONTROLS_TWO 0x04 +#define QUSB2PHY_PLL_CLOCK_INVERTERS 0x18c +#define QUSB2PHY_PLL_CMODE 0x2c +#define QUSB2PHY_PLL_LOCK_DELAY 0x184 +#define QUSB2PHY_PLL_DIGITAL_TIMERS_TWO 0xb4 +#define QUSB2PHY_PLL_BIAS_CONTROL_1 0x194 +#define QUSB2PHY_PLL_BIAS_CONTROL_2 0x198 +#define QUSB2PHY_PWR_CTRL2 0x214 +#define QUSB2PHY_IMP_CTRL1 0x220 +#define QUSB2PHY_IMP_CTRL2 0x224 +#define QUSB2PHY_CHG_CTRL2 0x23c + +struct qusb2_phy_init_tbl { + unsigned int offset; + unsigned int val; + /* + * register part of layout ? + * if yes, then offset gives index in the reg-layout + */ + int in_layout; +}; + +struct qusb2_phy_cfg { + const struct qusb2_phy_init_tbl *tbl; + /* number of entries in the table */ + unsigned int tbl_num; + /* offset to PHY_CLK_SCHEME register in TCSR map */ + unsigned int clk_scheme_offset; + + /* array of registers with different offsets */ + const unsigned int *regs; + unsigned int mask_core_ready; + unsigned int disable_ctrl; + unsigned int autoresume_en; + + /* true if PHY has PLL_TEST register to select clk_scheme */ + bool has_pll_test; + + /* true if TUNE1 register must be updated by fused value, else TUNE2 */ + bool update_tune1_with_efuse; + + /* true if PHY has PLL_CORE_INPUT_OVERRIDE register to reset PLL */ + bool has_pll_override; +}; + +/* set of registers with offsets different per-PHY */ +enum qusb2phy_reg_layout { + QUSB2PHY_PLL_CORE_INPUT_OVERRIDE, + QUSB2PHY_PLL_STATUS, + QUSB2PHY_PORT_TUNE1, + QUSB2PHY_PORT_TUNE2, + QUSB2PHY_PORT_TUNE3, + QUSB2PHY_PORT_TUNE4, + QUSB2PHY_PORT_TUNE5, + QUSB2PHY_PORT_TEST1, + QUSB2PHY_PORT_TEST2, + QUSB2PHY_PORT_POWERDOWN, + QUSB2PHY_INTR_CTRL, +}; + +#define QUSB2_PHY_INIT_CFG(o, v) \ + { \ + .offset = o, .val = v, \ + } + +#define QUSB2_PHY_INIT_CFG_L(o, v) \ + { \ + .offset = o, .val = v, .in_layout = 1, \ + } + +static const struct qusb2_phy_init_tbl sm6115_init_tbl[] = { + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE1, 0xf8), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x53), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE3, 0x81), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE4, 0x17), + + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_TUNE, 0x30), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL1, 0x79), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_USER_CTL2, 0x21), + + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TEST2, 0x14), + + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_AUTOPGM_CTL1, 0x9f), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_PWR_CTRL, 0x00), +}; + +static const unsigned int sm6115_regs_layout[] = { + [QUSB2PHY_PLL_STATUS] = 0x38, [QUSB2PHY_PORT_TUNE1] = 0x80, + [QUSB2PHY_PORT_TUNE2] = 0x84, [QUSB2PHY_PORT_TUNE3] = 0x88, + [QUSB2PHY_PORT_TUNE4] = 0x8c, [QUSB2PHY_PORT_TUNE5] = 0x90, + [QUSB2PHY_PORT_TEST1] = 0xb8, [QUSB2PHY_PORT_TEST2] = 0x9c, + [QUSB2PHY_PORT_POWERDOWN] = 0xb4, [QUSB2PHY_INTR_CTRL] = 0xbc, +}; + +static const struct qusb2_phy_init_tbl qusb2_v2_init_tbl[] = { + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_ANALOG_CONTROLS_TWO, 0x03), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CLOCK_INVERTERS, 0x7c), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_CMODE, 0x80), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_LOCK_DELAY, 0x0a), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_DIGITAL_TIMERS_TWO, 0x19), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_BIAS_CONTROL_1, 0x40), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PLL_BIAS_CONTROL_2, 0x20), + QUSB2_PHY_INIT_CFG(QUSB2PHY_PWR_CTRL2, 0x21), + QUSB2_PHY_INIT_CFG(QUSB2PHY_IMP_CTRL1, 0x0), + QUSB2_PHY_INIT_CFG(QUSB2PHY_IMP_CTRL2, 0x58), + + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE1, 0x30), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE2, 0x29), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE3, 0xca), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE4, 0x04), + QUSB2_PHY_INIT_CFG_L(QUSB2PHY_PORT_TUNE5, 0x03), + + QUSB2_PHY_INIT_CFG(QUSB2PHY_CHG_CTRL2, 0x0), +}; + +static const unsigned int qusb2_v2_regs_layout[] = { + [QUSB2PHY_PLL_CORE_INPUT_OVERRIDE] = 0xa8, + [QUSB2PHY_PLL_STATUS] = 0x1a0, + [QUSB2PHY_PORT_TUNE1] = 0x240, + [QUSB2PHY_PORT_TUNE2] = 0x244, + [QUSB2PHY_PORT_TUNE3] = 0x248, + [QUSB2PHY_PORT_TUNE4] = 0x24c, + [QUSB2PHY_PORT_TUNE5] = 0x250, + [QUSB2PHY_PORT_TEST1] = 0x254, + [QUSB2PHY_PORT_TEST2] = 0x258, + [QUSB2PHY_PORT_POWERDOWN] = 0x210, + [QUSB2PHY_INTR_CTRL] = 0x230, +}; + +static const struct qusb2_phy_cfg sm6115_phy_cfg = { + .tbl = sm6115_init_tbl, + .tbl_num = ARRAY_SIZE(sm6115_init_tbl), + .regs = sm6115_regs_layout, + + .has_pll_test = true, + .disable_ctrl = (CLAMP_N_EN | FREEZIO_N | POWER_DOWN), + .mask_core_ready = PLL_LOCKED, + .autoresume_en = BIT(3), +}; + +static const struct qusb2_phy_cfg qusb2_v2_phy_cfg = { + .tbl = qusb2_v2_init_tbl, + .tbl_num = ARRAY_SIZE(qusb2_v2_init_tbl), + .regs = qusb2_v2_regs_layout, + + .disable_ctrl = (PWR_CTRL1_VREF_SUPPLY_TRIM | PWR_CTRL1_CLAMP_N_EN | + POWER_DOWN), + .mask_core_ready = CORE_READY_STATUS, + .has_pll_override = true, + .autoresume_en = BIT(0), + .update_tune1_with_efuse = true, +}; + +/** + * struct qusb2_phy - structure holding qusb2 phy attributes + * + * @phy: generic phy + * @base: iomapped memory space for qubs2 phy + * + * @cfg_ahb_clk: AHB2PHY interface clock + * @phy_rst: phy reset control + * + * @cfg: phy config data + * @has_se_clk_scheme: indicate if PHY has single-ended ref clock scheme + */ +struct qusb2_phy { + struct phy *phy; + void __iomem *base; + + struct clk cfg_ahb_clk; + struct reset_ctl phy_rst; + + const struct qusb2_phy_cfg *cfg; + bool has_se_clk_scheme; +}; + +static inline void qusb2_write_mask(void __iomem *base, u32 offset, u32 val, + u32 mask) +{ + u32 reg; + + reg = readl(base + offset); + reg &= ~mask; + reg |= val & mask; + writel(reg, base + offset); + + /* Ensure above write is completed */ + readl(base + offset); +} + +static inline void qusb2_setbits(void __iomem *base, u32 offset, u32 val) +{ + u32 reg; + + reg = readl(base + offset); + reg |= val; + writel(reg, base + offset); + + /* Ensure above write is completed */ + readl(base + offset); +} + +static inline void qusb2_clrbits(void __iomem *base, u32 offset, u32 val) +{ + u32 reg; + + reg = readl(base + offset); + reg &= ~val; + writel(reg, base + offset); + + /* Ensure above write is completed */ + readl(base + offset); +} + +static inline void qusb2_phy_configure(void __iomem *base, + const unsigned int *regs, + const struct qusb2_phy_init_tbl tbl[], + int num) +{ + int i; + + for (i = 0; i < num; i++) { + if (tbl[i].in_layout) + writel(tbl[i].val, base + regs[tbl[i].offset]); + else + writel(tbl[i].val, base + tbl[i].offset); + } +} + +static int qusb2phy_do_reset(struct qusb2_phy *qphy) +{ + int ret; + + ret = reset_assert(&qphy->phy_rst); + if (ret) + return ret; + + udelay(10); + + ret = reset_deassert(&qphy->phy_rst); + if (ret) + return ret; + + return 0; +} + +static int qusb2phy_power_on(struct phy *phy) +{ + struct qusb2_phy *qphy = dev_get_priv(phy->dev); + const struct qusb2_phy_cfg *cfg = qphy->cfg; + int ret; + u32 val; + + ret = qusb2phy_do_reset(qphy); + if (ret) + return ret; + + /* Disable the PHY */ + qusb2_setbits(qphy->base, cfg->regs[QUSB2PHY_PORT_POWERDOWN], + qphy->cfg->disable_ctrl); + + if (cfg->has_pll_test) { + /* save reset value to override reference clock scheme later */ + val = readl(qphy->base + QUSB2PHY_PLL_TEST); + } + + qusb2_phy_configure(qphy->base, cfg->regs, cfg->tbl, cfg->tbl_num); + + /* Enable the PHY */ + qusb2_clrbits(qphy->base, cfg->regs[QUSB2PHY_PORT_POWERDOWN], + POWER_DOWN); + + /* Required to get phy pll lock successfully */ + udelay(150); + + if (cfg->has_pll_test) { + val |= CLK_REF_SEL; + + writel(val, qphy->base + QUSB2PHY_PLL_TEST); + + /* ensure above write is through */ + readl(qphy->base + QUSB2PHY_PLL_TEST); + } + + /* Required to get phy pll lock successfully */ + udelay(100); + + val = readb(qphy->base + cfg->regs[QUSB2PHY_PLL_STATUS]); + if (!(val & cfg->mask_core_ready)) { + pr_err("QUSB2PHY pll lock failed: status reg = %x\n", val); + ret = -EBUSY; + return ret; + } + + return 0; +} + +static int qusb2phy_power_off(struct phy *phy) +{ + struct qusb2_phy *qphy = dev_get_priv(phy->dev); + + /* Disable the PHY */ + qusb2_setbits(qphy->base, qphy->cfg->regs[QUSB2PHY_PORT_POWERDOWN], + qphy->cfg->disable_ctrl); + + reset_assert(&qphy->phy_rst); + + clk_disable(&qphy->cfg_ahb_clk); + + return 0; +} + +static int qusb2phy_clk_init(struct udevice *dev, struct qusb2_phy *qphy) +{ + int ret; + + /* We ignore the ref clock as we currently lack a driver for rpmcc/rpmhcc where + * it usually comes from - we assume it's always on. + */ + ret = clk_get_by_name(dev, "cfg_ahb", &qphy->cfg_ahb_clk); + if (ret == -ENOSYS || ret == -ENOENT) + return 0; + if (ret) + return ret; + + ret = clk_enable(&qphy->cfg_ahb_clk); + if (ret) { + return ret; + } + + return 0; +} + +static int qusb2phy_probe(struct udevice *dev) +{ + struct qusb2_phy *qphy = dev_get_priv(dev); + int ret; + + qphy->base = (void __iomem *)dev_read_addr(dev); + if (IS_ERR(qphy->base)) + return PTR_ERR(qphy->base); + + ret = qusb2phy_clk_init(dev, qphy); + if (ret) { + printf("%s: Couldn't get clocks: %d\n", __func__, ret); + return ret; + } + + ret = reset_get_by_index(dev, 0, &qphy->phy_rst); + if (ret) { + printf("%s: Couldn't get resets: %d\n", __func__, ret); + return ret; + } + + qphy->cfg = (const struct qusb2_phy_cfg *)dev_get_driver_data(dev); + if (!qphy->cfg) { + printf("%s: Couldn't get driver data\n", __func__); + return -EINVAL; + } + + debug("%s success qusb phy cfg %p\n", __func__, qphy->cfg); + return 0; +} + +static struct phy_ops qusb2phy_ops = { + .power_on = qusb2phy_power_on, + .power_off = qusb2phy_power_off, +}; + +static const struct udevice_id qusb2phy_ids[] = { + { .compatible = "qcom,qusb2-phy" }, + { .compatible = "qcom,qcm2290-qusb2-phy", + .data = (ulong)&sm6115_phy_cfg }, + { .compatible = "qcom,sm6115-qusb2-phy", + .data = (ulong)&sm6115_phy_cfg }, + { .compatible = "qcom,qusb2-v2-phy", .data = (ulong)&qusb2_v2_phy_cfg }, + {} +}; + +U_BOOT_DRIVER(qcom_qusb2_phy) = { + .name = "qcom-qusb2-phy", + .id = UCLASS_PHY, + .of_match = qusb2phy_ids, + .ops = &qusb2phy_ops, + .probe = qusb2phy_probe, + .priv_auto = sizeof(struct qusb2_phy), +}; From patchwork Fri Mar 15 15:10:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780514 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp252966wrs; Fri, 15 Mar 2024 08:11:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXAFxOyn7eGlWE6KH4F5P7CmNqQkAAR1nlO5fb4o3fc3YWd7MbzAIG4rLm5zW6RhGpSUHjJONXZtHKWj83n8Gsd X-Google-Smtp-Source: AGHT+IH2UMTJulJZWxLBocSCCpvFCDMXt63UWB/js21bvRvDEs2uB47oVoqwxfdTIU9YFsACNraS X-Received: by 2002:adf:eccd:0:b0:33e:172f:5709 with SMTP id s13-20020adfeccd000000b0033e172f5709mr3558219wro.8.1710515479354; Fri, 15 Mar 2024 08:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515479; cv=none; d=google.com; s=arc-20160816; b=CTJplUmhuijr/42Q1y183kle9mDmQAdVKHRuoWo7XSOgDF7avvMiZ89BmOz+yj5s8t xY/bmRoLRfEd3/ESc2anLNq1vCjGAdsGemAHMPMnGs105hS0YfXWQ3sotXziAoelppL0 OvZxHbQciXkQTBVlZME7isjgfYxNnHgTEoKi61ie7MOqddjb35wfFJZwpXHpHZRDSI/m 9QrfQ3daIJ6OHXSPz+5kr8wPdv/baSqFjKYEhZnRHI0wYFc6jIBWhlxgVZ4RUs52nYf0 AbMypeAKSohIb3uw399sz1p+6yBtZJkHsp2Ki0wmas2RhcitV86q5GorGJVy+P6I5OkI IpMw== 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=sdiEpf6P3cJK8B14F5lPuyDvhsCbEe61z94agzm99HE=; fh=IUJzsJXR8tzOhtgP/Qm7FzQrRAC2ZStJPTaXNXY0swo=; b=qc+ZPIKXwxxV+BlzqADUfRka2RjcxZXoBNnO6jRZH72FRtRD1QyBwYxLGv5aCR63LB wilMUe10JDC22TkCpJQClAOO1ey+yBc9Ek/RS5iNhzU975wyqM/jSgPtGGViedRKxH2E qRYbqK0RoeKOpHSGkhRL8Q0wujleh//NigQB2mkEnnp81+SKtTRpT/6SYKrF/pxXVDQX V52C+wda67qqG+PDx8nvubzW4H5mwErXaluLlXHFr+muqrxbrVVye9QuKH5As7hMMXUY 5uOyqctY9LOEtrZPZcDMLPFe6ASxuk4boIVgF+3Ywu5leJ91FdL/yuy2eLvu1+JNgHUM 0CAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v9SwqGjC; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a2-20020a056000100200b0033d9f127d34si1692166wrx.644.2024.03.15.08.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:11:19 -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=v9SwqGjC; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CADCD88049; Fri, 15 Mar 2024 16:10:39 +0100 (CET) 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="v9SwqGjC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 28DCE87FC6; Fri, 15 Mar 2024 16:10:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 4D2758800C for ; Fri, 15 Mar 2024 16:10:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33ec8aac149so1001579f8f.1 for ; Fri, 15 Mar 2024 08:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515432; x=1711120232; 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=sdiEpf6P3cJK8B14F5lPuyDvhsCbEe61z94agzm99HE=; b=v9SwqGjCYEdUkmW4snbOOYVI9sqaSlIEGEsurkAnIxI0e8KTB4ICpvHXjXRLn68VFM 80t7oOGx4e04TKOxP1AOZABCsNqhqKtUEVdbQvQTe2fuwqwCFSErmKfjxcBCdBg0dm7k 6YVlH1a5N0+SrSv4FitNfb3FcAMtw9OdlX+vKbVmFvbrHRJuqREGlHw4D9dxd3n+JTxf cX4JX4723k5Guu/kvt6fkeeERAW7FTL8avr7OiQnIPNqNSSP6FIRvdqWssXjwdkEwRGc NNAgheaJ9DZr3IIHyS9S5hyGbVjoVbfEMR17jZXzGI0Vii9KCQ9EFwCcr22KsLx88yZp m0EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515432; x=1711120232; 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=sdiEpf6P3cJK8B14F5lPuyDvhsCbEe61z94agzm99HE=; b=amiSR078O3D2MLYXTcJWhPM+lcTMrLsXm2l7bIY4fkoCfpygufVVHLjx/2FEQc0kIm QYqioiF6IHMpkmLmU/xrclaJLHBcEtjXt69ykPi5s0GHdu7p1kKIfpV6sY47AHwT4dkN cEZncw6vGrjkx4oDoh8vlTtbZ8bHM7SYdZ4B0DZa7If2mLWm63L1qYZt2gOElXxw5OEq sMmR02dF1q2hreyYjXBtJfBeTYai7VuHYKQnnUfAKd0Jaz3PVOBeQdBm3c+yjTrRGNVU ONR2RIuUj6/kmbg4Enm5TGJJcepxlNXXpbIpwahrHTSqPFv+s6H6gOdu58kz1d1D6m3y usbQ== X-Gm-Message-State: AOJu0Yym+UbS8hAR6jwb1oug3lIRM0svmZ5Of3sBzDmpSkFlGJuCqMKw zSbZJjYnpwfCDKgUumDrICAToEm4UPTcBLzxtqXrn18d5+V1A2S0H+JobUwOUR5SK8Vu8zayXsA L X-Received: by 2002:a5d:4010:0:b0:33e:cc1e:399 with SMTP id n16-20020a5d4010000000b0033ecc1e0399mr3008558wrp.43.1710515432044; Fri, 15 Mar 2024 08:10:32 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:31 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:12 +0000 Subject: [PATCH v2 03/14] phy: qcom: Add USB HS 7nm PHY driver MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-3-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de, Bhupesh Sharma , Bhupesh Sharma X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=9717; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=lACQTcB5MJXV/66mdlBTnkZRF31mWOf1jhSDruKEz1w=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY//OdVuMdg4Z1dCVUXm3vUBcTOEBAuXK9Z3LKk7m 9h/m2VmRykLgyAHg6yYIov4iWWWTWsv22tsX3ABZg4rE8gQBi5OAZiI30KG/z6fff0nLnddI7LL Zu9Rr4eFyS6HlxTMPeYZM3fzom1P7s9l+Cu2cc3/Own1bu+fPFJ0EmpTuuYocjMlRNpN83+Hy6N WP2sA 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: Bhupesh Sharma Some Qualcomm SoCs newer than SDM845 feature a so-called "7nm phy" driver, notable the SM8250 SoC which will gain U-Boot support in upcoming patches. Introduce a driver based on the Linux driver. Signed-off-by: Bhupesh Sharma [code cleanup, switch to clk/reset_bulk APIs] Signed-off-by: Caleb Connolly --- drivers/phy/qcom/Kconfig | 8 + drivers/phy/qcom/Makefile | 1 + drivers/phy/qcom/phy-qcom-usb-hs-7nm.c | 295 +++++++++++++++++++++++++++++++++ 3 files changed, 304 insertions(+) diff --git a/drivers/phy/qcom/Kconfig b/drivers/phy/qcom/Kconfig index 361dfb6e1126..3fc59dc65650 100644 --- a/drivers/phy/qcom/Kconfig +++ b/drivers/phy/qcom/Kconfig @@ -18,8 +18,16 @@ config PHY_QCOM_QUSB2 help Enable this to support the Super-Speed USB transceiver on various Qualcomm chipsets. +config PHY_QCOM_USB_HS_7NM + tristate "Qualcomm 7nm High-Speed PHY" + depends on PHY && ARCH_SNAPDRAGON + help + Enable this to support the Qualcomm Synopsys DesignWare Core 7nm + High-Speed PHY driver. This driver supports the Hi-Speed PHY which + is usually paired with Synopsys DWC3 USB IPs on MSM SOCs. + config PHY_QCOM_USB_HS_28NM tristate "Qualcomm 28nm High-Speed PHY" depends on PHY && ARCH_SNAPDRAGON help diff --git a/drivers/phy/qcom/Makefile b/drivers/phy/qcom/Makefile index f6af985666a4..39219ecd24aa 100644 --- a/drivers/phy/qcom/Makefile +++ b/drivers/phy/qcom/Makefile @@ -1,5 +1,6 @@ obj-$(CONFIG_PHY_QCOM_IPQ4019_USB) += phy-qcom-ipq4019-usb.o obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o obj-$(CONFIG_PHY_QCOM_QUSB2) += phy-qcom-qusb2.o +obj-$(CONFIG_PHY_QCOM_USB_HS_7NM) += phy-qcom-usb-hs-7nm.o obj-$(CONFIG_PHY_QCOM_USB_HS_28NM) += phy-qcom-usb-hs-28nm.o obj-$(CONFIG_PHY_QCOM_USB_SS) += phy-qcom-usb-ss.o diff --git a/drivers/phy/qcom/phy-qcom-usb-hs-7nm.c b/drivers/phy/qcom/phy-qcom-usb-hs-7nm.c new file mode 100644 index 000000000000..65128b45937b --- /dev/null +++ b/drivers/phy/qcom/phy-qcom-usb-hs-7nm.c @@ -0,0 +1,295 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2023 Bhupesh Sharma + * + * Based on Linux driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define USB2_PHY_USB_PHY_UTMI_CTRL0 (0x3c) +#define SLEEPM BIT(0) +#define OPMODE_MASK GENMASK(4, 3) +#define OPMODE_NORMAL (0x00) +#define OPMODE_NONDRIVING BIT(3) +#define TERMSEL BIT(5) + +#define USB2_PHY_USB_PHY_UTMI_CTRL1 (0x40) +#define XCVRSEL BIT(0) + +#define USB2_PHY_USB_PHY_UTMI_CTRL5 (0x50) +#define POR BIT(1) + +#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0 (0x54) +#define SIDDQ BIT(2) +#define RETENABLEN BIT(3) +#define FSEL_MASK GENMASK(6, 4) +#define FSEL_DEFAULT (0x3 << 4) + +#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1 (0x58) +#define VBUSVLDEXTSEL0 BIT(4) +#define PLLBTUNE BIT(5) + +#define USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2 (0x5c) +#define VREGBYPASS BIT(0) + +#define USB2_PHY_USB_PHY_HS_PHY_CTRL1 (0x60) +#define VBUSVLDEXT0 BIT(0) + +#define USB2_PHY_USB_PHY_HS_PHY_CTRL2 (0x64) +#define USB2_AUTO_RESUME BIT(0) +#define USB2_SUSPEND_N BIT(2) +#define USB2_SUSPEND_N_SEL BIT(3) + +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X0 (0x6c) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X1 (0x70) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X2 (0x74) +#define USB2_PHY_USB_PHY_HS_PHY_OVERRIDE_X3 (0x78) +#define PARAM_OVRD_MASK 0xFF + +#define USB2_PHY_USB_PHY_CFG0 (0x94) +#define UTMI_PHY_DATAPATH_CTRL_OVERRIDE_EN BIT(0) +#define UTMI_PHY_CMN_CTRL_OVERRIDE_EN BIT(1) + +#define USB2_PHY_USB_PHY_REFCLK_CTRL (0xa0) +#define REFCLK_SEL_MASK GENMASK(1, 0) +#define REFCLK_SEL_DEFAULT (0x2 << 0) + +#define HS_DISCONNECT_MASK GENMASK(2, 0) +#define SQUELCH_DETECTOR_MASK GENMASK(7, 5) + +#define HS_AMPLITUDE_MASK GENMASK(3, 0) +#define PREEMPHASIS_DURATION_MASK BIT(5) +#define PREEMPHASIS_AMPLITUDE_MASK GENMASK(7, 6) + +#define HS_RISE_FALL_MASK GENMASK(1, 0) +#define HS_CROSSOVER_VOLTAGE_MASK GENMASK(3, 2) +#define HS_OUTPUT_IMPEDANCE_MASK GENMASK(5, 4) + +#define LS_FS_OUTPUT_IMPEDANCE_MASK GENMASK(3, 0) + +#define SNPS_HS_NUM_VREGS ARRAY_SIZE(hs_7nm_vreg_names) + +struct override_param { + s32 value; + u8 reg_val; +}; + +struct override_param_map { + const char *prop_name; + const struct override_param *param_table; + u8 table_size; + u8 reg_offset; + u8 param_mask; +}; + +struct phy_override_seq { + bool need_update; + u8 offset; + u8 value; + u8 mask; +}; + +#define NUM_HSPHY_TUNING_PARAMS (9) + +/* struct hs_7nm_phy_cfg - per-PHY initialization config */ +struct hs_7nm_phy_cfg { + /* resets to be requested */ + struct reset_ctl *resets; + int num_resets; + + struct override_param_map *map_cfg; + struct phy_override_seq update_seq_cfg[NUM_HSPHY_TUNING_PARAMS]; +}; + +/** + * struct hs_7nm_phy_priv - snps hs phy attributes + */ +struct hs_7nm_phy_priv { + void __iomem *base; + + /* clocks to be requested */ + struct clk_bulk clks; + + /* resets to be requested */ + struct reset_ctl_bulk resets; + + struct hs_7nm_phy_cfg *cfg; +}; + +static inline void hs_7nm_write_mask(void __iomem *base, u32 offset, u32 mask, + u32 val) +{ + u32 reg; + + reg = readl_relaxed(base + offset); + + reg &= ~mask; + reg |= val & mask; + writel_relaxed(reg, base + offset); + + /* Ensure above write is completed */ + readl_relaxed(base + offset); +} + +static int hs_7nm_usb_init(struct phy *phy) +{ + struct hs_7nm_phy_priv *hs_7nm = dev_get_priv(phy->dev); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_CFG0, + UTMI_PHY_CMN_CTRL_OVERRIDE_EN, + UTMI_PHY_CMN_CTRL_OVERRIDE_EN); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_UTMI_CTRL5, POR, POR); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, + FSEL_MASK, 0); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, + PLLBTUNE, PLLBTUNE); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_REFCLK_CTRL, + REFCLK_SEL_DEFAULT, REFCLK_SEL_MASK); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON1, + VBUSVLDEXTSEL0, VBUSVLDEXTSEL0); + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL1, + VBUSVLDEXT0, VBUSVLDEXT0); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON2, + VREGBYPASS, VREGBYPASS); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2, + USB2_SUSPEND_N_SEL | USB2_SUSPEND_N, + USB2_SUSPEND_N_SEL | USB2_SUSPEND_N); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_UTMI_CTRL0, SLEEPM, + SLEEPM); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL_COMMON0, + SIDDQ, 0); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_UTMI_CTRL5, POR, 0); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_HS_PHY_CTRL2, + USB2_SUSPEND_N_SEL, 0); + + hs_7nm_write_mask(hs_7nm->base, USB2_PHY_USB_PHY_CFG0, + UTMI_PHY_CMN_CTRL_OVERRIDE_EN, 0); + + return 0; +} + +static int hs_7nm_phy_power_on(struct phy *phy) +{ + struct hs_7nm_phy_priv *hs_7nm = dev_get_priv(phy->dev); + int ret; + + clk_enable_bulk(&hs_7nm->clks); + + ret = reset_deassert_bulk(&hs_7nm->resets); + if (ret) + return ret; + + ret = hs_7nm_usb_init(phy); + if (ret) + return ret; + + return 0; +} + +static int hs_7nm_phy_power_off(struct phy *phy) +{ + struct hs_7nm_phy_priv *hs_7nm = dev_get_priv(phy->dev); + + reset_assert_bulk(&hs_7nm->resets); + clk_disable_bulk(&hs_7nm->clks); + + return 0; +} + +static int hs_7nm_phy_clk_init(struct udevice *dev, + struct hs_7nm_phy_priv *hs_7nm) +{ + int ret; + + ret = clk_get_bulk(dev, &hs_7nm->clks); + /* We may have no clocks */ + if (ret == -ENOENT) { + debug("%s: no clocks\n", __func__); + return 0; + } + if (ret < 0) { + printf("%s: Failed to get clocks %d\n", __func__, ret); + return ret; + } + + return 0; +} + +static int hs_7nm_phy_probe(struct udevice *dev) +{ + struct hs_7nm_phy_priv *hs_7nm = dev_get_priv(dev); + int ret; + + hs_7nm->base = (void __iomem *)dev_read_addr(dev); + if (IS_ERR(hs_7nm->base)) + return PTR_ERR(hs_7nm->base); + + hs_7nm->cfg = (struct hs_7nm_phy_cfg *)dev_get_driver_data(dev); + + ret = hs_7nm_phy_clk_init(dev, hs_7nm); + if (ret) { + printf("%s: hs_7nm_phy_clk_init %d\n", __func__, ret); + return ret; + } + + ret = reset_get_bulk(dev, &hs_7nm->resets); + if (ret < 0) { + printf("failed to get resets, ret = %d\n", ret); + return ret; + } + + clk_enable_bulk(&hs_7nm->clks); + reset_deassert_bulk(&hs_7nm->resets); + + return 0; +} + +static struct phy_ops hs_7nm_phy_ops = { + .power_on = hs_7nm_phy_power_on, + .power_off = hs_7nm_phy_power_off, +}; + +static const struct udevice_id hs_7nm_phy_ids[] = { + { + .compatible = "qcom,sm8150-usb-hs-phy", + }, + { + .compatible = "qcom,usb-snps-hs-5nm-phy", + }, + { + .compatible = "qcom,usb-snps-hs-7nm-phy", + }, + { + .compatible = "qcom,usb-snps-femto-v2-phy", + }, + {} +}; + +U_BOOT_DRIVER(qcom_usb_hs_7nm) = { + .name = "qcom-usb-hs-7nm", + .id = UCLASS_PHY, + .of_match = hs_7nm_phy_ids, + .ops = &hs_7nm_phy_ops, + .probe = hs_7nm_phy_probe, + .priv_auto = sizeof(struct hs_7nm_phy_priv), +}; From patchwork Fri Mar 15 15:10:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780513 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp252834wrs; Fri, 15 Mar 2024 08:11:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpkaWM9Z1/d1ARyzsPW60ZVgLTH8AdLIVOBZAsjhKL2uvErpXhAdZVBJp8iicJwRAVVzW6NgYaDp7x/u1PcZzO X-Google-Smtp-Source: AGHT+IFvTk5spKAk8EpMpUQYvL9bYqWsOnP8XnkbY4sHquyusIDG+t3Y86R76+GzfXbI2vU38+y0 X-Received: by 2002:adf:f405:0:b0:33e:78ca:e039 with SMTP id g5-20020adff405000000b0033e78cae039mr2369974wro.59.1710515467837; Fri, 15 Mar 2024 08:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515467; cv=none; d=google.com; s=arc-20160816; b=yDQHCoKP0pc0jfxx0O/4DU/GMWOhScHi35ub/GtQzb/pQfiZfIyVaekmOh58o6tyGC qYiM6I/6IIyFgaYmkeAbzv7m+fiTtcvfXDXhNag67HAHSXpfAnOJuEPpP4hxAehZFUZl 5VtPSoozL2ci9pVrhhRqrbhWPlh+dmJDGAu3pHs3+5uMIp9XuKi8q2to7WEh8mmZFVLZ xoddCzrM1JF87fL4/Axn1wKvSzHTKFSeygoKgs5ACTEaqL2/c7Y4k+I2CHrJLcQbwtwU tsykATHrZPstx7gSDtmMB9z+wiselKyEfF+go1WAPDwg3c6Szy/g2pwAfFdqRq0qiYg1 urXA== 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=Ik/CLzowJAROYo2NgNmeQLOoeZUcDXxXLIxLTfZ4zUQ=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=eMp/Wy9cmKuY6B25qs2ZoQZ5jfv9p4Mczj4mIcEuXL+sNXAmRUvWsGrOc3X+WF5XTp ib3SYXGwgYFp1kUaI+KK/g5qN1KUEi6Ds0VAtXmw27zqeyfxsTc6gXpfPyXyL/UF00iX f0pjnlOtTp+qY8Osb0CDKBBBYPr1p3bfk8+NLf+ksqEiCWFw3Ogd0gKbykufJ6fmyATX 3cSayMoATpjFJAYvFagRaoPlf1OksEd5QZ8Q56Fn5JkcSGB5k1NDRLB+TMuXZKCtB4kf dN6wbpHnlY3LC5P2viIAmeD++UGFi33xO+Yb80S8sfK3Vb16XOP6/Wud4vDehx03IjHX becg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XlPZEhnb; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id p11-20020adfcc8b000000b0033e47506171si1729953wrj.928.2024.03.15.08.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:11:07 -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=XlPZEhnb; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 59D5E8803A; Fri, 15 Mar 2024 16:10:39 +0100 (CET) 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="XlPZEhnb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26AA287FF5; Fri, 15 Mar 2024 16:10:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (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 662678800F for ; Fri, 15 Mar 2024 16:10:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33e9def4a6dso1461180f8f.2 for ; Fri, 15 Mar 2024 08:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515433; x=1711120233; 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=Ik/CLzowJAROYo2NgNmeQLOoeZUcDXxXLIxLTfZ4zUQ=; b=XlPZEhnbkyde4WkzpFlK7CJ1Hz+aXLSRKjY7i4geS9j83lo3BJj/2AA5SvwBE08uXY zHMxbZBGNL2uhn8iGesN9QOyQ8vFfmeimhnIXY9O1uU9cTuuqjjkgVj/G4B3X07hSZB7 n/A869ftlQDLbOF3W/Ab0k5vTHV4yvcZhzluJTPunfZ5t6E0tnop/+ZpIGT2pFcDQ1xq tpveWOp/J44hkDDo/mp3zpB4sZQdlS2yOnxg1Rrk1mqFJ1BQ3Xq4i0G5eKmt/S4NGwTO 9Ksx/7LEP3NNwEW1iL2a/5o9hD0avqRi56SietvKIyjnnHfuopU5Sc6Yz3IBrTnQo2j9 InsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515433; x=1711120233; 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=Ik/CLzowJAROYo2NgNmeQLOoeZUcDXxXLIxLTfZ4zUQ=; b=NuY75qBZXpMvkFRmi+BrzyWBlN5Xn4Kv6z/isC+br9RWfvJLlrNTq++K2LvabPeT3i sURt4PWdJkAbPjfwPI4nFqfT6gUl6bbPesb7jm4NlFjykOAZ4pUieNyn8cL/yGWTkO8U NY/wDoHcDjx3OMvMEGU463KBA5CHRsX8Gaoi19qszs9bpsqOrM0EHTi65lfbZ7git+uP UbManwqt7X6Tabgf5S3SO8Da+ltIgOZxRGyiH2r3wyVuD3RIkK7ML51tHTKTMGSfvH4K dhtkq3oQsgi9AyOCGi7E6J6zuG/k6vneTTXbGAw5la6BjZ/k8wNQ1RqDWqInRWXyii5r XQrA== X-Gm-Message-State: AOJu0YwlSp8Nefri+XnIvG0+ksmxwwJsfo7AfHmDW2+TjLrbdnA0mCWd iJ1YlgUbz9hzsTpkraAv1MUPKKuCv25hH1VBHpPyB2AqjjgzpFAJEs2mvoXEkfLU9sLlhyzzrY6 w X-Received: by 2002:a5d:69cd:0:b0:33e:c4c3:6f with SMTP id s13-20020a5d69cd000000b0033ec4c3006fmr2826672wrw.64.1710515432756; Fri, 15 Mar 2024 08:10:32 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:32 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:13 +0000 Subject: [PATCH v2 04/14] mach-snapdragon: disable power-domains for pre-reloc drivers MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-4-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2163; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=t1kvVGeh4i1zKEXYViR55Wh180+iwZWUeqzwnZOWrZs=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY9ZJi7v/uDBbhtT4R4ww1v0eVqOSuH1s0vDgmo/G h/nXTO9o5SFQZCDQVZMkUX8xDLLprWX7TW2L7gAM4eVCWQIAxenAEzkfCEjw8wDxs+b5xnODjw/ Kfu2t39GTu2Jts0uE7nSbsyXq5ZJ/crwVyB81SybkpDQLz+jnj3kepe6S5G5NTPGybvdN1bru8J 6YQA= 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 devices like the UART and clock controller reference an RPM(h) power domain. We don't support this device in U-Boot, so add DM_FLAG_DEFAULT_PD_CTRL_OFF to tell DM core not to try and enable the power domain. Signed-off-by: Caleb Connolly --- drivers/clk/qcom/clock-qcom.c | 2 ++ drivers/clk/qcom/clock-sdm845.c | 2 +- drivers/serial/serial_msm_geni.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c index 7a5938a06a34..6303dcbf8461 100644 --- a/drivers/clk/qcom/clock-qcom.c +++ b/drivers/clk/qcom/clock-qcom.c @@ -226,8 +226,9 @@ U_BOOT_DRIVER(qcom_clk) = { .id = UCLASS_CLK, .ops = &msm_clk_ops, .priv_auto = sizeof(struct msm_clk_priv), .probe = msm_clk_probe, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF, }; int qcom_cc_bind(struct udevice *parent) { @@ -410,5 +411,6 @@ U_BOOT_DRIVER(qcom_power) = { .name = "qcom_power", .id = UCLASS_POWER_DOMAIN, .ops = &qcom_power_ops, .probe = qcom_power_probe, + .flags = DM_FLAG_PRE_RELOC, }; diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index 36ffee79d966..babd83119e2c 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -182,6 +182,6 @@ U_BOOT_DRIVER(gcc_sdm845) = { .name = "gcc_sdm845", .id = UCLASS_NOP, .of_match = gcc_sdm845_of_match, .bind = qcom_cc_bind, - .flags = DM_FLAG_PRE_RELOC, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF, }; diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index e5c3dcffc1c6..4aa0bc8c72bc 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -602,9 +602,9 @@ U_BOOT_DRIVER(serial_msm_geni) = { .of_to_plat = msm_serial_ofdata_to_platdata, .priv_auto = sizeof(struct msm_serial_data), .probe = msm_serial_probe, .ops = &msm_serial_ops, - .flags = DM_FLAG_PRE_RELOC, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF, }; #ifdef CONFIG_DEBUG_UART_MSM_GENI From patchwork Fri Mar 15 15:10:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780515 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253101wrs; Fri, 15 Mar 2024 08:11:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVTYxl15K8tGJVSoYMkbcuN7xrVo56uFmf1+VFAE6gw4cyHAtPDAxcyM5gm4kuDt04Ek/kNS1Imv7I+7HaQ7EQB X-Google-Smtp-Source: AGHT+IEzaUKs9SW/ON4nAjgRovTVpFjAl3xbDmdncCEGC/QBNSxANcZYrwEJUkoTFYpFySr+LHGO X-Received: by 2002:a05:6000:12c1:b0:33e:64f3:65a5 with SMTP id l1-20020a05600012c100b0033e64f365a5mr3196656wrx.52.1710515491724; Fri, 15 Mar 2024 08:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515491; cv=none; d=google.com; s=arc-20160816; b=yEBNd04wJoJIhfySwcBox3TDSqHaBcTGqYKtYkm/Knc8kP+K6Jm3RNZh+NmrW0hkdo J/5/IREyRyhnFnGg3Vg2aJ0sVxpT0RnsNfFeK8ssXlVZ1fGRcLh0t65+UguBsdgBRSF4 4pnc4wJekNlGWA+sl2+GU6aidfMonJFLmXmob8akvzvLDuXK20XqUOw4pe9lCKH6GPcu qTYjN3G5LhD9MRJmc+Ntq9IgfyvaxIaaHKZd5UzYuqH3UCe7s13b/pPU6Nr/QMK7JLtp KTd+oCVh2N621n4OEkTOlm99T40hDyIIQQwXBe//HrvMCh9f+aqRqcZdYCftMWcZHVI+ x67A== 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=2tIybXB4/i8K8imQRbJFN4tQmiI9WOy924+pDsC6PPI=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=uH3Hra+ut8hEmnVXrAv92NsNsDkdLjRn+aroItrOZ/B+4NHTJ53KMyIWtKKbDV76Pi n/wTW00kyAN4eCKZW15ev4kU+XPOiZFHo5FnquEiYZHYEt1sB0gptgvCHsxpH6nWkPwU Hv1Y1E4jhpAGhukDcpa79KOuWv8hpNd2maI6NBOnd/Vep7I0/11S6x+cse8OO4/bh0K5 s++pVahOR4M86wme5bOq2IJJzLqOG4NuhQtYIx0JIvWqgx9MyTLCXLSKsQGGXtj3G0fg xnv85+NF0O3LhhadvJTlmsYhJeadVjLjRFvB8LkQl9pniGnJq90oJFdrtxatWz5zR0qQ CHhg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k62hcNu5; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id i18-20020a5d4392000000b0033e7a81cdacsi1744199wrq.911.2024.03.15.08.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:11: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=k62hcNu5; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B807C88050; Fri, 15 Mar 2024 16:10:41 +0100 (CET) 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="k62hcNu5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D47FB8804C; Fri, 15 Mar 2024 16:10:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 B32D687FC9 for ; Fri, 15 Mar 2024 16:10:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33e99b62e01so1773431f8f.0 for ; Fri, 15 Mar 2024 08:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515434; x=1711120234; 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=2tIybXB4/i8K8imQRbJFN4tQmiI9WOy924+pDsC6PPI=; b=k62hcNu53ylwUencKJViyvZAXcefxe4HkICisKkCH0tutO4NplXnRX/WxJtVU5j0l5 UXoZPaCNz+4vA0MsFIUNbv52hWqJpsK7eQrW0VoKx+8l6RIVkxOR3zeNNTD3zk6uTWka HvbnVUwcmX2VZmUtqsyt86GsiflMkMRp7ygOCPVmLJgOvQkexPmi6eF7lRfBg+zKbFqG Rn4vvZ0bGcbCR12M+DSyczovuECBjGPV5P3daPMrEFYtJ+4+wxTuexwGTtFF0hcQdHRF jD8iUwy+dOrU8tI1kszd1I6ApDMfMiZ9zvWlgUuGUFOZJdiUJfK/HqoFR2DYVmSvAuDr fEJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515434; x=1711120234; 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=2tIybXB4/i8K8imQRbJFN4tQmiI9WOy924+pDsC6PPI=; b=dODRIX8HR/dKJb0RUIyzhI4G/f+EuGT5VkSZ38J0tF2l51jqlZfV2i/+zmPbB0MX53 S+PryloKHWj76/OaFyV1Tu1Yil3rvXpaZkJXhf8NA8cpFaNUir6gLcYnPEHqsuz8KHiM cxpILvuDU2O3D7am3YY8Ztg3jVRmb8yVCOwCKMXCf/Iz6L0Ag42E33LmUKQOFxh8u4K4 kxW9q5Uw6VJaNddRTxOKhxW76Ta9zVDiVDUj3wgN9kUgCSpVZPbpl542FyOyuSVoOs15 5qhZWC6Q6kvp8uSdijWWn50qjVddPHik3YjHQuI033zx1Yrvlib6OKDoWvOm62s1ihAM LPFA== X-Gm-Message-State: AOJu0Yyt2yFjybpyFAttsBy12xD2vR2K9kRRsAIkLkafYogOZuGnEjRI 8jIJk59yM8SwRIgZXgqq6G76V5KIgAcnoAeVjLEzSKaX1YLAMGd2L+e1UTWNGy2tY9hxngiHHJk L X-Received: by 2002:a5d:5005:0:b0:33e:7831:8f69 with SMTP id e5-20020a5d5005000000b0033e78318f69mr4775208wrt.32.1710515433587; Fri, 15 Mar 2024 08:10:33 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:33 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:14 +0000 Subject: [PATCH v2 05/14] clk/qcom: use offsets for RCG registers MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-5-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=21410; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=+L98HdRBA9FLvBdzgwBiyByDFkebZAkL+nfO+eax76o=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY9/n3YQ9NW85DWjof+lU+0WER5P/cqDRbO3Wa2+r n5YbF1DRykLgyAHg6yYIov4iWWWTWsv22tsX3ABZg4rE8gQBi5OAZjI9+sMf2XCnlzmP5VQeVtz S7j/ac3Cqil11375PDH3CWPnyYu5bcfIsFWMb+P/vIYue5mH+3inv70QJKgYf+fETbPlIcK7OHd K/wIA 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 RCG registers always have the same offsets, so only store the base CMD register address and calculate the others relative to that. Signed-off-by: Caleb Connolly --- drivers/clk/qcom/clock-apq8016.c | 39 +------------ drivers/clk/qcom/clock-apq8096.c | 28 +-------- drivers/clk/qcom/clock-qcom.c | 22 +++---- drivers/clk/qcom/clock-qcom.h | 16 +++--- drivers/clk/qcom/clock-qcs404.c | 121 +++++---------------------------------- drivers/clk/qcom/clock-sdm845.c | 16 +----- 6 files changed, 39 insertions(+), 203 deletions(-) diff --git a/drivers/clk/qcom/clock-apq8016.c b/drivers/clk/qcom/clock-apq8016.c index e6647f7c41dd..5a5868169c89 100644 --- a/drivers/clk/qcom/clock-apq8016.c +++ b/drivers/clk/qcom/clock-apq8016.c @@ -22,13 +22,9 @@ #define APCS_GPLL_ENA_VOTE (0x45000) #define APCS_CLOCK_BRANCH_ENA_VOTE (0x45004) #define SDCC_BCR(n) ((n * 0x1000) + 0x41000) -#define SDCC_CMD_RCGR(n) ((n * 0x1000) + 0x41004) -#define SDCC_CFG_RCGR(n) ((n * 0x1000) + 0x41008) -#define SDCC_M(n) ((n * 0x1000) + 0x4100C) -#define SDCC_N(n) ((n * 0x1000) + 0x41010) -#define SDCC_D(n) ((n * 0x1000) + 0x41014) +#define SDCC_CMD_RCGR(n) (((n + 1) * 0x1000) + 0x41004) #define SDCC_APPS_CBCR(n) ((n * 0x1000) + 0x41018) #define SDCC_AHB_CBCR(n) ((n * 0x1000) + 0x4101C) /* BLSP1 AHB clock (root clock for BLSP) */ @@ -37,33 +33,12 @@ /* Uart clock control registers */ #define BLSP1_UART2_BCR (0x3028) #define BLSP1_UART2_APPS_CBCR (0x302C) #define BLSP1_UART2_APPS_CMD_RCGR (0x3034) -#define BLSP1_UART2_APPS_CFG_RCGR (0x3038) -#define BLSP1_UART2_APPS_M (0x303C) -#define BLSP1_UART2_APPS_N (0x3040) -#define BLSP1_UART2_APPS_D (0x3044) /* GPLL0 clock control registers */ #define GPLL0_STATUS_ACTIVE BIT(17) -static const struct bcr_regs sdc_regs[] = { - { - .cfg_rcgr = SDCC_CFG_RCGR(1), - .cmd_rcgr = SDCC_CMD_RCGR(1), - .M = SDCC_M(1), - .N = SDCC_N(1), - .D = SDCC_D(1), - }, - { - .cfg_rcgr = SDCC_CFG_RCGR(2), - .cmd_rcgr = SDCC_CMD_RCGR(2), - .M = SDCC_M(2), - .N = SDCC_N(2), - .D = SDCC_D(2), - } -}; - static struct pll_vote_clk gpll0_vote_clk = { .status = GPLL0_STATUS, .status_bit = GPLL0_STATUS_ACTIVE, .ena_vote = APCS_GPLL_ENA_VOTE, @@ -85,32 +60,24 @@ static int clk_init_sdc(struct msm_clk_priv *priv, int slot, uint rate) div = 4; clk_enable_cbc(priv->base + SDCC_AHB_CBCR(slot)); /* 800Mhz/div, gpll0 */ - clk_rcg_set_rate_mnd(priv->base, &sdc_regs[slot], div, 0, 0, + clk_rcg_set_rate_mnd(priv->base, SDCC_CMD_RCGR(slot), div, 0, 0, CFG_CLK_SRC_GPLL0, 8); clk_enable_gpll0(priv->base, &gpll0_vote_clk); clk_enable_cbc(priv->base + SDCC_APPS_CBCR(slot)); return rate; } -static const struct bcr_regs uart2_regs = { - .cfg_rcgr = BLSP1_UART2_APPS_CFG_RCGR, - .cmd_rcgr = BLSP1_UART2_APPS_CMD_RCGR, - .M = BLSP1_UART2_APPS_M, - .N = BLSP1_UART2_APPS_N, - .D = BLSP1_UART2_APPS_D, -}; - /* UART: 115200 */ int apq8016_clk_init_uart(phys_addr_t base) { /* Enable AHB clock */ clk_enable_vote_clk(base, &gcc_blsp1_ahb_clk); /* 7372800 uart block clock @ GPLL0 */ - clk_rcg_set_rate_mnd(base, &uart2_regs, 1, 144, 15625, + clk_rcg_set_rate_mnd(base, BLSP1_UART2_APPS_CMD_RCGR, 1, 144, 15625, CFG_CLK_SRC_GPLL0, 16); /* Vote for gpll0 clock */ clk_enable_gpll0(base, &gpll0_vote_clk); diff --git a/drivers/clk/qcom/clock-apq8096.c b/drivers/clk/qcom/clock-apq8096.c index a4731613c5e0..479f9771a464 100644 --- a/drivers/clk/qcom/clock-apq8096.c +++ b/drivers/clk/qcom/clock-apq8096.c @@ -25,33 +25,17 @@ #define SDCC2_BCR (0x14000) /* block reset */ #define SDCC2_APPS_CBCR (0x14004) /* branch control */ #define SDCC2_AHB_CBCR (0x14008) #define SDCC2_CMD_RCGR (0x14010) -#define SDCC2_CFG_RCGR (0x14014) -#define SDCC2_M (0x14018) -#define SDCC2_N (0x1401C) -#define SDCC2_D (0x14020) #define BLSP2_AHB_CBCR (0x25004) #define BLSP2_UART2_APPS_CBCR (0x29004) #define BLSP2_UART2_APPS_CMD_RCGR (0x2900C) -#define BLSP2_UART2_APPS_CFG_RCGR (0x29010) -#define BLSP2_UART2_APPS_M (0x29014) -#define BLSP2_UART2_APPS_N (0x29018) -#define BLSP2_UART2_APPS_D (0x2901C) /* GPLL0 clock control registers */ #define GPLL0_STATUS_ACTIVE BIT(30) #define APCS_GPLL_ENA_VOTE_GPLL0 BIT(0) -static const struct bcr_regs sdc_regs = { - .cfg_rcgr = SDCC2_CFG_RCGR, - .cmd_rcgr = SDCC2_CMD_RCGR, - .M = SDCC2_M, - .N = SDCC2_N, - .D = SDCC2_D, -}; - static const struct pll_vote_clk gpll0_vote_clk = { .status = GPLL0_STATUS, .status_bit = GPLL0_STATUS_ACTIVE, .ena_vote = APCS_GPLL_ENA_VOTE, @@ -68,31 +52,23 @@ static int clk_init_sdc(struct msm_clk_priv *priv, uint rate) { int div = 5; clk_enable_cbc(priv->base + SDCC2_AHB_CBCR); - clk_rcg_set_rate_mnd(priv->base, &sdc_regs, div, 0, 0, + clk_rcg_set_rate_mnd(priv->base, SDCC2_CMD_RCGR, div, 0, 0, CFG_CLK_SRC_GPLL0, 8); clk_enable_gpll0(priv->base, &gpll0_vote_clk); clk_enable_cbc(priv->base + SDCC2_APPS_CBCR); return rate; } -static const struct bcr_regs uart2_regs = { - .cfg_rcgr = BLSP2_UART2_APPS_CFG_RCGR, - .cmd_rcgr = BLSP2_UART2_APPS_CMD_RCGR, - .M = BLSP2_UART2_APPS_M, - .N = BLSP2_UART2_APPS_N, - .D = BLSP2_UART2_APPS_D, -}; - static int clk_init_uart(struct msm_clk_priv *priv) { /* Enable AHB clock */ clk_enable_vote_clk(priv->base, &gcc_blsp2_ahb_clk); /* 7372800 uart block clock @ GPLL0 */ - clk_rcg_set_rate_mnd(priv->base, &uart2_regs, 1, 192, 15625, + clk_rcg_set_rate_mnd(priv->base, BLSP2_UART2_APPS_CMD_RCGR, 1, 192, 15625, CFG_CLK_SRC_GPLL0, 16); /* Vote for gpll0 clock */ clk_enable_gpll0(priv->base, &gpll0_vote_clk); diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c index 6303dcbf8461..05e5ab7d094b 100644 --- a/drivers/clk/qcom/clock-qcom.c +++ b/drivers/clk/qcom/clock-qcom.c @@ -103,9 +103,9 @@ void clk_bcr_update(phys_addr_t apps_cmd_rcgr) /* * root set rate for clocks with half integer and MND divider * div should be pre-calculated ((div * 2) - 1) */ -void clk_rcg_set_rate_mnd(phys_addr_t base, const struct bcr_regs *regs, +void clk_rcg_set_rate_mnd(phys_addr_t base, uint32_t cmd_rcgr, int div, int m, int n, int source, u8 mnd_width) { u32 cfg; /* M value for MND divider. */ @@ -119,14 +119,14 @@ void clk_rcg_set_rate_mnd(phys_addr_t base, const struct bcr_regs *regs, debug("m %#x n %#x d %#x div %#x mask %#x\n", m_val, n_val, d_val, div, mask); /* Program MND values */ - writel(m_val & mask, base + regs->M); - writel(n_val & mask, base + regs->N); - writel(d_val & mask, base + regs->D); + writel(m_val & mask, base + cmd_rcgr + RCG_M_REG); + writel(n_val & mask, base + cmd_rcgr + RCG_N_REG); + writel(d_val & mask, base + cmd_rcgr + RCG_D_REG); /* setup src select and divider */ - cfg = readl(base + regs->cfg_rcgr); + cfg = readl(base + cmd_rcgr + RCG_CFG_REG); cfg &= ~(CFG_SRC_SEL_MASK | CFG_MODE_MASK | CFG_HW_CLK_CTRL_MASK | CFG_SRC_DIV_MASK); cfg |= source & CFG_SRC_SEL_MASK; /* Select clock source */ @@ -135,22 +135,22 @@ void clk_rcg_set_rate_mnd(phys_addr_t base, const struct bcr_regs *regs, if (n && n != m) cfg |= CFG_MODE_DUAL_EDGE; - writel(cfg, base + regs->cfg_rcgr); /* Write new clock configuration */ + writel(cfg, base + cmd_rcgr + RCG_CFG_REG); /* Write new clock configuration */ /* Inform h/w to start using the new config. */ - clk_bcr_update(base + regs->cmd_rcgr); + clk_bcr_update(base + cmd_rcgr); } /* root set rate for clocks with half integer and mnd_width=0 */ -void clk_rcg_set_rate(phys_addr_t base, const struct bcr_regs *regs, int div, +void clk_rcg_set_rate(phys_addr_t base, uint32_t cmd_rcgr, int div, int source) { u32 cfg; /* setup src select and divider */ - cfg = readl(base + regs->cfg_rcgr); + cfg = readl(base + cmd_rcgr + RCG_CFG_REG); cfg &= ~(CFG_SRC_SEL_MASK | CFG_MODE_MASK | CFG_HW_CLK_CTRL_MASK); cfg |= source & CFG_CLK_SRC_MASK; /* Select clock source */ /* @@ -159,12 +159,12 @@ void clk_rcg_set_rate(phys_addr_t base, const struct bcr_regs *regs, int div, */ if (div) cfg |= (2 * div - 1) & CFG_SRC_DIV_MASK; - writel(cfg, base + regs->cfg_rcgr); /* Write new clock configuration */ + writel(cfg, base + cmd_rcgr + RCG_CFG_REG); /* Write new clock configuration */ /* Inform h/w to start using the new config. */ - clk_bcr_update(base + regs->cmd_rcgr); + clk_bcr_update(base + cmd_rcgr); } const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, uint rate) { diff --git a/drivers/clk/qcom/clock-qcom.h b/drivers/clk/qcom/clock-qcom.h index 12a1eaec2b2e..a7f833a4b6dd 100644 --- a/drivers/clk/qcom/clock-qcom.h +++ b/drivers/clk/qcom/clock-qcom.h @@ -11,8 +11,13 @@ #define CFG_CLK_SRC_GPLL0 (1 << 8) #define CFG_CLK_SRC_GPLL0_EVEN (6 << 8) #define CFG_CLK_SRC_MASK (7 << 8) +#define RCG_CFG_REG 0x4 +#define RCG_M_REG 0x8 +#define RCG_N_REG 0xc +#define RCG_D_REG 0x10 + struct pll_vote_clk { uintptr_t status; int status_bit; uintptr_t ena_vote; @@ -23,15 +28,8 @@ struct vote_clk { uintptr_t cbcr_reg; uintptr_t ena_vote; int vote_bit; }; -struct bcr_regs { - uintptr_t cfg_rcgr; - uintptr_t cmd_rcgr; - uintptr_t M; - uintptr_t N; - uintptr_t D; -}; struct freq_tbl { uint freq; uint src; @@ -87,11 +85,11 @@ void clk_enable_gpll0(phys_addr_t base, const struct pll_vote_clk *gpll0); void clk_bcr_update(phys_addr_t apps_cmd_rgcr); void clk_enable_cbc(phys_addr_t cbcr); void clk_enable_vote_clk(phys_addr_t base, const struct vote_clk *vclk); const struct freq_tbl *qcom_find_freq(const struct freq_tbl *f, uint rate); -void clk_rcg_set_rate_mnd(phys_addr_t base, const struct bcr_regs *regs, +void clk_rcg_set_rate_mnd(phys_addr_t base, uint32_t cmd_rcgr, int div, int m, int n, int source, u8 mnd_width); -void clk_rcg_set_rate(phys_addr_t base, const struct bcr_regs *regs, int div, +void clk_rcg_set_rate(phys_addr_t base, uint32_t cmd_rcgr, int div, int source); static inline void qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id) { diff --git a/drivers/clk/qcom/clock-qcs404.c b/drivers/clk/qcom/clock-qcs404.c index 958312b88842..64a0a2d36754 100644 --- a/drivers/clk/qcom/clock-qcs404.c +++ b/drivers/clk/qcom/clock-qcs404.c @@ -27,37 +27,24 @@ /* Uart clock control registers */ #define BLSP1_UART2_BCR (0x3028) #define BLSP1_UART2_APPS_CBCR (0x302C) #define BLSP1_UART2_APPS_CMD_RCGR (0x3034) -#define BLSP1_UART2_APPS_CFG_RCGR (0x3038) -#define BLSP1_UART2_APPS_M (0x303C) -#define BLSP1_UART2_APPS_N (0x3040) -#define BLSP1_UART2_APPS_D (0x3044) /* I2C controller clock control registerss */ #define BLSP1_QUP0_I2C_APPS_CBCR (0x6028) #define BLSP1_QUP0_I2C_APPS_CMD_RCGR (0x602C) -#define BLSP1_QUP0_I2C_APPS_CFG_RCGR (0x6030) #define BLSP1_QUP1_I2C_APPS_CBCR (0x2008) #define BLSP1_QUP1_I2C_APPS_CMD_RCGR (0x200C) -#define BLSP1_QUP1_I2C_APPS_CFG_RCGR (0x2010) #define BLSP1_QUP2_I2C_APPS_CBCR (0x3010) #define BLSP1_QUP2_I2C_APPS_CMD_RCGR (0x3000) -#define BLSP1_QUP2_I2C_APPS_CFG_RCGR (0x3004) #define BLSP1_QUP3_I2C_APPS_CBCR (0x4020) #define BLSP1_QUP3_I2C_APPS_CMD_RCGR (0x4000) -#define BLSP1_QUP3_I2C_APPS_CFG_RCGR (0x4004) #define BLSP1_QUP4_I2C_APPS_CBCR (0x5020) #define BLSP1_QUP4_I2C_APPS_CMD_RCGR (0x5000) -#define BLSP1_QUP4_I2C_APPS_CFG_RCGR (0x5004) /* SD controller clock control registers */ #define SDCC_BCR(n) (((n) * 0x1000) + 0x41000) -#define SDCC_CMD_RCGR(n) (((n) * 0x1000) + 0x41004) -#define SDCC_CFG_RCGR(n) (((n) * 0x1000) + 0x41008) -#define SDCC_M(n) (((n) * 0x1000) + 0x4100C) -#define SDCC_N(n) (((n) * 0x1000) + 0x41010) -#define SDCC_D(n) (((n) * 0x1000) + 0x41014) +#define SDCC_CMD_RCGR(n) (((n + 1) * 0x1000) + 0x41004) #define SDCC_APPS_CBCR(n) (((n) * 0x1000) + 0x41018) #define SDCC_AHB_CBCR(n) (((n) * 0x1000) + 0x4101C) /* USB-3.0 controller clock control registers */ @@ -69,12 +56,8 @@ #define USB30_MOCK_UTMI_CBCR (0x39014) #define USB30_MOCK_UTMI_CMD_RCGR (0x3901C) #define USB30_MOCK_UTMI_CFG_RCGR (0x39020) #define USB30_MASTER_CMD_RCGR (0x39028) -#define USB30_MASTER_CFG_RCGR (0x3902C) -#define USB30_MASTER_M (0x39030) -#define USB30_MASTER_N (0x39034) -#define USB30_MASTER_D (0x39038) #define USB2A_PHY_SLEEP_CBCR (0x4102C) #define USB_HS_PHY_CFG_AHB_CBCR (0x41030) /* ETH controller clock control registers */ @@ -84,12 +67,8 @@ #define ETH_AXI_CBCR (0x4e010) #define EMAC_PTP_CMD_RCGR (0x4e014) #define EMAC_PTP_CFG_RCGR (0x4e018) #define EMAC_CMD_RCGR (0x4e01c) -#define EMAC_CFG_RCGR (0x4e020) -#define EMAC_M (0x4e024) -#define EMAC_N (0x4e028) -#define EMAC_D (0x4e02c) /* GPLL0 clock control registers */ #define GPLL0_STATUS_ACTIVE BIT(31) @@ -102,24 +81,8 @@ static struct vote_clk gcc_blsp1_ahb_clk = { .ena_vote = APCS_CLOCK_BRANCH_ENA_VOTE, .vote_bit = BIT(10) | BIT(5) | BIT(4), }; -static const struct bcr_regs uart2_regs = { - .cfg_rcgr = BLSP1_UART2_APPS_CFG_RCGR, - .cmd_rcgr = BLSP1_UART2_APPS_CMD_RCGR, - .M = BLSP1_UART2_APPS_M, - .N = BLSP1_UART2_APPS_N, - .D = BLSP1_UART2_APPS_D, -}; - -static const struct bcr_regs sdc_regs = { - .cfg_rcgr = SDCC_CFG_RCGR(1), - .cmd_rcgr = SDCC_CMD_RCGR(1), - .M = SDCC_M(1), - .N = SDCC_N(1), - .D = SDCC_D(1), -}; - static struct pll_vote_clk gpll0_vote_clk = { .status = GPLL0_STATUS, .status_bit = GPLL0_STATUS_ACTIVE, .ena_vote = APCS_GPLL_ENA_VOTE, @@ -132,92 +95,38 @@ static struct pll_vote_clk gpll1_vote_clk = { .ena_vote = APCS_GPLL_ENA_VOTE, .vote_bit = BIT(1), }; -static const struct bcr_regs usb30_master_regs = { - .cfg_rcgr = USB30_MASTER_CFG_RCGR, - .cmd_rcgr = USB30_MASTER_CMD_RCGR, - .M = USB30_MASTER_M, - .N = USB30_MASTER_N, - .D = USB30_MASTER_D, -}; - -static const struct bcr_regs emac_regs = { - .cfg_rcgr = EMAC_CFG_RCGR, - .cmd_rcgr = EMAC_CMD_RCGR, - .M = EMAC_M, - .N = EMAC_N, - .D = EMAC_D, -}; - -static const struct bcr_regs emac_ptp_regs = { - .cfg_rcgr = EMAC_PTP_CFG_RCGR, - .cmd_rcgr = EMAC_PTP_CMD_RCGR, - .M = EMAC_M, - .N = EMAC_N, - .D = EMAC_D, -}; - -static const struct bcr_regs blsp1_qup0_i2c_apps_regs = { - .cmd_rcgr = BLSP1_QUP0_I2C_APPS_CMD_RCGR, - .cfg_rcgr = BLSP1_QUP0_I2C_APPS_CFG_RCGR, - /* mnd_width = 0 */ -}; - -static const struct bcr_regs blsp1_qup1_i2c_apps_regs = { - .cmd_rcgr = BLSP1_QUP1_I2C_APPS_CMD_RCGR, - .cfg_rcgr = BLSP1_QUP1_I2C_APPS_CFG_RCGR, - /* mnd_width = 0 */ -}; - -static const struct bcr_regs blsp1_qup2_i2c_apps_regs = { - .cmd_rcgr = BLSP1_QUP2_I2C_APPS_CMD_RCGR, - .cfg_rcgr = BLSP1_QUP2_I2C_APPS_CFG_RCGR, - /* mnd_width = 0 */ -}; - -static const struct bcr_regs blsp1_qup3_i2c_apps_regs = { - .cmd_rcgr = BLSP1_QUP3_I2C_APPS_CMD_RCGR, - .cfg_rcgr = BLSP1_QUP3_I2C_APPS_CFG_RCGR, - /* mnd_width = 0 */ -}; - -static const struct bcr_regs blsp1_qup4_i2c_apps_regs = { - .cmd_rcgr = BLSP1_QUP4_I2C_APPS_CMD_RCGR, - .cfg_rcgr = BLSP1_QUP4_I2C_APPS_CFG_RCGR, - /* mnd_width = 0 */ -}; - static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) { struct msm_clk_priv *priv = dev_get_priv(clk->dev); switch (clk->id) { case GCC_BLSP1_UART2_APPS_CLK: /* UART: 1843200Hz for a fixed 115200 baudrate (19200000 * (12/125)) */ - clk_rcg_set_rate_mnd(priv->base, &uart2_regs, 0, 12, 125, + clk_rcg_set_rate_mnd(priv->base, BLSP1_UART2_APPS_CMD_RCGR, 0, 12, 125, CFG_CLK_SRC_CXO, 16); clk_enable_cbc(priv->base + BLSP1_UART2_APPS_CBCR); return 1843200; case GCC_SDCC1_APPS_CLK: /* SDCC1: 200MHz */ - clk_rcg_set_rate_mnd(priv->base, &sdc_regs, 7, 0, 0, + clk_rcg_set_rate_mnd(priv->base, SDCC_CMD_RCGR(0), 7, 0, 0, CFG_CLK_SRC_GPLL0, 8); clk_enable_gpll0(priv->base, &gpll0_vote_clk); clk_enable_cbc(priv->base + SDCC_APPS_CBCR(1)); return rate; case GCC_ETH_RGMII_CLK: if (rate == 250000000) - clk_rcg_set_rate_mnd(priv->base, &emac_regs, 3, 0, 0, + clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, CFG_CLK_SRC_GPLL1, 8); else if (rate == 125000000) - clk_rcg_set_rate_mnd(priv->base, &emac_regs, 7, 0, 0, + clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 7, 0, 0, CFG_CLK_SRC_GPLL1, 8); else if (rate == 50000000) - clk_rcg_set_rate_mnd(priv->base, &emac_regs, 19, 0, 0, + clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 19, 0, 0, CFG_CLK_SRC_GPLL1, 8); else if (rate == 5000000) - clk_rcg_set_rate_mnd(priv->base, &emac_regs, 3, 1, 50, + clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 1, 50, CFG_CLK_SRC_GPLL1, 8); return rate; } @@ -236,9 +145,9 @@ static int qcs404_clk_enable(struct clk *clk) switch (clk->id) { case GCC_USB30_MASTER_CLK: clk_enable_cbc(priv->base + USB30_MASTER_CBCR); - clk_rcg_set_rate_mnd(priv->base, &usb30_master_regs, 7, 0, 0, + clk_rcg_set_rate_mnd(priv->base, USB30_MASTER_CMD_RCGR, 7, 0, 0, CFG_CLK_SRC_GPLL0, 8); break; case GCC_SYS_NOC_USB3_CLK: clk_enable_cbc(priv->base + SYS_NOC_USB3_CBCR); @@ -258,16 +167,16 @@ static int qcs404_clk_enable(struct clk *clk) case GCC_ETH_PTP_CLK: /* SPEED_1000: freq -> 250MHz */ clk_enable_cbc(priv->base + ETH_PTP_CBCR); clk_enable_gpll0(priv->base, &gpll1_vote_clk); - clk_rcg_set_rate_mnd(priv->base, &emac_ptp_regs, 3, 0, 0, + clk_rcg_set_rate_mnd(priv->base, EMAC_PTP_CMD_RCGR, 3, 0, 0, CFG_CLK_SRC_GPLL1, 8); break; case GCC_ETH_RGMII_CLK: /* SPEED_1000: freq -> 250MHz */ clk_enable_cbc(priv->base + ETH_RGMII_CBCR); clk_enable_gpll0(priv->base, &gpll1_vote_clk); - clk_rcg_set_rate_mnd(priv->base, &emac_regs, 3, 0, 0, + clk_rcg_set_rate_mnd(priv->base, EMAC_CMD_RCGR, 3, 0, 0, CFG_CLK_SRC_GPLL1, 8); break; case GCC_ETH_SLAVE_AHB_CLK: clk_enable_cbc(priv->base + ETH_SLAVE_AHB_CBCR); @@ -279,29 +188,29 @@ static int qcs404_clk_enable(struct clk *clk) clk_enable_vote_clk(priv->base, &gcc_blsp1_ahb_clk); break; case GCC_BLSP1_QUP0_I2C_APPS_CLK: clk_enable_cbc(priv->base + BLSP1_QUP0_I2C_APPS_CBCR); - clk_rcg_set_rate(priv->base, &blsp1_qup0_i2c_apps_regs, 0, + clk_rcg_set_rate(priv->base, BLSP1_QUP0_I2C_APPS_CMD_RCGR, 0, CFG_CLK_SRC_CXO); break; case GCC_BLSP1_QUP1_I2C_APPS_CLK: clk_enable_cbc(priv->base + BLSP1_QUP1_I2C_APPS_CBCR); - clk_rcg_set_rate(priv->base, &blsp1_qup1_i2c_apps_regs, 0, + clk_rcg_set_rate(priv->base, BLSP1_QUP1_I2C_APPS_CMD_RCGR, 0, CFG_CLK_SRC_CXO); break; case GCC_BLSP1_QUP2_I2C_APPS_CLK: clk_enable_cbc(priv->base + BLSP1_QUP2_I2C_APPS_CBCR); - clk_rcg_set_rate(priv->base, &blsp1_qup2_i2c_apps_regs, 0, + clk_rcg_set_rate(priv->base, BLSP1_QUP2_I2C_APPS_CMD_RCGR, 0, CFG_CLK_SRC_CXO); break; case GCC_BLSP1_QUP3_I2C_APPS_CLK: clk_enable_cbc(priv->base + BLSP1_QUP3_I2C_APPS_CBCR); - clk_rcg_set_rate(priv->base, &blsp1_qup3_i2c_apps_regs, 0, + clk_rcg_set_rate(priv->base, BLSP1_QUP3_I2C_APPS_CMD_RCGR, 0, CFG_CLK_SRC_CXO); break; case GCC_BLSP1_QUP4_I2C_APPS_CLK: clk_enable_cbc(priv->base + BLSP1_QUP4_I2C_APPS_CBCR); - clk_rcg_set_rate(priv->base, &blsp1_qup4_i2c_apps_regs, 0, + clk_rcg_set_rate(priv->base, BLSP1_QUP4_I2C_APPS_CMD_RCGR, 0, CFG_CLK_SRC_CXO); break; case GCC_SDCC1_AHB_CLK: clk_enable_cbc(priv->base + SDCC_AHB_CBCR(1)); diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index babd83119e2c..ccb0cf245d33 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -18,15 +18,9 @@ #include #include "clock-qcom.h" -#define SE9_AHB_CBCR 0x25004 -#define SE9_UART_APPS_CBCR 0x29004 #define SE9_UART_APPS_CMD_RCGR 0x18148 -#define SE9_UART_APPS_CFG_RCGR 0x1814C -#define SE9_UART_APPS_M 0x18150 -#define SE9_UART_APPS_N 0x18154 -#define SE9_UART_APPS_D 0x18158 static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { F(7372800, CFG_CLK_SRC_GPLL0_EVEN, 1, 384, 15625), F(14745600, CFG_CLK_SRC_GPLL0_EVEN, 1, 768, 15625), @@ -45,25 +39,17 @@ static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { F(128000000, CFG_CLK_SRC_GPLL0, 1, 16, 75), { } }; -static const struct bcr_regs uart2_regs = { - .cfg_rcgr = SE9_UART_APPS_CFG_RCGR, - .cmd_rcgr = SE9_UART_APPS_CMD_RCGR, - .M = SE9_UART_APPS_M, - .N = SE9_UART_APPS_N, - .D = SE9_UART_APPS_D, -}; - static ulong sdm845_clk_set_rate(struct clk *clk, ulong rate) { struct msm_clk_priv *priv = dev_get_priv(clk->dev); const struct freq_tbl *freq; switch (clk->id) { case GCC_QUPV3_WRAP1_S1_CLK: /* UART9 */ freq = qcom_find_freq(ftbl_gcc_qupv3_wrap0_s0_clk_src, rate); - clk_rcg_set_rate_mnd(priv->base, &uart2_regs, + clk_rcg_set_rate_mnd(priv->base, SE9_UART_APPS_CMD_RCGR, freq->pre_div, freq->m, freq->n, freq->src, 16); return freq->freq; default: return 0; From patchwork Fri Mar 15 15:10:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780517 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253303wrs; Fri, 15 Mar 2024 08:11:54 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXzhVR9Nza2oaNX9/gFAGjVfk6CeNpmMneUj8qZ+xSz5IWwIP4qDU8tXXK+V7qeReemD/Llge8UXjnHGimDjElV X-Google-Smtp-Source: AGHT+IGguXAgDQ65SXxgdEl1SWqLEHOGmpNUCeEkxct3cR7c9geaNqHchuN1rNtwpdNd1xs4Fa7V X-Received: by 2002:a05:600c:3553:b0:413:f1c0:78b with SMTP id i19-20020a05600c355300b00413f1c0078bmr4312125wmq.41.1710515513971; Fri, 15 Mar 2024 08:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515513; cv=none; d=google.com; s=arc-20160816; b=iGwCOkM3HCXlyKg49hxZB4E70QyBEaZ+9mahJOAzlGSi/PN21rhoHbh2djWb563MoA WLvBi4wX9e5kIjXJte2fjhzvX4KAI2DsQ22G7Ze3VWD14SRpTGB6D20b8UwXrsM+nSWd 8CgbBjJH1P1oditPtJGuWNnkovFcgYRuPOF5FP7b1fNu+2ESb5pyh3+NJJFyk2HqgERQ DxBngyw2+KTpY5QR4rH1GkQ3glIZpYhf7hC4+elH5egt6vGhCvZL2kObsMmrTPuEQ4IA GuURil4yqo6oBYzkww6/y8/WEB3fBK2f8I3xxhCTY10JBlvld+rCgl6omqc6fnt/mAIa Bkiw== 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=XcXDGKGs2bZP+ebZn00UwvTozAt6kTe7PFxPgb291lE=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=uEwgkdR3kYq/2C6sWgjab32eYqqvIY8qSReFBbewh33CLm5ukWn0zP21NCxgE1aP8Q e4ePNAgVzYW0lbw9ju/5riU0rpgck9LLpi513GqQZ1KIbk30S0bo4P6em6GDxALhO4vZ aqsa/8dCDMeStjEqIEWLVNEZULKpKukOuls905onR7LL3HZmfKOid4+owYI4GCG0+zQy GwMrtRQMJwU5V1jyP5ywXhgQOZwaVGgVmOLwaDoIbbg2nyjuv7gxdyYEh3htv3e4e31/ 2/nS8o+gWTXoFO1fz2RieYXTVEUp2CcmYb9MV56ie9KnnpMHnHxSeSWwOmtHN9rSumzh 6PEw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WkcVKsnG; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id w11-20020a05600c474b00b00412a002ae92si3597768wmo.186.2024.03.15.08.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:11:53 -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=WkcVKsnG; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA42D88048; Fri, 15 Mar 2024 16:10:44 +0100 (CET) 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="WkcVKsnG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1A6588053; Fri, 15 Mar 2024 16:10:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AEDE788001 for ; Fri, 15 Mar 2024 16:10:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-414025406d7so3626715e9.2 for ; Fri, 15 Mar 2024 08:10:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515435; x=1711120235; 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=XcXDGKGs2bZP+ebZn00UwvTozAt6kTe7PFxPgb291lE=; b=WkcVKsnGhl8blRq+GE6Awm0OWYLsXuZlg4GxBKtkeM5kstvYLh2d+0oqYdPUKW7p8+ FMex9Oet7rSXzunWlEzcjvoTYVc3mQJ2e7S7IuK9rGxNmupcDLPreKjlnBtjfVWYQfpV j9vElPKKw5k7s/zCVvny3LmZUDKgd6k6PKDsrg3w9iAOD/Nxb3YxUYAxg1xcLjHzRHBw iQ2iUVsiEPn5rDqOYVKFkwaj2DEDUj8Tx9a5aVHxsdYZfKXfb/8+B3d03DEjnPswpJ84 SD4pjT9VAj4DMcgw2L54IB58n3tAfdWpJRYY8HDUSUabbZiExlH6Ka4y3jTYYC/bG80I O7/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515435; x=1711120235; 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=XcXDGKGs2bZP+ebZn00UwvTozAt6kTe7PFxPgb291lE=; b=WsNHZGpUsqSvcoQFvKBUpK2375N9TjQ4ahJX5MWN847BD3B9wQwTgPlafVMyejZzAc DUYqeCZt9UQsrHFxjdnKJOFuXFwS1xWFdIdOfwFSvWfI86rmhRYC0oie3Zd1++tJ2O// 3JuL5ICl2mMAU2k6wDbIrq50htD0yZjp1jUHTS6Sk8Rpc2fOyx/VBVZaPEFvAVm6uxHn G43Q2jjeR8kLeG5DN8Gfe0mA7YVOO92zJacUdDmHJYX3uqlQSdyRmWmt3Z/PbD8v/9tg 43NxE8B/d+EUAHzsMbQlOyrsxzYBIQD+z7MuXXTb58En9GFveC4ePJiGWLpYWbrjgnMy XSMg== X-Gm-Message-State: AOJu0YyeQx/3+75hkWmj0JXeFH6kM+CwzgrhEFR/x95C9g35PYuqCpnR CyoA4BGCIu/WBOKyak5C0uMHhljE7oRly6Dj/egIoJ42njZi0SMXjo9XkDwaz3mOacVqqVLhdSZ B X-Received: by 2002:a5d:568e:0:b0:33e:c385:7dce with SMTP id f14-20020a5d568e000000b0033ec3857dcemr3474737wrv.15.1710515434941; Fri, 15 Mar 2024 08:10:34 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:33 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:15 +0000 Subject: [PATCH v2 06/14] clk/qcom: sdm845: add gdscs MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-6-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1608; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=CZFRIcjdqr1GSgKHr5tO1jmY1D18fHto7mfrUIdD/TQ=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY+PNM4wkw2qOhwitSEumVuitMF7oc+n78cLLqSv3 feN99CvjlIWBkEOBlkxRRbxE8ssm9ZettfYvuACzBxWJpAhDFycAjCRqhSGf7YhyRo39qy6veer wMc5dyTqMkJj7CctEvhUs9V42iWhB5cY/idnyb16Mrnf9tnE9sSsesGnX5dn+6Z/Lcyflb/ps8H Pq/sA 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 Define the GDSC power domains for SDM845. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/clk/qcom/clock-sdm845.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index ccb0cf245d33..b7154360894a 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -145,13 +145,31 @@ static const struct qcom_reset_map sdm845_gcc_resets[] = { [GCC_USB3_DP_PHY_SEC_BCR] = { 0x50014 }, [GCC_USB_PHY_CFG_AHB2PHY_BCR] = { 0x6a000 }, }; +static const struct qcom_power_map sdm845_gdscs[] = { + [PCIE_0_GDSC] = { 0x6b004 }, + [PCIE_1_GDSC] = { 0x8d004 }, + [UFS_CARD_GDSC] = { 0x75004 }, + [UFS_PHY_GDSC] = { 0x77004 }, + [USB30_PRIM_GDSC] = { 0xf004 }, + [USB30_SEC_GDSC] = { 0x10004 }, + [HLOS1_VOTE_AGGRE_NOC_MMU_AUDIO_TBU_GDSC] = { 0x7d030 }, + [HLOS1_VOTE_AGGRE_NOC_MMU_PCIE_TBU_GDSC] = { 0x7d03c }, + [HLOS1_VOTE_AGGRE_NOC_MMU_TBU1_GDSC] = { 0x7d034 }, + [HLOS1_VOTE_AGGRE_NOC_MMU_TBU2_GDSC] = { 0x7d038 }, + [HLOS1_VOTE_MMNOC_MMU_TBU_HF0_GDSC] = { 0x7d040 }, + [HLOS1_VOTE_MMNOC_MMU_TBU_HF1_GDSC] = { 0x7d048 }, + [HLOS1_VOTE_MMNOC_MMU_TBU_SF_GDSC] = { 0x7d044 }, +}; + static struct msm_clk_data sdm845_clk_data = { .resets = sdm845_gcc_resets, .num_resets = ARRAY_SIZE(sdm845_gcc_resets), .clks = sdm845_clks, .num_clks = ARRAY_SIZE(sdm845_clks), + .power_domains = sdm845_gdscs, + .num_power_domains = ARRAY_SIZE(sdm845_gdscs), .enable = sdm845_clk_enable, .set_rate = sdm845_clk_set_rate, }; From patchwork Fri Mar 15 15:10:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780516 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253210wrs; Fri, 15 Mar 2024 08:11:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXNCEfv611ZfDnVtNJRcMQId8Uc25neAxtROTlgz66Y/HhC5JreLi9C7bxP+9EWGGI/Uo3TaMGCQtE99WfLUKEh X-Google-Smtp-Source: AGHT+IGBy3jcdWkubBSe3GxbS88QsAUFoP9Abet2MtdcKJrJ3/1kJq0PddUGJTPzh6G948jWeYvu X-Received: by 2002:a05:600c:1f8c:b0:413:f7c4:f4fc with SMTP id je12-20020a05600c1f8c00b00413f7c4f4fcmr2807488wmb.15.1710515503513; Fri, 15 Mar 2024 08:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515503; cv=none; d=google.com; s=arc-20160816; b=fGkssb8i+PPt/MNVwBJIKUR87+IS1JE6ndrSsK9ErNykqQ1RsBr0KIVhTEZAlzBQzq +1jtm4qF3sh9GkAk2u54g9NTG2E4Thc95GRL/TPLlkmHKYE5Y4PPicjPUhK1w6OENDYP WEBlDIntrbNAqgrZBx9OitSpqJ3pmbFce2TwiPrjIdop+acHm+kWaR9HaZ/278hccPUo PBJVRD1mfGNnohXpI5Q16IwGyIlwEH2eWE14y6QEjftXbJ4SaYamb3VVGB4q/4I6dWe0 8VWEbnmlpYpcSIbY4y5a4GSjgGnhw4pUiRkHQW2Om/KdQIjljqfyDIdSxonxMhgddup0 s2bA== 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=Wsmj05dPfs1rjcVH8tp3Vc80gcGSrf4xjJcLkyvDdHQ=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=jfLF53hc+iWKNaEG+XqwdAT7GNPoDjvasnqc+fF2zyRbz7E7qm1u63ldlcD08sxyMN 9iUGb3nrDuEuxOm8tTB5fNtTLm5ppo1diZ+NklB9QHg0NHGjgH8Io98ZHuZeAebtguBc kMhQ0+3zQ/c1jcpdn8RM182XW2HitZxYk6bCSHCYhvve1pFHCHLB6uOfZBgm6VxCji9O h27KJcX8RA2jG5EJIGe5ApcaX8dOcnZ59fQmHPoioKjvObHIJ0/WNJVt30rZVFeeZZwD 4+SsntAZnKpE5z5W/NXOP7oWaokOPPSVQQ3QlEGqNVk9bCANAqVrMwpYgh4HX3OsuMm/ UBzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="LpfuP/LL"; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id u16-20020a05600c211000b00412ea4ce549si3496703wml.211.2024.03.15.08.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:11:43 -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="LpfuP/LL"; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6346987FF7; Fri, 15 Mar 2024 16:10:44 +0100 (CET) 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="LpfuP/LL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5F0FF88053; Fri, 15 Mar 2024 16:10:40 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (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 CBA238802E for ; Fri, 15 Mar 2024 16:10:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33e9def4a6dso1461210f8f.2 for ; Fri, 15 Mar 2024 08:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515436; x=1711120236; 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=Wsmj05dPfs1rjcVH8tp3Vc80gcGSrf4xjJcLkyvDdHQ=; b=LpfuP/LLP7VA8ChWuZn7isNoC502K5LDFiB1vAf+ni2UFpj29PY20T/2Qiw1nv2WC0 FZp7W2ilYmRF8UC0nqFNxH/lNlg8GFOcUjzodRGjomCpO1Gm5Asje7rkVZl1gowdBOtn 6Fe8a1YX06wZ+IV7KixYhenioEyR/NgkEhpyw8ivncebJ2M4SqOeUyOrMnCCp55fxEvc GQ6jO3K+AKZmTfLkvAYYlzj8/DxAJpfVyJK+FJu0vgK48VHiX02XOYtWuxX3pVnZMi0M 5z8QXDu47Pt86ngSml1ROlvllncU/82ldC/fYJAbXGHw4vhhdkTAZfyF6cq6NCJF5fCv C03w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515436; x=1711120236; 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=Wsmj05dPfs1rjcVH8tp3Vc80gcGSrf4xjJcLkyvDdHQ=; b=GorS3fjeEKeNKtStQdiLH7yiriW/13v+697MsPJJPiG9mrjaNey4fOj5Y7LNnlIDie ucFx9DzGC7JgEk4aYr0ey3KwffUqWQYf5kYf7SG/zOGJ7gdwvFgMUTXRd+a2hGMSCOgT iT3UQpmf26ZjxH55kcKLQe/Ci397Sm4dlH17kYIFhwIaNDWQSFXL3ysT8JbZGUt7pRMa qIfMnoMv7h8K93eqja41K6BotZOTdyOPgq58WUzjHGXLxfkuWIxRhp3Q2lsUS3brF9vO fkd4qurpKwJAkGByJ9bDAJtB287DOqqremlacGE6kQZoDOoRgiMhr/iW9e0j+9zT9eX9 qu0g== X-Gm-Message-State: AOJu0Yx597GgUokF9x6n81QvkGT4C/R2YIs2O+ftT5STNA01aMwooSV2 AVdlNOEx9iewBnBhRherIF4tFQ8rNd5/+OP5r9TolUNA1j3CGgN/+5GAaDO5+7BPmQoGOHuE8w/ c X-Received: by 2002:adf:edc9:0:b0:33d:a944:54c0 with SMTP id v9-20020adfedc9000000b0033da94454c0mr2586891wro.22.1710515436184; Fri, 15 Mar 2024 08:10:36 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:35 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:16 +0000 Subject: [PATCH v2 07/14] clk/qcom: sdm845: add USB clocks MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-7-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2520; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=TPWXmjwONpVmkU2OdupRcZGhS+g7ubUhkmPEYsCZwuM=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY99nimsap/j8FlCzk1yrdbbdRZmW182PTNwjH195 yPPppWbOkpZGAQ5GGTFFFnETyyzbFp72V5j+4ILMHNYmUCGMHBxCsBEfi1j+Gf2LCSz0P+B0QkX b7YvJTtzzy2VuDOVRe3pxUvbGs/OCeFhZJh6S7vAuuY368qy/t3+U6wLRVOmBSbcXSWvbxKz5kq echQA 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 Most devices only initialise the USB clocks for us if we boot via "fastboot boot", add the missing clock configuration to get both USB ports working regardless of the bootloader state. Signed-off-by: Caleb Connolly --- drivers/clk/qcom/clock-sdm845.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index b7154360894a..e9c61eb480de 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -20,8 +20,12 @@ #include "clock-qcom.h" #define SE9_UART_APPS_CMD_RCGR 0x18148 +#define USB30_PRIM_MASTER_CLK_CMD_RCGR 0xf018 +#define USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR 0xf030 +#define USB3_PRIM_PHY_AUX_CMD_RCGR 0xf05c + static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { F(7372800, CFG_CLK_SRC_GPLL0_EVEN, 1, 384, 15625), F(14745600, CFG_CLK_SRC_GPLL0_EVEN, 1, 768, 15625), F(19200000, CFG_CLK_SRC_CXO, 1, 0, 0), @@ -56,8 +60,10 @@ static ulong sdm845_clk_set_rate(struct clk *clk, ulong rate) } } static const struct gate_clk sdm845_clks[] = { + GATE_CLK(GCC_AGGRE_USB3_SEC_AXI_CLK, 0x82020, 0x00000001), + GATE_CLK(GCC_CFG_NOC_USB3_SEC_AXI_CLK, 0x05030, 0x00000001), GATE_CLK(GCC_QUPV3_WRAP0_S0_CLK, 0x5200c, 0x00000400), GATE_CLK(GCC_QUPV3_WRAP0_S1_CLK, 0x5200c, 0x00000800), GATE_CLK(GCC_QUPV3_WRAP0_S2_CLK, 0x5200c, 0x00001000), GATE_CLK(GCC_QUPV3_WRAP0_S3_CLK, 0x5200c, 0x00002000), @@ -120,8 +126,27 @@ static int sdm845_clk_enable(struct clk *clk) struct msm_clk_priv *priv = dev_get_priv(clk->dev); debug("%s: clk %s\n", __func__, sdm845_clks[clk->id].name); + switch (clk->id) { + case GCC_USB30_PRIM_MASTER_CLK: + qcom_gate_clk_en(priv, GCC_USB_PHY_CFG_AHB2PHY_CLK); + /* These numbers are just pulled from the frequency tables in the Linux driver */ + clk_rcg_set_rate_mnd(priv->base, USB30_PRIM_MASTER_CLK_CMD_RCGR, + (4.5 * 2) - 1, 0, 0, 1 << 8, 8); + clk_rcg_set_rate_mnd(priv->base, USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR, + 1, 0, 0, 0, 8); + clk_rcg_set_rate_mnd(priv->base, USB3_PRIM_PHY_AUX_CMD_RCGR, + 1, 0, 0, 0, 8); + break; + case GCC_USB30_SEC_MASTER_CLK: + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_AUX_CLK); + + qcom_gate_clk_en(priv, GCC_USB3_SEC_CLKREF_CLK); + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK); + break; + } + qcom_gate_clk_en(priv, clk->id); return 0; } From patchwork Fri Mar 15 15:10:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780518 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253407wrs; Fri, 15 Mar 2024 08:12:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVUHNSRetETfnkDd1YS3thDK21rNWFpCoYDYj2ar2dD0ik4FOLxSoAPQw00QxBYVkQT4NeG9hcN+DBNg5MlqwwJ X-Google-Smtp-Source: AGHT+IHzrfOelQrcL6pQ3SjNyraQbgrmQ3jmTGfUfQ3L5zwrQRqFxBt8PnHXdKQZ/mpX12LpbPys X-Received: by 2002:a05:600c:1f10:b0:413:1dcd:b39 with SMTP id bd16-20020a05600c1f1000b004131dcd0b39mr4045864wmb.38.1710515524888; Fri, 15 Mar 2024 08:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515524; cv=none; d=google.com; s=arc-20160816; b=J4FVrcfM4cTUewFFYzej9HrglvvoEx+PapKfHRr30MEGf//XLa4n2U1r3GZj6pbBCD n6n3pkhmoMbpE9cyGP9tpe40WojsYNyyEO2NZ1urECVtHBrXJk5roBMGcxKrqYRJ1qxX 8XReH8nY/eI0VsiGfMLEsI9Oby8800HYE4GwCdMmWEohyInJt/0F5kNt07qkCdVz6HoX wHd2Lk4mhnNnTrv7y7GYtqejFgwHKUHVcDH9itLu066jGTaQg3IAPZ04qUGO70xg1jgy QOgCTN7b8Hgoe0nrueCY+edKsyA0SonnjmCCXEXaQuufHWrZv2379e47BWBLgbGKDnay ZjfA== 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=3JOoPnE7/Qw4KSbwZg45xCKwsyTMmqgOFvlWbdDPRFE=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=Jj8JuhmwguuBqQrbikIvB2V+RPlKSwgVeGhmExCITXiJ05Mfu0qQsIalxAvKOLtZOh SzD1m6Ccf9Xpi4FTMfBrzpzrFAGZVExKMOOvvCxiTQm5lHEG0iIf1Bj0O/T9aLwQEno9 Cb/g9WGgzR+Id41DO0w48qplM9rugmUlHzflVnvfdL+LG2dDewX7gm1MU1DkD3Phq4k6 S+5ZV9f+7N/iEgcNEY5Q1mMcdCMOGHDKT3IzN7Q43xva5vzYLJiL/BPy9Wgc0bLv9rnr vtTzBA9dsoUenQMMItytSkBrjs7hdmaig27rwicL4xnDfgCLvqFwyfs1qL3ym3h+QRJQ f4rw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bvf+/O57"; 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 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 19-20020a05600c231300b00412f83e8fbfsi2320302wmo.81.2024.03.15.08.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:04 -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="bvf+/O57"; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A54988041; Fri, 15 Mar 2024 16:10:45 +0100 (CET) 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="bvf+/O57"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AB3987FC6; Fri, 15 Mar 2024 16:10:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 E48B588007 for ; Fri, 15 Mar 2024 16:10:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-414037f37cfso3788615e9.0 for ; Fri, 15 Mar 2024 08:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515437; x=1711120237; 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=3JOoPnE7/Qw4KSbwZg45xCKwsyTMmqgOFvlWbdDPRFE=; b=bvf+/O57DaFItCBlz6Yp6MlkADz/NN/XCH3//at0davQMyPgm09x7rELSMxziZLVvF 1U9bnPWOGIoGcFizcxFdpK3vfkFq0gVVCh2BMT6ls2vBKiUKEC/Mw3WNlq6+26PDVPtg NMd/87Nf1vWvc9TKAy+7IP83fZDOuxZ7Mlpak0YILv2xbQhgEFxptgxUjLrRnKZvl6j4 D6CfVA2bMb9S1pu3Go8T/KxglEsDT9fSeNlOwXRhqQm+dOso2qHk9ok8V548yPPhi0dv YG70n3wPrwntU5G/52Bb9+kQHmq6rCxZchfywTR7FjqkVUszBWgEiLhAFGYdOV4hNfm9 jdNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515437; x=1711120237; 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=3JOoPnE7/Qw4KSbwZg45xCKwsyTMmqgOFvlWbdDPRFE=; b=bu+1RbffdKYgsNinNupFB72umeYPLjKn0ChLnNMeeUEDIBumRkPSM4aOCsnA6rN/Cr 4uRdjIJtW3CIiIu9sX9bbHsLd0/QQ5Cr4RrkVBi3b6GfOqSOXqNPavpUXRu9wOYCRN+U 6PjEPuaGvAco/8Klq3I6a24PJE+IgtJRoO9NZbImXLVxdALlrqfyelzsV4K+Ohf347CM pR15kKiGCFf5ghQxEWTis323pu2Pno7nAnoblJkK7wmgh+BdfwirIw+rDlze3+d4TG5C WVXaHa4G75/H1uXOa8rd8gxnTnelLY+7rCpiKVKrpzmOZmTRmLaFOgdQ/qV/k4jrMlAM 1oeQ== X-Gm-Message-State: AOJu0YyjJKpF8tgftNcxhJYCY8otdWJbXkCP0dgvUNB5MhI4AdE1aLJo FSlKYcx8tApQeN8ke4sKmf3QExvjimKwrZA1Ji6OtAHOF0+cvFdqhOxX64VOc2SYhP/0NUBATeb C X-Received: by 2002:a05:6000:1805:b0:33e:c7e3:b2e7 with SMTP id m5-20020a056000180500b0033ec7e3b2e7mr3554917wrh.11.1710515437305; Fri, 15 Mar 2024 08:10:37 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:36 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:17 +0000 Subject: [PATCH v2 08/14] gpio: msm_gpio: add .set_flags op MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-8-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2529; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=BqhIvZ0D1m2EoNdcJwYk4o3G6xvhwsOurBZjgFCw3S0=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY+DAjS6ZmRx3ZzLsHm3crtIk6zfAz2/CesO9znrH fh//WtuRykLgyAHg6yYIov4iWWWTWsv22tsX3ABZg4rE8gQBi5OAZjIpReMDEu9A9/lPY7j4tz4 7/pVZbNYnQP31x+/39xtv/D0tas86lWMDG1G+nuUO1TVz2iyJ+hyCat8ddqvffup2Tmz2+/1X/W xxQAA 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 .direction_input and .direction_output ops are deprecated, and don't seem to behave properly for us. Implement our own .set_flags op to handle this correctly. Signed-off-by: Caleb Connolly --- drivers/gpio/msm_gpio.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/msm_gpio.c b/drivers/gpio/msm_gpio.c index 5e57b0cbde75..f5d9ab54e817 100644 --- a/drivers/gpio/msm_gpio.c +++ b/drivers/gpio/msm_gpio.c @@ -34,21 +34,21 @@ struct msm_gpio_bank { #define GPIO_IN_OUT_REG(dev, x) \ (GPIO_CONFIG_REG(dev, x) + 0x4) -static int msm_gpio_direction_input(struct udevice *dev, unsigned int gpio) +static void msm_gpio_direction_input(struct udevice *dev, unsigned int gpio) { struct msm_gpio_bank *priv = dev_get_priv(dev); /* Always NOP for special pins, assume they're in the correct state */ if (qcom_is_special_pin(priv->pin_data, gpio)) - return 0; + return; /* Disable OE bit */ clrsetbits_le32(priv->base + GPIO_CONFIG_REG(dev, gpio), GPIO_OE_MASK, GPIO_OE_DISABLE); - return 0; + return; } static int msm_gpio_set_value(struct udevice *dev, unsigned int gpio, int value) { @@ -83,8 +83,25 @@ static int msm_gpio_direction_output(struct udevice *dev, unsigned int gpio, return 0; } +static int msm_gpio_set_flags(struct udevice *dev, unsigned int gpio, ulong flags) +{ + if (flags & GPIOD_IS_OUT_ACTIVE) { + return msm_gpio_direction_output(dev, gpio, 1); + } else if (flags & GPIOD_IS_OUT) { + return msm_gpio_direction_output(dev, gpio, 0); + } else if (flags & GPIOD_IS_IN) { + msm_gpio_direction_input(dev, gpio); + if (flags & GPIOD_PULL_UP) + return msm_gpio_set_value(dev, gpio, 1); + else if (flags & GPIOD_PULL_DOWN) + return msm_gpio_set_value(dev, gpio, 0); + } + + return 0; +} + static int msm_gpio_get_value(struct udevice *dev, unsigned int gpio) { struct msm_gpio_bank *priv = dev_get_priv(dev); @@ -109,12 +126,10 @@ static int msm_gpio_get_function(struct udevice *dev, unsigned int gpio) return GPIOF_INPUT; } static const struct dm_gpio_ops gpio_msm_ops = { - .direction_input = msm_gpio_direction_input, - .direction_output = msm_gpio_direction_output, + .set_flags = msm_gpio_set_flags, .get_value = msm_gpio_get_value, - .set_value = msm_gpio_set_value, .get_function = msm_gpio_get_function, }; static int msm_gpio_probe(struct udevice *dev) From patchwork Fri Mar 15 15:10:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780519 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253510wrs; Fri, 15 Mar 2024 08:12:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUDsvjSBoRvhvCAvPgessJn5CDgH6KwQF5nL3ibN8gT7AdmnCTcqqLf9gs0xpA9Z05bLwB1Xhy8ogqge/OAOmho X-Google-Smtp-Source: AGHT+IEFMiRnN5gsgFZ+xjnHTpzowuycGXZO1lA2+gziyabhodO1bRvUkpiI3tgRpSDEc9waIEO7 X-Received: by 2002:a05:600c:4f91:b0:413:2852:2835 with SMTP id n17-20020a05600c4f9100b0041328522835mr3823447wmq.17.1710515535802; Fri, 15 Mar 2024 08:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515535; cv=none; d=google.com; s=arc-20160816; b=QNzF4VsyUkyBDvmfAg0ZLnOEMUtucAz5PJr2x/qiGZlaeJg1Ig/yreKae2d47ErZoB KV34VODhX1FHDJDUb6Z+mj104EXpBetNBTKPbAMO2oqa7J8w24UbCitd3Cl1xoTDuWVS FQR3ebJiiF0iPDMwQeetdKe4biLWxy5IB+pNfGfn5rqORltrQPYEn0aokdAlRXfTc71Z vxuEHdQ1pCYGsCk1rMfbCg+Xx5PDGrhlux2K/amksSA5NG1zEYsYj+ittdluRdAoLauV sz93NtCCd2MxeAHTwDAPX3eMwEbNtxt5/PxLsXYGvV6pAitwG8MK1c+D2jo4b/WG3GBa w1cg== 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=Nutu774W+e/po+yxFNGoCWmqr2yjHvTybNe5vdX7QhQ=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=B7044/VMjQOWvIfKK/1u9CcZFFCzTPuFcith/uzDdJjMq7KH85JZ4HWqOtjVytStTY zjCbaooIg+Yw0Dsq+hiw2+Q2ZxUcZIUc9Igcf1+lzUjD6XR31LtzkkrvwpOtfuFvvEcr 654WNO7SAS1oTCYE4kQsEjWdGhC6AvRlEbf+3qqLZ4QhZXqCF6trXGQSQe8GsrZq+76H csVIpfgPQacE6TyRs+apBo3Cqsf1Tn3lkitT8YXbpQgszGmtN9ToRIxhlIRiO/Sa9a3A Uz080MOoIA6pvcxQzfwGeHNK5S9aITE8c8SmqRiZRvDaQOqBODvRM+WvXkfKNVVnait3 d/1w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWfHoTrw; 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 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 l4-20020adfe584000000b0033dbf9dbf7fsi1727838wrm.558.2024.03.15.08.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:15 -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=CWfHoTrw; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0148187FC6; Fri, 15 Mar 2024 16:10:47 +0100 (CET) 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="CWfHoTrw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E22B87FC6; Fri, 15 Mar 2024 16:10:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 C145A87FF7 for ; Fri, 15 Mar 2024 16:10:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33e99b639e0so1300532f8f.0 for ; Fri, 15 Mar 2024 08:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515438; x=1711120238; 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=Nutu774W+e/po+yxFNGoCWmqr2yjHvTybNe5vdX7QhQ=; b=CWfHoTrwpmAU9XWsjMw1mZmHeJdTyfIiu+hYOvhhg4oBHvLS2/9lSKZe5Jup3CrepK P8oQn7L5zPhBrrSWo+vW7UyXHV9O2s8VyAuaG/QHMlVE6nGIO683y4scJPoZGV0WOzsK PAVlJVqweEKYKGtNLPE+IdgRqD0BobiCOpnqQu9hGBAJALVRlTPw5ewr4C6bZrjk0CZE lORvmjAI6keoGLKuyDyHIXIZEM92GrRb1a8dSYE7ap1DdqewjXdv1dC8zhvL4uzIB1SH Mi/Z5yx1uj+BKj89+9I2jtdkzLSJRU1SmlzoN6UWFU+RJ3Mvztk1iyW770IeXV1cNuLZ 5k+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515438; x=1711120238; 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=Nutu774W+e/po+yxFNGoCWmqr2yjHvTybNe5vdX7QhQ=; b=tqj1XTNxLmo5tTg2ATlTzA6tusodLMrTHghJPmEEkIqHihwrBxQFOdjP6Hq04bbTnX A2qYrAq2n6EhqtOhB97XsEnRMKDQqjjqncxI+PGfL6yvnc97seMOj8t2ZgmWjqJVChpf dR2Fuv4UxJ/1iDnI+wb3LrGGhv/H++DnUpLt2VtvOuXiSVZqS46YeEsP/dyJdh9JkGUo LqIcvsWgupp3NF26Bn3uYwYaK3iazkKGO19KkGc6aKci+s47m2399xZYgoltczumnOHW JyL3oJNKW16NUIwWMdwecmE4i/t6f/G9WF0dVtFLgXlcBHSeC70x884QYHG1+nqfgvrQ sZ8A== X-Gm-Message-State: AOJu0YyND1QR28tJD1yCWox0MkhiFCfjaKV43kq3kNQTftTGdKpa3e8B WnWBHsNuXpx0bpAHtN36BxUyHypQ5VnqO61zluuJK035qXb0u4BlTMWWNLKTQxgB8WubugHJlab d X-Received: by 2002:a5d:6582:0:b0:33e:7c9a:9368 with SMTP id q2-20020a5d6582000000b0033e7c9a9368mr3349020wru.63.1710515438102; Fri, 15 Mar 2024 08:10:38 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:37 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:18 +0000 Subject: [PATCH v2 09/14] serial: msm-geni: support livetree MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-9-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1156; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=B+jPfevSWWFNhepB84HKKi/onYAxuvjKNgJOEGpnD6U=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY9DbObHh5gYcszr3TH11VW1a4YOXNcmfZuZ2ppWH llmLRzcUcrCIMjBICumyCJ+Ypll09rL9hrbF1yAmcPKBDKEgYtTACbSEcTIsEgp8CpXeh7b2xjN ExX355i1OQVrrOBxeKSX/9gjWNbaluGvFNtfVY4dv+/HLXXifhbimNx7s1/Rv9yx+s+CnxNzZta IAgA= X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When using OF_LIVE, the debug UART driver won't be probed if it's a subnode of the geni-se-qup controller. Add a NOP driver for the controller to correctly discover its child nodes. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/serial/serial_msm_geni.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index 4aa0bc8c72bc..5260474fb9a4 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -605,8 +605,21 @@ U_BOOT_DRIVER(serial_msm_geni) = { .ops = &msm_serial_ops, .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF, }; +static const struct udevice_id geniqup_ids[] = { + { .compatible = "qcom,geni-se-qup" }, + { } +}; + +U_BOOT_DRIVER(geni_se_qup) = { + .name = "geni-se-qup", + .id = UCLASS_NOP, + .of_match = geniqup_ids, + .bind = dm_scan_fdt_dev, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_DEFAULT_PD_CTRL_OFF, +}; + #ifdef CONFIG_DEBUG_UART_MSM_GENI static struct msm_serial_data init_serial_data = { .base = CONFIG_VAL(DEBUG_UART_BASE) From patchwork Fri Mar 15 15:10:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780520 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253605wrs; Fri, 15 Mar 2024 08:12:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXTCSimqlnONdTUP0I3p/uWVIcNk54YhMCVrybCVspEsKnEXXU2AIRbVEYTjq6lWRdjZNQwIlmmUN7xRkSgG9ON X-Google-Smtp-Source: AGHT+IEHZQQEzTQc1hiXP6cYjwqGWscd4/OGlcQE8Bp+AkaZy3taDPJrM7t092VAoUlADB4yuukp X-Received: by 2002:a5d:694b:0:b0:33e:b719:8bec with SMTP id r11-20020a5d694b000000b0033eb7198becmr3453655wrw.24.1710515546453; Fri, 15 Mar 2024 08:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515546; cv=none; d=google.com; s=arc-20160816; b=N8Blxl+jGefyg1ZmdxrDFYJUdyRNH7dkaqBE4GrnYojWyS1xiPziuu3jQZKKVuuyQS Zkq52KfmvNja962rLw7FCqFj3S7/IknG1Mm87mhTAbW+OKs5JExDXKVbjP+ljbML0StE xKVIQqfOpwFPwKE7UqjhOJkc2eXDZOLUr4GGJygTVCnbrTBQwI90d7SAvyxDRXAnr1Lv V8iA3UvWdi0TMIZ1s2vMLhqptiQ6nyvlmSx29QMhMLN1JSQyLb93vaWXVyFQZlTKEJQC wLvQiZuk+OiV96U7rBpB0I4t5AMEX2hC5G6vzoB+UTx/3xd0uINI8cjfpUEu1Xpiikpw D3Aw== 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=emZL/Pfipg7qjmq7o32OJOw4T2ZC+SaQMSZYB0NanLk=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=joX7Juas4XWSRQux+4m+/Rcn101z8DxewcXbfg622uNtWEbHbG/wVjVXhdQ1pQPM9G fxFh5dsARk5bb+STwnEdqXVEfUc7OMvlMJbXpWAwVeVqngWmbLWIrQGCC2i3jZZh7fqd srhKRclnd3T1ZEk9Z8XBzaVtrFS/p7Y5CaZzmnC5mh1/lXc1/6fCzrz36oRddcJoUqnk bN54VcV1OA4GEk6ZMffyMYps1W0giFTznvr3QlWRw3jAccng3Td4R6bbWgTnTtBjHGE2 BBSfiI8lHL5SDO55fbtN8v2FjaEsNhGJT/ME+K4lR5z2dS/D688t51DTJEWGEja2WG1A 6Zsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KObhh9RA; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id z17-20020a056000111100b0033e798be456si1685602wrw.798.2024.03.15.08.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:26 -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=KObhh9RA; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F9EA8804A; Fri, 15 Mar 2024 16:10:47 +0100 (CET) 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="KObhh9RA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8099C8805B; Fri, 15 Mar 2024 16:10:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C317B88047 for ; Fri, 15 Mar 2024 16:10:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33e76d653b5so1967761f8f.3 for ; Fri, 15 Mar 2024 08:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515439; x=1711120239; 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=emZL/Pfipg7qjmq7o32OJOw4T2ZC+SaQMSZYB0NanLk=; b=KObhh9RAiApxxjbq/rcgrz7KH6qAXX+oJONN7qc9mSDdO3bWGyE6pdgauAynnVY0Tu ldE/CXlyheFsKhsZaOVz0vA4ICa7qLGiy2koiYG8neQKUTFKuyhQa666hB3jngiewKVu YvwyIEXnuhXhacIc2XtoRS9Vsgre+bAz6iVbRPTgH5Q2UELib90QrQTJQUjb5TCPbZ2P SWJiRkYCno8FQiZBzD6nfUCqgMS3AXcMP2o/cu3ErABCCtSb8m38ruIZZMo1Yg/xN1qF 6bzbGHL4ftPuXTLUVz44pqH0n363B8cnlvsGeAxOVdFTq2rA9IELYj2njlVj74S5sIXa b6qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515439; x=1711120239; 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=emZL/Pfipg7qjmq7o32OJOw4T2ZC+SaQMSZYB0NanLk=; b=kXT7ZZfhV3R1EL1OzC0YRwa+spz7O/vbO3cQ0MwLQRcSjyzBag5ZC7/1ABqa1H2rCT HQ2Q92w2bwnDS4lHS8IVCjmtWw+gYPNc32QrRNLtcQGrunC8q8qIzaBRe8tBPKNPNkfg M5hUouEWtoWGkE+sJu2D8PsUZpCEJKQao+sbCuWSIYS9BW1W7VEoHXuOfzXMDCJkhQLB Pa3ubC8e1xvCuooh07UZJKHKlE4mEsuIddRI4X508dDmjtF8Zel2TE+bJmD+VMeIQv7C K5hbcQfPlu4tFYGIFsxPRawlOMHYcGXLNu+t3R5dq6DBexr3WIkISdRwlkz96XUVVxac 7yhA== X-Gm-Message-State: AOJu0YxWSpcd4vE03NTJg47pov1+lpX2IqswxsNrOmYrCTEIF4hZS8ow nCp0yOXi8I7Jn66y3ZtIf/1suBy4zCclJHl8jZwLADAJCT1AHf7EzvhqVzCbKkO6ySh9yjYhcKb w X-Received: by 2002:a5d:4e51:0:b0:33e:90b8:9332 with SMTP id r17-20020a5d4e51000000b0033e90b89332mr3275861wrt.49.1710515439015; Fri, 15 Mar 2024 08:10:39 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:38 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:19 +0000 Subject: [PATCH v2 10/14] mach-snapdragon: fixup USB nodes MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-10-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=6569; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=SuUOZRINgUKmOWJx0MCOzS4+PECzt4IomG1G76WK1cc=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY/nHXogqPjJ6XnBhooXthrXWL39jp2d4L7wwZmrz QeUVgiJdZSyMAhyMMiKKbKIn1hm2bT2sr3G9gUXYOawMoEMYeDiFICJ/ExlZJh3vuWT+Y0KtaVK 6RvCWR8ufidlfvq9hYz+CodJocnzTDoY/oov4g49/n2lUUNY5lumpfKbP/Zt5qvKtToa9sBF7vC vJ38A 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 support USB super-speed in U-Boot yet, we lack the SS PHY drivers, however from my testing even with a PHY driver there seem to be other issues when talking to super-speed peripherals. In pursuit of maintaining upstream DT compatibility, and simplifying porting for new devices, let's implement the DT fixups necessary to configure USB in high-speed only mode at runtime. The pattern is identical for all Qualcomm boards that use the Synaptics DWC3 controller: * Add an additional property on the Qualcomm wrapper node * Remove the super-speed phy phandle and phy-name entries. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/Makefile | 1 + arch/arm/mach-snapdragon/board.c | 3 + arch/arm/mach-snapdragon/of_fixup.c | 115 +++++++++++++++++++++++++++++++++++ arch/arm/mach-snapdragon/qcom-priv.h | 19 ++++++ 4 files changed, 138 insertions(+) diff --git a/arch/arm/mach-snapdragon/Makefile b/arch/arm/mach-snapdragon/Makefile index 857171e593da..7a4495c8108f 100644 --- a/arch/arm/mach-snapdragon/Makefile +++ b/arch/arm/mach-snapdragon/Makefile @@ -2,4 +2,5 @@ # # (C) Copyright 2015 Mateusz Kulikowski obj-y += board.o +obj-$(CONFIG_OF_LIVE) += of_fixup.o diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index 6f762fc948bf..65e4c61e866a 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -27,8 +27,10 @@ #include #include #include +#include "qcom-priv.h" + DECLARE_GLOBAL_DATA_PTR; static struct mm_region rbx_mem_map[CONFIG_NR_DRAM_BANKS + 2] = { { 0 } }; @@ -159,8 +161,9 @@ void __weak qcom_board_init(void) int board_init(void) { show_psci_version(); + qcom_of_fixup_nodes(); qcom_board_init(); return 0; } diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c new file mode 100644 index 000000000000..6810c8617cc0 --- /dev/null +++ b/arch/arm/mach-snapdragon/of_fixup.c @@ -0,0 +1,115 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * OF_LIVE devicetree fixup. + * + * This file implements runtime fixups for Qualcomm DT to improve + * compatibility with U-Boot. This includes adjusting the USB nodes + * to only use USB high-speed, as well as remapping volume buttons + * to behave as up/down for navigating U-Boot. + * + * We use OF_LIVE for this rather than early FDT fixup for a couple + * of reasons: it has a much nicer API, is most likely more efficient, + * and our changes are only applied to U-Boot. This allows us to use a + * DT designed for Linux, run U-Boot with a modified version, and then + * boot Linux with the original FDT. + * + * Copyright (c) 2024 Linaro Ltd. + * Author: Caleb Connolly + */ + +#include +#include +#include +#include +#include + +/* U-Boot only supports USB high-speed mode on Qualcomm platforms with DWC3 + * USB controllers. Rather than requiring source level DT changes, we fix up + * DT here. This improves compatibility with upstream DT and simplifies the + * porting process for new devices. + */ +static int fixup_qcom_dwc3(struct device_node *glue_np) +{ + struct device_node *dwc3; + int ret, len, hsphy_idx = 1; + const __be32 *phandles; + const char *second_phy_name; + + debug("Fixing up %s\n", glue_np->name); + + /* Tell the glue driver to configure the wrapper for high-speed only operation */ + ret = of_write_prop(glue_np, "qcom,select-utmi-as-pipe-clk", 0, NULL); + if (ret) { + log_err("Failed to add property 'qcom,select-utmi-as-pipe-clk': %d\n", ret); + return ret; + } + + /* Find the DWC3 node itself */ + dwc3 = of_find_compatible_node(glue_np, NULL, "snps,dwc3"); + if (!dwc3) { + log_err("Failed to find dwc3 node\n"); + return -ENOENT; + } + + phandles = of_get_property(dwc3, "phys", &len); + len /= sizeof(*phandles); + if (len == 1) { + log_debug("Only one phy, not a superspeed controller\n"); + return 0; + } + + /* Figure out if the superspeed phy is present and if so then which phy is it? */ + ret = of_property_read_string_index(dwc3, "phy-names", 1, &second_phy_name); + if (ret == -ENODATA) { + log_debug("Only one phy, not a super-speed controller\n"); + return 0; + } else if (ret) { + log_err("Failed to read second phy name: %d\n", ret); + return ret; + } + + if (!strncmp("usb3-phy", second_phy_name, strlen("usb3-phy"))) { + log_debug("Second phy isn't superspeed (is '%s') assuming first phy is SS\n", + second_phy_name); + hsphy_idx = 0; + } + + /* Overwrite the "phys" property to only contain the high-speed phy */ + ret = of_write_prop(dwc3, "phys", sizeof(*phandles), phandles + hsphy_idx); + if (ret) { + log_err("Failed to overwrite 'phys' property: %d\n", ret); + return ret; + } + + /* Overwrite "phy-names" to only contain a single entry */ + ret = of_write_prop(dwc3, "phy-names", strlen("usb2-phy"), "usb2-phy"); + if (ret) { + log_err("Failed to overwrite 'phy-names' property: %d\n", ret); + return ret; + } + + ret = of_write_prop(dwc3, "maximum-speed", strlen("high-speed"), "high-speed"); + if (ret) { + log_err("Failed to set 'maximum-speed' property: %d\n", ret); + return ret; + } + + return 0; +} + +static void fixup_usb_nodes(void) +{ + struct device_node *glue_np = NULL; + int ret; + + while ((glue_np = of_find_compatible_node(glue_np, NULL, "qcom,dwc3"))) { + ret = fixup_qcom_dwc3(glue_np); + if (ret) + log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret); + } +} + +void qcom_of_fixup_nodes(void) +{ + fixup_usb_nodes(); +} diff --git a/arch/arm/mach-snapdragon/qcom-priv.h b/arch/arm/mach-snapdragon/qcom-priv.h new file mode 100644 index 000000000000..d18fd1883b7f --- /dev/null +++ b/arch/arm/mach-snapdragon/qcom-priv.h @@ -0,0 +1,19 @@ + +#ifndef __QCOM_PRIV_H__ +#define __QCOM_PRIV_H__ + +#if CONFIG_IS_ENABLED(OF_LIVE) +/** + * qcom_of_fixup_nodes() - Fixup Qualcomm DT nodes + * + * Adjusts nodes in the live tree to improve compatibility with U-Boot. + */ +void qcom_of_fixup_nodes(void); +#else +static inline void qcom_of_fixup_nodes(void) +{ + log_debug("Unable to dynamically fixup USB nodes, please enable CONFIG_OF_LIVE\n"); +} +#endif /* OF_LIVE */ + +#endif /* __QCOM_PRIV_H__ */ From patchwork Fri Mar 15 15:10:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780522 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253787wrs; Fri, 15 Mar 2024 08:12:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUxT9rG4ZJl8/6LzzMXSXKSQ5j539p+4G0QJAz8zwvlr4feb2xrPkbLD4vZe4CuzKw15hgf3QWUwrW0s0p1T5Kh X-Google-Smtp-Source: AGHT+IEpe09kr31Atlg0jngYyOvVZXhliNREIm52MpEsGGvf2xymr+owERmlVUpR6eI/Hc4uWYLQ X-Received: by 2002:a5d:4b82:0:b0:33e:bf0f:8156 with SMTP id b2-20020a5d4b82000000b0033ebf0f8156mr3393711wrt.38.1710515566364; Fri, 15 Mar 2024 08:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515566; cv=none; d=google.com; s=arc-20160816; b=n7a7rPnAHoJB6ICXFDnDVn/T+20MkGR3vzvDD7WHpR4k3daVgBEQ9vexbVyJ8bNEB0 toFdL3j9SKFcZLPdwhjGWAia/mzuSlZRLHMbTHFnotNUS/KWiVPiiqJRu+QvnDHMcmJj sknNyzvwKU6HYWbO7CtM1zT8CiTqP2aVfIDl3Ml++jJhKCO+F/+YBnCOOI2IRev4uDj+ 4E/QW940I73ge4hb4dgTaR4lEVvCRHUu4IaluXYn58pLqG9RNZ4Hf4kfBvFQ8HI7uowg JnGqk8veFK25mdzLQWua+0IqK6u1Xs0pZxxRPtlAW0iUBHY9Ypod4n/ToEWVGPMm2egw oFqw== 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=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=EFKFr5/xaOWY/EgKSb6+LANLOE3M+2kH5D5PC65P97Ct/UYXgWeMpqbMr+3Rh2iUD/ dfD7iQZ5TMUG0bPR8Isgn61xKEDo3EQc2PpRUo4rsyjWNhgd2ybeb/A3d/SlDVwFU85U U9eOO+KHA9J+4AvJYaUrSHl8bpo87ujrrtMDISoI8wzN83+g9++pPirB5Xf6wrRLa1Ui oQN4PexcWSyQoOwJlQjgdOKiinFUCzDLoXV66a7sDpRpGjFGUQv5aoCT0WM6BcWf/PWm zB1X+5EDiMHV/TeTaMYNsHYcTXt3XqiEItXV575Ha9U5UwimDnGnufeXLNOmn6jInuTB GL/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uFq5DrQg; 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 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 g9-20020adfe409000000b0033e0f66423csi1773395wrm.184.2024.03.15.08.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:46 -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=uFq5DrQg; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D441F87FEF; Fri, 15 Mar 2024 16:10:53 +0100 (CET) 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="uFq5DrQg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8B788801F; Fri, 15 Mar 2024 16:10:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 92ED688023 for ; Fri, 15 Mar 2024 16:10:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33e6aca1ca9so1676774f8f.2 for ; Fri, 15 Mar 2024 08:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515440; x=1711120240; 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=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; b=uFq5DrQgzkugw9zhtf17coZj9ibue6w9AVFLCs71+pWiuQiI+q6PoZ4me0Xz515nhw W1kPfBh+/GAMTt7JNtZGl7TAJVN2PfT/4fEmnUsiCZCrmKwvvrUo8ais5xY7yAsHNcKZ KnSiL7qTkYAu6UpYHnlWfRy93uc8rpyZwARhTLLbNvgmX6xosVuO3LsBbZkDnQOzBkm0 mqJBcBcqstWug70YT7oBLM5G6wpGhpU5Rx0K/9D2RHBPSFxXYZ0cLd/bhH/RvY0+9QEL s4cn87CkU0cNxBaXBSL9JY+V7XRi0zLM7X9/9zDsPD6LVd4leOqlNfzRzoWi+MtF4QRx Mf4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515440; x=1711120240; 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=HxlOsugX2/wIO/P7KsmKCSR/CeuUXJcHxpYPD4HuMPo=; b=s/fwxFbsAznuTtIampZuc133juqMITZyumsNxPTVj5Fyar1TUzKEwQrY281K2CEAxf N3/aTKDvnWerVxuXp+9aje9NtHvH97q3y4RZ1RaEimALQixkyo8SpM7QQxpitMxRz7hx Xwa/QAB4hc3f/59Llj2kToLzfYcEA9cVP4xZqxIczo7MUp1HwuN8FymgURwjFTj3MrqU 7GjKnpuLaFz++PFvoZmR/HLl1/Lh1qtOu7pVQTTkfblyOMF8T7c0JQTLg2M9BlVsB5mb GcLh1WH1ckFAtRJsbXdTITovSPE1QUM3chwXcf4i8YBclTX6k3G9CDPToQTG2oi9NFpF c5KQ== X-Gm-Message-State: AOJu0Yxetg4OtAnYY6CjXWf83IUajuSQF2j/FjbhlhwSMpp4B7AT49FY /t0dBTidU0ceC+inRC/GjVpQAU9E/L31EkUu4+rYPRk5+toxhn8JFVoOE7z1pSdS7iCucgMxk6z z X-Received: by 2002:adf:fa0e:0:b0:33e:cbec:b2bd with SMTP id m14-20020adffa0e000000b0033ecbecb2bdmr2800266wrr.9.1710515439870; Fri, 15 Mar 2024 08:10:39 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:39 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:20 +0000 Subject: [PATCH v2 11/14] mach-snapdragon: fixup power-domains MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-11-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2538; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=eATLOOhI4TMycRloeb2rEN+Hpuc/Br8JMYSeGYyQmIY=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY835HU45L8PffhOkP3iOru60G+6ovFBU/etT8xIa F0rIOPbUcrCIMjBICumyCJ+Ypll09rL9hrbF1yAmcPKBDKEgYtTACYSKs7wP9rv7fWquhem22bd TJpW/+tMZp1C9enM2wu1ONJ+RlUETWf4Hzxnl0J6lMTmyws2T709ffrt6DU/CpXkZ8/RX2Kyc0V dxX8A 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 support the RPM(h)PD power domains in U-Boot, and we don't need to - the necessary resources are on, and we aren't going to enter any low power modes. We could try using a no-op device, but this requires adding a compatible for every platform, and just pollutes the driver model. So instead let's just remove every "power-domains" property that references the RPM(h)pd power controller. This takes <1ms as we're using OF_LIVE. Of note, this only applies to drivers which are loading post-relocation. Drivers loaded pre-reloc that reference the rpm(h)pd still need DM_FLAG_DEFAULT_PD_CTRL_OFF in their flags. Signed-off-by: Caleb Connolly --- arch/arm/mach-snapdragon/of_fixup.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c index 6810c8617cc0..49f1fc1948f3 100644 --- a/arch/arm/mach-snapdragon/of_fixup.c +++ b/arch/arm/mach-snapdragon/of_fixup.c @@ -21,8 +21,9 @@ #include #include #include #include +#include /* U-Boot only supports USB high-speed mode on Qualcomm platforms with DWC3 * USB controllers. Rather than requiring source level DT changes, we fix up * DT here. This improves compatibility with upstream DT and simplifies the @@ -108,8 +109,39 @@ static void fixup_usb_nodes(void) log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret); } } +/* Remove all references to the rpmhpd device */ +static void fixup_power_domains(void) +{ + struct device_node *pd = NULL, *np = NULL; + struct property *prop; + const __be32 *val; + + /* All Qualcomm platforms name the rpm(h)pd "power-controller" */ + for_each_of_allnodes(pd) { + if (pd->name && !strcmp("power-controller", pd->name)) + break; + } + + /* Sanity check that this is indeed a power domain controller */ + if (!of_find_property(pd, "#power-domain-cells", NULL)) { + log_err("Found power-controller but it doesn't have #power-domain-cells\n"); + return; + } + + /* Remove all references to the power domain controller */ + for_each_of_allnodes(np) { + if (!(prop = of_find_property(np, "power-domains", NULL))) + continue; + + val = prop->value; + if (val[0] == cpu_to_fdt32(pd->phandle)) + of_remove_property(np, prop); + } +} + void qcom_of_fixup_nodes(void) { fixup_usb_nodes(); + fixup_power_domains(); } From patchwork Fri Mar 15 15:10:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780521 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253707wrs; Fri, 15 Mar 2024 08:12:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXmNQ2YNR4vUVuHDZWsKT/nB5iDcL7zyD+grOGM14YS1eEA43LTSHurLs3rLjakY3kyOnvCj6iN+PZd3gXrTFwX X-Google-Smtp-Source: AGHT+IFFIAdT7ruIuRAnTDSgBhLzYA8OutuF0WvujUUWBHUj2fGFYqT3yoHILYgqn6Z32XquCgVj X-Received: by 2002:adf:cd0f:0:b0:33e:cf4e:86ba with SMTP id w15-20020adfcd0f000000b0033ecf4e86bamr1920042wrm.63.1710515557242; Fri, 15 Mar 2024 08:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515557; cv=none; d=google.com; s=arc-20160816; b=FhjoUFgb4NdoxKKa27wvZbcbE8Hk0WQcePH51gWJtMgJEslW37Ehsq775RhQhFDXzD TqxET8zPmklEUycliQqvod4LcnMs1P/5uRw/EbHYsUgmYDqqRKpdQpefABV8HjVbESyA +VzbDADKjdeqmPwYNhFDRf8fsTx5rVc1JPUSzoHNtq+lQ0+HReI6NAz+Xzpjry3ebXgj 6Mgvb+Mu65es1I/zHEnT4lZ1c1OB16/OR20oarjOFgNCSYy9mklaTBpsyLVLMZ+UlwfT 5WysiKotcwOVubJglQNikL5HqTmWfC9XWmkTdNizU7m7Z9Xc2ja+njY3C8jpwQwcpuCF eFiQ== 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=p1DgpWWU6EAciyMI+tFL4AWkmHHqHFUrK84uXLk8RKs=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=A+6JGtxurTNK3Pcm0Ikt3HaFR0p7Bt27BswW9yl6ylXBMYDp7W1VPEaX/YSU1ZRRNg EY+5BZROcKZPrnJNbcdBJD5RmvLnDcICGpd+SCQc5XB4tBnZlHCb10A3M9qcAH+tPD9j fBiCTN8c7pQt+Q82hOWQOfKNvypFq8MjDYV6wJWgKwztVoBv7WKlSO7Jmc1LCX0wVOgl UkftDzmsFFqTvKNyYdAe5M2CT93voVKEZ7gA1TliqxLbGfaRqPB44S98a4AnIfM7cQ7e yOEwOteZKKthSFUyCpkevRkiCUIB7ywUueA+gD5S5s1VYDE/qR8DeouRBRU4LCGc8GFp 8TUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1zqpN2x; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id m12-20020a056000174c00b0033ec7e5c301si1752297wrf.224.2024.03.15.08.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:37 -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=r1zqpN2x; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0ABEF8802F; Fri, 15 Mar 2024 16:10:49 +0100 (CET) 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="r1zqpN2x"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 440D387FEF; Fri, 15 Mar 2024 16:10:48 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 EC12388054 for ; Fri, 15 Mar 2024 16:10:41 +0100 (CET) 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-x133.google.com with SMTP id 2adb3069b0e04-513d9176cf9so969306e87.1 for ; Fri, 15 Mar 2024 08:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515441; x=1711120241; 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=p1DgpWWU6EAciyMI+tFL4AWkmHHqHFUrK84uXLk8RKs=; b=r1zqpN2x5dJn+MGcm6fsJXlG+Z3Bx+xUJkKFuUXIZxUnYe3G3/S/pCJ6LfV3LUllcj f8jVnYQK52rgBB08o/0+S1UkMirWK/U7cJp/L89pvJPD7hAFhIDFuIxBacxa+4n9yN6G c83M4UZ7eNtXPIN2XaeG+eaY8GxbBYneTNIBr1/O+1keGua806ZwpkmsWQGBMVXnpHMu wjLGV1mdRz3PplsJz2E+zgGCGKAtA+PSqkK2R9vzOw2QJivLqQ+vHPz5iX2Nrz1+wKe6 BoYQ18FJL37hBN8GeCFkre8YQAMSD2BZ9mqZ3N7AujhRrtfP1YtrxhaCuo3FAsGspu5m vNcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515441; x=1711120241; 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=p1DgpWWU6EAciyMI+tFL4AWkmHHqHFUrK84uXLk8RKs=; b=QnDdaIsRj/AQM03cFSjqUzoKlqadQjDrn688nAny9LjVT8phCwDs/EjDsKENtoXGWr 4wfezhArbHeyo2y0zLlkGUX9Yfdd1HxNAnS3CFD2k1KT/i935R0N2pUKfTF/4skoYO50 0zKPEHDjMM3U6uzmc87OW476/iNzNnAPBwc5hlrQw28EMeGzLAjWtIPziLS47Jt5j9pX dZ1Ukh8oZmrmRiGArya/RulD9f/HcKHqLo/Zs4N0JOUvSjAxkJ+waXq+4oO05O+uyew/ APGGfjO1Zl7EzvpfUCo7GC/ZSbIhvQGjoDVxmWAe07vLBQIYmtiE30tEVw8n/8JVGgxy ds1g== X-Gm-Message-State: AOJu0YyetC/DfJvoIGSQRqc1WWWyEZftgkiL1eOAZvsoDhjfGk3CIaGe MS+IB4mRsjS0vf9odmEDhWlgDxbgiTG4AG+/its1TZKknqRP4XuuzNhJNgJyE79ra6Na99DN9xR x X-Received: by 2002:a19:ae01:0:b0:513:25c6:e98d with SMTP id f1-20020a19ae01000000b0051325c6e98dmr2348803lfc.57.1710515440772; Fri, 15 Mar 2024 08:10:40 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:40 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:21 +0000 Subject: [PATCH v2 12/14] dts: sdm845-db845c: add u-boot fixups MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-12-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=843; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=YmBgscYN04ZbVZGGJFD08tSuDrrGuIbLaNGLiTo8A1w=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKY+Vkv3XqAXkbJi96UnU63l1qo96M/cmb71lNtN55 6enzcGnO0pZGAQ5GGTFFFnETyyzbFp72V5j+4ILMHNYmUCGMHBxCsBELtcy/A9eOkU3vPfip8l1 qq6HI3vez5n2lH+712v343NvfdriL8fP8N/phmjuzG/CNZtadsgU+BYf4Hc+vfnqLrd5scselrY y7PgCAA== 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 USB VBUS supply for the type-A port is enabled via a GPIO regulator. This is incorrectly modelled in Linux where only the PCIe dependency is expressed. Add a U-Boot specific dtsi snippet so that this supply will get enabled when initialising USB. Signed-off-by: Caleb Connolly --- arch/arm/dts/sdm845-db845c-u-boot.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/dts/sdm845-db845c-u-boot.dtsi b/arch/arm/dts/sdm845-db845c-u-boot.dtsi new file mode 100644 index 000000000000..3c83e21251c4 --- /dev/null +++ b/arch/arm/dts/sdm845-db845c-u-boot.dtsi @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* This GPIO must be turned on to enable the 5v VBUS + * supply on the USB port. + */ +&usb_2_dwc3 { + vbus-supply = <&pcie0_3p3v_dual>; +}; From patchwork Fri Mar 15 15:10:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780523 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp253911wrs; Fri, 15 Mar 2024 08:12:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWaxlN1/3FpCLy4+7c6wDNNom+zVMwOv90IRno+73nHk8nxsFy+C//hq2f0mx7jGd7S77Fwv2/zxSKm+g2rwJnj X-Google-Smtp-Source: AGHT+IEHDN3c4sFvAuPExnrGZZi1KQBtawqnvouc/B/osZYzqEmOlqfe6AmYnkE+kT4IYohn5V5c X-Received: by 2002:a5d:5412:0:b0:33e:c539:977d with SMTP id g18-20020a5d5412000000b0033ec539977dmr2674223wrv.22.1710515577111; Fri, 15 Mar 2024 08:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515577; cv=none; d=google.com; s=arc-20160816; b=xwoWfbbebiUXmx2UN9FVPYVejVUCPvy+T7G60dGgleh1hr4ftAq+bXVz+u+DdXB5+U DuyezUUpnWSo0jGlzv1PqTt5ErJA94wdIlNxNDkM2cRvIJaSM/KAn725uhmJFOsaHdph cdp861WyUB4VgSeUEHlt9ba2Etn82QxugtaHqkbuoXOrSZ4XjvnFf86FMdi9TRFF6HnY gqhg3mX9UCL6yO119y7O1kb+QmjaOQMkVoSap7oSPeYE/QadHQJGXWCuyP/d8fUnjbpY R65mbBvggEIChwcia3t5JC1+mTJkOFpX5DqeJOsuAFg+WiTs9NLUTHWwfGeOkhuSVPCl f7lg== 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=LlTy2SH0jD+rDZMfgaioHxBqgSU8ahy9ZHuQdbxygR8=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=bwvAhHR5LBSXjjRPN67lJJTp+uv5AXQqCzr+vnpnmW+jtlJXfE8Lh/aByjSPDJmlxb I5b/3soIfX1tu0uS+DiP9/gpa5h+pB2jSOHCSYeAwVuumYfWZzESdph8p4UxYAIy0TSW 11ZzWKIKKVMFVAJcVA0yQIro7SF/4Pmv2NA1B6JF0HOvhoB4z4hdfozxPo7Uv/+/rdjc TcqORe3p225gixADpFtjaIOi0NmNwAZZWBkapGgUa/wd+ftbS4/aSFSa42QhL/i8C5LC n1/x/gbWT2a42YB4FzcMHrITQPCXT0X6ghrBXzfnSyM/oPz4nIcJyeJWfqpfK+We42a9 I6pQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XOC8eiGL; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id dx5-20020a0560000e0500b0033ecb05f222si1619211wrb.274.2024.03.15.08.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:12:57 -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=XOC8eiGL; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D249588054; Fri, 15 Mar 2024 16:10:54 +0100 (CET) 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="XOC8eiGL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0955D87FBF; Fri, 15 Mar 2024 16:10:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CCAAE88064 for ; Fri, 15 Mar 2024 16:10:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33ecb04e018so875219f8f.1 for ; Fri, 15 Mar 2024 08:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515441; x=1711120241; 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=LlTy2SH0jD+rDZMfgaioHxBqgSU8ahy9ZHuQdbxygR8=; b=XOC8eiGLM4u/J1fApuujNS+0hVshfzrbZb3z2il7hkbBc4tufZmrgL7Cr5zmhki+sY pIcF9UZhozoqcqd3LCm93TrS8WoTcGAvp1t72nk85jVPBti+MUSSoMCErjVUyP2IB4ZM xYbXLaCE/Lc3xeIxGjWb+oWHYSfjapAhxPo2wnCdLOD5qgjyp9DKb5JV2sNMLerTB4vO vLZVCXX1agUFecLSqZ7opRg7uvT2QLo9VWFdoM/Yc7wfbWM8GAyA0AHGIeJe+XcOUb0r QwKzMITykeePdXo0BttNoSFgQx1sc66zJVBKKYUOahwSQHHOYD0mAzivaZYfarttFrhZ z5Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515441; x=1711120241; 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=LlTy2SH0jD+rDZMfgaioHxBqgSU8ahy9ZHuQdbxygR8=; b=hFF0S+jOvZGHSyVlRIoOCIyJHHwrdWSbCBDzJP0ux76VUKXfEH454AuU+yD94a/k4/ nxOOcY0ZkVPkMp+57K4K7JIbvbiWoEJ3Gv8iBGLRlHHsAXLQd6eD8+cxBu39jtO0Wne0 DNnvjA6YTcIj0imIwKt7LLP6cltnNoEFeqaslHoDaR455F3QrU6S5PS9T9ZYXS5sZ5pc dkS47aGBXFu4EIhPRMhyzmlLuJY6ocCc65yBWogtLs3tHd41+ooJNbsPz3VZj8+mHx6C zYyvyl5x/kU+3MxPQss4AQMagqzFv6IFG5tCVroUWY6aZrXVm2S/URLzzjPM6lQFKhdi cZ1A== X-Gm-Message-State: AOJu0YyJ2wjx7dQvmOaKStcsMV/7ItYhzy20j0NNBBx4ffHVvdVUFx+p acbGDuWGHeeaiQVJXBqnkxqWmlUztXUQxmptj3kMRtg+WN5tw7/IPb9qaUL8P6ltTalwVrHICD+ v X-Received: by 2002:a5d:4577:0:b0:33e:9116:bef4 with SMTP id a23-20020a5d4577000000b0033e9116bef4mr2507240wrc.14.1710515441730; Fri, 15 Mar 2024 08:10:41 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:41 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:22 +0000 Subject: [PATCH v2 13/14] qcom_defconfig: enable livetree MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-13-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1117; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=K+hGLekjLNLv+gZXUcwWJjU4qq1J3VQmPrhkKGcSqhI=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKU9E5ry9df6YZP58I6kfH2bvS/L16RCotNq6lLs6z DKwZcrrjlIWBkEOBlkxRRbxE8ssm9ZettfYvuACzBxWJpAhDFycAjCRJ0yMDLMmcHlzrp3lc/Ds oZ8z7d9Jzll26s6+Bkm+D+0m/1q/ffNj+J/Ys5754dZTn6wNeAP9vjZuaFVoC21b6H/z54mSmqf Ox/MA 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 Qualcomm FDTs are on the larger size, and with the addition of DT modifications during board_init() it makes sense to enable OF_LIVE globally. The cost of building the tree should be offset by the increased efficiency at which we can walk it. Some rough measurements with CONFIG_BOOTSTAGE suggests that this might add 0.1-0.2ms to the boot-to-console time. However the reset-to-reset timer difference is in the range of 0.5ms so this could just be noise. Suffice to say, no significant slow down. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- configs/qcom_defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index cbc612b44bd9..eebd0d74bd51 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -25,8 +25,11 @@ CONFIG_CMD_UFS=y CONFIG_CMD_USB=y CONFIG_CMD_CAT=y CONFIG_CMD_BMP=y CONFIG_CMD_LOG=y +CONFIG_OF_LIVE=y +# CONFIG_NET is not set +# CONFIG_OFNODE_MULTI_TREE is not set CONFIG_BUTTON_QCOM_PMIC=y CONFIG_CLK=y CONFIG_CLK_QCOM_QCS404=y CONFIG_CLK_QCOM_SDM845=y From patchwork Fri Mar 15 15:10:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 780524 Delivered-To: patch@linaro.org Received: by 2002:a5d:46c1:0:b0:33e:7753:30bd with SMTP id g1csp254036wrs; Fri, 15 Mar 2024 08:13:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU7E60BNMjB5uqyMw5LN2WqfMkpgySsElseiD4wpvnxlIuE5t6v1nNAxs4Rej2DeH8hTTxK1ghJam5gKde04jG0 X-Google-Smtp-Source: AGHT+IGVgkos4+6JdAYhu19asA83SqbXAysG2bZhZH3/kugmxgGF+Jjj+FKOtZjegCHsjf+u8omI X-Received: by 2002:adf:fdcc:0:b0:33e:c3ca:e9ff with SMTP id i12-20020adffdcc000000b0033ec3cae9ffmr3685306wrs.61.1710515587514; Fri, 15 Mar 2024 08:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710515587; cv=none; d=google.com; s=arc-20160816; b=tpu5XEDA4ByWRNgzlyLKPDp0tvApYUmyZhan5krh27gkhQrs5bR7WcwizviE8OIZOu aR2SAgyXDq8/KeoFUuTlYQeuavp+m8Az/fZ+gC3O1zc/yLxjBQfYrwDdzvsp5L7768oD TqVrJlIH4tLP1mzyKAwxudY8GrVVLp2bMo1xZUY4I06xq/wGmDvZgiD6EhmcwJgjEI/w kONxUZPIXjTBczxMK4mPdqcRAIR41yZQEh7gbsJxD1ZuxYuMUulrg6OVnacFeDs1Tdr5 Hyfo4SW96hdmNlcoSzCuC064pczIyGEZO7T7OXUWxppbTlLj3fhQjUL7mQn/WJ/0XlKH 2vnQ== 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=UcNVMhc5pd57BJAWg7CEaXltJXrT2vPxwLAptj91np4=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=Mg7G8vPR5PqDTXlzJm4fo+0BWo9ii5qncW81AexRkrbarM7xaUz+6wl99T82htxy8U Iyx/gp8BvJmKImk+h4vGn8uOy+cL8XAfno+3l2xABjjB0ZzgYDDVQlXfPYCrIcLGt6df F/c3W7ZKusyVpyco9qKfrTPFtC+qubfp0SqOnAG7gDH3eaaR/aqU0Ws5zL1+9ILVFk+x HPtsYHnZUvra5DHwdhWGyPEf9SKjV6/O+CGzdKOlTCOHLn2+2T7VBne/q73iDt83WfKn VTWOalK1cXViqTmlhwMKh8creiP8ZFHfdlHynE+CXKW+3cw2RhEXsCud3pNKiABbxzz+ kiaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Svn5zNVM; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id c11-20020a5d414b000000b0033e918d8579si1706235wrq.617.2024.03.15.08.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:13:07 -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=Svn5zNVM; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7830E88064; Fri, 15 Mar 2024 16:10:55 +0100 (CET) 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="Svn5zNVM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BFD8B88058; Fri, 15 Mar 2024 16:10:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.2 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 582C887FEE for ; Fri, 15 Mar 2024 16:10:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33e285a33bdso1317666f8f.2 for ; Fri, 15 Mar 2024 08:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710515442; x=1711120242; 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=UcNVMhc5pd57BJAWg7CEaXltJXrT2vPxwLAptj91np4=; b=Svn5zNVM4+0CyeE42+ugUDOK+Z0iZy0ayIY3JMON+rfFUEwfxaKGMRVqEtOO6Zx+aT /ABtlBb1SHkQHI1xvrUBI9NBGwK/OI178F8WinEpT2V/cNgrTQuMcrR1Z7TEnRLGSQa/ BIzU+ydzZ1h0G/02d7YDAofzWbuN0hkdOORfE+faqFykJ6bvBD496kXUde0DXa2pDR/5 DCEejd7DlcXMbCuDVLFOBQQ6GIOjOubaYkoARrZmNtr2u0jRkUZbUYiSoS6L+rSaqUL1 1VZjdbYfEYs4+j0Dv3i91uf0vXDvGIk5mzpoPoIUJMz8jPecHtMuJ6p1eo1QibKkQl3B DCow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710515442; x=1711120242; 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=UcNVMhc5pd57BJAWg7CEaXltJXrT2vPxwLAptj91np4=; b=XnAvurIYLQTBw3zCuMPM0nPRgbbtMt+yCx8KOUACY/5mWJTN+uFzgLuMFsz9YEtUrU UmFYgByHut/SI+VWwdGKxMqDE2wgx6xtKvAJSC/U+yWGjCP10DLjjXugSYhfd7tazfkT OXDHtEka54ly4CkxYPbwG/nsk66vlreOqfPP8+XfR5dl00HFMBIZ5qHzacOSwVbi81cG B6Frjo0MpqxPVtpf2Ze5/WneR5lBAoCjJ3nFicOilKOJbpqroSX1mm95EMxT87PVqrhJ zK3DdDVk352sjmsNcZ82erXUymlZzmdXfqSp5E/rgSRwBWYhn256Ox5oGDHftDH7S9eU tbyg== X-Gm-Message-State: AOJu0YwyXHZG4NfENgLRT/BkQ59Z0PDyoFk8GQzCRvWv9ysVg34kaPln zO+IKwkxf6kzw23ZHKK4PRGOnfbjdg/r3yuBFan/22zNOxe9eL5PiNpYMtXOMuHS9rKh3KHHOu9 h X-Received: by 2002:adf:a2d6:0:b0:33e:7a85:7244 with SMTP id t22-20020adfa2d6000000b0033e7a857244mr3585099wra.35.1710515442738; Fri, 15 Mar 2024 08:10:42 -0700 (PDT) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id n6-20020a5d4006000000b0033e699fc6b4sm3398141wrp.69.2024.03.15.08.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 08:10:42 -0700 (PDT) From: Caleb Connolly Date: Fri, 15 Mar 2024 15:10:23 +0000 Subject: [PATCH v2 14/14] qcom_defconfig: enable USB MIME-Version: 1.0 Message-Id: <20240315-b4-qcom-livetree-v2-14-ab635774b2dc@linaro.org> References: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> In-Reply-To: <20240315-b4-qcom-livetree-v2-0-ab635774b2dc@linaro.org> To: Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Lukasz Majewski , Sean Anderson Cc: u-boot@lists.denx.de X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=2128; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=wl9BzprwKPg29hyT0yDv2ltLCWGR/3EDXgkc/6tNd8M=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtQvKU8c/M6u5Nny9t2Oy7MZRa/+uGXrmFXYvcpYLrNdI PHA43fnOkpZGAQ5GGTFFFnETyyzbFp72V5j+4ILMHNYmUCGMHBxCsBE1iQyMqxkfL9g5jQZ96Ls /oDf/9JPm4TGX2RwrH5tXmeeeG9WTizD/6CcnHVlldXb4hdUOZ76mSwq1vCHwSHkzsSHr85ujp+ 5ThgA 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 Enable support for the DWC3 USB controller and required dependencies for Qualcomm boards, specifically the DB845c: * IOMMU / SMMU * USB high-speed PHYs * Mass storage and ACM gadgets Signed-off-by: Caleb Connolly --- configs/qcom_defconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index eebd0d74bd51..3979c19052db 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -12,8 +12,9 @@ CONFIG_BOOTSTD_FULL=y CONFIG_BOOTDELAY=1 CONFIG_USE_PREBOOT=y CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR=y CONFIG_SYS_CBSIZE=512 +# CONFIG_SYS_DEVICE_NULLDEV is not set CONFIG_LOG_MAX_LEVEL=9 CONFIG_LOG_DEFAULT_LEVEL=4 # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y @@ -22,14 +23,17 @@ CONFIG_CMD_CLK=y CONFIG_CMD_GPIO=y CONFIG_CMD_MMC=y CONFIG_CMD_UFS=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y +CONFIG_CMD_UMS_ABORT_KEYED=y CONFIG_CMD_CAT=y CONFIG_CMD_BMP=y CONFIG_CMD_LOG=y CONFIG_OF_LIVE=y # CONFIG_NET is not set # CONFIG_OFNODE_MULTI_TREE is not set +CONFIG_DM_WARN=y CONFIG_BUTTON_QCOM_PMIC=y CONFIG_CLK=y CONFIG_CLK_QCOM_QCS404=y CONFIG_CLK_QCOM_SDM845=y @@ -37,17 +41,24 @@ CONFIG_MSM_GPIO=y CONFIG_QCOM_PMIC_GPIO=y CONFIG_DM_KEYBOARD=y CONFIG_BUTTON_KEYBOARD=y CONFIG_MMC_HS200_SUPPORT=y +CONFIG_IOMMU=y +CONFIG_QCOM_HYP_SMMU=y +CONFIG_MISC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_ADMA=y CONFIG_MMC_SDHCI_MSM=y CONFIG_PHY=y +CONFIG_PHY_QCOM_QUSB2=y +CONFIG_PHY_QCOM_USB_HS_7NM=y CONFIG_PINCTRL=y CONFIG_PINCTRL_QCOM_QCS404=y CONFIG_PINCTRL_QCOM_SDM845=y CONFIG_DM_PMIC=y CONFIG_PMIC_QCOM=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y CONFIG_SCSI=y CONFIG_MSM_SERIAL=y CONFIG_MSM_GENI_SERIAL=y CONFIG_SPMI_MSM=y @@ -56,8 +67,9 @@ CONFIG_SYSINFO_SMBIOS=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y CONFIG_UFS=y CONFIG_VIDEO=y # CONFIG_VIDEO_FONT_8X16 is not set CONFIG_VIDEO_FONT_16X32=y