9
0
Fork 0
Commit Graph

9872 Commits

Author SHA1 Message Date
Sascha Hauer bf8988d820 Merge branch 'for-next/fs'
Conflicts:
	fs/Kconfig
	fs/Makefile
2013-10-07 07:59:42 +02:00
Sascha Hauer 574947ef76 Merge branch 'for-next/console' 2013-10-07 07:59:18 +02:00
Sascha Hauer fb0c2ee1ae Merge branch 'for-next/bpkfs' 2013-10-07 07:59:18 +02:00
Sascha Hauer e48331d6e2 Merge branch 'for-next/bootm' 2013-10-07 07:59:18 +02:00
Sascha Hauer b32f56e7dd Merge branch 'for-next/at91' 2013-10-07 07:59:18 +02:00
Sascha Hauer 2a10286e49 Merge branch 'for-next/arm' 2013-10-07 07:59:18 +02:00
Sascha Hauer d28c9bb55d dhcp: replace dhcp_getenv_int with getenv_uint
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-07 07:59:00 +02:00
Sascha Hauer 0546e669a2 bootm: Replace getenv_loadaddr with getenv_ul
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-07 07:57:42 +02:00
Sascha Hauer 577de193df Release v2013.10.0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-07 07:40:36 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2f677b9b1e fs: add BPKFS support
Simple update file format developed for Somfy, tools and library are
available under LGPLv2 (https://www.gitorious.org/libbpk).

This format in the v1.0 allow you to store 6 types a binary stream for
a unique hardware id:
 - bootloader
 - bootloader_version
 - description.gz
 - kernel
 - rootfs
 - firmware_version

and you can easly add more binary stream type.

The fs will display you in a directory per hw id

and if a binary stream type is unknown will be display
as unknown_%08x

 # mount image.bpk /tmp
 # ls -l /tmp/hw_id_0/
-rwxrwxrwx         10 firmware_version
-rwxrwxrwx          8 firmware_version.crc
-rwxrwxrwx    1845968 kernel
-rwxrwxrwx          8 kernel.crc
-rwxrwxrwx    5062656 rootfs
-rwxrwxrwx          8 rootfs.crc
-rwxrwxrwx        248 bootloader
-rwxrwxrwx          8 bootloader.crc
-rwxrwxrwx     248925 description.gz
-rwxrwxrwx          8 description.gz.crc
-rwxrwxrwx          4 bootloader_version
-rwxrwxrwx          8 bootloader_version.crc
-rwxrwxrwx          4 unknown_1234567g
-rwxrwxrwx          8 unknown_1234567g.crc

Why BPK and not CPIO or uImage

1) CPIO

cpio does not handle > 4GiB image and does not have any crc checksum

2) uImage

uImage only provide one crc32 for the all data part and only a list of binary
stream with no information about what is what (in multi-image format)

3) BPK

BPK provide a crc32 for the header part and one crc32 per binary stream
so if you does not care of some data you are not force to check them

And you known exactly the binary stream type and for which hw to
use it.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Fargier Sylvain <sylvain.fargier@somfy.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:31:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 32d88d9a86 filetype: add Binary PacKage BPK type
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:26:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6a5121f748 console: factorise function to get the first enabled console
rename it to console_get_first_active

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:19:46 +02:00
Jan Luebbe 453fe26ed7 beaglebone: use most recent timings for white variant
These values come from the U-Boot source code.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:13:53 +02:00
Jan Luebbe 58bed295c2 arm: omap: am33xx_generic: fix DDR setup for DDR2
For DDR2 RAMs, regs->zq_config is not used, which causes the
AM33XX_EMIF4_0_REG(SDRAM_CONFIG) register to be left unconfigured, resulting
in boot failure.

It seems that the DDR2 case was missed during the consolidation in commit
9f122f8bf0. The actual call for the Bone was
removed in 88659d9c4a.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:13:53 +02:00
Jan Luebbe 138f604bb2 arm: mmu: be more verbose if ttb setup fails
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:13:53 +02:00
Jan Luebbe 45b1e9c274 am33xx_generic: convert from switch to if/else
The function am33xx_get_cpu_rev may be called before barebox_arm_entry(),
so we need to avoid switch statements. One example is the BeagleBone,
where we use this function to differenciate between the white and black
variants.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:13:53 +02:00
Teresa Gámez 363843eba7 mci: omap: Fix default value of mci.f_max
With commit c2ef47887 mci.f_max default value is
only set when pdata is available.

Fix this with always setting the mci.f_max default
value and overrite it when pdata available.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-02 10:26:17 +02:00
Lucas Stach 34129cbd76 images: correctly linebreak built images output
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-02 10:23:50 +02:00
Sascha Hauer b2755ea06d mips: bcm47xx: Fix compiler warning
Fixes:

arch/mips/mach-bcm47xx/include/mach/debug_ll.h: In function 'PUTC_LL':
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:33: warning: passing argument 1 of '__raw_readb' makes pointer from integer without a cast
arch/mips/mach-bcm47xx/include/mach/debug_ll.h:34: warning: passing argument 2 of '__raw_writeb' makes pointer from integer without a cast

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-02 09:50:48 +02:00
Sascha Hauer fd4d237fc9 ARM: vexpress: Fix compiler warning
Fixes:

arch/arm/boards/vexpress/init.c: In function 'vexpress_core_init':
arch/arm/boards/vexpress/init.c:139:22: warning: 'hostname' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-02 09:50:40 +02:00
Sascha Hauer 9d5cf83ed1 ARM: Ka-Ro TX28: Fix result checking of devfs_add_partition
devfs_add_partition was changed to return the cdev. Fix the result
checking accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 16:08:23 +02:00
Sascha Hauer cfe7885b04 ARM: mx23-evk: Fix result checking of devfs_add_partition
devfs_add_partition was changed to return the cdev. Fix the result
checking accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 16:08:11 +02:00
Sascha Hauer 826928bd31 ARM: friendlyarm-tiny210: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 16:05:05 +02:00
Sascha Hauer 17475ec0a3 ARM: edb93xx: Add missing include
Fixes:

arch/arm/boards/edb93xx/edb93xx.c: In function 'edb93xx_console_init':
arch/arm/boards/edb93xx/edb93xx.c:123:2: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 16:04:34 +02:00
Sascha Hauer 7ade2ef4a9 loads: use getenv_bool for 'loads_echo'
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 10:28:58 +02:00
Sascha Hauer 5ee4ad2229 environment variables: introduce new helpers
This introduces some new environment variable helpers and updates
the existing ones. Newly introduced are:

getenv_bool: read a bool variable
getenv_ul: read an unsigned long variable
getenev_uint: read an unsigned int variable
getenv_nonempty: like normal getenv, but does return NULL instead of an
                 empty string

All new helpers take a pointer to the value. This value is only modified
when the variable exists. This allows the following programming scheme:

	unsigned int myvalue = sanedefault;

	getenv_uint("myvalue", &myvalue);

So without checking the return value myvalue contains the best possible
value.

getenv_ull is updated to this scheme.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 10:28:52 +02:00
Sascha Hauer 28141f9e5a defenv-2: replace boot script with command
This replaces the 'boot' script in the defaultenv-2 with a command
with the same behaviour. A command gives more flexibility for future
externsions

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 07:45:04 +02:00
Sascha Hauer 5a968fc81c bootm needs uImage support. Select it
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-30 07:45:04 +02:00
Sascha Hauer d4f5bb1e01 copy_file: Add missing O_TRUNC
Without it, when copying a smaller file over a larger file the
resulting file still has the remaining space from the larger file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-29 12:10:59 +02:00
Teresa Gámez e2b67d6a6a lib: Fix copy_file when filesize is FILESIZE_MAX
Using tftp command does not work proper when files
have FILESIZE_MAX, as copy_file and show_progress
can not handle it. Check the file size for FILESIZE_MAX
and handle it as file size = 0.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 16:20:17 +02:00
Sascha Hauer 8d7f51aeea ata: ide-sff: Add missing wait for ready in write function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:14:01 +02:00
Sascha Hauer 08ed36a3a5 detect command: Add missing help text for -a option
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:13:56 +02:00
Sascha Hauer 7220b134ba ARM: pfla02: Fix compiler warning
PUTC_LL no longer exists. Use putc_ll instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:12:43 +02:00
Teresa Gámez 2dd415bce2 arm: Update mach-types
Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 10:56:37 +02:00
Jean-Christophe PLAGNIOL-VILLARD 12158a28d4 fs: add uimagefs
this will provide the image data and information via file

 # ls -l /tmp/
-rwxrwxrwx          3 arch
-rwxrwxrwx         12 compression
-rwxrwxrwx         16 name
-rwxrwxrwx          5 os
-rwxrwxrwx         24 time
-rwxrwxrwx         12 type
-rwxrwxrwx         10 load_addr
-rwxrwxrwx         10 entry_point
-rwxrwxrwx    2199875 data0
-rwxrwxrwx    2199875 data
-rwxrwxrwx         10 data.crc

if it's multi image

 # ls -l /tmp-multi/
-rwxrwxrwx          3 arch
-rwxrwxrwx         12 compression
-rwxrwxrwx         16 name
-rwxrwxrwx          5 os
-rwxrwxrwx         24 time
-rwxrwxrwx         16 type
-rwxrwxrwx         10 load_addr
-rwxrwxrwx         10 entry_point
-rwxrwxrwx       1292 data0
-rwxrwxrwx        983 data1
-rwxrwxrwx       2287 data
-rwxrwxrwx         10 data.crc

you can get the image header via an ioctl on any file
UIMAGEFS_METADATA

if you want to check the crc do

 # crc32 -f /tmp-multi/data -V /tmp-multi/data.crc
CRC32 for /tmp-multi/data 0x00000000 ... 0x000008ee ==> 0x88d5a0db

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 10:39:56 +02:00
Sascha Hauer f043520c5a pwm: sanity check values before passing them to the drivers
Check for valid period size before calling ops->config. This fixes
the pxa driver which otherwise does a division by zero. While at
it, also check for duty_ns being smaller or equal to period_ns.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
2013-09-27 07:16:50 +02:00
Sascha Hauer ab8a576a09 ARM: dts: i.MX6q: cpus/cpu nodes dts updates
Add device_type = "cpu", otherwise a v3.10 kernel boots with only
one CPU enabled.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 07:11:02 +02:00
Jean-Christophe PLAGNIOL-VILLARD 651a23a69e console_simple: fix: set f_active
so generic code can check if the console is enabled

and now we can use loadb & loadxy

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:22:50 +02:00
Sascha Hauer 45212cdd72 command: Let builtin command take precedence
In theory we can overwrite a builtin command with a script. However,
I don't know a single case where this has been done. Scripts are
often more unflexible than commands so it's unlikely that a script
can extend the functionality of a builtin command. Moreover, the
internal command is no longer accessible once it's overwritten by
a script.

Invert this logic so that a builtin command can overwrite an existing
script. This will help when the 'boot' script is converted to a
builting command. Then with old environments the builtin command will
be used instead of the script.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 56f33b4679 ARM: compile bootm code depending on CONFIG_BOOTM
The bootm code is now independent from the actual bootm command, so
compile the ARM specific bootm code based on CONFIG_BOOTM and not on
CONFIG_CMD_BOOTM.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 68e6eceae9 bootm: Add dryrun support
This adds support for checking the bootm command without actually booting.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer b15c5eeecf bootm: separate bootm input data and internal data
We used to use struct image_data as the central data structure for bootm and
also as the input data structure. This makes it unclear which of the fields
are actually input data. This patch creates a struct bootm_data which is
exclusively used for input data to make usage clearer.

Also it moves the dispatching of multifile uImage pathnames to the core bootm
code so that the core code gets more flexible and the command code simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 172fc40f61 bootm: move globalvars from command to common
The globalvars should be available even if the bootm command
is not directly present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer fc5923d975 bootm: move getenv_loadaddr from command to common
getenv_loadaddr may be used by other code, so move it
from command/ to common/

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer feb2e4a947 bootm: remove unused define
OFTREE_SIZE_INCREASE isn't used anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 81e0f84dca bootm: check for os image file
Check if an os image file has been given.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer a0dd2f162a bootm: fix memory leak
data->of_root_node may be allocated from of of_unflatten_dtb.
Free it in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:18 +02:00
Sascha Hauer 3c2df61f63 bootm: fix possible memory leak
fdt is allocated, free it in error case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:03:17 +02:00
Sascha Hauer 47974cac82 bootstrap: Add missing include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:39:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 770e1a4d63 serial: do not set default baudrate at init
this will be done at activation

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-22 16:46:51 +02:00