From patchwork Tue Jul 16 11:56:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 756 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 AE38F3F08F for ; Tue, 16 Jul 2019 13:58:23 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id h5sf12484827pgq.23 for ; Tue, 16 Jul 2019 04:58:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278302; cv=pass; d=google.com; s=arc-20160816; b=tyxxphT1Lbkm1GaJq0HiqmaJ3fGmINSCXeiIk4/YvzxfgSkuJHWHwzXzPrYRz+Mhhd vsfwGRK7s5AcWG0l4EQCh1x8O99b/nLbOoz4HfwiMpDNdKp0fnSTID5hHXC7dwmgMW8m UKnVGy5NoehmzOFF/+HAEnUA30YhDQ5YYZwW0v4S9hj1kxG++RgJjBPJcBnN/WbQcryA 3gvpfEMJp8iKnav/6UjhLZlVUfQlR0a96cM3VxWT1mK3U/07l7CX1kgkpuPeC+1FapC6 fmXkGnJK+KRaUQ4No7HLSB5xAtWFOP4kJiyi+YVAkX0QDJwE8AXqCz5KBtwog6jyCBEO uBDg== 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=ScPb0zDoG7tFmS9fQmz3UYnf0xWQ3kEcvaM5aoygrIY=; b=uoBNK+h/XpRYfFYimVUg4wr72Zvi6gowls0e8DvYGuMEi38JuEFAMtjNrI9s0V0A/o 4PZodrz0ZEwC1WgR3/F+eeNk359ay+J/mfyz4KYzkn/E/iStHRWsxfQXh8kyMKwJdGZV RlfI8WDdG+LHiSX1dbanK1171ZAEJMyEZS6mDxgUWVrYi4co9cI/yWuVGifbHN5HtUZz TEUq55hEB9wnseOwc4BEoYGVUSMgT6GEgo5jNVrnskGdrDHfctvdcjCi09yzaqlCt9Ua BUGmkneZI2snlrUMoFKHr8HVtpsksz6ZlMsW6Y4qeYK1N6m4Ss5U6t4kbaXi9yItd3qL oNTg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jNpnIVKw; 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=ScPb0zDoG7tFmS9fQmz3UYnf0xWQ3kEcvaM5aoygrIY=; b=X+Zi6LVlU2ELELpPv/5RBsPr7XghG8jWunb2+oxymabUZ4NDV3/DNEvlF3HYmLSmQb TA/WmeyjpGCvJg7cWbLqaheX0yS0V6PqHwYpi43uoUJAm3tm+MmQKHRx42ZyhMRr0jWv 2uWPuxRdIx7MDT81vAAErj5dHjCXz56OwZRV4= 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=ScPb0zDoG7tFmS9fQmz3UYnf0xWQ3kEcvaM5aoygrIY=; b=PNbpNpNoEsN7C79wjR7Tl+CBN9r0K600ctK9pYbHnxf6ZNwrw7VGHi741Q004EpJ0X EdXnRHkRvnkpp5OP+01C35/IoEoBpPl/shq7G/+l8w5U00dVfgVh+p3sv78onHOYDrNK 49IWem9kMjNd4/0HjxyUBgD2L3xEaWGKPcvOWmzmfNIqDkBWYl7gHJnikrla9rc6Fmex PdQ5xZFidCkVxLrjqRoF+9xDpT/XDW+8HHvbyuHQVavbrouX420rCgIoWN1QeIBBY3yi vqcA9SJJWK4XeOc137MZfLRyN8efq8RiYs7OYPfvXuLl7rpO4cTqmzRY+RASPUWt3b5N MPpg== X-Gm-Message-State: APjAAAVElaWhQamx6xTEPN2umAIAxm2HHj98GDpgy49CVuRoVUs61B/5 7eGn4dejbYJzRHc3tHzT50JNmGwS X-Google-Smtp-Source: APXvYqxpM/g8Ms5brwHedpHYyT4suHBCfYNYdJOr2ix7U1qq3Jmqw884jg+ZyaqNwOCU61WEYEznzw== X-Received: by 2002:a17:90a:cb87:: with SMTP id a7mr36797998pju.130.1563278302487; Tue, 16 Jul 2019 04:58:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b402:: with SMTP id x2ls5462882plr.14.gmail; Tue, 16 Jul 2019 04:58:22 -0700 (PDT) X-Received: by 2002:a17:90a:1904:: with SMTP id 4mr36644453pjg.116.1563278302186; Tue, 16 Jul 2019 04:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278302; cv=none; d=google.com; s=arc-20160816; b=1AKGLvVhRruXsmUUw6pXlNGCMVIXX1WunjwYkvo1bWgQcZWppBL4KvJJ5do1JPn2mm YyDEWxNdRAwOFk0Rjzy80ucxk0bUFUB7oggwPz/knCisZ9DRVu2ZDhzUJAMwn4rfN0xR yUzH+aj/ZXaD0Ww4Ddke0Jv387mcC/8YyBZ75orSGziiYLZ7jichTfMEsvIrnB+1cQhv 3T9KctdAORT06Ckcemjw89MQXyuRsjP56FrYn03kp1HW0WnW0xQmCisl+QUtD6V7hlvS UQ4vqnNfO3SApIjBptSDK3SPQA8rLDpSTioqHDDSB9/ieJYSjeoUCfAzfAaDCIJhsTdg cS2A== 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=xFSBaPoLEgv3bGdkt8E0ZmIHJeSdBwXN2dF/hzci7V4=; b=upc6iRdaDFEUMrMDgpRkqZrrGbWwJFOHt+qsWywV1W5T/VbR/xLSjQ6Sn74Aw7iB+7 wykax5fzpi1Sw1SRENz32Kms+Mv8ioAiWpTrYevcSrb5V//4HL1HbXd/6jzbZJKPqU5b yIyPCKoNwy9QbDgfWW9GB8n6OtzX/GpLhH3d44Ht4dYsb4FQAByNYZ7/EfiKAnlGgf5p mswoCsowegJEzz3bUXLVyEYbo4038OibDMrp8iqEnLhjYJbKE1U9riPIkk8Z23sn9lSL EXsR9zCW6bwqUFkNJj6TCeMG/hlxqgCZ/y22Yd2GIBAo0ccF4I+VmeXyHgP9T1rfkVbU rIjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jNpnIVKw; 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 l10sor10499630pgp.54.2019.07.16.04.58.22 for (Google Transport Security); Tue, 16 Jul 2019 04:58:22 -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:a63:6bc5:: with SMTP id g188mr2108600pgc.225.1563278301786; Tue, 16 Jul 2019 04:58:21 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:21 -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 07/57] ram: rk3399: Add bk enc macro Date: Tue, 16 Jul 2019 17:26:55 +0530 Message-Id: <20190716115745.12585-8-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=jNpnIVKw; 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 bk. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- arch/arm/include/asm/arch-rockchip/sdram_common.h | 2 ++ drivers/ram/rockchip/sdram_rk3399.c | 3 +-- 2 files changed, 3 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 e7f15a7cf9..71062e3e71 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_common.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_common.h @@ -86,6 +86,8 @@ struct sdram_base_params { #define SYS_REG_ENC_COL(n, ch) (((n) - 9) << SYS_REG_COL_SHIFT(ch)) #define SYS_REG_BK_SHIFT(ch) (8 + (ch) * 16) #define SYS_REG_BK_MASK 1 +#define SYS_REG_ENC_BK(n, ch) (((n) == 3 ? 0 : 1) << \ + SYS_REG_BK_SHIFT(ch)) #define SYS_REG_CS0_ROW_SHIFT(ch) (6 + (ch) * 16) #define SYS_REG_CS0_ROW_MASK 3 #define SYS_REG_CS1_ROW_SHIFT(ch) (4 + (ch) * 16) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index f6a83f2acf..b93a6c6c44 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1093,8 +1093,7 @@ static void dram_all_config(struct dram_info *dram, sys_reg |= SYS_REG_ENC_CHINFO(channel); sys_reg |= SYS_REG_ENC_RANK(info->cap_info.rank, channel); sys_reg |= SYS_REG_ENC_COL(info->cap_info.col, channel); - sys_reg |= info->cap_info.bk == 3 ? 0 : 1 << - SYS_REG_BK_SHIFT(channel); + sys_reg |= SYS_REG_ENC_BK(info->cap_info.bk, channel); sys_reg |= (info->cap_info.cs0_row - 13) << SYS_REG_CS0_ROW_SHIFT(channel); sys_reg |= (info->cap_info.cs1_row - 13) <<