From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Grinberg Date: Thu, 3 Sep 2015 11:57:37 +0300 Subject: [U-Boot] [PATCH 3/3] arm: mx6: cm-fx6: modify device tree for old revisions of utilite In-Reply-To: <1441209920-10583-4-git-send-email-nikita@compulab.co.il> References: <1441209920-10583-1-git-send-email-nikita@compulab.co.il> <1441209920-10583-4-git-send-email-nikita@compulab.co.il> Message-ID: <55E80B81.1060402@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Cc: Igor Grinberg > Signed-off-by: Nikita Kiryanov > --- > 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.