From patchwork Tue Jul 21 06:46:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11675043 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 BC04E13B6 for ; Tue, 21 Jul 2020 06:47:28 +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 94AB92080D for ; Tue, 21 Jul 2020 06:47:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DY8f3/wn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="QPsjBHHM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94AB92080D 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=4o5FceCLnEfvNE5DniAwnhbK4WgWDJqznitMMrxX5iA=; b=DY8f3/wnnupCRPVvsBVBTrtyD nas5TEE6U8AytEyjWVUEnGQNuQMq6D+FLtgIH3WGgfDvdujTC9wBbUGJZdh7hslhDNVpa5mCvLu2T EOs+UlItrSMcA9drSZiG2QUII12LUAii6ZQNCuKd3gAXBU5oKzXp6d0M3Ot0qxoQQIVaNGX406F6Q w+K+t6JqY5rgAUROMxYJ+64YTJExmJNhyVMykvX2wU8sMNoTpAc7FiQOSLmaZYqo/qgzaxhQL8meb mb4dOLoX5SxMceLL3ElsYpZoBSTVV1fIStDaFjs2ky4mve7qRAe0oEwmPkKDn2sa0/S18UecsYXyc 3KM9PV2FQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxm3d-000527-I1; Tue, 21 Jul 2020 06:47:21 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxm3a-00051J-Aa for linux-rockchip@lists.infradead.org; Tue, 21 Jul 2020 06:47:19 +0000 Received: by mail-pf1-x443.google.com with SMTP id s26so10271587pfm.4 for ; Mon, 20 Jul 2020 23:47:17 -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=611leVAGAZ/qzztweqxoAKxoK/3V+KuYcXKdZyHyOYo=; b=QPsjBHHMhhzCZhIokO1iJyzofImvTuAOAZ6Sj+Wp72TBLSmBsIu+gVbf+aV+tu0bWF OPm/4DHjLhyo46GqP3JNxJR+u4j5K04ziWXpI4mktJqgpjwNPmG9AgY/sdt13Jxrm6qX 9jNaLK0XBBbxzYb8W9USjhnbajwtxvxGbQQEs= 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=611leVAGAZ/qzztweqxoAKxoK/3V+KuYcXKdZyHyOYo=; b=Jkb2sJejzy49QJpP/ao3vB1nLzhgeqVYVfqWiyXYXS9Tn0teYMFlR8UsqlPa4qhh6W 8ujVjxtLsjzDZhalaS7/9ddIGzB9mBhR6SHFT2vF4TWwnDlq6PxNcb4I7oMtIypPmkmS keGVF8YTPRmRYqnzdmeH3q4xkuU9gLk4QlaTP9xfKfxdBEKowYEbDy3zvJxKDbcLtX8/ OxYoGy6Ahr38HNYesbhIiij+DERfOgnnrrOYou3Oz5vfsk4dPbTrIgtz6V6DyAQLY5v0 TsbBYbpIQW0xqxMJTVwCH0Pr97LOjd62XllUGQ+sDlsKkWMUnWyfnBppCMeZPI98zakO mQYw== X-Gm-Message-State: AOAM530+8pT1/mwu486qoIcm0FTGpYhEUUd3TYaOisM8x1nFeA+Ka3SC cP77Rc3C+Ywa993SuAI8ixirOQ== X-Google-Smtp-Source: ABdhPJznUkHlXtLAE09lUFUNQBT03rCmfeqRfaESzPX4bmnZI+YE6JBDT2T0G0dzfpUJPe9hI7Vd8A== X-Received: by 2002:aa7:984d:: with SMTP id n13mr23999459pfq.276.1595314035387; Mon, 20 Jul 2020 23:47:15 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:38b9:d6b4:d935:307b]) by smtp.gmail.com with ESMTPSA id mv6sm1709069pjb.57.2020.07.20.23.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 23:47:14 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Subject: [PATCH v3 2/2] rockchip: rk3288: Add OF board setup Date: Tue, 21 Jul 2020 12:16:38 +0530 Message-Id: <20200721064638.16236-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200721064638.16236-1-jagan@amarulasolutions.com> References: <20200721064638.16236-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_024718_423218_056A1A8A X-CRM114-Status: GOOD ( 13.61 ) 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:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki , Suniel Mahesh 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 Reviewed-by: Kever Yang --- Changes for v3: - use struct bd_info - drop ifdef OF_BOARD_SETUP since it select by default arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/rk3288/rk3288.c | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index e2b6326584..fcab1d5cee 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -99,6 +99,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..1a4ecdf625 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,35 @@ int rk_board_late_init(void) return rk3288_board_late_init(); } +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, struct bd_info *bd) +{ + if (soc_is_rk3288w()) + return ft_rk3288w_setup(blob); + + return 0; +} + static int do_clock(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) {