* [U-Boot-Users] Add a new command to U-Boot @ 2005-11-15 18:32 Carlos Filipe Silva 2005-11-15 18:55 ` Cliff Brake 0 siblings, 1 reply; 25+ messages in thread From: Carlos Filipe Silva @ 2005-11-15 18:32 UTC (permalink / raw) To: u-boot Hi all! I have one doubt. How can I add a new command to U-Boot? Do I have to use only the macro U_BOOT_CMD() like files .../common/cmd_* or do I have to do more things, like defines, etc.? And after this is compliled with no error, if I type help in U-Boot's shell, do I see this command like the others? Best regards, Carlos Silva -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.denx.de/pipermail/u-boot/attachments/20051115/ea47a303/attachment.htm ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot-Users] Add a new command to U-Boot 2005-11-15 18:32 [U-Boot-Users] Add a new command to U-Boot Carlos Filipe Silva @ 2005-11-15 18:55 ` Cliff Brake 2009-05-07 13:35 ` [U-Boot] " Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Cliff Brake @ 2005-11-15 18:55 UTC (permalink / raw) To: u-boot On 11/15/05, Carlos Filipe Silva <CarlosF.Silva@siemens.com> wrote: > > Hi all! > > I have one doubt. How can I add a new command to U-Boot? > Do I have to use only the macro U_BOOT_CMD() like files .../common/cmd_* or > do I have to do more things, like defines, etc.? You do not need the gating defines -- U_BOOT_CMD() will automatically do everything. The defines are only required for including/excluding the command which saves memory if not included. If the command is defined in your board directory, it will probably always be active and not require any gating macros. > And after this is compliled with no error, if I type help in U-Boot's shell, > do I see this command like the others? Yes. Cliff -- ======================= Cliff Brake http://bec-systems.com ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2005-11-15 18:55 ` Cliff Brake @ 2009-05-07 13:35 ` Deepak Gopalakrishnan 2009-05-07 13:40 ` Jerry Van Baren 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-07 13:35 UTC (permalink / raw) To: u-boot HI I am working with Freescale MPC8313E-RDB and with it comes their BSP. This provides a u-boot. I want to understand how the u-boot commands work as in where are they defined and in which files. My utlimate goal is to add new u-boot commands and to modify the exsisting commands (if needed) Im a total newbie to uboot. and am looking for a hint as to where to look for. thanks a lot... Deepak -- View this message in context: http://www.nabble.com/Add-a-new-command-to-U-Boot-tp1498653p23426790.html Sent from the Uboot - Users mailing list archive at Nabble.com. ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-07 13:35 ` [U-Boot] " Deepak Gopalakrishnan @ 2009-05-07 13:40 ` Jerry Van Baren 2009-05-07 13:59 ` Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Jerry Van Baren @ 2009-05-07 13:40 UTC (permalink / raw) To: u-boot Deepak Gopalakrishnan wrote: > HI > I am working with Freescale MPC8313E-RDB and with it comes their BSP. This > provides a u-boot. I want to understand how the u-boot commands work as in > where are they defined and in which files. > My utlimate goal is to add new u-boot commands and to modify the exsisting > commands (if needed) > Im a total newbie to uboot. and am looking for a hint as to where to look > for. > > thanks a lot... > > Deepak ls common/cmd*.c Best regards, gvb ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-07 13:40 ` Jerry Van Baren @ 2009-05-07 13:59 ` Deepak Gopalakrishnan 2009-05-07 15:21 ` Subodh Nijsure 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-07 13:59 UTC (permalink / raw) To: u-boot yes indeed...thanks a lot... i can guess that adding a command wont be just a walk in the park.....could you tell me wat all this i will have to take care of if i were supposed to write....say another date function...which would display the date in another format.... other than adding it into the makefile and placing it in the common folder...wat shud i do..? thanks alot... Regards, Deepak Jerry Van Baren <gerald.vanbaren@ge.com> 05/07/2009 07:10 PM To Deepak Gopalakrishnan <Deepak.Gopalakrishnan@Lntemsys.com> cc u-boot at lists.denx.de Subject Re: [U-Boot] Add a new command to U-Boot Deepak Gopalakrishnan wrote: > HI > I am working with Freescale MPC8313E-RDB and with it comes their BSP. This > provides a u-boot. I want to understand how the u-boot commands work as in > where are they defined and in which files. > My utlimate goal is to add new u-boot commands and to modify the exsisting > commands (if needed) > Im a total newbie to uboot. and am looking for a hint as to where to look > for. > > thanks a lot... > > Deepak ls common/cmd*.c Best regards, gvb ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-07 13:59 ` Deepak Gopalakrishnan @ 2009-05-07 15:21 ` Subodh Nijsure 2009-05-08 13:21 ` Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Subodh Nijsure @ 2009-05-07 15:21 UTC (permalink / raw) To: u-boot Have you looked at code in common/cmd_date.c? If you see at the end of the file there is macro U_BOOT_CMD() that adds the command date, there is function do_date that is invoked, so if you wanted to implement your own version of date command you will have to implement your own do_date function. /Subodh > -----Original Message----- > From: u-boot-bounces at lists.denx.de > [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Deepak > Gopalakrishnan > Sent: Thursday, May 07, 2009 7:00 AM > To: Jerry Van Baren > Cc: u-boot at lists.denx.de > Subject: Re: [U-Boot] Add a new command to U-Boot > > yes indeed...thanks a lot... > i can guess that adding a command wont be just a walk in the > park.....could you tell me wat all this i will have to take > care of if i were supposed to write....say another date > function...which would display the date in another format.... > other than adding it into the makefile and placing it in the > common folder...wat shud i do..? > thanks alot... > > Regards, > Deepak > > > > Jerry Van Baren <gerald.vanbaren@ge.com> > 05/07/2009 07:10 PM > > To > Deepak Gopalakrishnan <Deepak.Gopalakrishnan@Lntemsys.com> > cc > u-boot at lists.denx.de > Subject > Re: [U-Boot] Add a new command to U-Boot > > > > > > > Deepak Gopalakrishnan wrote: > > HI > > I am working with Freescale MPC8313E-RDB and with it comes > their BSP. > This > > provides a u-boot. I want to understand how the u-boot > commands work > > as > in > > where are they defined and in which files. > > My utlimate goal is to add new u-boot commands and to modify the > exsisting > > commands (if needed) > > Im a total newbie to uboot. and am looking for a hint as to where to > look > > for. > > > > thanks a lot... > > > > Deepak > > ls common/cmd*.c > > Best regards, > gvb > > ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-07 15:21 ` Subodh Nijsure @ 2009-05-08 13:21 ` Deepak Gopalakrishnan 2009-05-08 13:20 ` Jerry Van Baren 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-08 13:21 UTC (permalink / raw) To: u-boot thanks to everyone first. im able to write a new command for the u-boot and load it on to the board and it works like a charm. Im explaining the steps here so that it would be helpful in the future: im using a MPC8313e RDB and u-boot-1.3.0. 1) First of all the commands are defined in files present in u-boot/common folder and are the files that start with cmd_*.c 2) now to add a new command create a file in the same format 3) include the necessary header file (depends on what the command would do) 4) "do_<command>" function. This is the function where you have to do what your command intends to do. 5) U_BOOT_CMD( ) function will include your command to the list of commands of u-boot 6) compile it and get the u-boot.bin file 7) load this on to the board. 8) TADAAAAA....ur function is up and running.... this is the content of firrst u-boot command i wrote: cmd_dgprint.c <code> /* * (C) Copyright 2005 * Wolfgang Denk, DENX Software Engineering, wd at denx.de. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include <common.h> #include <command.h> int do_dgprint(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { printf("Hi this is a test\n"); return 0; } U_BOOT_CMD( dgprint, 1, 1, do_dgprint, "dgprint takes no arguments", "this is just to test a function" ); </code> hope this is useful to atleast one person Regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-08 13:21 ` Deepak Gopalakrishnan @ 2009-05-08 13:20 ` Jerry Van Baren 2009-05-11 5:32 ` [U-Boot] Uboot reloaction scheme Deepak Gopalakrishnan 2009-05-11 8:16 ` [U-Boot] Add a new command to U-Boot Drasko DRASKOVIC 0 siblings, 2 replies; 25+ messages in thread From: Jerry Van Baren @ 2009-05-08 13:20 UTC (permalink / raw) To: u-boot Excellent, but... Deepak Gopalakrishnan wrote: [snip] > this is the content of firrst u-boot command i wrote: > > cmd_dgprint.c > <code> > /* > * (C) Copyright 2005 > * Wolfgang Denk, DENX Software Engineering, wd at denx.de. > * > * See file CREDITS for list of people who contributed to this > * project. > * > * This program is free software; you can redistribute it and/or > * modify it under the terms of the GNU General Public License as > * published by the Free Software Foundation; either version 2 of > * the License, or (at your option) any later version. ...you should put your own copyright with the correct year in it. Note also that u-boot is licensed using the GPLv2 so, if you distribute u-boot with your modifications linked into it, you must use a GPLv2 compatible license for your code. <http://www.gnu.org/philosophy/license-list.html> <http://en.wikipedia.org/wiki/License_compatibility> Welcome and enjoy your stay in u-boot-land, :-) gvb ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Uboot reloaction scheme 2009-05-08 13:20 ` Jerry Van Baren @ 2009-05-11 5:32 ` Deepak Gopalakrishnan 2009-05-11 8:16 ` [U-Boot] Add a new command to U-Boot Drasko DRASKOVIC 1 sibling, 0 replies; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-11 5:32 UTC (permalink / raw) To: u-boot I was wondering if there was any documentation or link which explains the uboot relocation scheme. Isnt it better to understand the concept and then try to understand the code. Regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] Add a new command to U-Boot 2009-05-08 13:20 ` Jerry Van Baren 2009-05-11 5:32 ` [U-Boot] Uboot reloaction scheme Deepak Gopalakrishnan @ 2009-05-11 8:16 ` Drasko DRASKOVIC 2009-05-11 14:12 ` [U-Boot] uboot relocate_code() function Deepak Gopalakrishnan 1 sibling, 1 reply; 25+ messages in thread From: Drasko DRASKOVIC @ 2009-05-11 8:16 UTC (permalink / raw) To: u-boot Hmmm... what about these additional steps: 1) Add .o file to COBJS in ./common/Makefile 2) Add CFG_CMD_<MY_COMMAND> to CONFIG_COMMANDS macro in ./include/configs/<board_name>.h 3) Add CFG_CMD_<MY_COMMAND> definition to ./include/cmd_confdefs.h are they necesarry? I think that I had to do these also. BR, Drasko On Fri, May 8, 2009 at 3:20 PM, Jerry Van Baren <gerald.vanbaren@ge.com>wrote: > Excellent, but... > > Deepak Gopalakrishnan wrote: > > [snip] > > > this is the content of firrst u-boot command i wrote: > > > > cmd_dgprint.c > > <code> > > /* > > * (C) Copyright 2005 > > * Wolfgang Denk, DENX Software Engineering, wd at denx.de. > > * > > * See file CREDITS for list of people who contributed to this > > * project. > > * > > * This program is free software; you can redistribute it and/or > > * modify it under the terms of the GNU General Public License as > > * published by the Free Software Foundation; either version 2 of > > * the License, or (at your option) any later version. > > ...you should put your own copyright with the correct year in it. > > Note also that u-boot is licensed using the GPLv2 so, if you distribute > u-boot with your modifications linked into it, you must use a GPLv2 > compatible license for your code. > <http://www.gnu.org/philosophy/license-list.html> > <http://en.wikipedia.org/wiki/License_compatibility> > > Welcome and enjoy your stay in u-boot-land, :-) > gvb > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot > ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] uboot relocate_code() function 2009-05-11 8:16 ` [U-Boot] Add a new command to U-Boot Drasko DRASKOVIC @ 2009-05-11 14:12 ` Deepak Gopalakrishnan 2009-05-11 14:19 ` Liu Dave-R63238 ` (2 more replies) 0 siblings, 3 replies; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-11 14:12 UTC (permalink / raw) To: u-boot Hi I was going thruogh the code of u-boot-1.3.0 and was particlarly going through the code in board/freescale/mpc8313erdb cause thats my board. And i found that relocate_code() function is being declared in common.h and called at few instances but could not find the definition of the code. Can anyone help me with this. thanks and regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] uboot relocate_code() function 2009-05-11 14:12 ` [U-Boot] uboot relocate_code() function Deepak Gopalakrishnan @ 2009-05-11 14:19 ` Liu Dave-R63238 2009-05-11 15:52 ` Timur Tabi 2009-05-11 18:22 ` Scott Wood 2 siblings, 0 replies; 25+ messages in thread From: Liu Dave-R63238 @ 2009-05-11 14:19 UTC (permalink / raw) To: u-boot > I was going thruogh the code of u-boot-1.3.0 and was > particlarly going through the code in > board/freescale/mpc8313erdb cause thats my board. > And i found that relocate_code() function is being declared > in common.h and called at few instances but could not find > the definition of the code. > Can anyone help me with this. Have a look cpu/mpc83xx/start.S. You may grep it in the u-boot. ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] uboot relocate_code() function 2009-05-11 14:12 ` [U-Boot] uboot relocate_code() function Deepak Gopalakrishnan 2009-05-11 14:19 ` Liu Dave-R63238 @ 2009-05-11 15:52 ` Timur Tabi 2009-05-11 18:22 ` Scott Wood 2 siblings, 0 replies; 25+ messages in thread From: Timur Tabi @ 2009-05-11 15:52 UTC (permalink / raw) To: u-boot On Mon, May 11, 2009 at 9:12 AM, Deepak Gopalakrishnan <Deepak.Gopalakrishnan@lntemsys.com> wrote: > And ?i found that relocate_code() function is being declared in common.h > and called at few instances but could not find the definition of the code. > Can anyone help me with this. grep -rw relocate_code * -- Timur Tabi Linux kernel developer at Freescale ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] uboot relocate_code() function 2009-05-11 14:12 ` [U-Boot] uboot relocate_code() function Deepak Gopalakrishnan 2009-05-11 14:19 ` Liu Dave-R63238 2009-05-11 15:52 ` Timur Tabi @ 2009-05-11 18:22 ` Scott Wood 2009-05-12 13:47 ` [U-Boot] start.s file Deepak Gopalakrishnan 2 siblings, 1 reply; 25+ messages in thread From: Scott Wood @ 2009-05-11 18:22 UTC (permalink / raw) To: u-boot On Mon, May 11, 2009 at 07:42:02PM +0530, Deepak Gopalakrishnan wrote: > Hi > I was going thruogh the code of u-boot-1.3.0 and was particlarly going > through the code in board/freescale/mpc8313erdb cause thats my board. > And i found that relocate_code() function is being declared in common.h > and called at few instances but could not find the definition of the code. > Can anyone help me with this. It's in cpu/mpc83xx/start.S. -Scott ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] start.s file 2009-05-11 18:22 ` Scott Wood @ 2009-05-12 13:47 ` Deepak Gopalakrishnan 2009-05-12 14:30 ` Detlev Zundel 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-12 13:47 UTC (permalink / raw) To: u-boot Hi everyone... In the quest of finding the code for relocation i have reached the start.s file present in u-boot-1.1.6\cpu\mpc83xx\ folder. Even its in assembly language (i dont know assembly language beyond movlw) i tried to understand that using the descriptions of the commands given in this site: http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.aixassem/doc/alangref/mfmsr.htm but im not able to proceed much. Is there any better way to understand this. thanks & regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] start.s file 2009-05-12 13:47 ` [U-Boot] start.s file Deepak Gopalakrishnan @ 2009-05-12 14:30 ` Detlev Zundel 2009-05-18 13:18 ` [U-Boot] u-boot version Deepak Gopalakrishnan 2009-05-19 11:17 ` [U-Boot] U-boot common/environment.c Deepak Gopalakrishnan 0 siblings, 2 replies; 25+ messages in thread From: Detlev Zundel @ 2009-05-12 14:30 UTC (permalink / raw) To: u-boot Hi Deepak, > In the quest of finding the code for relocation i have reached the start.s > file present in u-boot-1.1.6\cpu\mpc83xx\ folder. This is old code you're looking at. Best would be to look at current code although this doesn't help here. > Even its in assembly language (i dont know assembly language beyond > movlw) i tried to understand that using the descriptions of the > commands given in this site: > http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.aixassem/doc/alangref/mfmsr.htm > but im not able to proceed much. Is there any better way to understand > this. The algorithm is implemented in assembler (at the relocate_code label), so understanding assembler a little bit will be a preliminary to understanding unless you have access to a device which we in german call a "N?rnberger Trichter" [its a mythical mechanical learning device] ;) Cheers Detlev -- I haven't lost my mind, I know exactly where I left it. -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-12 14:30 ` Detlev Zundel @ 2009-05-18 13:18 ` Deepak Gopalakrishnan 2009-05-18 13:16 ` Wolfgang Denk 2009-05-19 11:17 ` [U-Boot] U-boot common/environment.c Deepak Gopalakrishnan 1 sibling, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-18 13:18 UTC (permalink / raw) To: u-boot Hi all.... this time i want to know is there anywat i can get a application in linux to fetch the bootstrap and u-boot version and display it.... i have no idea how this can be done.... could someone give a start.....im using AT91Bootstrap and u-boot-1.1.5_atmel_1.2 thanks alot note:sorry if i havent provided enough information for u to help me...im still pretty much new to this... Regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-18 13:18 ` [U-Boot] u-boot version Deepak Gopalakrishnan @ 2009-05-18 13:16 ` Wolfgang Denk 2009-05-19 9:29 ` Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Wolfgang Denk @ 2009-05-18 13:16 UTC (permalink / raw) To: u-boot Dear Deepak Gopalakrishnan, In message <OFCF73D3BF.BBC1DA5F-ON652575BA.00485257-652575BA.00482D67@lntemsys.com> you wrote: > > this time i want to know is there anywat i can get a application in linux > to fetch the bootstrap and u-boot version and display it.... > i have no idea how this can be done.... > could someone give a start.....im using AT91Bootstrap and > u-boot-1.1.5_atmel_1.2 You can use the "fw_printenv" tool in Linux to print U-Boot environment variables, including the "vers" variable (assuming you used "saveenv" at least once). I have no idea if there is any version information in what you call "the bootstrap" nor how to access it. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de To the systems programmer, users and applications serve only to provide a test load. ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-18 13:16 ` Wolfgang Denk @ 2009-05-19 9:29 ` Deepak Gopalakrishnan 2009-05-19 14:14 ` Detlev Zundel 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-19 9:29 UTC (permalink / raw) To: u-boot Hi first of all thanks for the reply... Actually we are planning to include a new parameter as version of parameter. I have a tentative idea of writing into the nand flash as a env variable so that i will be able to read it from the u-boot and then from kernel. But im not sure of how to do this. do u have any idea if this is possible. Also how do i add a new env variable in u-boot... thanks and regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-19 9:29 ` Deepak Gopalakrishnan @ 2009-05-19 14:14 ` Detlev Zundel 2009-05-19 14:41 ` Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Detlev Zundel @ 2009-05-19 14:14 UTC (permalink / raw) To: u-boot Hi Deepak, > Actually we are planning to include a new parameter as version of > parameter. This sounds like mata-programming, although I'm pretty sure that you wnat to do something simple - so obviously I did not understand what you want to do, sorry. > I have a tentative idea of writing into the nand flash as a env > variable so that i will be able to read it from the u-boot and then from > kernel. But im not sure of how to do this. do u have any idea if this is > possible. Much is possible, but I do not understand what exactly you are trying to do. Maybe you tell us what "high level" goal you try to achieve and then we can decide for ourselves if an environment variable is the way to go here or if other more natural solutions come to mind. > Also how do i add a new env variable in u-boot... setenv newvariable newvalue Cheers Detlev -- The latest code looks a bit similar to the old [linux] big-reader-locks hack (which got dropped for good many eons ago and with which i deny any involvement with, such as having authored it. [oh, did i say that out loud? crap.]), imple- mented cleanly and properly. -- Ingo Molnar <20090428124033.GA1655@elte.hu> -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-19 14:14 ` Detlev Zundel @ 2009-05-19 14:41 ` Deepak Gopalakrishnan 2009-05-19 14:40 ` Detlev Zundel 0 siblings, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-19 14:41 UTC (permalink / raw) To: u-boot Sorry for not being clear the first time around. My objective is to write a program with which i will be able to access the u-boot version. Also i would like to add a new parameter to the bootstrap which would specify the bootstrap version.(which i want to according to changes i make to bootstrap) i assume that for this i will have to write a version string to the nand flash and then try to access it for the linux kernel....but thats just an idea...have no clue how to.... Regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-19 14:41 ` Deepak Gopalakrishnan @ 2009-05-19 14:40 ` Detlev Zundel 2009-05-20 4:28 ` Deepak Gopalakrishnan 0 siblings, 1 reply; 25+ messages in thread From: Detlev Zundel @ 2009-05-19 14:40 UTC (permalink / raw) To: u-boot Hi Deepak, > Sorry for not being clear the first time around. My objective is to write a > program with which i will be able to access the u-boot version. Form Linux that is I guess. If you have CONFIG_VERSION_VARIABLE defined in your U-Boot configuration, then according to README (see, documentation can help sometimes): - U-Boot Version: CONFIG_VERSION_VARIABLE If this variable is defined, an environment variable named "ver" is created by U-Boot showing the U-Boot version as printed by the "version" command. This variable is readonly. This variable will also end up in the saved environment, (after at least one saveenv), so you could use the "standard" fw_printenv tools in tools/env/. > Also i would like to add a new parameter to the bootstrap which would > specify the bootstrap version.(which i want to according to changes i > make to bootstrap) You;d have to define what "a bootstrap" is for you. > i assume that for this i will have to write a version string to the nand flash > and then try to access it for the linux kernel....but thats just an idea...have > no clue how to.... Well if "bootstrap" is e.g. a combination of a U-Boot version + a way to boot Linux, you could simply pass an linux commandline option which is not evaluated by the kernel itself, say "bootstrap=..". In Linux you can use /proc/cmdline to read the command line and find your switch, voila. Cheers Detlev -- Q: Does that mean we also shouldn't be using IRQF_SAMPLE_RANDOM on interrupt [sources]? A: Yes. The flag needs to be taken out and shot. -- Matt Mackall <1239116251.14392.133.camel@calx> -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] u-boot version 2009-05-19 14:40 ` Detlev Zundel @ 2009-05-20 4:28 ` Deepak Gopalakrishnan 0 siblings, 0 replies; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-20 4:28 UTC (permalink / raw) To: u-boot Hi In my case, these are the things i do in my bootstrap : *Hardware initialization (DDR) and initialise the clock freq *Load u-boot image from Nand flash in RAM *jump to image address i want to add a version information for this part of the code. Im not in a postion to write a extra nand_write funtion for this bootstrap cause the limit of 4K has almost been covered. What method would u suggest to get around this? thanks & regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] U-boot common/environment.c 2009-05-12 14:30 ` Detlev Zundel 2009-05-18 13:18 ` [U-Boot] u-boot version Deepak Gopalakrishnan @ 2009-05-19 11:17 ` Deepak Gopalakrishnan 2009-05-19 14:34 ` Detlev Zundel 1 sibling, 1 reply; 25+ messages in thread From: Deepak Gopalakrishnan @ 2009-05-19 11:17 UTC (permalink / raw) To: u-boot Hi im using u-boot-1.1.5_atmel_1.2 and want to add a new environment variable for uboot version...my doubt --is it enough that i add this in the env_t environment __PPCENV__ . Also for each entry in this structure there is a macro defined, so if i add version as a new env variable..so this is wat i have made change in common/environment.c line 179 where env_t environment __PPCENV__ is defined #ifdef U_BOOT_VERSION "u-boot_version=" U_BOOT_VERSION #endif is this enough...? thanks & regards, Deepak Gopalakrishnan ^ permalink raw reply [flat|nested] 25+ messages in thread
* [U-Boot] U-boot common/environment.c 2009-05-19 11:17 ` [U-Boot] U-boot common/environment.c Deepak Gopalakrishnan @ 2009-05-19 14:34 ` Detlev Zundel 0 siblings, 0 replies; 25+ messages in thread From: Detlev Zundel @ 2009-05-19 14:34 UTC (permalink / raw) To: u-boot Hi Deepak, > im using u-boot-1.1.5_atmel_1.2 and want to add a new environment variable I doubt that you will get much support with this U-Boot version here on the list. Use latest code if you want to get help. > for uboot version...my doubt --is it enough that i add this in the env_t > environment __PPCENV__ . This all sounds very fishy - you're working on an ARM platform and you change something with a tag __PPCENV__? Well, let's see, oh it looks like you're looking at what is common/env_embedded.c in latest code. Note that this is only for board configuration which embed the environment *inside* the text segment, because of unusal requirements of the flash layout. This is definitely not the norm - does your configuration use CONFIG_ENV_IS_EMBEDDED? > Also for each entry in this structure there is a macro defined, so if i > add version as a new env variable..so this is wat i have made change in > common/environment.c > line 179 where env_t environment __PPCENV__ is defined > > #ifdef U_BOOT_VERSION > "u-boot_version=" U_BOOT_VERSION > #endif > > is this enough...? The environment is a dynamic data section which usually lives outside of U-Boot code in its own data location. Of course we can change the environment in a running system, so the compiled in default environment - or even the embedded environment is only relevant if the "normal" environment is not accessible, e.g. when flashing a module for the first time or after a complete erase operation. Otherwise the "normal" envirnment will be used and even if you change the compiled in set, you will not see much difference if you don't erase the environment on an update. Do you see the conceptual differences here? Cheers Detlev -- Q: Does that mean we also shouldn't be using IRQF_SAMPLE_RANDOM on interrupt [sources]? A: Yes. The flag needs to be taken out and shot. -- Matt Mackall <1239116251.14392.133.camel@calx> -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de ^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2009-05-20 4:28 UTC | newest] Thread overview: 25+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-11-15 18:32 [U-Boot-Users] Add a new command to U-Boot Carlos Filipe Silva 2005-11-15 18:55 ` Cliff Brake 2009-05-07 13:35 ` [U-Boot] " Deepak Gopalakrishnan 2009-05-07 13:40 ` Jerry Van Baren 2009-05-07 13:59 ` Deepak Gopalakrishnan 2009-05-07 15:21 ` Subodh Nijsure 2009-05-08 13:21 ` Deepak Gopalakrishnan 2009-05-08 13:20 ` Jerry Van Baren 2009-05-11 5:32 ` [U-Boot] Uboot reloaction scheme Deepak Gopalakrishnan 2009-05-11 8:16 ` [U-Boot] Add a new command to U-Boot Drasko DRASKOVIC 2009-05-11 14:12 ` [U-Boot] uboot relocate_code() function Deepak Gopalakrishnan 2009-05-11 14:19 ` Liu Dave-R63238 2009-05-11 15:52 ` Timur Tabi 2009-05-11 18:22 ` Scott Wood 2009-05-12 13:47 ` [U-Boot] start.s file Deepak Gopalakrishnan 2009-05-12 14:30 ` Detlev Zundel 2009-05-18 13:18 ` [U-Boot] u-boot version Deepak Gopalakrishnan 2009-05-18 13:16 ` Wolfgang Denk 2009-05-19 9:29 ` Deepak Gopalakrishnan 2009-05-19 14:14 ` Detlev Zundel 2009-05-19 14:41 ` Deepak Gopalakrishnan 2009-05-19 14:40 ` Detlev Zundel 2009-05-20 4:28 ` Deepak Gopalakrishnan 2009-05-19 11:17 ` [U-Boot] U-boot common/environment.c Deepak Gopalakrishnan 2009-05-19 14:34 ` Detlev Zundel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox