From patchwork Tue Jul 16 11:57:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 767 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 36ABB3F08F for ; Tue, 16 Jul 2019 13:59:02 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id t18sf2521424pgu.20 for ; Tue, 16 Jul 2019 04:59:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278341; cv=pass; d=google.com; s=arc-20160816; b=jIWYZbIihut9OU7OO4CMMxNouLlnte0uUpu4bEwahhtUt30o9YVjd5RN0m26wVebOK URzCfbz9POEF8KQ+db5ZwKJIWUnnrSIBQ/RWTEx3XRz/F2xKQn34RYs94SEG5+BvqbMq dk7SxFpzYsMyKhI4wtwoalQDipFxL8uRALJovOKpxCMtDphWzLZVoIjEn/qdywR1FjuM +cOdhjrfn0RGDjVXY/mJiLFe91UyO9Njpamye2TFfzyL6bCgzxZaE/UgQiar8Zd8Rox2 kI5qyZQAjPOZNfXKalKTdsJOuGVQiXB9LukKK1XLnT+JHU9MN2A0d6PbaO2pqfczjg3V XdAw== 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=uwKjF93EOn75Pm4SPcyFdXqO+AdTvm4hGTYaaQA4ToE=; b=HRw2e9JzTLFc5QNYXvwZ6jFtwvoZMxvuSX0LU/dN5dOQTIZtjxCO4465In5s+ogqzl tTIdFecnrWWvmXwnGSfZ3rXQ9k+kvjBa14Y7h6cn7u4E9TLwNAppkmr5bESNHsK/L3W5 u7yCfJ6y4f16x9DhyLBncrewFLpChwhh5EgJdx6K+r1um58tj36AMs6WlLkF5zziWL+A aS5EiEjdPmcjpSLleKqYiiUm64YlSFJJm7rw10Y0+RpvHYOxdaCq9V9nx+SsixB6G6s+ kkbRq6FVO0tOwq2Pdw1WxC9QU7ZD1/uf5uB3aHBUSFqXn7bUY2N6kugQIy4goTKyCdzk 9sZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mWXJia57; 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=uwKjF93EOn75Pm4SPcyFdXqO+AdTvm4hGTYaaQA4ToE=; b=kxZXmRQJk0bm17eEUbeJWeYf82p6qKiiS9nJU1jnmj7ceeX5xkd8qvRHWmtmhOet/Y cqol51Rkiamsv24H0QmjZzOMin4AAQk9SSOR3+0VqPiS+v6HACkVjEhqmMUL3FbtKsfn x2ST3DzYCJEvhRKDnOYw+Pg0EpNB6M+2HnV1Q= 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=uwKjF93EOn75Pm4SPcyFdXqO+AdTvm4hGTYaaQA4ToE=; b=hILHNrFA3RAWMqozcAANX5oupp3tn+dOoB793v2wh7hj75P0S3vp5/QTHzlRaznpMP yHWdCNwPf/QKIHURBDMxk52ARlVipgweFIpv+MTFcNtGPZ1C6ES/L5tioXbbrxkCYYo3 34kgedLVYee3fRDqtKKtaxNmrkNEaiZ5+jXwCPkk4tdqCOgB9P3/NWWzc508U7jUKwL4 fVNeox5ugmpav7NxCztXN6WkQPs6SWxX5gjAWaPUQtzIRYFEXduARloPy5Jopw3lVd0O GRAxLlX6w6Tk1T3Zi6xSBTTfa8Kp+Dls4FUtMwfG/zNOJ2IBmmSJTZNxIc+Yr8+Q0yN6 itlA== X-Gm-Message-State: APjAAAXEBHucBH5c+1erfcmPEUhrifJuZrT6m6vKb7vIsAW2RiOEb/HZ r0N/sGo5bxpRWC+pxS2s9/kL1Gci X-Google-Smtp-Source: APXvYqw2hHib3AgC2VQS8mx73MDipYWYbWXF1JWH9HwAiJUxCEG5Q4qJM/BVjpxXyq8vcA1uJaqCZA== X-Received: by 2002:a17:902:3341:: with SMTP id a59mr34159848plc.186.1563278341086; Tue, 16 Jul 2019 04:59:01 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3662:: with SMTP id s89ls7081670pjb.1.canary-gmail; Tue, 16 Jul 2019 04:59:00 -0700 (PDT) X-Received: by 2002:a17:90a:fe5:: with SMTP id 92mr36177225pjz.35.1563278340767; Tue, 16 Jul 2019 04:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278340; cv=none; d=google.com; s=arc-20160816; b=rxfqIbHszRrWgDyUGGipj0xBtqIyUfZMmb999WWbFwKwcZ6cq/IvA88+zxl1FNksB3 DE85Ok1YMH6s58dv2pUX0bZW30+Isqud32OzGndOe59dmPV2SOrfIIUt/cHfGGbkRkIn P5NhGvWXLK5B09yPMaMixfyQAmcNHGrfcDJmpp99c0xGw/8uIBOaSl/gu/bwHl0gDrvQ 3AI8MnDd0xHTJTc4N0dJSD0AWN4fVoQ1CgBni3NC6MeDL1iXphT0zMR6RIS1Wki+uQmd eacFlwTUIl+D35uwsR5N5Y47euPhj+MAkyxYzXaqZnRlsMvF+gb1lHAfTeqUrQU2yCiB ROZw== 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=OBBqxzwZk8zFsYhB5wViSonLKwBtWoREpqgXCRrl5xk=; b=W/UYeR2X90Y+pZWp4r18PLerYkhIVU8tCEfi4Y6CeYjAQGM1JTvRhJdtf9g0lBQdqW QttsrGaR/DBzctxUzt+w9+2nGqEXKbEh7C6GyQkCTrB04wthK5mLteLQ9y1ZT4qY4xqv ZVkl9cq6RMmgNCqDfPOrBYid14WV85qbugNmG8tHAXaMMZ7Y+Ms+d0KyEyA2fplJwt0A zV3jUZQQOGKA65AVqfFJew42dCqvIidiNz45Q6803lvOh42W9Wl5FtDvSZcPSmaQIUHC DrOo3lDp8mWkUGHRdTb+ARXACSLZ+HbUoMXcFXTs2UiZRkOAMdNUqI4fXm4kceDawQt2 S14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mWXJia57; 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 g4sor24788216plt.30.2019.07.16.04.59.00 for (Google Transport Security); Tue, 16 Jul 2019 04:59:00 -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:2a29:: with SMTP id i38mr35053781plb.46.1563278340462; Tue, 16 Jul 2019 04:59:00 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:00 -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 18/57] ram: rk3399: Add DdrMode Date: Tue, 16 Jul 2019 17:27:06 +0530 Message-Id: <20190716115745.12585-19-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=mWXJia57; 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 DdrMode structure with associated bit fields. These would help to reconfigure sdram capabilities during lpddr4 setup related configs. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- .../include/asm/arch-rockchip/sdram_rk3399.h | 17 ++++++++++++++++- drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h index 7f41a67242..dc65ae7924 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -28,6 +28,21 @@ union noc_ddrtimingc0 { } b; }; +union noc_ddrmode { + u32 d32; + struct { + unsigned autoprecharge : 1; + unsigned bypassfiltering : 1; + unsigned fawbank : 1; + unsigned burstsize : 2; + unsigned mwrsize : 2; + unsigned reserved2 : 1; + unsigned forceorder : 8; + unsigned forceorderstate : 8; + unsigned reserved3 : 8; + } b; +}; + struct rk3399_msch_regs { u32 coreid; u32 revisionid; @@ -48,7 +63,7 @@ struct rk3399_msch_timings { u32 ddrtimingb0; union noc_ddrtimingc0 ddrtimingc0; u32 devtodev0; - u32 ddrmode; + union noc_ddrmode ddrmode; u32 agingx0; }; diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index e916448fc0..e4723c7d59 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1114,7 +1114,7 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrtimingc0); writel(noc_timing->devtodev0, &ddr_msch_regs->devtodev0); - writel(noc_timing->ddrmode, + writel(noc_timing->ddrmode.d32, &ddr_msch_regs->ddrmode); /* rank 1 memory clock disable (dfi_dram_clk_disable = 1) */