From patchwork Sat Jul 4 09:15:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11643385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEBD614DD for ; Sat, 4 Jul 2020 09:15:35 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A855B208D5 for ; Sat, 4 Jul 2020 09:15:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LjaKNMhu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="B4953sAY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A855B208D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3t7ZuacGTe0zLHbHp1voNXz6qlkEu/C6WpDkcL94YHY=; b=LjaKNMhuebPHa/XM5TGOXk6Ps 2OallkBksLmWIEoic8UhjYZ4hzZY5wCvEPfEFurEdlBISUgEr8YnNHOZwawNOpqu+xPAOSuksRXCG L3tcLYzbfbI2k1PtUY9JnDrY/AGXNL+nkL2v+2SQN9+4sHcX3T8PtUDGwi2YQl58HPPlrOEkejByL lvh4BDbvgZSSGRkQE9ejqqI1IEVQGlhedhhxTT3OU11p2pvxgedHykYhaSfSBuYyW3DhJ02b/6Wzh QW2jTotLjepE6cuZAENSY4Gmb3Bi7S9Es+2XtHS0vjK3qQpkwn3Oyh7SqhNEvalE7KKeQ2RoOIPiB 3upUL/CUg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jreGk-0006bq-15; Sat, 04 Jul 2020 09:15:34 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jreGh-0006bN-PP for linux-rockchip@lists.infradead.org; Sat, 04 Jul 2020 09:15:32 +0000 Received: by mail-pj1-x1043.google.com with SMTP id k71so11270225pje.0 for ; Sat, 04 Jul 2020 02:15:31 -0700 (PDT) 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:content-transfer-encoding; bh=aYq8oJoHDhRlC7Neg8BOANaGIK4jLvc5YVs3cisEX6o=; b=B4953sAYnaF4tNfbef/RH+i+NjbGDiXPXCG8A5TIIZUVCbxMu+VXowGQEA4B95FQvQ PAZQMwzaxY0cm6aql6f3N6Tpaq6M+hbHegAwe6P2rltuLjBuoBkIb0ojMkOVV0D95Opd mpI/AsuzXPf7q4p0ljtqz6KRbXEHQrRmYpGGs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aYq8oJoHDhRlC7Neg8BOANaGIK4jLvc5YVs3cisEX6o=; b=V3vxADaBwdbYM68rDaUfWsaG1u9WErJpHiV3HcTVqn6qRFbGr81eIHiLMz/V3Dldt1 2PL0qvGWUg29o0DcrQGHEDalkOohSE/Fa9mzceGMuQwx4XPNuiWhBgZk9Xt4C6ME+LbL 3P+gJ4gWVyj1Iplsm/2vM+mchKXdy4YergWkdPeyFc6T+9DRBEmDDb8lX4OwfElXsEYL SMRQdbjytNv33AT800d0FI61FHGenzRZ+mzzszUcSFCVyW13DTrJaS9WWjoG9RVZMawl hf792KIXWbgh5HONvoO+DjKiTRUKS0MyfAUDN7lWIxVvwcnMd0Qs5f0lo+H8RxyE5x3u sm2A== X-Gm-Message-State: AOAM5332zE0hS11lydZY/M2R89/oL5vnsHFO4oqM4O0DGaqDpzAHGk0N nkltconlN5AU7oX70+CnyNY0pA== X-Google-Smtp-Source: ABdhPJx8Krx5fKBZ+DERzbQ/cPjWODYOX38cX1w37TrvtW33rfoVwEz2Ur+/CbUF5mH5ACeQm2cAZw== X-Received: by 2002:a17:90a:3a81:: with SMTP id b1mr36848193pjc.217.1593854129503; Sat, 04 Jul 2020 02:15:29 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:bdf4:3289:4b66:dcc0]) by smtp.gmail.com with ESMTPSA id h194sm13946930pfe.201.2020.07.04.02.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 02:15:28 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass , heiko@sntech.de, mylene.josserand@collabora.com, Ezequiel Garcia , Robin Murphy Subject: [PATCH v2 2/2] rockchip: rk3288: Add OF board setup Date: Sat, 4 Jul 2020 14:45:03 +0530 Message-Id: <20200704091503.71121-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200704091503.71121-1-jagan@amarulasolutions.com> References: <20200704091503.71121-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200704_051531_904401_ED482E73 X-CRM114-Status: GOOD ( 14.28 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1043 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, U-Boot-Denx , Jagan Teki , Suniel Mahesh , Michael Trimarchi , linux-amarula Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The new rk3288 revision rk3288w has some changes with respect to legacy rk3288 like hclk_vio in cru and usb host0 ohci. Linux clock driver already handle this via rockchip,rk3288w-cru compatible. USB ohci host can enable via dts for rk3288w based boards. So, add fdt board setup code to update cru compatible with rk3288w-cru compatible if the SOC revision is RK3288W. Signed-off-by: Jagan Teki --- Changes for v2: - use soc detection helper - add cru compatible change for rk3288w arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/rk3288/rk3288.c | 33 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index b1008a5058..822d8d4e9c 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -98,6 +98,7 @@ config ROCKCHIP_RK322X config ROCKCHIP_RK3288 bool "Support Rockchip RK3288" select CPU_V7A + select OF_BOARD_SETUP select SUPPORT_SPL select SPL select SUPPORT_TPL diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c index 804abe8a1b..9c873d2b6a 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -115,6 +116,38 @@ int rk_board_late_init(void) return rk3288_board_late_init(); } +#if defined(CONFIG_OF_BOARD_SETUP) + +static int ft_rk3288w_setup(void *blob) +{ + const char *path; + int offs, ret; + + path = "/clock-controller@ff760000"; + offs = fdt_path_offset(blob, path); + if (offs < 0) { + debug("failed to found fdt path %s\n", path); + return offs; + } + + ret = fdt_setprop_string(blob, offs, "compatible", "rockchip,rk3288w-cru"); + if (ret) { + printf("failed to set rk3288w-cru compatible (ret=%d)\n", ret); + return ret; + } + + return ret; +} + +int ft_board_setup(void *blob, bd_t *bd) +{ + if (soc_is_rk3288w()) + return ft_rk3288w_setup(blob); + + return 0; +} +#endif + static int do_clock(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) {