9
0
Fork 0
Commit Graph

9815 Commits

Author SHA1 Message Date
Sascha Hauer 8dbf2821e9 mtd: rename MTD_OOB_* to MTD_OPS_*
To sync with the Linux kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 16:13:49 +02:00
Sascha Hauer 278c16713a mtd: nand: write BBM to OOB even with flash-based BBT
This is based on Linux:

commit e2414f4c20bd4dc62186fbfd7bdec50bce6d2ead
Author: Brian Norris <computersforpeace@gmail.com>
Date:   Mon Feb 6 13:44:00 2012 -0800

Currently, the flash-based BBT implementation writes bad block data only
to its flash-based table and not to the OOB marker area. Then, as new bad
blocks are marked over time, the OOB markers become incomplete and the
flash-based table becomes the only source of current bad block
information. This becomes an obvious problem when, for example:

 * code accessing the flash cannot read the flash-based BBT format
 * BBT is corrupted and the flash must be rescanned for bad
   blocks; we want to remember bad blocks that were marked from Linux

So to keep the bad block markers in sync with the flash-based BBT, this
patch changes the default so that we write bad block markers to the proper
OOB area on each block in addition to flash-based BBT. Comments are
updated, expanded, and/or relocated as necessary.

The new flash-based BBT procedure for marking bad blocks:
 (1) erase the affected block, to allow OOB marker to be written cleanly
 (2) update in-memory BBT
 (3) write bad block marker to OOB area of affected block
 (4) update flash-based BBT
Note that we retain the first error encountered in (3) or (4), finish the
procedures, and dump the error in the end.

This should handle power cuts gracefully enough. (1) and (2) are mostly
harmless (note that (1) will not erase an already-recognized bad block).
The OOB and BBT may be "out of sync" if we experience power loss bewteen
(3) and (4), but we can reasonably expect that on next boot, subsequent
I/O operations will discover that the block should be marked bad again,
thus re-syncing the OOB and BBT.

Note that this is a change from the previous default flash-based BBT
behavior.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 16:13:44 +02:00
Sascha Hauer e49d260ba7 memory_display: Change address pointer to type const void *
No need to force a width of the pointer, so use void *. Also it's
not modified in memory_display, so also add a const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 12:16:26 +02:00
Sascha Hauer 4a28cf966d ARM: omap4: pcm049: register devices only when support is enabled
With other changes coming into the tree the binary is getting too big.
Save some space by not registering devices for which no support is available.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 11:49:01 +02:00
Sascha Hauer 72e561b5e8 ARM: omap4: Use writel where appropriate
Instead of making a pure 32bit write to a read/modify/write
operation with sr32 use writel directly. This saves a few bytes
of binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 11:49:01 +02:00
Sascha Hauer c7848ffee2 block: shortcut writebuffer_flush if writing is disabled
Saves a few bytes of binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 11:49:01 +02:00
Sascha Hauer 8c41c54da8 mtd: nand: omap: do not set write callback if mtd write is disabled
Saves a few bytes of binary space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 11:49:01 +02:00
Hubert Feurstein ed8e6f17a5 include/printk: fix level of pr_err and pr_warning
The level of pr_err and pr_warning were interchanged.

Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 09:33:22 +02:00
Jason Cooper 6f6e1377e4 arm: mvebu: add board USI Topkick
Successfully boots to console via kwboot.  No other functionality yet.

Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 09:21:14 +02:00
Jean-Christophe PLAGNIOL-VILLARD 618d669117 pbl: add lz4 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 09:15:32 +02:00
Renaud Barbier b04e3c7b9d ppc ddr-8xxx: misplaced parenthesis
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 08:40:53 +02:00
张忠山 c6d4b14ad9 create directory for dir/file.o
kbuild: create directory for dir/file.o

When add a obj with dir to obj-y, like this

    obj-y += dir/file.o

The $(obj)/dir not created, this patch fix this.

When try to add a file(which in a subdir) to my board's obj-y, the build
progress crashed.

For example, I use at91rm9200ek board, and in kernel dir run:

  mkdir objtree
  make O=objtree at91rm9200_defconfig
  mkdir arch/arm/mach-at91/dir
  touch arch/arm/mach-at91/dir/file.c

and edit arch/arm/mach-at91/dir/file.c to add some code.
then edit arch/arm/mach-at91/Makefile, change the following line:

  obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o

to:

  obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o dir/file.o

Now build it:

  make O=objtree

Then the error appears:
  ...
  CC      arch/arm/mach-at91/board-rm9200dk.o
  CC      arch/arm/mach-at91/board-rm9200ek.o
  CC      arch/arm/mach-at91/dir/file.o
  linux-2.6/arch/arm/mach-at91/dir/file.c:5:
    fatal error: opening dependency file
    arch/arm/mach-at91/dir/.file.o.d: No such file or directory

Check the objtree:
  LANG=en ls objtree/arch/arm/mach-at91/dir
  ls: cannot access objtree/arch/arm/mach-at91/dir: No such file or directory

It's apparently that the target dir not created for file.o

Check kbuild source code. It seems that kbuild create dirs for that in
$(obj-dirs).  But if the dir need not to create a built-in.o, It should
never in  $(obj-dirs).

So I make this patch to make sure It in  $(obj-dirs)

Signed-off-by: 张忠山 <zzs213@126.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 08:38:01 +02:00
Sascha Hauer 4a98bf1a0b mtd: nand_imx: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-19 08:59:47 +02:00
Sascha Hauer e6cc6f0805 ARM: i.MX51 babbage: configure environment from devicetree
While at it use offset 512k to allow bigger barebox binaries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:47 +02:00
Sascha Hauer a72e3b1f38 ARM: i.MX Datamodul edmqx6: configure environment from devicetree
This drops support for storing the environment in the eMMC,
but the standard bootsource is the SPI NOR flash.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:42 +02:00
Sascha Hauer 874f318037 Add configurability via devicetree
This adds the possibility to configure the place for the environment
from the devicetree and to partition devices from the devicetree.

Configuration has the general form of devices with a regular compatible
property. This allows to later add additional drivers or drivers with
different behaviour (for example to add support for redundant environment).

The configuration is all in the /chosen/barebox/ hierarchy of the
devicetree. This separates the configuration from the hardware
description. Also it makes it possible to store the configuration
in a completely separate devicetree (or devicetree overlay). For
the same reason all configuration is done using nodepathes rather
than phandles.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:38 +02:00
Sascha Hauer da6c4b21a8 mci: Add devicetree partition parsing
MMC/SD cards normally have a DOS/GPT partition table, but sometimes
barebox uses the unpartitioned area to store its environment. Add
devicetree partition parsing also for SD/MMC cards so that we have
a way to describe the partition in the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:34 +02:00
Sascha Hauer 3095043274 mtd: Add devicetree partition parsing
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:28 +02:00
Sascha Hauer 3ae902ed7f of: Add convenience functions to en/disable devicenodes
These functions allow to manipulate the "status" property of
devicenodes effectively enabling/disabling devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:23 +02:00
Sascha Hauer 9cb5f51d0a of: partition: check for valid node
So that users can call the of partition parsers without checking
if they are probed from the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-18 13:54:20 +02:00
Sascha Hauer c7b4d3669c bus: Add imx-weim support
Mostly taken from the kernel with support for other SoCs from
Alexander Shiyan.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Alexander Shiyan <shc_work@mail.ru>
2013-07-16 08:48:09 +02:00
Sascha Hauer aa9e85c555 of: add mtd of helpers
Directly taken from the kernel

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-16 08:46:30 +02:00
Kyungsik Lee cdc837f4d9 lib: Add support for LZ4-compressed kernel
This patch adds support for extracting LZ4-compressed kernel images,
as well as LZ4-compressed ramdisk images in the kernel boot process.

This depends on the patch below
decompressor: Add LZ4 decompressor module

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-16 08:24:30 +02:00
Kyungsik Lee e944e7f810 decompressor: Add LZ4 decompressor module
This patch adds support for LZ4 decompression in the Linux Kernel.
LZ4 Decompression APIs for kernel are based on LZ4 implementation
by Yann Collet.

LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository : http://code.google.com/p/lz4/

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-16 08:24:30 +02:00
Sascha Hauer b2968cc8af mci: set partnames of eMMC boot partitions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:19 +02:00
Sascha Hauer 0ee203186d cdev: add device_find_partition
device_find_partition allows to find a partition of a device with
a particular name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:14 +02:00
Sascha Hauer 2672c906a4 cdev: allow to open a struct cdev
cdev_open() opens a cdev by name. This introduces cdev_do_open which
allows to open a cdev when the cdev is already found by other means.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:09 +02:00
Sascha Hauer bec70b3aaa cdev: introduce partition names
currently most partition cdevs have the name <devname>.<partname>
This makes it hard to find a partition by <partname>. This introduces
a partname field in struct cdev so that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:16:04 +02:00
Sascha Hauer abf95154f5 of: partitions: factor out function to parse a single partition
To make it usable for other code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:59 +02:00
Sascha Hauer f57a85985b of: export of_default_bus_match_table
For code which wants to call of_platform_populate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:52 +02:00
Sascha Hauer 121c3d6e9c devfs: let devfs_add_partition return the new partition
Useful for unregistering later or for adding addional flags.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:15:47 +02:00
Alexander Shiyan 3f0642d383 commands: spi: Fix spi read procedure
Buffer for RX is set incorrectly.

barebox@Phytec phyCORE-i.MX27:/  spi -r 128 -v
device config
    bus_num       = 0
    max_speed_hz  = 1000000
    chip_select   = 0
    mode          = 0x0
    bits_per_word = 8

wrote 0 bytes
00000000:
read 128 bytes
00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
unable to handle paging request at address 0x4dffd3d0
pc : [<a7f05ec4>]    lr : [<a7f05ebc>]
sp : a7fff890  ip : a7fff860  fp : a7f68820
r10: a6ffe9bc  r9 : 00000000  r8 : 00000001
r7 : a6ffe9ec  r6 : a6f00000  r5 : a6ffe9ec  r4 : a6ffe9e4
r3 : a6ffe9e4  r2 : a6ffe9e5  r1 : a6ffe9e4  r0 : 4dffd3cc
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
...

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 11:05:24 +02:00
Alexander Shiyan d93a43c8fc mfd: mc13xxx: Add support for MC34708
This patch moves support for MC34708 PMIC into mc13xxx driver.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:19:36 +02:00
Alexander Shiyan 8c1a4930e1 mfd: mc13xxx: Separate query_revision function for each supported IC
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:19:36 +02:00
Alexander Shiyan c243873a77 mfd: mc13xxx: Determine used bus by "bus_type" field
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:19:36 +02:00
Sascha Hauer dc5ea760b2 ARM: mxs: implement debug_ll support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:09:07 +02:00
Sascha Hauer 798e976bf2 ARM: mxs: make ssp gates parents of ssp dividers
When changing the rates of the ssp clocks we have to poll the
busy bit, but only when they are enabled. The current code can
not check this properly since the gates are registered as children
of the dividers. This has the effect that when the gate is disabled
the busy bit will be set forever resulting in a freezed system.

Fix this by making the gates parents of the dividers which allows
clk_is_enabled to return the correct result.

The Kernel has the same problem, but here the busy polling is
limited to 10ms, so probably noone noticed this.

The datasheet mentions that the ssp dividers shall only be changed
when the clocks are enabled. The kernel and barebox currently ignore
this. I don't know what effect violating this rule has.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:08:54 +02:00
Alexander Shiyan 82022ecce6 i2c: Reuse "driver_match" for I2C bus
This will allow to use device_ids and make code a bit smaller.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:08:11 +02:00
Alexander Shiyan 4802ed1489 spi: Reuse "driver_match" for SPI bus
This will allow to use device_ids and make code a bit smaller.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:08:11 +02:00
Alexander Shiyan 7bc400d14c base: Transform "platform_match" into "device_match" and make this function public
This change will allow reuse this function for other buses.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:08:10 +02:00
Sascha Hauer 10920b6fe2 ARM: i.MX: Fix i.MX27 debug uart Kconfig entries
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-15 10:05:59 +02:00
Alexander Shiyan 0c4108f917 ARM: Use armlinux_bootparams address for DTB
In some cases, the address of the devicetree, which is obtained
dynamically, may be located in the kernel text area, which leads
to overwrite devicetree by kernel. The patch uses the address for
devicetree, provided by board, if it possible.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 14:37:26 +02:00
Sascha Hauer 1ee484f382 ARM: i.MX6: TQ tqma6x initial board support
The TQ tqma6x comes in two different variants. One i.MX6s based
tqma6s and a i.MX6q based tqma6q.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 24bd4d0d6f ARM: dts: Add more pinctrl groups for i.MX6q
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 499012d2af ARM: dts: Add i.MX6dl dtsi and pinfunc file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer ed91fac6e2 ARM: i.MX: External Nand boot: remove ifdefs around SoC functions
The ifdefs around the SoC specific boot_nand_external functions
can be removed when all functions go into their own sections so
that the linker can discard the unused functions.

This also adds a #ifdef BROKEN around the i.MX21 code which currently
does not have the imx21_barebox_entry function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 3ccb034fa1 ARM: i.MX: External Nand boot: remove ifdefs
Instead of ifdeffing out the correct NFC base address just pass
it to imx_nand_load_image which is called from SoC specific
context anyway.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 09b96768c7 ARM: i.MX: External Nand boot: move pagesize detection into SoC specific code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 3de30a438a ARM: i.MX: External Nand boot: remove debug command
The debug command does not work with SoC specific entry points.
remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:16 +02:00
Sascha Hauer 5a3329f6ad ARM: i.MX: External Nand boot: make 2k support nonoptional
All boards using the external nand boot code autodetect the
pagesize, so make this nonoptional to make the code simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-11 09:53:15 +02:00