From patchwork Thu Jul 19 07:28:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142329 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1422890ljj; Thu, 19 Jul 2018 00:32:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdXEk2jkXLX49g/PLYOi9RB0P7n7VcRoj2mfPMyxsPKl3GCK2dk5NtYrjhFOh6aClK40BJ3 X-Received: by 2002:a50:a0c5:: with SMTP id 63-v6mr9698655edo.47.1531985523221; Thu, 19 Jul 2018 00:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985523; cv=none; d=google.com; s=arc-20160816; b=CR7FtEyHMTBebocQECHR5TyQs9uV1NzrQ84Jv0dOfvcGRC1QpxPKAIaAqBYxZBEpgS l4BCfY/Y1lUTKiT3JOXt2UN1xRAZi1eWcqoYkJdkMFqtYm465v6fo9oBj4kgJ1iPWnEz n3CiK5n3yHqrH34PvyT6/73SyFUuUEKQm+ZUbKIBt7zlynL3DB74twcswOxj8AIAXnnS VuFEnt7hDsKJrVqcfab1sVRP6B5qEilTmbBoGwy9Pi3sW3Z77jxzr1k97tYbQ567D5EW XRspm/58F8M2rop1IbMoEfck7DCxgIPkRQwCaRcuKua1G0ug8hCl/YOrLItQTHEIIrh7 JLow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :dkim-filter:arc-authentication-results; bh=LDZ6lRagXoRY/MoEYgKgO958rAWdhbESzI9xwz/yT1E=; b=Q6Z/TVViwfD1/eROHuN3uFP8s8QDHPZkZXVrkmqvGhXQ7mIcTbjOrIrNCYntiCBgZY 1QctY1SfmWVqm+mJZko9UzVt4i4wkxTY/f1twquztAWGTrkjKX1cHhaooFPBnmN8fRfW nBiBuVAZtpIXNCBgXAhmOUMxLvYCPW8R35BI5A72gjunFv5vLLg6w5/1boBn9IqMlwzA k028DeNNmB09UA9oaO2w7bpz7wTRPPARLLaMOitQh1KDEWzEdO78KFEUuf5yC8Z++dNG sPFirutLb+9gxs6EgA+XaFvAACji5IYHtpA0Y7iOowv1Ncm7CmTpNqh6znRDrRWmFfIx jTFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=QsKmU90Z; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id u42-v6si3294127edm.404.2018.07.19.00.32.02; Thu, 19 Jul 2018 00:32:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=QsKmU90Z; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id CB897C21F8A; Thu, 19 Jul 2018 07:29:22 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 302A4C21F8A; Thu, 19 Jul 2018 07:29:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 26EA2C21F90; Thu, 19 Jul 2018 07:28:54 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id A17CFC21FBC for ; Thu, 19 Jul 2018 07:28:50 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUA021119; Thu, 19 Jul 2018 16:28:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUA021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985310; bh=Ad+htyda3ZHwE8Td1syrn18so8MN2HoRWj2taPJzkdw=; h=From:To:Cc:Subject:Date:From; b=QsKmU90ZaywgAgMAVB8u/FAbq1Bzok40uE5gBzqcHkAWTL4SO0k2Oo5f17PhfPmcs Yg5+Ryird8cOvO9qsFB5AGBvZpMXAGK1l4KT27W+atL71cP6mixkgiXHMj5zac6mZQ yVCnTu/Zt+1g8c/Thj7KG06G0Nf2oerh2rFeT40I9Ke+hvbrlDwFEwLHZxtDzBmJKb UAATW4cAqOe0n+RNR8hTcTbdiXWXctZ43/uQdoFbT0xWF+TzA1ws4aI3YcTuT55qEB tP21CDr5nxtRVQh8g4mYRY8pR4z3Gtzl/uL5idMfw+GF7jaHOAyoSFD2VUKw7UvbuH zS+hcuAqQmJLw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:22 +0900 Message-Id: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH 1/6] fdt_support: make fdt_fixup_mtdparts() prototype more specific X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The second argument of fdt_fixup_mtdparts() is an opaque pointer, 'void *node_info', hence callers can pass any pointer. Obviously, fdt_fixup_mtdparts() expects 'struct node_info *' otherwise, it crashes run-time. Change the prototype so that it is compile-time checked. Also, add 'const' qualifier to it so that callers can constify the struct node_info arrays. Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass --- common/fdt_support.c | 13 +++++++------ include/fdt_support.h | 11 ++++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 812eca8..3b31f3d 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -893,9 +893,9 @@ err_prop: * * fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); */ -void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size) +void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, + int node_info_size) { - struct node_info *ni = node_info; struct mtd_device *dev; int i, idx; int noff; @@ -905,12 +905,13 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size) for (i = 0; i < node_info_size; i++) { idx = 0; - noff = fdt_node_offset_by_compatible(blob, -1, ni[i].compat); + noff = fdt_node_offset_by_compatible(blob, -1, + node_info[i].compat); while (noff != -FDT_ERR_NOTFOUND) { debug("%s: %s, mtd dev type %d\n", fdt_get_name(blob, noff, 0), - ni[i].compat, ni[i].type); - dev = device_find(ni[i].type, idx++); + node_info[i].compat, node_info[i].type); + dev = device_find(node_info[i].type, idx++); if (dev) { if (fdt_node_set_part_info(blob, noff, dev)) return; /* return on error */ @@ -918,7 +919,7 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size) /* Jump to next flash node */ noff = fdt_node_offset_by_compatible(blob, noff, - ni[i].compat); + node_info[i].compat); } } } diff --git a/include/fdt_support.h b/include/fdt_support.h index a9a0078..27fe564 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -205,11 +205,16 @@ int fdt_increase_size(void *fdt, int add_len); int fdt_fixup_nor_flash_size(void *blob); +struct node_info; #if defined(CONFIG_FDT_FIXUP_PARTITIONS) -void fdt_fixup_mtdparts(void *fdt, void *node_info, int node_info_size); +void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info, + int node_info_size); #else -static inline void fdt_fixup_mtdparts(void *fdt, void *node_info, - int node_info_size) {} +static inline void fdt_fixup_mtdparts(void *fdt, + const struct node_info *node_info, + int node_info_size) +{ +} #endif void fdt_del_node_and_alias(void *blob, const char *alias); From patchwork Thu Jul 19 07:28:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142330 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1423440ljj; Thu, 19 Jul 2018 00:32:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6XaC0RTYXL/5QtBuwQBWVvGCKMOTMD96/HsaT0OhoeGYv/INP8mVvVDj/5/iP58qvcJSK X-Received: by 2002:a50:8fe6:: with SMTP id y93-v6mr10280321edy.290.1531985563082; Thu, 19 Jul 2018 00:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985563; cv=none; d=google.com; s=arc-20160816; b=kFQZGnhZYm8pzWBodtjueX6LBDIvNra6brldOyGWJddOmqnt1YWVJWdB4NbJUAv3Sp 8J6zCm9LyklmAn+eZP3pSEY5+aMfhsBRUXqp93o0e2YZQCrjtZ8pP2cO6QurHPO7piGB dZuwUKYKwr3PoL2P+kBVCSEaTKFPcnmhjNZ0CftVOvY/U8QK8dVrPiKruRxqWyKZ2WZu sNGx64mueLpU9fFoeWKa6QLcW93w5mM2IA6oBqocARWIu0jNsrrPJ02CvX0EhrikuJOO JytCoyz4Z/dITIdlr70NzJA+HWeUdFd6B6Irc/DT0nSjinyPHWCPS1Oi/tYVzEubtnW3 PGMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=7qxGd6TGVJpWCYXpDIpOnvbEjlHrPVgVggLoK+kr8W8=; b=lyVdwzinC44quF01+ANhNxnXNwXs4ukOiruiJM3Q9xhYjsp4QT6LfoYYZltv4KWfun T7PQiU07VJm2rFOQ+OdupSMuylpcYm9RmlrhKPNHc0Iwl+kHVPmrRfzeqHLpGkLzUuhh dGOXFbyRV0Xn4ygbzy6Gq6nfKdYmCflvfp36aGSgt8JRSA0AVJ/JsBtUsQyVVjF34XJE 3J1vNBihKe0HH0Z5VV7OlMDyxV0yQjXeRDQh8MikgHSJ0RJiQfa1sHWrdfLGEQ5rCU0r SNI8uWlcMcRQIAkUY7FNEcKaoq+gLQNJzF4ovOZPWoQ5oYdQbpTZJGhTM4XbOT/d5Z6l IymQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Akfc97yb; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id e15-v6si432258edr.447.2018.07.19.00.32.42; Thu, 19 Jul 2018 00:32:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Akfc97yb; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id A79FBC21FCD; Thu, 19 Jul 2018 07:30:33 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 68F34C21FA5; Thu, 19 Jul 2018 07:30:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 360C5C21FA5; Thu, 19 Jul 2018 07:29:02 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id C00EFC21FC0 for ; Thu, 19 Jul 2018 07:29:01 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUB021119; Thu, 19 Jul 2018 16:28:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUB021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985311; bh=WC28ofTFnd+Vf5rHtnrMhnOd1EORIS2edQzejI++AEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Akfc97yb5BFhI5yMj79WmErbxopCV3Uvhsz6C3ExPyjPb9xnMO0XqP3YrkNYmxXxK 94/s3Ty9kmhsyYk4m0uyYGqcHxnWiN8XDR2FBSTCq/dfC2EevBAn/cu3+7k80dt1C0 GwD/BkBomn8xbvUBS9c6dX2yFqYhUXPUWAF1EV3MreZTdCy8g67tzxhl/NTfw3RV6/ MJ1ezCMSDVPX1MjqsJLodPDmi2RcWVVkDHR9KMvDmXymU4IYbzMeo5P+1j9JJtAzNI mJ7E/VoOjqMddxQFcBmdi6T7dle9ak16H7B4rzNRedWsxKU7ORrePRnbDobUdR32yC TKKJ+5nnQlgXA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:23 +0900 Message-Id: <1531985307-4208-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> References: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> Cc: Nikita Kiryanov , Stefan Agner , Naveen Burmi Subject: [U-Boot] [PATCH 2/6] board: constify struct node_info array X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add 'const' (also 'static' in some places) to struct node_info arrays to save memory footprint. Signed-off-by: Masahiro Yamada --- board/CarMediaLab/flea3/flea3.c | 2 +- board/compulab/cm_fx6/cm_fx6.c | 2 +- board/freescale/bsc9131rdb/bsc9131rdb.c | 2 +- board/freescale/bsc9132qds/bsc9132qds.c | 2 +- board/gateworks/gw_ventana/gw_ventana.c | 2 +- board/isee/igep003x/board.c | 2 +- board/isee/igep00x0/igep00x0.c | 2 +- board/toradex/colibri_imx7/colibri_imx7.c | 2 +- board/toradex/colibri_vf/colibri_vf.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/board/CarMediaLab/flea3/flea3.c b/board/CarMediaLab/flea3/flea3.c index c0f33b8..9eec1b7 100644 --- a/board/CarMediaLab/flea3/flea3.c +++ b/board/CarMediaLab/flea3/flea3.c @@ -205,7 +205,7 @@ u32 get_board_rev(void) */ int ft_board_setup(void *blob, bd_t *bd) { - struct node_info nodes[] = { + static const struct node_info nodes[] = { { "physmap-flash.0", MTD_DEV_TYPE_NOR, }, /* NOR flash */ { "mxc_nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index c114cdc..d42f57d 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -519,7 +519,7 @@ int cm_fx6_setup_ecspi(void) { return 0; } #ifdef CONFIG_OF_BOARD_SETUP #define USDHC3_PATH "/soc/aips-bus@02100000/usdhc@02198000/" -struct node_info nodes[] = { +static const struct node_info nodes[] = { /* * Both entries target the same flash chip. The st,m25p compatible * is used in the vendor device trees, while upstream uses (the diff --git a/board/freescale/bsc9131rdb/bsc9131rdb.c b/board/freescale/bsc9131rdb/bsc9131rdb.c index 367152f..9d9c83f 100644 --- a/board/freescale/bsc9131rdb/bsc9131rdb.c +++ b/board/freescale/bsc9131rdb/bsc9131rdb.c @@ -53,7 +53,7 @@ int checkboard(void) #if defined(CONFIG_OF_BOARD_SETUP) #ifdef CONFIG_FDT_FIXUP_PARTITIONS -struct node_info nodes[] = { +static const struct node_info nodes[] = { { "fsl,ifc-nand", MTD_DEV_TYPE_NAND, }, }; #endif diff --git a/board/freescale/bsc9132qds/bsc9132qds.c b/board/freescale/bsc9132qds/bsc9132qds.c index 6885668..36a5528 100644 --- a/board/freescale/bsc9132qds/bsc9132qds.c +++ b/board/freescale/bsc9132qds/bsc9132qds.c @@ -357,7 +357,7 @@ void fdt_del_node_compat(void *blob, const char *compatible) #if defined(CONFIG_OF_BOARD_SETUP) #ifdef CONFIG_FDT_FIXUP_PARTITIONS -struct node_info nodes[] = { +static const struct node_info nodes[] = { { "cfi-flash", MTD_DEV_TYPE_NOR, }, { "fsl,ifc-nand", MTD_DEV_TYPE_NAND, }, }; diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index b86924e..c4ec974 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -1114,7 +1114,7 @@ int ft_board_setup(void *blob, bd_t *bd) { struct ventana_board_info *info = &ventana_info; struct ventana_eeprom_config *cfg; - struct node_info nodes[] = { + static const struct node_info nodes[] = { { "sst,w25q256", MTD_DEV_TYPE_NOR, }, /* SPI flash */ { "fsl,imx6q-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; diff --git a/board/isee/igep003x/board.c b/board/isee/igep003x/board.c index cc55bcc..965a009 100644 --- a/board/isee/igep003x/board.c +++ b/board/isee/igep003x/board.c @@ -211,7 +211,7 @@ int board_late_init(void) int ft_board_setup(void *blob, bd_t *bd) { #ifdef CONFIG_FDT_FIXUP_PARTITIONS - static struct node_info nodes[] = { + static const struct node_info nodes[] = { { "ti,omap2-nand", MTD_DEV_TYPE_NAND, }, }; diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 45a414c..367af82 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -157,7 +157,7 @@ static int ft_enable_by_compatible(void *blob, char *compat, int enable) int ft_board_setup(void *blob, bd_t *bd) { #ifdef CONFIG_FDT_FIXUP_PARTITIONS - static struct node_info nodes[] = { + static const struct node_info nodes[] = { { "ti,omap2-nand", MTD_DEV_TYPE_NAND, }, { "ti,omap2-onenand", MTD_DEV_TYPE_ONENAND, }, }; diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index cd98ec8..c05ca0c 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -408,7 +408,7 @@ int checkboard(void) int ft_board_setup(void *blob, bd_t *bd) { #if defined(CONFIG_FDT_FIXUP_PARTITIONS) - static struct node_info nodes[] = { + static const struct node_info nodes[] = { { "fsl,imx7d-gpmi-nand", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c index 83c3503..4db1757 100644 --- a/board/toradex/colibri_vf/colibri_vf.c +++ b/board/toradex/colibri_vf/colibri_vf.c @@ -580,7 +580,7 @@ int ft_board_setup(void *blob, bd_t *bd) { int ret = 0; #ifdef CONFIG_FDT_FIXUP_PARTITIONS - static struct node_info nodes[] = { + static const struct node_info nodes[] = { { "fsl,vf610-nfc", MTD_DEV_TYPE_NAND, }, /* NAND flash */ }; From patchwork Thu Jul 19 07:28:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142326 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1421849ljj; Thu, 19 Jul 2018 00:30:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeC49PvUZJR7flYjYqmHmAPJ3757pYdh3AInUtjxpDdCAMvzK08gFR/dwBXSz/GSsL2fGT5 X-Received: by 2002:a50:ac65:: with SMTP id w34-v6mr10276133edc.211.1531985459885; Thu, 19 Jul 2018 00:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985459; cv=none; d=google.com; s=arc-20160816; b=ThocQSl8fP5we1K0MK3ZQYDH7nSOpk0GVnVPvTiAyXZXdRjYVk4UZDvt8xhKi+XIt6 uSINI6xTw7fY7rmzBGj5b530+PdYce+XA8RgaLFRYCqjysRn4BSK7fr82JhMucC2iWYr SfVmFrbByrIMOJOG5Wi/NlIFS9y4CUBk8u8BZB9VFXr54Iqb6g7MmfM63+KEALc24IUl SXT89ZCyZudz3DU5Z9gr/ldiijgdkMIUzrFnmzPbfCVy1dGIQThtJbmvq+hjIqpTQFjt j8z5PiUVTF8Mf+aqAi+XZGpH3S2SCPxswpKaW9gAF2awsrQTfjLQpUuRLr5e3yoMNMhC 2cbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=YUtHCbKpRkjBuQ0EuAJLPOOHz0ixMfrJArJQHh3IX8Q=; b=rDzi+CbR9CmpU9Aoyd2TBV4nn+IU5v0SXz8jdF+wafU+fqpRDxq0MPQatZkZKTNoNh L8W4ZKaCJaIC6TPatEhvZM973tOk4iXjaOJd0v90o3+CNlvcTpVeaW46cJwbBEHTurfC mhxPydF/THzU13g0IBbl3AsXxQlnoEKVpIpWuLqGXxx6bcGaSwOcMW4zbFjoj+zPwJgN dKjSoENR5lJ1v6eOAPD4etFEndQx6EleP57+rsy0+oylv7zTA5ey0wT35+b4mjj+HyTp wXM0sK5hjIxX3Vsm9O+eY/y+KR0+5BYYJJv38p0O1bKM3gxxolbWKTZH0gUrAgTTZ1WM nL5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=GFpPTj38; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id z18-v6si201064edc.424.2018.07.19.00.30.59; Thu, 19 Jul 2018 00:30:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=GFpPTj38; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 5C639C21FD0; Thu, 19 Jul 2018 07:30:14 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5F3B3C21FD1; Thu, 19 Jul 2018 07:29:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C0CAC21FD1; Thu, 19 Jul 2018 07:28:54 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id A966EC21FC2 for ; Thu, 19 Jul 2018 07:28:50 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUC021119; Thu, 19 Jul 2018 16:28:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUC021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985311; bh=OcgApAE7moeUUmWsG7Z9kFKONq+qHFOBR5jy4NcOsdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFpPTj38snHMdcp7KPSflPK1o6SLD99W5VWzbrQD66atjoZO0K1eR2c5VojLIziMQ ogsaEwCiFtZkHRPii8+Gyj7KXXAiGXx84TbgnxjJ+1xpTQRgnHuCwVJUqGXWRSInkF Mn27YZGTlShxztPoG52eM9zUZuyv0XZdQgxkLVHE14Ru0yNgKxndB3YOYq/AzBWm93 31nCMKYaF7iuwSR2SpLWJr7yDUx1+B3w6kWuoRaySWB2HeOyG3ZA/8MP2DnDD50cMi Q0ehyGpFqL7PZFd2LJOszlx/e/BBiqkk5P+dX7sBhenOz0uAzRSagus1HD1YIIAPx/ C1hni02Je6BbQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:24 +0900 Message-Id: <1531985307-4208-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> References: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH 3/6] ARM: uniphier: clean-up ft_board_setup() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The 'bd' is passed in ft_board_setup() as the second argument. Replace 'gd->bd' with 'bd'. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/dram_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index 2eb4836..8aa3f81 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -279,11 +279,11 @@ int ft_board_setup(void *fdt, bd_t *bd) if (uniphier_get_soc_id() != UNIPHIER_LD20_ID) return 0; - for (i = 0; i < ARRAY_SIZE(gd->bd->bi_dram); i++) { - if (!gd->bd->bi_dram[i].size) + for (i = 0; i < ARRAY_SIZE(bd->bi_dram); i++) { + if (!bd->bi_dram[i].size) continue; - rsv_addr = gd->bd->bi_dram[i].start + gd->bd->bi_dram[i].size; + rsv_addr = bd->bi_dram[i].start + bd->bi_dram[i].size; rsv_addr -= rsv_size; ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size); From patchwork Thu Jul 19 07:28:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142327 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1421861ljj; Thu, 19 Jul 2018 00:31:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpey+5M9YVdnfABYjWw6iObiI7U+mkAp3pmeuXfGk1B/gMOcC9mVAUc+XfHCWpWKVZ71hj0u X-Received: by 2002:a50:9182:: with SMTP id g2-v6mr10352132eda.24.1531985460693; Thu, 19 Jul 2018 00:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985460; cv=none; d=google.com; s=arc-20160816; b=lpZiw4K9FOEP7vQT1a9JvOnnTNLxJX0PtqePiczdZ4Ok8tF1Uozm5OoaP8q/Z6iAmw zeU+DpBJJqE+8YwRlItaSkICWR5/p42lL7ldDdtuwDu+7dn9KDsvOUOIlS4DOqnPFCVw ooLRGrWQj7isGMy7Utrz7mvOu09l33F2g1USY6Gfvxqsb7w8wSSqvqKJL7QbpjM2zFu8 wSV1BKSEVnyG8AaM6rYRjB2QcgMDR3tsQN9l/6wyicvYT3uhm9FwzCHtN/H8bI4u9Srx 4Jdiy8sv3FghlPZJmryYMJD+imlTy5AXXQtKCJQeD9+8jY5qPyv9gfZTFaBA5I0Fyjca 7Z8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=hTwR42VsPWWgvPGuq9L3AfqlZbQHJH39oP+mFVkiR3Q=; b=phweBC3Sm2A1ecP3GNmJraGwdLVVo3TGebTUalkCkTZVS4yaATTs7t8Ues45cCo4Bk pgbqQ1nUBZWNDx6BbPWMwIIhc8lAaDOAi9w/bUD32LN/8k8pJKQAX3TR8lUhPaD2/AT8 pEBm5sBDUxIDO7PBby6GDcC2Q9RIMhaPKUAUH/hf4CR0B9eEUk3QgtNiQow7jp78ugPT 81PqPL7GYhpal4rieFOMClZQ4RiB00XDQC6hO41V+yRJaNRtehQ8TITh4wCkxe9Bu5id 9rsWgWehFs6+begUKqttCumqsGsxEXyD9giyCMdzrjvZOSMXxj74sM+sTSXqPRzN4OCK Ph/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=OfEvmFIr; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f5-v6si669374edj.330.2018.07.19.00.31.00; Thu, 19 Jul 2018 00:31:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=OfEvmFIr; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 44DE3C21FBC; Thu, 19 Jul 2018 07:29:38 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 28FF8C21FCE; Thu, 19 Jul 2018 07:29:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D9413C21FCD; Thu, 19 Jul 2018 07:28:54 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id A4ACAC21FC0 for ; Thu, 19 Jul 2018 07:28:50 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUD021119; Thu, 19 Jul 2018 16:28:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUD021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985312; bh=8EB8NGqNlf60UZIcPm9BXGLzAh6/Zx9YtPnJBt6po7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfEvmFIrRgmdjL8aWdA7/3xW5nA0KDz/TCh9r3dpAd2K+13AwcWqp7RNBWxECUBEz SF7BdEyBCm3OwJIF1EmrpbP1yRiSSNQVUwV2iElCdnzvo6TLTPJ8dvseh5BP60EAXB 4HxbLSBSNz3Rcb53fMD5ABBEbkJPG4N4/Z+g655sbiM/gw05Qa9+KuA356qhL723RV p5BSFMETNL06+Dhcf/CKDdB//WP95cHE1uakNRL31nMd5anuBD3DpzKFKh9/y2DB3V 8vRLfLbGOgbytJFMUmf2P3V1/+fHQTAbFdTlaftnU4PWcJj+tvTSBCix8iB+tkzhk1 y29pL8Bb4jVTg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:25 +0900 Message-Id: <1531985307-4208-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> References: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH 4/6] ARM: uniphier: split ft_board_setup() out to a separate file X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Prepare to add more fdt fixup code. Signed-off-by: Masahiro Yamada --- arch/arm/Kconfig | 1 + arch/arm/mach-uniphier/Kconfig | 1 - arch/arm/mach-uniphier/Makefile | 1 + arch/arm/mach-uniphier/dram_init.c | 35 ------------------------ arch/arm/mach-uniphier/fdt-fixup.c | 56 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 36 deletions(-) create mode 100644 arch/arm/mach-uniphier/fdt-fixup.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5b3746c..ebd7c9a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1221,6 +1221,7 @@ config ARCH_UNIPHIER select DM_RESET select DM_SERIAL select DM_USB + select OF_BOARD_SETUP select OF_CONTROL select OF_LIBFDT select PINCTRL diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig index 91bea77..c199374 100644 --- a/arch/arm/mach-uniphier/Kconfig +++ b/arch/arm/mach-uniphier/Kconfig @@ -68,7 +68,6 @@ config ARCH_UNIPHIER_LD11 config ARCH_UNIPHIER_LD20 bool "Enable UniPhier LD20 SoC support" depends on ARCH_UNIPHIER_V8_MULTI - select OF_BOARD_SETUP default y config ARCH_UNIPHIER_PXS3 diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile index 269c51b..d0c39d42 100644 --- a/arch/arm/mach-uniphier/Makefile +++ b/arch/arm/mach-uniphier/Makefile @@ -21,6 +21,7 @@ endif obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ micro-support-card.o obj-y += pinctrl-glue.o obj-$(CONFIG_MMC) += mmc-first-dev.o +obj-y += fdt-fixup.o endif diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index 8aa3f81..7e7c1d9 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -6,8 +6,6 @@ */ #include -#include -#include #include #include #include @@ -264,36 +262,3 @@ int dram_init_banksize(void) return 0; } - -#ifdef CONFIG_OF_BOARD_SETUP -/* - * The DRAM PHY requires 64 byte scratch area in each DRAM channel - * for its dynamic PHY training feature. - */ -int ft_board_setup(void *fdt, bd_t *bd) -{ - unsigned long rsv_addr; - const unsigned long rsv_size = 64; - int i, ret; - - if (uniphier_get_soc_id() != UNIPHIER_LD20_ID) - return 0; - - for (i = 0; i < ARRAY_SIZE(bd->bi_dram); i++) { - if (!bd->bi_dram[i].size) - continue; - - rsv_addr = bd->bi_dram[i].start + bd->bi_dram[i].size; - rsv_addr -= rsv_size; - - ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size); - if (ret) - return -ENOSPC; - - pr_notice(" Reserved memory region for DRAM PHY training: addr=%lx size=%lx\n", - rsv_addr, rsv_size); - } - - return 0; -} -#endif diff --git a/arch/arm/mach-uniphier/fdt-fixup.c b/arch/arm/mach-uniphier/fdt-fixup.c new file mode 100644 index 0000000..022e442 --- /dev/null +++ b/arch/arm/mach-uniphier/fdt-fixup.c @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016-2018 Socionext Inc. + * Author: Masahiro Yamada + */ + +#include +#include +#include +#include +#include + +#include "soc-info.h" + +/* + * The DRAM PHY requires 64 byte scratch area in each DRAM channel + * for its dynamic PHY training feature. + */ +static int uniphier_ld20_fdt_mem_rsv(void *fdt, bd_t *bd) +{ + unsigned long rsv_addr; + const unsigned long rsv_size = 64; + int i, ret; + + if (!IS_ENABLED(CONFIG_ARCH_UNIPHIER_LD20) || + uniphier_get_soc_id() != UNIPHIER_LD20_ID) + return 0; + + for (i = 0; i < ARRAY_SIZE(bd->bi_dram); i++) { + if (!bd->bi_dram[i].size) + continue; + + rsv_addr = bd->bi_dram[i].start + bd->bi_dram[i].size; + rsv_addr -= rsv_size; + + ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size); + if (ret) + return -ENOSPC; + + pr_notice(" Reserved memory region for DRAM PHY training: addr=%lx size=%lx\n", + rsv_addr, rsv_size); + } + + return 0; +} + +int ft_board_setup(void *fdt, bd_t *bd) +{ + int ret; + + ret = uniphier_ld20_fdt_mem_rsv(fdt, bd); + if (ret) + return ret; + + return 0; +} From patchwork Thu Jul 19 07:28:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142328 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1421908ljj; Thu, 19 Jul 2018 00:31:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc0IW20rEadRREnRhw/e/FkLutKyWv34dXyfvr4cyAu+8EIxupDt5TsnJh1uliGphTExbHT X-Received: by 2002:a50:8dcb:: with SMTP id s11-v6mr9691920edh.86.1531985462829; Thu, 19 Jul 2018 00:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985462; cv=none; d=google.com; s=arc-20160816; b=wcqGu1b//qQC3wPLb4CtPykAUzpScLrA/pec+apRExtLEhSOHYRaIZV6qQjuONXTZn 1TPT7D4BAeh6nilyi0AgbCRmVp7aENRm/wudF0wW1KZk8Aqk/K9Shpt0FOJt4O1Qm0bH oPD55C1SaLTOIrS4wYbTf2hR0Ps8T5tdOX393vmAUt/GV5Gp3sahYsb4XcMz3Mvs/qnt SpDuZwSrbZhfmn+Yn5cFfiOEvr99TwwNiXjKEigdGl2INxs4MLlhKDbD8Y1eVSpE9dr/ E6slcTY++HgKqWq9LdsfckheJvUFxPQOlYQ37EwQthwf+/A49x9ZP9iVU0C8Xln5NQIn iexg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=BnHKBReRykMLI5T6DrLgjKNEDgnRw1c3st9wDc58kAM=; b=NP3gDfTzrALUGowxdd1/2Jg9H7pNaHI3ArgnFJo+Vqf/gwB1/7skzicVpVlFiljZyO GEmAUpdroK/HP8n8aggEJiJOMWU2OUDV6pLQFZGWrVo4VfEPKomWRtKubrqvJ+J0KmZb 3owCwkaYks8cPBN9Cwg5aFy7l+jH44wCLdflcCwanilSI748xh1NCgUomU/FkvLIc8JV ZznwHXm8srwRDex2pwB1DJB/zi0dtY3uQDtvDgeVe1FSBEnp/FobDNsGVzfXwcFMWO3t yf+XYSlRUNm3cZc2Yl3e+PbpuztiLEEASo3FLkDERUislvOTtZSqWbipUSXOaYgSL/xN vN0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=FUsNTp1t; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id h25-v6si812248edh.18.2018.07.19.00.31.02; Thu, 19 Jul 2018 00:31:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=FUsNTp1t; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 69C5BC21BE5; Thu, 19 Jul 2018 07:29:55 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6C30BC21E56; Thu, 19 Jul 2018 07:29:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4F90BC21FCB; Thu, 19 Jul 2018 07:28:54 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id A8CEAC21F9B for ; Thu, 19 Jul 2018 07:28:50 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUE021119; Thu, 19 Jul 2018 16:28:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUE021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985312; bh=u+y7Pp79y3Gz3IcsN4fXWW/2pS5teYRDubLdp2jNftg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUsNTp1tB+riI2kWGiQA/MZOUwF2e+LwRDUiLRmxdOngJ37Hi58T+/XTF8R92Rtgs gJM1xseFXTu47ABAARwaQ083cn5NxTGMVdqzDi9e3/at2baYILQNWUKBSZtyPkKD7e eXce1XYNbRYE9gY6x97O9+D811GJkewaQ2auhZ+oT52cHFqa06cEKzb6lMHa9FeDUs xivgozKszbU6mtlfh5OqvF9TqZQ9rKl3YdiNVoxGM9PULWePkwauCh0oALUe+sHzvR 5DOa7otb0uJf43MvdszYDJsDD21Vnisc5+aNpGpD/XqT/llo4727eaF90MsNqliw8w Gki346FgMZ6sg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:26 +0900 Message-Id: <1531985307-4208-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> References: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH 5/6] ARM: uniphier: support fdt_fixup_mtdparts X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Propagate the "mtdparts" environment variable to the DT passed in to OS. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/fdt-fixup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-uniphier/fdt-fixup.c b/arch/arm/mach-uniphier/fdt-fixup.c index 022e442..6f3c29d 100644 --- a/arch/arm/mach-uniphier/fdt-fixup.c +++ b/arch/arm/mach-uniphier/fdt-fixup.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include @@ -46,8 +48,14 @@ static int uniphier_ld20_fdt_mem_rsv(void *fdt, bd_t *bd) int ft_board_setup(void *fdt, bd_t *bd) { + static const struct node_info nodes[] = { + { "socionext,uniphier-denali-nand-v5a", MTD_DEV_TYPE_NAND }, + { "socionext,uniphier-denali-nand-v5b", MTD_DEV_TYPE_NAND }, + }; int ret; + fdt_fixup_mtdparts(fdt, nodes, ARRAY_SIZE(nodes)); + ret = uniphier_ld20_fdt_mem_rsv(fdt, bd); if (ret) return ret; From patchwork Thu Jul 19 07:28:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 142325 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1420646ljj; Thu, 19 Jul 2018 00:29:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf/g90LOJ6UY3nfOld+M4wVVVf/vIeo3XUwhbCLlJKTiXSc+8ztdPUiW3E88Uy8+5auK2QY X-Received: by 2002:a50:d307:: with SMTP id g7-v6mr10512069edh.221.1531985377963; Thu, 19 Jul 2018 00:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531985377; cv=none; d=google.com; s=arc-20160816; b=z3dge2dwJ4v3yVU9AFSyu6ytYkoRdBHxeDVx67INVweKByFF6U6bSMmZ07+lEbFBgy abzFd91Z/P06AUbC5KWo44Rx/t+bO0P8KxSmz2TaEsMlZcfIX+uNNLUXulCFlqHg4Y/t AwNMM3P3m9UQulOQf2SO6Izy0x3SGiPThYYdv+tVSKcSHiafGzJDp+3Nqz8oQkOUMYZW DgQOYLFFbbTH6dzeQbXao9odGtw7cZQ/tkC6+m17KmPs8a7L3c3c4jzK74Al3YfVmjJJ kK5qP8RQfapxeIzLI602hG5w/TBeEllyTNGUzyyEdLdKRtds3fp30Fi7EAaByt77u4Bt sz8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=KPkHXgTxv/oG5QsYtQd5KG5+/0x5CvozLnWjJBF+kzo=; b=UWyAExTxpZVaBV6+6EvaHoiBloaio3PFPdV+7h/yRZ1yBDr8vrEVHkQ6/li4t9NAAl zG8at3RKnbc4kWIm8qJKTFjDSeagzl3WrAXqnJjES+80bRWWYQY+uaOBmPBGFOsrJTi1 gmmLF2BP9uAkwGB6RMQvGUEOSeJDyVEFVTF+gSGnpDkUslEnMxOjIqG1opbIMEvjgKwK AYUNRc1n4VGHgimCFUCMfEf8RXcYo9s//fEJMsc1ofK/yITKIiE+zWjxT8XfaQmXFXDR eckU4SYjiscMUC1hIATq0Hl6G2gxy/l4h3Sa6ua5BHe4Ol858SX4VZtKeUF7dxqV6VPJ 1OgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=qrmHHLQF; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id g24-v6si3126865edh.209.2018.07.19.00.29.37; Thu, 19 Jul 2018 00:29:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=qrmHHLQF; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 8A26EC21F3C; Thu, 19 Jul 2018 07:29:05 +0000 (UTC) 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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0E5ACC21FB8; Thu, 19 Jul 2018 07:29:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6009FC21FC0; Thu, 19 Jul 2018 07:28:54 +0000 (UTC) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lists.denx.de (Postfix) with ESMTPS id A9FF8C21FC5 for ; Thu, 19 Jul 2018 07:28:50 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w6J7STUF021119; Thu, 19 Jul 2018 16:28:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w6J7STUF021119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1531985313; bh=cUjxMhnRSJIocL51QxVa1ys4fSQ58uGOpBYeSV0qBWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qrmHHLQFjA1qIYQtTrFoK4wGqT6u1e1pQ3ZmjlblDzgNu/tyYjbp5RRdb9cq480t7 WlTTpIHMVBwNqB/4PL4+D1+BvI8BGSjw5quK4Ffw28uPeGckvoJvvjcdsmLzZPndON H+D2o4m79iwhf2ugTvGHoPyQQP+uNEtQznIk9i+/wMYalcY4gni0D8OrJP0bk96CYY s+lkJ/1TFAQIR2lOFckovsx6soWQ1GQ1dMfAqH8PxlMe9CISA4bbs+EABJAJFs310g XnOkpSJIIX1Y1P391icAO2ugAFMal/SpS20WygIDc1bgsFw9tTvnDF2MdepTolY0c1 +wdNfFgMYvbQA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 19 Jul 2018 16:28:27 +0900 Message-Id: <1531985307-4208-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> References: <1531985307-4208-1-git-send-email-yamada.masahiro@socionext.com> Cc: Tom Rini Subject: [U-Boot] [PATCH 6/6] ARM: uniphier: enable MTD partition and UBI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Enable "mtdparts" and "ubi" commands for uniphier_v8_defconfig to use UBI on NAND devices. Enable only "mtdparts" for uniphier_{v7,ld4_sld8}_defconfig because enabling UBI would increase 170KB, which would be memory footprint problem. Signed-off-by: Masahiro Yamada --- configs/uniphier_ld4_sld8_defconfig | 4 ++++ configs/uniphier_v7_defconfig | 4 ++++ configs/uniphier_v8_defconfig | 4 ++++ include/configs/uniphier.h | 1 + 4 files changed, 13 insertions(+) diff --git a/configs/uniphier_ld4_sld8_defconfig b/configs/uniphier_ld4_sld8_defconfig index e5c1deb..225be21 100644 --- a/configs/uniphier_ld4_sld8_defconfig +++ b/configs/uniphier_ld4_sld8_defconfig @@ -31,6 +31,9 @@ CONFIG_CMD_TIME=y # CONFIG_CMD_MISC is not set CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nand0=uniphier-nand.0" +CONFIG_MTDPARTS_DEFAULT="mtdparts=uniphier-nand.0:1m(firmware),-(UBI)" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_NET_RANDOM_ETHADDR=y @@ -52,3 +55,4 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_GENERIC=y CONFIG_USB_STORAGE=y CONFIG_PANIC_HANG=y +CONFIG_FDT_FIXUP_PARTITIONS=y diff --git a/configs/uniphier_v7_defconfig b/configs/uniphier_v7_defconfig index 89b7b4a..c54ee00 100644 --- a/configs/uniphier_v7_defconfig +++ b/configs/uniphier_v7_defconfig @@ -30,6 +30,9 @@ CONFIG_CMD_TIME=y # CONFIG_CMD_MISC is not set CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_MTDPARTS=y +CONFIG_MTDIDS_DEFAULT="nand0=uniphier-nand.0" +CONFIG_MTDPARTS_DEFAULT="mtdparts=uniphier-nand.0:1m(firmware),-(UBI)" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_NET_RANDOM_ETHADDR=y @@ -53,3 +56,4 @@ CONFIG_USB_DWC3=y CONFIG_USB_DWC3_UNIPHIER=y CONFIG_USB_STORAGE=y CONFIG_PANIC_HANG=y +CONFIG_FDT_FIXUP_PARTITIONS=y diff --git a/configs/uniphier_v8_defconfig b/configs/uniphier_v8_defconfig index 93df2f6..67ebde7 100644 --- a/configs/uniphier_v8_defconfig +++ b/configs/uniphier_v8_defconfig @@ -26,6 +26,9 @@ CONFIG_CMD_TIME=y # CONFIG_CMD_MISC is not set CONFIG_CMD_FAT=y CONFIG_CMD_FS_GENERIC=y +CONFIG_MTDIDS_DEFAULT="nand0=uniphier-nand.0" +CONFIG_MTDPARTS_DEFAULT="mtdparts=uniphier-nand.0:1m(firmware),-(UBI)" +CONFIG_CMD_UBI=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_GPIO_UNIPHIER=y CONFIG_MISC=y @@ -53,3 +56,4 @@ CONFIG_USB_DWC3=y CONFIG_USB_DWC3_UNIPHIER=y CONFIG_USB_STORAGE=y CONFIG_PANIC_HANG=y +CONFIG_FDT_FIXUP_PARTITIONS=y diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h index b631f79..49eb18f 100644 --- a/include/configs/uniphier.h +++ b/include/configs/uniphier.h @@ -26,6 +26,7 @@ /* FLASH related */ #define CONFIG_MTD_DEVICE +#define CONFIG_MTD_PARTITIONS #define CONFIG_FLASH_CFI_DRIVER #define CONFIG_SYS_FLASH_CFI