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: 1321163 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=FJxO5+ir; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49yBc6195Pz9sR4 for ; Thu, 2 Jul 2020 18:49:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C9265821A2; Thu, 2 Jul 2020 10:48:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="FJxO5+ir"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D39E82168; Thu, 2 Jul 2020 10:48:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 9727B82168 for ; Thu, 2 Jul 2020 10:48:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pf1-x441.google.com with SMTP id u185so10213190pfu.1 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=uDDYoz+APREZiUFLT4ASuZxlqMotJy3k6Pwd+XyZbEJZnzYxrfuSNf3tarUM97s7FC +l3q/50LjqshSl1ek0e7DWJDyimt+b/IQN+IkRA4UeKW3FLXsbzp+dhfHrCCVSo/enF3 DjENBPXyyOwhCKxrZX6vy+01/PlSmg1CdNXf3EiCpnPPn0g3vg6qGIs135Ts4K37f/Pt Agtl37SMYysyg/MjcZBvCjnXeOw+0+uoCwy2yAaXUHDGC9UfVinQ/oZDp/c9YKDNCFtt wSg3a51S3gVXB17X8rOzYgQGPF3O2I1iTMRKgG9iF6fhILmp10uoATPUseUftStddyTU 3j+A== X-Gm-Message-State: AOAM533J6YcnozZcjA8iBY33zXKQGFe4hq6N14zNuISkpPMadk4Tm9HE R4zM+V/DCATQF1sOsK34h2nJIg== 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 Cc: Suniel Mahesh , Michael Trimarchi , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki 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-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean 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[]) {