9
0
Fork 0
Commit Graph

284 Commits

Author SHA1 Message Date
Sascha Hauer 5b85daacc6 mtd: nand: register nand flashes with nand specific function
This allows us to have some NAND specific stuff during registration,
like for example adding NAND specific device parameters.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 11:00:00 +01:00
Sascha Hauer 13b4e37c1c Merge branch 'for-next/vexpress' 2013-03-04 09:21:54 +01:00
Sascha Hauer 62ee96bd3b Merge branch 'for-next/mtd'
Conflicts:
	arch/arm/configs/eukrea_cpuimx27_defconfig
	drivers/mtd/core.c
2013-03-04 09:21:49 +01:00
Sascha Hauer 13408877f4 Merge branch 'for-next/misc' 2013-03-04 09:21:37 +01:00
Sascha Hauer c6813a5fb1 Merge branch 'for-next/gpt' 2013-03-04 09:21:37 +01:00
Maxime Ripard 4f105dd774 log2: Fix declaration of __roundup_pow_of_two
The roundup_pow_of_two function is making use of __roundup_pow_of_two
when the call to __builtin_constant_p fails, which is not implemented in
barebox.

Copied the code from Linux log2.h header.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-27 08:59:34 +01:00
Jean-Christophe PLAGNIOL-VILLARD 62acc70dc1 phy: fix force mode
do not try to read the status in force mode
the link is up

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-25 08:54:40 +01:00
Sascha Hauer 22d747e264 mtd: nand: do not write empty pages
Do not write pages which only contain 0xff. UBI expects pages which
seem empty to be writable. This got lost with:

| commit 3139c3e9a6
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date:   Thu Nov 29 11:16:40 2012 +0100
|
|    mtd core: call driver write function with complete buffer
|
|    mtd->write is supposed to loop around pages internally, no need
|    to do this in mtd_write. This fixes a huge write performance drop
|    with the m25p80 driver when it was converted to a mtd driver recently.
|    Since mtd->writesize is 1 for this driver mtd_write ended up doing
|    single byte writes on the flash.

Introduce mtd_all_ff as a global function since UBI currently has its own
implementation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-21 08:58:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 760689e5cc disk: partitions: add EFI GUID Partition Table
form linux 3.8

so you can have part by num or name
not by GUID as this is a non human reading name

     `---- ffe08000.sata
          `---- 0x00000000-0x3fffffff: /dev/ata0
          `---- 0x00100000-0x063fffff: /dev/ata0.0
          `---- 0x00100000-0x063fffff: /dev/ata0.boot
          `---- 0x06400000-0x3fefffff: /dev/ata0.1
          `---- 0x06400000-0x3fefffff: /dev/ata0.linux

Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-18 09:11:37 +01:00
Jean-Christophe PLAGNIOL-VILLARD ee2599db24 linux/types: import __aligned_x64 from the kernel
need it by upcoming EFI GPT support

Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-16 23:39:08 +01:00
Sascha Hauer 1bd90ff5a1 mtd: implement mtd_lock and mtd_unlock
Needed for NOR flashes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-14 10:44:41 +01:00
Sascha Hauer 7b7cf936cb mtd: Add mtd_* functions
The Kernel has mtd_read, mtd_write, mtd_erase and mtd_block_markbad.
Add these functions to barebox aswell to make future mtd synchronizations
with the kernel easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-14 10:31:39 +01:00
Jean-Christophe PLAGNIOL-VILLARD ed4da3f2de sp804: introduce amba_is_arm_sp804 to detect if the sp804 is present at the address
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-12 20:35:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD a59a5acf68 amba: introduce amba_device_get_pid/cid
so we can use it on vexpress to detect the hardware mapping

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-12 20:35:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2738f72352 arm: add vexpress board support
detect the cpu model to dynamise the periphs mapping

currently only tested on qemu but should work on real hardware

Cortex-A9

if you use 1GiB of ram you can run the same barebox on Cortex-A15 or Cortex-A9
otherwise use vexpress_ca9_defconfig where the TEXT_BASE is at 0x63f00000

when we will add the relocation support this defconfig will be drop

qemu/arm-softmmu/qemu-system-arm -M vexpress-a9 -m 1024 -smp 1 -kernel build/vexpress/barebox -pflash build/vexpress/flash0 -nographic

Cortex-A15

qemu/arm-softmmu/qemu-system-arm -M vexpress-a15 -m 1024 -smp 1 -kernel build/vexpress/barebox -pflash build/vexpress/flash0 -nographic

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-12 08:49:27 +01:00
Sascha Hauer a81c6a9f16 mtd nand: Specify pr_fmt and change messages to pr_*
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:39 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6cd8247eb7 w1: gpio: use int for gpio
so we can use negative value for invalid gpio

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2013-01-13 02:44:30 +08:00
Sascha Hauer a1a50a4654 net phylib: force to wait for link
When starting a network device wait until the link is up. Otherwise
autobooting does not work with little timeout and several attempts
have to be made until the network is finally up.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-12 20:02:44 +01:00
Sascha Hauer 8f32824c6e Merge branch 'for-next/phylib'
Conflicts:
	drivers/net/phy/phy.c
2012-12-07 16:43:21 +01:00
Sascha Hauer 6bbb1b51bf Merge branch 'pu/clk' into for-next/clk
Conflicts:
	include/linux/clk.h
2012-12-07 11:54:19 +01:00
Sascha Hauer 802d901450 clk: Add clk table based divider support
For easy support of table based dividers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-06 12:55:21 +01:00
Antony Pavlov ac5c168870 clk: add always enabled clocks
Current barebox clk framework allow disable any clock
and there is no means to prevent that.

But there are the clocks that can't be disabled
by software at all.

This patch allow registration of a clock immune to clk_disable().

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-03 10:48:07 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1308d908ea m25p80: re-import it againt mtd_add_host
so we now create the cdev via mtd

This will also simplify sync with linux

to avoid the m25p8000 or m25p00 the cdev is still named name m25p and the
drivers m25p80

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:40:23 +01:00
Jean-Christophe PLAGNIOL-VILLARD 34bcbaa2ba phylib: add micrel support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4a1e4d4b1d phylib: add fixup support
if board need specific phy fixup they can register it and then the code will
executed only if needed

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 09:38:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD d1662f9db3 phylib: introduction of forced 100Mbps
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 10:19:07 +01:00
Sascha Hauer 9749c2f16f Merge branch 'for-next/mtd'
Conflicts:
	arch/arm/configs/at91sam9x5ek_defconfig
2012-11-16 14:02:32 +01:00
Sascha Hauer bf38ac7b89 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/boards/guf-neso/lowlevel.c
	arch/arm/boards/pcm038/lowlevel.c
	commands/Makefile
2012-11-16 14:01:09 +01:00
Sascha Hauer daac8bf5d3 Merge branch 'for-next/bcm2835'
Conflicts:
	arch/arm/configs/versatilepb_defconfig
2012-11-16 14:00:34 +01:00
Sascha Hauer 2f5cd85719 Merge branch 'for-next/at91' 2012-11-16 14:00:24 +01:00
Sascha Hauer 18f044436e Merge branch 'for-next/i2c' into for-next/at91 2012-11-15 20:20:19 +01:00
Sascha Hauer eaa821788d Merge commit 'a8a9542' into HEAD 2012-11-15 20:18:46 +01:00
Jean-Christophe PLAGNIOL-VILLARD aa498eefce phy: add smsc phy driver support
as we to have specific phy init to fix chip issue link detection support

based on linux 3.6

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 14:24:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4f655dd24a phy: add phy_drivers_register
to allow to register an array of drivers

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 14:24:18 +01:00
Jean-Christophe PLAGNIOL-VILLARD b27a52c9d6 add roundup and rounddown support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 08:34:54 +01:00
Jean-Christophe PLAGNIOL-VILLARD 85ca16d028 import log2 support from linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-15 08:34:54 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4104dd9173 mtd: introduce mtd_block_isbad
this allow to do not provide block_isbad at mtd driver level
as example spi flash

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-03 23:20:59 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6cb9aa9202 1-wire: add gpio bus
Based on linux implementation.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-29 22:31:18 +01:00
Carlo Caione 04b941cbac clkdev: add helper function to register one clock lookup for a struct clk
Signed-off-by: Carlo Caione <carlo.caione@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-21 10:51:19 +02:00
Jean-Christophe PLAGNIOL-VILLARD 006538e7c2 mtd: add parent support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-17 20:16:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD a8a9542a71 import include/linux/math64.h
need by mtd_dataflash

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-15 19:53:06 +02:00
Sascha Hauer 477b665671 clk: Add clk gate support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:47:51 +02:00
Jean-Christophe PLAGNIOL-VILLARD e554bfa6ce gpio: add ARM Primcell pl061 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-10-05 15:07:02 +08:00
Sascha Hauer f2e2e596a2 clk: initial common clk support
This adds barebox common clk support loosely based on the Kernel common
clk support. differences are:

- barebox does not need prepare/unprepare
- no parent rate propagation for set_rate
- struct clk is not really encapsulated from the drivers

Along with the clk support we have support for some basic clk building
blocks:

- clk-fixed
- clk-fixed-factor
- clk-mux
- clk-divider

clk-fixed and clk-fixed-factor are completely generic, clk-mux and clk-divider
are currently the way i.MX muxes/dividers are implemented.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:55 +02:00
Sascha Hauer 89b710e509 clk clkdev: Add clkdev matching based on physbase
Most clock/device associations can be done based on the physical
base address of the corresponding device. So instead of depending
on string matching add an optional possibility to associate a clock
lookups with physical addresses. This also has the advantage that
the lookups for devicetree based devices can be identical to the
platform based devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:54 +02:00
Sascha Hauer 6f4dd1b204 err.h: introduce IS_ERR_OR_NULL
Copied from Linux.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 15:19:54 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Sascha Hauer 6f018668d6 Merge branch 'for-next/amba' 2012-10-03 21:10:05 +02:00
Sascha Hauer 0dc9de2efd net/eth: fix link handling
Check link status on eth device open time and then periodically
every 5 seconds.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-27 23:55:12 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2263e27814 net: introduce phylib
Adapt phylib from linux

switch all the driver to it
reimplement mii bus

This will allow to have
 - phy drivers
 - to only connect the phy at then opening of the device
 - if the phy is not ready or not up fail on open

Same behaviour as in linux and will allow to share code and simplify porting.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-25 08:18:58 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
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>
2012-09-17 10:57:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 75a0136cca amba-pl011: add st specific init
This is need on the new IP for ux500

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-11 12:48:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD 7492e86329 Introduce ARM AMBA bus
This will allow to detect the amba device and use the right driver for it at
runtime.

The code is base on linux 3.5.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-09-11 12:48:34 +08:00
Sascha Hauer bed1a6ffab Merge branch 'for-next/pbl' 2012-09-05 12:59:29 +02:00
Sascha Hauer 85f4fe32cf mtd nand: implement buswidth detection
This introduces a new NAND_BUSWIDTH_AUTO flag which can be used
to automatically detect the nand buswidth. The id is always read
in 8bit mode. An additional callback is needed to switch the nand
controller into 16bit mode.
This currently depends on a safe read_byte (always) and read_buf
(for onfi-only flashes) callback. It has been tested on OMAP, but
is not something that generally works. For this reason the existence
of the set_buswidth callback is used to determine whether we are
able to do autodetection or not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-03 19:32:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD a2e3601d12 decompressor: import malloc/free implementation for linux 3.4
This is need for gunzip support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Sascha Hauer b1a4e722c3 Merge branch 'for-next/onfi' 2012-08-01 17:49:27 +02:00
Sascha Hauer f72b0713d6 kconfig: fix IS_ENABLED to not require all options to be defined
From Linux commit 69349c2dc01c489eccaa4c472542c08e370c6d7e:

    Using IS_ENABLED() within C (vs.  within CPP #if statements) in its
    current form requires us to actually define every possible bool/tristate
    Kconfig option twice (__enabled_* and __enabled_*_MODULE variants).

    This results in a huge autoconf.h file, on the order of 16k lines for a
    x86_64 defconfig.

    Fixing IS_ENABLED to be able to work on the smaller subset of just
    things that we really have defined is step one to fixing this.  Which
    means it has to not choke when fed non-enabled options, such as:

      include/linux/netdevice.h:964:1: warning: "__enabled_CONFIG_FCOE_MODULE" is not defined [-Wundef]

    The original prototype of how to implement a C and preprocessor
    compatible way of doing this came from the Google+ user "comex ." in
    response to Linus' crowdsourcing challenge for a possible improvement on
    his earlier C specific solution:

    	#define config_enabled(x)       (__stringify(x)[0] == '1')

    In this implementation, I've chosen variable names that hopefully make
    how it works more understandable.

    Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:16 +02:00
Eric Bénard 4b23222c4d nand_base: add ONFI flash detection
the code is taken from linux & u-boot implementations
Validated on an i.MX53 which gives the following log :
ONFI flash detected ... ONFI param page 0 valid
NAND device: Manufacturer ID: 0x2c, Chip ID: 0x38 (Micron MT29F8G08ABABAWP), page size: 4096, OOB size: 224

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-05 20:58:54 +02:00
Eric Bénard 7baead578d string: add strim for ONFI code
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-05 20:58:54 +02:00
Sascha Hauer 1510c57e93 Merge branch 'for-next/resource-size'
Conflicts:
	drivers/base/resource.c
	fs/fs.c
2012-07-02 11:05:57 +02:00
Sascha Hauer 93d4ea2ac8 Merge branch 'for-next/mips-clocksource' 2012-07-02 11:04:38 +02:00
Sascha Hauer f22d4e2778 Merge branch 'for-next/sparse' 2012-07-02 10:59:37 +02:00
Sascha Hauer 5f03074ea9 resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-01 08:18:53 +02:00
Sascha Hauer 27c5d37ecc define __user empty
There is no seperate user address space, so do not generate sparse
warnings for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 22:34:54 +02:00
Sascha Hauer 849ce2df7a make st_size in struct stat 64 bit
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Antony Pavlov e172909335 clocksource: move the NSEC_PER_SEC constant to common header
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:19:58 +02:00
Sascha Hauer 1d8134c8d2 include/linux/time.h: remove dead code
include/linux/time.h contains several unused functions derived from U-Boot
code. Since this is a file under include/linux/ it should contain only code
from the kernel, so remove all this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-29 10:19:25 +02:00
Sascha Hauer 51885a7d73 Change byte order detection mechanism to kernel style
The Linux Kernel defines only one of __LITTLE_ENDIAN and
__BIG_ENDIAN. Endianess can then be tested with #ifdef __xx_ENDIAN. Userspace
always defined both __LITTLE_ENDIAN and __BIG_ENDIAN and byteorder can then
be tested with #if __BYTE_ORDER == __xx_ENDIAN.

As we tend to use a lot of Kernel code in barebox we switch to use the kernel
way of determing the byte order.

As this always causes a lot of confusion add a check to include/common.h to
make sure only one of __LITTLE_ENDIAN and __BIG_ENDIAN is defined.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-28 13:49:16 +02:00
Sascha Hauer 2ca512e592 print out resource_size_t correctly
resource_size_t can be 32bit or 64bit depending on the architecture.
Add a define for it to be able to printf a resource_size_t correctly

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-25 14:45:43 +02:00
Renaud Barbier 2f05b69256 linux/types.h: define phys_size_t
Add this definition in preparation for the introduction of the
mpc85xx support.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-13 22:10:52 +02:00
Antony Pavlov f9b932fed9 fix typo funtion -> function
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-13 22:00:54 +02:00
Sascha Hauer 2546c5a514 Merge branch 'pu/device-cleanup' into next 2012-02-17 10:27:31 +01:00
Sascha Hauer 6ca081d53d add list_is_singular
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-17 10:27:15 +01:00
Sascha Hauer c9c5440e61 list: add list_last_entry function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-15 08:21:34 +01:00
Jean-Christophe PLAGNIOL-VILLARD 18e18dd13b kconfig: sync to linux 3.2-rc4
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Robert Jarzmik fa4d33d146 lib: add bitrev utility
Add bit reversing utility, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Robert Jarzmik 1bfde3cea9 lib: add BCH encoding/decoding
As flash memories need BCH correcting codes, add the BCH
library, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Robert Jarzmik 6473b28065 drivers/mtd: split mtd mtdoob devices
Split /dev/mtd and /dev/mtdoob devices.
Remove from mtd structure the mtdoob character device.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:11:11 +01:00
Robert Jarzmik 88ce7ef769 drivers/mtd: transfer NAND notions to MTD core
Change NAND_WRITE into MTD_WRITE.
Change "page_shift" references in the core, which are purely
NAND, into mtd->writesize which is MTD generic.
Rename all "info" (struct mtd_info) into "mtd".

Also provide a parameter to add_mtd_device() so that legacy
nand devices still appear as nand<N>.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:11:11 +01:00
Sascha Hauer 200ae6b4ee add resource management functions
It is time to track our memory usage. Add a simple resource
management.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-03 10:09:29 +01:00
Sascha Hauer 4b09cdc798 add kernel gunzip implementation
The kernel uncompression functions have a unified API so use this
implementation to get it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 9135dd5f67 initial libfdt support
vanilla libfdt 1.3.0 from the dtc git:

git://git.jdl.com/software/dtc.git

Only small adjustments to compile with barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-19 10:08:48 +02:00
Sascha Hauer 597da1b76e Merge branch 'next' 2011-10-09 03:58:49 +02:00
Sascha Hauer d01070c8af remove EARLY_INIT and EARLY_CONSOLE support
Bitrotted over time and nearly unused, so remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-27 10:27:18 +02:00
Wolfram Sang ad68c2f829 include: list: add include because we need NULL
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-14 10:37:27 +02:00
Jean-Christophe PLAGNIOL-VILLARD 1c278e4ced clkdev: factorize macro
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-12 11:07:41 +02:00
Jean-Christophe PLAGNIOL-VILLARD 126c9b69cf device: introduce resource structure to simplify resource declaration
and add multi resource per device support

for now we keep the old map_base and size temporary but will switch all of
the used step by step to them resource way

and mirror the first resource to the map_base and size if available

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-18 07:57:49 +08:00
Antony Pavlov 8a14eb2ead include/linux/stat.h: make struct stat unified
The current version of struct stat has been taken from an
ancient Linux Kernel. It looks different on different architectures
to support different userspace formats of struct stat. As we do
not have a userspace on barebox there is no need to keep different
versions.

Also, this unification make MIPS arch possible.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-28 08:36:37 +02:00
Dirk Behme 59f06471ed pr_warn() must be pr_warning()
Fix the warning/error:

drivers/mci/mci-core.c: In function 'mci_card_probe':
drivers/mci/mci-core.c:1195: warning: implicit declaration of function 'pr_warn'
...
drivers/built-in.o: In function `mci_card_probe':
mc13892.c:(.text.mci_card_probe+0x68): undefined reference to `pr_warn'

Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-06-01 14:55:28 +02:00
Sascha Hauer 5b27fcbde4 nand: remove unused header file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-11 12:36:08 +02:00
Sascha Hauer 2e6a9440b9 nand: remove unused suspend/resume functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:40:16 +02:00
Baruch Siach c470225100 mtd/nand: increase page and oob size limits
Sync these limits with the Linux kernel. This allows support for NAND devices
with page size of 4k.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-18 08:29:21 +01:00
Jean-Christophe PLAGNIOL-VILLARD be4146161b import swab.h arch implementation form linux v2.3.37
this will avoid __bswapsi2 issue see with gcc 4.5.1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 09:39:16 +01:00
Marek Belisko 5c495ce5e5 nand_s3c2410: Fix sparse warnings.
Patch fix following sparse warnings:
drivers/mtd/nand/nand_s3c2410.c:125:9:
warning: incorrect type in argument 1 (different base types)
	expected void const volatile [noderef] <asn:2>*<noident>
	got unsigned long

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:09 +01:00
Marek Belisko dbd3613394 mtd: Fix sparse warning.
Patch fix following sparse warning:
drivers/mtd/nand/nand_base.c:123:16:
warning: incorrect type in argument 1 (different address spaces)
	expected void const volatile [noderef] <asn:2>*<noident>
	got void *IO_ADDR_R

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-19 09:35:04 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5156e781bd import __stringify from linux
update the current code

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-29 09:30:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6186a85515 arm: move clkdev to drivers/clk
as refer in this patch "arm & sh: factorised duplicated clkdev.c"

factorise some generic infrastructure to assist looking up struct clks
for the ARM & SH architecture.

as the code is identical at 99% in linux

move it also as preparing for the SH adding

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:56:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 55819d58d4 types.h: move __kernel_dev_t to include/linux/types.h
no need to have a arch specific type

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Jean-Christophe PLAGNIOL-VILLARD 37d6cbca5f move include/unaligned to include/linux/unaligned/
as originally in linux

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 14:36:08 +02:00
Jean-Christophe PLAGNIOL-VILLARD 12f396a8b0 net: rework the mii support
this rework is done in order to add a phylib and allow to have phy driver support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:36:03 +02:00
Jean-Christophe PLAGNIOL-VILLARD 95556fc53d introduce phys_addr_t and resource_size_t
this will allow to support 64bit platform

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-27 14:25:19 +02:00
Jean-Christophe PLAGNIOL-VILLARD 80758d4083 stddef: introduce true/false enum
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:12:07 +02:00
Jean-Christophe PLAGNIOL-VILLARD 907d7cb909 amba: add pl011
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Andrea GALLO <andrea.gallo@stericsson.com>
Cc: Gael SALLES <gael.salles@stericsson.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:09:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD e0953c5db2 string: add strlcpy support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Andrea GALLO <andrea.gallo@stericsson.com>
Cc: Gael SALLES <gael.salles@stericsson.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:09:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9080a35160 clock: Introduce clock framework from Linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:08:55 +02:00
Sascha Hauer 8dbed40da9 add ubi support from u-boot. Just enough to compile and scan
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 15:07:14 +02:00
Sascha Hauer 595a1fd3d5 include stuff missing for ubi
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 15:07:13 +02:00
Sascha Hauer acc46ca4f0 add partition mtd support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:02 +02:00
Sascha Hauer a33bc77bdd add rbtree support (needed for ubi)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-05 13:00:01 +02:00
Baruch Siach 9ad1fe64ab byteorder: add missing {BIG,LITTLE}_ENDIAN defines
This fixes build warnings when testing __BYTE_ORDER of the other kind.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-30 09:06:11 +02:00
Marc Kleine-Budde 8beeb199d7 import recent include/linux/compiler*.h
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-02-16 21:49:33 +01:00
Juergen Beisert dac84c7b9d documentation updates
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 11:32:02 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
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>
2009-12-15 10:18:30 +01:00
Sascha Hauer c6f639fafb NAND: Allow to read oob data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-03 10:46:47 +01:00
Sascha Hauer 73d57b1d35 list: remove duplicated list.h
We accidently have two list implementations in the tree:
include/list.h and include/linux/list.h. This patch moves
the latter (newer one) to include/linux/list.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-03 09:48:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD 318e743323 add bool types support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-11-02 08:23:23 +01:00
Sascha Hauer 217b7d8573 nand: Add size parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 18:37:32 +02:00
Sascha Hauer a2b7cd183b introduce cdev
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-07-21 16:41:44 +02:00
Sascha Hauer 8bd42496f7 mtd: Replace DEBUG by MTD_DEBUG
DEBUG is already used for another purpose by U-Boot

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-06-10 13:54:37 +02:00
Sascha Hauer f090bca2d8 add __[lb]e types
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-04-06 11:12:54 +02:00
Sascha Hauer c3fc1364d9 Introduce dev_* and pr_* functions
Proven to be useful in linux kernel, U-Boot should have such a thing
aswell. We do not distinguish between the various print levels others
than debug and not debug.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-10-31 14:02:25 +01:00
Marc Kleine-Budde 27a7de44ee [at91sam9] Nand driver
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-10-27 17:29:29 +01:00
Marc Kleine-Budde 5482395b9e import io-{read,write}s{b,w} functions from linux
This patch imports:
- io-readsb,
- io-readsw,
- io-writesb,
- io-writesw,
from linux

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2008-10-27 12:18:25 +01:00
Sascha Hauer bcb049a702 string: add typechecking for strchr, strrchr, strstr
These functions offered an excellent possibility to bypass compiler
type checking.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-20 17:46:54 +02:00
Nishanth Menon cb3f2e34c4 Bitops:Remove generic_funcs
Use asm-generic/bitops/xyz.h instead of using
generic_xyz functions.

Signed-off-by: Nishanth Menon <x0nishan@ti.com>
2008-08-15 08:47:50 +02:00
Sascha Hauer e33ff403f3 remove unused include file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:14 +02:00
Sascha Hauer d9af366450 NAND: Add updated NAND support from Kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:14 +02:00
Sascha Hauer 12f00ac59c add include/linux/kernel.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:52:09 +02:00
Sascha Hauer 8b9dd936e8 Add include/linux/err.h from Kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:41:22 +02:00
Sascha Hauer 31cb2f0347 add wrapper macros for easier inclusion of kernel code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:41:22 +02:00
Sascha Hauer 2db67353f3 add compiler header files from kernel
Add include/linux/compiler*.h from Linux Kernel and remove old
include/compiler.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2008-08-13 16:41:17 +02:00
sascha 3f90fc9d3e NAND support work in progress 2007-10-20 01:13:46 +02:00
sascha 7f72d26be9 add ffs 2007-10-15 18:01:30 +02:00
Sascha Hauer 7e58e219f8 add nand_ecc.h 2007-10-15 17:55:48 +02:00
Sascha Hauer 616cf2b45a NAND WIP 2007-10-15 17:22:25 +02:00
Sascha Hauer c1711479b0 remove unported includes and drivers 2007-09-21 14:14:05 +02:00
Sascha Hauer 93abe4f36b make printf position independent 2007-07-12 09:30:20 +02:00
Sascha Hauer d259b1dad0 svn_rev_530
remove linux/config.h
2007-07-05 18:02:02 +02:00
Sascha Hauer db17619e35 svn_rev_527 2007-07-05 18:02:02 +02:00
Sascha Hauer fa668fe184 svn_rev_502
complete multiple console support
2007-07-05 18:01:59 +02:00
Sascha Hauer 58c64290a1 svn_rev_354 2007-07-05 18:01:46 +02:00
Sascha Hauer 353cecddb3 svn_rev_322
simplify ifdef
2007-07-05 18:01:43 +02:00
Sascha Hauer 162484b83c svn_rev_003
remove all #if 0 and #if 1
2007-07-05 18:01:13 +02:00
Stefan Roese 887e2ec9ec Add support for AMCC Sequoia PPC440EPx eval board
- Add support for PPC440EPx & PPC440GRx
- Add support for PPC440EP(x)/GR(x) NAND controller
  in cpu/ppc4xx directory
- Add NAND boot functionality for Sequoia board,
  please see doc/README.nand-boot-ppc440 for details
- This Sequoia NAND image doesn't support environment
  in NAND for now. This will be added in a short while.
Patch by Stefan Roese, 07 Sep 2006
2006-09-07 11:51:23 +02:00
Wolfgang Denk b9365a26a1 Code cleanup 2006-07-21 11:56:05 +02:00
Wolfgang Denk 983bebbea3 Scheduled for removal: strnicmp() which is unused 2006-05-03 01:00:39 +02:00
Marian Balakowicz 2fc000d756 Remove dependencies between DoC code and old legacy NAND driver.
Necessary defines and data structures were copied to DoC specific files
so that legacy NAND code could be entirely removed from u-boot tree
in the near future.
2006-04-05 20:46:41 +02:00
Wolfgang Denk 0afe519a43 Add ADI Blackfin support
- add support for Analog Devices Blackfin BF533 CPU
- add support for the ADI BF533 Stamp uClinux board
- add support for the ADI BF533 EZKit board
Patches by Richard Klingler, June 11th 2005:
2006-03-12 02:10:00 +01:00
Wolfgang Denk bfc81252c0 Minor code cleanup 2006-03-06 13:03:37 +01:00