Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1132183/?format=api
{ "id": 1132183, "url": "http://patchwork.ozlabs.org/api/patches/1132183/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20190715182856.21688-15-jagan@amarulasolutions.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20190715182856.21688-15-jagan@amarulasolutions.com>", "list_archive_url": null, "date": "2019-07-15T18:28:52", "name": "[U-Boot,v3,14/18] ram: rk3399: Compute stride for 2 channels", "commit_ref": "4b09719c38cea3d10095675046eb6e8e84955e85", "pull_url": null, "state": "accepted", "archived": false, "hash": "7ec1be1064ad9d36c65d3f54824e9c81d6c2e028", "submitter": { "id": 69820, "url": "http://patchwork.ozlabs.org/api/people/69820/?format=api", "name": "Jagan Teki", "email": "jagan@amarulasolutions.com" }, "delegate": { "id": 93623, "url": "http://patchwork.ozlabs.org/api/users/93623/?format=api", "username": "kevery", "first_name": "Kever", "last_name": "Yang", "email": "ykai007@gmail.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20190715182856.21688-15-jagan@amarulasolutions.com/mbox/", "series": [ { "id": 119574, "url": "http://patchwork.ozlabs.org/api/series/119574/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=119574", "date": "2019-07-15T18:28:43", "name": "ram: rk3399: Add rank detection", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/119574/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1132183/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1132183/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=amarulasolutions.com", "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=amarulasolutions.com\n\theader.i=@amarulasolutions.com header.b=\"Coa1qETY\"; \n\tdkim-atps=neutral" ], "Received": [ "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 45nXGq1CPsz9s4Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 16 Jul 2019 04:33:39 +1000 (AEST)", "by lists.denx.de (Postfix, from userid 105)\n\tid B61A4C21FA5; Mon, 15 Jul 2019 18:32:40 +0000 (UTC)", "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 9A310C21FC2;\n\tMon, 15 Jul 2019 18:30:28 +0000 (UTC)", "by lists.denx.de (Postfix, from userid 105)\n\tid 4FF07C21FA6; Mon, 15 Jul 2019 18:30:02 +0000 (UTC)", "from mail-pf1-f194.google.com (mail-pf1-f194.google.com\n\t[209.85.210.194])\n\tby lists.denx.de (Postfix) with ESMTPS id EE81CC21FCE\n\tfor <u-boot@lists.denx.de>; Mon, 15 Jul 2019 18:29:58 +0000 (UTC)", "by mail-pf1-f194.google.com with SMTP id g2so7826297pfq.0\n\tfor <u-boot@lists.denx.de>; Mon, 15 Jul 2019 11:29:58 -0700 (PDT)", "from localhost.localdomain ([49.206.201.107])\n\tby smtp.gmail.com with ESMTPSA id\n\ty133sm20250075pfb.28.2019.07.15.11.29.54\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 15 Jul 2019 11:29:57 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable autolearn_force=no\n\tversion=3.4.0", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=amarulasolutions.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=AsLLPwLnBovdXkNi9P5ImLX7S8wEFQBRTIIMJmHhUWg=;\n\tb=Coa1qETYaxDUm8uiAG14zdZbsHjqMda5bm2SHZgWGv/slXP9hsxR481YYp24tsSSc/\n\t7JBJ2eeyXDoRIsmMgkKWFJG0xN5XmYCOEnlgipbKuYak6TxxWPPg6cRndyfpNsPVNLV9\n\tQaBciVXMCGlpZoa+IJp3g2CwmZhhjbCMuJBbA=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=AsLLPwLnBovdXkNi9P5ImLX7S8wEFQBRTIIMJmHhUWg=;\n\tb=mMTTDa52ZFnC8NslZVhsd+SHpp5IuD36fmgspa1XZ9l7gdK5OOhxKa6ST5/Yq9/KXW\n\t3F/uwt1w/uj8AwqSSCCbRBSxYVg/My/5S9UTlsljsgUhMTkT0wl99BJQerFgdGTG8m+r\n\t0/YufC56M8RMnvAUZAzP358B/K0Lb7587PdBu7g1q3XZkd5KmLblhy8fjsReqJYJ8lss\n\t2u8eZLg3ek+Mb4Xqz/zKhglly1ZbsPuge2xZ93OnV2k6+KZZ+K4F4XctEjCLbXgWheha\n\tDfHsKoKH4oiDr8rX7n853eoAIejKs/tE2sOzDTney4ZBdc6SZbx+0ooa6ilUjZt+RfP+\n\tep/A==", "X-Gm-Message-State": "APjAAAXUhWAWpvpxg370gfPhfXVLLZd3lSZjfE0FSmO7AxtqWpKVrDdQ\n\tTeOPXH83ayULf5gQI152JsAJNw==", "X-Google-Smtp-Source": "APXvYqyBRQMYorqyvfi6aIXugZxyrflH5vgQZzW3mnTdn64P9LtM1GYxU9JiH3WHsIbv3ZZoJ5/suQ==", "X-Received": "by 2002:a63:4845:: with SMTP id\n\tx5mr27631710pgk.155.1563215397471; \n\tMon, 15 Jul 2019 11:29:57 -0700 (PDT)", "From": "Jagan Teki <jagan@amarulasolutions.com>", "To": "Simon Glass <sjg@chromium.org>,\n\tPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>,\n\tKever Yang <kever.yang@rock-chips.com>,\n\tYouMin Chen <cym@rock-chips.com>, u-boot@lists.denx.de", "Date": "Mon, 15 Jul 2019 23:58:52 +0530", "Message-Id": "<20190715182856.21688-15-jagan@amarulasolutions.com>", "X-Mailer": "git-send-email 2.18.0.321.gffc6fa0e3", "In-Reply-To": "<20190715182856.21688-1-jagan@amarulasolutions.com>", "References": "<20190715182856.21688-1-jagan@amarulasolutions.com>", "MIME-Version": "1.0", "Cc": "linux-rockchip@lists.infradead.org, gajjar04akash@gmail.com,\n\tlinux-amarula@amarulasolutions.com,\n\tManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>", "Subject": "[U-Boot] [PATCH v3 14/18] ram: rk3399: Compute stride for 2 channels", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.18", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>" }, "content": "stride value from sdram timings can be computed dynamically\nbased on the determined capacity for the given channel.\n\nRight now these stride values are taken as part of sdram timings\nvia dtsi, but it possible to use same timings dtsi for given\nfrequency even though the configured board sdram do support\nsingle channel with different size by dynamically detect the\nstride value.\n\nExample, NanoPi NEO4 do have DDR3-1866, but with single channel\nand 1GB size with dynamic stride detection it is possible to\nuse existing rk3399-sdram-ddr3-1866.dtsi whose stride,\nnumber of channels and capacity it support is d efferent.\n\nSo, add initial support to calculate the stride value for\n2 channels sdram, which is available by default on existing\nboards.\n\nSigned-off-by: Jagan Teki <jagan@amarulasolutions.com>\nSigned-off-by: YouMin Chen <cym@rock-chips.com>\n---\n drivers/ram/rockchip/sdram_rk3399.c | 71 ++++++++++++++++++++++++++++-\n 1 file changed, 70 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c\nindex 084c949728..c626ef602c 100644\n--- a/drivers/ram/rockchip/sdram_rk3399.c\n+++ b/drivers/ram/rockchip/sdram_rk3399.c\n@@ -1183,8 +1183,75 @@ static int switch_to_phy_index1(struct dram_info *dram,\n \treturn 0;\n }\n \n+static unsigned char calculate_stride(struct rk3399_sdram_params *params)\n+{\n+\tunsigned int stride = params->base.stride;\n+\tunsigned int channel, chinfo = 0;\n+\tunsigned int ch_cap[2] = {0, 0};\n+\tu64 cap;\n+\n+\tfor (channel = 0; channel < 2; channel++) {\n+\t\tunsigned int cs0_cap = 0;\n+\t\tunsigned int cs1_cap = 0;\n+\t\tstruct sdram_cap_info *cap_info = ¶ms->ch[channel].cap_info;\n+\n+\t\tif (cap_info->col == 0)\n+\t\t\tcontinue;\n+\n+\t\tcs0_cap = (1 << (cap_info->cs0_row + cap_info->col +\n+\t\t\t\t cap_info->bk + cap_info->bw - 20));\n+\t\tif (cap_info->rank > 1)\n+\t\t\tcs1_cap = cs0_cap >> (cap_info->cs0_row\n+\t\t\t\t\t - cap_info->cs1_row);\n+\t\tif (cap_info->row_3_4) {\n+\t\t\tcs0_cap = cs0_cap * 3 / 4;\n+\t\t\tcs1_cap = cs1_cap * 3 / 4;\n+\t\t}\n+\t\tch_cap[channel] = cs0_cap + cs1_cap;\n+\t\tchinfo |= 1 << channel;\n+\t}\n+\n+\t/* stride calculation for 2 channels, default gstride type is 256B */\n+\tif (ch_cap[0] == ch_cap[1]) {\n+\t\tcap = ch_cap[0] + ch_cap[1];\n+\t\tswitch (cap) {\n+\t\t/* 512MB */\n+\t\tcase 512:\n+\t\t\tstride = 0;\n+\t\t\tbreak;\n+\t\t/* 1GB */\n+\t\tcase 1024:\n+\t\t\tstride = 0x5;\n+\t\t\tbreak;\n+\t\t/*\n+\t\t * 768MB + 768MB same as total 2GB memory\n+\t\t * useful space: 0-768MB 1GB-1792MB\n+\t\t */\n+\t\tcase 1536:\n+\t\t/* 2GB */\n+\t\tcase 2048:\n+\t\t\tstride = 0x9;\n+\t\t\tbreak;\n+\t\t/* 1536MB + 1536MB */\n+\t\tcase 3072:\n+\t\t\tstride = 0x11;\n+\t\t\tbreak;\n+\t\t/* 4GB */\n+\t\tcase 4096:\n+\t\t\tstride = 0xD;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tprintf(\"%s: Unable to calculate stride for \", __func__);\n+\t\t\tprint_size((cap * (1 << 20)), \" capacity\\n\");\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn stride;\n+}\n+\n static int sdram_init(struct dram_info *dram,\n-\t\t const struct rk3399_sdram_params *params)\n+\t\t struct rk3399_sdram_params *params)\n {\n \tunsigned char dramtype = params->base.dramtype;\n \tunsigned int ddr_freq = params->base.ddr_freq;\n@@ -1232,6 +1299,8 @@ static int sdram_init(struct dram_info *dram,\n \t\tset_ddrconfig(chan, params, channel,\n \t\t\t params->ch[channel].cap_info.ddrconfig);\n \t}\n+\n+\tparams->base.stride = calculate_stride(params);\n \tdram_all_config(dram, params);\n \tswitch_to_phy_index1(dram, params);\n \n", "prefixes": [ "U-Boot", "v3", "14/18" ] }