From patchwork Thu Jul 2 08:48:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 11638309 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 4EC756C1 for ; Thu, 2 Jul 2020 08:49:01 +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 276F220884 for ; Thu, 2 Jul 2020 08:49:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cfGgYQGi"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="FJxO5+ir" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 276F220884 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: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:In-Reply-To:References:List-Owner; bh=0YyHEPZIbPWFU7zrwM5N/1qCimTJzWd1Ao8FQgSp1L0=; b=cfGgYQGis8LKY7gwoLiMHC5Teq 4sXZt1eRENLzdK+abERen1a4/Sde1VSnywujwzwvfDYOpm7xHszvU2HFNjFVfHMuWC+6Zn4/Od4rI 7i/6kGAeDDzR3sfgnLOy1fDfnoNL0x+JLAdBzSyoX/nfrkrEj2WNakl4EWdkFrUsPDfLRwDea94W1 cP30WeDfx+Ha9u9ijRsqu24gG9XestbZ611rOhPjpaKpRm8g2lT8IUYPCuRTPsYovJ0cbj4zN4UKD 4AE+pqKJletbvWFvM75L8WzYCQUT1TKoSaugfnpQBLflKxOvgOjkNcEKk08dbHMxu824CFA8o+OhT fYvPjdtg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jquts-0004Y2-7p; Thu, 02 Jul 2020 08:48:56 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqutp-0004WA-S4 for linux-rockchip@lists.infradead.org; Thu, 02 Jul 2020 08:48:54 +0000 Received: by mail-pf1-x444.google.com with SMTP id u5so12253636pfn.7 for ; Thu, 02 Jul 2020 01:48:51 -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:mime-version :content-transfer-encoding; bh=wY3+1bQy75Ooj4SRznvIgDDKWK1pDcQ+Z/6oKkhYiic=; b=FJxO5+irJRHRPTjH1blXY8sv4M+SmXRBbN/3MrgyogTtp1b7HOH/EzJkfKl7UGSeYL GzoeOWn6UBv0KVpEPipmFOVwSW1QjnabmKCK17mHM42oWL1qGeMJUvhLYjRBSvKgcNbK yscfRVhsabp4K8HHMGP2HGdA/1KEWDyA/AfIs= 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:mime-version :content-transfer-encoding; bh=wY3+1bQy75Ooj4SRznvIgDDKWK1pDcQ+Z/6oKkhYiic=; b=J4s42Aa8tRd9DbCJZMDw6ZxIs/elKzUsYHu0k4/V+RFHpPNW/1GE4a7/D1UfG4Cj9T 7mrwiJxtpTHmKQQZln7oZHvNHO1Yr0+5yRUJI6yHj8oZx755SFvRVjcpE8qAb067AgTr C5ErlInLapaYGxd8N1LFOZOm3/Dze0TXyexdAipXtBn9GFZWEJHrS8WHZuH3cCcMHDYy 68N9cHxnh2RKarM6LMt5eW9x8hgFAP/G6p5XwNV25HRxAwvTXoWjNjbpcty4L2Q5QK1S 9tQzolkHRyGPOxCDZc7ipo05QeLysENd5sZC/4WtukWm17+6uOjZSI5GL7uyKZt1x7/J IPoQ== X-Gm-Message-State: AOAM531BaH4gUSfzttPONKOfHN6SgOLv2wOKEztl3ozNKctWcC1X4LD+ +vMqgucGevbgyUMCKEGMsd8DlQ== X-Google-Smtp-Source: ABdhPJwoFtilf2sLpSDLyPCtCiF2RBQe6gtqzzKQKBW18fJWHqp+f1ToO+ZY/uoiEnylxbQWjxnSnw== X-Received: by 2002:aa7:9736:: with SMTP id k22mr26808526pfg.62.1593679729845; Thu, 02 Jul 2020 01:48:49 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:a961:9b2e:1b93:8ca7]) by smtp.gmail.com with ESMTPSA id q92sm7413406pjh.12.2020.07.02.01.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 01:48:49 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass , heiko@sntech.de, mylene.josserand@collabora.com Subject: [PATCH] rockchip: rk3288: Add OF board setup Date: Thu, 2 Jul 2020 14:18:20 +0530 Message-Id: <20200702084820.35942-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200702_044853_941020_90D9C214 X-CRM114-Status: GOOD ( 12.21 ) 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:444 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -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 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 and usb host0 ohci. In order to work these on the same in Linux kernel update the compatible the root compatible with rockchip,rk3288w before booting. So, this support during of board setup code of rk3288. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- arch/arm/mach-rockchip/Kconfig | 1 + arch/arm/mach-rockchip/rk3288/rk3288.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 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..8a682675e6 100644 --- a/arch/arm/mach-rockchip/rk3288/rk3288.c +++ b/arch/arm/mach-rockchip/rk3288/rk3288.c @@ -115,6 +115,32 @@ int rk_board_late_init(void) return rk3288_board_late_init(); } +#ifdef CONFIG_OF_BOARD_SETUP + +#define RK3288_HDMI_PHYS 0xff980000 +#define RK3288W_HDMI_REV 0x1A +#define HDMI_CONFIG0_ID 0x04 + +int ft_board_setup(void *blob, bd_t *bd) +{ + u8 config0; + int ret; + + config0 = readb(RK3288_HDMI_PHYS + HDMI_CONFIG0_ID); + if (config0 == RK3288W_HDMI_REV) { + ret = fdt_setprop_string(blob, 0, + "compatible", "rockchip,rk3288w"); + if (ret < 0) { + printf("failed to set rk3288w compatible (ret=%d)\n", + ret); + return ret; + } + } + + return 0; +} +#endif + static int do_clock(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) {