From patchwork Tue Jul 16 11:57:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 766 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B4BCA3F08F for ; Tue, 16 Jul 2019 13:58:58 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id d6sf10042342pls.17 for ; Tue, 16 Jul 2019 04:58:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278337; cv=pass; d=google.com; s=arc-20160816; b=bIUXwNNMtt/P/SCWw3lieoT/pwpUY83h9LOYp1Wj4ln43lx30CRZaZCPGRZQv8yzU8 KkjyeFR1F4UbuUkk5nWWdrNPkTwGHNdZIY9cuABupjtCWEZ5gHQvaLs/XR1ZSkvsoAP4 RAortJxZPuo1VOLSDyoMQZxYt++vuqlbldzXFXf80sySlLV8lhC2KFFR6bsWz8VVi/az TO59UbU2BjMg1hiwEPxV+eYxJ0RpGqJ8JmPaGJxyWDYYOvmozlvI0D3X5SmG6xqdI2Vy t8tV06ATYCoiq6EogIDU/BipU48XWuJI+5VOFjIfk1AwpaJlXXdwwxihf1xLq3rQGznG Ytfw== 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=viPdYhV5R/jz8qsnM2jjWbJ6mi/VtyqtONloAA8w6uQ=; b=I9aOxV4XQHcvnOeYbiwWLzDC1/xDu93GAghYYKJTHDljkQgh2T/qVMQSbJt6p1rooc 5ARiFYJhzefaLY2wO8tUgouoUGzKalPLyb062r4mNX1hLHgpPJ84CBRY0mK1pgC50IhT lOk0PAYWfHq+ErEyja8He5158c3WwrtddMycHW1aE7qsnUTx08sn3ZmovrJw2zHQAnm9 pOaQkrw9W2env8JblkBBlQF4wxOzwoDtvkCYhJvWg3LciQwTI9WCv9cvgJ2Ybz/kUk8R ske62LYJ4FkHE/6+VCtlCquYGMc/if1x2+tEUHiYrhE+jyE/bQmDkmnAhnDV0yUlNi8T jwdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="EO/gVMfP"; 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=viPdYhV5R/jz8qsnM2jjWbJ6mi/VtyqtONloAA8w6uQ=; b=Wsupshq1NBpuSAYuoSZ5eilNtd5llxvKJqRm5pBRBfA8ndIceGuHQl2/dvAqz2Byr5 8Z8V2/9qgiDpW+Ao8zwOD1eCYR11Utf2+Hx9zL5VSqaHaxsTMU9aI/VKJ5CHo4ZDS2vV qhbJrG6oDaAGxawPRU70plQlU0zNmAThXmVBM= 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=viPdYhV5R/jz8qsnM2jjWbJ6mi/VtyqtONloAA8w6uQ=; b=SCFG/geNTgyS2prCZKVLamKDi8qm+HeYun4/zTeRRrqp1rq/gZomoPrk09U6Xcsp7h xF/kjg0QZEwpU9U5ScAeHxuC2wPxzRJyhRbCNAUUDTztKPczafrsGQTITBJQvZcUafBi pNx+BmgVfCeHB/gcIVGqE21pBNWYDtKQ5IsLNfC0fEuT+22h0W549uURZGvdfRXxxXp9 p6XiPj5sHA6Qyw2FXd3b5nxQO7IlMaD28CKNlDV0SWt3KTbg22fa5dSDpi3FZucrsn9v S1UUVTm5CGc2tb9sSVEV3eUexsurRqA5LqaSfRGEejmYp4x/qcwLqfjaXrwq6BVJsT81 ZsGA== X-Gm-Message-State: APjAAAWCmyExHrnfDQ2FasYzNLqu1ia/djoTNkLrO/sjwRo6ibXCU5I+ dQ/eMrNky03zXMJpItIFc+bngZi/ X-Google-Smtp-Source: APXvYqzsT2Y5eOJjzSf7Pp/9Wq/GB4jSShJY2/fx9vzuyPfL09oOm1k/2GqyTULsqrewyxih+/DW/w== X-Received: by 2002:a17:902:8205:: with SMTP id x5mr35312062pln.279.1563278337585; Tue, 16 Jul 2019 04:58:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:680d:: with SMTP id h13ls3343911plk.13.gmail; Tue, 16 Jul 2019 04:58:57 -0700 (PDT) X-Received: by 2002:a17:90a:d58c:: with SMTP id v12mr35052676pju.7.1563278337322; Tue, 16 Jul 2019 04:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278337; cv=none; d=google.com; s=arc-20160816; b=duUDqYv79OYwg2yFoKPdiQkipxbkzXGQWzgi0Kopa0pSg3U1a44fpJ7r1Mc6SKIXKT fOq6W4ZBBYC0FgaP0jQUtSdYB4ZyNEavp5aIDJn0DjamMU37dFkBj4YYfSWjpm+MWBmA 32CO5AlwWpOFdsUsO2x6DPANRnzlR6om/DgtnnXrIKTGDzJB+bEcNpCFabmytjeWph6i 3iua5PMoKNiVEqrFKD8nnH9R7OubEO+C54ET+ufF0LZT90xjlO7qLHP5VsJOwU4cw/z6 DMLOOEri+hjc2wuV+wK8CK7IP5dH44GRa9CmiyBzmAUgdusFFeZUb6ZkeQ3wBQkHb/Mr LqNA== 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=G9X4zZvYI0+z1juOsggDVzjoWCoJKJscHi2dgdYyHhQ=; b=nmx9ZUk/eMn6jK0YZoeL26xyvA6Kp1Cad1XxvVrjpz4zXIxi8W95Mbb/2VYdfquv2W Uee9kywKUs05/v1UY1CuJVYrZVKfSr5BPROkEfNrkQoEZpb3KyTra0/4IaHXErRP9CG6 iPv4xM/NKGytSfxDsJIiuk6Rj0dVoVNVcGgVOod7qFvBaLJbdb1gI1bNRF7NPYUh9tPI jLWkDUVVBz187lcHmdrswb1UNBPUMVE+7W66kVH6vULkCK4nyU3m1Ar50RAx0SbrJP/I 3MiXqaV+f5O6Pdo0hVLIryvnB6IVU9zhiaIVow4bteOhvgTw4Mpyc163iuw/cH/KYTB6 qKsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="EO/gVMfP"; 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 h4sor24449513pji.23.2019.07.16.04.58.57 for (Google Transport Security); Tue, 16 Jul 2019 04:58:57 -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:d998:: with SMTP id d24mr8962017pjv.89.1563278337035; Tue, 16 Jul 2019 04:58:57 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.58.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:58:56 -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 17/57] ram: rk3399: Add ddrtimingC0 Date: Tue, 16 Jul 2019 17:27:05 +0530 Message-Id: <20190716115745.12585-18-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="EO/gVMfP"; 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 DdrTimingC0 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 --- arch/arm/include/asm/arch-rockchip/sdram_rk3399.h | 12 +++++++++++- drivers/ram/rockchip/sdram_rk3399.c | 2 +- 2 files changed, 12 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 471702f935..7f41a67242 100644 --- a/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h +++ b/arch/arm/include/asm/arch-rockchip/sdram_rk3399.h @@ -18,6 +18,16 @@ struct rk3399_ddr_pi_regs { u32 denali_pi[200]; }; +union noc_ddrtimingc0 { + u32 d32; + struct { + unsigned burstpenalty : 4; + unsigned reserved0 : 4; + unsigned wrtomwr : 6; + unsigned reserved1 : 18; + } b; +}; + struct rk3399_msch_regs { u32 coreid; u32 revisionid; @@ -36,7 +46,7 @@ struct rk3399_msch_regs { struct rk3399_msch_timings { u32 ddrtiminga0; u32 ddrtimingb0; - u32 ddrtimingc0; + union noc_ddrtimingc0 ddrtimingc0; u32 devtodev0; u32 ddrmode; u32 agingx0; diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 7f6f7d8a9a..e916448fc0 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1110,7 +1110,7 @@ static void dram_all_config(struct dram_info *dram, &ddr_msch_regs->ddrtiminga0); writel(noc_timing->ddrtimingb0, &ddr_msch_regs->ddrtimingb0); - writel(noc_timing->ddrtimingc0, + writel(noc_timing->ddrtimingc0.d32, &ddr_msch_regs->ddrtimingc0); writel(noc_timing->devtodev0, &ddr_msch_regs->devtodev0);