[U-Boot] U-boot Config Parameters on Compact Flash

Dear U-Boot Users,
I am using successfully U-boot for many years. So far I was dealing with the system which has the Flash memory on board. The u-boot binary and u-boot config parameters were stored in Flash.
Currently I am dealing with the new board which has Xilinx Virtex05 chip (with built in powerPC) and Compact Flash instead of Flash memory chip. Compact Flash is interfaced with the system by means of System ACE "interface".
Compact Flash has few partitions (ie. FAT and EXT2). Is it possible to configure u-boot to access (ie. read/write) u-boot parameters which are on Compact Flash as a file?
I will be grateful for any hint
Best Regards
Miroslaw Dach

Dear "Dach Miroslaw",
In message 1B4F8000449511488D1A640DD6DECA350392A606@MAILBOX0A.psi.ch you wrote:
Compact Flash has few partitions (ie. FAT and EXT2). Is it possible to configure u-boot to access (ie. read/write) u-boot parameters which are on Compact Flash as a file?
What do you mean my "u-boot parameters"?
Of course you can for example read a file from a FAT file system on the CF card, and then import the environment from this.
Note however that the opposite direction is harder: thre is no FAT write support.
OK, you can read and write raw sectors, but this is obviously less flexible (but has the charming benefit to work out of the box).
Best regards,
Wolfgang Denk

Hello Wolfgang,
Thank you for your quick answer.
What do you mean my "u-boot parameters"?
To be clear I mean u-boot parameters the environment variables which are denied for example: CFG_ENV_IS_IN_FLASH or CFG_ENV_IS_IN_EEPROM
Note however that the opposite direction is harder: there is no FAT write support.
OK, you can read and write raw sectors, but this is obviously less flexible (but has the charming benefit to work out of the box).
My new board does not have Flash nor EEPROM. It has only Compact Flash. What would be than your suggestion to access (read/write) u-boot (parameters) environ variables?
When the board is booted than at first the simply boot loader which is in Xilinx internal BRAM can place u-boot environ variables from file (on Compact Flash) to the RAM memory and next u-boot can be booted. In such a scenario u-boot can access easily parameters from RAM. The problem remains valid how to write theses environ variables back to the file on Compact Flash.
Best Regards
Miroslaw Dach
-----Original Message----- From: Wolfgang Denk [mailto:wd@denx.de] Sent: Thu 1/20/2011 1:09 PM To: Dach Miroslaw Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] U-boot Config Parameters on Compact Flash
Dear "Dach Miroslaw",
In message 1B4F8000449511488D1A640DD6DECA350392A606@MAILBOX0A.psi.ch you wrote:
Compact Flash has few partitions (ie. FAT and EXT2). Is it possible to configure u-boot to access (ie. read/write) u-boot parameters which are on Compact Flash as a file?
What do you mean my "u-boot parameters"?
Of course you can for example read a file from a FAT file system on the CF card, and then import the environment from this.
Note however that the opposite direction is harder: thre is no FAT write support.
OK, you can read and write raw sectors, but this is obviously less flexible (but has the charming benefit to work out of the box).
Best regards,
Wolfgang Denk

Dear "Dach Miroslaw",
In message 1B4F8000449511488D1A640DD6DECA350392A609@MAILBOX0A.psi.ch you wrote:
What do you mean my "u-boot parameters"?
To be clear I mean u-boot parameters the environment variables which are denied for example: CFG_ENV_IS_IN_FLASH or CFG_ENV_IS_IN_EEPROM
CFG_* ? You code must be _extremely_ old. Update!
My new board does not have Flash nor EEPROM. It has only Compact Flash.
Then #define CONFIG_ENV_IS_NOWHERE
What would be than your suggestion to access (read/write) u-boot (parameters) environ variables?
Reserve some space (like a tiny partition) somewhere on your CF card; say 32 sectors for 16 kB environment data. Use ide read combined with env import to load the envrionment from CF card, and use env export combined with ide write to write it back if needed.
Best regards,
Wolfgang Denk

Dear Wolfgang,
Thank you again for your hints.
Then #define CONFIG_ENV_IS_NOWHERE
What would be than your suggestion to access (read/write) u-boot (parameters) environ variables?
Reserve some space (like a tiny partition) somewhere on your CF card; say 32 sectors for 16 kB environment data. Use ide read combined with env import to load the envrionment from CF card, and use env export combined with ide write to write it back if needed.
Please let me write what I understood from your idea. Please correct me if I am wrong.
In the include config file I should say #define CONFIG_ENV_IS_NOWHERE meaning take the default environ configuration is built in the u-boot itself.
Next, when the u-boot is booted the environment variables should be imported from Compact Flash. This is done in two steps: 1. ide read (read the u-boot config from Compact Flash to RAM ?) 2. env import (import u-boot config from RAM to u-boot?)
Could you please give me more hints which CONFIG macros should/could be used for the above mentioned steps. Is there any command to import/export u-boot config. So far I was using saveenv to export/save u-boot config into Flash?
Best Regards
Mirek
Dear "Dach Miroslaw",
In message 1B4F8000449511488D1A640DD6DECA350392A609@MAILBOX0A.psi.ch you wrote:
What do you mean my "u-boot parameters"?
To be clear I mean u-boot parameters the environment variables which are denied for example: CFG_ENV_IS_IN_FLASH or CFG_ENV_IS_IN_EEPROM
CFG_* ? You code must be _extremely_ old. Update!
My new board does not have Flash nor EEPROM. It has only Compact Flash.
Then #define CONFIG_ENV_IS_NOWHERE
What would be than your suggestion to access (read/write) u-boot (parameters) environ variables?
Reserve some space (like a tiny partition) somewhere on your CF card; say 32 sectors for 16 kB environment data. Use ide read combined with env import to load the envrionment from CF card, and use env export combined with ide write to write it back if needed.
Best regards,
Wolfgang Denk
participants (2)
-
Dach Miroslaw
-
Wolfgang Denk