* [U-Boot] [PATCH 0/3] i.MX refactoring patchset
@ 2012-06-17 12:58 Otavio Salvador
2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador
` (3 more replies)
0 siblings, 4 replies; 32+ messages in thread
From: Otavio Salvador @ 2012-06-17 12:58 UTC (permalink / raw)
To: u-boot
This patchset include minor changes for i.MX; mainly:
1/3: improves the rare case of unkown booting machine
2/3: generalize the code so it works for i.MX23 and i.MX28
The patch 3/3 is what we've been using in Yocto and has been change to
affect only mx28evk.
Otavio Salvador (3):
imx: Use a clear identification of an unidentified CPU type
mxs: generalize code for print_cpuinfo()
mx28evk: extend default environment
arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++-
arch/arm/cpu/armv7/imx-common/cpu.c | 4 +-
include/configs/mx28evk.h | 83 +++++++++++++++++++++++++++++++----
3 files changed, 104 insertions(+), 12 deletions(-)
--
1.7.10
^ permalink raw reply [flat|nested] 32+ messages in thread* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 12:58 [U-Boot] [PATCH 0/3] i.MX refactoring patchset Otavio Salvador @ 2012-06-17 12:58 ` Otavio Salvador 2012-06-17 13:05 ` Fabio Estevam 2012-06-17 15:43 ` Stefano Babic 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador ` (2 subsequent siblings) 3 siblings, 2 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 12:58 UTC (permalink / raw) To: u-boot In case an unidentified CPU type is detected it now returns i.MX<unidentified>, in a const char. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Cc: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> --- arch/arm/cpu/armv7/imx-common/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c index b3195dd..77aac7d 100644 --- a/arch/arm/cpu/armv7/imx-common/cpu.c +++ b/arch/arm/cpu/armv7/imx-common/cpu.c @@ -66,7 +66,7 @@ char *get_reset_cause(void) #if defined(CONFIG_DISPLAY_CPUINFO) -static char *get_imx_type(u32 imxtype) +static const char *get_imx_type(u32 imxtype) { switch (imxtype) { case 0x63: @@ -80,7 +80,7 @@ static char *get_imx_type(u32 imxtype) case 0x53: return "53"; default: - return "unknown"; + return "<unidentified>"; } } -- 1.7.10 ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador @ 2012-06-17 13:05 ` Fabio Estevam 2012-06-17 13:09 ` Otavio Salvador 2012-06-17 15:43 ` Stefano Babic 1 sibling, 1 reply; 32+ messages in thread From: Fabio Estevam @ 2012-06-17 13:05 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 9:58 AM, Otavio Salvador <otavio@ossystems.com.br> wrote: > -static char *get_imx_type(u32 imxtype) > +static const char *get_imx_type(u32 imxtype) This is OK, but ... > ?{ > ? ? ? ?switch (imxtype) { > ? ? ? ?case 0x63: > @@ -80,7 +80,7 @@ static char *get_imx_type(u32 imxtype) > ? ? ? ?case 0x53: > ? ? ? ? ? ? ? ?return "53"; > ? ? ? ?default: > - ? ? ? ? ? ? ? return "unknown"; > + ? ? ? ? ? ? ? return "<unidentified>"; I really don't see any improvement here. ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 13:05 ` Fabio Estevam @ 2012-06-17 13:09 ` Otavio Salvador 2012-06-17 13:13 ` Fabio Estevam 0 siblings, 1 reply; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 13:09 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 10:05 AM, Fabio Estevam <festevam@gmail.com> wrote: >> ? ? ? ?default: >> - ? ? ? ? ? ? ? return "unknown"; >> + ? ? ? ? ? ? ? return "<unidentified>"; > > I really don't see any improvement here. It is just to avoid a i.MXunkown return; besides this is how I am doing in the mx23 code too. -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 13:09 ` Otavio Salvador @ 2012-06-17 13:13 ` Fabio Estevam 2012-06-17 13:21 ` Otavio Salvador 2012-06-17 13:30 ` Marek Vasut 0 siblings, 2 replies; 32+ messages in thread From: Fabio Estevam @ 2012-06-17 13:13 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 10:09 AM, Otavio Salvador <otavio@ossystems.com.br> wrote: > On Sun, Jun 17, 2012 at 10:05 AM, Fabio Estevam <festevam@gmail.com> wrote: >>> ? ? ? ?default: >>> - ? ? ? ? ? ? ? return "unknown"; >>> + ? ? ? ? ? ? ? return "<unidentified>"; >> >> I really don't see any improvement here. > > It is just to avoid a i.MXunkown return; besides this is how I am > doing in the mx23 code too. This is OK. If you read "i.MXunkown" things are too broken already because the chip version could not be read. Reading "i.MX<unidentified>" will make things no better. ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 13:13 ` Fabio Estevam @ 2012-06-17 13:21 ` Otavio Salvador 2012-06-17 13:30 ` Marek Vasut 1 sibling, 0 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 13:21 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 10:13 AM, Fabio Estevam <festevam@gmail.com> wrote: > Reading "i.MX<unidentified>" will make things no better. OK; I'll drop it from the patch queue then. -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 13:13 ` Fabio Estevam 2012-06-17 13:21 ` Otavio Salvador @ 2012-06-17 13:30 ` Marek Vasut 1 sibling, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 13:30 UTC (permalink / raw) To: u-boot Dear Fabio Estevam, > On Sun, Jun 17, 2012 at 10:09 AM, Otavio Salvador > > <otavio@ossystems.com.br> wrote: > > On Sun, Jun 17, 2012 at 10:05 AM, Fabio Estevam <festevam@gmail.com> wrote: > >>> default: > >>> - return "unknown"; > >>> + return "<unidentified>"; > >> > >> I really don't see any improvement here. > > > > It is just to avoid a i.MXunkown return; besides this is how I am > > doing in the mx23 code too. > > This is OK. If you read "i.MXunkown" things are too broken already > because the chip version could not be read. > > Reading "i.MX<unidentified>" will make things no better. This was from my head actually ... and I think this is better. The text is at least not mangled so badly. So let's keep it. Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador 2012-06-17 13:05 ` Fabio Estevam @ 2012-06-17 15:43 ` Stefano Babic 2012-06-17 15:48 ` Otavio Salvador 1 sibling, 1 reply; 32+ messages in thread From: Stefano Babic @ 2012-06-17 15:43 UTC (permalink / raw) To: u-boot On 17/06/2012 14:58, Otavio Salvador wrote: > In case an unidentified CPU type is detected it now returns > i.MX<unidentified>, in a const char. > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> > Cc: Marek Vasut <marex@denx.de> > Cc: Stefano Babic <sbabic@denx.de> > Cc: Fabio Estevam <fabio.estevam@freescale.com> > --- Hi Otavio, > arch/arm/cpu/armv7/imx-common/cpu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/armv7/imx-common/cpu.c b/arch/arm/cpu/armv7/imx-common/cpu.c > index b3195dd..77aac7d 100644 > --- a/arch/arm/cpu/armv7/imx-common/cpu.c > +++ b/arch/arm/cpu/armv7/imx-common/cpu.c > @@ -66,7 +66,7 @@ char *get_reset_cause(void) > > #if defined(CONFIG_DISPLAY_CPUINFO) > > -static char *get_imx_type(u32 imxtype) > +static const char *get_imx_type(u32 imxtype) > { > switch (imxtype) { > case 0x63: > @@ -80,7 +80,7 @@ static char *get_imx_type(u32 imxtype) > case 0x53: > return "53"; > default: > - return "unknown"; > + return "<unidentified>"; Taste ist taste... but why <unidentified> is better that unknown ? Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 15:43 ` Stefano Babic @ 2012-06-17 15:48 ` Otavio Salvador 2012-06-17 16:03 ` Marek Vasut 0 siblings, 1 reply; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 15:48 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 12:43 PM, Stefano Babic <sbabic@denx.de> wrote: >> - ? ? ? ? ? ? return "unknown"; >> + ? ? ? ? ? ? return "<unidentified>"; > > Taste ist taste... but why <unidentified> is better that unknown ? For me it gives a visual indication that we didn't meant to support a i.MXunknown processor ;-) i.MX<unidentified> make it easy to spot this. But really, I don't mind it being included or not. I did it because Marek has comment about it when looking at my initial mx23 patches. -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 15:48 ` Otavio Salvador @ 2012-06-17 16:03 ` Marek Vasut 2012-06-17 17:50 ` Otavio Salvador 0 siblings, 1 reply; 32+ messages in thread From: Marek Vasut @ 2012-06-17 16:03 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > On Sun, Jun 17, 2012 at 12:43 PM, Stefano Babic <sbabic@denx.de> wrote: > >> - return "unknown"; > >> + return "<unidentified>"; > > > > Taste ist taste... but why <unidentified> is better that unknown ? > > For me it gives a visual indication that we didn't meant to support a > i.MXunknown processor ;-) i.MX<unidentified> make it easy to spot > this. > > But really, I don't mind it being included or not. I did it because > Marek has comment about it when looking at my initial mx23 patches. And I like it more, it looks less like a typo. Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 16:03 ` Marek Vasut @ 2012-06-17 17:50 ` Otavio Salvador 2012-06-17 18:04 ` Stefano Babic 2012-06-17 18:04 ` Marek Vasut 0 siblings, 2 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 17:50 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 1:03 PM, Marek Vasut <marex@denx.de> wrote: >> But really, I don't mind it being included or not. I did it because >> Marek has comment about it when looking at my initial mx23 patches. > > And I like it more, it looks less like a typo. Sorry; I didn't get what you meant ... should it go or not? -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 17:50 ` Otavio Salvador @ 2012-06-17 18:04 ` Stefano Babic 2012-06-17 18:40 ` Marek Vasut 2012-06-17 18:04 ` Marek Vasut 1 sibling, 1 reply; 32+ messages in thread From: Stefano Babic @ 2012-06-17 18:04 UTC (permalink / raw) To: u-boot On 17/06/2012 19:50, Otavio Salvador wrote: > On Sun, Jun 17, 2012 at 1:03 PM, Marek Vasut <marex@denx.de> wrote: >>> But really, I don't mind it being included or not. I did it because >>> Marek has comment about it when looking at my initial mx23 patches. >> >> And I like it more, it looks less like a typo. > > Sorry; I didn't get what you meant ... should it go or not? Hi Otavio, I make also my point clearer for Marek: my point is that the behavior for all i.MX must be consistent. If you change here, please change also for i.MX31 (that returns "unknown in print_cpuinfo) and for other SOCs that returns "unknown" in print_cpuinfo() - or let the code as now. Best regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 18:04 ` Stefano Babic @ 2012-06-17 18:40 ` Marek Vasut 0 siblings, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 18:40 UTC (permalink / raw) To: u-boot Dear Stefano Babic, > On 17/06/2012 19:50, Otavio Salvador wrote: > > On Sun, Jun 17, 2012 at 1:03 PM, Marek Vasut <marex@denx.de> wrote: > >>> But really, I don't mind it being included or not. I did it because > >>> Marek has comment about it when looking at my initial mx23 patches. > >> > >> And I like it more, it looks less like a typo. > > > > Sorry; I didn't get what you meant ... should it go or not? > > Hi Otavio, > > I make also my point clearer for Marek: my point is that the behavior > for all i.MX must be consistent. If you change here, please change also > for i.MX31 (that returns "unknown in print_cpuinfo) and for other SOCs > that returns "unknown" in print_cpuinfo() - or let the code as now. Ah, I thought it was about the revision. Ok, whatever way is fine by me. > Best regards, > Stefano Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type 2012-06-17 17:50 ` Otavio Salvador 2012-06-17 18:04 ` Stefano Babic @ 2012-06-17 18:04 ` Marek Vasut 1 sibling, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 18:04 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > On Sun, Jun 17, 2012 at 1:03 PM, Marek Vasut <marex@denx.de> wrote: > >> But really, I don't mind it being included or not. I did it because > >> Marek has comment about it when looking at my initial mx23 patches. > > > > And I like it more, it looks less like a typo. > > Sorry; I didn't get what you meant ... should it go or not? It doesn't look like a typing mistake (i.MX<unknown> vs. i.MXunknown) => I like it more with "<" ">". Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 12:58 [U-Boot] [PATCH 0/3] i.MX refactoring patchset Otavio Salvador 2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador @ 2012-06-17 12:58 ` Otavio Salvador 2012-06-17 13:10 ` Fabio Estevam ` (3 more replies) 2012-06-17 12:58 ` [U-Boot] [PATCH 3/3] mx28evk: extend default environment Otavio Salvador 2012-06-17 21:54 ` [U-Boot] [PATCH 0/3] i.MX refactoring patchset Marek Vasut 3 siblings, 4 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 12:58 UTC (permalink / raw) To: u-boot The information now is gathered from HW_DIGCTL_CHIPID register and includes the revision of the chip on the output. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Cc: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> --- arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c index a82ff25..ac2f2e0 100644 --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c @@ -190,13 +190,38 @@ int arch_cpu_init(void) #endif #if defined(CONFIG_DISPLAY_CPUINFO) +static const char *get_cpu_type(void) +{ + struct mx28_digctl_regs *digctl_regs = + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; + + switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { + case 0x2800: + return "28"; + case 0x3728: + return "23"; + default: + return "<unidentified>"; + } +} + +static u8 get_cpu_rev(void) +{ + struct mx28_digctl_regs *digctl_regs = + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; + + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; +} + int print_cpuinfo(void) { struct mx28_spl_data *data = (struct mx28_spl_data *) ((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf); - printf("Freescale i.MX28 family at %d MHz\n", - mxc_get_clock(MXC_ARM_CLK) / 1000000); + printf("CPU: Freescale i.MX%s rev%d at %d MHz\n", + get_cpu_type(), + get_cpu_rev(), + mxc_get_clock(MXC_ARM_CLK) / 1000000); printf("BOOT: %s\n", mx28_boot_modes[data->boot_mode_idx].mode); return 0; } -- 1.7.10 ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador @ 2012-06-17 13:10 ` Fabio Estevam 2012-06-17 13:25 ` Fabio Estevam ` (2 subsequent siblings) 3 siblings, 0 replies; 32+ messages in thread From: Fabio Estevam @ 2012-06-17 13:10 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 9:58 AM, Otavio Salvador <otavio@ossystems.com.br> wrote: > The information now is gathered from HW_DIGCTL_CHIPID register and > includes the revision of the chip on the output. > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> > Cc: Marek Vasut <marex@denx.de> > Cc: Stefano Babic <sbabic@denx.de> > Cc: Fabio Estevam <fabio.estevam@freescale.com> > --- > ?arch/arm/cpu/arm926ejs/mx28/mx28.c | ? 29 +++++++++++++++++++++++++++-- > ?1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c > index a82ff25..ac2f2e0 100644 > --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c > +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c > @@ -190,13 +190,38 @@ int arch_cpu_init(void) > ?#endif > > ?#if defined(CONFIG_DISPLAY_CPUINFO) > +static const char *get_cpu_type(void) > +{ > + ? ? ? struct mx28_digctl_regs *digctl_regs = > + ? ? ? ? ? ? ? (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + ? ? ? switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { > + ? ? ? case 0x2800: > + ? ? ? ? ? ? ? return "28"; > + ? ? ? case 0x3728: > + ? ? ? ? ? ? ? return "23"; > + ? ? ? default: > + ? ? ? ? ? ? ? return "<unidentified>"; > + ? ? ? } > +} > + > +static u8 get_cpu_rev(void) > +{ > + ? ? ? struct mx28_digctl_regs *digctl_regs = > + ? ? ? ? ? ? ? (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + ? ? ? return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > +} > + > ?int print_cpuinfo(void) > ?{ > ? ? ? ?struct mx28_spl_data *data = (struct mx28_spl_data *) > ? ? ? ? ? ? ? ?((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf); > > - ? ? ? printf("Freescale i.MX28 family at %d MHz\n", > - ? ? ? ? ? ? ? ? ? ? ? mxc_get_clock(MXC_ARM_CLK) / 1000000); > + ? ? ? printf("CPU: ? Freescale i.MX%s rev%d at %d MHz\n", In all other i.MX SoCs we display the revision as rev%d.%d, for example: rev1.0 , rev1.1 , etc. I think we should print it in the same format here (x.y) ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador 2012-06-17 13:10 ` Fabio Estevam @ 2012-06-17 13:25 ` Fabio Estevam 2012-06-17 13:35 ` Marek Vasut 2012-06-17 14:35 ` Otavio Salvador 2012-06-17 13:28 ` Marek Vasut 2012-06-17 15:49 ` Stefano Babic 3 siblings, 2 replies; 32+ messages in thread From: Fabio Estevam @ 2012-06-17 13:25 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 9:58 AM, Otavio Salvador <otavio@ossystems.com.br> wrote: > ?#if defined(CONFIG_DISPLAY_CPUINFO) > +static const char *get_cpu_type(void) > +{ > + ? ? ? struct mx28_digctl_regs *digctl_regs = > + ? ? ? ? ? ? ? (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + ? ? ? switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { > + ? ? ? case 0x2800: > + ? ? ? ? ? ? ? return "28"; > + ? ? ? case 0x3728: Reading the Reference Manual I read 0x3780 instead. ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 13:25 ` Fabio Estevam @ 2012-06-17 13:35 ` Marek Vasut 2012-06-17 14:14 ` Fabio Estevam 2012-06-17 14:35 ` Otavio Salvador 1 sibling, 1 reply; 32+ messages in thread From: Marek Vasut @ 2012-06-17 13:35 UTC (permalink / raw) To: u-boot Dear Fabio Estevam, > On Sun, Jun 17, 2012 at 9:58 AM, Otavio Salvador > > <otavio@ossystems.com.br> wrote: > > #if defined(CONFIG_DISPLAY_CPUINFO) > > +static const char *get_cpu_type(void) > > +{ > > + struct mx28_digctl_regs *digctl_regs = > > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > > + > > + switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { > > + case 0x2800: > > + return "28"; > > > + case 0x3728: > Reading the Reference Manual I read 0x3780 instead. Good catch ;-) What's the code for mx6q? They dropped this register from it it seems ;-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 13:35 ` Marek Vasut @ 2012-06-17 14:14 ` Fabio Estevam 0 siblings, 0 replies; 32+ messages in thread From: Fabio Estevam @ 2012-06-17 14:14 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 10:35 AM, Marek Vasut <marex@denx.de> wrote: > What's the code for mx6q? They dropped this register from it it seems ;-) mx6 code does read the SoC type and revision correctly. ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 13:25 ` Fabio Estevam 2012-06-17 13:35 ` Marek Vasut @ 2012-06-17 14:35 ` Otavio Salvador 2012-06-17 15:10 ` Marek Vasut 1 sibling, 1 reply; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 14:35 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 10:25 AM, Fabio Estevam <festevam@gmail.com> wrote: > Reading the Reference Manual I read 0x3780 instead. Indeed; I must have typoed it when writting it back. I fixed it locally; Fabio will check the masking for mx28 revision and when I get it I update the patch according. -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 14:35 ` Otavio Salvador @ 2012-06-17 15:10 ` Marek Vasut 2012-06-17 15:17 ` Otavio Salvador 0 siblings, 1 reply; 32+ messages in thread From: Marek Vasut @ 2012-06-17 15:10 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > On Sun, Jun 17, 2012 at 10:25 AM, Fabio Estevam <festevam@gmail.com> wrote: > > Reading the Reference Manual I read 0x3780 instead. > > Indeed; I must have typoed it when writting it back. > > I fixed it locally; Fabio will check the masking for mx28 revision and > when I get it I update the patch according. It's 0x2800 ... roll out a new version ;-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 15:10 ` Marek Vasut @ 2012-06-17 15:17 ` Otavio Salvador 0 siblings, 0 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 15:17 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 12:10 PM, Marek Vasut <marex@denx.de> wrote: >> I fixed it locally; Fabio will check the masking for mx28 revision and >> when I get it I update the patch according. > > It's 0x2800 ... roll out a new version ;-) We are in doubt about the revision, not product code ;-) -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador 2012-06-17 13:10 ` Fabio Estevam 2012-06-17 13:25 ` Fabio Estevam @ 2012-06-17 13:28 ` Marek Vasut 2012-06-17 15:49 ` Stefano Babic 3 siblings, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 13:28 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > The information now is gathered from HW_DIGCTL_CHIPID register and > includes the revision of the chip on the output. > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> > Cc: Marek Vasut <marex@denx.de> > Cc: Stefano Babic <sbabic@denx.de> > Cc: Fabio Estevam <fabio.estevam@freescale.com> > --- > arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c > b/arch/arm/cpu/arm926ejs/mx28/mx28.c index a82ff25..ac2f2e0 100644 > --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c > +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c > @@ -190,13 +190,38 @@ int arch_cpu_init(void) > #endif > > #if defined(CONFIG_DISPLAY_CPUINFO) > +static const char *get_cpu_type(void) > +{ > + struct mx28_digctl_regs *digctl_regs = > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { #define that >> 16 ... maybe offset? I'd define a mask though, see below. #define PRODUCT_CODE_MASK (0xffff << 16) > + case 0x2800: #define this as something ... #define PRODUCT_CODE_MX28 (0x2800 << 16) > + return "28"; > + case 0x3728: > + return "23"; > + default: > + return "<unidentified>"; So X-Files-ish ;-) > + } > +} > + > +static u8 get_cpu_rev(void) uint8_t ... maybe? it's used throughout the code, so let's keep consistent. > +{ > + struct mx28_digctl_regs *digctl_regs = > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > +} > + > int print_cpuinfo(void) > { > struct mx28_spl_data *data = (struct mx28_spl_data *) > ((CONFIG_SYS_TEXT_BASE - sizeof(struct mx28_spl_data)) & ~0xf); > > - printf("Freescale i.MX28 family at %d MHz\n", > - mxc_get_clock(MXC_ARM_CLK) / 1000000); > + printf("CPU: Freescale i.MX%s rev%d at %d MHz\n", > + get_cpu_type(), > + get_cpu_rev(), > + mxc_get_clock(MXC_ARM_CLK) / 1000000); > printf("BOOT: %s\n", mx28_boot_modes[data->boot_mode_idx].mode); > return 0; > } Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador ` (2 preceding siblings ...) 2012-06-17 13:28 ` Marek Vasut @ 2012-06-17 15:49 ` Stefano Babic 2012-06-17 16:02 ` Marek Vasut 2012-06-17 17:49 ` Otavio Salvador 3 siblings, 2 replies; 32+ messages in thread From: Stefano Babic @ 2012-06-17 15:49 UTC (permalink / raw) To: u-boot On 17/06/2012 14:58, Otavio Salvador wrote: > The information now is gathered from HW_DIGCTL_CHIPID register and > includes the revision of the chip on the output. > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> > Cc: Marek Vasut <marex@denx.de> > Cc: Stefano Babic <sbabic@denx.de> > Cc: Fabio Estevam <fabio.estevam@freescale.com> > --- Hi Otavio, > arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++++++++++++++++++-- > 1 file changed, 27 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c b/arch/arm/cpu/arm926ejs/mx28/mx28.c > index a82ff25..ac2f2e0 100644 > --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c > +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c > @@ -190,13 +190,38 @@ int arch_cpu_init(void) > #endif > > #if defined(CONFIG_DISPLAY_CPUINFO) > +static const char *get_cpu_type(void) > +{ > + struct mx28_digctl_regs *digctl_regs = > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { > + case 0x2800: > + return "28"; > + case 0x3728: > + return "23"; > + default: > + return "<unidentified>"; > + } > +} I like that there will be support for i.MX23, too. But I dislike that everything takes the name "MX28". As you suggest in your subject, maybe it is time to rename directories, and use "mxs" (as in kernel) instead of mx28. > + > +static u8 get_cpu_rev(void) > +{ > + struct mx28_digctl_regs *digctl_regs = > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > + > + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > +} Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is currently exported, too. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de ===================================================================== ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 15:49 ` Stefano Babic @ 2012-06-17 16:02 ` Marek Vasut 2012-06-17 17:56 ` Stefano Babic 2012-06-17 17:49 ` Otavio Salvador 1 sibling, 1 reply; 32+ messages in thread From: Marek Vasut @ 2012-06-17 16:02 UTC (permalink / raw) To: u-boot Dear Stefano Babic, > On 17/06/2012 14:58, Otavio Salvador wrote: > > The information now is gathered from HW_DIGCTL_CHIPID register and > > includes the revision of the chip on the output. > > > > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> > > Cc: Marek Vasut <marex@denx.de> > > Cc: Stefano Babic <sbabic@denx.de> > > Cc: Fabio Estevam <fabio.estevam@freescale.com> > > --- > > Hi Otavio, > > > arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++++++++++++++++++-- > > 1 file changed, 27 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c > > b/arch/arm/cpu/arm926ejs/mx28/mx28.c index a82ff25..ac2f2e0 100644 > > --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c > > +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c > > @@ -190,13 +190,38 @@ int arch_cpu_init(void) > > > > #endif > > > > #if defined(CONFIG_DISPLAY_CPUINFO) > > > > +static const char *get_cpu_type(void) > > +{ > > + struct mx28_digctl_regs *digctl_regs = > > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > > + > > + switch (readl(&digctl_regs->hw_digctl_chipid) >> 16) { > > + case 0x2800: > > + return "28"; > > + case 0x3728: > > + return "23"; > > + default: > > + return "<unidentified>"; > > + } > > +} > > I like that there will be support for i.MX23, too. But I dislike that > everything takes the name "MX28". As you suggest in your subject, maybe > it is time to rename directories, and use "mxs" (as in kernel) instead > of mx28. We can do that eventually, later ... it depends on the ordering of Otavio's patches, I'm fine either way. > > + > > +static u8 get_cpu_rev(void) > > +{ > > + struct mx28_digctl_regs *digctl_regs = > > + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > > + > > + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > > +} > > Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is > currently exported, too. Correct, but isn't the return value mangled somehow (like having major rev. << 16 and minor rev. << 0 )? Or that's only IMX? > > Best regards, > Stefano Babic Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 16:02 ` Marek Vasut @ 2012-06-17 17:56 ` Stefano Babic 2012-06-17 18:03 ` Otavio Salvador 2012-06-17 18:04 ` Marek Vasut 0 siblings, 2 replies; 32+ messages in thread From: Stefano Babic @ 2012-06-17 17:56 UTC (permalink / raw) To: u-boot On 17/06/2012 18:02, Marek Vasut wrote: >> I like that there will be support for i.MX23, too. But I dislike that >> everything takes the name "MX28". As you suggest in your subject, maybe >> it is time to rename directories, and use "mxs" (as in kernel) instead >> of mx28. > > We can do that eventually, later ... it depends on the ordering of Otavio's > patches, I'm fine either way. Fine with me - anyway, it is something must be done. > >>> + >>> +static u8 get_cpu_rev(void) >>> +{ >>> + struct mx28_digctl_regs *digctl_regs = >>> + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; >>> + >>> + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; >>> +} >> >> Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is >> currently exported, too. > > Correct, but isn't the return value mangled somehow (like having major rev. << > 16 and minor rev. << 0 )? Or that's only IMX? Checking in current implementations for get_cpu_rev() (i.MX / OMAP24 / OMAP3 / AM33, and even board/apollon/sys_info.c: I do not know why the cpu detection is inseide this file), none of them requires strictly 32 bit. However, we should be coherent in all code - for this reason I dislike if one of the i.MX is implemented differently as for other SOCs. Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de ===================================================================== ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 17:56 ` Stefano Babic @ 2012-06-17 18:03 ` Otavio Salvador 2012-06-17 18:41 ` Marek Vasut 2012-06-17 18:04 ` Marek Vasut 1 sibling, 1 reply; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 18:03 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 2:56 PM, Stefano Babic <sbabic@denx.de> wrote: >> Correct, but isn't the return value mangled somehow (like having major rev. << >> 16 and minor rev. << 0 )? Or that's only IMX? > > Checking in current implementations for get_cpu_rev() (i.MX / OMAP24 / > OMAP3 / AM33, and even board/apollon/sys_info.c: I do not know why the > cpu detection is inseide this file), none of them requires strictly 32 > bit. However, we should be coherent in all code - for this reason I > dislike if one of the i.MX is implemented differently as for other SOCs. So, we change this one to follow the others or fix the others? -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 18:03 ` Otavio Salvador @ 2012-06-17 18:41 ` Marek Vasut 0 siblings, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 18:41 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > On Sun, Jun 17, 2012 at 2:56 PM, Stefano Babic <sbabic@denx.de> wrote: > >> Correct, but isn't the return value mangled somehow (like having major > >> rev. << 16 and minor rev. << 0 )? Or that's only IMX? > > > > Checking in current implementations for get_cpu_rev() (i.MX / OMAP24 / > > OMAP3 / AM33, and even board/apollon/sys_info.c: I do not know why the > > cpu detection is inseide this file), none of them requires strictly 32 > > bit. However, we should be coherent in all code - for this reason I > > dislike if one of the i.MX is implemented differently as for other SOCs. > > So, we change this one to follow the others or fix the others? Fix the others ;-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 17:56 ` Stefano Babic 2012-06-17 18:03 ` Otavio Salvador @ 2012-06-17 18:04 ` Marek Vasut 1 sibling, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 18:04 UTC (permalink / raw) To: u-boot Dear Stefano Babic, > On 17/06/2012 18:02, Marek Vasut wrote: > >> I like that there will be support for i.MX23, too. But I dislike that > >> everything takes the name "MX28". As you suggest in your subject, maybe > >> it is time to rename directories, and use "mxs" (as in kernel) instead > >> of mx28. > > > > We can do that eventually, later ... it depends on the ordering of > > Otavio's patches, I'm fine either way. > > Fine with me - anyway, it is something must be done. > > >>> + > >>> +static u8 get_cpu_rev(void) > >>> +{ > >>> + struct mx28_digctl_regs *digctl_regs = > >>> + (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; > >>> + > >>> + return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; > >>> +} > >> > >> Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is > >> currently exported, too. > > > > Correct, but isn't the return value mangled somehow (like having major > > rev. << 16 and minor rev. << 0 )? Or that's only IMX? > > Checking in current implementations for get_cpu_rev() (i.MX / OMAP24 / > OMAP3 / AM33, and even board/apollon/sys_info.c: I do not know why the > cpu detection is inseide this file), none of them requires strictly 32 > bit. However, we should be coherent in all code - for this reason I > dislike if one of the i.MX is implemented differently as for other SOCs. +1 > Best regards, > Stefano Babic Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() 2012-06-17 15:49 ` Stefano Babic 2012-06-17 16:02 ` Marek Vasut @ 2012-06-17 17:49 ` Otavio Salvador 1 sibling, 0 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 17:49 UTC (permalink / raw) To: u-boot On Sun, Jun 17, 2012 at 12:49 PM, Stefano Babic <sbabic@denx.de> wrote: > I like that there will be support for i.MX23, too. But I dislike that > everything takes the name "MX28". As you suggest in your subject, maybe > it is time to rename directories, and use "mxs" (as in kernel) instead > of mx28. I have it in my wip branch; I'd like to hold it until I have mx23 working so I have freedom to rework the patches. I can split it on mx28 part and leave mx23 on my branch; this does looks nicer for me. >> +static u8 get_cpu_rev(void) >> +{ >> + ? ? struct mx28_digctl_regs *digctl_regs = >> + ? ? ? ? ? ? (struct mx28_digctl_regs *)MXS_DIGCTL_BASE; >> + >> + ? ? return readl(&digctl_regs->hw_digctl_chipid) & 0x0000F; >> +} > > Everywhere (i.MX, omap, ...) get_cpu_rev returns u32. The function is > currently exported, too. I change it then. Will fix it. -- Otavio Salvador? ? ? ? ? ? ? ? ? ? ? ? ? ? ?O.S. Systems E-mail: otavio at ossystems.com.br? http://www.ossystems.com.br Mobile: +55 53 9981-7854? ? ? ?? ? ? ?http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 3/3] mx28evk: extend default environment 2012-06-17 12:58 [U-Boot] [PATCH 0/3] i.MX refactoring patchset Otavio Salvador 2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador @ 2012-06-17 12:58 ` Otavio Salvador 2012-06-17 21:54 ` [U-Boot] [PATCH 0/3] i.MX refactoring patchset Marek Vasut 3 siblings, 0 replies; 32+ messages in thread From: Otavio Salvador @ 2012-06-17 12:58 UTC (permalink / raw) To: u-boot The environment has been based on mx53loco and m28evk but keeping the possibility to easy change the default console device as Freescale and mainline kernels differ on the device name. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Cc: Marek Vasut <marex@denx.de> Cc: Stefano Babic <sbabic@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> --- include/configs/mx28evk.h | 83 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h index e98a746..889d58a 100644 --- a/include/configs/mx28evk.h +++ b/include/configs/mx28evk.h @@ -234,7 +234,6 @@ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_BOOTDELAY 3 #define CONFIG_BOOTFILE "uImage" -#define CONFIG_BOOTCOMMAND "run bootcmd_net" #define CONFIG_LOADADDR 0x42000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR #define CONFIG_OF_LIBFDT @@ -243,13 +242,81 @@ * Extra Environments */ #define CONFIG_EXTRA_ENV_SETTINGS \ - "console_fsl=console=ttyAM0" \ - "console_mainline=console=ttyAMA0" \ - "netargs=setenv bootargs console=${console_mainline}" \ + "update_nand_full_filename=u-boot.nand\0" \ + "update_nand_firmware_filename=u-boot.sb\0" \ + "update_sd_firmware_filename=u-boot.sd\0" \ + "update_nand_firmware_maxsz=0x100000\0" \ + "update_nand_stride=0x40\0" /* MX28 datasheet ch. 12.12 */ \ + "update_nand_count=0x4\0" /* MX28 datasheet ch. 12.12 */ \ + "update_nand_get_fcb_size=" /* Get size of FCB blocks */ \ + "nand device 0 ; " \ + "nand info ; " \ + "setexpr fcb_sz ${update_nand_stride} * ${update_nand_count};" \ + "setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0" \ + "update_nand_full=" /* Update FCB, DBBT and FW */ \ + "if tftp ${update_nand_full_filename} ; then " \ + "run update_nand_get_fcb_size ; " \ + "nand scrub -y 0x0 ${filesize} ; " \ + "nand write.raw ${loadaddr} 0x0 ${update_nand_fcb} ; " \ + "setexpr update_off ${loadaddr} + ${update_nand_fcb} ; " \ + "setexpr update_sz ${filesize} - ${update_nand_fcb} ; " \ + "nand write ${update_off} ${update_nand_fcb} ${update_sz} ; " \ + "fi\0" \ + "update_nand_firmware=" /* Update only firmware */ \ + "if tftp ${update_nand_firmware_filename} ; then " \ + "run update_nand_get_fcb_size ; " \ + "setexpr fcb_sz ${update_nand_fcb} * 2 ; " /* FCB + DBBT */ \ + "setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; " \ + "setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz};" \ + "nand erase ${fcb_sz} ${fw_sz} ; " \ + "nand write ${loadaddr} ${fcb_sz} ${filesize} ; " \ + "nand write ${loadaddr} ${fw_off} ${filesize} ; " \ + "fi\0" \ + "update_sd_firmware=" /* Update the SD firmware partition */ \ + "if mmc rescan ; then " \ + "if tftp ${update_sd_firmware_filename} ; then " \ + "setexpr fw_sz ${filesize} / 0x200 ; " /* SD block size */ \ + "setexpr fw_sz ${fw_sz} + 1 ; " \ + "mmc write ${loadaddr} 0x800 ${fw_sz} ; " \ + "fi ; " \ + "fi\0" \ + "script=boot.scr\0" \ + "uimage=uImage\0" \ + "console_fsl=ttyAM0\0" \ + "console_mainline=ttyAMA0\0" \ + "console=${console_mainline}\0" \ + "mmcdev=0\0" \ + "mmcpart=2\0" \ + "mmcroot=/dev/mmcblk0p3 rw\0" \ + "mmcrootfstype=ext3 rootwait\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ + "root=${mmcroot} " \ + "rootfstype=${mmcrootfstype}\0" \ + "loadbootscript=" \ + "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ + "bootscript=echo Running bootscript from mmc ...; " \ + "source\0" \ + "loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \ + "mmcboot=echo Booting from mmc ...; " \ + "run mmcargs; " \ + "bootm\0" \ + "netargs=setenv bootargs console=${console},${baudrate} " \ "root=/dev/nfs " \ - "ip=dhcp nfsroot=${serverip}:${nfsroot}\0" \ - "bootcmd_net=echo Booting from net ...; " \ - "run netargs; " \ - "dhcp ${uimage}; bootm\0" \ + "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ + "netboot=echo Booting from net ...; " \ + "run netargs; " \ + "dhcp ${uimage}; bootm\0" + +#define CONFIG_BOOTCOMMAND \ + "if mmc rescan ${mmcdev}; then " \ + "if run loadbootscript; then " \ + "run bootscript; " \ + "else " \ + "if run loaduimage; then " \ + "run mmcboot; " \ + "else run netboot; " \ + "fi; " \ + "fi; " \ + "else run netboot; fi" #endif /* __MX28EVK_CONFIG_H__ */ -- 1.7.10 ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [U-Boot] [PATCH 0/3] i.MX refactoring patchset 2012-06-17 12:58 [U-Boot] [PATCH 0/3] i.MX refactoring patchset Otavio Salvador ` (2 preceding siblings ...) 2012-06-17 12:58 ` [U-Boot] [PATCH 3/3] mx28evk: extend default environment Otavio Salvador @ 2012-06-17 21:54 ` Marek Vasut 3 siblings, 0 replies; 32+ messages in thread From: Marek Vasut @ 2012-06-17 21:54 UTC (permalink / raw) To: u-boot Dear Otavio Salvador, > This patchset include minor changes for i.MX; mainly: > > 1/3: improves the rare case of unkown booting machine <trolling> The word's actually "unknown" ;-D </trolling> > 2/3: generalize the code so it works for i.MX23 and i.MX28 > > The patch 3/3 is what we've been using in Yocto and has been change to > affect only mx28evk. > > Otavio Salvador (3): > imx: Use a clear identification of an unidentified CPU type > mxs: generalize code for print_cpuinfo() > mx28evk: extend default environment It's good, really good :-) > arch/arm/cpu/arm926ejs/mx28/mx28.c | 29 +++++++++++- > arch/arm/cpu/armv7/imx-common/cpu.c | 4 +- > include/configs/mx28evk.h | 83 > +++++++++++++++++++++++++++++++---- 3 files changed, 104 insertions(+), 12 > deletions(-) Best regards, Marek Vasut ^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2012-06-17 21:54 UTC | newest] Thread overview: 32+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-06-17 12:58 [U-Boot] [PATCH 0/3] i.MX refactoring patchset Otavio Salvador 2012-06-17 12:58 ` [U-Boot] [PATCH 1/3] imx: Use a clear identification of an unidentified CPU type Otavio Salvador 2012-06-17 13:05 ` Fabio Estevam 2012-06-17 13:09 ` Otavio Salvador 2012-06-17 13:13 ` Fabio Estevam 2012-06-17 13:21 ` Otavio Salvador 2012-06-17 13:30 ` Marek Vasut 2012-06-17 15:43 ` Stefano Babic 2012-06-17 15:48 ` Otavio Salvador 2012-06-17 16:03 ` Marek Vasut 2012-06-17 17:50 ` Otavio Salvador 2012-06-17 18:04 ` Stefano Babic 2012-06-17 18:40 ` Marek Vasut 2012-06-17 18:04 ` Marek Vasut 2012-06-17 12:58 ` [U-Boot] [PATCH 2/3] mxs: generalize code for print_cpuinfo() Otavio Salvador 2012-06-17 13:10 ` Fabio Estevam 2012-06-17 13:25 ` Fabio Estevam 2012-06-17 13:35 ` Marek Vasut 2012-06-17 14:14 ` Fabio Estevam 2012-06-17 14:35 ` Otavio Salvador 2012-06-17 15:10 ` Marek Vasut 2012-06-17 15:17 ` Otavio Salvador 2012-06-17 13:28 ` Marek Vasut 2012-06-17 15:49 ` Stefano Babic 2012-06-17 16:02 ` Marek Vasut 2012-06-17 17:56 ` Stefano Babic 2012-06-17 18:03 ` Otavio Salvador 2012-06-17 18:41 ` Marek Vasut 2012-06-17 18:04 ` Marek Vasut 2012-06-17 17:49 ` Otavio Salvador 2012-06-17 12:58 ` [U-Boot] [PATCH 3/3] mx28evk: extend default environment Otavio Salvador 2012-06-17 21:54 ` [U-Boot] [PATCH 0/3] i.MX refactoring patchset Marek Vasut
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox