From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pantelis Antoniou Date: Mon, 26 Apr 2004 11:16:37 +0300 Subject: [U-Boot-Users] dynamic setting of CONFIG_SYS_CLK_FREQ In-Reply-To: <20040426080216.8FEE9C109F@atlas.denx.de> References: <20040426080216.8FEE9C109F@atlas.denx.de> Message-ID: <408CC565.9040006@intracom.gr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: >In message <408CAD48.4020004@intracom.gr> you wrote: > >>IMHO the gd data are pretty much useless in a complicated environment. >> > >Agreed. But that's not what they were meant for. > >The gd data is intended to store the absolute minimum of rwritable >date which is really unavoidable to be stored in global variables >until the RAM has been initialized and a standard data segment and >stack are available. > > >>For example when you have multiple network interfaces you have no >>information which network interface was used to obtain the configuration, >>which was it's ethernet address etc. >> > >This is something which can easily be done after relocation to RAM, >so there is no need to use gd for this purpose. > > >>For me the gd is usefull only for the simple case of most boards with >>one network interface, fixed clock etc. >> > >No. This is NOT the intention. > > >>For anything more complicated is better to parse the environment variables. >> > >In the end we will probably have something like bi_recs ... > > >>Why don't we just add the missing information to the environment variables? >> > >Because you cannot access envrionment in very early initialization >steps, or you have to do it in a very slow way (like reading byte by >byte from serial EEPROM), which would horribly slow down boot. > > Correct. But I'm not talking about the early initialization. I'm talking about how the loaded image/kernel gets access to the information. At that point the variables are placed in RAM, and can contain every info that is present in the gd structure. U-boot can continue to use the gd structure, but the application can access all it's configuration from the environment variables. For example we can fill a environment variable with the system clock value at the later stages of initialization. >Best regards, > >Wolfgang Denk > > Regards Pantelis