summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* drivers/base: fix corrupt device treeSascha Hauer2012-12-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_add_child is a very unsafe function. If called multiple times it allows setting the same device to different parents thus corrupting the siblings list. This happens regularly since: | commit c2e568d19c5c34a05a1002d25280bf113b72b752 | Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | Date: Sat Nov 3 16:11:05 2012 +0100 | | bus: add bus device | | automatically add it as parent of any bus device if none already specified | | we have now a nice output per bus If for example a FATfs is mounted this nice output per bus often ends with: > `---- fat0 > `---- 0 > `---- 0x86f0000087020031-0x86f000410df27124: /dev/<NULL> > `---- sram00 > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > `---- 0x00000000-0xffffffffffffffff: /dev/<NULL> > unable to handle NULL pointer dereference at address 0x0000000c > pc : [<87f08a20>] lr : [<87f08a04>] > sp : 86eff8c0 ip : 87f3fbde fp : ffffffff > r10: ffffffff r9 : 00000000 r8 : 00000003 > r7 : 86f075b8 r6 : 00000002 r5 : ffffffec r4 : 86f07544 > r3 : 00000000 r2 : 43f900b4 r1 : 00000020 r0 : 00000005 > Flags: Nzcv IRQs off FIQs off Mode SVC_32 > [<87f08a20>] (do_devinfo_subtree+0x90/0x130) from [<87f08a90>] (do_devinfo_subtree+0x100/0x130) > > [<87f3e070>] (unwind_backtrace+0x0/0x90) from [<87f28514>] (panic+0x28/0x3c) > [<87f28514>] (panic+0x28/0x3c) from [<87f3e4b8>] (do_exception+0x10/0x14) > [<87f3e4b8>] (do_exception+0x10/0x14) from [<87f3e544>] (do_data_abort+0x2c/0x38) > [<87f3e544>] (do_data_abort+0x2c/0x38) from [<87f3e268>] (data_abort+0x48/0x60) This patch fixes this by adding a device to its parents children list in register_device so that dev_add_child is no longer needed. This function is removed from the tree. Now callers of register_device have to clearly set the parent *before* registering a device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Jan Lübbe <jlu@pengutronix.de>
* Merge branch 'kconfig'Sascha Hauer2012-12-081-8/+8
|\
| * Cleanup Kconfig filesAlexander Shiyan2012-12-081-8/+8
| | | | | | | | | | | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/tftp'Sascha Hauer2012-12-071-24/+0
|\ \
| * | uimage: fix misunderstanding in common/uimage.cVicente Bergas2012-11-261-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The option of reading the file at once was discarded because the option of increasing the buffer size provided almost the same benefit. Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2012-12-071-5/+8
|\ \ \
| * | | password: fixed underflow on <backspace>Enrico Scholz2012-12-051-5/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | due to missing/misplaced boundary check, deleting characters could underflow the password buffer. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2012-12-071-0/+2
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: arch/arm/mach-imx/include/mach/devices-imx53.h
| * | | debug_ll: Add some usage commentsSascha Hauer2012-12-051-0/+2
| | |/ | |/| | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/ext4'Sascha Hauer2012-12-072-13/+36
|\ \ \
| * | | add ext fs detection supportSascha Hauer2012-12-031-0/+8
| | | | | | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | filetype: Pass bufsizeSascha Hauer2012-12-032-13/+28
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass the buffer size to the file detection code. This makes sure we do not read past the buffer. This is especially useful for ext filesystem detection as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE define which is set to the minimum bufsize the detection code needs to detect all known filetypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/commands'Sascha Hauer2012-12-072-4/+12
|\ \ \ | |/ / |/| |
| * | loadenv: allow more fine grained environment loadingSascha Hauer2012-11-292-4/+12
| |/ | | | | | | | | | | | | | | | | | | | | This implements two new options for the loadenv command: -s: removes (scrubs) old directory contents to be able to create a fresh environment from for example /dev/defaultenv -n: no overwrite. Do not overwrite existing files. This allows to keep parts of the old environment. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / barebox update: fix finding default handlerSascha Hauer2012-12-031-5/+8
|/ | | | | | | It was not possible to register another handler when already a default handler is registered. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* uimage: improve transfer speedVicente2012-11-161-2/+25
| | | | | Signed-off-by: Vicente <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/of'Sascha Hauer2012-11-162-5/+14
|\ | | | | | | | | | | Conflicts: drivers/of/base.c include/of.h
| * of: Print model name in bannerSascha Hauer2012-10-091-2/+9
| | | | | | | | | | | | | | If we know the model name from the devicetree print this in the banner instead of the hardcoded board name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * memory: return error in barebox_add_memory_bankSascha Hauer2012-10-081-3/+5
| | | | | | | | | | | | | | | | When a memory bank is already registered, return an error code instead of throwing a bug. This can happen if a board has registered a memory bank and the same bank is then probed from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2012-11-166-73/+79
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: commands/Makefile Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | environment variables: use linux listSascha Hauer2012-10-302-62/+71
| | | | | | | | | | | | | | | | | | | | | | | | This switches environment variables to use linux list. This is easier to read. An additional plus is that the environment variables no longer need an initcall, so malloc is the only requirement for them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | UIMAGE: improve transfer speedVicente Bergas2012-10-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Vicente Bergas <vicencb@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common/partitions.c: make use of is_fat_or_mbrFranck Jullien2012-10-121-1/+2
| | | | | | | | | | | | | | | Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | startup: Print error message when initcall failsSascha Hauer2012-10-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a time when we used to panic when initcalls failed. Then it was changed to totally ignore the return value. Instead, print an error message now so that the user can get a clue when something bad happened. So initcalls are now recommended to actually return negative error codes when something fails. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | resource: statically initialize iomem resourceSascha Hauer2012-10-071-8/+2
| |/ | | | | | | | | | | | | This gets us rid of an initcall and also has the advantage that request_iomem_region can be called at any time now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2012-11-163-0/+154
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: arch/arm/boards/guf-neso/lowlevel.c arch/arm/boards/pcm038/lowlevel.c commands/Makefile
| * | Add in-system barebox update infrastructureSascha Hauer2012-10-173-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in-system update means to write an arbitrary file to an arbitrary device. There is no sanity check if the flashed image is of the right type or will fit onto the device. Furthermore some SoCs need a special preparation step for their images before flashing them. This adds a barebox in-system update infrastructure. Boards can register update handlers which know how to make the board bootable. The available handlers can be listed to be able to select one, different force levels give the user the chance to know it better. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/filetype-command'Sascha Hauer2012-11-161-19/+32
|\ \ \
| * | | filetype: add shortnamesSascha Hauer2012-10-301-19/+32
| |/ / | | | | | | | | | | | | | | | | | | The filetype strings are not really suitable for shell scripts, so add a shortname array of filetypes usable for shell scripts. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/console'Sascha Hauer2012-11-163-35/+64
|\ \ \
| * | | console: display Switch to console [csxx] when switching from debug_ll to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | real console Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | console: use debug_ll before the console is availableJean-Christophe PLAGNIOL-VILLARD2012-10-302-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow to have the same feature as earlyprintk in the kernel Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | console/of: evaluate linux,stdout-path propertySascha Hauer2012-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a linux,stdout-path property is given in the devicetree activate the corresponding console. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | console: cleanup KconfigSascha Hauer2012-10-091-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a choice for the CONSOLE_ACTIVATE_* variables, which is the natural way of specifying mutually exclusive variabled in Kconfig. Also update the help texts a bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | console: Cleanup console activationSascha Hauer2012-10-091-25/+26
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_CONSOLE_ACTIVATE_ALL is set, the banner will never be printed. Also, the console buffer is emptied when the first console is registered, even when it's not enabled. This patch cleans it up in a way that: - the console buffer is emptied once the first console is activated, not when it's registered. - Make sure that the banner is printed first, so that we can output things to the buffer before the banner is printed without ending up in having the banner in the middle of the other boot messages. - Use IS_ENABLED rather than ifdefs Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/w1' into for-next/at91Sascha Hauer2012-11-151-5/+11
|\ \ \
| * | | clock: introduce non interruptible timeoutJean-Christophe PLAGNIOL-VILLARD2012-10-291-5/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is_timeout call poller_call if the timeout is >= 100us but on 1-wire bus we need to wait 500us and not more than 930us for the bus reset. So if the poller_call is caller we can not guarantee it. So for this introduce is_non_interruptible_timeout than we only wait. Use it for ndelay too. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | command: return 1 on unknown commandSascha Hauer2012-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | hush now prints the error value if a command returns a value < 0, so do not return -1 (EPERM) when we encounter an unknown command. Instead, return 1 so that hush is quiet. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | uimage: Fix deleting of temporary fileSascha Hauer2012-10-301-2/+2
|/ / | | | | | | | | | | | | the uImage support may generate a temporary file which ought to be deleted after usage. Due to the wrong filename this never happened. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | defaultenv: dependencies fixesSascha Hauer2012-10-122-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a build with a compressed default environment is done and then environment compression is disabled, barebox_default_env.h is not regenerated because its dependency (now barebox_default_env) is still up to date. This results in a corrupt default environment. This patch fixes this by adding a cmd_env_h and changing barebox_default_env.h to FORCE. As a side effect barebox_default_env.h is no longer generated in include/generated/ but in common/ as we have to add barebox_default_env.h to $(targets) (extra-y). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common/paritions.c: force little endian readsFranck Jullien2012-10-121-4/+4
|/ | | | | | | | When reading values from a DOS disk, we need to force a little endian reading. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/defaultenv-deps'Sascha Hauer2012-10-031-12/+20
|\
| * environment generation: Fix dependenciesSascha Hauer2012-09-281-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependencies for generating the environment do not work properly: - If files are removed from the defaultenv, a subsequent make will not update the default environment. - If CONFIG_DEFAULT_ENVIRONMENT_PATH changes, the default environment also will not be regenerated. This patch fixes this by introducing a cmd_env which has the content of $(ENV_FILES) in the command so that the if_changed mechanism recognizes a change when $(ENV_FILE) changes. This also results in a nice " ENV " string in the build process. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * environment generation: remove unused CLEAN_FILESSascha Hauer2012-09-281-4/+0
| | | | | | | | | | | | | | The CLEAN_FILES in common/Makefile are unused. All generated files are removed from the toplevel Makefile. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/arm-remove-arch-init-ll'Sascha Hauer2012-10-031-3/+0
|\ \ | | | | | | | | | | | | Conflicts: arch/arm/include/asm/barebox-arm.h
| * | ARM: remove ARCH_HAS_LOWLEVEL_INITSascha Hauer2012-09-251-3/+0
| |/ | | | | | | | | | | | | | | This is unused now and not needed. We have a board_init_lowlevel. If a board needs some architecture setup it can always call it from its board_init_lowlevel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-0326-92/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * | Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-1726-92/+0
| |/ | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/png'Sascha Hauer2012-10-031-0/+7
|\ \ | | | | | | | | | | | | | | | Conflicts: common/filetype.c include/filetype.h