[{"id":1781417,"web_url":"http://patchwork.ozlabs.org/comment/1781417/","msgid":"<alpine.OSX.2.21.1710061230280.20491@vpn-10-11-0-14.lan>","list_archive_url":null,"date":"2017-10-06T10:34:25","subject":"Re: [U-Boot] [U-Boot,8/8] rockchip: rk3128: add sdram driver","submitter":{"id":53488,"url":"http://patchwork.ozlabs.org/api/people/53488/","name":"Philipp Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"content":"On Wed, 27 Sep 2017, Kever Yang wrote:\n\n> RK3128 support up to 2GB DDR3 sdram, one channel, 32bit data width.\n>\n> This patch is only used for U-Boot, but not for SPL which will\n> comes later, maybe after we merge all the common code into a common\n> file.\n>\n> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>\n> ---\n>\n> drivers/ram/rockchip/Makefile       |  1 +\n> drivers/ram/rockchip/sdram_rk3128.c | 60 +++++++++++++++++++++++++++++++++++++\n> 2 files changed, 61 insertions(+)\n> create mode 100644 drivers/ram/rockchip/sdram_rk3128.c\n>\n> diff --git a/drivers/ram/rockchip/Makefile b/drivers/ram/rockchip/Makefile\n> index 45b5fe7..1a1e557 100644\n> --- a/drivers/ram/rockchip/Makefile\n> +++ b/drivers/ram/rockchip/Makefile\n> @@ -5,6 +5,7 @@\n> #\n>\n> obj-$(CONFIG_ROCKCHIP_RK3368) = dmc-rk3368.o\n> +obj-$(CONFIG_ROCKCHIP_RK3128) = sdram_rk3128.o\n> obj-$(CONFIG_ROCKCHIP_RK3188) = sdram_rk3188.o\n> obj-$(CONFIG_ROCKCHIP_RK322X) = sdram_rk322x.o\n> obj-$(CONFIG_ROCKCHIP_RK3288) = sdram_rk3288.o\n> diff --git a/drivers/ram/rockchip/sdram_rk3128.c b/drivers/ram/rockchip/sdram_rk3128.c\n> new file mode 100644\n> index 0000000..04ad2bb\n> --- /dev/null\n> +++ b/drivers/ram/rockchip/sdram_rk3128.c\n> @@ -0,0 +1,60 @@\n> +/*\n> + * (C) Copyright 2017 Rockchip Electronics Co., Ltd.\n> + *\n> + * SPDX-License-Identifier:     GPL-2.0\n> + */\n> +\n> +#include <common.h>\n> +#include <dm.h>\n> +#include <ram.h>\n> +#include <syscon.h>\n> +#include <asm/arch/clock.h>\n> +#include <asm/arch/grf_rk3128.h>\n> +#include <asm/arch/sdram_common.h>\n> +\n> +DECLARE_GLOBAL_DATA_PTR;\n> +struct dram_info {\n> +\tstruct ram_info info;\n> +\tstruct rk3128_grf *grf;\n> +};\n> +\n> +static int rk3128_dmc_probe(struct udevice *dev)\n> +{\n> +\tstruct dram_info *priv = dev_get_priv(dev);\n> +\n> +\tpriv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);\n> +\tprintf(\"%s: grf=%p\\n\", __func__, priv->grf);\n> +\tpriv->info.base = CONFIG_SYS_SDRAM_BASE;\n> +\tpriv->info.size = rockchip_sdram_size(\n> +\t\t\t\t(phys_addr_t)&priv->grf->os_reg[1]);\n\nCan we make this into a common driver for devices that are not supported \nby SPL yet (or for people that want to use the miniloader)?\n\nTo make this chip-independent, we just need to export the OS_REG via \nsyscon or regmap... e.g allowing a regmap_read on the OS_REG region for \neach chip.\n\n> +\n> +\treturn 0;\n> +}\n> +\n> +static int rk3128_dmc_get_info(struct udevice *dev, struct ram_info *info)\n> +{\n> +\tstruct dram_info *priv = dev_get_priv(dev);\n> +\n> +\t*info = priv->info;\n> +\n> +\treturn 0;\n> +}\n> +\n> +static struct ram_ops rk3128_dmc_ops = {\n> +\t.get_info = rk3128_dmc_get_info,\n> +};\n> +\n> +\n> +static const struct udevice_id rk3128_dmc_ids[] = {\n> +\t{ .compatible = \"rockchip,rk3128-dmc\" },\n> +\t{ }\n> +};\n> +\n> +U_BOOT_DRIVER(dmc_rk3128) = {\n> +\t.name = \"rockchip_rk3128_dmc\",\n> +\t.id = UCLASS_RAM,\n> +\t.of_match = rk3128_dmc_ids,\n> +\t.ops = &rk3128_dmc_ops,\n> +\t.probe = rk3128_dmc_probe,\n> +\t.priv_auto_alloc_size = sizeof(struct dram_info),\n> +};\n>","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y7mGk0nd7z9t4R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  6 Oct 2017 21:34:38 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid E0D35C21DB5; Fri,  6 Oct 2017 10:34:34 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 41414C21C40;\n\tFri,  6 Oct 2017 10:34:32 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 39EFEC21C40; Fri,  6 Oct 2017 10:34:30 +0000 (UTC)","from mail.theobroma-systems.com (vegas.theobroma-systems.com\n\t[144.76.126.164])\n\tby lists.denx.de (Postfix) with ESMTPS id ED62BC21C3F\n\tfor <u-boot@lists.denx.de>; Fri,  6 Oct 2017 10:34:29 +0000 (UTC)","from [86.59.122.178] (port=51530 helo=android.lan)\n\tby mail.theobroma-systems.com with esmtps\n\t(TLS1.2:RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.80) (envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1e0Pxc-0004py-Cf; Fri, 06 Oct 2017 12:34:28 +0200","from [10.11.0.14] (helo=vpn-10-11-0-14.lan)\n\tby android.lan with esmtp (Exim 4.84_2)\n\t(envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1e0Pxb-000Fkt-RC; Fri, 06 Oct 2017 12:34:28 +0200"],"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=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","Date":"Fri, 6 Oct 2017 12:34:25 +0200 (CEST)","From":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","X-X-Sender":"ptomsich@vpn-10-11-0-14.lan","To":"Kever Yang <kever.yang@rock-chips.com>","In-Reply-To":"<1506515969-1472-9-git-send-email-kever.yang@rock-chips.com>","Message-ID":"<alpine.OSX.2.21.1710061230280.20491@vpn-10-11-0-14.lan>","References":"<1506515969-1472-9-git-send-email-kever.yang@rock-chips.com>","User-Agent":"Alpine 2.21 (OSX 202 2017-01-01)","MIME-Version":"1.0","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [U-Boot,8/8] rockchip: rk3128: add sdram driver","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-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1781752,"web_url":"http://patchwork.ozlabs.org/comment/1781752/","msgid":"<E1e0UuR-000576-7E@mail.theobroma-systems.com>","list_archive_url":null,"date":"2017-10-06T15:51:31","subject":"Re: [U-Boot] [U-Boot,8/8] rockchip: rk3128: add sdram driver","submitter":{"id":53488,"url":"http://patchwork.ozlabs.org/api/people/53488/","name":"Philipp Tomsich","email":"philipp.tomsich@theobroma-systems.com"},"content":"> RK3128 support up to 2GB DDR3 sdram, one channel, 32bit data width.\n> \n> This patch is only used for U-Boot, but not for SPL which will\n> comes later, maybe after we merge all the common code into a common\n> file.\n> \n> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>\n> ---\n> \n>  drivers/ram/rockchip/Makefile       |  1 +\n>  drivers/ram/rockchip/sdram_rk3128.c | 60 +++++++++++++++++++++++++++++++++++++\n>  2 files changed, 61 insertions(+)\n>  create mode 100644 drivers/ram/rockchip/sdram_rk3128.c\n> \n\nAcked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","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>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y7vMy1RZsz9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  7 Oct 2017 02:54:38 +1100 (AEDT)","by lists.denx.de (Postfix, from userid 105)\n\tid 021E8C21DDA; Fri,  6 Oct 2017 15:52:56 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 19541C21E24;\n\tFri,  6 Oct 2017 15:51:42 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 815DEC21E14; Fri,  6 Oct 2017 15:51:35 +0000 (UTC)","from mail.theobroma-systems.com (vegas.theobroma-systems.com\n\t[144.76.126.164])\n\tby lists.denx.de (Postfix) with ESMTPS id 1ABDFC21D82\n\tfor <u-boot@lists.denx.de>; Fri,  6 Oct 2017 15:51:32 +0000 (UTC)","from 89-104-28-141.customer.bnet.at ([89.104.28.141]:51590\n\thelo=vpn-10-11-0-14.lan) by mail.theobroma-systems.com with esmtpsa\n\t(TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80)\n\t(envelope-from <philipp.tomsich@theobroma-systems.com>)\n\tid 1e0UuR-000576-7E; Fri, 06 Oct 2017 17:51:31 +0200"],"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=none autolearn=unavailable\n\tautolearn_force=no version=3.4.0","MIME-Version":"1.0","From":"Philipp Tomsich <philipp.tomsich@theobroma-systems.com>","To":"Kever Yang <kever.yang@rock-chips.com>","In-Reply-To":"<1506515969-1472-9-git-send-email-kever.yang@rock-chips.com>","References":"<1506515969-1472-9-git-send-email-kever.yang@rock-chips.com>","Message-Id":"<E1e0UuR-000576-7E@mail.theobroma-systems.com>","Date":"Fri, 06 Oct 2017 17:51:31 +0200","Cc":"u-boot@lists.denx.de","Subject":"Re: [U-Boot] [U-Boot,8/8] rockchip: rk3128: add sdram driver","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>"}}]