From patchwork Fri May 20 08:26:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1969 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 141553F039 for ; Fri, 20 May 2022 10:26:30 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id y1-20020a056402170100b0042aa8f679fdsf5239653edu.1 for ; Fri, 20 May 2022 01:26:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653035189; cv=pass; d=google.com; s=arc-20160816; b=osW5fx7A3KW5cKvJGPrBCIRih1KNuNHLDLYxzFBWnewWiTdoRu1ZnUqoHS/rE9jx56 uqm9M50hBvyob651JECaZmwpeH+QK5tPGXqA4UxsRS6C6Ws61a7YK8J+KLQbgaQlNEDD GYhzJlBafmtT9Jc/EORJIiA/xMbRMfUxvlNpTUe7rMaeLbZnQNW0wy1FREhhZlriakhH nYvNHIscWy+oZ+UpxFO14eHaR/4/IWA2Obry/QElnjFEA0WuurG+DdrmWUJ8DynH4HRH h2qY55CAjFhU0LWMy+wEckQExHaI6Vjh28mbuMmmfQDfLQ9cI/YTEyWkHH85rAGOKx/I ZLzw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=r6VC6nWktwlT1ZfJej/y35P4KlaMo1GTM1dmp0MIgY4=; b=P4g4Cq51bcxeUK8OKZtU1z/ZjbxGf3/f8jhvVsc4HgvgHBYyI+/ZgBk2Uad/nZ7v05 doLXf1Xpknq0Zp+NecchYU+qXwOCLhqFoMoiPDyD71E797+HHZjeIAIlX23oCVshAFJr D3MdvfBCZVCkL8LNK/5x8JRIH6ACDhBG2lCmWGFMj25xjtHWrPVEHxKnhOJTIKlTZdiz P0jCcEAjy4elIum+Bv6rZKNuKuiYqcLQLLvWY8+3fic6WAgdR/VBa5UVa3PewTBEZgbh lj84sTnljaK6x1PVixYvShzjMbLWJ99c4k7pIardh/8UMuy84EReLw9d72RH2ZXdo1Ly nInA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q66PBwno; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=r6VC6nWktwlT1ZfJej/y35P4KlaMo1GTM1dmp0MIgY4=; b=ezjnvFmHQxgyvvDTiK6LHq6iObP20TGfbJo4nPmO6AU1XM4uYiS5smObe8BY6IcxRy OEpHlOvWiC5pcluI5z77oHv5EdGsQyb3LFYMd/8bNP2StYNFd50rxK7mA3i98W6QMK/K 86f1oGL0bKaiLaI0t5LDzsvioEG3dSg6CaHM8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=r6VC6nWktwlT1ZfJej/y35P4KlaMo1GTM1dmp0MIgY4=; b=5ftbJBu899nKPJyV3DhhdTsZitIMiiWi+oMCvmdzQ70E3bWQiwjDTl7H9Sqx8rNYL+ ymSMFcQh4oGz8MuKfnq8JaUIFZgyn01q8s2+QTKLppWMhpBj3oI3nOPAN4ptTjyJhx4K SAWKYmipGolirieItN3QA2UdzAWXuAnKcc5Gr/EymBkJsWA3XRcY86lZyveuuTh0I+sN mwOK/1nBrT4wPXc4vyr+UD1NdKKUE3Hm9B9xSUN0ApJPTg8d5tsQk7Z/g2cM+ZvlmviG 39y9HVYMJ5L6mM0odlVoMWINFBYNkNawdq7JdNxnSC4BljPUc5MwFA2/Y12FRtk4z3Ac CYPQ== X-Gm-Message-State: AOAM531EqnYkOIfvsPmw2J3CQ3bAq5SHPs6Z1kLSZEGLxS50+JLdYOSB OvH7DhfSU/WNeo3ROYjS5nmzppRS X-Google-Smtp-Source: ABdhPJzEJ1OoFEYmPcfli0tQPD8Kft0W/g1naJCBSDhPuG1BBlffryqhP8ToiJ/y3WIXUdxT42rjXA== X-Received: by 2002:a17:907:a407:b0:6f4:3f14:7707 with SMTP id sg7-20020a170907a40700b006f43f147707mr7688511ejc.351.1653035189903; Fri, 20 May 2022 01:26:29 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:907:8a10:b0:6f4:91cc:ac07 with SMTP id sc16-20020a1709078a1000b006f491ccac07ls468938ejc.0.gmail; Fri, 20 May 2022 01:26:28 -0700 (PDT) X-Received: by 2002:a17:906:4fc6:b0:6f4:da16:4a09 with SMTP id i6-20020a1709064fc600b006f4da164a09mr7630730ejw.599.1653035188735; Fri, 20 May 2022 01:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653035188; cv=none; d=google.com; s=arc-20160816; b=boXG4i4diInun9KLHZV8yIf27nFPWJ4XNxRFY7xDnqV4uWjVPBpo+KvD35Tr4C0M5P ZB1lXvLkk4XX8bLmljnHkbSvO1+aSnuCYrcZNEgTj8rwjC4gaRkWwZMeotQyRnSBUzaf KF/xqKkyeNiHt3DfscGsGr+t4Z0S49aRXJYqyc0z/2LrHTcLA1qao8D9fVMctOnVGb1m s7x4C2ANEuuU4AfQxnJftuhqgETk6fdX3TJ08IxwbihemI9hRjZmTTPt4aBPpNKBNdCu 9eWtEyyy5ZW1VBq+hbTe3p+qhG3HK0GWYqMwwN1V7ZfFngXfAGVfPGmfyHUClx2UtwHf 9W0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=AMsyJlRVUobMnY77yXtLou/Y/5t22m/ig+/2/tQ9bGQ=; b=AX7g2zg2V6oluK6Ux6M/7Ar3xDFUaskPAKxD4XALrkQ7csCbumo7hAFw1mBx/alnKU DraT/PYghfd/gx3FM8vfR2Ne28MiGC8GjM+p4mP7YgLlLd+/lcTJ8NgR9aFbvSYsYYyN gAkqmC1lS3pThEOpU3gFaEUGjA96N9Kkt6mhtMuxq25aWb5moN4mvv+HUu6zBml2dmkF N3PiZPtL8S7a/IgQeBeYEwqxSHamOPQh3/iWKJ5SCZc3p2AaFMeGCVDNr8RLFpx8L1yX nexFuXEUVgx2YpRGuM1MxhR2XldDx7XgSw/iWZnS/DQChtLtTjPE6FDlZwrGOzsUEtnw 1maA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q66PBwno; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id s3-20020a05640217c300b0042ab7d12ce3sor4468434edy.7.2022.05.20.01.26.28 for (Google Transport Security); Fri, 20 May 2022 01:26:28 -0700 (PDT) Received-SPF: pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6402:294e:b0:425:f016:24e7 with SMTP id ed14-20020a056402294e00b00425f01624e7mr9437603edb.111.1653035188346; Fri, 20 May 2022 01:26:28 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-53-154.cust.vodafonedsl.it. [188.217.53.154]) by smtp.gmail.com with ESMTPSA id el9-20020a170907284900b006f3ef214e55sm2896544ejc.187.2022.05.20.01.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 01:26:28 -0700 (PDT) From: Tommaso Merciai To: Cc: linux-amarula@amarulasolutions.com, Tommaso Merciai , Frieder Schrempf , Fabio Estevam Subject: [PATCH 3/8] clock_imx8mm: Add enable_usboh3_clk() for i.MX8M Date: Fri, 20 May 2022 10:26:18 +0200 Message-Id: <20220520082623.1788887-4-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520082623.1788887-1-tommaso.merciai@amarulasolutions.com> References: <20220520082623.1788887-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: tommaso.merciai@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=q66PBwno; spf=pass (google.com: domain of tommaso.merciai@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=tommaso.merciai@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently we can't use DM_USB in SPL as the ci_udc driver is not ported to DM yet. Signed-off-by: Frieder Schrempf Signed-off-by: Fabio Estevam Signed-off-by: Tommaso Merciai --- arch/arm/include/asm/arch-imx8m/clock.h | 1 + arch/arm/mach-imx/imx8m/clock_imx8mm.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/arch/arm/include/asm/arch-imx8m/clock.h b/arch/arm/include/asm/arch-imx8m/clock.h index e4433763bc..bb93c7c61c 100644 --- a/arch/arm/include/asm/arch-imx8m/clock.h +++ b/arch/arm/include/asm/arch-imx8m/clock.h @@ -278,3 +278,4 @@ int enable_i2c_clk(unsigned char enable, unsigned int i2c_num); int set_clk_enet(enum enet_freq type); int set_clk_eqos(enum enet_freq type); void hab_caam_clock_enable(unsigned char enable); +void enable_usboh3_clk(unsigned int enable); diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c index 4db55f8608..4b891c6a94 100644 --- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c +++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c @@ -298,6 +298,22 @@ int intpll_configure(enum pll_clocks pll, ulong freq) return 0; } +void enable_usboh3_clk(unsigned int enable) +{ + if (enable) { + clock_enable(CCGR_USB_MSCALE_PL301, 0); + /* 500M */ + clock_set_target_val(USB_BUS_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1)); + /* 100M */ + clock_set_target_val(USB_CORE_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1)); + /* 100M */ + clock_set_target_val(USB_PHY_REF_CLK_ROOT, CLK_ROOT_ON | CLK_ROOT_SOURCE_SEL(1)); + clock_enable(CCGR_USB_MSCALE_PL301, 1); + } else { + clock_enable(CCGR_USB_MSCALE_PL301, 0); + } +} + void init_uart_clk(u32 index) { /*