From patchwork Tue Jul 16 11:57:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 779 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CCA663F08F for ; Tue, 16 Jul 2019 13:59:44 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id o6sf10057974plk.23 for ; Tue, 16 Jul 2019 04:59:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278383; cv=pass; d=google.com; s=arc-20160816; b=QrHr4oYW2uAZ1ZzdjsI0gGFgbLtpDoPlUFbs6M0N/H+L1H58mmjWD/rO+rxjx1sJe0 OfcJ5HhV5dmimGqPAk9EG3pZ5vu8PsquVE2XH55YIfOLjAjgloM3/GA3wlIxiLrnN+dJ 9ucEl58XfuapXaIsm5KPDMM9ZLSJjS2qaG1xbNfc6+Y6vaoAlbsdDmVolFZbY4hpBkon hrLF1uogaQEe5hc1LvQQ/XVG1PX3zvD/+0ijC1QOJroJeW4o3wce5dpWJfjXG9D7zrbZ RjLhQ7zwO2/xOa18FFeVzMtLq5MaYVeGeIogk661fH5hGYChAdv3gMkERtNIvPua/S2n hu9Q== 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=CbtwC8bD/FPXFOmPbHqV+EEfmyHcIPKQ0r+kr7UfG5g=; b=SgaRyqiUHQ+ZJTyvSQDUMwS4hy8VF4YKQRUWEHTOoV2PDZbAw1t+e9Mi1t27mlFuM4 oMHfmU9b+AdttKBLU3FfS/8gV5Z1vQfBZ8LA5zP1yJqtIP9TmN6mMg51xLoHrQd3xFWg s/Yv3VRfn07ca9AoYL3TZ0sD4prLjxvNzNjXmQw9iV865isWDuW0B0XuzK6Dod00kXxR vPzHK+lBKdEi01uaoAj5AG3q3x3vOtZEydRbeIwhUVBH/+o4WjHNvdBqKCbVsmV4u74f rOoucwowd5NCOTbVJz9bawCPN2RcWBdejq5MpeyQq9mvLv21/Uyzdx3vq/+8a1PsOd+p vxtw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TDMpdvzh; 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=CbtwC8bD/FPXFOmPbHqV+EEfmyHcIPKQ0r+kr7UfG5g=; b=i0+UopQBAmBFGUE2InWedmu53AFxjb30LjvEvzJQhq7uEzcYzZmA2aFzKK8NWRcWzJ +Wdik2WiAQznXrMdHxgbyOfrEYYRHVcl4FGPQHB+al8hnYFHyCEftyvStx9b+oB11XSX 7iTmBhkJYN9CF+d6LVZhVmmTo4TqseyhH1RJI= 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=CbtwC8bD/FPXFOmPbHqV+EEfmyHcIPKQ0r+kr7UfG5g=; b=jkqF6DIra6SJaRP1f6w0CY55e/lvrqtOxJ4bgzHHWb3oSIa7GqgCZRRt1kYT68zOqD Ls4YVF+wCc0NBygjz3GQX16qfbFWFoM0j51scJ7MdkQSjanXJjWJYUyC4SXJeGon3Du3 +9fJn8QpJIrb0qfyIbYcSPx2Aui9Nn3U2wbLeRu+3EggipNDLa5xK1FASIe2p5fsUOLu 0fTOmm3741e5nVS8seC8ll80Gpq9M0zx1LjAdWzv2XVGWZQ1UhP1iNbR3GykI+fRG1Io HbDV9z8N8SHdNO87xAhWTCvBaCZ3reQzJK/Fj3QTFGXIy73Vsw2PQraV750PR/o0X42F BboQ== X-Gm-Message-State: APjAAAVsUFvpE1euqeFI+9bUtJBEeHhatnt0APWZCANsrvbsGvAlI3ye MgIvQI1aTa4OLQdULplRg0Hd0Xyr X-Google-Smtp-Source: APXvYqy6md1sjAK08B8yZP4TOygje2JR5/vJFn3OJX5TNca77OntUQY6LrCnuG3HT5D/YdR10DHUBg== X-Received: by 2002:a17:90a:26e4:: with SMTP id m91mr35793933pje.93.1563278383647; Tue, 16 Jul 2019 04:59:43 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls7086417pjb.0.gmail; Tue, 16 Jul 2019 04:59:43 -0700 (PDT) X-Received: by 2002:a17:902:f01:: with SMTP id 1mr34599851ply.170.1563278383385; Tue, 16 Jul 2019 04:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278383; cv=none; d=google.com; s=arc-20160816; b=TF/eAmvIR0Oq2lo5iaLQgcLgxgvHDo68WA6XhXEJU4Mk5trRB9hDDzPvnyVdTt4+1R N9/y0q8fGypt1SSMAH/scU9sBHsDg2B237TsT6o/mFpcodS9GNlaLmaQmClnQxsvJUOc YDSXc5QZ+kSxxsdatO9uqJAvuVbEBIHrJEIua9+5D+9iKtDEQcAQ56LeYt6Son63iKfO BiGTqbvZiXPumXXeEHsoSF4Aek3yJ1GO3NJwrey5rOaa5+8+ecGNcXms29UzVG46U6sy JOSt4y9eGW1rmghofBV2rXT1gs1edAnYNR0hYSrIIbaG/ilGIKz6zuAkpYhWvwkZbxDa de8g== 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=35O8lHuctuEuK/510PsjVw9EI596auqTMOJ6mksNslA=; b=YMv3Gcroen4rOug8Z2jFpjWjT2g6o2hevQw3op7JF6cB19R22ZoGTbkVK3qhWB1dK7 1omuibG0nyzdhx7WfI1aCzooADLU/OIVU0m/IBfQbBF/wQl/q5RZT+BzxkVFd51KD/gf +uWNS2zWi0xmKqQsd02Zx0KH0jyZecA21DH24ieLQlYm8e3J2RbgrSd0CXCKTULsVJ46 2JL4BjQRmuQzgZ3ftvhoTTZFgXp6cKjToAHW7zcuBWqLJKvqjIgsxC9M4pQHr8dBkc/O HB/NbrUfXDXOnzHcbyD0k4KVKo9GByxWLVoHUpOUaqOtCjosusZqvWjGQ2WvDXpca8t4 sdCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=TDMpdvzh; 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 q30sor24709092pjc.13.2019.07.16.04.59.43 for (Google Transport Security); Tue, 16 Jul 2019 04:59:43 -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:a613:: with SMTP id c19mr36426805pjq.17.1563278383051; Tue, 16 Jul 2019 04:59:43 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:42 -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 30/57] ram: rk3399: Map chipselect for lpddr4 Date: Tue, 16 Jul 2019 17:27:18 +0530 Message-Id: <20190716115745.12585-31-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=TDMpdvzh; 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: , Assign desired cs_map values for lpddr4 during set memory map. Initial cs_map values is based on the sdram parameters, so the same will adjusted based dramtype as LPDDR4. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 2ab10da53f..7689711a99 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -188,6 +188,16 @@ static void set_memory_map(const struct chan_info *chan, u32 channel, clrsetbits_le32(&denali_pi[155], (0x3 << 16) | (0x7 << 24), ((3 - sdram_ch->cap_info.bk) << 16) | ((16 - row) << 24)); + + if (IS_ENABLED(CONFIG_RAM_RK3399_LPDDR4)) { + if (cs_map == 1) + cs_map = 0x5; + else if (cs_map == 2) + cs_map = 0xa; + else + cs_map = 0xF; + } + /* PI_41 PI_CS_MAP:RW:24:4 */ clrsetbits_le32(&denali_pi[41], 0xf << 24, cs_map << 24); if (sdram_ch->cap_info.rank == 1 && params->base.dramtype == DDR3)