9
0
Fork 0
Commit Graph

2868 Commits

Author SHA1 Message Date
Sascha Hauer 078a29da28 mci: imx: Add devicetree probe support
Only simple probing, no properties supported yet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 11:31:31 +01:00
Sascha Hauer d25cba0090 pinctrl: Add pinctrl driver for i.MX1/21/27
This turns the legacy iomux-v1 support into a full pinctrl
driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 11:31:31 +01:00
Sascha Hauer ae39ba29c6 misc: Add devicetree SRAM driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:29:47 +01:00
Sascha Hauer 27da1665d3 misc Kconfig: always ask for misc devices
The "Misc devices" menu does not enable anything by itself, so make it a
regular menu rather than a menuconfig.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:29:43 +01:00
Philipp Zabel 7a150c5fb1 net usb asix: add AX88772B USB ID
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:14:37 +01:00
Philipp Zabel 4eabf125fb net usb asix: read MAC from EEPROM on AX88772B
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:14:37 +01:00
Sascha Hauer 25cee7ec17 environment: Use accessor functions for default environment path
default_environment_path only exists when CONFIG_ENV_HANDLING is enabled.
Boards would have to #ifdef this if they wanted to use
default_environment_path. Use accessor functions instead which can
be ifdeffed on a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-27 09:27:02 +01:00
Alexander Shiyan 32d6d2ae76 serial: clps711x: Update driver
This patch updates the CLPS711X UART driver.
The update adds support for use with devicetree and
makes driver comatible with current driver from kernel.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan 6c3e620e57 gpio: clps711x: Update driver
This patch updates the CLPS711X GPIO driver.
The update adds support for use with devicetree and
optimizes "probe" a bit.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan 624454160b ARM: clps711x: Remove the special name for the syscon driver
No reason to make SYSCON driver name unique to that processor.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan c2c5f48b91 mfd: syscon: Introduce syscon_base_lookup_by_phandle() function
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Marek Vasut f5fa816cff net usb asix: Use only 11 bits of header for data size
The AX88772B uses only 11 bits of the header for the actual size. The other bits
are used for something else. This causes dmesg full of messages:

	asix_rx_fixup() Bad Header Length

This patch trims the check to only 11 bits. I believe on older chips, the
remaining 5 top bits are unused.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-23 08:10:06 +01:00
Marek Vasut c827eb8ff3 net usb asix: Simplify condition in rx_fixup()
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-23 08:10:06 +01:00
Sascha Hauer dac65f99e8 console: Set Linux console parameter automatically
Linux specifies the linux,stdout-path property in the /chosen node
in the devicetree. Unfortunately this is ignored in most cases.
For cases in which barebox uses this property for its own use we
translate this into a Linux boot arg with:

- the console name provided by the serial driver
- the the instance from the 'serial' alias
- the baudrate from the actual baudrate.

So with this it's for devicetee enabled boards no longer necessary
to manually assign a console= parameter. Should a user not want
to use the automatically assigned parameter it should do:

global.linux.bootargs.console=

in the environment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-22 07:53:21 +01:00
Antony Pavlov cec6fd5d85 net/phy: add driver for National Semiconductor DP83865 PHY
Based on Linux kernel 3.12 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-20 10:54:24 +01:00
Sascha Hauer d9a08d8bc5 net: phy: Fix crash when no phy is found
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-20 10:54:17 +01:00
Markus Niebel fa5bdb30ee mci: imx-esdhc: add DSR support
having DSR support in mci-core we need a way to
forward the DSR value to the driver. Add it to
platform data for imx-esdhc

TODO: implement the same for other host controller
drivers

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:56 +01:00
Markus Niebel f11668fee7 mci: add device tree support for DSR
add optional DSR support. This should go into the kernel, too

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:43 +01:00
Markus Niebel 78b9e4e041 mci: add DSR support
The eMMC and the SD-Card specifications describe the optional SET_DSR command.
During measurements at our lab we found that some cards implementing this feature
having really strong driver strengts per default. This can lead to voltage peaks
above the specification of the host on signal edges for data sent from a card to
the host.

Since availability of a given card type may be shorter than the time a certain
hardware will be produced it is useful to have support for this command (Alternative
would be changing termination resistors and adapting the driver strength of the
host to the used card.)

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:43 +01:00
Markus Niebel 96da216991 mci: production year for eMMC 4.41 and later
Year is coded in 4 bits of CID. eMMC 4.41
adds a new interpretation rule: production
year for 4.41 cards and newer is between 2010
and 2025 with 0 corresponding to 2013.

This fix was inspired by currect kernel code.

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 14:56:58 +01:00
Markus Niebel 98d5fd3915 mci: Support the correct version for eMMC
eMMC is available up to version 4.5 but the
correct version is not decoded. Change version
definitions to support more minor verions, add
missing versions and parse the minor versions from
ext_csd.

After this, card detection code and devinfo reports
correct versions.

Handling is inspired by u-boot code.

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 14:56:58 +01:00
Jan Weitzel 1ebf5ff0c1 of: find also nodes by mixture of alias and path
Let of_find_node_by_path_or_alias also find a node starting with an alias
followed by a path like "i2c0/tps@24"

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:39:57 +01:00
Antony Pavlov d1e54c4bc2 gpiolib: gpiolib command: show label only for requested pins
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Antony Pavlov 4fcad5129e gpiolib: gpio_free: clear gpio's "label" field too
If an error occured during gpio_request_array() then we can
get not requested gpio with nonempty garbage "label" field
value. Afterward the "gpiolib" command can try to use this
nonempty garbage value.

This patch prevents this error situation.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Antony Pavlov f8cdb92751 gpiolib: gpio_request(): print message on error
Just copy gpiod_request() function logic from linux-v3.13-rc7.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Alexander Shiyan d95f27aaa8 of: platform: Fix possible crash
"dev" may uninitialized or points to incorrect device. While at
it make the message more informative.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 08:38:36 +01:00
Sascha Hauer 29b6d429f6 Merge branch 'for-next/video' 2014-01-07 11:57:52 +01:00
Sascha Hauer dd28a45d9d Merge branch 'for-next/usb-chipidea' 2014-01-07 11:57:52 +01:00
Sascha Hauer 07e5ba98e5 Merge branch 'for-next/ubi' 2014-01-07 11:57:52 +01:00
Sascha Hauer 968cb4bb84 Merge branch 'for-next/openrisc' 2014-01-07 11:57:51 +01:00
Sascha Hauer c56fdbbc37 Merge branch 'for-next/miiphy' 2014-01-07 11:57:51 +01:00
Sascha Hauer 682d47d6ce usb: chipidea i.MX: add some delay after ulpi_setup
On the pcm038 the ULPI phy is found correctly, but after
a power cycle the attached devices are not found. Adding
some delay fixes this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:59 +01:00
Sascha Hauer d35fa7f26d usb: chipidea i.MX: always print an error message when ULPI fails
The ULPI code does not print a message when the operation times
out. Add one to the caller so that he gets an idea that something
is going wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Sascha Hauer db48428216 usb: chipidea i.MX: limit port init to HSIC mode
imx_chipidea_port_init() will be called during startup from
the ehci driver. Calling it before setting up the PORTSC register
is only necessary in HSIC mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Sascha Hauer 873b6b6892 usb: chipidea i.MX: remove unused pdata->init hook
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Richard Weinberger 73618394bf UBI: Add some asserts to ubi_attach_fastmap()
Add more paranioa asserts to make it easier to detect
implementation errors.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 71791bd2cb UBI: Fix memory leak in ubi_attach_fastmap() error path
On error we have to free all three temporary lists.

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Genoud dee73c54b0 UBI: simplify image sequence test
The test:
if (!a && b)
  a = b;
can be symplified in:
if (!a)
  a = b;

And there's no need to test if ubi->image_seq is not null, because if it is,
it is set to image_seq.
So, we just test if image_seq is not null.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Genoud 2bae366563 UBI: fastmap: fix backward compatibility with image_seq
Some old UBI implementations (e.g. U-Boot) have not implemented the image
sequence feature.
So, when erase blocks are written, the image sequence in the ec header
is lost (set to zero).
UBI scan_all() takes this case into account (commits
32bc4820287a1a03982979515949e8ea56eac641 and
2eadaad67b2b6bd132eda105128d2d466298b8e3)

But fastmap scan functions (ubi_scan_fastmap() and scan_pool()) didn't.

This patch fixes the issue.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 8000a53dda UBI: Call scan_all() with correct offset in error case
If we find an invalid fastmap we have to scan from the very beginning.
Otherwise we leak the first 64 PEBs.

Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 4a290f970d UBI: Fix error path in scan_pool()
We have to set "ret", not "err" in case of an error.

Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger f0986b6f70 UBI: fix refill_wl_user_pool()
If no free PEBs are available refill_wl_user_pool() must not
return with -ENOSPC immediately.
It has to block till produce_free_peb() produced a free PEB.

Reported-and-Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 54930d9f92 UBI: Fix invalidate_fastmap()
Onging tests uncovered that invalidate_fastmap() is broken.
It must not call ubi_wl_put_fm_peb() because all PEBs used
by the old fastmap have already been put back.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-01-07 11:03:24 +01:00
Richard Weinberger 92924e7ae1 UBI: Fix PEB leak in wear_leveling_worker()
get_peb_for_wl() removes the PEB from the free list.
If the WL subsystem detects that no wear leveling is needed
it cancels the operation and drops the gained PEB.
In this case we have to put the PEB back into the free list.

This issue was introduced with commit ed4b7021c
(UBI: remove PEB from free tree in get_peb_for_wl()).

Cc: <stable@vger.kernel.org> # 3.7.x
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-01-07 11:03:24 +01:00
Antony Pavlov 9bc8980590 net/phy/phy.c: fix whitespace
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:30 +01:00
Antony Pavlov ce4e4eff35 net/phy: add driver for LXT PHYs
Based on Linux kernel 3.12 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:30 +01:00
Antony Pavlov 8ffd4f8c74 miitool: change behaviour closer to linux' mii-tool
miitool without arguments will try to show status for all phys.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:29 +01:00
Sascha Hauer d7fe5e2263 mtd: Add subpagesize to mtd_info_user
ubiformat needs the subpagesize to work correctly. The kernel uses
sysfs to pass the subpagesize, but in barebox we have the possibility
to extend struct mtd_info_user. Add a corresponding field and use it
in ubiformat.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:30 +01:00
Sascha Hauer 080a4e9c9b mtd: fix mtd_read return value
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:30 +01:00
Sascha Hauer a8fd9bfd12 mtd: fix wrong return values in cdev read
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:29 +01:00
Sascha Hauer 8a01dea639 video: ipufb: Use uncached memory for framebuffer
Otherwise funny caching artifacts can occur on the screen.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 11:32:08 +01:00
Sascha Hauer 96ec430eeb video: simplefb: Add a8r8g8b8 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 11:32:08 +01:00
Sascha Hauer ff1542fc5e video: simplefb: Add of reserve entry for framebuffer memory
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 11:32:07 +01:00
Sascha Hauer a76f3d9535 video: imx-ipu-fb: Allow to specify framebuffer memory size via platform_data
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 11:32:07 +01:00
Sascha Hauer 8bec1f2f16 video: Add screen_size field
barebox does not need the screen size directly, but we pass the
framebuffer to Linux via simnplefb it is desirable to pass the
full size of the framebuffer. Default to calculated values from
the screen resolution.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Sascha Hauer 484cc65fdb video: imx-ipu-fb: Do not modify pwm register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Sascha Hauer 4e64bcac45 video: ipufb: Allow to disable fractional pixelclock divider
The IPU has a fractional pixelclock divider. When used, this produces
clock jitter which especially LVDS transceivers can't handle. Allow
to disable it via platform_data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Sascha Hauer 53bbcf85aa video: ipufb: Fix divider debug print
The fractional part is 4 bit, not 3

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Sascha Hauer ec3ba30258 video: ipufb: Fix 24bit format and implement 32bit format
When requested 32bit formats the IPU generated a 24bit format instead.
Implement real 32bit format (xxrrggbb) and let the IPU generate a 24bit format
when requested.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:38 +01:00
Sascha Hauer 5b58f68d5a video: ipufb: calculate channel param fields from fb_bitfields
No need to hardcode the channel parameters for the rgb offsets,
we can calculate them from the fb_bitfields. ipu_ch_param_write_field()
is the same as is the mainline IPUv3 driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:36 +01:00
Sascha Hauer 497436eb58 video: ipufb: do not use bitfields
bitfields are not portable and one should make assumptions of the
layout of bitfields. Replace them with the ipu_ch_param_write_field()
which is already used in the mainline IPUv3 driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 09:35:14 +01:00
Sascha Hauer 26f2c815d1 mtd: nand_imx: remove trailing whitespaces
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-19 17:39:35 +01:00
Eric Bénard 7ef217bbb6 nand_imx: fix read ONFI param on NFC v21
tested on an i.MX25 where we now get :
nand: ONFI param page 0 valid
nand: ONFI flash detected
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G08ABAEAWP), 256MiB, page size: 2048, OOB size: 64

Signed-off-by: Eric Bénard <eric@eukrea.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-19 16:58:25 +01:00
Sascha Hauer 3b04e00d7e net: dm9k: bail out when resources can't be claimed
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-18 16:52:19 +01:00
Sascha Hauer 1c9668a3cc net: dm9k: Fix resource sizes in add_dm9000_device
The dm9000 needs a resource for an index register and one for
the data register. Both should have a size of the access width,
and not two times the access width. The current code is probably
a leftover when the dm9000 had only one resource.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-18 16:52:14 +01:00
Sascha Hauer 68a6fedcd4 video: ipufb: make disp_data_fmt configurable
With the IPU the way the display is connected is completely independent
of the framebuffer pixel format. So instead of specifying a pixel width
in platform_data we have to specify how the display is connected.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-18 16:38:05 +01:00
Jan Weitzel 87bae6ead5 pinctrl: single: select CONFIG_PINCTRL
pinctrl_register is used.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-17 08:25:45 +01:00
Beniamino Galvani 497c01ff1f net: add driver for OpenCores 10/100 Mbps ethernet MAC
This patch introduces a driver for the OpenCores 10/100 Mbps ethernet
MAC core, ported from Linux kernel with small changes.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-17 08:20:48 +01:00
Eric Bénard 50b02080c9 atmel_nand: check gpio validity before using it
else we get : "invalid GPIO -22"
(as enable_pin is EINVAL)

tested on SAMA5D35

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-12 09:45:26 +01:00
Antony Pavlov a4dfb8d910 of: gpio: Fix Kconfig variables to depend on
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-12 09:13:20 +01:00
Jan Weitzel 09783b9c45 net: cpsw: Fix gmii_sel config
Prober slave_num is needed by cpsw_gmii_sel_am335x to calc reg value.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-12 09:07:20 +01:00
Sascha Hauer 6cb2b2f29f net: phy: implement detect callback for miibus devices
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 12:33:05 +01:00
Sascha Hauer bfc9a6985c net: phy: Track mii buses on a list
To be able to iterate over registered mii buses

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 12:32:20 +01:00
Sascha Hauer 5200678e86 net: phy: move phy_init_hw to phy_device_connect
This is needed when a phy gets registered outsize of phy_device_connect
but has to be attached to an ethernet device later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 12:14:55 +01:00
Sascha Hauer 33790253da net: phy: track registered state of a phy device
With this phy_device_connect only registers a phy device if it wasn't
registered already. This allows us to register phy devices outside
of ethernet drivers. phy_device_connect will now pick up an already
registered phy given that it's not attached to another ethernet device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 10:58:02 +01:00
Sascha Hauer d023d690fc net: phy: check if a phy already has an ethernet device
If during a phy_device_connect a phy already has an ehternet device
this can only mean it's already attached to another device. return -EBUSY
in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 10:56:31 +01:00
Sascha Hauer 664694d9f7 net: phy: move duplicated code out of if/else
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 10:53:22 +01:00
Sascha Hauer 58f9167a04 net: phy: bail out early in phy_device_connect
If an ethernet device already has a phy in phy_device_connect all we
have to do is to start autonegotiation. Do this early and bail out
so that for the rest of the code it's clear that we have to search for
a phy device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 10:46:50 +01:00
Sascha Hauer 5f0a71708e net: phy: cleanup attached device handling
phy_register_device() currently requires an attached ethernet device.
This is not needed, a phy device can equally well be registered as
a standalone device without an ethernet device. Remove the need
for an attached ethernet device in phy_register_device. Also, make
the edev <-> phy connection on a registered device which simplifies
the code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-11 10:45:00 +01:00
Sascha Hauer 6d8a85d6c3 Merge branch 'for-next/tegra' 2013-12-06 08:23:27 +01:00
Sascha Hauer ed039cd72b Merge branch 'for-next/omap-drivers' 2013-12-06 08:23:27 +01:00
Sascha Hauer 6d7fae1e97 Merge branch 'for-next/omap-devicetree-prepare' 2013-12-06 08:23:27 +01:00
Sascha Hauer e9ea6eeaab Merge branch 'for-next/misc'
Conflicts:
	scripts/Makefile
2013-12-06 08:23:24 +01:00
Sascha Hauer 0cb6f2c19e Merge branch 'for-next/imx' 2013-12-06 08:22:48 +01:00
Sascha Hauer 2789ccd18f Merge branch 'for-next/gpio' 2013-12-06 08:22:48 +01:00
Sascha Hauer cac8f8deb4 Merge branch 'for-next/clk' 2013-12-06 08:22:48 +01:00
Lucas Stach 5f9dea93a1 tegra: add SDMMC controller driver
Confirmed working on Tegra 2, may need some small adjustments for
Tegra 3.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 16:57:35 +01:00
Lucas Stach 3504f23ed8 clk: tegra: add SDMMC clocks
Provide peripheral clocks for the SD controller.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 14:59:39 +01:00
Lucas Stach 1f52d71587 gpio: tegra: remove leftover debug code
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 14:59:39 +01:00
Lucas Stach 7b6c063f57 tegra: speed up system bus
We run the system bus from the OSC clock during init, to avoid crashing
the system while reconfiguring the PLLs.
Switch to a more reasonable clock when we are done with this.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 14:59:39 +01:00
Lucas Stach 87b651ed89 gpio: reduce noise when parsing DT
Some GPIOs are optional, so it might not be an error if we can not find
a DT property. Do the same thing as the Linux kernel and only print a
debug message not an error.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-04 14:59:39 +01:00
Lucas Stach c5ff2805a1 net/phy: add driver for atheros PHYs
Based on Linux kernel 3.12 driver.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-03 11:31:34 +01:00
Sascha Hauer 6e66ab7a53 mtd: mtdraw: drop ioctl callback for mtdraw device
Do not call mtd_ioctl for mtdraw devices. mtd_ioctl will derefence
the priv pointer to a struct mtd_info whereas with mtdraw devices it will be
a struct mtdraw pointer. We do not need ioctls for mtdraw devices, so drop
it instead of fixing it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-02 16:22:31 +01:00
Sascha Hauer 3febd4d4ce ata: pata-imx: Add missing NULL entry in dt ids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-02 13:04:15 +01:00
Alexander Aring 35d64bb375 mmci: add missing depends on ARM_AMBA
The mmci implementation uses some specific arm amba functions, so add a
depends on ARM_AMBA.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-02 08:42:26 +01:00
Sascha Hauer 03d601d58f mmc: omap: Add devicetree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:54 +01:00
Sascha Hauer 599e61ebd9 bus: Add omap gpmc driver
This adds a devicetree-only driver for to configure the gpmc and its
child devices from dt. Currently only NAND is supported.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:54 +01:00
Sascha Hauer f92f309c54 device: Add functions to add resources
We currently have functions to add a device based on function parameters.
This adds the corresponding functions to add resources to a device without
registering the device itself. This is useful to manipulate devices before
registering them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:54 +01:00
Sascha Hauer b0cd10ff12 mtd: omap gpmc: Use dev_add_param_enum
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 15d60e5230 gpio: omap: Add devicetree probe support
This adds devicetree probe support for the OMAP gpio ports and
also makes sure the corresponding platform_devices don't get
registered when they are already present from devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 7603f7442b gpio: omap: move to drivers/gpio/
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 7cc4a2ad95 net: cpsw: straighten error path
This mainly has the effect of checking the return value of eth_register.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 046157602e net: cpsw: attach slave to edev->priv
An ethernet device belongs to a slave, so set edev->priv to the slave
and not to the cpsw.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 82bc71b820 net: cpsw: drop for_each_slave
We currently only use one slave, so drop for_each_slave and hardcode
slave[0] until we pass the proper context to the functions that makes
this hack unnecessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer a722418645 net: cpsw: move eth_device into slave
An ethernet device is per slave, not per cpsw.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 9321538ee2 cpsw: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 6d2f0d57be pinctrl: Add functions to select pinctrl from device_node
Instead of requiring a device pointer, add a functions to select
the pinctrl state based on a device node.
The AM33xx cpsw devicetree description has several subdevices with
pinctrl information attached to them. In barebox we do not handle
the subdevices as distinct devices, so the pinctrl is never configured
correctly and the mdio bus subdevice stops working. This patch makes
it possible to configure the pinctrl without having a device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-27 10:42:53 +01:00
Sascha Hauer 8cf612878e mmc: omap: name mmc device after devicetree alias
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-25 09:19:21 +01:00
Sascha Hauer 7614ee1640 net: phy: Fix get_phy_device return value
A function should either return an ERR_PTR or NULL on failure, but not both.
Let get_phy_device() return an ERR_PTR and fix the return checks in mdiobus_scan
and phy_device_connect.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-25 09:01:49 +01:00
Rostislav Lisovy 5c1846b625 ARM: i.mx53: Parse Reset GPIO pin in FEC driver from Devicetree
Signed-off-by: Rostislav Lisovy <lisovy@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-25 09:01:33 +01:00
Sascha Hauer bb7929aaaa of: gpio: Add Kconfig variable to depend on
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-25 09:01:33 +01:00
Sascha Hauer e586a64d3e net: cpsw: inline slave_data
Devicetree probed cpsw devices won't have platform_data, so inline
the fields from slave_data instead of keeping a pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Sascha Hauer 7f5b61ab14 i2c: omap: Add devicetree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Sascha Hauer 5525385c78 spi: omap: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Sascha Hauer 1869803405 spi: omap: encode register offset into device_id
The omap3 and omap4/am33xx spi cores differ in the offset of the
registers in the address space. Instead of encoding this into the
resources use the platform_device_id mechanism. This is done in
preparation for devicetree probe support where the address space
is in the devicetree and can't be adjusted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Sascha Hauer 26c725874b pinctrl: Add pinctrl-single driver
Based on the kernel pinctrl-single driver. This one is just enough
to make OMAP/AM33xx work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 15:35:12 +01:00
Antony Pavlov bcf0877266 gpiolib: import gpio_request_array() from linux 3.7
Also import related functions gpio_request_one() and
gpio_free_array().

This commit imports code from linux 3.7 as
the more recent linux kernel versions use gpiolib descriptors,
see this commit for details:

  commit 372e722ea4dd4ca11c3d04845e11cbc15f32144c
  Author: Alexandre Courbot <acourbot@nvidia.com>
  Date:   Sun Feb 3 01:29:29 2013 +0900

      gpiolib: use descriptors internally

      Make sure gpiolib works internally with descriptors and (chip, offset)
      pairs instead of using the global integer namespace. This prepares the
      ground for the removal of the global gpio_desc[] array and the
      introduction of the descriptor-based GPIO API.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 10:59:04 +01:00
Antony Pavlov 6339a419e9 gpio: unify gpio direction macros names with Linux kernel
See linux.git/include/linux/gpio.h and
linux.git/Documentation/gpio.txt for details.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 10:59:00 +01:00
Sascha Hauer 9ed42fa866 serial: ns16550: Add device ids for omap
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-22 10:56:49 +01:00
Alexander Aring 32a5775125 barebox: remove double semicolons
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-18 10:13:35 +01:00
Alexander Aring fbe83cfe50 mmci: remove include of mmci.h header
We need #include "mmci.h" only and not #include <mmci.h>
which don't exists.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-18 10:12:39 +01:00
Uwe Kleine-König 3bd7f80d8f mci: mxs: support overwriting the device name via platform data
The current implementation of the bootloader specification depends on the
hardware name and the name of the device in /dev to match. As the default
hardware name is mciX and the device name is diskY the bootloader spec
cannot be used as is.

This patch implements a way to overwrite the device name similar to what is
possible for the imx-esdhc driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 11:16:22 +01:00
Sebastian Hesselbarth 56dec39e68 clk: fixed: add DT init function
This adds a DT init function to clk-fixed and corresponding CLK_OF_DECLARE
to put it into the DT clock provider table.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:26:59 +01:00
Sebastian Hesselbarth a7d8384d12 OF: parse OF clock providers after populate
This adds a call to of_clk_init right after platform devices have been
populated.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:26:59 +01:00
Sebastian Hesselbarth feb1e38b43 clk: add of_clk_init and CLK_OF_DECLARE macro
This add barebox versions of of_clk_init for parsing and registering
clock providers from DT. Also, a macro CLK_OF_DECLARE is added, that
allows to put init callbacks into its own section that can be linked
in the binary.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:26:59 +01:00
Sebastian Hesselbarth d7fc449a2e gpio: dw: add get_direction callback
This adds a callback function to read the current state of a GPIOs
in/out direction.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:05:35 +01:00
Sebastian Hesselbarth fcc25285a2 gpiolib: make gpiolib command more verbose
This adds some more printf information to gpiolib command, like the
gpiochip handling a specific gpio. Also, current direction and value
of the gpio are printed, if the gpiochip provides the corresponding
callbacks.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:05:35 +01:00
Sebastian Hesselbarth 4faf305507 led: trigger: disable LEDs with trigger before installing it
This disables LEDs that have a trigger function assigned right before
the trigger is installed. As the trigger was parsed before the LED has
been registered, also swap LED registration and trigger parsing.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 09:02:07 +01:00
Alexander Shiyan 7e6406e59e net: netx: Fix signed/unsigned arguments for printf
"%d" in format string requires a signed integer.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 08:52:05 +01:00
Alexander Shiyan ba7556e29a net/Kconfig: Remove non-existent ARCH_DAVINCI
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-11 08:52:05 +01:00
Sascha Hauer 7c1091bd58 of: fdt: reorder fdt_header initialization
No functional change, just reorder the initialization of
the different offset/size members of fdt_header in increasing
order to make it easier to read.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:42:55 +01:00
Sascha Hauer c9a86c5c02 of: fdt: Fix fdt size_dt_struct
size_dt_struct was calculated too big, we have to substract ofs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:42:50 +01:00
Sascha Hauer b0fd9462d6 eeprom: at24: Enable OF partition parsing
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:42:08 +01:00
Sascha Hauer b67b2671c2 treewide: Add missing includes
A lot of files rely on include/driver.h including include/of.h (and
this including include/errno.h. include the files explicitly so we can
eventually get rid of including of.h from driver.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:42:04 +01:00
Sascha Hauer 480782a265 Merge branch 'for-next/usb' 2013-11-07 08:31:47 +01:00
Sascha Hauer c803c74cb8 Merge branch 'for-next/spi' 2013-11-07 08:31:47 +01:00
Sascha Hauer ded25480d8 Merge branch 'for-next/rpi' 2013-11-07 08:31:47 +01:00
Sascha Hauer b8d20bf3fa Merge branch 'for-next/of' 2013-11-07 08:31:47 +01:00
Sascha Hauer 8be53ce2ab Merge branch 'for-next/net' 2013-11-07 08:31:47 +01:00
Sascha Hauer 398cdf212d Merge branch 'for-next/mtd' 2013-11-07 08:31:47 +01:00
Sascha Hauer 4c8221be2c Merge branch 'for-next/mci' 2013-11-07 08:31:47 +01:00
Sascha Hauer 2d022b5097 Merge branch 'for-next/imx' 2013-11-07 08:31:47 +01:00
Andre Heider 97607e85cd video: set up the kernel's simple framebuffer driver
Add support to configure the active framebuffer for the kernel through
device tree.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 10:37:24 +01:00
Andre Heider 91b3761ec8 video: add a BCM2835 framebuffer driver
Use the mailbox driver to set up a framebuffer based on the firmware
configuration.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 09:59:05 +01:00
Andre Heider 485544f0fb fb: add a line_length value to struct fb_info
Add support for framebuffers with noncontiguous horizontal lines.

Video drivers can set this value if the hardware requires it.
In case a driver does not set it, the current value of
xres * (bpp / 8) is used instead.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 09:59:04 +01:00
Alexander Shiyan 572f03cfb0 USB: i.MX5x: Remove usage of MXC_EHCI_INTERNAL_PHY for OTG port
i.MX5x OTG port is hardwired to the internal UTMI PHY, so having
this configurable makes no sense and helps using this port with DT.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-04 15:06:14 +01:00
张忠山 183e6d8b74 mtd: nand: don't scan bbt if CONFIG_NAND_BBT not set
Signed-off-by: 张忠山 <zzs0213@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-04 09:27:23 +01:00
Sascha Hauer 2fa5f06958 spi: Get bus_num from devicetree
Get the bus_num from devicetree if a "spi" alias exists.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-31 12:53:08 +01:00
Sascha Hauer fb40dd5157 spi: support dynamic bus ids
When probing spi bus masters from devicetree they got a bus_num
of -1. This works with a single bus master only since all bus masters
had the same bus_num. Detect this and dynamically assign a valid
bus_num.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-31 12:53:08 +01:00
Sascha Hauer fd5b82e640 spi: Call spi_of_register_slaves from core
Makes individual handling of OF spi slaves unnecessary in the bus drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-31 12:53:05 +01:00
Lucas Stach 2733d47108 pinctrl: don't allow drivers to be selected by menuconfig user
There is no much sense in having the pinctrl drivers be user selectable
as all arches using on of them already selects the right one.

So to avoid presenting the user with the choice to enable unrelated
pinctrl drivers or pushing lots of dependencies into the Kconfig just
drop the configurability.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-31 08:49:57 +01:00
Alexander Shiyan 77b93d7dfe USB: i.MX: Make DT dr_mode & phy_type parameters kernel compatible
Since the mainline kernel now has its own dr_mode and phy_type DT-options
for setting modes of USB ports, do these kernel parameters compatible by
removing "barebox" prefix.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-30 09:52:42 +01:00
Sascha Hauer 5f0bd3edc2 mtd: m25p80: Allow to specify devicename via devicetree alias
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-29 09:10:27 +01:00
Sascha Hauer d317b1bf85 mtd: Pass device_id to add_mtd_device
Right now we do not support persistent names for mtd devices. The
base name can be passed to add_mtd_device, but this is always appended
with a dynamic number. With this patch add_mtd_device takes a device_id
argument which can be used to create a mtd device with an exact name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-29 09:10:21 +01:00
Sascha Hauer 865bab0347 mtd: raw: rename raw device
The name of the raw device is mtdraw<num> which is inconsistent to other
mtd devices which are named mtd<num>.<partname>. Rename it to mtd<num>.raw.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-29 09:10:17 +01:00
Markus Pargmann 5d3cb01271 net: phy: Add micrel KSZ8031
KSZ8031 is similar to KSZ8021. It can use the same functions.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-26 10:12:05 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4d2d66fe52 add: mmci drivers
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 16:49:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD ed78b8dbbc mci: add max_req_size support
Some controller such as the ARM AMBA pl181 can not handle more than 16bits
data length request.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 16:49:48 +02:00
Andre Heider db81ebba81 mci: bcm2835: use the registered device clkdev
Switch from local mailbox code to using the newly created clock device.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 15:28:59 +02:00
Andre Heider 233718d8c5 ARM: bcm2835: register the clocksource driver earlier
RPi's mailbox driver is used early and it needs clock functions to
handle timeouts.

Promote to a core_initcall().

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 15:28:58 +02:00
Sascha Hauer 9101c2d02f of: simplify phandle lookup
Instead of populating an extra list containing all phandles just iterate
over the whole tree. This is done as preparation for more dynamic devicetrees
where parts are loaded at runtime. Here we don't want to keep the list of
phandles in sync.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 08:55:08 +02:00
Alexander Shiyan 139a88a337 USB: Check init/post_init errors
Host with inoperable ULPI able to bring the system into an
infinite loop. The patch adds error checking during initialization
to avoid this.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 08:53:23 +02:00
Alexander Shiyan bbef610b0f gadget: at91: Fix uninitialized variable
Variable udc is used unitialized for DBG(xxx).

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-22 08:51:44 +02:00
Sascha Hauer 2725164194 mci: bcm2835: Add detect callback support for hardware device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-16 09:39:24 +02:00
Andre Heider 43efd0e84f ARM: rpi: fix reading of the EMMC clock for CONFIG_MMU
Add explicit flushing to prevent the 50MHz fallback.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-16 09:39:17 +02:00
Jan Weitzel 0abb8a6c2a i2c-omap: fix reported revison
Report correct major and minor revision
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-14 11:13:10 +02:00
Sascha Hauer 904298deb0 Merge branch 'for-next/socfpga'
Conflicts:
	scripts/Makefile
2013-10-07 08:02:24 +02:00
Sascha Hauer ebf9022f2e Merge branch 'for-next/rs485'
Conflicts:
	common/console_common.c
2013-10-07 08:02:14 +02:00
Sascha Hauer a293dc2753 Merge branch 'for-next/omap' 2013-10-07 08:00:39 +02:00
Sascha Hauer 01f37a992f Merge branch 'for-next/net'
Conflicts:
	arch/arm/boards/animeo_ip/init.c
2013-10-07 08:00:36 +02:00
Sascha Hauer 33c56e21eb Merge branch 'for-next/misc'
Conflicts:
	commands/Makefile
2013-10-07 08:00:25 +02:00
Sascha Hauer 409885aaf3 Merge branch 'for-next/mci' 2013-10-07 08:00:16 +02:00
Sascha Hauer 9aa6dd0270 Merge branch 'for-next/login'
Conflicts:
	include/console.h
2013-10-07 08:00:13 +02:00
Sascha Hauer 408f054247 Merge branch 'for-next/gpio' 2013-10-07 07:59:45 +02:00
Sascha Hauer 574947ef76 Merge branch 'for-next/console' 2013-10-07 07:59:18 +02:00
Sascha Hauer 2a10286e49 Merge branch 'for-next/arm' 2013-10-07 07:59:18 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7ccaaf71fe macb: add support to read the mac address from register
check the 4 mac address register and return at the first valid

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-10-06 13:36:14 +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
Sascha Hauer 666f12e0c1 introduce runtime loglevel
With this the verbosity of barebox can be controlled during runtime
using the 'loglevel' globalvar.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-29 12:15:40 +02:00
Sascha Hauer fc15b013b3 i2c: omap: remove unncessary printf
A printf in the driver should be dev_* and contain useful information.
Both is not the case, remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 16:25:55 +02:00
Jan Weitzel c988b8bf7f i2c-omap: Update driver
The driver didn't work well with at24 driver. NACKS are lost.
Errors are lost in isr due to the local variable err. Also we didn't wait for
bus free in omap_i2c_xfer_msg.

Fix issues and get other improvements from linux kernel

Tested on OMAP4 and AM335x

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 16:24:37 +02:00
Sascha Hauer 61d6a8485d usb: Turn some printf into pr_*
So that these messages can be suppressed if necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:14:37 +02:00
Sascha Hauer 4a22305307 move devinfo command to its own file
Just like nearly all other commands are in individual files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-27 11:14:32 +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 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 eacd5e7cc3 usb: make usb devices children of the corresponding host
To be able to find usb devices in the hardware tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 18:38:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD 568e628974 atmel_serial: add rs485 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-24 09:21:40 +02:00
Sascha Hauer 23d86834c7 clk: Add Altera SoCFPGA clk support
The SoCFPGA currently has all clocks described in the devicetree which
makes common clock support a straight forward task.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Sascha Hauer ff05a46c28 serial: ns16550: Add compatible entry for snps,dw-apb-uart
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Sascha Hauer fa71e57f22 of: partition: Check for valid partition name
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Sascha Hauer 19ea38a004 clk: of: introduce of_clk_src_simple_get
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Dmitry Smagin 3f9ee093f9 Add missing dependency ENV_HANDLING for OF_BAREBOX_DRIVER option
This patch fixes linker error:
  barebox.c:(.text.environment_probe+0x48): undefined reference to `default_environment_path`

Which appears when compiling env-less boards with enabled devicetree.

Signed-off-by: Dmitry Smagin <dmitry.s.smagin@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-23 08:40:31 +02:00
Jean-Christophe PLAGNIOL-VILLARD 7e6b99fd09 smc91111: add fixup for qemu phy support
as today qemu does not support phy, it will return always 0x0 to any read
on the mii bus. So the phy_id is 0 and the link is donw.

To have the norwork running on versatilpb & other qenu board for the link up
at 100Mbps.

Only enable if qemu_fixup is set.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-22 16:48:03 +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
Jean-Christophe PLAGNIOL-VILLARD e62d425517 console: drop f_caps and check the function pointer getc/putc instead
None of the driver make the difference between STDOUT and STDERR.
So we just need to check if putc or getc are filled in the console_device

save 32 bytes on versatilepb

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-21 09:59:16 +02:00
Dmitry Smagin fe4117357f Add missing dependency ENV_HANDLING for OF_BAREBOX_DRIVER option
This patch fixes linker error:
  barebox.c:(.text.environment_probe+0x48): undefined reference to `default_environment_path`

Which appears when compiling env-less boards with enabled devicetree.

Signed-off-by: Dmitry Smagin <dmitry.s.smagin@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 10:24:29 +02:00
Jean-Christophe PLAGNIOL-VILLARD dde9161963 atmel_mci: add devname pdata support
so we can specify the devname in the board

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-18 08:48:07 +02:00
Sascha Hauer c6c3afb3eb mci: add designware mmc controller support
Based on the U-Boot driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-11 12:20:02 +02:00
Markus Niebel e3ab3078dc MCI: imx-esdhc: implement workaround for errata ENGcm12360
At least i.MX53 has errata ENGcm12360:

Occurs when a pending command which issues busy is completed.
For a command with R1b response, the proper software sequence
is to poll the DLA for R1b commands to determine busy
state completion. The DLA polling is not working properly for
the ESDHC module. This is relevant for all eSDHC ports (eSDHC1-4 ports)

DLA bit in PRSSTAT register cannot be
polled to wait for busy state completion.

Updated block guide to reflect that DLA is not applicable to detect
busy state, instead, should poll bit 24 in PRSSTAT register (DLSL[0] bit)
to check that wait busy state is over.

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-11 12:20:01 +02:00
Sascha Hauer 0207b0c6ac gpio: Add designware gpio controller support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:11:36 +02:00
Eric Bénard bf04eedf69 i.MX28: unbreak ethernet
since the switch to common clock, ethernet driver doesn't works and
and access to the network leads to :
eth0: Read MDIO failed...
unable to handle NULL pointer dereference at address 0x000000c7

The problem is that bit 31 (SLEEP) of register HW_CLKCTRL_ENET is kept
to its default value (1) which means : "put Ethernet block in sleep mode.
CLK_H_MAC0(1), CLK_H_MAC0(1)_S, and CLK_ENET0(1)_TX are gated off.
Ethernet can be wakeup remotely in sleep mode"
In that case the FEC don't get its clock.

This patch fix the problem by toggling this bit when FEC's clock is
enabled.

Tested on i.MX28EVK.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:03:59 +02:00
Eric Bénard 6318cfbd9b video/stm: enable clock to get the display working
else the clock is not enabled :
        ref_pix (rate 270000000, disabled)
            lcdif_sel (rate 270000000, disabled)
                lcdif_div (rate 33750000, disabled)
                    lcdif (rate 33750000, disabled)
                        lcdif_comp (rate 33750000, disabled)

tested on i.MX28EVK.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:03:59 +02:00
Eric Bénard f962ae4cd3 video/stm: don't fail when the pixel clock is properly set
the check is wrong as when the clock rate is correctly set
the function will return 0.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:03:59 +02:00
Eric Bénard 8bbd9f59b1 nand_mxs: fix on i.MX28
when the bootmode is different than NAND (USB for example), the
GPMI clock is not enabled thus we can't probe a NAND flash.

Tested on an i.MX28

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:03:59 +02:00
Eric Bénard 3b3ec898cd mxs_spi: unbreak driver
since the switch to common clock, SPI driver reports :
MXS: Timeout resetting block via register 0x80014000
mxs_spi mxs_spi2: MXS SPI: Timeout waiting for start

The reason is that the clock is not enabled anywhere in
the driver.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 21:03:59 +02:00
Eric Bénard e4ee1943fe serial_auart: fix compile error
this fix :
drivers/serial/serial_auart.c:49:22: fatal error: mach/mxs.h: No such file or directory
and
drivers/serial/serial_auart.c: In function 'auart_serial_init_port':
drivers/serial/serial_auart.c:174:2: warning: implicit declaration of function 'stmp_reset_block' [-Wimplicit-function-declaration]

only compile tested ATM

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 08:19:35 +02:00
Eric Bénard 524d2c81a0 mxs_spi: fix compile error
this fix :
drivers/spi/mxs_spi.c:29:22: fatal error: mach/mxs.h: No such file or directory
and
drivers/spi/mxs_spi.c: In function 'mxs_spi_setup':
drivers/spi/mxs_spi.c:102:2: error: too few arguments to function 'stmp_reset_block'
include/stmp-device.h:21:12: note: declared here

only compile tested ATM

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-10 08:19:35 +02:00
Sascha Hauer 38b3be6f35 net: designware: remove backspaces from code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:15:03 +02:00
Sascha Hauer c7278cc625 net: designware: Add decvicetree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:15:01 +02:00
Sascha Hauer 8c3c7c5d64 net: designware: make alt/enhanced descriptor runtime configurable
Instead of hardcoding the alternate/enhanced descriptor layout make
it configurable during runtime. This is based on the value of the
enh_desc variable which is currently hardcoded to zero. This should
be configurable via device_id in the future. Since currently we have
no in tree user of this driver this currently doesn't hurt.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:11:50 +02:00
Sascha Hauer f8db2d225e net: designware: use dma_alloc for descriptors
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:08:38 +02:00
Sascha Hauer 5302030510 net: designware: drop HAS_DESIGNWARE_ETH
To let the driver just compile when needed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:08:38 +02:00
Sascha Hauer 9743dce55a net: designware: Fix broken cache invalidate
Move the cache invalidation of a received packet before we actually
use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-09 14:07:44 +02:00
Sascha Hauer 0cfeb67d6b clocksource: arm_smp_twd: Add devicetree support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 14:34:19 +02:00
Sascha Hauer 7f6b6d25d8 Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/pcm051/env/config
2013-09-05 10:40:04 +02:00
Sascha Hauer 1729b1798e Merge branch 'for-next/boardinfo'
Conflicts:
	arch/mips/boards/qemu-malta/init.c
	commands/bootm.c
	drivers/of/base.c
2013-09-05 10:39:22 +02:00
Sascha Hauer 8f9d4007c5 Merge branch 'for-next/arm-gpio' 2013-09-05 10:38:53 +02:00
Sascha Hauer ec102f635b Merge branch 'for-next/mvebu' 2013-09-05 10:38:46 +02:00
Sascha Hauer e147a7e2bb Merge branch 'for-next/misc' 2013-09-05 10:38:31 +02:00
Sascha Hauer 4cabe36807 Merge branch 'for-next/mci' 2013-09-05 10:38:17 +02:00
Sascha Hauer 10169a04ca Merge branch 'for-next/of' 2013-09-05 10:37:54 +02:00
Renaud Barbier da19582070 of: base: import of_find_node_by_type
Import of_find_node_by_type from Linux drivers/of/base.c -
commit id d8dfad3.
This function retrieves a node pointer based on the "device_type"
property of the node.

This is used by device tree update functions in PPC support.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-05 10:27:51 +02:00
Sascha Hauer 88e132b2a8 Merge branch 'for-next/ubifs' 2013-09-05 10:11:54 +02:00
Sascha Hauer 6b0233be38 Merge branch 'for-next/fb' 2013-09-05 10:11:40 +02:00
Jan Weitzel aaf6fdce2f i2c-omap: fix am33xx and omap3 fclk_rate
commit f64ed12b accidentally swap fclk_rate from am33xx and omap3.
Revert this change.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-31 12:03:25 +02:00
Jan Weitzel f958ffb3cd net/phy: support of mmd register read and write
Add function for indirect access of the mmd registers, based on linux.
phy_read_mmd_indirect
phy_write_mmd_indirect

Also clean some private mmd functions

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-31 12:01:32 +02:00
Sascha Hauer c2ef478873 mci: omap: Allow to set mmc devname via platformdata
To be able to get persistent names for the sd/mmc devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:32 +02:00
Sascha Hauer 7fe0ab2818 mci: omap: implement device detect callback
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:32 +02:00
Sascha Hauer b87a380a5e mci: omap: advertise 8 bit support
The driver is already capable of 8 bit buswidth support, so advertise
it to actually make use of it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-27 07:12:32 +02:00
Steffen Trumtrar c06c88ae51 mci: sdhci: fix IRQSTAT_DMAE bit shift
According to the SD Host Controller Specification Version 3.00, the ADMA error
status bit is on the wrong bit. Fix this.

While at it, add the missing standard error status bits.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-26 09:04:08 +02:00
Sascha Hauer 8c349b5526 ARM: AT91: move iomux definitions to iomux.h
mach/gpio.h is for the gpio API, so move unrelated stuff
away.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 15:58:33 +02:00
Sebastian Hesselbarth 25bc492997 clk: mvebu: add OF clock providers for Marvell MVEBU SoCs
This adds of_clk_providers for core clocks and clock gates found on
Marvell MVEBU SoCs (Armada 370, Armada XP, Dove, and Kirkwood).
It is based on Linux clock providers with clock flags removed, as they
are not used on Barebox.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:45:33 +02:00
Sascha Hauer 775ba3c093 introduce barebox_set_model
Instead of calling of_get_model() in barebox_get_model() add a
barebox_set_model() and use it to set the boardinfo once it's
available from the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 08:40:37 +02:00
David Jander ba3b39d5f0 of: base.c: Use correct device-tree in of_add_initrd()
Otherwise only the internal DT is modified, not necessarily the one passed
to the kernel.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 14:42:53 +02:00
Sascha Hauer 6c9e799a00 of: introduce some new helpers
of_get_tree_max_phandle - get the maximum phandle of a tree. Needed for
                          creating new phandles without conflicts.
of_node_create_phandle - create a phandle for a node which doesn't have one.
of_find_node_by_alias - find a node by alias name
of_find_node_by_path_or_alias - find a node by full path or alias name
of_find_root_node - find the root node for a given device node

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:03:28 +02:00
Sascha Hauer 55909550f8 of: default to internal tree in of_find_node_by_path_from
So that of_find_node_by_path_from can be used easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:03:28 +02:00
Sascha Hauer 7d505a9626 of: parse phandles during unflatten
With this node->phandle becomes valid after unflattening a tree
and not during of_probe later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:03:28 +02:00
Sascha Hauer a5352dfb66 of: fix merge mode in of_unflatten_dtb
In merge mode a property may be overwritte with new values. When
this happens the length has to be adjusted.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 10:03:28 +02:00
Sascha Hauer e60778e041 of: Fix endless loop in of_add_memory
of_add_memory is stuck in an endless loop when a memory bank with zero
size is passed. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-14 09:35:24 +02:00
Alexander Shiyan 93a4a77528 mfd: syscon: Replace dev_info with dev_dbg
There is no reason to print used region each time.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-12 22:06:36 +02:00
Alexander Shiyan 4db3f91326 Cleanup Kconfig files
This patch provides a global cleanup barebox Kconfig files. This includes
replacing spaces to tabs, formatting in accordance format.
No functional changes.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-12 08:05:37 +02:00
Sascha Hauer 1fd45e07f2 fb: make fb device a pure device
Makes the code simpler and makes the framebuffer layer independent
of initcalls.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:49:30 +02:00
Sascha Hauer be442d717e move print_hex_dump function to include/common.h
print_hex_dump is a standard kernel function, so move it outside
the ubi header files to make it usable for other code derived from
the kernel aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:44:48 +02:00
Sascha Hauer 8fb48927da mtd: ubi: Add support for opening a volume by cdev
Needed by ubifs support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:44:48 +02:00
Sascha Hauer 9576c34252 mtd: ubi: add ubi info functions
Needed for ubifs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:44:47 +02:00
Sascha Hauer 419a5f716c mtd: ubi: add missing prototype for ubi_volume_notify
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-06 15:02:24 +02:00
Sascha Hauer 68c50d4cab mtd: ubi: remove calls to nonexisting functions
We do not have ubi_do_get_volume_info and ubi_do_get_device_info
and do not need them yet, so remove calls to these functions to fix
compilation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-06 12:28:57 +02:00
Sascha Hauer df6494123f Merge branch 'for-next/serial' 2013-08-05 12:50:09 +02:00
Sascha Hauer fbf082b565 Merge branch 'for-next/of'
Conflicts:
	arch/arm/boards/freescale-mx53-loco/board.c
	drivers/of/Makefile
2013-08-05 12:50:06 +02:00
Sascha Hauer feefc3ef3b Merge branch 'for-next/mtd' 2013-08-05 12:49:58 +02:00
Sascha Hauer f1355b4f57 Merge branch 'for-next/mfd' 2013-08-05 12:49:58 +02:00
Sascha Hauer 07afe7d0e0 Merge branch 'for-next/marvell'
Conflicts:
	arch/arm/boards/Makefile
	arch/arm/dts/Makefile
2013-08-05 12:49:55 +02:00
Sascha Hauer b8c60d554f Merge branch 'for-next/imagesize' 2013-08-05 12:49:31 +02:00
Sascha Hauer eb5565f003 Merge branch 'for-next/driver' 2013-08-05 12:49:31 +02:00
Sascha Hauer ae5eeb06ed mtd: Turn 'bad block at' message into pr_debug
As bad blocks get more and more on modern nand flashes this message
starts getting annoying.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-05 12:40:21 +02:00
Sascha Hauer b2acebc742 of: Use dts syntax when printing devicetrees
Our devicetree printing is close to correct dts syntax, so fix
some remaining differences:

- Use an equal sign instead of a colon to separate a poperty name and
  a value
- Add a semicolon at the end of properties
- Make sure we do not print a separator for empty properties

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-27 07:41:52 +02:00
Sascha Hauer b655b1e110 mtd: ubi: implement ubi_volume_notify
This is necessary to update the fastmap after ubi manipulations.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-27 07:19:52 +02:00
Sascha Hauer 50f75a1a0e UBI: reimport UBI from Linux v3.10
This is a fresh UBI import from Linux v3.10

This is done mainly to get fastmap support.

This was tested with the i.MX nand driver, the MXS nand driver and
on CFI NOR flash.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-25 10:24:16 +02:00
Antony Pavlov f9ae3fb01c serial: ns16550: fill cdev just-in-time
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-24 18:53:47 +02:00
Antony Pavlov fe290ec08f serial: ns16550: get clock-frequency from dt
This patch helps clk-less boards to use device
tree for clock frequency probing (taken from
linux.git/drivers/tty/serial/of_serial.c).

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-24 18:53:47 +02:00
Sascha Hauer 10f7528afb UBI: remove old ubi support
To update to the latest UBI support from the Kernel first remove
the old UBI support. Without it the update will be even less reviewable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-24 07:17:01 +02:00
Sascha Hauer 5e282091d6 mtd: nand: mxs-nand: Add on flash bbt support
For DT only at the moment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 0f15dee78f mtd: nand: mxs-nand: Add i.MX6 support
The i.MX6 uses the same GPMI NAND controller as i.MX23/28 do. This adds
i.MX6 support to the driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer a4f58f5665 mtd: nand: gpmi: cleanup includes
remove unused includes and use <io.h> instead of <asm/io.h>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 12d2062d5c mtd: nand: gpmi: replace MXS_BCH_BASE with driver resources
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 13968e43b7 mtd: nand: gpmi: use io_base instead of MXS_GPMI_BASE
we have io_base, so use it instead of hardcoded base
address.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer f659fd3069 dma: apbh: cleanup includes
Several includes are unused, remove them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 85fd269e76 dma: apbh: add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 5cd4fd8fba dma: apbh: Turn into a driver
This converts the apbh driver into a real driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:14 +02:00
Sascha Hauer 3d75e777af dma: apbh-dma: move header file to common location
As the apbh dma engine is also found on i.MX6 move the header file
out of MXS specific directories.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Sascha Hauer 6ce6ce79b9 dma: apbh: introduce private struct
Currently the apbh driver uses a hardcoded base (MXS_APBH_BASE).
As a first step to clean this up add a private data struct
which is initialized during startup.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Sascha Hauer ca13a84ac2 ARM: MXS: introduce stmp device support
MXS specific devices have some common infrastructure in the kernel
known as STMP devices. We have the same in barebox, but with a
mxs_ prefix instead of a stmp_ prefix. As some STMP devices are
also found on i.MX6 move the common infrastructure out of MXS
specific files and use the stmp_ prefix.

This is done in preparation for i.MX6 NAND support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Sascha Hauer 66891566cc mtd: nand: update to v3.11-rc1
This updates the NAND stuff to Linux-3.11-rc1. It is synchronized
as best as we can get:

- locks removed
- The splitting in different files we had to better support different
  features has been dropped. Instead this is now done mostly with the
  use of __maybe_unused

Some barebox adjustments are forward ported, like:

- Allow partial page writes
- Optionally allow to erase bad blocks
- check for all_ff before writing a page

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Sascha Hauer c841e7a262 serial: ns16550: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:32:49 +02:00
Sascha Hauer 4b557daac9 serial: ns16550: Add clk support and make platform_data optional
The clockrate was the only really needed field from platform data.
Add clk support to retrieve the clockrate and make platform data
optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:32:21 +02:00
Sascha Hauer 38438d4a0f serial: ns16550: remove f_caps from platform_data
So far no user had the need to set the flags, so just remove them
from platform data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:28:31 +02:00
Sascha Hauer 25c9ecfa82 serial: ns16550: introduce private struct
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:28:30 +02:00
Sascha Hauer ffd44fc14c serial: ns16550: reorder functions to avoid forward declaration
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:28:30 +02:00
Sascha Hauer cdd1de46ff clk: provide static inline wrappers
So that drivers can use clk_* functions without having to ifdef
them away.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 08:28:02 +02:00
Sascha Hauer 69f3d6c93b mtd: introduce mtd_read_oob and mtd_write_oob
Directly copied from the Kernel as of 3.11-rc1

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 16:14:16 +02:00
Sascha Hauer d155610821 mtd: introduce ecc strength
This introduces the ecc stength fields in the structures and fills
them in, but leaves them unused right now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 16:14:08 +02:00
Sascha Hauer e3885851b7 mtd: rename mtd_read_oob
There is the same function name in the Kernel but with different
semantics. Rename to avoid naming conflicts when we update the
mtd support from the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-22 16:14:03 +02:00
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 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
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 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
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 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
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 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 98df44ee7d led: gpio: Add trigger support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-10 14:10:50 +02:00
Sebastian Hesselbarth 34934c183b LED: add support for device tree parsing of gpio-leds
This adds a driver option to probe GPIO LEDs from device tree compatible
with "gpio-leds" device tree nodes.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 20:00:19 +02:00
Jan Luebbe a1c79b1bd1 nand_base: add missing newline
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 19:49:41 +02:00
Sebastian Hesselbarth b29eac0769 OF: base: initalize from node in of_find_node_with_property
This adds initialization of from device node with root_node if NULL
is passed. This corresponds to the behavior of all other node iterators.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-09 08:55:02 +02:00
Sebastian Hesselbarth 5db1a578d6 spi: add Marvell MVEBU SoC SPI driver
This adds support for the SPI controller found on Marvell MVEBU SoCs
(Dove, Kirkwood, Discovery Innovation, and Armada 370/XP). Current driver
is DT only. Compatible strings are provided for Orion (common denominator),
Armada 370/XP and Dove SoCs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-08 09:42:49 +02:00
Sebastian Hesselbarth f457f683cb OF: base: fix iterator in of_get_next_available_child
of_get_next_available_child does not iterate but always tries the
same node over and over again. This first prepares the entry and
then uses list_for_each_entry_continue, instead of for_each_child_of_node
before.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:47:57 +02:00
Sascha Hauer 73986cc87d OF: base: fix inifinite looping in node iterators
of_find_node_by_name suffers from infinite looping, because it
does not check for root node of the tree iterated over. This
fixes this by checking for node->parent to determine whether
the last node has been reached.
Since of_tree_for_each_node does not iterate over the whole tree,
but only over the remaining nodes, rename it to
of_tree_for_each_node_from.

Reported-by: NISHIMOTO Hiroki <hiroki.nishimoto.if@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:45:57 +02:00
Sebastian Hesselbarth 414ee7154a GPIO: add Marvell Orion/MVEBU SoC GPIO driver
This adds a DT only driver for the GPIO controller found on Marvell
Orion/MVEBU SoCs (Armada 370/XP, Dove, Kirkwood, MV78x00, Orion5x).

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:27:11 +02:00
Sebastian Hesselbarth f10119f27e clocksource: mvebu: add DT support
This adds device tree support to mvebu timer and also converts clk_get
to clk_lookup to find TCLK without device name reference.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:27:10 +02:00
Sebastian Hesselbarth 3c24858206 clocksource: mvebu: lookup clock by physbase
This converts Armada 370/XP SoC init to register tclk alias
for timer by physbase instead of name.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:27:10 +02:00
Sebastian Hesselbarth dce879a14e clocksource: orion: add DT support
This adds device tree support to orion timer and also converts clk_get
to clk_lookup to find TCLK without device name reference.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:27:10 +02:00
Sebastian Hesselbarth 6e40610d51 clocksource: orion: lookup clock by physbase
This converts Kirkwood and Dove SoC init to register tclk alias
for timer by physbase instead of name.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:27:10 +02:00
Sebastian Hesselbarth cf31688b6a OF: base: rename of_free to of_delete_node
of_free is misleading about the actual purpose of the function. There is
already a of_create_node counterpart, so rename of_free to of_create_node
and update all users accordingly.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth b73f70bb1a OF: base: convert of_add_memory to OF API
Convert of_add_memory parsing to make use of of_address_to_resource
instead of parsing memory ranges itself. This makes some functions
dead code which are also removed.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth 3c84ded0f5 OF: remove device and resource pointer from struct device_node
struct device_node has its own resources and a pointer to associated
device_d. With recent platform related OF code, we can convert the
only user of it and remove those pointers from struct device_node.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth ffa50c1e60 OF: base: remove dead device related functions
With recent conversion to of_platfrom_populate_some functions are now
dead code and can be removed.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth 4aa0506c95 OF: base: use of_platform_populate for probing
With recent bus/device related functions in OF API, we can now
convert to use of_platform_populate.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth 61bb8bfc7c OF: gpio: convert DT based gpio handling to new OF API
This creates a Linux OF API compatible counterpart of of_get_named_gpio_flags.
Existing of_get_named_gpio is converted to a static inline function, which is
in the corresponding of_gpio.h include. While at it, drivers/of/gpio.c is
also renamed to drivers/of/of_gpio.c to follow the of_ prefix naming scheme.
The new include is also added to existing users of of_get_named_gpio.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth 483424e027 OF: import bus/device related functions from Linux OF API
This imports some bus and device related functions from Linux OF API
with some modifcations for Barebox.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth 6fbaab1085 OF: base: move OF_ROOT_NODE_ defines to local OF code
OF_ROOT_NODE_* defines should not be used outside of base.c. Move them
to drivers/of/base.c to ensure they will not be used elsewhere.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth bfc5605e2f OF: convert of_translate_address to new API
This converts existing of_translate_address to recently added API. In
contrast to existing behavior, the new function honors ranges properties
properly. It now allows reg properties to be set as offset with respect
to the correspoding parent node.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Sebastian Hesselbarth d0a6aaea6a OF: import address related functions from Linux OF API
This imports drivers/of/address.c from Linux with some minor modifications.
of_translate_address is not yet enabled and PCI and ISA related bus translations
have not been imported. Also, a corresponding include header is created with
prototypes and non-OF function stubs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-05 08:26:57 +02:00
Lucas Stach 3cfd3be736 tegra: add peripheral clocks
Only UART clocks are included for now, but the code should cover
other peripherals needs, too.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach c16730e3c6 tegra: add new clock framework driver
This removes the existing Tegra CAR driver and replaces it with code
ported from the Linux clock framework.

In the current state only the relevant PLLs are supported, but this is
no functional regression from the existing code.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach 10a06ed554 clk: allow to instanciate clk mux without registering it
Allows to reuse clk mux code within other clocks.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach 98a2fe8f95 clk: allow to instanciate clk gate without registering it
Allows to reuse the clk gate code within other clocks.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Lucas Stach b0d851d951 clk: add clock lookup from devicetree
Taken from the Linuxkernel with some small adjustments for barebox.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-02 08:36:09 +02:00
Sascha Hauer 8afe2cb4d4 Merge branch 'for-next-manual/oftree-linux-sync' 2013-07-02 07:08:46 +02:00
Sascha Hauer 12657cb99e Merge branch 'for-next/usb' 2013-07-01 10:14:40 +02:00
Sascha Hauer 55e87e07c1 Merge branch 'for-next/ppc' 2013-07-01 10:14:40 +02:00
Sascha Hauer da05cbd69a Merge branch 'for-next/omap' 2013-07-01 10:14:40 +02:00
Sascha Hauer b83536bdb9 Merge branch 'for-next/mxs' 2013-07-01 10:14:40 +02:00
Sascha Hauer 939c2173a3 Merge branch 'for-next/multi-image' 2013-07-01 10:14:40 +02:00
Sascha Hauer ae0589c5ef Merge branch 'for-next/mtd' 2013-07-01 09:37:38 +02:00
Sascha Hauer 85b427ffed Merge branch 'for-next/misc' 2013-07-01 09:37:37 +02:00
Sascha Hauer f686bbd083 Merge branch 'for-next/mfd' 2013-07-01 09:37:37 +02:00
Sascha Hauer be1ebac429 Merge branch 'for-next/mci'
Conflicts:
	arch/arm/boards/ccxmx51/ccxmx51js.c
	arch/arm/boards/dmo-mx6-realq7/board.c
2013-07-01 09:37:35 +02:00
Sascha Hauer 33a6e99a38 Merge branch 'for-next/imx'
Conflicts:
	drivers/usb/imx/chipidea-imx.c
2013-07-01 09:37:04 +02:00
Sascha Hauer 1e382ad1c4 Merge branch 'for-next/debug' 2013-07-01 09:32:05 +02:00
Sascha Hauer 5d4d3abad1 Merge branch 'for-next/ata' 2013-07-01 09:32:04 +02:00
Sebastian Hesselbarth 26e15b6ec8 clocksource: fix Marvell timer read-back value
Clocksource read callback expects incrementing timer values, while
internal timer on Marvell SoCs counts backwards. Fix value returned
by Marvell MVEBU and Orion clocksource drivers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-29 10:43:02 +02:00
Sascha Hauer 22159db6b0 ARM: build dtbs depending on CONFIG_OFTREE
The upcoming multi image support will need devicetree binary
blobs even when there is no builtin dtb. Instead of depending
on CONFIG_BUILTIN_DTB depend on CONFIG_OFTREE and let this option
select DTC.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-26 23:42:47 +02:00
Sascha Hauer 8d2762ff56 driver: implement device_detect_by_name function
It becomes a common pattern for boards to find a device and
call device_detect on it. Add a convenience wrapper for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-26 18:17:12 +02:00
Renaud Barbier eb99c09f7c ppc: gianfar MDIO buses
This commit creates MDIO bus devices to separate the MDIO bus
abstraction from the Ethernet device initialisation.

It also updates the configuration of the P2020RDB ports.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 22:16:55 +02:00
Sascha Hauer c6edbecd68 usb: gadget: fsl: Fix registering from chipidea driver
The fsl gadget driver wants to configure the portsc register
with information from platform_data. When registered from the
chipidea driver there is no platform_data. Fix the resulting
crash by not derefencing platform_data when NULL. In this
case the PORTSC register is not touched, it will have been
configured by the chipidea driver in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 16:01:50 +02:00
Sascha Hauer acb28bb881 pinctrl: imx-iomux-v3: Add imx6dl compatible entry
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 16:01:45 +02:00
Sascha Hauer ff3c9fa7fb ARM: i.MX51 efikasb: Switch to devicetree probing
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:05 +02:00
Sascha Hauer d9760dc26b usb: i.MX chipidea: probe ULPI phys later
Probe ULPI phys during USB initialization and not during driver
probe. This lowers the pressure to have the necessary board specific
setup in place early.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-25 11:52:05 +02:00