From patchwork Wed Apr 1 15:35:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mylene Josserand X-Patchwork-Id: 11469231 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 DDF9892C for ; Wed, 1 Apr 2020 15:35:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B9849214DB for ; Wed, 1 Apr 2020 15:35:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NtWpBphG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9849214DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=b2JzO1y9226qJqsEuXxbyq69WdlNCGr3t4sO9UsLwWg=; b=NtWpBphGcQ3yW1 GSP9VPAu7RAOjVi17Zpmn2LAwRvBPfylb4dgTBGr8y3Lcbo2WWWgmD+94Z2g8IcsjKTXH4tIzCwpI 0FoWPlxsxeIut/uLNxkJKklF19aR6lGlVW35s0jNTSTBkxOaHOc4Qn2fckPNNRebU36M1lJl5Gb2b NliETjFyrnQn3I14kIbmJajQ0oj1ke4NZ9s3KOa9gF2r4zjY/4skWQBAAZtPjIypWqlvnboY3/ll2 0p8mNVlAo/p9Lz8RRBmLiXHu2tcC0msDG/rZEFb/PGO2u8jBG/++j8wiXsr/Jjphzv8GXZBczO3Dj U7nyHiAQiofEZvB81pww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJfP2-0003bB-W6; Wed, 01 Apr 2020 15:35:41 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJfOz-0003a7-Hj; Wed, 01 Apr 2020 15:35:39 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: myjosserand) with ESMTPSA id 7831A283D19 From: =?utf-8?q?Myl=C3=A8ne_Josserand?= To: heiko@sntech.de, linux-arm-kernel@lists.infradead.org, mturquette@baylibre.com, sboyd@kernel.org Subject: [PATCH v2 0/2] ARM: Add Rockchip rk3288w support Date: Wed, 1 Apr 2020 17:35:11 +0200 Message-Id: <20200401153513.423683-1-mylene.josserand@collabora.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-20200401_083537_753636_BF51B00F X-CRM114-Status: GOOD ( 14.67 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mylene.josserand@collabora.com, kever.yang@rock-chips.com, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, geert@linux-m68k.org, kernel@collabora.com, linux-clk@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hello everyone, Here is my V2 of my patches that add the support for the Rockchip RK3288w which is a revision of the RK3288. It is mostly the same SOC except for, at least, one clock tree which is different. This difference is only known by looking at the BSP kernel [1]. Currently, the mainline kernel will not hang on rk3288w but it is probably by "chance" because we got an issue on a lower kernel version. According to Rockchip's U-Boot [2], the rk3288w can be detected using the HDMI revision number (= 0x1A) in this version of the SOC. Not to rely on U-Boot about the compatible, the patch 01 will handle the detection of the HDMI version. In this V2, the revision's detection is done using soc_device registration. Thanks to that, in case of other differences than the clock tree, it will be possible to detect rk3288/rk3288w using the 'soc_device_match' function. The main issue was an ordering issue: my rk3288 driver was registered too late to be able to act on the clock tree. This is fixed by using an initcall in the clock driver. One possible way would be to convert the clock driver into platform_driver but, as it is using some common functions to all Rockchip's drivers, it would have been necessary to update all others. Instead, using an initcall to post-pone hclkvio clock's registration is enough to make everything work correctly without a big change on the clock driver. Changes since v1: - As suggested by Geert, update the HDMI detection by using all 'soc_device' functions - Use 'soc_device_match' function to detect the revision in the clock driver - Create a function that registers hclkvio clocks later than others to be sure that RK3288 revision is read. Best regards, Mylène Josserand [1] https://github.com/rockchip-linux/kernel/blob/develop-4.4/drivers/clk/rockchip/clk-rk3288.c#L960..L964 [2] https://github.com/rockchip-linux/u-boot/blob/next-dev/arch/arm/mach-rockchip/rk3288/rk3288.c#L378..L388 Mylène Josserand (2): soc: rockchip: Register a soc_device to retrieve revision clk: rockchip: rk3288: Handle clock tree for rk3288w drivers/clk/rockchip/clk-rk3288.c | 36 ++++++++- drivers/soc/rockchip/Makefile | 1 + drivers/soc/rockchip/rk3288.c | 125 ++++++++++++++++++++++++++++++ 3 files changed, 158 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/rockchip/rk3288.c