From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 4/4] arm: mx6: cm-fx6: modify device tree for old revisions of utilite
Date: Sun, 6 Sep 2015 16:38:08 +0300 [thread overview]
Message-ID: <55EC41C0.2010104@compulab.co.il> (raw)
In-Reply-To: <1441529318-23973-5-git-send-email-nikita@compulab.co.il>
On 09/06/15 11:48, 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>
> ---
> Changes in V2:
> - #define USDHC3_PATH instead of const variable usdhc3_path
> - Do not update device tree on eeprom read failures in a more explicit
> way
>
> board/compulab/cm_fx6/cm_fx6.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
> index 572111d..a21e7b0 100644
> --- a/board/compulab/cm_fx6/cm_fx6.c
> +++ b/board/compulab/cm_fx6/cm_fx6.c
> @@ -580,9 +580,14 @@ int cm_fx6_setup_ecspi(void) { return 0; }
> #endif
>
> #ifdef CONFIG_OF_BOARD_SETUP
> +#define USDHC3_PATH "/soc/aips-bus at 02100000/usdhc at 02198000/"
> int ft_board_setup(void *blob, bd_t *bd)
> {
> + u32 baseboard_rev;
> + int nodeoffset;
> uint8_t enetaddr[6];
> + char baseboard_name[16];
That would probably have the actual size (macro).
> + int err;
>
> /* MAC addr */
> if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
> @@ -596,6 +601,21 @@ int ft_board_setup(void *blob, bd_t *bd)
> enetaddr, 6, 1);
> }
>
> + baseboard_rev = cl_eeprom_get_board_rev(0);
> + err = cl_eeprom_get_product_name((uchar *)baseboard_name, 0);
I would replace the 0 with a define explaining what that is.
> + if (err || baseboard_rev == 0)
> + return 0; /* Assume not an early revision SB-FX6m baseboard */
> +
> + 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.
next prev parent reply other threads:[~2015-09-06 13:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-06 8:48 [U-Boot] [PATCH V2 0/4] cm-fx6 updates for Utilite Nikita Kiryanov
2015-09-06 8:48 ` [U-Boot] [PATCH V2 1/4] compulab: eeprom: select i2c bus when querying for board rev Nikita Kiryanov
2015-09-06 8:48 ` [U-Boot] [PATCH V2 2/4] compulab: eeprom: propagate error value in read_mac_addr() Nikita Kiryanov
2015-09-06 12:58 ` Igor Grinberg
2015-09-06 8:48 ` [U-Boot] [PATCH V2 3/4] compulab: eeprom: add support for obtaining product name Nikita Kiryanov
2015-09-06 13:30 ` Igor Grinberg
2015-09-06 8:48 ` [U-Boot] [PATCH V2 4/4] arm: mx6: cm-fx6: modify device tree for old revisions of utilite Nikita Kiryanov
2015-09-06 13:38 ` Igor Grinberg [this message]
2015-09-13 8:36 ` [U-Boot] [PATCH V2 0/4] cm-fx6 updates for Utilite Stefano Babic
2015-09-16 10:10 ` Igor Grinberg
2015-09-16 16:50 ` Nikita Kiryanov
2015-09-22 7:52 ` Stefano Babic
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=55EC41C0.2010104@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