From patchwork Wed Jan 31 15:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768501 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1910560wro; Wed, 31 Jan 2024 07:17:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5nRhFXHjZvYWfgeE9ZaHFkasVMSSOPpK5sKC5v3F+qGZDieEL5Xt311Fm8rw5tyT4tTLS X-Received: by 2002:a05:6000:542:b0:33a:e6e4:945d with SMTP id b2-20020a056000054200b0033ae6e4945dmr1571592wrf.2.1706714237786; Wed, 31 Jan 2024 07:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714237; cv=none; d=google.com; s=arc-20160816; b=N0HsZ3FWPuk/seDsHL7r42J/gSqxLGnCC1aF9yMMzxpyORm2UnDhBzt1rzjtxhU9Z3 JhCxnaRaKypeay4wu6uMvNpQHpgvsCBltNpUr4wb+PudLBtRR14GPFlfK/QEDe9FFPRR Xs3Z/m4MhoWKJyFWeg5vTqZBussMVTCFKlFsk2Ebz6AuCTZd3tjqAgGeqoN2eGTNDC0P F9cuSVL1Zz7Ww8plgUXkyXtLFKT1ZwHkXPwDti7FpW1hEH57cLwZF3n48zQjHSrorZOb yA+92N9lLToGDEbXxKyAPYiJeRk0wJMj2i2VJMfYMRZSx6reNjyijPsm7uOp9mmoxbDZ hQCw== 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=NUKWtJNuzdemEldFviChnZJaROqyAug441mCn6zzdBY=; fh=d4E/HI+bVm3xBknIHr8qwsldMVqwTsS3rriTMMP/Q9c=; b=tReVRstNF8nW5XSTa7Wuezq5/SwyMlmBDrIzFUlU1vbjiSaT3eSlsTLR5LsFt6oP4w dhF9/gYYJdiT7Hlp6nRSA4uycLRt+PkywZZuhSAiia6+/LZ2u+wIqt3CaxQcVr8PQL4j EI6+TxKBVjRcDnweBOzz0GNS4+3boHv8qTKrL6cXJ8kHIKMh0HMAV4KpoAbGk+raWkA3 IQ4hBRYSRpusqLwFlY448/mqX6wFgOMFJh3XBdzPhbXN7y8gxXOrKyV7d6YozAs0KCkd pFsbJRkcn29LCluI4wvrbvppQ2QpqPp+9LnnQBmM7QgWyf0c472L+IaK+sfl+HlnRt3N r7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=us3ysoh6; 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 k1-20020adff281000000b003392e402247si6818538wro.826.2024.01.31.07.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:17 -0800 (PST) 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=us3ysoh6; 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 B32E487D86; Wed, 31 Jan 2024 16:17:08 +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="us3ysoh6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9F10A87C09; Wed, 31 Jan 2024 16:17:06 +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-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 683DB87C26 for ; Wed, 31 Jan 2024 16:17:03 +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-x42b.google.com with SMTP id ffacd0b85a97d-33ae3cc8a70so3096566f8f.0 for ; Wed, 31 Jan 2024 07:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714222; x=1707319022; 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=NUKWtJNuzdemEldFviChnZJaROqyAug441mCn6zzdBY=; b=us3ysoh6GQmc9VNQgK7vD9xgfJW3gDSLDBfz6Ac7dpQVruJRp3ZV4FLNe6++K6loLH FCnLH/gyAaagKpma/ABuNm+tg+L4yDaPblK78EFAKtYVHHTrQDjJwU915wt+YVWiAnTF 7Om+LPkUAmO92Cc+03JNgYGyTE/ntJrH54FBHJ5XL5tIWGB9/i72ttKgmRfa15mAW1zk wExZ0VuxVUpcOoGTc3K+J7dl4kyW0Pl53JRBFJoxVsmL+WD2ef8Jmu0gS5c5YiSMIxnC lvB2GfCHw1EnEHuzxOB5HRJwsPyTa3TjO9lgLtm9dYyAKeidMQwjlCXqPkvIj5un5Kdx PoqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714222; x=1707319022; 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=NUKWtJNuzdemEldFviChnZJaROqyAug441mCn6zzdBY=; b=W7Pai5NE4BhEgpIdKX3WpbIsZlP8WRW+7xGl3Kk36rU5AeegYZ8PZ2gmcg61BiM6H1 6NyTzVinC6JS2+3DTnmuhdrDwO9/UAoN+dHa74TS1J8is3wYvBk98la8GBlCZ0ptm1Rn UBogq4WBCcVF1BgOpxM7yo+fanktsWwSvOml0zHkvZ553bVGQr4mlQM5Vd1gil9hDP5Q vJjXOkQwFLCto2AQW0R6OB2g5H9e6LwbzSCymihHxWSPQd2vU+NkzebH1bXtpfcUUYzq +U7Fsm/uBVJkrj6m0KTgIGrP1fAbtfpGccqhgxpci4apfkfED75C3kXgF4WXsZLOz33E pD5w== X-Gm-Message-State: AOJu0YymIMAKT4MKG5rHRMw++teBtxF7O4doY9VVHHdkrvkLLdGwiCc8 6SHoqoec8pAgKS2UgctFWz82Tt5r16s2ffW4OYbLSgGJIUrceSYj3/kHyIO1IB9Kc7PX/2/0caS s X-Received: by 2002:adf:f3c4:0:b0:33a:f2a3:d0fc with SMTP id g4-20020adff3c4000000b0033af2a3d0fcmr1653760wrp.39.1706714222688; Wed, 31 Jan 2024 07:17:02 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:02 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:53 +0000 Subject: [PATCH 01/13] mailmap: update Bhupesh's email address MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-1-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=966; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=K9JW8cy0h3HF9qfFJuSmTvEu0xU4iHHdsafM8i8mZY8=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKdm7kxdcuSbktMd2VURI//57ur/+3/o3m7GLc8XSQ yH2T2uedpSyMAhyMMiKKbKIn1hm2bT2sr3G9gUXYOawMoEMYeDiFICJbN/J8N85TMj0kq64v4zo 8gUr7kcuvmXpOcXH+PMdva+mhyZ17p/LyLBYYP8q4U/H94nrzZfN2zutJn9vp43rgjXrG79cmLP /TE8+AA== 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 --- Cc: Bhupesh Sharma --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index d1f08f3eca8a..f6e0847b2168 100644 --- a/.mailmap +++ b/.mailmap @@ -30,6 +30,7 @@ Atish Patra Bharat Kumar Gogada Bharat Kumar Gogada Bhargava Sreekantappa Gayathri +Bhupesh Sharma Bin Meng Boris Brezillon Boris Brezillon From patchwork Wed Jan 31 15:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768502 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1910666wro; Wed, 31 Jan 2024 07:17:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnKS45wu14xkN+lxKF54CGJ1g7wmnuayEZo2djbG+YpDTG+/fbuymW3RitQUjWh8oeJzfn X-Received: by 2002:a5d:5142:0:b0:33a:ec25:60b3 with SMTP id u2-20020a5d5142000000b0033aec2560b3mr1411227wrt.68.1706714249098; Wed, 31 Jan 2024 07:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714249; cv=none; d=google.com; s=arc-20160816; b=xJy3RqlYikYTk/6Z4Elzqj3UERnHhD/XXiNMlt1Eqzt23NzRQS9hAtEEK2yxS1/FG0 gAlE+Udy+7+4LxzPisMYMNKe1v9GCJQEjQbSWyFU0wiTSBOcbg20m6BdsldDD3Nj3Zxk coPp52h7JtCRBIeiy467W75lLK0PR5m0kWz9YEKY2N5CthEnRwbxc/DLazkE8VviL2ao E2nL1H9bKv+sW+9FMPpIDgWaITmJVLZ3q9MsiN+Z8WpAhF5PdK/nIs0fWdms1gMBoMlt G1FOgYaaunl9e0CWsh9BFfCBzZTUdI+Yk/NRzncO8hrXRvUyTKeLIHyBRrfaUpjb/ESm l6Ig== 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=C4tobKv+CKE+CLdoggOlcYFIZKT8rWqapVdpNSo9lOw=; fh=IUJzsJXR8tzOhtgP/Qm7FzQrRAC2ZStJPTaXNXY0swo=; b=V8W/kaVeTXH1BQf8gbqsVAUFh3MKGWEZP2MnuvI4eUsEk+5VE+zv1gLgkvLFNQ5Hul a1SzDhxkmzIIPr4HqZxjaifPkg9IVmuXi3Mdh2BzdwvMYUVihb9Ul+bcZbTBeoE6mGeu DxmYV3WmOhDe7jC1DteX3yjsFi6ATh7w5hPBx+YOX/HGfa9atwACb2qPqqwbu1jK8l5R cxMd6fVfcgICWUTjobbwXQHdQ1ndYonQtFasadVJFrW+fjTne+8x2e5Q6zpO7D1biK9C S7MLFUcD/aW+8UcPNKBCyKe18ZFhZcE3DSWVtK2naQUqwdAeRlZkd/c0gT7hLHd2zIfq wvvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u5QkAKwg; 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-20020a5d68cb000000b0033aebf0945bsi4283792wrw.786.2024.01.31.07.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:29 -0800 (PST) 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=u5QkAKwg; 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 5534287D3B; Wed, 31 Jan 2024 16:17:09 +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="u5QkAKwg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA3C387C26; Wed, 31 Jan 2024 16:17:06 +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-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 691CE87D03 for ; Wed, 31 Jan 2024 16:17:04 +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-x32a.google.com with SMTP id 5b1f17b1804b1-40e800461baso64526715e9.3 for ; Wed, 31 Jan 2024 07:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714223; x=1707319023; 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=C4tobKv+CKE+CLdoggOlcYFIZKT8rWqapVdpNSo9lOw=; b=u5QkAKwgJS6t3DIdunZUjASJPtnD9hbd7LiGLLP10dr0SWMpc8bFV+migSaSiSWZ9J ERgOYdU4hMSytA71zxymjSwa+iFc+50OcrZzhDUXX2Q7V1NZxHuR22Co0AGDyi9jq9z7 uvFJz3QTIgefVt/rQF9bYqWUUn0LTrlPjRbF8gNADlea2XF49fjf6hYUucYKe0Xz0xxR f9wdy5gwBMLj8yZIhPWWzlKsgZfHaWEPEPtYiuJHzt09ofNGaYxqVKKTaFrUvb43R1Cx pbveLD/GeizXqjzCkPy5GvzzBEa6BRUz+cGwOuxpOh1grZNo+X410te6VwhZhdbVRUKg Fn2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714223; x=1707319023; 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=C4tobKv+CKE+CLdoggOlcYFIZKT8rWqapVdpNSo9lOw=; b=oJ/4c8XeFeBdtfwcJSQjIwjyEojHcxNc5O1tuBS004ucTHq6OqeqfH/thVJfU8FZ3z cWkU3RByNtuXevMK+fvIQj5Z13Uu5tOv8jZDXLw1MWjefpcB49pqF+fch5nIK4BB/Y0o RFizcq+Zfzc52F+1Yb/c/pmiZ//hXRJ4G8pmlzDyMO0VauHXUu9r5zybSbh84s7xVhbd V042fM3rosB6cR/kZJ7LGJj882T6V7TzGEDEHPVE4xp84Z0hQ10JeMk3ZaOUsl5sW6E2 1gvpxmDeXeeCUIeeIXYHdUJzWYjRx6LohPAgryi8LWwKAiHw1sLA6VTny85oA7ObmByF 4mBA== X-Gm-Message-State: AOJu0YxmLStBrYOviC18bmREYrOXE8YStLB+RDGF6CRZliwh9OPhq+Ip ddwPAlCXYBdBBd05DjOvgfKhwsMCjiVehYlm30zQV3Z6AP3kwK27y3OAF3281cUevdaHElDSt+d 3 X-Received: by 2002:adf:fd82:0:b0:33b:e62:63c7 with SMTP id d2-20020adffd82000000b0033b0e6263c7mr212502wrr.61.1706714223513; Wed, 31 Jan 2024 07:17:03 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:03 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:54 +0000 Subject: [PATCH 02/13] phy: qcom: add Qualcomm QUSB2 USB PHY driver MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-2-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=14813; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=4FiWejoY7+qLMHEOYdFGdLBql0JC5Gm4IwK54xWhxqw=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKdmTlH8xJkrFpu8o5K6fN0PX6rtGkt6Cx4H3ZD6/F 7q9e6p7RykLgyAHg6yYIov4iWWWTWsv22tsX3ABZg4rE8gQBi5OAZjIupWMDFtaVGc4WNZLbZgQ xm++c86OBddCxQxqTlWzX70TukP0cCMjw4LnTyt/S7mxON2NOFu08QSDadnlQ98+PK3tWGjdt6D 912EA 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 @@ -12,6 +12,13 @@ config PHY_QCOM_IPQ4019_USB 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 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 Wed Jan 31 15:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768503 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1910752wro; Wed, 31 Jan 2024 07:17:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9dAvHDVZbkzPES2qQVuLgUhZmLSQ5mBt3rTAHdzKJDwJE8hnPPB5QUZm2sUZhWJMwH3tw X-Received: by 2002:adf:e38f:0:b0:33a:e9c8:77c6 with SMTP id e15-20020adfe38f000000b0033ae9c877c6mr1637577wrm.18.1706714259560; Wed, 31 Jan 2024 07:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714259; cv=none; d=google.com; s=arc-20160816; b=bFCnWL2G8GQLs/zCRM3hiulZxHj239AQk3FMvx0SV2WLTZ8eelqkboR3Wu7mMbdcxU aznYJ8+sDoVoiCLvgPYqENIlQYCgFWPD6xYKWs1IYWIQLBRRdQYypKmFs1YH1VKTtZA9 psibxzdTT4N95xY9IIBd0dIe57vTzMLHzvGuaVOmFvNRdnS9TtydPBsQRcZ+aG3EKZYe ojVgvGmBNN7jA6Qx8MJGD3e3w6uMgIL6ZL6O4ox6/Q/I+08ZJkbihQlqr2xp4Fj3KZUh Gsg9QrrUjKLUVkv9nlxsFZr9W3wCRZae2JysnCBaKnR5LSxJekvjELvnbuaC+rf3JQFR SLOw== 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=lQc3ADq7JG+XC6HPi3rN3iHdyesyW4jGzfzKMeaxjEY=; fh=IUJzsJXR8tzOhtgP/Qm7FzQrRAC2ZStJPTaXNXY0swo=; b=kEmJ+H9CXXA7Y1+HxCKpiEgq49HqjXawlfC7y0/vY1yC2Mko5nf7ZG5mGWoLrAmb82 OfWtWBLPuQa3pHF5xYWujjd0Q+OWr5uco3LpVBafVPhjUP+ehKlOUpl0RbKOlgXr5dwF kexZvOysjll3KVeQzanQMvdjr6oXsgFyo+R0bVAPS9BgDsgGkTncB38fHLuRL5oW9ZaZ pM7pUGcL6auiSG8f6oDoc0QKXEHksizztsSZ5279oke8rpQuBCehC6WiLdzofRgF/enI o9SajKJEvBeZeHcRKaXKMy2240Lm90JZLndzTQDTsVV5Gf6xUBNKlugKgSzrE25bHCoa YylQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mbTTHWQ+; 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 v10-20020adff68a000000b0033b07c3b86asi505839wrp.572.2024.01.31.07.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:39 -0800 (PST) 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=mbTTHWQ+; 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 E85F287DC1; Wed, 31 Jan 2024 16:17:11 +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="mbTTHWQ+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BE9EE87D88; Wed, 31 Jan 2024 16:17:08 +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 5303687B1D for ; Wed, 31 Jan 2024 16:17:05 +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-3394bec856fso670046f8f.0 for ; Wed, 31 Jan 2024 07:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714224; x=1707319024; 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=lQc3ADq7JG+XC6HPi3rN3iHdyesyW4jGzfzKMeaxjEY=; b=mbTTHWQ+tUz7QbzqpQvxC2WYj9SkU4gCool15weHxON3PtDA8gC/VdLMLtV2JTXG06 UaRkMXUZfvytHbwZwsOnrDpzbZIiB+3aCfFbyfylNJxwh7lI/LuwThEH8rJwUOe4rtJm U/eTHisCOH5w1F/Ba3c+NzupMu4yqCiDQ50HrGw4GU7nyOoGbR2HDB1xwIsBun+uglGf pyY9OfqKSZzbGuoyptPS+KWJJVspZnZqfeqwM0euzR45GEcipiu4BrYQzjtEt5RhTBmM 90gLUIc8IaJElM0wuvt6RF48+VCvX+CZHtDb2brzH4D3CLN7k63LuRZG9W5sehlY0W0H sLKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714224; x=1707319024; 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=lQc3ADq7JG+XC6HPi3rN3iHdyesyW4jGzfzKMeaxjEY=; b=in2svNbUwF4km5O5EiDRuP/iJq4NljCjxJTkBPQ5dEunq0OVrMv/dK6uYvRIcIZTzB /uEEqi0YxEt/D0QCq8B6J4GkYm1KF6shRzAfEEu+1KXgVdEUFLvLpvhmVTZKmJDPTDc2 q7tQ8fENZMz3VNgNpoRj6c0nBIKulWzWH1U+0q2Q9PsODtTnlAKR33O/aLqNtBTZ1Odp 2ZtUWsIHU5SlOquvXWxjW6NSc7qEbDsCjhodQN/G+U5Ny8p8a92JASCJtZpD+N28Bowh Ob6El9MSGiVn2P5+pPQ/56DPrQoRMZfx6c89SpdwP3IRnrv+NWJZZB6WMYkepBAmjTJC rSxQ== X-Gm-Message-State: AOJu0YyGkTwvGSMNS0fiF16oHc6FyUxT2UX7X9KOUOC/dlGtHrqV4J+M m2tw8nYpBpd2UymrfWBPtcJJBLn6RLkTbCfdslXwrpKwZdDHcX5ldo/IC2L8zA5b8ca2MswGFNh w X-Received: by 2002:adf:eb4f:0:b0:33a:fe4a:90be with SMTP id u15-20020adfeb4f000000b0033afe4a90bemr1835882wrn.23.1706714224536; Wed, 31 Jan 2024 07:17:04 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:03 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:55 +0000 Subject: [PATCH 03/13] phy: qcom: Add USB HS 7nm PHY driver MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-3-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=9701; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=bVyBUWrmB+ud+t8QvIiY7KrTX0FEL8AvxznCejpPZPw=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKdmrn4QfSxL+NPtM1IpnPxsMPxy/tuDHpyw95pOS7 IvyOLo1OkpZGAQ5GGTFFFnETyyzbFp72V5j+4ILMHNYmUCGMHBxCsBELtkz/GRstTnwsOnr6bnB PMb7HKw+dWRN/nZO899DWe13vU2Xr3cw/NMtZFOeWbvhlsKjm69rDJ/W9hxreNnUfarvrPK8uRt ixCwA 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 @@ -19,6 +19,14 @@ config PHY_QCOM_QUSB2 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 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 Wed Jan 31 15:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768505 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1910951wro; Wed, 31 Jan 2024 07:18:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs+6gDTxyvvdyMDLuYEyhBZ2FlT8iW44JC+hDb1Lbms5cahVKZnd1tWaNMgOsRjq9zpQW1 X-Received: by 2002:a05:600c:1c11:b0:40e:f9f4:eeb3 with SMTP id j17-20020a05600c1c1100b0040ef9f4eeb3mr1523355wms.39.1706714281196; Wed, 31 Jan 2024 07:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714281; cv=none; d=google.com; s=arc-20160816; b=idejsGxf8JbZKl0epYi1tDjXROv9Vrb2WgQoRyZEPZDHvw+EoC9tvEt5VUb98eYNVU SuUQc8ItdiqS0nbIopJ+BgAPNCe05HePsuUF9EmIObDRa6GFH9o+uzRRLhldNvE/HNQ/ cNnmGx+m1Byfk9TsqLAnS9KULHUaHP4Y7u51TJJJbuSTb+wHdjIYQ5fO72qaFpcxf0Ih JjwL+c0p1sC/7BpSbVHf5yY6xEL3WCgax30xKwlX3nHbdjT6s79pVWuYZ0aSV4w9mOHE zms23kxzUk6lppTm1OFl9BIAkQSeWaCf8VEZdHWju1jhSKNkpYAzi6DoJ9IuAbFq28V/ 56Yw== 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=BFLsg20wM5TJTQaIx2QGSw+936ZgLg2JcXs02tyk2dU=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=kP9/0kSA+58PH65kW1saYLaUSV9rITxTIndQxdTfO0TWY87VoGQ3a0yco4NVVr4hFj hPlGpxBVuVvLjt7WC7Y3jt4cUp5Ab0RMiIaliV+bZWyyYjqYzAsN3dLVoTXjEN+QVAmJ n2nAd9rLCTIPQYal8ypEblJYhlbKXPd67V0Kj9/DmtSf29ZgYOEd780sbSH8+pPaxZi5 8XbLDIUR5glqtXljqs5E/3gAOBVOJnLqBOCbL6+FpfgNVProKdM2cvDQuNUjopd0gTty pYk+r481x2pViIpt9eeeN8M9v2QWYiiT6Hs1IFCAcCbz1PcvhwTgITqB1BwoSEb6x89S iYKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERPlH2RU; 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 t15-20020adfe44f000000b0033aeec57dd3si3652525wrm.232.2024.01.31.07.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:01 -0800 (PST) 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=ERPlH2RU; 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 EC58487DCE; Wed, 31 Jan 2024 16:17:12 +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="ERPlH2RU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5356687C38; Wed, 31 Jan 2024 16:17:09 +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 34C4687D6B for ; Wed, 31 Jan 2024 16:17:06 +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-33aea66a31cso2106053f8f.1 for ; Wed, 31 Jan 2024 07:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714225; x=1707319025; 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=BFLsg20wM5TJTQaIx2QGSw+936ZgLg2JcXs02tyk2dU=; b=ERPlH2RU2zVFD2+cHFoA+7K06GNwVrFySsnAUnsRWh1KywltPY24nQhNIMBwNyTPgJ VgJQJQ+8hQfEfOG1k/kE8Hv0H4PePu6tq7rubAy1xcWsWWijzTxtPXVJVEEFOAsE809I 0BGMsuYPNP6OCgobPOg3Cs5hw0dPER2WeBJ5CwxWrCnlx2mZW5BJKiBssSuJWnTosY8Y Y0ucuYjYxxm7U/TCxwqT60+yADBqILNmmiKFfYK+TUamsP8FTnUBAtOKpUbYazUbDMe1 BzY+cgFpDLQuhsi3bfLJPBt9iRMlSIRpw04WZvzLfBWuUyq4b9fKyRh09lVGpFGZTaJz JIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714225; x=1707319025; 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=BFLsg20wM5TJTQaIx2QGSw+936ZgLg2JcXs02tyk2dU=; b=JiJCVnKyoO7u1myLNaZ8AgbwrioqLzBiZRNBbx0I+OLKUVcWH3lf6HeGmtflP39OA5 +cggcEZ0zL8xTY2hyoDBocSRcJuVqeHnIvAujkYQCLTPa6pGLBE7CHcNZHwdVKxtpABL 4kFdMviuJz3UIxvQ0+r4h1f2y/srag8yLiIpMn8IPaDdMLnB6wM8hLpPz86uIQAxk5tz VDX9ydYPSr15gwbuvc7Hcsfvhjm6BQd3PgBsRkPUOu2mIiocBSV88aGd/+fG4sWC2ia9 St8OCPxqpL99Qaip3V7jeJrwHVztCMGoyGNTP8qWdD+pu78zMXpros2o4CUHg/o2CP3J EMow== X-Gm-Message-State: AOJu0YyIlVfbzJisxXCCMdOxkaGAAZF7Bb66AeTHcCO3sGkeAA242Ey1 hQgzbgXmxPbj0qlwQMpQaR3Xwhklk1nMoDUpBQVfJYhkZHBZrCqFKgf10C5wwSw9Ps2nyFogZaM e X-Received: by 2002:adf:ee0d:0:b0:33a:f5bd:2cf4 with SMTP id y13-20020adfee0d000000b0033af5bd2cf4mr1405694wrn.58.1706714225328; Wed, 31 Jan 2024 07:17:05 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:04 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:56 +0000 Subject: [PATCH 04/13] clk/qcom: use offsets for RCG registers MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-4-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=20474; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=xwik2LbcKScV4ihBFX+p3Kz97DYq1jplkZUMvLutQGg=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKdlL/MLap85m6uDZtn5xxiu3F8+dtI7w6tn3a/xzm PVt8e3DHaUsDIIcDLJiiiziJ5ZZNq29bK+xfcEFmDmsTCBDGLg4BWAiHnWMDLNnmwi7C3ZbHBIP 2J1jKykizWsjdDgs+Y63XZaRn4DlBIa/Mn56rT/CvpaU8q5dvvrgFna179pG/nujd6tda1l0Xbg 9HgA= 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 9de0ad5ed32d..67d2d108326c 100644 --- a/drivers/clk/qcom/clock-apq8016.c +++ b/drivers/clk/qcom/clock-apq8016.c @@ -23,11 +23,7 @@ #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) @@ -38,31 +34,10 @@ #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, @@ -86,7 +61,7 @@ static int clk_init_sdc(struct msm_clk_priv *priv, int slot, uint rate) 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)); @@ -94,14 +69,6 @@ static int clk_init_sdc(struct msm_clk_priv *priv, int slot, uint rate) 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 */ static int clk_init_uart(struct msm_clk_priv *priv) { @@ -109,7 +76,7 @@ static int clk_init_uart(struct msm_clk_priv *priv) clk_enable_vote_clk(priv->base, &gcc_blsp1_ahb_clk); /* 7372800 uart block clock @ GPLL0 */ - clk_rcg_set_rate_mnd(priv->base, &uart2_regs, 1, 144, 15625, + clk_rcg_set_rate_mnd(priv->base, BLSP1_UART2_APPS_CMD_RCGR, 1, 144, 15625, CFG_CLK_SRC_GPLL0, 16); /* Vote for gpll0 clock */ 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 @@ -26,31 +26,15 @@ #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, @@ -69,7 +53,7 @@ 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); @@ -77,21 +61,13 @@ static int clk_init_sdc(struct msm_clk_priv *priv, uint rate) 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 */ diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c index 7c683e519226..d912b673d0d8 100644 --- a/drivers/clk/qcom/clock-qcom.c +++ b/drivers/clk/qcom/clock-qcom.c @@ -95,7 +95,7 @@ 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; @@ -111,12 +111,12 @@ 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 |= source & CFG_SRC_SEL_MASK; /* Select clock source */ @@ -126,20 +126,20 @@ 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 */ @@ -150,10 +150,10 @@ 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 01088c19015a..7eb26369cd8f 100644 --- a/drivers/clk/qcom/clock-qcom.h +++ b/drivers/clk/qcom/clock-qcom.h @@ -12,6 +12,11 @@ #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; @@ -24,13 +29,6 @@ struct vote_clk { 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; @@ -82,9 +80,9 @@ 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 03fd65a9328b..3ebfb9030dd0 100644 --- a/drivers/clk/qcom/clock-qcs404.c +++ b/drivers/clk/qcom/clock-qcs404.c @@ -28,35 +28,22 @@ #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) @@ -70,10 +57,6 @@ #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) @@ -85,10 +68,6 @@ #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 */ @@ -103,22 +82,6 @@ static struct vote_clk gcc_blsp1_ahb_clk = { .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, @@ -133,60 +96,6 @@ static struct pll_vote_clk gpll1_vote_clk = { .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); @@ -194,7 +103,7 @@ static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) switch (clk->id) { case GCC_BLSP1_UART2_APPS_CLK: /* UART: 115200 */ - 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); break; @@ -203,7 +112,7 @@ static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) break; 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)); @@ -213,16 +122,16 @@ static ulong qcs404_clk_set_rate(struct clk *clk, ulong rate) break; 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; } @@ -238,7 +147,7 @@ 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: @@ -260,14 +169,14 @@ static int qcs404_clk_enable(struct clk *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: @@ -281,27 +190,27 @@ static int qcs404_clk_enable(struct clk *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; default: diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index 36ffee79d966..5d6c0cdaeee5 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -19,13 +19,7 @@ #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), @@ -46,14 +40,6 @@ static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = { { } }; -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); @@ -62,7 +48,7 @@ static ulong sdm845_clk_set_rate(struct clk *clk, ulong rate) 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: From patchwork Wed Jan 31 15:16:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768504 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1910847wro; Wed, 31 Jan 2024 07:17:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHf1qm3l/cL7HIYsjk+aDuWcAHIKMXPExrGkoGhfgyFwmuee4hDo+NJf8C3iFpZ1YT3jwGO X-Received: by 2002:a5d:64ce:0:b0:33a:eb58:fa83 with SMTP id f14-20020a5d64ce000000b0033aeb58fa83mr1622630wri.4.1706714270074; Wed, 31 Jan 2024 07:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714270; cv=none; d=google.com; s=arc-20160816; b=H/drek5y4umISIg/9OyJUL1fqGO4ayYvqVJfpjFyTH/l+FPOq6XKVPLPKGL/sVSgZH gMhk8n1bWQkOzsxt2GJTc5tw/pwfEWsw6egkfzzeGC10wQCcdsaW1bnzb3BzC5DydUH2 D6JcHpV0BgjRWSG650GJO9OQAH9erXWCNb7mK/OgIc7n5JnRua7SBr7T2hqdAFpD98v4 ecrew64eiqru/YTrCWLYasfTp+UzB/tRphzodzaAJ7z8Ft7hHqaTruCjt00ITXkTC4o4 pcX5gLETYiCFvPbwDL/L16C9jaXlUTrnyEs5PUUudBbKVSsJWS8dSWCxSawr/3Adp1Uz wakA== 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=UFqjXWR2EyRY181MoxOm1kupuAVudbHRyYSyeMvdfE4=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=pnFhtM/FvDOOeqWp/LKyVTmetOIuhhuL+1nuzGIgVcLjnd9RxNLT2JyNbaGPPv4i74 t4hxKG4G64rNd3XLepbpBaVYkiFIYXYHAaLjkEm2Zr8sFyFdCMuvhJTsG+gAFTuITzJN gA8nshBwisi/6M1VO5Q1Xv1sR/LRb3jRWxW2Tl2a2aMqr9KIv7wJwWJNvP/bszhx3oPO X7tZfxkevAIdf38elZSuwVF2LDC+hUrYXwsg/2M1tV21m/Mu+5NbsAPeGC1JHgAgIWmB NRHJ1LpRdFEcoJ1lIxTW3vJp9mx/mfRu+L+Cd233ZEdAn8Bi7B842/aKUdu7eLSbuvs8 0Lkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oZJYm2eu; 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 m1-20020a056000174100b00337d6c36a77si5702195wrf.155.2024.01.31.07.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:50 -0800 (PST) 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=oZJYm2eu; 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 76FD987DC9; Wed, 31 Jan 2024 16:17:12 +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="oZJYm2eu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2AFA787D8A; Wed, 31 Jan 2024 16:17:09 +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-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 08DF087C38 for ; Wed, 31 Jan 2024 16:17:07 +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-x436.google.com with SMTP id ffacd0b85a97d-3394ca0c874so4232471f8f.2 for ; Wed, 31 Jan 2024 07:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714226; x=1707319026; 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=UFqjXWR2EyRY181MoxOm1kupuAVudbHRyYSyeMvdfE4=; b=oZJYm2eugi1OPCrHM3IC1FbizZGt2fplcmlCCngqarHy792pdoea1sMqVYwVZEEC+y RosUndm4Yqvt8dcZFtR//xN/ICW608IjL0RDgVjRISX0eTWrjfJLM4Qpo0BhHI3F3iFt +FkaPyiGvgJkKkHjCE2SAJnXpfDmTXwqTPC/akkSpjJzrysPtkQIlU49kJcHCiHXjszL 7+JjuIUindEelPTHWmc84IFnxuH7vH/9+gbGSz0grc1ScakhcHNkst+mSfTnsV1rGo/k qUhH+RFNTiMRU4nkbr3Ro2oAwr6hLDM/WUnr37crVNuEd0ke15w6NsY0Sv6ge8nT3ETm A/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714226; x=1707319026; 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=UFqjXWR2EyRY181MoxOm1kupuAVudbHRyYSyeMvdfE4=; b=OErBjG9DneLaXPmP2m3/Mp5g2c2rYChiyKZiWrKX+G5WacxS4h5uspp28T6EWHBOAy x48PqiAQnXT67yGisZPnouGy+4kGslf2TYCebEwsuNYQRjMPgt5dJxLo2swhtHOICMnv dLjOUMvNn7EJmfA7NDGw4wLA4YupMvRpkrv7ExEcza/IQiU17UE9Kk9L80Xk4gm8o84z ykRhMHkLbSiRrCBPabwHrzVY6FawNmJm2D6wGYY/NcmWNm9ZstNTVmJkbTVrqnqXg8jj A7ScjDca2jlfDP6FefIsxyxo962vYFZQE+RcVrPfu7L08E0/yBLwmkqKUBwnh0d5YZkU P+IQ== X-Gm-Message-State: AOJu0Yz6V+63sAnPl77w3XwWwX3Prj/40ZRTbfTnM5m3nv25xCTpu5Zp BzpkXz4xVHK/Fuwbuy3RUz/fNidO2t5Kpu01Gq1GwhP/EZHilDu4DBJtNlxpfGCLMlByUHTNVp1 2 X-Received: by 2002:a5d:5088:0:b0:33a:ff67:74f with SMTP id a8-20020a5d5088000000b0033aff67074fmr1230495wrt.41.1706714226294; Wed, 31 Jan 2024 07:17:06 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:05 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:57 +0000 Subject: [PATCH 05/13] clk/qcom: add gdsc_enable helper MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-5-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=2590; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=BSNiNlwYSEmQfLDCyKskK/nWEh4PijXssqGk2AWtGPs=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTltD6cmito+VWh+XrqI6dsNFw7GA97bQyeUXTtVd vHB5LuqHaUsDIIcDLJiiiziJ5ZZNq29bK+xfcEFmDmsTCBDGLg4BWAiwkcZGVauePmNPVZ60qFz xi6K5988cPjk3/SKU+Vpw4sznVckVvgwMizOCJML8t/D9ZF580qvyR+eGsh/7Vt5v0aYtZU57ff CCHsA 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 Global Distributed Switch Controllers are per-domain switches which are used to toggle power and clocks to an entire subsystem. They live under the GCC block and might need to be enabled before certain clocks, so handle them as part of the clock driver. Linux models these as power domains, however this additional complexity doesn't offer much benefit to us in U-Boot. For now they can be turned on as-needed when a relevant clock is enabled. In the future, we can add a power-domain driver to model these properly. Signed-off-by: Caleb Connolly --- drivers/clk/qcom/clock-qcom.c | 18 ++++++++++++++++++ drivers/clk/qcom/clock-qcom.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c index d912b673d0d8..0e89e7fe429e 100644 --- a/drivers/clk/qcom/clock-qcom.c +++ b/drivers/clk/qcom/clock-qcom.c @@ -39,6 +39,24 @@ void clk_enable_cbc(phys_addr_t cbcr) ; } +/* Global Distributed Switch Controller - these are + * breaker switches for entire peripherals like USB, + * they control power and clocks and must be turned on + * before configuring clocks or accessing the peripheral. + */ +void gdsc_enable(phys_addr_t gdscr) +{ + u32 count; + + clrbits_le32(gdscr, GDSC_SW_COLLAPSE); + for (count = 0; count < 1500; count++) { + if (readl(gdscr) & GDSC_PWR_ON) + break; + udelay(1); + } + WARN(count == 1500, "WARNING: GDSC @ %#llx stuck at off\n", gdscr); +} + void clk_enable_gpll0(phys_addr_t base, const struct pll_vote_clk *gpll0) { if (readl(base + gpll0->status) & gpll0->status_bit) diff --git a/drivers/clk/qcom/clock-qcom.h b/drivers/clk/qcom/clock-qcom.h index 7eb26369cd8f..2e074d0401c4 100644 --- a/drivers/clk/qcom/clock-qcom.h +++ b/drivers/clk/qcom/clock-qcom.h @@ -12,6 +12,9 @@ #define CFG_CLK_SRC_GPLL0_EVEN (6 << 8) #define CFG_CLK_SRC_MASK (7 << 8) +#define GDSC_PWR_ON BIT(31) +#define GDSC_SW_COLLAPSE BIT(0) + #define RCG_CFG_REG 0x4 #define RCG_M_REG 0x8 #define RCG_N_REG 0xc @@ -78,6 +81,7 @@ int qcom_cc_bind(struct udevice *parent); 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 gdsc_enable(phys_addr_t gdscr); 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, uint32_t cmd_rcgr, From patchwork Wed Jan 31 15:16:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768507 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911130wro; Wed, 31 Jan 2024 07:18:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoVYxAAh4ehWG6o5OmJ6G9+Fb6QwCx2HFbklmlTUb0bEMloQ1eKTyjxYSgatrrOtYEe2sq X-Received: by 2002:a05:6000:a07:b0:33b:fed:656f with SMTP id co7-20020a0560000a0700b0033b0fed656fmr89446wrb.53.1706714303559; Wed, 31 Jan 2024 07:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714303; cv=none; d=google.com; s=arc-20160816; b=Ppwsn0YYpxo3IcwIRAuwRH2MNO13li/DX+Qc9GufAXvFgmXGBX3VvnP9KgHQeBKrjP iHfYEjKvNlNPN6x9doUEgaROuwHWViA5DrGSpPtX7My6OI6D31V8Qutkvb7h77GyI4be mKIoh2keJuPH9OLQfNRzLafT3tPue0GdDnwUuIGmlOcgJJyvxt2/lcZZ6d0cyBJWfW3J PMksi2/0WtnNJyiDpxfFCULuGptEFNzRHWQUeRBl46wWKKrW7Xb5HXw36VpoJJtS0BH0 4kFmxbwXvXgUvv1OcmC9p8Lr7SbC/1ABfexXghjWvxzHj8X2v0TaLy1BNc8jpRcOYeAh treg== 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=TUjVm8ChAuEE7poMndSbEEcqjlSiD7o3DI2Vmypvbys=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=zRoD5zoe5IGQKuEAqhW+uAU/fz8t0BnPCtKY3PyexiX5L6XnhZyEx8RwaAAL8MIEu9 iLVcta7peXKDZSPtFvxabwyspPOm3aBCtrv13quu2Nj/DGG3FAQ5cDx8lx3r7K6zDLJs IR+9SD2m09oslXJhPtnEUIqH0mhKaKo0CLrx1vObHWKaH0ItEqBGnZpZb1c7mtBljvCI YAQmdaqXqsRqto05Clv5xRz0ypUul2v4v93lnXMfYTOKFQI1y+M/nmn38mWXhaZR2Zh2 IpvRymo3AXGLx6vwMz3oXckNGtKwojeiTsZN+/I2kCkfjR3unIcHKRij135COl+XSW+n uBAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q1SBf+1O; 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 u8-20020adfeb48000000b0033acf8819f7si6603573wrn.489.2024.01.31.07.18.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:23 -0800 (PST) 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=Q1SBf+1O; 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 EB59787DA2; Wed, 31 Jan 2024 16:17:16 +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="Q1SBf+1O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B920987DA2; Wed, 31 Jan 2024 16:17:12 +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-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (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 C834687C39 for ; Wed, 31 Jan 2024 16:17:07 +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-x32b.google.com with SMTP id 5b1f17b1804b1-40e7e2e04f0so55905315e9.1 for ; Wed, 31 Jan 2024 07:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714227; x=1707319027; 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=TUjVm8ChAuEE7poMndSbEEcqjlSiD7o3DI2Vmypvbys=; b=Q1SBf+1OKzffjWH3q0MYFe20CuC0DgRpWzkwwXbF0EmcBRga/SnDL2Kl50ZyIrt86D qyFClK0r8S21z/HjJ2ay0zRm1o6HTLFnuCZyi+ErcbnAuOvhdTE0+O7WICLThyjyMPLQ GfeaURjGHXfL4Yx2jnq5E1CKUbPC+3AT+V+zt3YsDyvemeVK0PcXJjebXWS/4lUaba4Y PTa7Nt5M9QW/N6DxGOWRF4QAyVUJ9TRG2atHtsdMvw75rin9SO1sZSe1GKAy89Le7IXs CpmlmuldVWn0iOqXB1mQ+jNbCE8zrj1LGdB14NFkMGmxP7CSeMAy2lWWDFeDBUN6AEW/ zYiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714227; x=1707319027; 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=TUjVm8ChAuEE7poMndSbEEcqjlSiD7o3DI2Vmypvbys=; b=LOmoO2fTKZfKskRVmCBQPwefdE1VRa6K6IdAsJ3iQcjm38pcTgvb2eRmFrT7LDHsxM unLzMSBSTdlnLVamNFZ566VTVmHI9QAtLot88IvMlqEokUvdpCGYT1vzKvc4Z0RwWZpE B1NWcbc8V6WxgkZX81B5J9RF3LMT7SSfn0s/ifPSxbKtYeplsCv+xdb2Kmi1PWodOLGE 2QoDpwU+WMPRxn/grQY7xZNn6wn0aOfHGej3nINWzBmtmKtiscrqVSm19PB+XRTU/IXb X2NrM648L5FtfUrqDwmbrVMeGVZm36FFGMSmWsZ6bcdhn4F1ZEXorKhZWtgb0/9VBgzj 2mcQ== X-Gm-Message-State: AOJu0YzJ6O01VmqB/6rzMy8EGUTGSQBdu767hpt4v1GfMmdTkajjQnnL 95VGtvs32QPQJaaPlSN82fjRmO8At8zKCfnOhJ0+tVOce5e06nzZ1bopiaN1X4GzZubGvpafIkP 0 X-Received: by 2002:adf:a3cc:0:b0:33a:fce9:47ff with SMTP id m12-20020adfa3cc000000b0033afce947ffmr1509250wrb.4.1706714227071; Wed, 31 Jan 2024 07:17:07 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:06 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:58 +0000 Subject: [PATCH 06/13] clk/qcom: sdm845: add USB clocks MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-6-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=2487; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=SePkLo8cAWQlkal5yGvvBWm4sTdv1wMRoUK+7UJ5xnA=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTlLDdyF059EPLrmImJ8bU7OfyZ/i0vHdd+dj+13P HFYzNO/o5SFQZCDQVZMkUX8xDLLprWX7TW2L7gAM4eVCWQIAxenAExk5wKG/2XTuY7K77zcJn7L 3m/RQYm6L/wZZn2SwZo77CoXacYvrGT4p/3uv2+FfcUu6ysJ1y7o8LXPddYUSvwjMCffXrOKMYz vPgA= 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index 5d6c0cdaeee5..e5033cacb216 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -21,6 +21,13 @@ #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 + +#define USB30_PRIM_GDSCR 0xf004 +#define USB30_SEC_GDSCR 0x10004 + 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), @@ -57,6 +64,8 @@ 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), @@ -121,6 +130,26 @@ static int sdm845_clk_enable(struct clk *clk) debug("%s: clk %s\n", __func__, sdm845_clks[clk->id].name); + switch (clk->id) { + case GCC_USB30_PRIM_MASTER_CLK: + gdsc_enable(priv->base + USB30_PRIM_GDSCR); + 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); + case GCC_USB30_SEC_MASTER_CLK: + gdsc_enable(priv->base + USB30_SEC_GDSCR); + 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 Wed Jan 31 15:16:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768506 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911058wro; Wed, 31 Jan 2024 07:18:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGS0M35U4eZjoEdycXD3kfl5DWzCmUyo8B4rxJqylzLK0L+Ij08/YVecAv3BoREVXVO3H2l X-Received: by 2002:a05:600c:4fc6:b0:40e:fb90:207 with SMTP id o6-20020a05600c4fc600b0040efb900207mr1348495wmq.25.1706714292381; Wed, 31 Jan 2024 07:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714292; cv=none; d=google.com; s=arc-20160816; b=G9vygNFk4DFcb0fvO4XaXg259BrfX4snYKcHdHkMNjvEni/2XFj4o2DyMdNbIjsolH y/bFCrpYiPvsTdCitbPc8EjqTdiQKCInYXsttlJo6Tckr9l3LPYC9PW95zue8Rkzj+UH LNMhrx/+ttCScwjtX0HyPNpJ7Tdeph3EQpbUEaD/bys1d7UAmokOjrRrmtXzk+HzvbVL PHvt35RcINeAG7+NZbkeuiN/uOEuaC1GbsM9xJoe2rMU2sYmQosqLFfuTmG4BR6NeFCr fBqMywhGX2TJ7XJP3RJ86oX+AEkTcjPPUjF6buKR14b6Sq8tsTcfNkLvLuMl3np9wY0F 25uQ== 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=GFzzPtezzlz3qBSalQkCEEJ+9ZjAlCvWbTGr49LOGOY=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=iKZfzI5/DhbGD1UPjb1k9IsDR1V1St6bq4kAaFbkbMusmwZW4ErssBZD8uoDYTDQUH DHXIZeA8/XjPhqixVcwMxit88grpVOTcCCjjxhXGkE8i81c7Z8J0RM9Lw0Zrqup5/p5m ZDYHUIFTYMmLVKHYSEq5A+F/AAcVL+T5euuZ0ASw90OA+hdimXjlkAyA9TSS2yAFmRwQ E1ALduBPZ17UNyQ0JSjDOIHWfJngeICZuj6WNPXunmlmPtqcQa6IE1KacqyOiOJlaMOD tB07nfjMYAmoArmDzaVvm861OTuLGlTcDoTXvDO+Slpb00/Lx9du8mtiKyhdW56QPRpA JJAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IEGIS7n6; 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 u2-20020a05600c138200b0040efa74bea8si817172wmf.119.2024.01.31.07.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:12 -0800 (PST) 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=IEGIS7n6; 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 71F1487D03; Wed, 31 Jan 2024 16:17:16 +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="IEGIS7n6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D837C87D47; Wed, 31 Jan 2024 16:17:11 +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 8B7C287D47 for ; Wed, 31 Jan 2024 16:17:08 +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-33ae3cc8a70so3096609f8f.0 for ; Wed, 31 Jan 2024 07:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714228; x=1707319028; 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=GFzzPtezzlz3qBSalQkCEEJ+9ZjAlCvWbTGr49LOGOY=; b=IEGIS7n6X/71XZ3VA++2ZUX7iqFIlLxobdU1NY5FNyfODIQ6BSSXIG0XSlBjE75++C zPC72+yLJuSWAKxKcVzWVVXLqmcrqY7o0ayQJn0a/VxkQkBUDNz2tKnOlD8QJGj2cWAs jNNxyw+2HhCLOcnfPGKqekVP2TMagVtnLlZRvLufz7X2sMtyUaDrNHsSgILN46IrSIF2 8Zf+jpvi+GST045dTJj/rmBuLabrqVvkNaMBpGVCPSp5Jo7mMmls031xh1K4eJTSlfEK fACBKi5LJ7hzja8KJLYUJkP2SaVq+5PjWx8cWanzuWrLwQCVilhWDbkUYvhwkGhied+w SdfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714228; x=1707319028; 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=GFzzPtezzlz3qBSalQkCEEJ+9ZjAlCvWbTGr49LOGOY=; b=HO+l9IXkDjG3wGNPqv3llPAwDjRcF6XmovNTgO8DbqbgxjGimRzryczFk/vAsGjr9B tWXtKDGYGG3ZtdSSbIgut6jmGC4R2pr29siutLNeuwxdPvwhgsvr+zysMrHTCIDm361+ TENCilZvOO9uq/n+oYE/qWhLAmrm3D5tfrLhEEbNPSJDykCqvSeIoFNjL0XYjV1NfdH5 2pxcZPca9w2sFBXTW8OULKmbOGvABSY7wav5oxczYtQQeCaK3WUY8BgkmQ6FtULyCbUv fckLFUO/a1tx43txhSbZS7usPfw4/gjPUXacrNOEE0xvq1ZpqO/4A4vWwXg/Tm20uF+S ym5g== X-Gm-Message-State: AOJu0YwW/merw3ARPZKV8AiTBTlOqCl5CMCgHmzHOCqIRUakxpVvTVU1 FkLOTdeGmAXPQwNZDbxjrstz3qLOHcE4myPxUy6zi0pS2hklm1NVsc6HsHpyIaFD+DS8xE4R6jU 7 X-Received: by 2002:a05:6000:cf:b0:33a:d1b5:8164 with SMTP id q15-20020a05600000cf00b0033ad1b58164mr1277963wrx.70.1706714227920; Wed, 31 Jan 2024 07:17:07 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:07 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:16:59 +0000 Subject: [PATCH 07/13] gpio: msm_gpio: add .set_flags op MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-7-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=1719; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=KaoiPri56jQkPcn0dAO4J1jrhRFbc4C0gCpe+xSpZOI=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTmT5+geFuJ2+zhVKV+nkslROVEr1qJ75aqJbVfm6 MzkW2rZUcrCIMjBICumyCJ+Ypll09rL9hrbF1yAmcPKBDKEgYtTACbyX5vhf+lUkcyf57c8CIs8 MrOwRn4li1/n1nd/w5ZLvJAvfW4cFsnIMOeb01K7/OvvNhpYqF/93mDvwJDncnT9XXc9E6k5Vrz 5HAA= 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 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/msm_gpio.c b/drivers/gpio/msm_gpio.c index 80cd28bb231f..0230305af299 100644 --- a/drivers/gpio/msm_gpio.c +++ b/drivers/gpio/msm_gpio.c @@ -72,6 +72,23 @@ 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) { + return 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); @@ -90,10 +107,8 @@ static int msm_gpio_get_function(struct udevice *dev, unsigned int gpio) } 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, }; From patchwork Wed Jan 31 15:17:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768508 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911209wro; Wed, 31 Jan 2024 07:18:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IECtvlnAVYOdC0B8VrdnFy4kj9GV2runbYYQhQIZi1BBBpcPkoNDdVYnAUBpv8gG/bqoh6c X-Received: by 2002:adf:fd47:0:b0:33a:f77a:f6de with SMTP id h7-20020adffd47000000b0033af77af6demr1416715wrs.40.1706714313440; Wed, 31 Jan 2024 07:18:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714313; cv=none; d=google.com; s=arc-20160816; b=cwnTMp0EkZ4NQy7o6W/YevDz0YrHJxMvJCcr2yWnUjyE8QNCPEJ2oRdGx5nXpia5YM /avdq3CEGd3rm6bIm76mNmnUypI830T4d67jnk0aUDt8A174GZDVpuiplwnKta6pY26j qjzXT2k8f5k/Mu9UAxATyIoLrjWMTBATpBM73P7P9q2iALIwqxh65xelPfT2W7GL9Va4 9FTgcZnIuxCyyaO6gdx2hcntTP9A0IdPQZ031WxWbUUs2oMFXVGVfcXyiVM9CfuTMO/6 ni0JLzqGdK1Hsc6j4o6Rgv7RanJNeZD7v7K+HSp6V8k2HT57/+Cx27zKj1plCuuGS7Ml 7GYA== 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=9d6pK+oluV5IpInoW43059fRkUOQBE+4Tw5fwZZIJpI=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=BwESnn7xqvgQ2mGJGh0RdDmKRRXGXw9iJxpf6wtB2lfaKmSwYeOUmJgUSi4nUv1I4F QVP9pJPRwXfyTk6Oz7VUzBigq3kr45CXDuiMAXlJvTalcS55ssqPeGI6i0MHQ0emGSZi fwnwnmZ8eR1vcecc1a2+OoV33it+ZOHBuHnObcYDxXyKcICdswJojLofV1FdVlq85kVm 6XOMTJ4SrNMV0aw0J1pA1xgmBIfYGo+vpSvuwOOBUXe7NhjGi5oLxYbInTjjBl2pE/Wp M5BiRQnMN6nGC1qfJpPVRbh0/YzU4uaT/43VaOzJ5Vgkegz/RWzz9kPurNSLzOtpWxUa g7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wGq4/tp3"; 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 l38-20020a05600c08a600b0040fb360d553si810349wmp.181.2024.01.31.07.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:33 -0800 (PST) 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="wGq4/tp3"; 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 6C31E87D18; Wed, 31 Jan 2024 16:17:17 +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="wGq4/tp3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7AD4987DD8; Wed, 31 Jan 2024 16:17:13 +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-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 57BDD87D7E for ; Wed, 31 Jan 2024 16:17:09 +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-x32c.google.com with SMTP id 5b1f17b1804b1-40ef6f10b56so26391315e9.2 for ; Wed, 31 Jan 2024 07:17:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714228; x=1707319028; 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=9d6pK+oluV5IpInoW43059fRkUOQBE+4Tw5fwZZIJpI=; b=wGq4/tp3O7pJ58by8H16Y1h5RJ2BPtWvrrqISK8waNpoxb0K8RF5st6Qp/5gQkVWdq d27YD+AnEHL8ZKz0haPVBPUVR1mA/+TrdeBZRCaThLED7wSyjwgBm4LnyGz1VkwlvNX5 r0u6JCMC+h2TNoDg/kYnn1BZRdK8JFcEiprZWYQ7wXNg7a5iLCRYbIhnLQrqP3GeTT6W sdM5r4YXFkBZtsN5huyUjjYy++he4QbCty83N2IblQ8HLCG8VeBLL1adppSr3+m0gP2x oxbsHSrRv2My+j6V6mT35JFe8XzpZzlmDUjunEDWVZNEK4T48sqbTTXWf06m53TE4i96 Mz/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714228; x=1707319028; 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=9d6pK+oluV5IpInoW43059fRkUOQBE+4Tw5fwZZIJpI=; b=jcW0DyaRdu3dI0vMdGYH1Hhnku1X7YJo3lRvheSgGIlYgdLgIfM2f3V6c91W4D8inN gLz6cdvIl44YVsee6AsSkbjoVjD5xgj13OnIME4My9nN1GcMsHO6zUaavlaeyK2WcUPO UF6IZklPXhqbqNZFRW2DhaUNWCb2iPmM4C5d/FTOEghjlChlkd0E3rGllm2rVCvVBd1O xT8VfsO++ZAbtZsi2Gb/bxer/36tnFOA/suZp3rDIq7KXiBzbolvZEBOEla/5fnJbvbp A+Nrth1IOfl4GsxnpxiskqGS2ba5N5EuUzTgeA6c28ZxJNu8QE76UYTDTW+yvO/d3JYN +8xQ== X-Gm-Message-State: AOJu0Yzly9L6slxJ0+npCynjCdFBcwtqMVpR5abxdEKXCwBQe1OdRzle YFBKDxnFFUI+p/1tVR2B2sR9nwrQ4v80LpkTxnqIe1iQ87QdNrPv3amcJGBCeSD2dAwnrBgg7CJ g X-Received: by 2002:a05:600c:3544:b0:40f:b335:fe7c with SMTP id i4-20020a05600c354400b0040fb335fe7cmr1470483wmq.39.1706714228657; Wed, 31 Jan 2024 07:17:08 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:08 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:00 +0000 Subject: [PATCH 08/13] serial: msm-geni: support livetree MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-8-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=1030; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=kxKkRT67ZfSHqA1UC4TLHGzsRNTPg9F90ko30AeYXqo=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTm5BtZ/fkvfmTPl6veP4dwJF3aErxcovjDxdn/xA velBseWdpSyMAhyMMiKKbKIn1hm2bT2sr3G9gUXYOawMoEMYeDiFICJ6CYw/M96snFaVtT73DQn W6dZhc9Xqd2wnnNc18n7bP7l19/C0lUZ/lkruOxc+sg83bhvttT7DwGJd6tm/Jq268ero/bV97l mndcFAA== 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 --- 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 e5c3dcffc1c6..6455b0fff63c 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -606,6 +606,19 @@ U_BOOT_DRIVER(serial_msm_geni) = { .flags = DM_FLAG_PRE_RELOC, }; +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, +}; + #ifdef CONFIG_DEBUG_UART_MSM_GENI static struct msm_serial_data init_serial_data = { From patchwork Wed Jan 31 15:17:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768509 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911286wro; Wed, 31 Jan 2024 07:18:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIrtFq5aK6VeGtsm0mY8xrpX2p0jKHZk876K3xQyIO16mMK2UKRKERmO6kWhuVcM931aAY X-Received: by 2002:a5d:6046:0:b0:337:c4be:7b9a with SMTP id j6-20020a5d6046000000b00337c4be7b9amr1240022wrt.63.1706714322902; Wed, 31 Jan 2024 07:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714322; cv=none; d=google.com; s=arc-20160816; b=ROaUFVG/zzs5EcixVtLKpIxxezVaVXV5QI55G4OXKWNZryia8yeKNIXitz+NhgLMp0 RCGwfnWpHRw/IR2ASqxWCPMsPMKQ/ANzSfKxddR8P5F7Wk6tRrILe/o6UckvDsRZwYTq nMMOZXJ0AFER+LjVZuyVZyfoOZ9sZ2FReB11a+KjsZquqiLwGnQft0PBY+oFTdAIwxqN +sD2GXUJXV2OmmwnOtgtqpqXguAPQwo5VvOTaH9x+5fjKppABbsQFbVuaxCtvW+1koln PZLoZ3gxtuipWcON1OMTzxbkJq1mlfsuRj3vedHJP+ASd6DAtNHSK/D9ZPh8w2o/ntB+ l8OA== 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=1K2UpMRlfHQyCWRzBdmc6/7/huOXjQDmSO+ysf6rEtw=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=rGX1xrY6Y0UEjvkbMs6mQPtjzAxZChZTXuA6KKBBdQaPfdbDIUN6o8k2lYB5LFhO6Z n3aAWReByTeXi3ff7tDQ2hEUthStLKW9FFptVWZVwRJf6qSRBNAZmHsp72UdWNVggwpr zx51EsWj0xF593LenXKzZOxDSROkHVXpoIM1cvvSebEpod/hgxhBe5GfGOla3k2+4V+G rNXN1DtevX38q2ut/5q7AGKCSrbLSO0Mm/u9nKpovtk0EAZfei1TXudKEE7ySlYOX69u eQMF8lToHi5UTYUSc7WhpN3MRL2UiAUXPE/ugq4PJky6T31PQJh/1Jd6Dbef6f7hVrB5 CRPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KrJmLV5O; 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 b17-20020a5d5511000000b0033b0be295b3si285918wrv.126.2024.01.31.07.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:42 -0800 (PST) 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=KrJmLV5O; 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 E571787DB3; Wed, 31 Jan 2024 16:17:17 +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="KrJmLV5O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 70DB187CE9; Wed, 31 Jan 2024 16:17:15 +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-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 73FAF87D9E for ; Wed, 31 Jan 2024 16:17:11 +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-x434.google.com with SMTP id ffacd0b85a97d-33aed096cb3so2613742f8f.1 for ; Wed, 31 Jan 2024 07:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714229; x=1707319029; 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=1K2UpMRlfHQyCWRzBdmc6/7/huOXjQDmSO+ysf6rEtw=; b=KrJmLV5Ooni1Gwh0AKzbk2W4erstloh5adfny4cDmUJ/SuIFelpHSl0RhpvabW0nWw NOB54e3Qf7C6hnSQD+uCUcdQ0xKTUPc9K5Wm5jwXCc6nCARfJ6HMCm9vnifu0oAMxkOK no9/dYnLyVVFys4BSy6ulRucDAgedhVX8RN09EDrE1/QG/IxSfofBEH9hyS51NoHmM94 TQfFqxGDy+lPEWHn8tWiMfhzjE9WH5VDmePaAbQautDS2+OB4dvyPgtJW6Pm52D+1ixL tvRc1t5ZaDTH20b7Dx1LCYz9/C2FPSAf+v5pJGf0eFMkeDW+7UnKH8uN/bRgxG3MAhZa 8OvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714229; x=1707319029; 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=1K2UpMRlfHQyCWRzBdmc6/7/huOXjQDmSO+ysf6rEtw=; b=ZKGBqtUw6aJOy+6WmZ1tjWJlMHvLbyxa8HKqCqJSzt2MPu/bNcusI43dD/iO7TkmS8 ZbtXknTxwzAZSaLCp7Jtx1/e0iIhpC8H3FF6aZYb+FSY2cpaAXbA/r2o9ooPp9zVQZC2 dOpQRiqB8xZr17/3ZGoJ6cg1wq4tlG4wvqHGdr5KH/sWuOm2Vupp3p5Er6X0aF5umP6y Zteg5NXlDTmGuJ83ee02T0xKqGLTKhAHzhHOanUdd3Cclrqq43w8PbXkAskpZAV6jxW1 7uuEiDUiNbQdKmSrhOmDfXbgSG3fQ04SgOHD9/8UJbvVEf4ns6S4nFl7Npw47ddjTGJT 3K+A== X-Gm-Message-State: AOJu0Yw//U5jkgUOejrJii1SEcyrJLUmEkJEhZZWwk3Ra7MG4q2lG95i HxYCyRaKdGEix4OlmeONFMp5UpasTJfuYZ8+UmJ+sP2NFLlCs0g9QAwdt4EEmrdOp4sVSb5Pbln 9 X-Received: by 2002:adf:fdd2:0:b0:33a:e504:9fe0 with SMTP id i18-20020adffdd2000000b0033ae5049fe0mr1226186wrs.64.1706714229718; Wed, 31 Jan 2024 07:17:09 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:09 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:01 +0000 Subject: [PATCH 09/13] mach-snapdragon: fixup USB nodes MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-9-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=4114; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=nFJ1Rg1PfcJyJ/579wdX+LmX63sts5GorAFhcmezZ2Y=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTn5NTutNO+1rQhI/9BV0Wx/tW3PRguDBCGFWrHch 3s/qal1lLIwCHIwyIopsoifWGbZtPayvcb2BRdg5rAygQxh4OIUgIlICjH8L2ZnXu7nlnbWUCzA 5+/BTXrr9XlsWT3/dt0QsWEuL5x3l5GhIfr9oU85cxXW6nxatKGgMPhM7UedHNPipeVSJRdXGib wAwA= 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/board.c | 88 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c index ca300dc843a9..44925e369d8e 100644 --- a/arch/arm/mach-snapdragon/board.c +++ b/arch/arm/mach-snapdragon/board.c @@ -146,6 +146,93 @@ int board_usb_init(int index, enum usb_init_type init) return 0; } +/* 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. + */ +#if CONFIG_IS_ENABLED(OF_LIVE) +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", NULL, 0); + 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; + } + + 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); + } +} +#else +static void fixup_usb_nodes(void) +{ + log_debug("Unable to dynamically fixup USB nodes, please enable CONFIG_OF_LIVE\n"); +} +#endif + /* * Some boards still need board specific init code, they can implement that by * overriding this function. @@ -159,6 +246,7 @@ void __weak qcom_board_init(void) int board_init(void) { show_psci_version(); + fixup_usb_nodes(); qcom_board_init(); return 0; } From patchwork Wed Jan 31 15:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768510 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911379wro; Wed, 31 Jan 2024 07:18:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEldwOkj2NUI3sWMWKRZ6vr3pY+nHZyi6NmYN6pxq4OINu7YoMJWN4II1dc2T0ovgzynl3Z X-Received: by 2002:a05:600c:4b2a:b0:40e:46b6:bc48 with SMTP id i42-20020a05600c4b2a00b0040e46b6bc48mr1642386wmp.41.1706714333146; Wed, 31 Jan 2024 07:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714333; cv=none; d=google.com; s=arc-20160816; b=wGMtiJfAHnFD39bdBhzkxd69IldHQqZT7nvFRdsXx1xMjOchkKygQhE5h+iun2Sm6o RjHSQ2JCppnhS9YEjtReo4Lx3aSZjmaxVL92hIDVeBvRF3D0ms431iU7debsHYvafi9E 3aBODgUS5Puyrm0aZFmK12HeBXtqSdK01BmYv1gOlQVPhyAu1TcjVsx4aGp8WCb7+fQv peWFTc17XYTwIIOBP1UQfumXMtMQ6tUFwXTgIHNcVK8jyJo5mYQJCbGwQUuEfc/5nvuA C8qxowS8WjdVZ8plhUv2QRWyD4oJiPdjyakZD2lxnYhFe0pHuF9sBwoiFX1feQDf1mKU KtaA== 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=7gS7zpo61JmV4RiezQyJ8jmpn3ALZjRjf7mpIfEhg9Y=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=H1EpmEK5mGvXN/l6ttnI8xhlzhCLEoGe4fNMQzXzSeR7FqYTZRBTv1SfkyfMiylUDA uL4fLyKs5PFPuySJ6vp9FIrihpdcg6KvZV8iszypZPS5pcndTUTxZgUzPaiv7yOREWM1 /BAc/cEHtjuG0FHfUbmpaMyqEaotOhQEsslrPMqdxNVJQTLK0eBy9Gg9mVhoIYHW5r1P EXXAPPIJOcdrq2shZ1p6skIjZTTKf9N9NBFFmZ42h3THa+f99uT5ZWx3RK8ggfb34HqI l0V91wbkb8JUre7XSWEOQ5oJAqZjtFAw/W/WjLoQTwm7K//nBbXBBS0HWjhUYWHO//T+ DE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PCu3ff0q; 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 m9-20020a05600c280900b0040fb0d65c42si818413wmb.231.2024.01.31.07.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:18:53 -0800 (PST) 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=PCu3ff0q; 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 6356B87DD1; Wed, 31 Jan 2024 16:17:18 +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="PCu3ff0q"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3FE387CE9; Wed, 31 Jan 2024 16:17:15 +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-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 C9B8287DBB for ; Wed, 31 Jan 2024 16:17:11 +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-x436.google.com with SMTP id ffacd0b85a97d-33ae3cc8a6aso3141416f8f.2 for ; Wed, 31 Jan 2024 07:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714230; x=1707319030; 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=7gS7zpo61JmV4RiezQyJ8jmpn3ALZjRjf7mpIfEhg9Y=; b=PCu3ff0q5/JMWRmp4I9hQMROlW4H8IuBxOMMRbnXtbruj7xBAouDtF8ZUre1BpbnXH ZXXU6uslwkkWOO3Ef1837IgJ4vb7TUWArH+340vcpICWv30omdzazVMM3zMLoVmFzKML bA5cT2jqrfw0glRa+NtNbqMyfu8PXL1MqVz+ZtEdBL7g0FJIAD5m6gJaM5LMSLEIYjLN KErkTS3AyDn4BuonNpoqJUAcE/oXRgxBeWPZWZcLRBjqE38h/KP+Ibi/6NeF5fASTpK0 m1GkITkZNNe11yN2ZdR2eHEE1vbw4xrhaWj5dkMPT/ycsH2g76EBR9eUjiNzRTVNTFoR ByFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714230; x=1707319030; 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=7gS7zpo61JmV4RiezQyJ8jmpn3ALZjRjf7mpIfEhg9Y=; b=vbYf+Vyi/3tVNDo1avczBvLYc1kYdkxfQf77R7G+C/Jg3jf13lmB2bNIXRmKGL2uBJ jdxeZxwzCkyoQhsHdqgzUODECeqMohzcgd7IpTnXqjfQ0GqlpiIPQVTs7Lhe4ZKLPsxZ GjexChAf3PASNjGfQ/CK7/JmuKQQcLDHRTzGPVxH0pIVBaHMPXlPsrcJP4UXgX9f4W1M 4KOsuaVJoEJViam2c2i3PB+N3Io7fJ9GHSdCoY0Th3V6LpKDODPQzoyzguXRgsjYGwja RIyR76OAKx+mvNAadCehVQBlveQJeMs/gB9yF2HEoyAKpsSsra/l3uWvMx3jhHlCpSsP 6/IQ== X-Gm-Message-State: AOJu0YwikOu7ypL0XacOfUFO3IR5KQXw9Mt6GpVBADpfjWfoD5vT6sqC LiXconIvE/rniv/zSqdrhi8XSyNlLMWfQlBH1iC+7XcXQlETYsP9+za3oB7VXZqomLVIz11RHls N X-Received: by 2002:adf:fc92:0:b0:33a:eed5:7072 with SMTP id g18-20020adffc92000000b0033aeed57072mr1137469wrr.71.1706714230681; Wed, 31 Jan 2024 07:17:10 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:10 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:02 +0000 Subject: [PATCH 10/13] dts: sdm845-db845c: add u-boot fixups MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-10-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=843; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=dGiXbkaMfkO6VGP03CgItaGcQXC5bVnesE53z55Dua4=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTkXZXy+bri75ZTV+sWOC2ffM1u/n4F/7oLj+akHL tcXsicFdpSyMAhyMMiKKbKIn1hm2bT2sr3G9gUXYOawMoEMYeDiFICJMPsy/LOxWfbe/H5/qeEr lhWf/5Qu7ZR8+n3/watnj+X15M1rmljL8D9tKd+OzYsvh77ZOyXpuZVom7feOs6a6bI6/M9jXkT 8PNkLAA== 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 Wed Jan 31 15:17:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768511 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911452wro; Wed, 31 Jan 2024 07:19:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3zNBT5BTJ5/qNOaaRyxZdsEBZT4baJxa2o7QUqGpmsGIOSamkFt/i6KGRBXekzJcdovjk X-Received: by 2002:a5d:448f:0:b0:33a:f0cf:3d5d with SMTP id j15-20020a5d448f000000b0033af0cf3d5dmr1337970wrq.23.1706714343310; Wed, 31 Jan 2024 07:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714343; cv=none; d=google.com; s=arc-20160816; b=rqjf4srSnLRLZ03bkqbl8RIORx0nyd527XQWAZr5hV/5DiwCQJ5FgGp0X9ceUqJi2l eZPICLZMQnd+FzdBNGt9mLtrU8YJADQp+iiCCxvA61iE2K3TbN6pscUShYmY06xYn4Gk w0CiCxz+xzxA8iMrI/4d5QpX8U/Hsw6ZWmHKC/+DWi59SUMLad7AdKEqP7vK7n5Uk+rj zrUX0vNB3Nu4m+Ahr3RYTWj2QGAHMJRxT17IsJWKwGIsLK211sqghnX7jqBDNL5OWckG iNEeFrVYm7MqA1AZGSSbo/jFqEl9iEmZpZRplQ4TNopE6+MmuCxwSCj4fhErIFybF1tA 9JDg== 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=REfHkSKj/W8rWrQvPlPGQDRdKeMQECUIWxqRSMchf6U=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=q4fj//1KdoZDbKk0cnucN2+by+IJ2AqCjUfMs0yefjpd25fRb961B3QPF/+oTfF97o zta9zzPLv+mOu5Ve3unt3AmyKNtoVqrrfvncILeyMkejTB2xDklCSAjdP9qGxrbegbXo hrky2ckh0zGArAJzpWm3jwG+oMDivddTje0wMioxNNFHxAPfXznUWaE5OwU+fjbWQcku DbsQ/zQ7lh45wwNyybIZxja6w2AW2FmYSeqEh/gTE83RKax5aRJ5XFqsqi1HPtf7gyVe eFn2lR/S8/YR09Gq3i/KUloxYusGyjMrFYNHxhxXKOG+IQCAFHn5tLrBH60ez67S0qF4 qHUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nRZ2HB3j; 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 m17-20020a5d56d1000000b0033af4d681a3si2984690wrw.440.2024.01.31.07.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:19:03 -0800 (PST) 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=nRZ2HB3j; 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 30F3C87DD0; Wed, 31 Jan 2024 16:17:24 +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="nRZ2HB3j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A946887DAE; Wed, 31 Jan 2024 16:17:17 +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-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 433AF8751F for ; Wed, 31 Jan 2024 16:17:12 +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-x434.google.com with SMTP id ffacd0b85a97d-33af40493f4so1853736f8f.3 for ; Wed, 31 Jan 2024 07:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714231; x=1707319031; 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=REfHkSKj/W8rWrQvPlPGQDRdKeMQECUIWxqRSMchf6U=; b=nRZ2HB3jn0OxWNVTL4QE99JJP74P5jqf1C1gGCV8J1EyxL/Oj3EGMwfFfgWZnKh820 sWOSDNyxWRMVLanhNrBdAWrbgf28v1jAepjmYz6ah0wy4qsxf4szfNOxT8yndmoe9Zsj kvELHOP0CaulNxHITg3rXlhEvKZN9znQKOcDiWxyikUT/wkB4a7WpBv1IV4fgvdgKo1L 3pk3bbp0MDPt/L6H3U1D6zbYUX/ky0Mcyc/b4qF/uMMCx10IN+Y9DKZdnwfMa92GUU4w 6sZjpqEt+gs7OxcZL2hTfFICH/ZMpQwq4cGXntq4AGFzOenFZY0BEPJNKyOQEbAkW/ug /3sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714231; x=1707319031; 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=REfHkSKj/W8rWrQvPlPGQDRdKeMQECUIWxqRSMchf6U=; b=TY+XAqKSlIaJIgf8ydRoR9eqGsARVIMFEMhsTWCj5X7On4YYVUDx8XwHwWhX4xXqtT rT1utJFRHzn1Ek2DJMdApGiVcIJWQ4FABMF4IpxhLeu5ZzzoygGbItWGJ2TBLHBZglJ7 RVdhRtkkCLDM8JlswyjpCr4axBEB/7laxhjLgZlb8IXj8tV8fNypiUxIWWhyags6Y+MD D9vOvCK0X+JMM/0A/isNw06t/+Ck8C1chJPx7UbcKiuZnCbIoM4XUBi1OhEzzOICqhg6 GWY5Df2z9Bxk7Kbf0IT6yvmTzwVmimvNPlN6WowRWLRnKVTPoHJMN0l428oPpWLrvxW7 W1+w== X-Gm-Message-State: AOJu0YwtaO2Zr4vHaXHKynUR7R2pUcG/Uu8iSNM+RqdCW15VWQTl+Cl2 q6Els99Dk7lu2hcU3cm0ZrEw/VNgIU84ubo71D0m4ksO0dbxRFW9rSjRHB+urWBZwiTkfLyb2Tv D X-Received: by 2002:adf:fd48:0:b0:33a:e50d:d635 with SMTP id h8-20020adffd48000000b0033ae50dd635mr1239535wrs.54.1706714231642; Wed, 31 Jan 2024 07:17:11 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:11 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:03 +0000 Subject: [PATCH 11/13] qcom_defconfig: regenerate with savedefconfig MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-11-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=1389; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=H1z1D8CTBPvjgv97Sqt5ciDaCpGuIEyPMmWv7Zp5VHA=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTkcaWsT5Gu0kt99YT5WEOWy4JPJj4ctYUyOzvdF5 WUudk/vKGVhEORgkBVTZBE/scyyae1le43tCy7AzGFlAhnCwMUpABPRncbIsG0F407P2TlvNCLm 3pXpvKMnHtKXaRCqFWO24N2B78YHnzD8FdiTsaG44WrIkp2OrZ3aZ0OPHCxTOWGfUr+ifCFH+/F FSQA= 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 Prepare to enable some additional features. Signed-off-by: Caleb Connolly --- configs/qcom_defconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index 3c6bdc2071b2..659775852c07 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -12,13 +12,13 @@ CONFIG_BOOTSTD_FULL=y # CONFIG_BOOTMETH_SCRIPT is not set CONFIG_BOOTDELAY=1 CONFIG_USE_PREBOOT=y +CONFIG_SYS_CBSIZE=512 CONFIG_LOG_MAX_LEVEL=9 CONFIG_LOG_DEFAULT_LEVEL=4 # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_HUSH_PARSER=y CONFIG_SYS_MAXARGS=64 -CONFIG_SYS_CBSIZE=512 CONFIG_CMD_BOOTMENU=y CONFIG_CMD_CLK=y CONFIG_CMD_GPIO=y @@ -33,6 +33,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_CMD_LOG=y CONFIG_EFI_PARTITION=y # CONFIG_NET is not set +CONFIG_BUTTON_QCOM_PMIC=y CONFIG_CLK=y CONFIG_CLK_QCOM_QCS404=y CONFIG_CLK_QCOM_SDM845=y @@ -40,7 +41,6 @@ CONFIG_MSM_GPIO=y CONFIG_QCOM_PMIC_GPIO=y CONFIG_DM_KEYBOARD=y CONFIG_BUTTON_KEYBOARD=y -CONFIG_BUTTON_QCOM_PMIC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_MSM=y CONFIG_PHY=y @@ -50,7 +50,6 @@ CONFIG_PINCTRL_QCOM_SDM845=y CONFIG_DM_PMIC=y CONFIG_PMIC_QCOM=y CONFIG_SCSI=y -CONFIG_DM_SCSI=y CONFIG_MSM_SERIAL=y CONFIG_MSM_GENI_SERIAL=y CONFIG_SPMI_MSM=y From patchwork Wed Jan 31 15:17:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768512 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911554wro; Wed, 31 Jan 2024 07:19:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEl2YNGAVP8v5Jeyfpahz5t3dlGxox8UIBA3g36JEgjlr3z9pv2UjrSFymxAefSSL45Hr60 X-Received: by 2002:adf:f207:0:b0:33a:eb4b:c702 with SMTP id p7-20020adff207000000b0033aeb4bc702mr4300143wro.3.1706714353284; Wed, 31 Jan 2024 07:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714353; cv=none; d=google.com; s=arc-20160816; b=MPvEsNBT/QpX8Rm1dAqRaaWM43DwUccjqT3B6LCdAEohLOLnjfekLNpOiDeKAw04pl qcMV6pQgbmSBkOAfbsF+0hydS3Eo7lJxzQZiQJtk6FuNIrw/dQVZCJcm6ZHvSOFYbfH4 +dWntmdJlUhPODBm7+UJooqPLp3DyJlauSzeA1w/nO/eqPNchlCTRPxk27R1E+apJOT2 ewO3rN/H8FoU51g0kzQq2yy1OHyGaT2ftK6m/FZV0QHH0DhH0bJhIqJY6c1bIrEQCzW3 WdVqzR/xDugIK7ENA6s8821R91C6zgclgtgztS1xjnI9hmTjU/3J4+vjniDbPdExrciF ZESQ== 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=CET3eUDV9NZELvt9it488uR+EPRcQvbv6V634t911uU=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=JdZ9CsiCVLoEoeDMEHYINbt3u1Vm6zaHK0BWQPnAwVlnVr+l4eODFi1BlHL2vlKwrj wh36cS6sqxXX1YAnR4oyeCu+Ec5K4imD/CAcw6r3gWnoduZw/kDFN2ZoweefkI1NLNfF J8Wue0kD9gTdZePun5a8RBmVIjnQROK81AGCRGdiRm73Nry24sSjoInl1PIyvUN2iaul aMvsHs7ISliRsT6mergHSGLp4b/4S3/TcQ6Whovjk87hs36kauUn5RJSgifOxZtkpdKA yoHHh2/fBrsEulQ9/akkEFstLNnje8LSJ1jeCXclTJ3Xk2ZvIavyozMEBKR8k5P3zEyZ /05Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQ00i6gQ; 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 e21-20020a05600c4e5500b0040e4b04d2b4si833932wmq.44.2024.01.31.07.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:19:13 -0800 (PST) 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=cQ00i6gQ; 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 DF4F287D82; Wed, 31 Jan 2024 16:17:24 +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="cQ00i6gQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFCFB87DAE; Wed, 31 Jan 2024 16:17:18 +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 4E46587DD5 for ; Wed, 31 Jan 2024 16:17:13 +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-33b029a1c8aso484025f8f.1 for ; Wed, 31 Jan 2024 07:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714232; x=1707319032; 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=CET3eUDV9NZELvt9it488uR+EPRcQvbv6V634t911uU=; b=cQ00i6gQqR9ILg+VtSWraN1rIy0KxavnXARjpzqiPYRqVAnYgKYFfA3jHb28qanJnN gmPcHBS7ea0qwLYg3s23CRy3WHPA8l5XwHpPlbuIYMHk+hoUlcxyU+6tfXjtVWqcZV0T kAK3+J48NGawnLqCBbFs5TTBW2ogNzwhmX2aYVjquYG7bGfAYsPlAC6vwP9g9giPKhCy UZvH5sbSCnIx5P/vqimjCGQQMNP+53pW1VcA9myX7G3Z6jcFvJiZl4d6ijNzIyGlvY43 /U/fYERm3dO1xzfD5lt2bXluNGyuK8Omi0EohksG4FmBsb2HV98lryq2SXc6dk/kW5qk hm3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714232; x=1707319032; 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=CET3eUDV9NZELvt9it488uR+EPRcQvbv6V634t911uU=; b=ORXxVtlbuhVGxFCZeO5yNUQjPYttap9M+eTVJbBoBJ8kUyTP2iK30EPJDSzqoaJf8m NE0XJR7JpfrEzp2MVig27TNKajax9jKqJIyaxkyNKIKv2Gl9G4zwtVxrwwW6CgK6ekd+ Hc0ftQpEiqi0VAoQ9aAuJtZS4Q5WYeLaIIPihVUU7gvlcUQE5JpihLgNE1ElrRvFw8uQ /cy5SLBkvD3+7QBh6xWjZq+sYUM+t471JhAID4VXsWDRP/814hSqR5aN8AFbjNAzbrgK /4SsZrl6Jpb4WSj6xGJUAdsmtLZMxtIGOuqzBfSf1pF/NvH2lGcmloMBchplWDSXdPEF 3fSA== X-Gm-Message-State: AOJu0Yz61g0Unh2wvQrzgKwX4c+g44xBcvx2ssXYZ9JQiJ2ry+4ndkxX EMFblJBK0srWBrU46pykaKWOJr6uv68HqkDbkpMPJEF1AZu/LG6+QgZJTkCShJbUWPfaVcLKIGG T X-Received: by 2002:a05:6000:1c3:b0:33a:ff6f:815e with SMTP id t3-20020a05600001c300b0033aff6f815emr1973656wrx.8.1706714232590; Wed, 31 Jan 2024 07:17:12 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:12 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:04 +0000 Subject: [PATCH 12/13] qcom_defconfig: enable livetree MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-12-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=1082; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=mRizWpS+90DO1FRezjuCs5U0eGxwVK0LwtZzPnHg6k4=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTk39T2dgkQnb39Q7vtk/9W9oauYH7+Y2fS/Jq+ob 6rmOrtFHaUsDIIcDLJiiiziJ5ZZNq29bK+xfcEFmDmsTCBDGLg4BWAieUwM/0Osmz/pKAufvG5v JV8y78jyXM+FdVcuvH56616LyFGJG9sZ/rvveNC2YF7ZpclPjypFtpy//l3TbkHg2vm3Wz4fCuv VvHwOAA== 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 --- configs/qcom_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index 659775852c07..3935fe2ef59f 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -32,7 +32,9 @@ CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y CONFIG_CMD_LOG=y CONFIG_EFI_PARTITION=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 From patchwork Wed Jan 31 15:17:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 768513 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1911628wro; Wed, 31 Jan 2024 07:19:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOj5FIsIfg88/kUOQKekE2qM4YTmEvKrFarHfEd9iU2MHCpFmxg7FNMcuKbNX5xaj0uFLJ X-Received: by 2002:a5d:6889:0:b0:33a:e6dc:2e98 with SMTP id h9-20020a5d6889000000b0033ae6dc2e98mr1365964wru.5.1706714363803; Wed, 31 Jan 2024 07:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706714363; cv=none; d=google.com; s=arc-20160816; b=JD2HZMgK7eUr+xmzxmBUWSm9f5asCFRHPNb60TchOaTbyF6/fPavKsPj/NhxQgpKpF 0T9wjIqt48LZrPOsgW+0UF5lnHshdQkxv2dO7a+SWPsfHVWXvpjiE6jRZhleaWaDds6t NNn/k2GN8ZJwligY8mwTLe5MRhZd+ffRHCNMA40cG72HSFHelQ0M2xSTPaqC8GLolyVt OgzFx4kE+1WxDaF1piUp7skIkVKpUJNo5FjDIOdoUrAqdtRh1AYa1XuHWD7soK2GYaLs 6q7QLFVEkU+WzpkolEFewdianKLfkk/WztvL4MMVkCu5VE2k5PbmGcmL+tR7GfjDs/co jG9Q== 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=hJTsHECS24vGCObVThDn1gZyJSGsUl9Dz7bFF4jZ1Kg=; fh=gSVpyLKtvZ+QePPYgVwr0OwBuSQ/slJGUurC/y9msiw=; b=VJd/Rqy7MzTR4iHsFxm1OdwDjpzu8ulgxumocyKgDFY/nabb0/R7piP6VG1C8MFEWb Gft5lUUcHT7lIBqMevtyDRbVHOneAVFDPyHpdWcWTNRN4lNCUW0Ww16zNHbBnCP18oF4 g8PyXecW7zTzQjTSH4P/nJ/gmunsGFKTmDrw6wnw/5kZ2or/hOvjr/hNOARTM8HsbjUj amcPf7MXqbaQIfd2eGJPh2R2IogXh8V+eolUnIQDu2cEXjokQ/Iy8gZzSvGD6GU5WT2A r80GwAFZU6xuzqYx0NvMl8AI6qWfZOmX2GRwjKowrMO1usy13IByRM/0QmsI282Ix09I WKGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q8NidTz2; 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 p3-20020a5d4583000000b0033ae78fe185si4666149wrq.1004.2024.01.31.07.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:19:23 -0800 (PST) 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=q8NidTz2; 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 9843A87DDB; Wed, 31 Jan 2024 16:17:25 +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="q8NidTz2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9527587D6B; Wed, 31 Jan 2024 16:17:19 +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-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (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 7523887D8E for ; Wed, 31 Jan 2024 16:17:14 +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-x131.google.com with SMTP id 2adb3069b0e04-51120e2864fso1722250e87.1 for ; Wed, 31 Jan 2024 07:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706714233; x=1707319033; 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=hJTsHECS24vGCObVThDn1gZyJSGsUl9Dz7bFF4jZ1Kg=; b=q8NidTz2O9LQ2n86jPqissOkDo8rzrvlISRDoaSjDk0KtzdY1ZjC35hFI+qMFSC45u MBxlSoFsFkWIELewK9z1jqhxbh+iTrJX1nwhUXtteWqBihGBPax9U0/sELNLAYcsrQGz /4z6x9DTCDHI0VL/pWdYjY/SMog6ZeVgWBkp/TivOTf3B2rgXbFVTWsz3JYcROhC4lEW g5zA/JbGEAHPhbA6VEohEmyXvhrhkDALqGx8ZQ6LpWWHhFvriL0ubnqngCV6N3tSD0wG fiZ7DX1GpQiGSoZ8qSVldGlPMwAvFseAcPHKTLChf3UtCQGfTUurtyNksQxTvTpIlRId BNzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706714233; x=1707319033; 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=hJTsHECS24vGCObVThDn1gZyJSGsUl9Dz7bFF4jZ1Kg=; b=N7Eu4+66AnM+CTx9NS4/HkDZytR8B1O1M46U2QUhHzLvr5F6jVOunJ4P1YuEpQ/rxx S0ftOkuB6ad0vXseyvX2HQJ9UWmCZrMpKX+xc2gECLUGY8RMfgD9/MmzvoxSxu0YOW62 zib1Mp7Uw6jSIoaKNbrQMY5hSE7iuAeDt5IdFfu2UhKXSaNKXtiMBAvpIkAZF5XDpec3 2dlT4P0XpEkb3VpaeYnJOaUHUJKhsLJ/2fW8gTrSwGbZil0sIbMU6WTDfT/4qdnuSo9r mU/9Yp5gdX9rX53RsGFeo9deCRARIhSmlNi87GVMXD3TWEDlh3LIlSJKPmCYhHSL18MB n15A== X-Gm-Message-State: AOJu0YyX/NwROWC07qQUl7ivZiy7QqBDHF498FasLuKPzbUa435UTaIl BMqcRxhGsX/SedmONR4hzBPXJF0BO6yT/NthZeE7Czft/gHYETa/lgA8WLKrV7p1+hL9uM2smTc z X-Received: by 2002:a05:6512:1251:b0:510:280a:baf2 with SMTP id fb17-20020a056512125100b00510280abaf2mr1722138lfb.12.1706714233467; Wed, 31 Jan 2024 07:17:13 -0800 (PST) Received: from lion.localdomain (host-92-17-96-232.as13285.net. [92.17.96.232]) by smtp.gmail.com with ESMTPSA id en6-20020a056000420600b0033ae5b637d4sm11109031wrb.35.2024.01.31.07.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:17:12 -0800 (PST) From: Caleb Connolly Date: Wed, 31 Jan 2024 15:17:05 +0000 Subject: [PATCH 13/13] qcom_defconfig: enable USB MIME-Version: 1.0 Message-Id: <20240131-b4-qcom-livetree-v1-13-4071c0787db0@linaro.org> References: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@linaro.org> In-Reply-To: <20240131-b4-qcom-livetree-v1-0-4071c0787db0@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.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=2022; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=SM8R83lPmNm2vkoJLzCW97VuijG2vHV1ie7IOHBvDcY=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhtRdKTnPKrM03XNUtMoKjc5+6ixMSp/4b/1Bj/evarYuM Yi2frmmo5SFQZCDQVZMkUX8xDLLprWX7TW2L7gAM4eVCWQIAxenAExE/xPDP3UxcyWvoxNPvlAr PeafkcihyR3iIfnwxpzprGuClTf/cmP4Z6T5wK88KeVpiGbZtTnr782KW6HaVSiSVHjRsv7+wY0 f7QA= 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configs/qcom_defconfig b/configs/qcom_defconfig index 3935fe2ef59f..dedd5f20b719 100644 --- a/configs/qcom_defconfig +++ b/configs/qcom_defconfig @@ -13,6 +13,7 @@ CONFIG_BOOTSTD_FULL=y CONFIG_BOOTDELAY=1 CONFIG_USE_PREBOOT=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 @@ -26,6 +27,8 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PART=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_FAT=y @@ -35,6 +38,7 @@ CONFIG_EFI_PARTITION=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 @@ -43,14 +47,21 @@ CONFIG_MSM_GPIO=y CONFIG_QCOM_PMIC_GPIO=y CONFIG_DM_KEYBOARD=y CONFIG_BUTTON_KEYBOARD=y +CONFIG_IOMMU=y +CONFIG_QCOM_HYP_SMMU=y +CONFIG_MISC=y CONFIG_MMC_SDHCI=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 @@ -61,7 +72,11 @@ CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_STORAGE=y +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_DOWNLOAD=y +CONFIG_USB_FUNCTION_ACM=y CONFIG_UFS=y CONFIG_VIDEO=y # CONFIG_VIDEO_FONT_8X16 is not set