omap: use 512k barebox partition
Subsystems (2)
PATCH 1/1 omap: use 512k barebox partition
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in config
--- arch/arm/boards/pcm049/board.c | 7 +++++-- arch/arm/boards/pcm049/env/config | 2 +- arch/arm/boards/phycard-a-l1/env/config | 2 +- arch/arm/boards/phycard-a-l1/pca-a-l1.c | 9 ++++++--- arch/arm/boards/phycard-a-xl2/env/config | 2 +- arch/arm/boards/phycard-a-xl2/pca-a-xl2.c | 4 ++-- arch/arm/mach-omap/xload.c | 2 +- 7 files changed, 17 insertions(+), 11 deletions(-)
arch/arm/boards/pcm049/board.c +5 -2
@@ -113,9 +113,12 @@ static int pcm049_devices_init(void)#ifdef CONFIG_PARTITION devfs_add_partition ("nand0" ,0x00000 ,SZ_128K ,DEVFS_PARTITION_FIXED ,"xload_raw" );dev_add_bb_dev ("xload_raw" ,"xload" ); -devfs_add_partition ("nand0" ,SZ_128K ,SZ_256K ,DEVFS_PARTITION_FIXED ,"self_raw" ); +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K , +DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,SZ_128K +SZ_256K ,SZ_128K ,DEVFS_PARTITION_FIXED ,"env_raw" ); +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K , +DEVFS_PARTITION_FIXED ,"env_raw" ); +dev_add_bb_dev ("env_raw" ,"env0" );#endif
arch/arm/boards/pcm049/env/config +1 -1
@@ -40,7 +40,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),2M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in)
arch/arm/boards/phycard-a-l1/env/config +1 -1
@@ -70,7 +70,7 @@ bootargs="$bootargs omapdss.def_disp=pd050vl1" #bootargs="$bootargs omapdss.def_disp=pd104slf" #bootargs="$bootargs omapdss.def_disp=pm070wl4" -nand_parts="512k(x-loader)ro,1920k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(x-loader)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" nand_device=omap2-nand.0 rootfs_mtdblock_nand=4
arch/arm/boards/phycard-a-l1/pca-a-l1.c +6 -3
@@ -336,13 +336,16 @@ static int pcaal1_late_init(void) nand =get_device_by_name ("nand0" ); -devfs_add_partition ("nand0" ,0x00000 ,0x80000 ,DEVFS_PARTITION_FIXED ,"x-loader" ); +devfs_add_partition ("nand0" ,0x00000 ,SZ_128K , +DEVFS_PARTITION_FIXED ,"x-loader" );dev_add_bb_dev ("self_raw" ,"x_loader0" ); -devfs_add_partition ("nand0" ,0x80000 ,0x1e0000 ,DEVFS_PARTITION_FIXED ,"self_raw" ); +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K , +DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,0x260000 ,0x20000 ,DEVFS_PARTITION_FIXED ,"env_raw" ); +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K , +DEVFS_PARTITION_FIXED ,"env_raw" );dev_add_bb_dev ("env_raw" ,"env0" );return 0 ;
arch/arm/boards/phycard-a-xl2/env/config +1 -1
@@ -39,7 +39,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in)
arch/arm/boards/phycard-a-xl2/pca-a-xl2.c +2 -2
@@ -131,10 +131,10 @@ static int pcaaxl2_devices_init(void)devfs_add_partition ("nand0" ,0x00000 ,SZ_128K ,DEVFS_PARTITION_FIXED ,"xload_raw" );dev_add_bb_dev ("xload_raw" ,"xload" ); -devfs_add_partition ("nand0" ,SZ_128K ,SZ_256K , +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K ,DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,SZ_128K +SZ_256K ,SZ_128K , +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K ,DEVFS_PARTITION_FIXED ,"env_raw" );dev_add_bb_dev ("env_raw" ,"env0" );#endif
arch/arm/mach-omap/xload.c +1 -1
@@ -80,7 +80,7 @@ int run_shell(void)printf ("unknown boot source. Fall back to nand\n" );case OMAP_BOOTSRC_NAND :printf ("booting from NAND\n" ); - func =omap_xload_boot_nand (SZ_128K ,SZ_256K ); + func =omap_xload_boot_nand (SZ_128K ,SZ_512K );break ; }
Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in config
The barebox binary has the size encoded into it at offset 0x2c. We could use this to transfer the correct size.
Sascha
Quoted 133 lines
Signed-off-by Jan Weitzel <[email protected]>--- arch/arm/boards/pcm049/board.c | 7 +++++-- arch/arm/boards/pcm049/env/config | 2 +- arch/arm/boards/phycard-a-l1/env/config | 2 +- arch/arm/boards/phycard-a-l1/pca-a-l1.c | 9 ++++++--- arch/arm/boards/phycard-a-xl2/env/config | 2 +- arch/arm/boards/phycard-a-xl2/pca-a-xl2.c | 4 ++-- arch/arm/mach-omap/xload.c | 2 +- 7 files changed, 17 insertions(+), 11 deletions(-)arch/arm/boards/pcm049/board.c +5
-2@@ -113,9 +113,12 @@ static int pcm049_devices_init(void)#ifdef CONFIG_PARTITION devfs_add_partition ("nand0" ,0x00000 ,SZ_128K ,DEVFS_PARTITION_FIXED ,"xload_raw" );dev_add_bb_dev ("xload_raw" ,"xload" ); -devfs_add_partition ("nand0" ,SZ_128K ,SZ_256K ,DEVFS_PARTITION_FIXED ,"self_raw" ); +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K , +DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,SZ_128K +SZ_256K ,SZ_128K ,DEVFS_PARTITION_FIXED ,"env_raw" ); +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K , +DEVFS_PARTITION_FIXED ,"env_raw" ); +dev_add_bb_dev ("env_raw" ,"env0" );#endif arch/arm/boards/pcm049/env/config +1
-1@@ -40,7 +40,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),2M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in)arch/arm/boards/phycard-a-l1/env/config +1
-1@@ -70,7 +70,7 @@ bootargs="$bootargs omapdss.def_disp=pd050vl1" #bootargs="$bootargs omapdss.def_disp=pd104slf" #bootargs="$bootargs omapdss.def_disp=pm070wl4" -nand_parts="512k(x-loader)ro,1920k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(x-loader)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" nand_device=omap2-nand.0 rootfs_mtdblock_nand=4arch/arm/boards/phycard-a-l1/pca-a-l1.c +6
-3@@ -336,13 +336,16 @@ static int pcaal1_late_init(void) nand =get_device_by_name ("nand0" ); -devfs_add_partition ("nand0" ,0x00000 ,0x80000 ,DEVFS_PARTITION_FIXED ,"x-loader" ); +devfs_add_partition ("nand0" ,0x00000 ,SZ_128K , +DEVFS_PARTITION_FIXED ,"x-loader" );dev_add_bb_dev ("self_raw" ,"x_loader0" ); -devfs_add_partition ("nand0" ,0x80000 ,0x1e0000 ,DEVFS_PARTITION_FIXED ,"self_raw" ); +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K , +DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,0x260000 ,0x20000 ,DEVFS_PARTITION_FIXED ,"env_raw" ); +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K , +DEVFS_PARTITION_FIXED ,"env_raw" );dev_add_bb_dev ("env_raw" ,"env0" );return 0 ;arch/arm/boards/phycard-a-xl2/env/config +1
-1@@ -39,7 +39,7 @@ autoboot_timeout=3 bootargs="console=ttyO2,115200" -nand_parts="128k(xload)ro,256k(barebox),128k(bareboxenv),4M(kernel),-(root)" +nand_parts="128k(xload)ro,512k(barebox),128k(bareboxenv),4M(kernel),-(root)" rootfs_mtdblock_nand=4 # set a fancy prompt (if support is compiled in)arch/arm/boards/phycard-a-xl2/pca-a-xl2.c +2
-2@@ -131,10 +131,10 @@ static int pcaaxl2_devices_init(void)devfs_add_partition ("nand0" ,0x00000 ,SZ_128K ,DEVFS_PARTITION_FIXED ,"xload_raw" );dev_add_bb_dev ("xload_raw" ,"xload" ); -devfs_add_partition ("nand0" ,SZ_128K ,SZ_256K , +devfs_add_partition ("nand0" ,SZ_128K ,SZ_512K ,DEVFS_PARTITION_FIXED ,"self_raw" );dev_add_bb_dev ("self_raw" ,"self0" ); -devfs_add_partition ("nand0" ,SZ_128K +SZ_256K ,SZ_128K , +devfs_add_partition ("nand0" ,SZ_128K +SZ_512K ,SZ_128K ,DEVFS_PARTITION_FIXED ,"env_raw" );dev_add_bb_dev ("env_raw" ,"env0" );#endif arch/arm/mach-omap/xload.c +1
-1@@ -80,7 +80,7 @@ int run_shell(void)printf ("unknown boot source. Fall back to nand\n" );case OMAP_BOOTSRC_NAND :printf ("booting from NAND\n" ); - func =omap_xload_boot_nand (SZ_128K ,SZ_256K ); + func =omap_xload_boot_nand (SZ_128K ,SZ_512K );break ; }Signature · 7 lines
1.7.0.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Sascha,
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in configThe barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.
Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
I would need this information in my S3C6410 implementation (for NAND and SD cards to boot from) so it would be a really helpful feature. But only if it is still present in future versions.
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 8 lines · Juergen Beisert
Hi Sascha,
Quoted 5 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in config
Quoted 5 lines
Quoted 2 lines
The barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
Yes, definitely.
That said, it is not a feature you can generally rely upon, because some SoCs may require some special image layout conflicting with this. If your SoC can support this header, barebox will support it in the future aswell.
The header is in arch/arm/include/asm/barebox-arm-head.h. As you can see it also contains the ascii string 'barebox' which means that you can test for it, and if you find it, the next word will contain the address this binary should be copied to (only used to skip copying the binary to the correct place, it's not mandatory to start the image there). The word after it will contain the image size.
This means, what you can do is:
- Test if the image contains 'barebox'
- if yes, use the encoded image size
- if no, fall back to whatever suitable size (It could be a U-Boot image for example)
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Sascha,
Quoted 10 lines · Sascha Hauer
Quoted 9 lines · Juergen Beisert
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in configThe barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.
Quoted 7 lines
Quoted 2 lines
Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
Yes, definitely.
That said, it is not a feature you can generally rely upon, because some SoCs may require some special image layout conflicting with this.
This would require a "movable marker" inside the binary image.
Quoted 2 lines
If your SoC can support this header, barebox will support it in the future aswell.
Okay.
Quoted 10 lines
The header is in
arch/arm/include/asm/barebox-arm-head.h. As you can see it also contains the ascii string 'barebox' which means that you can test for it, and if you find it, the next word will contain the address this binary should be copied to (only used to skip copying the binary to the correct place, it's not mandatory to start the image there). The word after it will contain the image size.This means, what you can do is:
- Test if the image contains 'barebox'
This might be very dangerous, as this kind of string can be part of the binary more than one times, if it is used as part of an output string for example ("Hi, barebox here").
Quoted 3 lines
- if yes, use the encoded image size
- if no, fall back to whatever suitable size (It could be a U-Boot image for example)
What we need for this "movable marker" is:
- a string like "barebox" as its start indication
- in-between some payload data we want to know
- size of the "payload"
- version marker
- real data
- something that indicates the end of the whole marker to verify, this entry is not a phantom (for example the string "xoberab" ;) )
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 35 lines · Juergen Beisert
Hi Sascha,
Quoted 10 lines · Sascha Hauer
Quoted 9 lines · Juergen Beisert
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k
Fix enviroment for boards with size in configThe barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.Quoted 7 lines
Quoted 2 lines
Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
Yes, definitely.
That said, it is not a feature you can generally rely upon, because some SoCs may require some special image layout conflicting with this.
This would require a "movable marker" inside the binary image.
Quoted 2 lines
If your SoC can support this header, barebox will support it in the future aswell.
Okay.
Quoted 7 lines
The header is in
arch/arm/include/asm/barebox-arm-head.h. As you can see it also contains the ascii string 'barebox' which means that you can test for it, and if you find it, the next word will contain the address this binary should be copied to (only used to skip copying the binary to the correct place, it's not mandatory to start the image there). The word after it will contain the image size.
Quoted 7 lines
Quoted 3 lines
This means, what you can do is:
- Test if the image contains 'barebox'
This might be very dangerous, as this kind of string can be part of the binary more than one times, if it is used as part of an output string for example ("Hi, barebox here").
Should have said: 'contains the string 'barebox' at offset 0x20'
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 38 lines · Sascha Hauer
Quoted 37 lines · Juergen Beisert
Hi Sascha,
Quoted 10 lines · Sascha Hauer
Quoted 9 lines · Juergen Beisert
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k Fix enviroment for boards with size in config
The barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.Quoted 7 lines
Quoted 2 lines
Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
Yes, definitely.
That said, it is not a feature you can generally rely upon, because some SoCs may require some special image layout conflicting with this.
This would require a "movable marker" inside the binary image.
Quoted 2 lines
If your SoC can support this header, barebox will support it in the future aswell.
Okay.
Quoted 9 lines
The header is in
arch/arm/include/asm/barebox-arm-head.h. As you can see it also contains the ascii string 'barebox' which means that you can test for it, and if you find it, the next word will contain the address this binary should be copied to (only used to skip copying the binary to the correct place, it's not mandatory to start the image there). The word after it will contain the image size.This means, what you can do is:
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
- Test if the image contains 'barebox'
This might be very dangerous, as this kind of string can be part of the binary more than one times, if it is used as part of an output string for example ("Hi, barebox here").
Should have said: 'contains the string 'barebox' at offset
0x20'
Okay. This would mean: There might be a marker at 0x20, else nowhere in the image.
jbe
Signature · 7 lines
Pengutronix e.K. | Juergen Beisert | Linux Solutions for Science and Industry | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 41 lines · Juergen Beisert
Quoted 40 lines · Sascha Hauer
Quoted 39 lines · Juergen Beisert
Hi Sascha,
Quoted 10 lines · Sascha Hauer
Quoted 9 lines · Juergen Beisert
Quoted 7 lines · Sascha Hauer
Quoted 3 lines · Jan Weitzel
Use 512k NAND Partion for barebox. Problem is we don't know the size of the barebox inside xload. Set it also to 512k Fix enviroment for boards with size in config
The barebox binary has the size encoded into it at offset
0x2c. We could use this to transfer the correct size.Quoted 7 lines
Quoted 2 lines
Will this be a reliable "API" to the outerworld? Also in future versions of Barebox?
Yes, definitely.
That said, it is not a feature you can generally rely upon, because some SoCs may require some special image layout conflicting with this.
This would require a "movable marker" inside the binary image.
Quoted 2 lines
If your SoC can support this header, barebox will support it in the future aswell.
Okay.
Quoted 10 lines
The header is in
arch/arm/include/asm/barebox-arm-head.h. As you can see it also contains the ascii string 'barebox' which means that you can test for it, and if you find it, the next word will contain the address this binary should be copied to (only used to skip copying the binary to the correct place, it's not mandatory to start the image there). The word after it will contain the image size.This means, what you can do is:
- Test if the image contains 'barebox'
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
This might be very dangerous, as this kind of string can be part of the binary more than one times, if it is used as part of an output string for example ("Hi, barebox here").
Should have said: 'contains the string 'barebox' at offset
0x20'Okay. This would mean: There might be a marker at
0x20, else nowhere in the image.
Yes.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox