9
0
Fork 0
Commit Graph

12679 Commits

Author SHA1 Message Date
Lucas Stach b2e8ce4b76 imd: provide dummy imd_command_setenv
If CONFIG_CMD_IMD is not set there is no imd_command_setenv in the
barebox binary that can be linked to. Although the whole imd infrastructure
will be removed by the linker later in the build process as soon as it
figures out that nothing inside barebox is using it, we still have to
provide a dummy function to keep the build going.

Fixes:
In function `imd_command': undefined reference to `imd_command_setenv'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 10:58:08 +01:00
Masahiro Yamada 84fcb11b02 pbl: remove start_barebox() stub
PBL never calls start_barebox().  If it does, it is a bug.
Without this stub function, we can detect such a bug at link time.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 10:50:22 +01:00
Sascha Hauer cd7feae00b defaultenv-2: mtdparts-add: Use new partition parameter
mtd devices now have a partition parameter to create mtd partitions.
Use it to simplify the mtdparts-add script.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 341f7d5574 defaultenv-2: mtdparts-add: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer ed440360e6 mtd: fixup device tree partitions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 2bdbd1436d mtd: Add a partitions parameter to mtd devices
The partitions parameter allows to partition a mtd device
using a standard cmdline partition description string. This
way the partitions of a mtd device can be changed at once.
The output of the string can be used to be passed to the kernel
as cmdline partition string. The partitions can also still be
changed with addpart/delpart, the partitions parameter will
be updated accordingly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 8f19864803 mtd: Use flags parameter in mtd_add_partition
mtd_add_partition is passed a flag parameter. This has been unused
so the DEVFS_PARTITION_FIXED and DEVFS_PARTITION_READONLY were ignored.
Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer 8587c5f8a9 mtd: forbid conflicting mtd partitions
mtd partitions should not conflict with each other, so forbid this.
Also add the partitions to the partitions list sorted, so that they
can be easier translated into a cmdline partition string.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer e5c73e0fe1 cmndlinepart: skip devname if partstr already contains it
When the partition name already starts with "devname." skip this
when adding the partition.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:44 +01:00
Sascha Hauer c1156d841f cmdlinepart: add function to parse a cmdline partition string
This adds a function to parse a full cmdline partition string. The
addpart command is switched to use this function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 10a0aaabfe cmdlinepart: make argument types safer
The return size should be loff_t to support partitions bigger
than 4G. Also use const for the devname and endp.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer d397eb6162 cmdlinepart: Change SIZE_REMAINING to loff_t
For compatibility with devices > 4G.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 39f6392d93 move cmdline partition parsing code to separate file
So it's no longer local to the addpart/delpart code and can be used
from other code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 7649473f40 mtd: nand: remove automatically created bb devices
the bb devices which are created in add_mtd_device() must be removed
in del_mtd_device(). Also remove deletion of the bb devices in the
mtdparts-add environment file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 99bed34278 mtd: Add partitions to list
So that we can iterate over the existing partitions from the master
mtd device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 891e08b822 mtd: partitions: Add error check
add_mtd_device can fail. Add an error check and bail out properly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer 31d8b2e83d mtd: partitions: Use xstrdup
The return value of strdup is not checked. Use xstrdup instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer b798f55495 mtd: core: add error checks
register_device and devfs_create can fail. Add error checks for these.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:42 +01:00
Sascha Hauer 977be3d715 of: Add for_each_child_of_node_safe
Needed for iterating over child nodes and deleting the children.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:42 +01:00
Sascha Hauer c0225222c1 ARM: remove unused variable
arm_architecture is unused, remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:50 +01:00
Sascha Hauer e986c1eae8 dts: update to v3.19-rc7
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:09 +01:00
Sascha Hauer a3a33ebc1c dts: update to v3.19-rc6
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer 52329fa2e3 dts: update to v3.19-rc5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer 7439e0ffa8 dts: update to v3.19-rc3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer ab001302c8 dts: update to v3.19-rc1
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer c937ef5d34 dts: update to v3.18-rc7
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer 66b7b55c09 dts: update to v3.18-rc6
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer e85ff327c2 dts: update to v3.18-rc5
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer c61cf95d46 dts: update to v3.18-rc4
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Sascha Hauer f271dddb33 dts: update to v3.18-rc3
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:50:08 +01:00
Uwe Kleine-König dd6090ecba mtd: nand-imx: don't copy more bytes than read from hardware
The NFC command used for reading the result of a READID command to the NAND chip
reads 6 bytes (in x8 mode) or 6 words (in x16 mode with the upper bytes all
being 0). So there is no need to safe 16 bytes for later consumption.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:49:30 +01:00
Brian Norris 1a0ab5e97e mtd: nand: cleanup ONFI printed errors, warnings
This corresponds to commit c7f23a70635895b5125aeb5593aaf8cb44d3a088 in
the Linux kernel.

One notable difference is however that ONFI detection is allowed here
even in 16-bit mode. This is proved to work fine on an i.MX25 based
machine with a x16 NAND.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:49:30 +01:00
Uwe Kleine-König a6eacb9b33 mtd: nand-imx: fix byte reading in x16 mode
There are a few NAND commands that make the chip only respond on I/O
lines 0 to 7 even for x16 devices. READID (90h) is one such command
which was already handled fine in the driver (at least for NFC v1 and
v2). Other commands (like PARAM (ECh) to read out ONFI parameters)
however were not handled properly. Instead of adding another callback
make the read_byte callback handle the holes added by the NFC and depend
on the nand-base support to call read_byte when necessary instead of
read_buf.

This fixes reading the ONFI parameter page on an i.MX25 with an x16 NAND
and probably[1] also the result of READID on i.MX51/i.MX53 with x16
NAND.

[1] untested because no matching machine available

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:49:30 +01:00
Bo Shen 6c2a1c6769 ARM: atmel: at91sam9n12: add subtype support
As the at91sam9n12 series includes at91sam9n12, at91sam9cn11,
at91sam9cn12. So, add subtype to distinguish them.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 09:38:07 +01:00
Masahiro Yamada d7dc46d5d6 defaultenv: ignore barebox_zero_env
Since commit c4c2317fe8 (defaultenv: generate force-built-in
(zero) environment file), we have this generated file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-11 08:34:29 +01:00
Bo Shen 34e4f98539 ARM: atmel: sama5d4 xplained: correc env path
Correct the environment path for sama5d4 xplained board.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 10:36:07 +01:00
Antony Pavlov b7120bb88d openrisc: barebox.lds.S: fix BFD format names
Here is Franck Jullien's comment (see
http://lists.infradead.org/pipermail/barebox/2015-February/022259.html):

  > Until now, the official openrisc toolchain was called or32.
  > However, the new one (and maintained one)  is called or1k. So we need
  > to change "elf32-or32" to "elf32-or1k" in barebox.lds.S.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 10:35:32 +01:00
Sascha Hauer c7dbb6c689 mtd: nand-bb: Also print raw position in debug messages
When debugging the nand-bb devices also the raw position on the
device is interesting, print it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:58:23 +01:00
Sascha Hauer ce073eb9e4 mtd: nand-bb: Fix test for bad block when reading
in nand_bb_read() 'offset' contains the virtual position on the device,
but we have to test for a bad block on the raw physical position, so
use bb->offset instead of offset

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:58:23 +01:00
Sascha Hauer eebfbe9116 mtd: nand-bb: fix erasing bb devices with bad blocks
mtd_erase does not skip bad blocks, we must skip them in nand_bb_erase
instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:58:18 +01:00
Sascha Hauer 3b71b23b46 mtd: nand-bb: Fix accesses beyond device
When a block is marked bad after the bb device has been created
the real size of the bb device is smaller than the calculated size
on creation. In this case we can't rely on the upper layers anymore
that they won't pass read/write sizes in that fit into the device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:55:44 +01:00
Sascha Hauer 9d82489c07 mtd: Fix allowing to erase bad blocks on partitions
Partitions are mtd devices themselves, but the 'erasebad'
parameter is only set to the master mtd device. To allow to
erase bad blocks on partitions test the master device instead
of the partition devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:55:44 +01:00
Sascha Hauer 0d26729d85 mtd: nand: omap: Fix OMAP_ECC_BCH8_CODE_HW ecc mode
This is broken since:

| commit 00f119a293
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Fri Aug 1 14:09:48 2014 +0200
|
|     mtd: omap gpmc: fix ecc bytes/size
|
|     The ecc bytes / size are per subpage, not per page.
|
|     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

The ecc code in omap_correct_data() expects to correct a whole page
at once, so we must tell the nand layer that we have 4 * 13 bytes of
ecc bytes and 4 * 512 bytes of ecc size. Otherwise the NAND layer will
iterate over 512 byte steps over a page and call the .correct callback
each time.

This only works for 2k pagesize and needs revisit once other page sizes
shall be supported. It would be better to tell the nand layer the real
ecc bytes (13) and ecc size (512) instead and drop the iteration in
omap_correct_bch(). However, this needs better testing so it isn't done
here now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:55:43 +01:00
Sascha Hauer 4497013f0a ARM: Phytec phyCORE OMAP4460: Split xload defconfigs
The configs grew too big to support both NAND and MMC at the
same time, so split them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:55:43 +01:00
Sascha Hauer 6f88d51efd blspec: put blspec bootargs into a .dyn bootargs variable
So that they get deleted later when something else is booted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-10 09:55:43 +01:00
Wadim Egorov c145c929cb ARM: dts: Add a new compatible type for am335x phytec SOMs
Added a new compatible type for am335x phytec SOMs

  "phytec,am335x-som"

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-06 08:14:54 +01:00
Wadim Egorov eb47b05c27 ARM: am335x: phyFLEX-AM335x: Split DT and add MLO DT
To support different module variants, this patch splits the phyFLEX DT
in dts and dtsi.

And we are also adding a DT for the MLO, which has all bootable devices
disabled. The bootsource is checked in the board file and only the needed
device is enabled and registered.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-06 08:14:54 +01:00
Sascha Hauer 35405138c8 Merge branch 'for-next/socfpga' 2015-02-04 19:09:16 +01:00
Sascha Hauer 2afe398a62 Merge branch 'for-next/raspberry-pi' 2015-02-04 19:09:15 +01:00
Sascha Hauer 1b95290433 Merge branch 'for-next/pxa' 2015-02-04 19:09:15 +01:00