public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 16/17] board: toradex: use get_nand_dev_by_index()
Date: Sat, 11 Feb 2017 01:20:57 +0000	[thread overview]
Message-ID: <1486776056.23828.3.camel@toradex.com> (raw)
In-Reply-To: <20170210202304.20652-17-grygorii.strashko@ti.com>

On Fri, 2017-02-10 at 14:23 -0600, Grygorii Strashko wrote:
> As part of preparation for nand DM conversion the new API has been
> introduced to remove direct access to nand_info array. So, use it
> here
> instead of accessing to nand_info array directly.
> 
> Cc: Lucas Stach <dev@lynxeye.de>
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

Looks reasonable to me.

Reviewed-by:?Marcel Ziswiler <marcel.ziswiler@toradex.com>

> ---
> ?board/toradex/colibri_t20/colibri_t20.c |??2 +-
> ?board/toradex/common/tdx-cfg-block.c????| 12 ++++++++----
> ?2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/board/toradex/colibri_t20/colibri_t20.c
> b/board/toradex/colibri_t20/colibri_t20.c
> index 7d574fb..71b8fd3 100644
> --- a/board/toradex/colibri_t20/colibri_t20.c
> +++ b/board/toradex/colibri_t20/colibri_t20.c
> @@ -69,7 +69,7 @@ int checkboard(void)
> ?{
> ?	printf("Model: Toradex Colibri T20 %dMB V%s\n",
> ?	???????(gd->ram_size == 0x10000000) ? 256 : 512,
> -	???????(nand_info[0]->erasesize >> 10 == 512) ?
> +	???????(get_nand_dev_by_index(0)->erasesize >> 10 == 512) ?
> ?	???????((gd->ram_size == 0x10000000) ? "1.1B" : "1.1C") :
> "1.2A");
> ?
> ?	return 0;
> diff --git a/board/toradex/common/tdx-cfg-block.c
> b/board/toradex/common/tdx-cfg-block.c
> index 0014ce8..7722b92 100644
> --- a/board/toradex/common/tdx-cfg-block.c
> +++ b/board/toradex/common/tdx-cfg-block.c
> @@ -153,8 +153,10 @@ static int read_tdx_cfg_block_from_nand(unsigned
> char *config_block)
> ?	size_t size = TDX_CFG_BLOCK_MAX_SIZE;
> ?
> ?	/* Read production parameter config block from NAND page */
> -	return nand_read_skip_bad(nand_info[0],
> CONFIG_TDX_CFG_BLOCK_OFFSET,
> -			?&size, NULL, TDX_CFG_BLOCK_MAX_SIZE,
> config_block);
> +	return nand_read_skip_bad(get_nand_dev_by_index(0),
> +				??CONFIG_TDX_CFG_BLOCK_OFFSET,
> +				??&size, NULL,
> TDX_CFG_BLOCK_MAX_SIZE,
> +				??config_block);
> ?}
> ?
> ?static int write_tdx_cfg_block_to_nand(unsigned char *config_block)
> @@ -162,7 +164,8 @@ static int write_tdx_cfg_block_to_nand(unsigned
> char *config_block)
> ?	size_t size = TDX_CFG_BLOCK_MAX_SIZE;
> ?
> ?	/* Write production parameter config block to NAND page */
> -	return nand_write_skip_bad(nand_info[0],
> CONFIG_TDX_CFG_BLOCK_OFFSET,
> +	return nand_write_skip_bad(get_nand_dev_by_index(0),
> +				???CONFIG_TDX_CFG_BLOCK_OFFSET,
> ?				???&size, NULL,
> TDX_CFG_BLOCK_MAX_SIZE,
> ?				???config_block, WITH_WR_VERIFY);
> ?}
> @@ -425,7 +428,8 @@ static int do_cfgblock_create(cmd_tbl_t *cmdtp,
> int flag, int argc,
> ?		?* empty (config block invalid...)
> ?		?*/
> ?		printf("NAND erase block %d need to be erased before
> creating a Toradex config block\n",
> -		???????CONFIG_TDX_CFG_BLOCK_OFFSET / nand_info[0]-
> >erasesize);
> +		???????CONFIG_TDX_CFG_BLOCK_OFFSET /
> +		???????get_nand_dev_by_index(0)->erasesize);
> ?		goto out;
> ?#elif defined(CONFIG_TDX_CFG_BLOCK_IS_IN_NOR)
> ?		/*

  reply	other threads:[~2017-02-11  1:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 20:22 [U-Boot] [PATCH v3 00/17] nand: remove direct acces to nand_info array Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 01/17] cmd: nand: abstract global variable usage for dm conversion Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 02/17] common: env_nand: use get_nand_dev_by_index() Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 03/17] dfu: dfu_nand: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 04/17] cmd: bootm: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 05/17] cmd: jffs2: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 06/17] common: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 07/17] fs: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 08/17] cmd: nand: remove direct access to struct mtd_info->priv Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 09/17] net: phy: cortina: use get_nand_dev_by_index() Grygorii Strashko
2017-02-10 20:52   ` Joe Hershberger
2017-02-10 20:22 ` [U-Boot] [PATCH v3 10/17] net: fm: " Grygorii Strashko
2017-02-10 20:54   ` Joe Hershberger
2017-02-10 20:22 ` [U-Boot] [PATCH v3 11/17] mtd: nand: drv: " Grygorii Strashko
2017-02-10 20:22 ` [U-Boot] [PATCH v3 12/17] cmd: mvebu: bubt: " Grygorii Strashko
2017-02-10 20:23 ` [U-Boot] [PATCH v3 13/17] board: atmel: " Grygorii Strashko
2017-02-10 20:23 ` [U-Boot] [PATCH v3 14/17] board: ronetix: " Grygorii Strashko
2017-02-10 20:23 ` [U-Boot] [PATCH v3 15/17] board: BuR: " Grygorii Strashko
2017-02-21 11:53   ` Hannes Schmelzer
2017-02-22  4:00     ` Simon Glass
2017-02-10 20:23 ` [U-Boot] [PATCH v3 16/17] board: toradex: " Grygorii Strashko
2017-02-11  1:20   ` Marcel Ziswiler [this message]
2017-02-10 20:23 ` [U-Boot] [PATCH v3 17/17] mtd: nand: make nand_info array static Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486776056.23828.3.camel@toradex.com \
    --to=marcel.ziswiler@toradex.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox