From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 23 Apr 2015 15:10:56 -0400 Subject: [U-Boot] [PATCH 5/5] mx6cuboxi: Load the correct 'fdt_file' variable In-Reply-To: <55388D71.3030503@denx.de> References: <1429761426-26748-1-git-send-email-festevam@gmail.com> <1429761426-26748-5-git-send-email-festevam@gmail.com> <55388D71.3030503@denx.de> Message-ID: <20150423191056.GV16702@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Apr 23, 2015 at 08:13:05AM +0200, Stefano Babic wrote: > Hi Fabio, > > On 23/04/2015 05:57, Fabio Estevam wrote: > > From: Fabio Estevam > > > > Instead of hardcoding the 'fdt_file' variable, let's introduce a new > > function - build_dts_name(), that can build the dtb filename on the fly. > > > > Signed-off-by: Fabio Estevam > > --- > > board/solidrun/mx6cuboxi/mx6cuboxi.c | 24 ++++++++++++++++++++++++ > > include/configs/mx6cuboxi.h | 3 +-- > > 2 files changed, 25 insertions(+), 2 deletions(-) > > > > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c > > index 83410b2..1c24a55 100644 > > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c > > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c > > @@ -212,6 +212,30 @@ int checkboard(void) > > return 0; > > } > > > > +static const char *build_dts_name(void) > > +{ > > + char *dt_prefix = "unknown"; > > + char *dt_suffix = "unknown"; > > + > > + if (is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) > > + dt_prefix = "imx6q"; > > + else if (is_cpu_type(MXC_CPU_MX6SOLO) || is_cpu_type(MXC_CPU_MX6DL)) > > + dt_prefix = "imx6dl"; > > + > > + if (is_hummingboard()) > > + dt_suffix = "-hummingboard.dtb"; > > + else > > + dt_suffix = "-cubox-i.dtb"; > > + > > + return strcat(dt_prefix, dt_suffix); > > +} > > + > > I admit I do not like a lot to have C code setting / fixing the > environment. This has the drawback that when a user try to set the > environment from the console as he wants, he cannot because the code has > reverted back and it is not easy to track. I would like to propose > another solution. Yes. Please see how this is done for the various TI boards where we export into the env enough information to make these kind of decisions in the shell. This is even more applicable here as we don't have the dynamic "pick a DT" for Falcon Mode that the Solid Run tree has where this originated in. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: