public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] arm: mx6: cm-fx6: modify device tree for old revisions of utilite
Date: Thu, 3 Sep 2015 11:57:37 +0300	[thread overview]
Message-ID: <55E80B81.1060402@compulab.co.il> (raw)
In-Reply-To: <1441209920-10583-4-git-send-email-nikita@compulab.co.il>

On 09/02/15 19:05, Nikita Kiryanov wrote:
> Old revisions of Utilite (a miniature PC based on cm-fx6) do not have
> a card detect for mmc, and thus the kernel needs to be told that
> there's a persistent storage on usdhc3 to force it to probe the mmc
> card.
> 
> Check the baseboard revision and modify the device tree accordingly
> if needed.
> 
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
>  board/compulab/cm_fx6/cm_fx6.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 572111d..c8e980d 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -582,6 +582,10 @@ int cm_fx6_setup_ecspi(void) { return 0; }
>  #ifdef CONFIG_OF_BOARD_SETUP
>  int ft_board_setup(void *blob, bd_t *bd)
>  {
> +	u32 baseboard_rev;
> +	int nodeoffset;
> +	const char *usdhc3_path = "/soc/aips-bus at 02100000/usdhc at 02198000/";

I would really like to see this path discovered dynamically...
Is it possible?
If not, then may be define?

> +	char *baseboard_name;
>  	uint8_t enetaddr[6];
>  
>  	/* MAC addr */
> @@ -596,6 +600,18 @@ int ft_board_setup(void *blob, bd_t *bd)
>  				     enetaddr, 6, 1);
>  	}
>  
> +	baseboard_name = cl_eeprom_get_product_name(0);

Once you will change the patch 2/3, this will also need to be changed.

> +	baseboard_rev = cl_eeprom_get_board_rev(0);
> +	if (!strncmp("SB-FX6m", baseboard_name, 7) && baseboard_rev <= 120) {
> +		fdt_shrink_to_minimum(blob); /* Make room for new properties */
> +		nodeoffset = fdt_path_offset(blob, usdhc3_path);
> +		fdt_delprop(blob, nodeoffset, "cd-gpios");
> +		fdt_find_and_setprop(blob, usdhc3_path, "non-removable",
> +				     NULL, 0, 1);
> +		fdt_find_and_setprop(blob, usdhc3_path, "keep-power-in-suspend",
> +				     NULL, 0, 1);
> +	}
> +
>  	return 0;
>  }
>  #endif
> 

-- 
Regards,
Igor.

      reply	other threads:[~2015-09-03  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 16:05 [U-Boot] [PATCH 0/3] cm-fx6 updates for Utilite Nikita Kiryanov
2015-09-02 16:05 ` [U-Boot] [PATCH 1/3] compulab: eeprom: select i2c bus when querying for board rev Nikita Kiryanov
2015-09-03  8:35   ` Igor Grinberg
2015-09-02 16:05 ` [U-Boot] [PATCH 2/3] compulab: eeprom: add support for obtaining product name Nikita Kiryanov
2015-09-03  8:45   ` Igor Grinberg
2015-09-02 16:05 ` [U-Boot] [PATCH 3/3] arm: mx6: cm-fx6: modify device tree for old revisions of utilite Nikita Kiryanov
2015-09-03  8:57   ` Igor Grinberg [this message]

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=55E80B81.1060402@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --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