Skip to contentSkip to conversation

i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels

U-Boot Superseded Eric Nelson 10 participants 35 messages Mar 2, 2012 – Mar 7, 2012

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

#1 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
index db1bea9..590030b 100644
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
 #ifdef CONFIG_MXC_SPI
 iomux_v3_cfg_t ecspi1_pads[] = {
 	/* SS1 */
include/configs/mx6qsabrelite.h +1 -0
index 93000f0..85f6f7a 100644
@@ -33,6 +33,7 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG
 
 /* Size of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
Signature · 1 line
1.7.9
#2 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 33 lines

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
 #ifdef CONFIG_MXC_SPI
 iomux_v3_cfg_t ecspi1_pads[] = {
 	/* SS1 */
(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 93000f0..85f6f7a 100644

include/configs/mx6qsabrelite.h line 36

Quoted 4 lines
include/configs/mx6qsabrelite.h +1 -0
@@ -33,6 +33,7 @@
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG

I think you can avoid this define altogether, you're using it anyway.

M

#3 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 31 lines · Marek Vasut
Quoted 31 lines

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---
  board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
  include/configs/mx6qsabrelite.h               |    1 +
  2 files changed, 8 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
  }
  #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
  #ifdef CONFIG_MXC_SPI
  iomux_v3_cfg_t ecspi1_pads[] = {
  	/* SS1 */
(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 93000f0..85f6f7a 100644 --- a/include/configs/mx6qsabrelite.h

Quoted 9 lines

include/configs/mx6qsabrelite.h line 36

Quoted 6 lines

+++ b/include/configs/mx6qsabrelite.h

include/configs/mx6qsabrelite.h +1 -0
@@ -33,6 +33,7 @@
  #define CONFIG_CMDLINE_TAG
  #define CONFIG_SETUP_MEMORY_TAGS
  #define CONFIG_INITRD_TAG
+#define CONFIG_REVISION_TAG

I think you can avoid this define altogether, you're using it anyway.

Hi Marek,

I'm not sure I understand.

I need to define CONFIG_REVISION_TAG in order to get bootm to add the tag:

	http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/lib/bootm.c;h=afa0093df7620606ee12b4dc1dd2ee37adee347c;hb=master#l137

I made get_board_rev() conditional so we can get rid of it if (once) we're only using DT kernels.

#4 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 48 lines · Marek Vasut
Quoted 39 lines
Quoted 39 lines

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---

  board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
  include/configs/mx6qsabrelite.h               |    1 +
  2 files changed, 8 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 
  }
  #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
 
  #ifdef CONFIG_MXC_SPI
  iomux_v3_cfg_t ecspi1_pads[] = {

/* SS1 */

(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 93000f0..85f6f7a 100644

include/configs/mx6qsabrelite.h +0 -0
@@ -33,6 +33,7 @@
 
Quoted 7 lines

include/configs/mx6qsabrelite.h

Quoted 5 lines
include/configs/mx6qsabrelite.h +1 -0
  #define CONFIG_CMDLINE_TAG
  #define CONFIG_SETUP_MEMORY_TAGS
  #define CONFIG_INITRD_TAG
 
+#define CONFIG_REVISION_TAG

I think you can avoid this define altogether, you're using it anyway.

Quoted 7 lines

Hi Marek,

I'm not sure I understand.

I need to define CONFIG_REVISION_TAG in order to get bootm to add the tag:

	http://git.denx.de/?p=u-

boot.git;a=blob;f=arch/arm/lib/bootm.c;h=afa0093df

Quoted 4 lines

7620606ee12b4dc1dd2ee37adee347c;hb=master#l137

I made get_board_rev() conditional so we can get rid of it if (once) we're only using DT kernels.

You have CONFIG_REVISION_TAG set unconditionally, so you don't need the macro around that get_revision() function. I might be wrong.

M

#5 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 55 lines · Marek Vasut
Quoted 48 lines · Marek Vasut
Quoted 39 lines
Quoted 39 lines

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---

   board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
   include/configs/mx6qsabrelite.h               |    1 +
   2 files changed, 8 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 
   }
   #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
 
   #ifdef CONFIG_MXC_SPI
   iomux_v3_cfg_t ecspi1_pads[] = {
   	/* SS1 */
(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 93000f0..85f6f7a 100644

include/configs/mx6qsabrelite.h +0 -0
@@ -33,6 +33,7 @@
 
Quoted 7 lines

include/configs/mx6qsabrelite.h

Quoted 5 lines
include/configs/mx6qsabrelite.h +1 -0
   #define CONFIG_CMDLINE_TAG
   #define CONFIG_SETUP_MEMORY_TAGS
   #define CONFIG_INITRD_TAG
 
+#define CONFIG_REVISION_TAG

I think you can avoid this define altogether, you're using it anyway.

Quoted 7 lines

Hi Marek,

I'm not sure I understand.

I need to define CONFIG_REVISION_TAG in order to get bootm to add the tag:

	http://git.denx.de/?p=u-
Quoted 9 lines

boot.git;a=blob;f=arch/arm/lib/bootm.c;h=afa0093df

Quoted 4 lines

7620606ee12b4dc1dd2ee37adee347c;hb=master#l137

I made get_board_rev() conditional so we can get rid of it if (once) we're only using DT kernels.

You have CONFIG_REVISION_TAG set unconditionally, so you don't need the macro around that get_revision() function. I might be wrong.

You're right. Its just that I did that deliberately so you can save the (admittedly) small amount of code by editing mx6qsabrelite.h.

Since U-Boot doesn't really have a configuration step, I find that folks tend to tweak the board configuration file quite a bit based on their needs.

Though it's a bit of a hack, we even formalized it on our i.MX5x products to allow customers to keep their git repositories clean:
http://boundarydevices.com/blogs/customizing-u-boot-on-i-mx

#6 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 62 lines · Marek Vasut
Quoted 61 lines
Quoted 48 lines · Marek Vasut
Quoted 39 lines
Quoted 39 lines

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---

   board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
   include/configs/mx6qsabrelite.h               |    1 +
   2 files changed, 8 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +7 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 
   }
   #endif
 
+#ifdef CONFIG_REVISION_TAG
+u32 get_board_rev(void)
+{
+	return 0x63000 ;
+}
+#endif
+
 
   #ifdef CONFIG_MXC_SPI
   iomux_v3_cfg_t ecspi1_pads[] = {
   	/* SS1 */
(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 93000f0..85f6f7a 100644

include/configs/mx6qsabrelite.h +0 -0
@@ -33,6 +33,7 @@
 
Quoted 7 lines

include/configs/mx6qsabrelite.h

Quoted 5 lines
include/configs/mx6qsabrelite.h +1 -0
   #define CONFIG_CMDLINE_TAG
   #define CONFIG_SETUP_MEMORY_TAGS
   #define CONFIG_INITRD_TAG
 
+#define CONFIG_REVISION_TAG

I think you can avoid this define altogether, you're using it anyway.

Quoted 8 lines

Hi Marek,

I'm not sure I understand.

I need to define CONFIG_REVISION_TAG in order to get bootm to add

the tag:

	http://git.denx.de/?p=u-

boot.git;a=blob;f=arch/arm/lib/bootm.c;h=afa0093df

Quoted 2 lines

7620606ee12b4dc1dd2ee37adee347c;hb=master#l137

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I made get_board_rev() conditional so we can get rid of it if (once) we're only using DT kernels.

You have CONFIG_REVISION_TAG set unconditionally, so you don't need the macro around that get_revision() function. I might be wrong.

You're right. Its just that I did that deliberately so you can save the (admittedly) small amount of code by editing mx6qsabrelite.h.

Shouldn't that be removed by the compiler anyway?

Quoted 4 lines

Since U-Boot doesn't really have a configuration step, I find that folks tend to tweak the board configuration file quite a bit based on their needs.

This needs to be fixed, we need kbuild. Who's up to doing it ? ;-D

Quoted 4 lines

Though it's a bit of a hack, we even formalized it on our i.MX5x products to allow customers to keep their git repositories clean:
http://boundarydevices.com/blogs/customizing-u-boot-on-i-mx

That's good, thank you :)

Cheers!
M

#7 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

In reply to Eric Nelson

Dear Eric Nelson,

Quoted 4 lines · In message <[email protected]> you wrote:

Since U-Boot doesn't really have a configuration step, I find that folks tend to tweak the board configuration file quite a bit based on their needs.

Yes, peaople do that a lot, nd it has always been a very good idea to at least detect such modifications of the code. The worst thing to happen is when you receive a bug report for version FOO, and you have no chance of detecting that somebody actually messed with the configuration and/or the code.

Quoted 3 lines

Though it's a bit of a hack, we even formalized it on our i.MX5x products to allow customers to keep their git repositories clean:

	....

[Link deleted to not further distribute this horrible stuff.]

Frankly, this "keep their git repositories clean" is a really, really bad idea. We pay special care to add the git commit ID to the U-Boot version string so you can easily detect if somebody messed with the code, and you come up and invent methods of circumventing that.

This is totally counterproductive.

If you use this, that's your business. But please do me the favour and do not recommend this to others.

Thanks.

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Alliance: In international politics, the union  of  two  thieves  who
have  their hands so deeply inserted in each other's pocket that they
cannot separately plunder a third.                   - Ambrose Bierce
#8 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

Quoted 24 lines · Wolfgang Denk

Dear Eric Nelson,

Quoted 4 lines · In message<[email protected]> you wrote:

Since U-Boot doesn't really have a configuration step, I find that folks tend to tweak the board configuration file quite a bit based on their needs.

Yes, peaople do that a lot, nd it has always been a very good idea to at least detect such modifications of the code. The worst thing to happen is when you receive a bug report for version FOO, and you have no chance of detecting that somebody actually messed with the configuration and/or the code.

Quoted 3 lines

Though it's a bit of a hack, we even formalized it on our i.MX5x products to allow customers to keep their git repositories clean:

	....

[Link deleted to not further distribute this horrible stuff.]

Frankly, this "keep their git repositories clean" is a really, really bad idea. We pay special care to add the git commit ID to the U-Boot version string so you can easily detect if somebody messed with the code, and you come up and invent methods of circumventing that.

Quoted 5 lines

This is totally counterproductive.

If you use this, that's your business. But please do me the favour and do not recommend this to others.

We don't. Sorry if I implied otherwise.

We recommend that customers keep their own repositories with changes from our "standard" releases, but we have a number of customers whose complete set of differences amounts to default environment variables and/or choices of serial consoles for which we don't want to carry and publish an entire configuration.

This hack was borne out of frustration when getting a 'revision-dirty' reference back from a customer because they've changed something simple (usually environment settings).

#9 lore raw

PATCH 1/3 i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG

In reply to Eric Nelson
Quoted 14 lines · Eric Nelson

Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU.

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    7 +++++++
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +0 -0
index db1bea9..590030b 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c int board_mmc_init(bd_t *bis) · line 218

Quoted 4 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +1 -0
@@ -215,6 +215,13 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_REVISION_TAG

You add CONFIG_REVISION_TAG, then you can get rid of unneeded #ifdef

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#10 lore raw

PATCH 2/3 i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE

In reply to Eric Nelson

Allow non-dt kernels to boot

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    6 ++++--
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +4 -2
index 590030b..2786482 100644
@@ -282,8 +282,10 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+	/* board id for linux */
+	gd->bd->bi_arch_number = MACH_TYPE_MX6Q_SABRELITE;
+	/* address of boot parameters */
+	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
        return 0;
 }
include/configs/mx6qsabrelite.h +1 -0
index 85f6f7a..53869a9 100644
@@ -27,6 +27,7 @@
 #define CONFIG_SYS_MX6_CLK32           32768
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
+#define MACH_TYPE_MX6Q_SABRELITE       3769
 
 #include <asm/arch/imx-regs.h>
 
Signature · 1 line
1.7.9
#11 lore raw

PATCH 2/3 i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE

Quoted 31 lines

Allow non-dt kernels to boot

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    6 ++++--
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/board/freescale/mx6qsabrelite/mx6qsabrelite.c index 590030b..2786482 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c +4 -2
@@ -282,8 +282,10 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+	/* board id for linux */
+	gd->bd->bi_arch_number = MACH_TYPE_MX6Q_SABRELITE;
+	/* address of boot parameters */
+	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
        return 0;
 }
(quoted diff) +0 -0

b/include/configs/mx6qsabrelite.h index 85f6f7a..53869a9 100644

include/configs/mx6qsabrelite.h line 30

Quoted 4 lines
include/configs/mx6qsabrelite.h +1 -0
@@ -27,6 +27,7 @@
 #define CONFIG_SYS_MX6_CLK32           32768
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
+#define MACH_TYPE_MX6Q_SABRELITE       3769

Just use #define CONFIG_MACH_TYPE 3769

M

#12 lore raw

PATCH 2/3 i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE

In reply to Eric Nelson
Quoted 13 lines · Eric Nelson

Allow non-dt kernels to boot

---
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |    6 ++++--
 include/configs/mx6qsabrelite.h               |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)
board/freescale/mx6qsabrelite/mx6qsabrelite.c +0 -0
index 590030b..2786482 100644

board/freescale/mx6qsabrelite/mx6qsabrelite.c int board_early_init_f(void) · line 286

Quoted 7 lines
board/freescale/mx6qsabrelite/mx6qsabrelite.c +2 -2
@@ -282,8 +282,10 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+	/* board id for linux */
+	gd->bd->bi_arch_number = MACH_TYPE_MX6Q_SABRELITE;

You do not needed. This is done in common code. Add only CONFIG_MACH_TYPE in mx6qsabrelite.h

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#13 lore raw

PATCH 3/3 i.MX6: mx6qsabrelite: add ext2 support

In reply to Eric Nelson

Current Ubuntu releases from Freescale contain a boot script in ext3 filesystem.

---
 include/configs/mx6qsabrelite.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/mx6qsabrelite.h +1 -0
index 53869a9..51ed791 100644
@@ -66,6 +66,7 @@
 #define CONFIG_MMC
 #define CONFIG_CMD_MMC
 #define CONFIG_GENERIC_MMC
+#define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 #define CONFIG_DOS_PARTITION
 
Signature · 1 line
1.7.9
#14 lore raw

PATCH 3/3 i.MX6: mx6qsabrelite: add ext2 support

Quoted 4 lines · Eric Nelson

Current Ubuntu releases from Freescale contain a boot script in ext3 filesystem.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#15 lore raw
In reply to Eric Nelson
Quoted 7 lines

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

Almost looks good, just minor tweaks needed. Thanks for your good work so far, keep it up !

M

#16 lore raw
In reply to Eric Nelson

Dear Eric Nelson,

Quoted 6 lines · In message <1330728909-12203-1-git-send-email-eric.nelson@boundarydevices.com>…

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

Is this really needed? I feel we should rather focus on current mainline kernel code and support that well instead of adding backward compatibility complexity for old, obsolete code.

People who want to run FSL kernels should be able run FSL's version of U-Boot.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
No journaling file system can recover your data if the disk dies.
                                 - Steve Rago in <[email protected]>
#17 lore raw
Quoted 6 lines · Wolfgang Denk

Dear Eric Nelson,

Quoted 3 lines · In message<1330728909-12203-1-git-send-email-eric.nelson@boundarydevices.com>…

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

Quoted 8 lines
Quoted 3 lines

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

Is this really needed? I feel we should rather focus on current mainline kernel code and support that well instead of adding backward compatibility complexity for old, obsolete code.

I think new code is still being written for 2.6.38, so it may be obsolete, but not necessarily old.

Quoted 3 lines

People who want to run FSL kernels should be able run FSL's version of U-Boot.

They certainly can.

These small patches will be a big help to those of us who need to support both though, and it's not yet clear how long the kernel transition will take.

Quoted 4 lines

Best regards,

Wolfgang Denk

Regards,

Eric

#18 lore raw
Quoted 3 lines · Eric Nelson

These small patches will be a big help to those of us who need to support both though, and it's not yet clear how long the kernel transition will take.

Agree. It would be extremely helpful if we could run FSL kernel with mainline U-boot.

Thanks,

Fabio Estevam

#19 lore raw
In reply to Eric Nelson

Dear Eric Nelson,

Quoted 3 lines · In message <[email protected]> you wrote:

I think new code is still being written for 2.6.38, so it may be obsolete, but not necessarily old.

It definitely is old - Linux mainline has seen 50240 commits since v2.6.38, with 3243564 lines added and 2329522 removed.

You probably do not want to consider it obsolete yet... I do. YMMV.

Quoted 3 lines

These small patches will be a big help to those of us who need to support both though, and it's not yet clear how long the kernel transition will take.

The problem is that these changes will cause additional maintenance efforts in the future. I think we have reached a point in time where new boards that get added should only add support for DT baed configurations, and get rid of this MACH_ID crap. Just look at the number of recent board breakages and need of fixes just because IDs get dropped from the mach_id database.

I feel efforts would be better invested if they were directed in improving current mainline kernel code.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"When the only  tool  you  have  is  a  hammer,  you  tend  to  treat
everything as if it were a nail."                    - Abraham Maslow
#20 lore raw
In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 10 lines · Wolfgang Denk

Dear Eric Nelson,

Quoted 6 lines · In message<1330728909-12203-1-git-send-email-eric.nelson@boundarydevices.com>…

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

Quoted 6 lines

Is this really needed? I feel we should rather focus on current mainline kernel code and support that well instead of adding backward compatibility complexity for old, obsolete code.

People who want to run FSL kernels should be able run FSL's version of U-Boot.

Hmm, yes, some days ago, when this discussion started, I was under the same impression. But:

After thinking some days about it, I wonder if it would help to make the transition path to mainline easier. So maybe it's not mainly a technical issue, but more a political one ;)

Having Freescale working on these quite old and unclean U-Boot and Kernel versions is a pain. Kernel is an other topic, but with U-Boot, thanks to the very good work of everybody, we are in a good position to get rid of the old Freescale U-Boot, now. And get everybody to work with mainline and create patches against it.

So if it helps to apply some backward compatibility to make it easier for everybody, esp. Freescale, to switch to mainline U-Boot, I think we should try it.

Let's try to make the first step with U-Boot. Then try to make the next, harder, step with the kernel.

Best regards

Dirk

#21 lore raw

Dear Dirk,

Quoted 6 lines · In message <[email protected]> you wrote:

Having Freescale working on these quite old and unclean U-Boot and Kernel versions is a pain. Kernel is an other topic, but with U-Boot, thanks to the very good work of everybody, we are in a good position to get rid of the old Freescale U-Boot, now. And get everybody to work with mainline and create patches against it.

ACK.

Quoted 3 lines

So if it helps to apply some backward compatibility to make it easier for everybody, esp. Freescale, to switch to mainline U-Boot, I think we should try it.

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

I think we should make a clear statement that new boards that get added should only support DT based configurations. If really needed, legacy MACH_ID support may be kept out of tree.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Overflow on /dev/null, please empty the bit bucket.
#22 lore raw
Quoted 16 lines · Wolfgang Denk

Dear Dirk,

Quoted 6 lines · In message <[email protected]> you wrote:

Having Freescale working on these quite old and unclean U-Boot and Kernel versions is a pain. Kernel is an other topic, but with U-Boot, thanks to the very good work of everybody, we are in a good position to get rid of the old Freescale U-Boot, now. And get everybody to work with mainline and create patches against it.

ACK.

Quoted 3 lines

So if it helps to apply some backward compatibility to make it easier for everybody, esp. Freescale, to switch to mainline U-Boot, I think we should try it.

Quoted 8 lines

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

I think we should make a clear statement that new boards that get added should only support DT based configurations. If really needed, legacy MACH_ID support may be kept out of tree.

I think a point here is that boards must not use any macro defined in mach-types.h, such as machine_is_*. U-Boot does not need it, and their usage makes the code strictly dependent from the kernel legacy mach-ids.

If a board defines only CONFIG_MACH_TYPE in its own configuration file, it should not break if we decide in future to drop it completely.

Best regards,
Stefano Babic

#23 lore raw
In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 12 lines · Wolfgang Denk

Dear Dirk,

Quoted 6 lines · In message<[email protected]> you wrote:

Having Freescale working on these quite old and unclean U-Boot and Kernel versions is a pain. Kernel is an other topic, but with U-Boot, thanks to the very good work of everybody, we are in a good position to get rid of the old Freescale U-Boot, now. And get everybody to work with mainline and create patches against it.

ACK.

Quoted 8 lines
Quoted 3 lines

So if it helps to apply some backward compatibility to make it easier for everybody, esp. Freescale, to switch to mainline U-Boot, I think we should try it.

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

Now I'm just trying to learn something regarding [1]:

Which changes would you accept in the category 'backward compatibility'?

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

Many thanks and best regards

Dirk

[1]

http://lists.denx.de/pipermail/u-boot/2012-March/119207.html

http://lists.denx.de/pipermail/u-boot/2012-March/119208.html

(assuming this will be changed to

include/configs/mx6qsabrelite.h +1 -0
@@ -27,6 +27,7 @@
  #define CONFIG_SYS_MX6_CLK32           32768
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_MACH_TYPE       3769
 
  #include <asm/arch/imx-regs.h>
 

)

#24 lore raw

Dear Dirk Behme,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

Now I'm just trying to learn something regarding [1]:

Which changes would you accept in the category 'backward compatibility'?

There are 3 commits in this series:

[PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support

I dislike #1 because it uses the completely undocumented CONFIG_REVISION_TAG, and I agree with Marek's and Stefano's comments.

The problems I mentioned are with # 2, which now would depend on MACH_TYPE_MX6Q_SABRELITE, which may or may not exist.

Also, I think we should not need this any more at all, as we now have DT support in Linux on ARM, too.

I see no issues with # 3.

Quoted 2 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

include/configs/mx6qsabrelite.h line 30

Quoted 9 lines

(assuming this will be changed to

include/configs/mx6qsabrelite.h +1 -0
@@ -27,6 +27,7 @@
  #define CONFIG_SYS_MX6_CLK32           32768
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_MACH_TYPE       3769

Such a change would avoid breakages as the ones mentioned above, but is this nice? Either we have a mach-types.h that can be used, or we don't, in which case we should stop using any definitions from it, especially for new boards where it's not needed due to DT support in the kernel.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is better to marry than to burn.
                                - Bible ``I Corinthians'' ch. 7, v. 9
#25 lore raw
Quoted 25 lines · Wolfgang Denk

Dear Dirk Behme,

Quoted 7 lines · In message<[email protected]> you wrote:
Quoted 4 lines

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

Now I'm just trying to learn something regarding [1]:

Which changes would you accept in the category 'backward compatibility'?

There are 3 commits in this series:

[PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support

I dislike #1 because it uses the completely undocumented CONFIG_REVISION_TAG, and I agree with Marek's and Stefano's comments.

The problems I mentioned are with # 2, which now would depend on MACH_TYPE_MX6Q_SABRELITE, which may or may not exist.

Also, I think we should not need this any more at all, as we now have DT support in Linux on ARM, too.

Quoted 8 lines

I see no issues with # 3.

Quoted 2 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

Would you rather that I take RMK's cleaned up file, and undelete the machines that u-boot
uses? That would be more simple than adding to the board's config file. I can delete all of the mach_is_xxx macros in mach-types while I'm at it.

Thanks
Troy

#26 lore raw

Dear Troy Kisky,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 3 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

Would you rather that I take RMK's cleaned up file, and undelete the machines that u-boot
uses? That would be more simple than adding to the board's config file. I can delete all of the mach_is_xxx macros in mach-types while I'm at it.

I think we had this discussion before (when RMK's changes hit us), and it was decided not to do this. IIRC we decided not to do this.

I have never understood why this mach_types thingy was needed (other rchitectures worked fine without it, or better), and now we are on the edge of obsoleting it. So all efforts trying to maintain this file are futile, and we would have to redo these for any updates of the file.

I feel this is not a good investment of our time.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
:       I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it.  Any ideas?  (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <[email protected]>
#27 lore raw

Hi Wolfgang,

Le 04/03/2012 09:39, Wolfgang Denk a ?crit :

Quoted 9 lines

Dear Troy Kisky,

Quoted 6 lines · In message<[email protected]> you wrote:
Quoted 6 lines
Quoted 3 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

Quoted 7 lines
Quoted 4 lines

Would you rather that I take RMK's cleaned up file, and undelete the machines that u-boot
uses? That would be more simple than adding to the board's config file. I can delete all of the mach_is_xxx macros in mach-types while I'm at it.

I think we had this discussion before (when RMK's changes hit us), and it was decided not to do this. IIRC we decided not to do this.

YRC. :)

The retained strategy is to not fiddle with the Linux mach-type.h and to complement (and lampshade) any discrepancy between Linux and U-Boot support in the board config files.

Quoted 6 lines

I have never understood why this mach_types thingy was needed (other rchitectures worked fine without it, or better), and now we are on the edge of obsoleting it. So all efforts trying to maintain this file are futile, and we would have to redo these for any updates of the file.

I feel this is not a good investment of our time.

Hopefully FDT will make mach-types obsolete, except for the rare boards which will want to keep support for it, at which point we'll decide to either maintain or own, reduced and mostly legacy, mach-type file, or to move mach-type declarations in the board's config files.

Quoted 3 lines

Best regards,

Wolfgang Denk

Amicalement,

Signature · 1 line
Albert.
#28 lore raw
In reply to Wolfgang Denk
Quoted 2 lines · Wolfgang Denk

Dear Dirk Behme,

Hi,

Quoted 11 lines
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

Now I'm just trying to learn something regarding [1]:

Which changes would you accept in the category 'backward compatibility'?

Quoted 8 lines

There are 3 commits in this series:

[PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support

I dislike #1 because it uses the completely undocumented CONFIG_REVISION_TAG, and I agree with Marek's and Stefano's comments.

A lot of boards are currently set CONFIG_REVISION_TAG. Sure, it would be nice to document it. To be consistent we should drop this CONFIG_ from all boards, or add documentation for it.

However, I am asking if this TAG is really needed. I have searched in 2.6.38 Kernel provided by Freescale if the TAG is really evaluated to set different revisions of the boards, but I have not found anything. Is it really needed ? If not, we should drop it.

Quoted 3 lines

The problems I mentioned are with # 2, which now would depend on MACH_TYPE_MX6Q_SABRELITE, which may or may not exist.

Right, I agree. And we do not know (maybe it is not this case) if MACH_TYPE_MX6Q_SABRELITE will be dropped in the future. IMHO we should not use mach-types at all..

Quoted 5 lines

Also, I think we should not need this any more at all, as we now have DT support in Linux on ARM, too.

I see no issues with # 3.

I will merge #3 into u-boot-imx

Quoted 9 lines
Quoted 3 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

Quoted 2 lines

(assuming this will be changed to

Quoted 11 lines

include/configs/mx6qsabrelite.h line 30

Quoted 7 lines
include/configs/mx6qsabrelite.h +1 -0
@@ -27,6 +27,7 @@
  #define CONFIG_SYS_MX6_CLK32           32768
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_MACH_TYPE       3769

Such a change would avoid breakages as the ones mentioned above, but is this nice? Either we have a mach-types.h that can be used, or we don't,

Personally I vote for the second choice. U-boot does not use mach-types, and it is at the end only a parameter for the kernel.

I think the solution in the patch is better as to try to maintain the mach-types file: not very nice, but setting its value is not different as several other setups inside the configuration file that are very board specifiv. And CONFIG_MACH_TYPE is well documented.

Quoted 3 lines

in which case we should stop using any definitions from it, especially for new boards where it's not needed due to DT support in the kernel.

Agree completely - mach-types introduces a strong dependency with the kernel, and we do not need it.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#29 lore raw

Hi,

Quoted 26 lines · Stefano Babic
Quoted 2 lines · Wolfgang Denk

Dear Dirk Behme,

Hi,

Quoted 11 lines
Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Agreed. If these patches were only for backward compatibility I would not complain much. But they are known to introduce forward incompati- bilities with all this MACH_ID stuff, and this is what I would like to avoid.

Now I'm just trying to learn something regarding [1]:

Which changes would you accept in the category 'backward compatibility'?

Quoted 8 lines

There are 3 commits in this series:

[PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support

I dislike #1 because it uses the completely undocumented CONFIG_REVISION_TAG, and I agree with Marek's and Stefano's comments.

Quoted 8 lines

A lot of boards are currently set CONFIG_REVISION_TAG. Sure, it would be nice to document it. To be consistent we should drop this CONFIG_ from all boards, or add documentation for it.

However, I am asking if this TAG is really needed. I have searched in 2.6.38 Kernel provided by Freescale if the TAG is really evaluated to set different revisions of the boards, but I have not found anything. Is it really needed ? If not, we should drop it.

Linux's system_rev global variable is set to that value. You can check for it by "cat /proc/cpuinfo | grep Revision".

Quoted 8 lines
Quoted 4 lines

The problems I mentioned are with # 2, which now would depend on MACH_TYPE_MX6Q_SABRELITE, which may or may not exist.

Right, I agree. And we do not know (maybe it is not this case) if MACH_TYPE_MX6Q_SABRELITE will be dropped in the future. IMHO we should not use mach-types at all..

+1
making the mach-type local to a board moves the maintenance burden to a board maintainer which is good because it can be decided on per board basis.
Also, we should always raise the question if it is still needed for a particular board and don't let it in, if it is not...

Quoted 30 lines
Quoted 6 lines

Also, I think we should not need this any more at all, as we now have DT support in Linux on ARM, too.

I see no issues with # 3.

I will merge #3 into u-boot-imx

Quoted 9 lines
Quoted 3 lines

And which changes 'introduce forward incompatibilities', and what are these incompatibilities?

See the recent problems that occurred when RMK decided to "clean up" the machids file.

Quoted 2 lines

(assuming this will be changed to

Quoted 11 lines

include/configs/mx6qsabrelite.h line 30

Quoted 7 lines
include/configs/mx6qsabrelite.h +1 -0
@@ -27,6 +27,7 @@
  #define CONFIG_SYS_MX6_CLK32           32768
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO
+#define CONFIG_MACH_TYPE       3769

Such a change would avoid breakages as the ones mentioned above, but is this nice? Either we have a mach-types.h that can be used, or we don't,

Quoted 2 lines

Personally I vote for the second choice. U-boot does not use mach-types, and it is at the end only a parameter for the kernel.

+1

Quoted 5 lines

I think the solution in the patch is better as to try to maintain the mach-types file: not very nice, but setting its value is not different as several other setups inside the configuration file that are very board specifiv.

+1

Quoted 1 line

And CONFIG_MACH_TYPE is well documented.

10x ;-)

Quoted 7 lines
Quoted 4 lines

in which case we should stop using any definitions from it, especially for new boards where it's not needed due to DT support in the kernel.

Agree completely - mach-types introduces a strong dependency with the kernel, and we do not need it.

+1

I think, some more time is needed for the transition to DT.
We should let the boards use non-DT configurations, but move the maintenance to the board maintainer (i.e. set the CONFIG_MACH_TYPE in the board config file).
Also, soon there will be no non-DT boards accepted in the mainline kernel (probably, also, there will be no new machine types accepted in the machine types registry), so the need for the mach-type will just go away, no?

Signature · 2 lines
Regards,
Igor.
#30 lore raw

[U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels)

In reply to Stefano Babic
Quoted 14 lines · Stefano Babic
Quoted 4 lines · Wolfgang Denk

Dear Dirk Behme,

<snip>

Quoted 8 lines

There are 3 commits in this series:

[PATCH 1/3] i.MX6: mx6qsabrelite: add CONFIG_REVISION_TAG [PATCH 2/3] i.MX6: mx6qsabrelite: add MACH_TYPE_MX6Q_SABRELITE [PATCH 3/3] i.MX6: mx6qsabrelite: add ext2 support

I dislike #1 because it uses the completely undocumented CONFIG_REVISION_TAG, and I agree with Marek's and Stefano's comments.

Quoted 9 lines

A lot of boards are currently set CONFIG_REVISION_TAG. Sure, it would be nice to document it. To be consistent we should drop this CONFIG_ from all boards, or add documentation for it.

However, I am asking if this TAG is really needed. I have searched in 2.6.38 Kernel provided by Freescale if the TAG is really evaluated to set different revisions of the boards, but I have not found anything. Is it really needed ? If not, we should drop it.

The linkage is really indirect. The ATAG item is still supported in the main-line kernel for ARM:

	http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/kernel/setup.c;h=a255c39612ca3cfa10bddb7c7728216efeeb04d5;hb=HEAD#l704

The breakage I noticed was in the VPU driver, which refused to load with a zero-value in system_rev. The net result was no video playback in the Freescale Android ICS release.

#31 lore raw

[U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels)

Quoted 8 lines · Eric Nelson

The linkage is really indirect. The ATAG item is still supported in the main-line kernel for ARM:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/kernel/setup.c;h=a255c39612ca3cfa10bddb7c7728216efeeb04d5;hb=HEAD#l704

The breakage I noticed was in the VPU driver, which refused to load with a zero-value in system_rev. The net result was no video playback in the Freescale Android ICS release.

However, I have not found a statement in FSL's kernel where system_rev in VPU driver is checked, directly or indirectly - neither in VPU driver nor in the board initialization code, nor in another MXC driver. It seems to me a side-effect in FSL's kernel, and for some not yet known reasons the problem disappears with this tag - or can reappear later, because we do not know the cause.

And if I am not wrong, there are two macros in FSL's kernel checking the system_rev (arch/arm/plat-mxc/include/mach/mxc.h):

#define imx_cpu_ver() (system_rev & 0xFF)
#define board_is_rev(rev) (((system_rev & 0x0F00) == rev) ? 1 : 0)

But you defines board_rev as:

Review

Quoted 3 lines
(quoted diff) +3 -0
+u32 get_board_rev(void)
+{
+	return 0x63000 ;

Both macro still return 0x00...there is no change if the ATAG is not set. Sure that the problem you report is really bound to system_rev ? I am quite OT here, we are investigating an issue in FSL kernel on the U-boot ML.

Anyway, the ATAG is supported and as I already said quite common for U-Boot boards. The commit message " Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU." should be extended explaining the real cause (if known) or changed dropping VPU because there is no clear relationship between the ATAG and the issue.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#32 lore raw

[U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels)

Hi Stefano,

Thanks for the feedback and the prod.

Quoted 10 lines · Stefano Babic
Quoted 7 lines · Eric Nelson

The linkage is really indirect. The ATAG item is still supported in the main-line kernel for ARM:

     http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=arch/arm/kernel/setup.c;h=a255c39612ca3cfa10bddb7c7728216efeeb04d5;hb=HEAD#l704

The breakage I noticed was in the VPU driver, which refused to load with a zero-value in system_rev. The net result was no video playback in the Freescale Android ICS release.

Quoted 7 lines

However, I have not found a statement in FSL's kernel where system_rev in VPU driver is checked, directly or indirectly - neither in VPU driver nor in the board initialization code, nor in another MXC driver. It seems to me a side-effect in FSL's kernel, and for some not yet known reasons the problem disappears with this tag - or can reappear later, because we do not know the cause.

I did the same search but was apparently not as persistent as you were. The symptom is simple: Video won't play back on Android (R13.1 ICS) without the system revision but play nicely with it.

Quoted 7 lines

And if I am not wrong, there are two macros in FSL's kernel checking the system_rev (arch/arm/plat-mxc/include/mach/mxc.h):

#define imx_cpu_ver() (system_rev& 0xFF)
#define board_is_rev(rev) (((system_rev& 0x0F00) == rev) ? 1 : 0)

But you defines board_rev as:

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+u32 get_board_rev(void)
+{
+	return 0x63000 ;

Both macro still return 0x00...there is no change if the ATAG is not set. Sure that the problem you report is really bound to system_rev ? I am quite OT here, we are investigating an issue in FSL kernel on the U-boot ML.

I think I just found the culprit, and it's in userspace, not in the kernel. In package imx-lib-11.11.01, file vpu/vpu.c, there's this routine that sets a global system_rev based on /proc/cpuinfo:

static int get_system_rev(void)

{
	FILE *fp;
	char buf[1024];
	int nread;
	char *tmp, *rev;
	int ret = -1;

	fp = fopen("/proc/cpuinfo", "r");
	if (fp == NULL) {
		perror("/proc/cpuinfo\n");
		return ret;
	}

	nread = fread(buf, 1, sizeof(buf), fp);
	fclose(fp);
	if ((nread == 0) || (nread == sizeof(buf))) {
		fclose(fp);
		return ret;
	}

	buf[nread] = '\0';

	tmp = strstr(buf, "Revision");
	if (tmp != NULL) {
		rev = index(tmp, ':');
		if (rev != NULL) {
			rev++;
			system_rev = strtoul(rev, NULL, 16);
			ret = 0;
		}
	}

	return ret;
}

The global is then exported via macros:

	vpu/vpu_io.c:unsigned int system_rev;
	vpu/vpu_io.c:static int get_system_rev(void)
	vpu/vpu_io.c:			system_rev = strtoul(rev, NULL, 16);
	vpu/vpu_io.c:	ret = get_system_rev();
	vpu/vpu_lib.h:extern unsigned int system_rev;
	vpu/vpu_lib.h:#define mxc_cpu()               (system_rev >> 12)
	vpu/vpu_lib.h:#define mxc_cpu_rev()           (system_rev & 0xFF)

and used to find the firmware file:

	vpu/vpu_util.c:	sprintf(temp_str, "vpu_fw_imx%2x.bin", mxc_cpu());

...all to support the userspace I/O for the VPU.

We are way off topic here, but I certainly hope we can address this in the future and get a real driver written for the VPU.

Quoted 6 lines

Anyway, the ATAG is supported and as I already said quite common for U-Boot boards. The commit message " Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU." should be extended explaining the real cause (if known) or changed dropping VPU because there is no clear relationship between the ATAG and the issue.

How about something more generic like this?
"Freescale Linux distributions depend on system_rev".

Quoted 3 lines

Best regards,
Stefano Babic

#33 lore raw

[U-Boot] CONFIG_REVISION (was i.MX6: mx6qsabrelite: allow use with Freescale 2.6.38 kernels)

Quoted 2 lines · Eric Nelson

Hi Stefano,

Hi Eric,

Quoted 4 lines

I did the same search but was apparently not as persistent as you were. The symptom is simple: Video won't play back on Android (R13.1 ICS) without the system revision but play nicely with it.

Ok, we know the symptoms...

Quoted 49 lines

I think I just found the culprit, and it's in userspace, not in the kernel. In package imx-lib-11.11.01, file vpu/vpu.c, there's this routine that sets a global system_rev based on /proc/cpuinfo:

static int get_system_rev(void)

{
    FILE *fp;
    char buf[1024];
    int nread;
    char *tmp, *rev;
    int ret = -1;

    fp = fopen("/proc/cpuinfo", "r");
    if (fp == NULL) {
        perror("/proc/cpuinfo\n");
        return ret;
    }

    nread = fread(buf, 1, sizeof(buf), fp);
    fclose(fp);
    if ((nread == 0) || (nread == sizeof(buf))) {
        fclose(fp);
        return ret;
    }

    buf[nread] = '\0';

    tmp = strstr(buf, "Revision");
    if (tmp != NULL) {
        rev = index(tmp, ':');
        if (rev != NULL) {
            rev++;
            system_rev = strtoul(rev, NULL, 16);
            ret = 0;
        }
    }

    return ret;
}

The global is then exported via macros:

    vpu/vpu_io.c:unsigned int system_rev;
    vpu/vpu_io.c:static int get_system_rev(void)
    vpu/vpu_io.c:            system_rev = strtoul(rev, NULL, 16);
    vpu/vpu_io.c:    ret = get_system_rev();
    vpu/vpu_lib.h:extern unsigned int system_rev;
    vpu/vpu_lib.h:#define mxc_cpu()               (system_rev >> 12)
    vpu/vpu_lib.h:#define mxc_cpu_rev()           (system_rev & 0xFF)
Quoted 4 lines

and used to find the firmware file:

    vpu/vpu_util.c:    sprintf(temp_str, "vpu_fw_imx%2x.bin", mxc_cpu());

...all to support the userspace I/O for the VPU.

Understood - this is really crappy, because it makes so absurd dependencies that is very easy to break - and when it happens, nobody knows why, as we find now. Really this is a problem neither in u-boot nor in kernel...

Quoted 2 lines

We are way off topic here,

Well, we have now the cause...

Quoted 2 lines

but I certainly hope we can address this in the
future and get a real driver written for the VPU.

..in the mainline kernel...

Quoted 10 lines
Quoted 7 lines

Anyway, the ATAG is supported and as I already said quite common for U-Boot boards. The commit message " Freescale 2.6.38 (Non-DT) kernels require the revision atag to enable the VPU." should be extended explaining the real cause (if known) or changed dropping VPU because there is no clear relationship between the ATAG and the issue.

How about something more generic like this?
"Freescale Linux distributions depend on system_rev".

Because you deeply investigated and found the reason, I propose you add a full description indicating that the imx lib libraries depend on the system_rev in kernel to transfer the correct firmware. So we know it is neither a problem in u-boot nor in kernel, but we as u-bootlers are fair with some bad implemented libraries....

Normally I would say that the fix should be done where the bug is - we are introducing a work-around for a problem in user space. But as I stated previously, the revision tag is used on a lot of ARM boards, and there is no reason to reject it only on this board.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#34 lore raw
In reply to Wolfgang Denk
Quoted 10 lines · Wolfgang Denk

Dear Eric Nelson,

Quoted 6 lines · In message <1330728909-12203-1-git-send-email-eric.nelson@boundarydevices.com>…

This series of patches is needed to allow main-line U-Boot to be used with Freescale's Linux 2.6.38 non-DT kernel releases.

These releases currently require at least the machine type and revision atag entries and are configured to load boot scripts from the ext3 filesystem.

Quoted 6 lines

Is this really needed? I feel we should rather focus on current mainline kernel code and support that well instead of adding backward compatibility complexity for old, obsolete code.

People who want to run FSL kernels should be able run FSL's version of U-Boot.

Generally I agree with you - and it cannot be that U-boot mainline supports old kernels and not mainline kernel.

However, these are slightly changes and at the end conform with most of supported ARM boards, if not all. And it can better convince people to not continue to add features to a really obsolete and dicontinued U-Boot version as 2009.08 is, instead of working with the community on the current U-Boot development.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================