From patchwork Sat Jul 4 09:15:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1435 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5DE4B3F03F for ; Sat, 4 Jul 2020 11:15:28 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id bf1sf15909759pjb.6 for ; Sat, 04 Jul 2020 02:15:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593854126; cv=pass; d=google.com; s=arc-20160816; b=fwEw8nLE6GebTscm1G9b86E+A5Bjf8ANWtLWfzCKgB2uC+aTo3jpJeGL7NCq/2T1Mu um3S/U0AWFsd/mfDNMlVT08u7m6AxxHbUy2kHZM21CjbAySjLrnA40yZWmcmAc5VpAzg ZmzOkiyPmLZPXUtEr6fafyO+PDvRDgDm8TWkkOJjdo4CgbJONXAvbgejBljD2O4Lo5/G Wwo/P4HUAreW9idGsY6Nj7k+YoM3gSquqoASxsE3oU9RjY4MApe5uwLShkb47rQHHat5 twYrZuqNawSKyHYimoTGRBicaQ/xZh5vIitIerkT4e7usYqkJk0YCYgtQKaP88SvDStR gewg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=td46qC0j7NGJjuOT3lulaF0XBi7DRpbvAYaa83kGQSA=; b=wP8FsiktjWxXlKfsUuxkW5hnuQEuE5wk5DZzrcFOo/YxvnNV2vGo4d5s8Ur96mU+8I I7xeEI5ZQ1l1O+EJyp3FVx1I9e4EfY3VztnSwOCRd0kvcV1R02J6ToWXlArvuUQAbaQg M6f3T8DayG6mB81B5fOvDJkF3oOFvhybnU6wjZn4yb9PS+d54b5Gjg7C5gDeTUJ53AW9 G6eIYHgVwpFPN/fyTCgNUy51rFHNZ41sbKmRq5LrIedepnDaqvAbtShuMw0GflztLB7Z FYV4NfOUQa+42UhyXnzNNzXELxHoPJiD8OrBg89JcG45L5mYvdG9jbYDiVwSIJcZtrtR 1ZuQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XR6vkglI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=td46qC0j7NGJjuOT3lulaF0XBi7DRpbvAYaa83kGQSA=; b=mS1nAfcRlySNl4Sn4/+ykEWkHSilWDVXn7hYg1N2hvnVQplfl5OHzA+cem2848QtWD nops50knvUzScKLZAd01wozIUKSPOJ1VZ00/HoGX2ZAwGUd6nowm/LVDtl9vhaM0Yrdc RDc0odtvbcU1drvYymHYnArE/dNrYg3rDFWOY= 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=td46qC0j7NGJjuOT3lulaF0XBi7DRpbvAYaa83kGQSA=; b=sY74iYWf51UYz32FHsuPbTywnklZxSVJhUJzZCJXO2RwQgDelNRE9iqiD8JPYKv848 VwmUn87OowaFm6Bg1Cq0F2mPzPDygcV3euKdKNHyxDDvfrZlmUYgLhX/us4BmmlN6OEg H2h8DuWjKq58ii9F1ASD56aRWCmbriE6ap6sDwlQxojtJS0COnm7r3YWRj2vEqgU9KL7 bgf0QfO/o6WC6uPbLdpDMORGoHHs+u7OgJoN30en9d7kYOz8QxoVMGJfKmV1NLduuu/6 NnzWGvccNoHu50goQ3jpIA0TawUIZxQwOQS2BhGSgiFe3S/Ve0auRLhEazzEKqSf1mWE fsZw== X-Gm-Message-State: AOAM530o+zJTQbUQif2YtEctoM1eY5aEInUT+ZtTYCN/5SJ2U0mzKAiz uxvTLwHgVppaEuNSlaOaUu/ypfJ4 X-Google-Smtp-Source: ABdhPJxCDcxp3UbxQqeFNmuHcxS0ne5kiBzS9K5wSGbI6uMDRe2QseRfvSiVhfE0xfEkT9Btach0Ow== X-Received: by 2002:a63:5a20:: with SMTP id o32mr23798915pgb.15.1593854125987; Sat, 04 Jul 2020 02:15:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:f450:: with SMTP id p16ls3684282pgk.5.gmail; Sat, 04 Jul 2020 02:15:25 -0700 (PDT) X-Received: by 2002:a62:7f55:: with SMTP id a82mr27705358pfd.61.1593854125550; Sat, 04 Jul 2020 02:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593854125; cv=none; d=google.com; s=arc-20160816; b=CQ+YDBijNFS26xY2iSFviVRyh8TUnXX4MwoxrEwRCBQs/5W9SDWKipYfTVUsK2qR9U wOGbLgtHYdR93Fi99DQyeb2Nbv8jeKoI4c9LK99THR2B/3uhbBbRGwgo9F0Ujzii5Ca6 FcsfjcYprmW7W+oRLQg3ER2jBXAIxIqQpT7ad+lmVn460CT3ITfA125eise9Y4Zp7AfD jjmTJFtn7++kw2dMHz6Kl54T6F2A4BxCvQsSQxWDTmn6l3mH6gDjN1W4OqSTw0XYlrRF 2emVve75Zr+rjuLrKNRONDYyMzf4otzX2uHPYSqXe6Tg14Jol2vYXxXPuwz4Vq9X7eH4 l9zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=Ch7t7JgFjiW4lKYC1YSWH86G7kdXoDb/7ukyKuQkWyA=; b=omWrm9nkZqRRjAxGQ7EprDbTm7ejA6/161xHWhTowGCdYXWeFlukT9c6sWKgFTnOhL LHRqKVar4cF7f8jBGYyYd342X6l8SFUC5h+Q8Ed6wVTIxF2tfvQXp9YotuzcAd+1tdtY vn7jI1oIK05e2yrmaMUQFb3eecqXeHUKvIavo53u220F7b2GXiltZlaqtleFskqJu0nP zov+lEIOLP9n3ihJoljtS96Tf1eHV7NaVbeQvdr0z3bbRBnfOZ2pwcKK/DlyB4OHt3pe K67xtdVUCby6WbFq1gnUGv4cBuKaKZ+vu6INd5769VVB0XKrtY7kzn0nwsJ514+SDDEN 8h8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XR6vkglI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c20sor19294728pls.63.2020.07.04.02.15.25 for (Google Transport Security); Sat, 04 Jul 2020 02:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:b197:: with SMTP id s23mr26553343plr.157.1593854124559; Sat, 04 Jul 2020 02:15:24 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 02:15:23 -0700 (PDT) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass , heiko@sntech.de, mylene.josserand@collabora.com, Ezequiel Garcia , Robin Murphy Cc: Suniel Mahesh , Michael Trimarchi , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki Subject: [PATCH v2 1/2] rockchip: Add SoC detection helper Date: Sat, 4 Jul 2020 14:45:02 +0530 Message-Id: <20200704091503.71121-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XR6vkglI; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rockchip SoC's has a new revision chip for rk3288, rk3308 based SoCs. RK3288 has a new revision chip called RK3288W which is relevantly similar but different hclk_vio clock and working ohci host. Add common rockchip SoC detection helper to support this rk3288w detection. Signed-off-by: Jagan Teki --- Changes for v2: - new patch arch/arm/include/asm/arch-rockchip/cpu.h | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/cpu.h diff --git a/arch/arm/include/asm/arch-rockchip/cpu.h b/arch/arm/include/asm/arch-rockchip/cpu.h new file mode 100644 index 0000000000..d0d22e4967 --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/cpu.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Rockchip Electronics Co., Ltd. + */ + +#ifndef __ASM_ARCH_CPU_H +#define __ASM_ARCH_CPU_H + +#include + +#define ROCKCHIP_CPU_MASK 0xffff0000 +#define ROCKCHIP_CPU_RK3288 0x32880000 + +#define ROCKCHIP_SOC_MASK (ROCKCHIP_CPU_MASK | 0xff) +#define ROCKCHIP_SOC_RK3288 (ROCKCHIP_CPU_RK3288 | 0x00) +#define ROCKCHIP_SOC_RK3288W (ROCKCHIP_CPU_RK3288 | 0x01) + +#define RK3288_HDMI_PHYS 0xff980000 +#define HDMI_CONFIG0_ID 0x4 +#define RK3288W_HDMI_REVID 0x1a + +static inline int rockchip_soc_id(void) +{ + u8 reg; + +#if defined(CONFIG_ROCKCHIP_RK3288) + reg = readb(RK3288_HDMI_PHYS + HDMI_CONFIG0_ID); + if (reg == RK3288W_HDMI_REVID) + return ROCKCHIP_SOC_RK3288W; + else + return ROCKCHIP_SOC_RK3288; +#else + return 0; +#endif +} + +#define ROCKCHIP_SOC(id, ID) \ +static inline bool soc_is_##id(void) \ +{ \ + int soc_id = rockchip_soc_id(); \ + if (soc_id) \ + return ((soc_id & ROCKCHIP_SOC_MASK) == ROCKCHIP_SOC_ ##ID); \ + return false; \ +} + +ROCKCHIP_SOC(rk3288, RK3288) +ROCKCHIP_SOC(rk3288w, RK3288W) + +#endif 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: 1436 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 309233F03F for ; Sat, 4 Jul 2020 11:15:32 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id z16sf25118479pgh.21 for ; Sat, 04 Jul 2020 02:15:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1593854130; cv=pass; d=google.com; s=arc-20160816; b=XAV5M7M9rN7eJTWas2f7joh1d3yItF0N4cfBB/52mUJNKrD9VbIJCE7RAdQx61GJeR oc76D0qNHlAsXj/5zDXWq91u5XDtxwNn14huC/SDQNumDjb9uzZPHwsCwQOE1Vlv5LDo jEce90CGaSGd5BjWjUWGf6zL6GExIH7i1un5C2WMwGgzZgU2JShKZ1N5YvXjnXpCgjNd zMfh2iZ8ik7/FaYUVJM2gg1LZdrlbLMCQcMjsEyuS2vHwVbE5ezy0xIICTOCivsuBFvc ubGusvUMMJKdgcsGDBIuVkJpWIJ+B15zIw7Cona0cyvaknhZoKxz65yAsFRPdHTMfc8h +oWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=36K3FjebcSXtPHQH5UmgZUX6t+i9E+ohiiLX4CQEciE=; b=dTWe31+/N6ZSrGoXkAk0gmVd3zCiS9VkDLrH9z4cMmke6svupAgFRy2qbWzpDS3fRs TrC7hjOJae+w48rxGNbHCo9ux97aljCRQYt5vnF+Ht+MKpdkhrLtY2LD2MTReF9xZkyj SqRkaZ1ggwFcFfTNooKJcVftwYh1qWB1AHiCwbkaLls/c/ix6dGtnufhYuljs0LzbHkM CJCOZuxvgEtmg+nb3QxeK298T/0JBMyrltQsEZYs3Br1hMoPbE/2YboPw9Emd8Wvvvfi 2FbeexVPUa+lExQHesTLq2pB0jDA0t56zb6jo5uSnQRHWbT+fSNyIoJfw35lxWeP1QkY Zb4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B4953sAY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=36K3FjebcSXtPHQH5UmgZUX6t+i9E+ohiiLX4CQEciE=; b=KNfumpyNXSYjcLZiBWNdCJhHPhgbKdmWNYdvPPQ0SXaWJv8NFJTqhqtLZavQxuDhEr 0gc+xzpYlsKwEv10uNY1JvebScjbroJKemvt7/1KKyIOUPZqfXpOVg0/V+nMJXskOmEf Ljx9euV2mbnvAjGE8Oj2DVjxPaToKcXgk48as= 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=36K3FjebcSXtPHQH5UmgZUX6t+i9E+ohiiLX4CQEciE=; b=s+UX2DNYtieIThcZb1MQLNOx2mo2Q9qQ0RqOYrUJPuGywsvWX+cMBcwMdlMCBU0eia FiUZKYXirsT4eap5tyV7xGYTyFS3So1ukBkWZXjUXAaXyUp4cbn+pyPTyAmBfsss2owN c6JDS2o5dDree5oDEC1yah2W/SBTFxOqBS6GN9Dx7RuTO9fCXWyRv47l8rh5NPd3xC9z CvyH+k0OuF7S6YLyYCefqDedZjCAS6xdm4mvrAOtxFbx0YW6Cwq9w/MQKHacLZ0F4MDC k16ysYtrg32ZDylfKTydFh060te3/B8IXTPV4QhSatuMNln+kLen3mn29A986MPHAtYc oSdA== X-Gm-Message-State: AOAM533JsvdQRkUzv/2JZn9PiaHXvg148gxYejKkh1cg39gwihMWiNvD pltCqLCVzM+6KkGtJvHdZevdkSde X-Google-Smtp-Source: ABdhPJyX34BDJ22H+UZoJmTB6TLAu6icmp8XoWZ0l1Jus5mFd5itDS/JSXZRFgkcceGkyDmUPMqLWw== X-Received: by 2002:a17:902:bb8b:: with SMTP id m11mr33072030pls.183.1593854130403; Sat, 04 Jul 2020 02:15:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6891:: with SMTP id e17ls3686710pgt.3.gmail; Sat, 04 Jul 2020 02:15:30 -0700 (PDT) X-Received: by 2002:a63:5b55:: with SMTP id l21mr25265786pgm.348.1593854129818; Sat, 04 Jul 2020 02:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593854129; cv=none; d=google.com; s=arc-20160816; b=FoYE4//qPo0LUjrXL/3HmCSOJReZXwQCDa7YRcpy+H4sqP2+5wf8e9Vmy/JSfdRk4A 48jjS/0xZrMr7teUO+wWRHSWtKXn3kCnLtKhpFUNnSNFbV9CPi/d1OiJ5DOPYSl7VPbo Y+pl30oGtOhBwFZsnF2lh0sVGDh8HfEI9THu8Qam00VSodNjgM1/AQj5rTaGnyA7MbQX J89MOops8E34Q59nvKzVpCpV3z8vDUsF7LweKZAe/IKWFqLYfmZmlBEbivtfivraukgc Xepr3dsBJiejEz1I3hSubz4LVh7Ap1txd+ZK7FuImx23EwZ631gY+Tc+H3W2ECmGoS+K Gdog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=aYq8oJoHDhRlC7Neg8BOANaGIK4jLvc5YVs3cisEX6o=; b=u68oTy6rh8t+BlEa2Q1Yen4IS9Zv5RvnJdqM0R7ISFG6j5zqV6/9sOTqoPT7cwWJVV +xo/sxLgE6PnO05bMslKAcQI0HUF/buC7SqCqLoi/4TWtnJ8HNV+le8MKGEqzXXSm4Uz zPVgkphqyU3N7VEkH6Sr7FDVMv1+7O5kbQ7u2re7zblmfdv2LsI+8ypRgv5JoIbIhqMJ pjJwk2Xaz1+sSsoQznvXfqSQuTQOWxFY3lpnWxQ7pP9Jg80Ugn8a2bdkDzCjY0KHdFlQ hYiwsESck0bzs9N3yBtDx7TYkdoA3OCo/28vhWIoHKj1+nPPBsOCc7Vfh4V7Hff1MGyW B3tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B4953sAY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id my14sor18102576pjb.1.2020.07.04.02.15.29 for (Google Transport Security); Sat, 04 Jul 2020 02:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; 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 Cc: Suniel Mahesh , Michael Trimarchi , U-Boot-Denx , linux-rockchip@lists.infradead.org, linux-amarula , Jagan Teki 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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=B4953sAY; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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[]) {