From patchwork Wed Feb 19 01:46:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 1240461 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=85.214.62.61; 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=rock-chips.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nTCi7zDB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 48MgYf1sQ2z9sNg for ; Wed, 19 Feb 2020 12:46:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42886816A9; Wed, 19 Feb 2020 02:46:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nTCi7zDB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63AD1815F2; Wed, 19 Feb 2020 02:46:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (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 6C3768153B for ; Wed, 19 Feb 2020 02:46:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@gmail.com Received: by mail-pg1-x543.google.com with SMTP id 70so11869766pgf.8 for ; Tue, 18 Feb 2020 17:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xHM6FV0i4bw4kauVSfbIU70NAG7RxYPwbZcj7bkXVcQ=; b=nTCi7zDBNLtHYThyGztFaBgW5LxOjKVRquqeWJxT2N2VuIyXxQ5vvt9RYH5RM7WKce 7GFIz/PJY48O0npDJVEtL2zs+Ourb3JL9GT5Ps/b+czHlIaK37taiHrllmGsmwEmMSDg Z8n6lEhIcEmoWYF4lrNyEITyGHncG1BRBCltnQVwd2WEviEs/evWBrw18bMPDT89q/jz BJYCodXGXx6bZUM38qOtorfYVOQVEkcInMDSqDp6SDDn4KX+OoTQro7ayp0w3nCEdgWc oQpoNNzda9i4It4/y59f+3gTn7lwrzkiSB+QJ1Cg1kD72plb0ECvCgweuxJhIAEH3Ebk THeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=xHM6FV0i4bw4kauVSfbIU70NAG7RxYPwbZcj7bkXVcQ=; b=XxhbOh+mxmwBdQGhf/peZcRw4BStbFTGndCJbQczzAg1kv2v0WhtDTIxI1SNDXefBE 0MQIumOYm+IrPrj45ATFaiiDzgeZvVOxstWq4/ks7KQvHNHQsOL/A8DZWeC2Za8RsVjF k5we6eyDL6tJJPBexmEJzJ6pgo/7968CdUMsws1rAT1psLZJLuOw5PmxRh7aePPy7oiZ WbQPMXO9rZzv8XvOZHvi9sAvnjoKIQ8MD0H3XOdItSfy54yppQGEPq0omuaA5TQ0/y0z 2Ny58CGyxBa8/x8oWo7c0+RLLdJ66Enm7jkhn/RrAzycZ25sT9f2yHVcbhVHFilzifYv qH4g== X-Gm-Message-State: APjAAAUlWrQIWT+yxRJmeY65ql3lVD7pluolOvTebKPwILnyhu8Qzvfu /D/fqdVkmNUkxkmaUo6uVzux5HWV X-Google-Smtp-Source: APXvYqxTiU1hzcz9A21YlBU0DMNJkSbDLzf2idVo2eKq+86wg2vWaUPxLoYiwYWchYy72J0VDieleQ== X-Received: by 2002:a65:4c82:: with SMTP id m2mr24742396pgt.432.1582076773887; Tue, 18 Feb 2020 17:46:13 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id bb5sm210171pjb.8.2020.02.18.17.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 17:46:13 -0800 (PST) From: Kever Yang To: u-boot@lists.denx.de Cc: sjg@chromium.org, philipp.tomsich@theobroma-systems.com, Kever Yang , Andy Yan Subject: [PATCH 2/2] rockchip: evb-rv1108: Use syscon API to get grf base Date: Wed, 19 Feb 2020 09:46:06 +0800 Message-Id: <20200219014606.18515-2-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200219014606.18515-1-kever.yang@rock-chips.com> References: <20200219014606.18515-1-kever.yang@rock-chips.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.1 at phobos.denx.de X-Virus-Status: Clean Use syscon API to get grf base instead of get from dts. Signed-off-by: Kever Yang Reviewed-by: Simon Glass --- board/rockchip/evb_rv1108/evb_rv1108.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/board/rockchip/evb_rv1108/evb_rv1108.c b/board/rockchip/evb_rv1108/evb_rv1108.c index 733f29376e..5d622c3737 100644 --- a/board/rockchip/evb_rv1108/evb_rv1108.c +++ b/board/rockchip/evb_rv1108/evb_rv1108.c @@ -5,8 +5,9 @@ */ #include +#include #include -#include +#include #include #include @@ -14,7 +15,6 @@ DECLARE_GLOBAL_DATA_PTR; int mach_cpu_init(void) { - int node; struct rv1108_grf *grf; enum { GPIO3C3_SHIFT = 6, @@ -34,8 +34,7 @@ int mach_cpu_init(void) GPIO2D1_UART2_SIN_M0, }; - node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf"); - grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg"); + grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); /*evb board use UART2 m0 for debug*/ rk_clrsetreg(&grf->gpio2d_iomux,