[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Question related to u-boot



Hi,

Kulkarni wrote:
>  
> Hi John,
> Following are the details of my system:
> 
> - The system that we are developing will have a flash in the end-system but the current eval board on which I am working doesn't have a flash connected to it. That's why I wanted to know about both with and without flash.
> 
> - I have already successfully booted my system using the bootm command with an image already copied at the specified location. What I wanted to achieve with memory images is something similar to what grub(or even u-boot) gives for flash images, which is an option to choose between 2 images are different memory locations and then choose amongst them. Anyways, if this is not easily achievable, I don't want to spend much time on this.

As John wrote it is easy to do. Just setup new booting command.

setevn old_boot tftp 0xA0001000 new_image.ub\;bootm 0xA0001000
setevn new_boot tftp 0x90001000 new_image.ub\;bootm 0x90001000

run new_boot
run old_boot


> 
> - For upgrade, what I want to achieve is this: 
> 	The system will have only an ethernet connectivity to the outside world where a linux-like host will be connected to it. Now from the linux host, a new kernel image needs to be pushed into the Petalinux flash memory only when an admin has triggered the upgrade through some command.Now there will be a process running on my Petalinux system which will interpret the upgrade command and which will copy the new image to the flash while the system is still running. Another thing this process can do is change the u-boot script to get image from the outside linux host using bootp or tftp boot command. Please note here that during all this I don't have the u-boot shell accessible with me and this is happening in the context of a process running on my Petalinux system. So the question is whether setenv and saveenv commands can be executed from within a process running  in  the system.


I haven't seen problem in it too.
Create 4 MTD partition.
1. for u-boot variables
2. bootup script
3. for first image (I am calling it 3 image)
4. for second image (I am calling it 4 image)

You have four MTD partition in linux as char/block device. You can write there from linux.
Means that if you want to do your system upgrade you just copy new image with kernel/fs to last
partition.

The most important thing are u-boot variables and booting scripts. I would setup them to look at 4
partition if is image there then bootup. If is there you should setup any u-boot variable to 3
partition - for case that 4 image failed - in next restart will be used 3 image. (Your system should
contain any watchdog for reseting in case that your new linux image failed) If 4 image boot up
correctly you can change u-boot variables from Linux or change bootup script.

That bootup script is there because you can direct everything through it.

Anyway as I wrote in my email - look at u-boot mainling list. I saw there some schemes on it and
discuss about.


Regards,
Michal


> 
> So if you can read  my previous mail keeping this input in mind, I guess your answers will change :)
> 
> Thanks,
> -Mayuri
> 
> -----Original Message-----
> From: owner-microblaze-uclinux@xxxxxxxxxxxxxxxxxxxx [mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Michal Simek
> Sent: Thursday, July 23, 2009 3:12 PM
> To: microblaze-uclinux@xxxxxxxxxxxxxx
> Subject: Re: [microblaze-uclinux] Question related to u-boot
> 
> 
> 
> John Williams wrote:
>> On Thu, Jul 23, 2009 at 6:46 PM, Kulkarni, Mayuri 
>> <Mayuri.Kulkarni@xxxxxxx <mailto:Mayuri.Kulkarni@xxxxxxx>> wrote:
>>
>>     Hi,
>>     I have the following problem definition for u-boot usage for
>>     Petalinux running on Microblaze soft CPU:
>>      
>>     - I have a system without flash wherein I am copying the Petelinux
>>     kernel image.ub into memory through xmd and then invoking u-boot.
>>     Now if I have another kernel image at a second location in memory, I
>>     want u-boot to let me choose which image to boot.
>>
>>
>> u-boot can boot an image from any address - you just change the value 
>> passed to the "bootm" command.
> 
> but you can't rewrite u-boot
> 
>> How that value is derived is up to you.  u-boot has some basic 
>> scripting and conditional execution capabilities - see the manual at 
>> www.denx.com <http://www.denx.com>
> 
> Just minor fixup denx.de.
> 
> 
> 
> 
>>  
>>
>>      
>>     - After this stage, is it possible to programmatically change the
>>     default image from which u-boot can boot? I want to be able to copy
>>     an upgraded kernel image either into the flash or memory and make
>>     u-boot use the upgraded image the next time the system reboots.
>>
>>
>> I thought you just said you have a system without flash?
>>
>> Anyway, with flash, you could adjust the uboot environment with 
>> "setenv", then use "saveenv" to save it to flash.  Next time u-boot 
>> starts, it gets the saved environment.
>>
>> Without flash, you'll need something like a DIP switch on the board, 
>> and have u-boot query that to make its decision about which image to boot.
>>  
>>
>>     I have checked the auto-boot script but don't see how we can change
>>     the script or issue a u-boot setenv-like command through another
>>     process in a running system.
>>
>>
>> The problem seems to be your lack of persistent storage more than 
>> anything else.  We've configured u-boot in PetaLinux to cover the most 
>> standard situations - what you are describing is far from standard, 
>> but likely to be achievable in some way.
>>
>> It would help to know more about what you are trying to achieve, in 
>> the broader sense.  There is almost certainly an easier way to do 
>> whatever it is you are trying to achieve.
> 
> This was discussed many times on u-boot mailing list. You should look there.
> 
> Regards,
> Michal
> 
>> Regards,
>>
>> John
>> --
>> John Williams, PhD, B.Eng, B.IT <http://B.IT> PetaLogix - Linux 
>> Solutions for a Reconfigurable World
>> w: www.petalogix.com <http://www.petalogix.com>  p: +61-7-30090663  f:
>> +61-7-30090663
> 
> --
> Michal Simek, Ing. (M.Eng)
> PetaLogix - Linux Solutions for a Reconfigurable World
> w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663 ___________________________ microblaze-uclinux mailing list microblaze-uclinux@xxxxxxxxxxxxxx Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
> 
> 
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
> 
> 

-- 
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/