[U-Boot-Users] [PATCH] TQM5200B: update MTD partition layout

- insert partition for dtb blob to TQM5200B MTD layout - fix MTD layout for highboot configuration - set env variables dependent on the configured board (TQM5200 or TQM5200B)
Signed-off-by: Martin Krause martin.krause@tqs.de --- If I receive no negative feedback, I'm going to pick this patch into the u-boot-tq-group.git custodian tree and do a pull-request, once the merge window has opened again.
Best Regards, Martin Krause
include/configs/TQM5200.h | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 5b2ed0f..4228888 100755 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -255,12 +255,22 @@ "setup=tftp 200000 cam5200/setup.img; autoscr 200000\0" #endif
+#if defined(CONFIG_TQM5200_B) +#define ENV_FLASH_LAYOUT \ + "fdt_addr=FC100000\0" \ + "kernel_addr=FC140000\0" \ + "ramdisk_addr=FC2C0000\0" +#else /* !CONFIG_TQM5200_B */ +#define ENV_FLASH_LAYOUT \ + "fdt_addr=FC0A0000\0" \ + "kernel_addr=FC0C0000\0" \ + "ramdisk_addr=FC240000\0" +#endif + #define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "console=ttyPSC0\0" \ - "fdt_addr=FC0A0000\0" \ - "kernel_addr=FC0C0000\0" \ - "ramdisk_addr=FC240000\0" \ + ENV_FLASH_LAYOUT \ "kernel_addr_r=400000\0" \ "fdt_addr_r=600000\0" \ "rootpath=/opt/eldk/ppc_6xx\0" \ @@ -403,13 +413,16 @@ # if defined(CONFIG_TQM5200_B) # if defined(CFG_LOWBOOT) # define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:1m(firmware)," \ + "256k(dtb)," \ "1536k(kernel)," \ - "3584k(small-fs)," \ + "3328k(small-fs)," \ "2m(initrd)," \ "8m(misc)," \ "16m(big-fs)" # else /* highboot */ -# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:2560k(kernel)," \ +# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:256k(dtb);" \ + "768k(environment)," \ + "1536k(kernel)," \ "3584k(small-fs)," \ "2m(initrd)," \ "8m(misc)," \

In message 20071107141109.6486.18579.stgit@tq-sewsrv-4.tq-net.de you wrote:
- insert partition for dtb blob to TQM5200B MTD layout
- fix MTD layout for highboot configuration
- set env variables dependent on the configured board (TQM5200 or TQM5200B)
Signed-off-by: Martin Krause martin.krause@tqs.de
I'm afraid I have to NAK this patch.
# else /* highboot */ -# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:2560k(kernel)," \ +# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:256k(dtb);" \
"768k(environment)," \
"1536k(kernel)," \
First, it is a realy ugly design to have the environment right in the middle of your flash. Please locate it adjacent to the U-Boot code. Ditto for the DTB.
Second, and major reason for my NAK: 1.5 MB is much too small for current 2.6 Linux kernels, assuming you have to enable a few additional drivers. There was a good reason why I changed this size recently.
Best regards,
Wolfgang Denk

wd@denx.de wrote on Wednesday, November 07, 2007 8:43 PM:
In message 20071107141109.6486.18579.stgit@tq-sewsrv-4.tq-net.de you wrote:
- insert partition for dtb blob to TQM5200B MTD layout
- fix MTD layout for highboot configuration
- set env variables dependent on the configured board (TQM5200 or
TQM5200B)
Signed-off-by: Martin Krause martin.krause@tqs.de
I'm afraid I have to NAK this patch.
# else /* highboot */ -# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:2560k(kernel)," \ +# define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:256k(dtb);" \
"768k(environment)," \ + "1536k(kernel)," \
First, it is a realy ugly design to have the environment right in the middle of your flash. Please locate it adjacent to the U-Boot code. Ditto for the DTB.
Yes, it seems ugly to have the environment in the middle of the flash. This comes from the design goal behind the highboot option. The intention was to have two u-boot images in parallel in flash. One "normal" lowboot image and one highboot emergency image. If the lowboot image does not boot anymore (after a faulty update for example), the highboot image could be used to boot the board and to restore the normal lowboot image. A Jumper on the STK52xx board is used to select between high- and lowboot. Highboot and lowboot U-Boot share the same environment in flash. It was never intended to use a highboot U-Boot without a lowboot U-Boot. So the envrironment does not really lay in the middle of the flash.
Hm, thinking about this, the whole MTDPARTS_DEFAULT definition for the highboot configuration should be removed. The current definition only fits on boards with >=32 MiB flash. On boards with smaller flash memory the 'firmware' partition lays outside the physical available memory:
# else /* highboot */ # define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:2560k(kernel)," \ "3584k(small-fs)," \ "2m(initrd)," \ "8m(misc)," \ "15m(big-fs)," \ "1m(firmware)" # endif /* CFG_LOWBOOT */
So I propose to use the MTDPARTS_DEFAULT of the normal lowboot configuration also for the higboot configuration. This configuration will not fit to 100% also, but it is as good as the current highboot configuration.
Second, and major reason for my NAK: 1.5 MB is much too small for current 2.6 Linux kernels, assuming you have to enable a few additional drivers. There was a good reason why I changed this size recently.
OK, I see the point. I then propose to change the partitions to the following:
TQM5200_B:
Offset Size(Partition) 0 1m(firmware) 256k(dtb) 2818k(kernel) 4M 4m(samll-fs) ... 8M 8m(misc) ... 16M 16m(big-fs) ... 32M
TQM5200:
0 640k(firmware) 128k(dtb) 3328k(kernel) 4M 4m(samll-fs) ... 8M 8m(misc) ... 16M 16m(big-fs) ... 32M
TQM5200_B highboot -> same as TQM5200_B
This partitioning should work for boards with 4 MiB, 8 MiB, 16 MiB and 32 MiB flash memory.
If this is OK, I'll submit a patch.
Best Regards, Martin Krause

In message 47F3F98010FF784EBEE6526EAAB078D1024F87C6@tq-mailsrv.tq-net.de you wrote:
OK, I see the point. I then propose to change the partitions to the following:
Why do you want to change everything again and again? Why cannot we simply settle now by what is being used by Linux, too?
There repeated changes are a maintenance nightmare for the users of the boards, so please restrict those to the cases where absolutely necessary. And keep in mind that U-Boot and Linus should be changed in sync.
Best regards,
Wolfgang Denk

wd@denx.de wrote on Thursday, November 08, 2007 8:29 PM:
In message 47F3F98010FF784EBEE6526EAAB078D1024F87C6@tq-mailsrv.tq-net.de you wrote:
OK, I see the point. I then propose to change the partitions to the following:
Why do you want to change everything again and again? Why cannot we simply settle now by what is being used by Linux, too?
I do not want to change everything again and again. The last change in the TQM5200 mtd partitioning was done by DENX (without posting the patch on the list, by the way), not by me. And this change is IMO not ideal, because the new partitioning does not suit for boards with less than 32 MiB flash memory (because the partition boarders do not lay on powers of 2). I tried to point this out on the linuxppc-dev mailing list, by commenting the patchset for the TQM5200 which contains the same (IMO wrong) partitions (in the dts).
There repeated changes are a maintenance nightmare for the users of
100% agreed. But the last change in U-Boot was done by DENX, without a chance of commenting for me. If I not fully agree on this changes, what else could I do than post a patch on the list for discussion?
the boards, so please restrict those to the cases where absolutely necessary. And keep in mind that U-Boot and Linus should be changed in sync.
Agreed. But TQM5200 support isn't in the Linus tree, yet. There were patches posted on the linuxppc-dev list. I tried to express my concerns regarding the flash partitioning on the list, to prevent getting an (IMO) unclean partitioning into the kernel. But propably I failed to express my concerns cleanly?
I don't know, what else I could do, to discuss/change a IMO wrong partitioning?
Best Regards, Martin Krause
participants (3)
-
Martin Krause
-
Martin Krause
-
Wolfgang Denk