From patchwork Tue Jul 16 11:56:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 752 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 9DF223F08F for ; Tue, 16 Jul 2019 13:58:09 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id o19sf12465012pgl.14 for ; Tue, 16 Jul 2019 04:58:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278288; cv=pass; d=google.com; s=arc-20160816; b=EBRFU5jHzyuBpJh4It3Em2z1ExdzqN0nX8WZp25IaPkAOBPLgW7FArqBr4CxEeF9eO SF/bzDAI5yAnUSJZQJBpOwV9OKYJrYMP2/Edx7h5I9MEhEeoGk7m3fi2OqULOkZz5IUm nAJ3AGWXiy40deIUhPOH7OGjiNoTciOuoHCNQZCB/MUxTN4mLAtnQ4XnRlTSe5gD7fGR q1aEB77e0GAVjqQUMLsQIBduqrtubPCrImBOz/2N1v6gMVPtPiQZ+ohhyj3iTGvfh/c2 tiRFkn2WeiT8j+6v1r+v/uJ+3tqvZZy6kuOVNUzoocw9qpVTMwVrM8UaV4Aklw1YHora AcNw== 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=MWlHZrQyRczU+06EiUl3vgd9NOXrYSmpGkeiwff4R5I=; b=I6zwMYsio28Un3Bye0mcttEEIqcmjzcTM0AT7rVXcmJGZxU/jo12XtPXWjtwFyUn7S eG+mLOaFd3cYMbdXeT6i+2cBNazqhII2/SsgKWAqhL5G/qXWYOswYTj+craxddh/Jr+N OkNyX8yDEDbHsVGiRc7BE5Gl+qvovjHAh3mS1ChtEUt/EX4/6oK7+VuhwhiPQgZTKawH B2BL5fOPTPBgLHprScfEwPmAufUtKW40b4OiTpjUVo3TBbTg1x36cS/8zESS5mL79jSj UETHylITFKUpsrbcwnmsKvIwdZN1h/Q+xGB8bIZXedL0kTZh6472qdIWVAviMBwCCWfJ 3veg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QZmjDZ+s; 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=MWlHZrQyRczU+06EiUl3vgd9NOXrYSmpGkeiwff4R5I=; b=RbB4x7FB22NgZ7BkFYyWe46lpZT9WAOVNPMOX0TvmRhC7Q89Ohayus/ej+zU2kOC1w USFc7w0vpxZMBCF/zim2eh7W9ly92aEn5XTJsruDfh3UsmqKGhKV6u0er6LOqmDpWJjd AqLr14Qm/YzVqb7OBlLgLNJnTNtusKE7oot+M= 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=MWlHZrQyRczU+06EiUl3vgd9NOXrYSmpGkeiwff4R5I=; b=lk5aJCAN01gfFE5Z+MHfQMqhZoOkpQIG+bcnx76YC3NnwvHBaq5VreLZajVh89MWAN 7ZI7wjMoh7eSXpA/1xxTaghghamlsgSQmk4H+ShRMM7nCQgdZUac/nLdKSVno3TOTzBP b6/I9r3Jbnk1k1v8Q11kGoOrAdX+uIgJA+UG2r8yKLfyNEWxcPS2Cnod3L1Ez6OdjxBS Z8p+ZKb8AzVnc1o+MUnXx0ybwRc7X9ZN7JpaPcsfyh+aDZVK+NG5P9tHIpGfgWA4XF/h HRUIAOledhBJ9LEwdD2Ez7OOKpcV1xU4hytF8GRJCxy7gQIdrNDyxXqersY9cBYz6UKl G0UA== X-Gm-Message-State: APjAAAX1sBkm0cbiT+4Hv0+zP7tkj3Aecjbm6mRvqkzRWO0IeggRNyLh ZJIVHqd34r4ZX1KcTuAQqh6De5uf X-Google-Smtp-Source: APXvYqwZXxbUufZbVxUzFt4APsqeomqrZi+QrJWIVMW98ESs1x2uo4FEVD/+WxdJGyf9m95mhtopgg== X-Received: by 2002:a63:c20e:: with SMTP id b14mr32109557pgd.96.1563278287956; Tue, 16 Jul 2019 04:58:07 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:905:: with SMTP id bo5ls7080853pjb.0.canary-gmail; Tue, 16 Jul 2019 04:58:07 -0700 (PDT) X-Received: by 2002:a17:90a:bd8c:: with SMTP id z12mr35835343pjr.60.1563278287588; Tue, 16 Jul 2019 04:58:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278287; cv=none; d=google.com; s=arc-20160816; b=AUG1MgAJ4zlHosKM1jup0+DYYDSrrIgd3AZqG/F8vwk7hW/9AnFKtA6Zcd8qGZE8Ob ThMIC08X7wA9m7sqg+uhN5IP2wskGUhuIEMKz9Tk0kl1IWXTGSqoy84Goy+splcyjL3E RpkssXRUOo9w7aowQPaZLT0HeIUvbFlxejpgqFPPTfwr7C8uxDsgjUwVRQUBuu6pesvT +tezK/NykLkSBNwz5ST+tp25547izLO7kpjVfNgMVKtwJ4ONZrY4ajyB+NlSLBikuiP6 fAEgU/yvDPv976lUUn7JA6RTj6BwjJdAod4OyWR6Dfmt7XNzZrQ7XujRchEYzEePLrLT 9Fig== 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=R2Xvx+xaEN7GG8Ut0L1/mXHTaQYOC5n4Pflx8rX6nbg=; b=J8oim/QiGH3ZSa6gfLRiaphNBcsN19PFe+NJNjvWlDk258e/6IUsawsgVJlH+Kxhl5 3JT7bbAtSTg/T2Z/cP4oXxK9nSE0k7qUXlC/zfeeqF5GdyuF27OEurLJJm96RlqilSaO euNnjGA3rfNGAZz5I6TGTPx/LAvOLq04XpJCYqXqgNEjWmupC1YoSnkInYACw4ca7qxq WhfYxCkf8soCAwbJonvaPVTR+NUs75Xd8G4RTRqjs/JardOnuQw1s0M256LfpyYR3L0R zmf8SlFW+GlrBgYSpl2GHGLn89vVmhAvVUEqvA6O+ty10ewF6I9j2CcAvoN74sCYzlDM sk9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QZmjDZ+s; 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 73sor24450903plf.60.2019.07.16.04.58.07 for (Google Transport Security); Tue, 16 Jul 2019 04:58:07 -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:846:: with SMTP id 64mr34833017plk.265.1563278287322; Tue, 16 Jul 2019 04:58:07 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:06 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v3 03/57] ram: rk3399: Add row_3_4 enc macro Date: Tue, 16 Jul 2019 17:26:51 +0530 Message-Id: <20190716115745.12585-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190716115745.12585-1-jagan@amarulasolutions.com> References: <20190716115745.12585-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=QZmjDZ+s; 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: , Add simplified and meaningful macro for row_3_4. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 1 + drivers/ram/rockchip/sdram_rk3399.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_common.h b/arch/arm/include/asm/arch-rockchip/sdram_common.h index 076afe2ae3..e5af3eab7e 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -71,6 +71,7 @@ struct sdram_base_params { #define SYS_REG_NUM_CH_MASK 1 #define SYS_REG_ROW_3_4_SHIFT(ch) (30 + (ch)) #define SYS_REG_ROW_3_4_MASK 1 +#define SYS_REG_ENC_ROW_3_4(n, ch) ((n) << (30 + (ch))) #define SYS_REG_CHINFO_SHIFT(ch) (28 + (ch)) #define SYS_REG_ENC_DDRTYPE(n) ((n) << SYS_REG_DDRTYPE_SHIFT) #define SYS_REG_ENC_NUM_CH(n) (((n) - SYS_REG_NUM_CH_MASK) << \ diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 830311ffa9..d97efb6996 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1089,8 +1089,7 @@ static void dram_all_config(struct dram_info *dram, if (params->ch[channel].cap_info.col == 0) continue; idx++; - sys_reg |= info->cap_info.row_3_4 << - SYS_REG_ROW_3_4_SHIFT(channel); + sys_reg |= SYS_REG_ENC_ROW_3_4(info->cap_info.row_3_4, channel); sys_reg |= 1 << SYS_REG_CHINFO_SHIFT(channel); sys_reg |= (info->cap_info.rank - 1) << SYS_REG_RANK_SHIFT(channel);