thanks @ogra @ppisati for the shared informations.
We double check our porting of u-boot with the your porting on raspberry 2/3.
What is the rationale of the following part of the patch?
+#define CONFIG_PREBOOT "usb start; if test ! \"mmc dev 0\"; then " \
+ "fatload usb 0:1 0x3000000 "FAT_ENV_FILE"; " \
+ "env import -b 0x3000000; " \
If the rationale of this patch is permit the board to boot from usb, we found the following facts:
if test ! \"mmc dev 0\"; 
return always true.
Furthermore, because it is not checked the existence of FAT_ENV_FILE, the command
env import -b 0x3000000;
is always execute, so we can load garbage memory in uboot env.
Moreover it is necessary to remove the CRC pad from the file generate from mkenvimage for placing it on USB support.
Is this feature strictly necessary for porting ubuntu core on a new board?
Nicolino & Francesco