summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* image: factorise image printing contentsJean-Christophe PLAGNIOL-VILLARD2010-10-082-1/+178
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-10-081-4/+4
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* image: rename IH_CPU to IH_ARCH to be more concistantJean-Christophe PLAGNIOL-VILLARD2010-10-081-18/+18
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* image: factorise string helperJean-Christophe PLAGNIOL-VILLARD2010-10-082-0/+135
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Revert "image: factorise string helper"Sascha Hauer2010-10-072-135/+0
| | | | This reverts commit 7bd7d59e60f3f23862ebc09c9f3527ee24b2960f.
* Revert "image: rename IH_CPU to IH_ARCH to be more concistant"Sascha Hauer2010-10-071-18/+18
| | | | | | | | | | This reverts commit aba80a2d2d0f1b25185246925577ce2108247dde. Conflicts: include/image.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "Replace direct header access with the API routines"Sascha Hauer2010-10-071-4/+4
| | | | | | | | | | This reverts commit 0ceafe14be072696eff3e549d8c7b7de8a3e416d. Conflicts: include/image.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "image: factorise image printing contents"Sascha Hauer2010-10-072-176/+1
| | | | This reverts commit d424ce77f5e9295584252452dbd78eea562c9af0.
* console: set device_d id at -1Jean-Christophe PLAGNIOL-VILLARD2010-09-241-0/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise image printing contentsJean-Christophe PLAGNIOL-VILLARD2010-09-242-1/+176
| | | | | | | before we duplicate it between command/bootm.c and scripts/mkimage.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Replace direct header access with the API routinesJean-Christophe PLAGNIOL-VILLARD2010-09-241-4/+4
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: rename IH_CPU to IH_ARCH to be more concistantJean-Christophe PLAGNIOL-VILLARD2010-09-231-18/+18
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise string helperJean-Christophe PLAGNIOL-VILLARD2010-09-232-0/+135
| | | | | | | before we duplicate it between common/bootm.c and scripts/mkimage.c Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename __initdata to __early_initdataSascha Hauer2010-09-201-2/+2
| | | | | | | | | The __initdata define was present before Jean-Christophe added it as fake value for Linux compatibility. Rename the previous define to a different name to avoid clashes Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Menu: add box style entryJean-Christophe PLAGNIOL-VILLARD2010-09-201-6/+32
| | | | | | | | | | | | | | | | | | | | | | | this will allow you to create a box style entry via C API by specifying the type as struct menu_entry me = { .display "test", .type = MENU_ENTRY_BOX, .box_state = 1, .action = action_to_run, } and via shell menu -e -a -m <menu> -c <command> [-R] [-b 0|1] -d <description> menu -e -a -m <menu> -u submenu -d [-b 0|1] <description> -b with 0 for not selected and 1 for selected and -c for the command to run when changing state Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: add auto select supportJean-Christophe PLAGNIOL-VILLARD2010-09-201-1/+53
| | | | | | | | | | | this will allow to automaticaly run an entry if the user do no choice this is usefull for boot menu as example with menu -s -m boot -A 3 -d "Auto Boot in" Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: use id as -1 for auto assigned idJean-Christophe PLAGNIOL-VILLARD2010-09-201-0/+1
| | | | | | | | before if you specify id = 0 the next available id will be taken otherwise fail if already registered now as in linux we use -1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add password frameworkJean-Christophe PLAGNIOL-VILLARD2010-09-203-0/+315
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add digest frameworkJean-Christophe PLAGNIOL-VILLARD2010-09-202-0/+78
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* move barebox_default_env.h to include/generated/Jean-Christophe PLAGNIOL-VILLARD2010-09-172-4/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* move utsrelease.h to include/generated/ instead of include/linuxJean-Christophe PLAGNIOL-VILLARD2010-09-171-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* menu: simplify usage for clientsSascha Hauer2010-08-301-8/+100
| | | | | | | | | | | | | | | Clients now only have to call menu_add_submenu or menu_add_command_entry instead of allocating many strings. This also fixes some problems in the menu code. The priv field in struct menu_entry was a pointer to struct menu or a pointer to an allocated string. It was never freed, only had to be freed when it was an allocated string. The reference to a submenu is now kept as a string and not to the menu itself. The code checked the existence of the submenu when creating it, but crashed when the submenu was removed and referenced afterwards. Now the code hapily allows references to nonexistant menus but complains during runtime when the menu is not there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use an initialized struct list as menu listSascha Hauer2010-08-301-12/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: use list_for_each_entry where appropriateSascha Hauer2010-08-301-16/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: remove superfluous struct menu_entry member from struct menuSascha Hauer2010-08-301-10/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: simplify menu_free with list_for_each_entry_safeSascha Hauer2010-08-301-9/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* menu: initialize entries list in menu_allocSascha Hauer2010-08-301-4/+0
| | | | | | Otherwise menu_free fails when menu_add failed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Menu/cmd: add sub menu entry command supportJean-Christophe PLAGNIOL-VILLARD2010-08-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this will simplify the creation of navigation link as this menu -a -m boot -d "Boot Menu" menu -a -m network -d "Network settings" menu -e -a -m network -u boot -d "Back" menu -e -a -m boot -u network -d "Network settings ->" menu -e -a -m boot -c reset -R -d "Reset" menu -e -a -m boot -c clear -d "Exit" menu -s -m boot in C struct menu m_boot = { .name = "boot", .display = "Boot Menu", }; struct menu m_network = { .name = "network", .display = "Network settings", }; struct menu_entry e_to_network = { .display = "Network settings ->", .action = menu_action_show, .priv = &m_network, }; struct menu_entry e_to_boot = { .display = "Back", .action = menu_action_show, .priv = &m_boot, }; struct menu_entry e_reset = { .display = "Reset", .action = menu_action_run, .priv = "reset", }; struct menu_entry e_exit = { .display = "Exit", .action = menu_action_run, .non_re_ent = 1, .priv = "clear", }; void menu_test(void) { menu_add(&m_boot); menu_add(&m_network); menu_add_entry(&m_boot, &e_to_network); menu_add_entry(&m_boot, &e_reset); menu_add_entry(&m_boot, &e_exit); menu_add_entry(&m_network, &e_to_boot); menu_show(&m_boot); } Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add Menu FrameworkJean-Christophe PLAGNIOL-VILLARD2010-08-303-0/+323
| | | | | | | | | | | | | | | | | | | | | | | Introduce a menu framework that allow us to create list menu to simplify barebox and make it more user-frendly This kind of menu is very usefull when you do not have a keyboard or a serial console attached to your board to allow you to interract with barebox For the develloper part, The framework introduce two API 1) C that allow you to create menu, submenu, entry and complex menu action 2) Command that allow you as the C API to create menu, submenu, entry and complex menu action but this time the actions will be store in a function and then be evaluated and excecuted at runtime. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Kconfig: sync with linux kernel v2.6.36-rc1-168-ge36c886Jean-Christophe PLAGNIOL-VILLARD2010-08-221-0/+13
| | | | | | this will add also the support of the new ncurse interface nconfig Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* barebox_default_env: fix out of tree buildJean-Christophe PLAGNIOL-VILLARD2010-07-221-3/+5
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Allow to merge default environment from more than one directorySascha Hauer2010-06-222-4/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* errno: add strings for network related error messagesSascha Hauer2010-06-171-3/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework device parametersSascha Hauer2010-06-171-19/+21
| | | | | | | | Change device parameters so that the memory management is in generic code. This also removes the need of storing statically initialized parameters as they are stored in a struct list_head for each device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix error return value while loading environmentLuotao Fu2010-05-031-1/+5
| | | | | Signed-off-by: Luotao Fu <l.fu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clock: fix possible error on overflow in is_timeoutUwe Kleine-König2010-04-221-2/+1
| | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce a arch_shutdown call and call it from shutdown_bareboxSascha Hauer2010-03-301-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make panic and hang __noreturn functionsSascha Hauer2010-03-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: allow fancy promptsSascha Hauer2010-03-302-4/+17
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: only remove backslashes introduced from globSascha Hauer2010-03-301-2/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hush: Fix return code when calling 'exit' inside loopsSascha Hauer2010-03-301-11/+3
| | | | | | | | | | | | | | | | | | | | v2: Do not exit from all scripts but only the current one This fixes the case: barebox:/ cat /test if [ 0 = 0 ]; then exit 1 fi barebox:/ /test barebox:/ echo $? 0 barebox:/ Also, remove code to not allow exit from main shell. The for(;;) loop in common/startup.c will bring us back anyway. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-014-19/+19
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused file common/flash.cSascha Hauer2010-02-011-73/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Remove/adjust erroneous references to CONFIG_MODULE.Robert P. J. Day2009-12-211-1/+0
| | | | | | | | The correct config variable is CONFIG_MODULES, so tweak any references to the incorrect CONFIG_MODULE. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-1510-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Re-format the fileJuergen Beisert2009-12-101-912/+781
| | | | | | | Re-format the file with 'indent' and some manual corrections. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
* Combine memory initialization with the main memory functions.Juergen Beisert2009-12-102-106/+60
| | | | | | | | | Memory allocation is very simple in u-boot-v2. So, it makes also sense to add the "operating system" emulation layer into the main memory management source file, to keep them at one place and simple. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
* Use the global string functionsJuergen Beisert2009-12-101-108/+6
| | | | | | | | | Don't try to be smarter than GCC. There are various better optimizations available than to write our own. So, use the globaly available string functions instead. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
* Remove win32 supportJuergen Beisert2009-12-101-186/+0
| | | | | | | Remove never used code. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
* Remove debug codeJuergen Beisert2009-12-101-179/+0
| | | | | | | | When assert() is always defined to do nothing, the debug functions makes no sense, because they also do nothing. Removing them shrinks the code. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>