firefly-linux-kernel-4.4.55.git
9 years agocoresight: remove the unused macro CORESIGHT_DEBUGFS_ENTRY
Xia Kaixu [Fri, 9 Jan 2015 23:57:18 +0000 (16:57 -0700)]
coresight: remove the unused macro CORESIGHT_DEBUGFS_ENTRY

Debugfs isn't used for coresight configuration, so the macro
CORESIGHT_DEBUGFS_ENTRY is unnecessary, just remove it.

Signed-off-by: Xia Kaixu <xiakaixu@huawei.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f379984f849d729bd2eb076b633200b1c040611e)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-etm: Fix initial trace ID value
Mathieu Poirier [Fri, 9 Jan 2015 23:57:17 +0000 (16:57 -0700)]
coresight-etm: Fix initial trace ID value

The coresight TRM specify that a component's trace ID should
be other than 0.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b2c09284bbfe36f9ba0e3e8bec8bb3c4789b3911)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-tpiu: use module_amba_driver to simplify the code
Wei Yongjun [Fri, 9 Jan 2015 23:57:16 +0000 (16:57 -0700)]
coresight-tpiu: use module_amba_driver to simplify the code

module_amba_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3ff7ca051a43bf2dfd1eebdd6c771c4b7a276d8e)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-tmc: use module_amba_driver to simplify the code
Wei Yongjun [Fri, 9 Jan 2015 23:57:15 +0000 (16:57 -0700)]
coresight-tmc: use module_amba_driver to simplify the code

module_amba_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d2e580c272d19afff768b56dd0f5d2095cb5a07c)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-funnel: use module_amba_driver to simplify the code
Wei Yongjun [Fri, 9 Jan 2015 23:57:14 +0000 (16:57 -0700)]
coresight-funnel: use module_amba_driver to simplify the code

module_amba_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit a48f52e185f7f6da2c53f8dd4efda963c32b73f1)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-etb: use module_amba_driver to simplify the code
Wei Yongjun [Fri, 9 Jan 2015 23:57:13 +0000 (16:57 -0700)]
coresight-etb: use module_amba_driver to simplify the code

module_amba_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 52d6bbb9b06cac67ec3c016bc9758a1815022b2b)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agocoresight-etm: unlock on error paths in mode_store()
Dan Carpenter [Fri, 9 Jan 2015 23:57:12 +0000 (16:57 -0700)]
coresight-etm: unlock on error paths in mode_store()

There are some missing unlocks on the error paths.

Fixes: a939fc5a71ad ('coresight-etm: add CoreSight ETM/PTM driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6ad1095990328e7e4b3a0e260825ad4b6406785a)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
9 years agommc: 3368: midgreed WA
lintao [Mon, 2 Mar 2015 10:11:11 +0000 (18:11 +0800)]
mmc: 3368: midgreed WA

Signed-off-by: lintao <lintao@rock-chips.com>
9 years agork3368 mipi: fix the phase between the mipi clock and mipi data
chenyifu [Mon, 2 Mar 2015 09:03:57 +0000 (17:03 +0800)]
rk3368 mipi: fix the phase between the mipi clock and mipi data

The mipi screen may be no-display in rk3368 when the mipi rate
higher than 900M, so we need to fix the phase between the clock and data.

Signed-off-by: chenyifu <chenyf@rock-chips.com>
9 years agork3368 lcdc: init pixclock when uboot logo on is open, it is need by DSI
hjc [Mon, 2 Mar 2015 07:25:38 +0000 (15:25 +0800)]
rk3368 lcdc: init pixclock when uboot logo on is open, it is need by DSI

Signed-off-by: hjc <hjc@rock-chips.com>
9 years agork: uboot_mem_reserve: lost a '=' in 'if' statement
CMY [Mon, 2 Mar 2015 07:42:55 +0000 (15:42 +0800)]
rk: uboot_mem_reserve: lost a '=' in 'if' statement

9 years agoarm64: mm: reserve memory region for uboot
CMY [Mon, 2 Mar 2015 03:44:54 +0000 (11:44 +0800)]
arm64: mm: reserve memory region for uboot

Signed-off-by: CMY <cmy@rock-chips.com>
9 years agork: uboot_mem_reserve: fix print format
CMY [Mon, 2 Mar 2015 03:33:35 +0000 (11:33 +0800)]
rk: uboot_mem_reserve: fix print format

Signed-off-by: CMY <cmy@rock-chips.com>
9 years agork3368: iommu: fix 32bit iommu work error in 64bit kernel
Simon [Tue, 6 Jan 2015 06:13:31 +0000 (14:13 +0800)]
rk3368: iommu: fix 32bit iommu work error in 64bit kernel

unsigned long has 8bytes in 64bit kernel,Maybach iommu each entry
both dte and pte has 4bytes,so we can not use unsigned long type
to define the entry address,otherwise,wrong page table will be set up,
that will cause page fault.So,replace unsigned long with unsigned int to
define the entry address

Signed-off-by: Simon <xxm@rock-chips.com>
9 years agork3368 codec : add support for codec es8316
smj [Mon, 2 Mar 2015 02:33:08 +0000 (10:33 +0800)]
rk3368 codec : add support for codec es8316

Signed-off-by: smj <smj@rock-chips.com>
9 years agommc: replace tSD enumaration machanism
lintao [Mon, 2 Mar 2015 01:25:57 +0000 (09:25 +0800)]
mmc: replace tSD enumaration machanism

Remove dt property "support-tSD" and combine "support-emmc" with
"support-sd" in together for tSD/emmc distinguish by mmc core. More details
please refer to arch/arm/boot/dts/rk3288-tb.dts

Signed-off-by: lintao <lintao@rock-chips.com>
9 years agorockchip: i2s: use subysys_initcall_sync for probe.
Sugar Zhang [Mon, 2 Mar 2015 00:50:41 +0000 (08:50 +0800)]
rockchip: i2s: use subysys_initcall_sync for probe.

because some codecs initialization depends on i2s mclk.

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
9 years agocamsys_drv: v0.0x1c.0
dalon.zhang [Sat, 28 Feb 2015 11:16:21 +0000 (19:16 +0800)]
camsys_drv: v0.0x1c.0

9 years agocamera:
dalon.zhang [Sat, 28 Feb 2015 11:09:34 +0000 (19:09 +0800)]
camera:
oneframe: v0.2.0
pingpong: v0.1.a

9 years agoremove unused wifi driver: rda5990, mt5931, mt7601, mt6620
hwg [Sat, 28 Feb 2015 09:06:56 +0000 (17:06 +0800)]
remove unused wifi driver: rda5990, mt5931, mt7601, mt6620

9 years agork3368: p9_dts: add lcd_en delay time
guoyi [Sat, 28 Feb 2015 08:57:06 +0000 (16:57 +0800)]
rk3368: p9_dts: add lcd_en delay time

9 years agork3368 lcdc: fix fbdc addr config error
hjc [Sat, 28 Feb 2015 07:09:28 +0000 (15:09 +0800)]
rk3368 lcdc: fix fbdc addr config error

Signed-off-by: hjc <hjc@rock-chips.com>
9 years agosupport different wifi bt chip auto compatible
hwg [Sat, 28 Feb 2015 06:05:32 +0000 (14:05 +0800)]
support different wifi bt chip auto compatible
 like auto recognize rtl8188eu, ap6210, esp8089 in android

9 years agosupport different wifi bt chip auto compatible
hwg [Sat, 28 Feb 2015 06:03:13 +0000 (14:03 +0800)]
support different wifi bt chip auto compatible
 modify arch/arm/boot/dts/rk3128-86v.dts

9 years agosupport different wifi bt chip auto compatible
hwg [Sat, 28 Feb 2015 06:02:56 +0000 (14:02 +0800)]
support different wifi bt chip auto compatible
 modify arch/arm/boot/dts/rk3126-86v.dts

9 years agosupport different wifi bt chip auto compatible
hwg [Sat, 28 Feb 2015 05:59:24 +0000 (13:59 +0800)]
support different wifi bt chip auto compatible
 Attention: this is only for android 5.0, not compatible for android 4.4, meaning can't compatible for 4.4 after this commit
 modify arch/arm/boot/dts/rk3288-tb_8846.dts

9 years agork: ion: allow the cacheable buffer to map iommu
CMY [Fri, 27 Feb 2015 09:59:00 +0000 (17:59 +0800)]
rk: ion: allow the cacheable buffer to map iommu

Signed-off-by: CMY <cmy@rock-chips.com>
9 years agoHDMI:
Zheng Yang [Sat, 14 Feb 2015 08:22:35 +0000 (16:22 +0800)]
HDMI:
1. In DVI mode, input color and output color should be RGB[0-255];
   In HDMI mode, input color should be YCbCr;
2. For MID, HDMI is default disabled.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agohdmi: hdmiv1:
Zheng Yang [Sat, 14 Feb 2015 01:14:18 +0000 (09:14 +0800)]
hdmi: hdmiv1:
For nlpcm bitstream mode, we need to set audio
channel status nlpcm bit to 1.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agohdmi: fix set hdmi switch state error when remove hdmi.
Zheng Yang [Sat, 14 Feb 2015 00:51:54 +0000 (08:51 +0800)]
hdmi: fix set hdmi switch state error when remove hdmi.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agork3368 lcdc: inter bak register will lead to clear
hjc [Fri, 27 Feb 2015 07:39:30 +0000 (15:39 +0800)]
rk3368 lcdc: inter bak register will lead to clear
    other inter status, so when we clear inter inter
    status we should set clear register to zero.

Signed-off-by: hjc <hjc@rock-chips.com>
9 years agork31xx lvds: set clock lane enable int ttl mode
hjc [Fri, 27 Feb 2015 03:50:10 +0000 (11:50 +0800)]
rk31xx lvds: set clock lane enable int ttl mode

Signed-off-by: hjc <hjc@rock-chips.com>
9 years agork_sdmmc: speed up MMC for 3368
lintao [Fri, 27 Feb 2015 03:19:15 +0000 (11:19 +0800)]
rk_sdmmc: speed up MMC for 3368

   Test with p9-818 board, without DM for ext4 mount option.

Signed-off-by: lintao <lintao@rock-chips.com>
9 years agork fb: if uboot-logo-on set 1, open iommu when iommu en
hjc [Thu, 26 Feb 2015 10:27:40 +0000 (18:27 +0800)]
rk fb: if uboot-logo-on set 1, open iommu when iommu en

Signed-off-by: hjc <hjc@rock-chips.com>
9 years agork312x/rk3036: not change aclk_core_div for stability
dkl [Thu, 26 Feb 2015 01:44:34 +0000 (09:44 +0800)]
rk312x/rk3036: not change aclk_core_div for stability

In rk312x/rk3036, do not change aclk_core_div for stability.
Also remove some unusued macros and codes.

Signed-off-by: dkl <dkl@rock-chips.com>
9 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Sat, 21 Feb 2015 09:06:59 +0000 (18:06 +0900)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

9 years agoMerge branch 'lsk/v3.10/topic/of' into linux-linaro-lsk
Mark Brown [Sat, 21 Feb 2015 03:16:39 +0000 (12:16 +0900)]
Merge branch 'lsk/v3.10/topic/of' into linux-linaro-lsk

9 years agoi2c: Mark instantiated device nodes with OF_POPULATE
Pantelis Antoniou [Thu, 15 Jan 2015 18:33:18 +0000 (20:33 +0200)]
i2c: Mark instantiated device nodes with OF_POPULATE

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 6d0a0d9ad09be16e3ca676b245643945b4bff47d)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/i2c/i2c-core.c

9 years agoi2c: Mark instantiated device nodes with OF_POPULATE
Pantelis Antoniou [Thu, 15 Jan 2015 16:33:55 +0000 (18:33 +0200)]
i2c: Mark instantiated device nodes with OF_POPULATE

Mark (and unmark) device nodes with the POPULATE flag as appropriate.
This is required to avoid multi probing when using I2C and device
overlays containing a mux.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit d5285c36e6d27c1a411a3131c034641a5fa452cb)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoi2c/of: Add OF_RECONFIG notifier handler
Pantelis Antoniou [Tue, 28 Oct 2014 20:36:03 +0000 (22:36 +0200)]
i2c/of: Add OF_RECONFIG notifier handler

CONFIG_OF_DYNAMIC enables runtime changes to the device tree which in
turn may trigger addition or removal of devices from Linux. Add an
OF_RECONFIG notifier handler to receive tree change events and to
creating or destroy i2c devices as required.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: clean up #ifdefs and drop unneeded error handling]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-i2c@vger.kernel.org
(cherry picked from commit ea7513bbc04170f1cbf42953187a4d8b731c71c4)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoi2c/of: Factor out Devicetree registration code
Pantelis Antoniou [Tue, 28 Oct 2014 20:36:02 +0000 (22:36 +0200)]
i2c/of: Factor out Devicetree registration code

Dynamically inserting i2c client device nodes requires the use
of a single device registration method. Factor out the loop body of
of_i2c_register_devices() so that it can be called for individual
device_nodes instead of for all the children of a node.

Note: The diff of this commit looks far more complicated than it
actually is due the indentation being changed for a large block of code.
When viewed using the diff -w flag to ignore whitespace changes it can
be seen that the change is actually quite simple.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Made new function static and removed changes to header]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-i2c@vger.kernel.org
(cherry picked from commit a430a3455f2c48995e06b359a82a1109a419e9ef)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/i2c/i2c-core.c

9 years agoi2c: move OF helpers into the core
Wolfram Sang [Thu, 11 Jul 2013 11:56:15 +0000 (12:56 +0100)]
i2c: move OF helpers into the core

I2C of helpers used to live in of_i2c.c but experience (from SPI) shows
that it is much cleaner to have this in the core. This also removes a
circular dependency between the helpers and the core, and so we can
finally register child nodes in the core instead of doing this manually
in each driver. So, fix the drivers and documentation, too.

[Modified to keep a stub device registration API exposed to drivers in
order to avoid disruption]

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 687b81d083c082bc1e853032e3a2a54f8c251d27)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/i2c/busses/i2c-imx.c
drivers/i2c/busses/i2c-stu300.c
drivers/i2c/busses/i2c-wmt.c
drivers/of/Kconfig
drivers/of/Makefile
drivers/staging/imx-drm/imx-tve.c
sound/soc/fsl/imx-wm8962.c

9 years agoMerge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android
Mark Brown [Fri, 20 Feb 2015 05:29:33 +0000 (14:29 +0900)]
Merge remote-tracking branch 'lsk/v3.10/topic/aosp' into linux-linaro-lsk-android

Conflicts:
drivers/Kconfig
drivers/Makefile
fs/pstore/inode.c
fs/pstore/ram.c

9 years agoMerge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro...
Mark Brown [Fri, 20 Feb 2015 05:27:48 +0000 (14:27 +0900)]
Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro-android into lsk-v3.10-aosp

9 years agoMerge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
Mark Brown [Thu, 19 Feb 2015 10:17:15 +0000 (19:17 +0900)]
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android

9 years agoMerge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk
Mark Brown [Thu, 19 Feb 2015 10:17:10 +0000 (19:17 +0900)]
Merge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk

Conflicts:
drivers/of/Makefile

9 years agoof/overlay: Directly include idr.h
Mark Brown [Tue, 17 Feb 2015 02:35:02 +0000 (11:35 +0900)]
of/overlay: Directly include idr.h

The overlay code uses IDRs but does not explicitly include the header
providing the interface, instead relying on an implicit inclusion. Make
the dependency implict to avoid potential future build issues if the
implicit inclusion goes away.

Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/platform: Handle of_populate drivers in notifier
Pantelis Antoniou [Tue, 16 Dec 2014 17:45:26 +0000 (19:45 +0200)]
of/platform: Handle of_populate drivers in notifier

When using overlays with drivers calling of_populate the notifier
will try to create the device twice. Using the populated bit
before proceeding protects against this.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 15204ab1ebc5aba608cd19c83c37b98438b938b0)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/overlay: Do not generate duplicate nodes
Pantelis Antoniou [Tue, 16 Dec 2014 17:45:25 +0000 (19:45 +0200)]
of/overlay: Do not generate duplicate nodes

During the course of the rewrites a bug sneaked in when dealing
with children nodes of overlays, which ends up duplicating
sub nodes.

Simply remove the duplicate traversal of child nodes to fix.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 3e7f7626fd49a9ffba8520a1a073f62929acad63)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/overlay: Introduce DT overlay support
Pantelis Antoniou [Tue, 28 Oct 2014 20:35:58 +0000 (22:35 +0200)]
of/overlay: Introduce DT overlay support

Overlays are a method to dynamically modify part of the kernel's
device tree with dynamically loaded data. Add the core functionality to
parse, apply and remove an overlay changeset. The core functionality
takes care of managing the overlay data format and performing the add
and remove. Drivers are expected to use the overlay functionality to
support custom expansion busses commonly found on consumer development
boards like the BeagleBone or Raspberry Pi.

The overlay code uses CONFIG_OF_DYNAMIC changesets to perform the low
level work of modifying the devicetree.

Documentation about internal and APIs is provided in
Documentation/devicetree/overlay-notes.txt

v2:
- Switch from __of_node_alloc() to __of_node_dup()
- Documentation fixups
- Remove 2-pass processing of properties
- Remove separate ov_lock; just use the DT mutex.
v1:
- Drop delete capability using '-' prefix. The '-' prefixed names
are valid properties and nodes and there is no need for it just yet.
- Do not update special properties - name & phandle ones.
- Change order of node attachment, so that the special property update
works.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 7518b5890d8ac366faa2326ce2356ef6392ce63d)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/Makefile

9 years agoof: Refactor __of_node_alloc() into __of_node_dup()
Grant Likely [Mon, 17 Nov 2014 22:31:32 +0000 (22:31 +0000)]
of: Refactor __of_node_alloc() into __of_node_dup()

Add a node argument to __of_node_alloc() and rename it to
__of_node_dup() so that it can also be used to duplicate a node with
its properties. This is important for the overlay code so that it can
create new nodes without using separate changeset items for every single
property.

At the same time rework the overlay code to use the new function and
drop the extra changeset items.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit e51795815ef1a7adc018cbaf05aac46e3d24eda8)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/unittest.c

9 years agoof: Use vargs in __of_node_alloc
Grant Likely [Fri, 14 Nov 2014 15:33:07 +0000 (15:33 +0000)]
of: Use vargs in __of_node_alloc

The overlay code needs to construct a new full_name from the parent name
and the node name, but the current method has to allocate and then free
an temporary string which is wasteful. Fix this problem by using vargs
to pass in a format and arguments into __of_node_alloc().

At the same time remove the allocflags argument to __of_node_alloc().
The only users all use GFP_KERNEL, so there is no need to provide it as
an option. If there is ever a need later it can be added back.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit ef8bbd73a76197cf8362a2b43aaadc5717bd0746)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/unittest.c

9 years agoof/reconfig: Add OF_DYNAMIC notifier for platform_bus_type
Pantelis Antoniou [Tue, 28 Oct 2014 20:36:01 +0000 (22:36 +0200)]
of/reconfig: Add OF_DYNAMIC notifier for platform_bus_type

Add OF notifier handler needed for creating/destroying platform devices
according to dynamic runtime changes in the DT live tree.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 801d728c10db4b28e01590b46bf1f0df930760cc)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/platform: Fix of_platform_device_destroy iteration of devices
Grant Likely [Tue, 24 Jun 2014 15:13:47 +0000 (16:13 +0100)]
of/platform: Fix of_platform_device_destroy iteration of devices

of_platform_destroy does not work properly, since the tree
population test was iterating on all devices having as its parent
the given platform device.

The check was intended to check whether any other platform or amba
devices created by of_platform_populate were still populated, but
instead checked for every kind of device. This is wrong, since platform
devices typically create a subsystem regular device and set themselves
as parents.

Instead, go ahead and call the unregister functions for any devices
created with of_platform_populate. The driver core will take care of
unbinding drivers, and drivers are responsible for getting rid of any
child devices that weren't created by of_platform_populate.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
(cherry picked from commit 75f353b61342b5847c7f6d8499fd6301dce09845)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
include/linux/of_platform.h

9 years agoof: Keep track of populated platform devices
Pawel Moll [Thu, 15 May 2014 15:55:24 +0000 (16:55 +0100)]
of: Keep track of populated platform devices

In "Device Tree powered" systems, platform devices are usually massively
populated with of_platform_populate() call, executed at some level of
initcalls, either by generic architecture or by platform-specific code.

There are situations though where certain devices must be created (and
bound with drivers) before all the others. This presents a challenge,
as devices created explicitly would be created again by
of_platform_populate().

This patch tries to solve that issue in a generic way, adding a
"populated" flag for a DT node description. Subsequent
of_platform_populate() will skip such nodes (and its children) in
a similar way to the non-available ones.

This patch also adds of_platform_depopulate() as an operation
complementary to the _populate() one. It removes a platform or an amba
device populated from the Device Tree, together with its all children
(leaving, however, devices without associated of_node untouched)
clearing the "populated" flag on the way.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit c6e126de43e7d4abfd6cf796b40589db3a046167)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/platform.c
include/linux/of_platform.h

9 years agoMerge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk
Mark Brown [Mon, 16 Feb 2015 07:57:48 +0000 (16:57 +0900)]
Merge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk

Conflicts:
arch/powerpc/kernel/prom.c
drivers/of/Kconfig
drivers/of/Makefile
drivers/of/selftest.c
include/linux/of.h

9 years agoof/reconfig: Always use the same structure for notifiers
Grant Likely [Mon, 24 Nov 2014 17:58:01 +0000 (17:58 +0000)]
of/reconfig: Always use the same structure for notifiers

The OF_RECONFIG notifier callback uses a different structure depending
on whether it is a node change or a property change. This is silly, and
not very safe. Rework the code to use the same data structure regardless
of the type of notifier.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: <linuxppc-dev@lists.ozlabs.org>
(cherry picked from commit f5242e5a883bf1c1aba6bfd87b85e7dda0e62191)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
arch/powerpc/platforms/pseries/hotplug-memory.c
include/linux/of.h

9 years agoof/reconfig: Add debug output for OF_RECONFIG notifiers
Grant Likely [Fri, 14 Nov 2014 14:34:55 +0000 (14:34 +0000)]
of/reconfig: Add debug output for OF_RECONFIG notifiers

Add some additional debug output to cover OF_RECONFIG notifier activity.
At the same time, refactor the changeset debug output to use the same
strings as the notifier debug output.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 00aa37206e1a54dae61a0dba96bf2ee0938b99d7)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/reconfig: Add of_reconfig_get_state_change() of notifier helper.
Pantelis Antoniou [Tue, 28 Oct 2014 20:33:53 +0000 (22:33 +0200)]
of/reconfig: Add of_reconfig_get_state_change() of notifier helper.

Introduce of_reconfig_get_state_change() which allows an of notifier
to query about device state changes.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit b53a2340d0d30468b7315992ba77fe188c3bc5c8)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/resolver: Switch to new local fixups format.
Pantelis Antoniou [Tue, 28 Oct 2014 20:33:49 +0000 (22:33 +0200)]
of/resolver: Switch to new local fixups format.

The original resolver format is way too cryptic, switch
to using a tree based format that gets rid of repetitions,
is more compact and readable.

At the same time, update the selftests to using the new local fixups
format.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Squashed in testcase changes and merged similar functions]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit da56d04c806a3e9986c66a061d7363ca3157c37b)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/unittest-data/testcases.dts

9 years agoof: Introduce Device Tree resolve support.
Pantelis Antoniou [Fri, 4 Jul 2014 16:59:20 +0000 (19:59 +0300)]
of: Introduce Device Tree resolve support.

Introduce support for dynamic device tree resolution.
Using it, it is possible to prepare a device tree that's
been loaded on runtime to be modified and inserted at the kernel
live tree.

Export of of_resolve and bug fix of double free by
Guenter Roeck <groeck@juniper.net>

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Don't need to select CONFIG_OF_DYNAMIC and CONFIG_OF_DEVICE]
[grant.likely: Don't need to depend on OF or !SPARC]
[grant.likely: Factor out duplicate code blocks into single function]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 7941b27b16e3282f6ec8817e36492f1deec753a7)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/Kconfig
drivers/of/Makefile

9 years agoof: Transactional DT support.
Pantelis Antoniou [Fri, 4 Jul 2014 16:58:49 +0000 (19:58 +0300)]
of: Transactional DT support.

Introducing DT transactional support.

A DT transaction is a method which allows one to apply changes
in the live tree, in such a way that either the full set of changes
take effect, or the state of the tree can be rolled-back to the
state it was before it was attempted. An applied transaction
can be rolled-back at any time.

Documentation is in
Documentation/devicetree/changesets.txt

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[glikely: Removed device notifiers and reworked to be more consistent]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 201c910bd6898d81d4ac6685d0f421b7e10f3c5d)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/selftest.c
drivers/of/testcase-data/testcases.dtsi
include/linux/of.h

9 years agoof: Reorder device tree changes and notifiers
Grant Likely [Wed, 16 Jul 2014 18:48:23 +0000 (12:48 -0600)]
of: Reorder device tree changes and notifiers

Currently, devicetree reconfig notifiers get emitted before the change
is applied to the tree, but that behaviour is problematic if the
receiver wants the determine the new state of the tree. The current
users don't care, but the changeset code to follow will be making
multiple changes at once. Reorder notifiers to get emitted after the
change has been applied to the tree so that callbacks see the new tree
state.

At the same time, fixup the existing callbacks to expect the new order.
There are a few callbacks that compare the old and new values of a
changed property. Put both property pointers into the of_prop_reconfig
structure.

The current notifiers also allow the notifier callback to fail and
cancel the change to the tree, but that feature isn't actually used.
It really isn't valid to ignore a tree modification provided by firmware
anyway, so remove the ability to cancel a change to the tree.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Nathan Fontenot <nfont@austin.ibm.com>
(cherry picked from commit 259092a35c7e11f1d4616b0f5b3ba7b851fe4fa6)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Move dynamic node fixups out of powerpc and into common code
Grant Likely [Wed, 16 Jul 2014 05:25:43 +0000 (23:25 -0600)]
of: Move dynamic node fixups out of powerpc and into common code

PowerPC does an odd thing with dynamic nodes. It uses a notifier to
catch new node additions and set some of the values like name and type.
This makes no sense since that same code can be put directly into
of_attach_node(). Besides, all dynamic node users need this, not just
powerpc. Fix this problem by moving the logic out of arch/powerpc and
into drivers/of/dynamic.c.

It is also important to remove this notifier because we want to move the
firing of notifiers from before the tree is modified to after so that
the receiver gets a consistent view of the tree, but that is
incompatible with notifiers that modify the node.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Nathan Fontenot <nfont@austin.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
(cherry picked from commit a25095d451ece23b1fef34474f3230100db7aa05)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
arch/powerpc/kernel/prom.c

9 years agoof: Make sure attached nodes don't carry along extra children
Grant Likely [Wed, 16 Jul 2014 14:48:46 +0000 (08:48 -0600)]
of: Make sure attached nodes don't carry along extra children

The child pointer does not get cleared when attaching new nodes which
could cause the tree to be inconsistent. Clear the child pointer in
__of_attach_node() to be absolutely sure that the structure remains in a
consistent layout.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 6162dbe49a451f96431a23b4821f05e3bd925bc1)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Make devicetree sysfs update functions consistent.
Grant Likely [Wed, 23 Jul 2014 23:05:06 +0000 (17:05 -0600)]
of: Make devicetree sysfs update functions consistent.

All of the DT modification functions are split into two parts, the first
part manipulates the DT data structure, and the second part updates
sysfs, but the code isn't very consistent about how the second half is
called. They don't all enforce the same rules about when it is valid to
update sysfs, and there isn't any clarity on locking.

The transactional DT modification feature that is coming also needs
access to these functions so that it can perform all the structure
changes together, and then all the sysfs updates as a second stage
instead of doing each one at a time.

Fix up the second have by creating a separate __of_*_sysfs() function
for each of the helpers. The new functions have consistent naming (ie.
of_node_add() becomes __of_attach_node_sysfs()) and all of them now
defer if of_init hasn't been called yet.

Callers of the new functions must hold the of_mutex to ensure there are
no race conditions with of_init(). The mutex ensures that there will
only ever be one writer to the tree at any given time. There can still
be any number of readers and the raw_spin_lock is still used to make
sure access to the data structure is still consistent.

Finally, put the function prototypes into of_private.h so they are
accessible to the transaction code.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[grant.likely: Changed suffix from _post to _sysfs to match existing code]
[grant.likely: Reorganized to eliminate trivial wrappers]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 8a2b22a2595bf89d4396530edf8388159fad9d83)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/base.c

9 years agoof: rename of_aliases_mutex to just of_mutex
Pantelis Antoniou [Fri, 4 Jul 2014 16:58:03 +0000 (19:58 +0300)]
of: rename of_aliases_mutex to just of_mutex

We're overloading usage of of_aliases_mutex for sysfs changes,
so rename to something that is more generic.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit c05aba2bd5f9dd3f363611ff844513de1341ac60)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Create unlocked versions of node and property add/remove functions
Pantelis Antoniou [Fri, 4 Jul 2014 16:58:46 +0000 (19:58 +0300)]
of: Create unlocked versions of node and property add/remove functions

The DT overlay code will need to manipulate nodes and properties while
already holding the devicetree lock, or on nodes that are not yet
attached to the tree, but the current helper functions don't allow that.
Extract the core behaviour from the accessors and create the following
unlocked variants.

The unlocked variants require either the lock to already be held or for
the nodes to be detached from the tree. Changes to live nodes will not
get updated in sysfs, so the caller must arrange for housekeeping to
take place after dropping the lock.

The new functions are: __of_add_property(), __of_remove_property(),
__of_update_property(), __of_attach_node() and __of_detach_node().

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[Remove unnecessary diff hunks and rewrite commit text]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit d8c50088417ebf61ad8b132caad20d10f7736034)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/base.c

9 years agoof: add __of_add_property() without lock operations
Xiubo Li [Wed, 22 Jan 2014 05:57:39 +0000 (13:57 +0800)]
of: add __of_add_property() without lock operations

There two places will use the same code for adding one new property to
the DT node. Adding __of_add_property() and prepare for fixing
of_update_property()'s bug.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 62664f67775fad840cf6f68d6b5f428817bef6c5)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/base.c

9 years agoOF: Utility helper functions for dynamic nodes
Pantelis Antoniou [Fri, 4 Jul 2014 16:58:47 +0000 (19:58 +0300)]
OF: Utility helper functions for dynamic nodes

Introduce helper functions for working with the live DT tree,
all of them related to dynamically adding/removing nodes and
properties.

__of_prop_dup() copies a property dynamically
__of_node_alloc() creates an empty node

Bug fix about prop->len == 0 by Ionut Nicu <ioan.nicu.ext@nsn.com>

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
[glikely: Added unittest for of_copy_property and dropped fine-grained allocations]
[glikely: removed name, type and phandle arguments from __of_node_alloc]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 698433963b98d6de7b102c242805c99fda4fa1fb)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/selftest.c

9 years agoof: Move CONFIG_OF_DYNAMIC code into a separate file
Grant Likely [Thu, 26 Jun 2014 14:40:48 +0000 (15:40 +0100)]
of: Move CONFIG_OF_DYNAMIC code into a separate file

Split the dynamic device tree code into a separate file to make it
really clear what features CONFIF_OF_DYNAMIC add to the kernel. Without
CONFIG_OF_DYNAMIC only properties can be changed, and notifiers do not
get sent. Enabling it turns on reference counting, notifiers and the
ability to add and remove nodes.

v2: Moved of_node_release() into dynamic.c

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Rob Herring <robh+dt@kernel.org>
(cherry picked from commit 6afc0dc381573559251de9a8259404f49e6aed14)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/Makefile
drivers/of/base.c

9 years agoof: Introduce device tree node flag helpers.
Pantelis Antoniou [Fri, 8 Nov 2013 15:03:56 +0000 (17:03 +0200)]
of: Introduce device tree node flag helpers.

Helper functions for working with device node flags.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 588453c69dace39351129a038dd2796608f74bb3)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: device_node kobject lifecycle fixes
Pantelis Antoniou [Fri, 13 Dec 2013 18:08:59 +0000 (20:08 +0200)]
of: device_node kobject lifecycle fixes

After the move to having device nodes be proper kobjects the lifecycle
of the node needs to be controlled better.

At first convert of_add_node() in the unflattened functions to
of_init_node() which initializes the kobject so that of_node_get/put
work correctly even before of_init is called.

Afterwards introduce of_node_is_initialized & of_node_is_attached that
query the underlying kobject about the state (attached means kobj
is visible in sysfs)

Using that make sure the lifecycle of the tree is correct at all
times.

Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
[grant.likely: moved of_node_init() calls, fixed up locking, and
               dropped __of_populate() hunks]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 0829f6d1f69e4f2fae4062987ae6531a9af1a2e3)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: remove /proc/device-tree
Grant Likely [Tue, 6 Nov 2012 21:03:27 +0000 (21:03 +0000)]
of: remove /proc/device-tree

The same data is now available in sysfs, so we can remove the code
that exports it in /proc and replace it with a symlink to the sysfs
version.

Tested on versatile qemu model and mpc5200 eval board. More testing
would be appreciated.

v5: Fixed up conflicts with mainline changes

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
(cherry picked from commit 8357041a69b368991d1b04d9f1d297f8d71e1314)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
drivers/of/base.c
fs/proc/proc_devtree.c
include/linux/of.h

9 years agoof: add functions to count number of elements in a property
Heiko Stuebner [Wed, 12 Feb 2014 00:00:34 +0000 (01:00 +0100)]
of: add functions to count number of elements in a property

The need to know the number of array elements in a property is
a common pattern. To prevent duplication of open-coded implementations
add a helper static function that also centralises strict sanity
checking and DTB format details, as well as a set of wrapper functions
for u8, u16, u32 and u64.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit ad54a0cfbeb4bd4033d09017557ccbc423f9d5ff)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agofs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware exists.
Dave Jones [Thu, 23 Jan 2014 23:55:43 +0000 (15:55 -0800)]
fs/proc/proc_devtree.c: remove empty /proc/device-tree when no openfirmware exists.

Distribution kernels might want to build in support for /proc/device-tree
for kernels that might end up running on hardware that doesn't support
openfirmware.  This results in an empty /proc/device-tree existing.
Remove it if the OFW root node doesn't exist.

This situation actually confuses grub2, resulting in install failures.
grub2 sees the /proc/device-tree and picks the wrong install target cf.
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/annotate/4300/util/grub-install.in#L311
grub should be more robust, but still, leaving an empty proc dir seems
pointless.

Addresses https://bugzilla.redhat.com/show_bug.cgi?id=818378.

Signed-off-by: Dave Jones <davej@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit c1d867a54d426b45da017fbe8e585f8a3064ce8d)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Make device nodes kobjects so they show up in sysfs
Grant Likely [Thu, 20 Feb 2014 18:02:11 +0000 (18:02 +0000)]
of: Make device nodes kobjects so they show up in sysfs

Device tree nodes are already treated as objects, and we already want to
expose them to userspace which is done using the /proc filesystem today.
Right now the kernel has to do a lot of work to keep the /proc view in
sync with the in-kernel representation. If device_nodes are switched to
be kobjects then the device tree code can be a whole lot simpler. It
also turns out that switching to using /sysfs from /proc results in
smaller code and data size, and the userspace ABI won't change if
/proc/device-tree symlinks to /sys/firmware/devicetree/base.

v7: Add missing sysfs_bin_attr_init()
v6: Add __of_add_property() early init fixes from Pantelis
v5: Rename firmware/ofw to firmware/devicetree
    Fix updating property values in sysfs
v4: Fixed build error on Powerpc
    Fixed handling of dynamic nodes on powerpc
v3: Fixed handling of duplicate attribute and child node names
v2: switch to using sysfs bin_attributes which solve the problem of
    reporting incorrect property size.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
(cherry picked from commit 75b57ecf9d1d1e17d099ab13b8f48e6e038676be)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
arch/powerpc/platforms/pseries/dlpar.c

9 years agoMerge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk
Mark Brown [Mon, 16 Feb 2015 03:51:52 +0000 (12:51 +0900)]
Merge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk

Conflicts:
drivers/of/base.c
drivers/of/fdt.c

9 years agoof/irq: Pass trigger type in IRQ resource flags
Tomasz Figa [Sat, 28 Sep 2013 17:52:51 +0000 (19:52 +0200)]
of/irq: Pass trigger type in IRQ resource flags

Some drivers might rely on availability of trigger flags in IRQ
resource, for example to configure the hardware for particular interrupt
type. However current code creating IRQ resources from data in device
tree does not configure trigger flags in resulting resources.

This patch tries to solve the problem, based on the fact that
irq_of_parse_and_map() configures the trigger based on DT interrupt
specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*,
and we can get correct trigger flags by calling irqd_get_trigger_type()
after mapping the interrupt.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
[grant.likely: Merged the two assignments to r->flags]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 4a43d686fe336cc0e955c4400ba4d3fcff788786)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Fix dereferencing node name in debug output to be safe
Grant Likely [Thu, 19 Sep 2013 16:01:52 +0000 (11:01 -0500)]
of: Fix dereferencing node name in debug output to be safe

Several locations in the of_address and of_irq code dereference the
full_name parameter from a device_node pointer without checking if the
pointer is valid.  This patch switches to use of_node_full_name() which
always checks the pointer.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 8804827b305dbc1c6e24f2b36f1df4a9856b80e8)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/fdt: Remove duplicate memory clearing on FDT unflattening
Grant Likely [Wed, 28 Aug 2013 20:24:17 +0000 (21:24 +0100)]
of/fdt: Remove duplicate memory clearing on FDT unflattening

Patch 9e4012752, "of: fdt: fix memory initialization for expanded DT"
fixed incomplete clearing of memory when unflattening the device tree.
However the code was already clearing some of the memory, it just wasn't
doing so for all allocations. Now that the memory is cleared right at
the point of allocation, the memset after unflatten_dt_alloc() is
redundant. Remove it.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Acked-by: Wladislav Wiebe <wladislav.kw@gmail.com>
(cherry picked from commit 92d31610aac907c046f0e9c0f888c30415f20936)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: call __of_parse_phandle_with_args from of_parse_phandle
Stephen Warren [Wed, 14 Aug 2013 21:27:11 +0000 (15:27 -0600)]
of: call __of_parse_phandle_with_args from of_parse_phandle

The simplest case of __of_parse_phandle_with_args() now implements the
semantics of of_parse_phandle(). Rewrite of_parse_phandle() to call
__of_parse_phandle_with_args() rather than open-coding the simple case.

Optimize __of_parse_phandle_with_args() so that it doesn't call
of_find_node_by_phandle() except when it's strictly needed. This avoids
introducing too much overhead when replacing of_parse_phandle().

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 91d9942c28ee691dab47185f38b052f84db4e0f7)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: introduce of_parse_phandle_with_fixed_args
Stephen Warren [Wed, 14 Aug 2013 21:27:10 +0000 (15:27 -0600)]
of: introduce of_parse_phandle_with_fixed_args

This is identical to of_parse_phandle_with_args(), except that the
number of argument cells is fixed, rather than being parsed out of the
node referenced by each phandle.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 035fd9482274bf43858b00e0ff95179af66df8e8)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: move of_parse_phandle()
Stephen Warren [Wed, 14 Aug 2013 21:27:09 +0000 (15:27 -0600)]
of: move of_parse_phandle()

Move of_parse_phandle() after __of_parse_phandle_with_args(), since a
future patch will call __of_parse_phandle_with_args() from
of_parse_phandle(). Moving the function avoids adding a prototype. Doing
the move separately highlights the code changes separately.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 5fba49e3a8c22a7bb71c3526ec32b373b3ef32b8)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: move documentation of of_parse_phandle_with_args
Stephen Warren [Wed, 14 Aug 2013 21:27:08 +0000 (15:27 -0600)]
of: move documentation of of_parse_phandle_with_args

Commit bd69f73 "of: Create function for counting number of phandles in
a property" renamed of_parse_phandle_with_args(), and created a wrapper
function that implemented the original name. However, the documentation
of the original function was not moved, leaving it apparently documenting
the newly renamed function.

Move the documentation so that it is adjacent to the function it
documents.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit eded9dd40b1e30215ab7379dc433f3d3c662ec88)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: fdt: fix memory initialization for expanded DT
Wladislav Wiebe [Mon, 12 Aug 2013 11:06:53 +0000 (13:06 +0200)]
of: fdt: fix memory initialization for expanded DT

Already existing property flags are filled wrong for properties created from
initial FDT. This could cause problems if this DYNAMIC device-tree functions
are used later, i.e. properties are attached/detached/replaced. Simply dumping
flags from the running system show, that some initial static (not allocated via
kzmalloc()) nodes are marked as dynamic.

I putted some debug extensions to property_proc_show(..) :
..
+       if (OF_IS_DYNAMIC(pp))
+               pr_err("DEBUG: xxx : OF_IS_DYNAMIC\n");
+       if (OF_IS_DETACHED(pp))
+               pr_err("DEBUG: xxx : OF_IS_DETACHED\n");

when you operate on the nodes (e.g.: ~$ cat /proc/device-tree/*some_node*) you
will see that those flags are filled wrong, basically in most cases it will dump
a DYNAMIC or DETACHED status, which is in not true.
(BTW. this OF_IS_DETACHED is a own define for debug purposes which which just
make a test_bit(OF_DETACHED, &x->_flags)

If nodes are dynamic kernel is allowed to kfree() them. But it will crash
attempting to do so on the nodes from FDT -- they are not allocated via
kzmalloc().

Signed-off-by: Wladislav Wiebe <wladislav.kw@gmail.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@nsn.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
(cherry picked from commit 9e40127526e857fa3f29d51e83277204fbdfc6ba)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoOF: Add helper for matching against linux,stdout-path
Sascha Hauer [Mon, 5 Aug 2013 12:40:44 +0000 (14:40 +0200)]
OF: Add helper for matching against linux,stdout-path

devicetrees may have a linux,stdout-path property in the chosen
node describing the console device. This adds a helper function
to match a device against this property so a driver can call
add_preferred_console for a matching device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5c19e95216b93b0d29c6a4887e69a980edc6fc81)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof: Specify initrd location using 64-bit
Santosh Shilimkar [Mon, 1 Jul 2013 18:20:35 +0000 (14:20 -0400)]
of: Specify initrd location using 64-bit

On some PAE architectures, the entire range of physical memory could reside
outside the 32-bit limit.  These systems need the ability to specify the
initrd location using 64-bit numbers.

This patch globally modifies the early_init_dt_setup_initrd_arch() function to
use 64-bit numbers instead of the current unsigned long.

There has been quite a bit of debate about whether to use u64 or phys_addr_t.
It was concluded to stick to u64 to be consistent with rest of the device
tree code. As summarized by Geert, "The address to load the initrd is decided
by the bootloader/user and set at that point later in time. The dtb should not
be tied to the kernel you are booting"

More details on the discussion can be found here:
https://lkml.org/lkml/2013/6/20/690
https://lkml.org/lkml/2012/9/13/544

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 374d5c9964c10373ba39bbe934f4262eb87d7114)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/irq: init struct resource to 0 in of_irq_to_resource()
Sebastian Andrzej Siewior [Thu, 18 Jul 2013 10:24:10 +0000 (12:24 +0200)]
of/irq: init struct resource to 0 in of_irq_to_resource()

It almost does not matter because most users use only the ->start member
of the struct. However if this struct is passed to a platform device
which is then added via platform_device_add() then the ->parent member is
also used.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit cf9e2368655d86cd800e4d9fe65a407b39d29373)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agoof/irq: Avoid calling list_first_entry() for empty list
Axel Lin [Sun, 23 Jun 2013 07:50:07 +0000 (15:50 +0800)]
of/irq: Avoid calling list_first_entry() for empty list

list_first_entry() expects the list is not empty, we need to check if list is
empty before calling list_first_entry(). Thus use list_first_entry_or_null()
instead of list_first_entry().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit c0cdfaa0a5e7a346ac2f661f63f543cdc5f7cbbe)
Signed-off-by: Mark Brown <broonie@kernel.org>
9 years agork31xx lvds: ttl mode test ok
hjc [Sat, 14 Feb 2015 11:39:58 +0000 (19:39 +0800)]
rk31xx lvds: ttl mode test ok

Signed-off-by: hjc<hjc@rock-chips.com>
9 years agork3368 lcdc: overlay mode depend on screen color mode
hjc [Sat, 14 Feb 2015 09:56:26 +0000 (17:56 +0800)]
rk3368 lcdc: overlay mode depend on screen color mode

Signed-off-by: hjc<hjc@rock-chips.com>
9 years agocamera: oneframe v0.1.f
dalon.zhang [Sat, 14 Feb 2015 10:18:09 +0000 (18:18 +0800)]
camera: oneframe v0.1.f

9 years agork: ion: assign sg's dma_length in ion allocation if CONFIG_NEED_SG_DMA_LENGTH is set
CMY [Sat, 14 Feb 2015 10:05:01 +0000 (18:05 +0800)]
rk: ion: assign sg's dma_length in ion allocation if CONFIG_NEED_SG_DMA_LENGTH is set

9 years agoHDMI:
Zheng Yang [Sat, 14 Feb 2015 08:22:35 +0000 (16:22 +0800)]
HDMI:
1. In DVI mode, input color and output color should be RGB[0-255];
   In HDMI mode, input color should be YCbCr;
2. For MID, HDMI is default disabled.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agoARM64: dma-mapping: zero the buffer that allocate with __GFP_ZERO flags
CMY [Sat, 14 Feb 2015 08:03:06 +0000 (16:03 +0800)]
ARM64: dma-mapping: zero the buffer that allocate with __GFP_ZERO flags

9 years agohdmi: hdmiv1:
Zheng Yang [Sat, 14 Feb 2015 01:14:18 +0000 (09:14 +0800)]
hdmi: hdmiv1:
For nlpcm bitstream mode, we need to set audio
channel status nlpcm bit to 1.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agohdmi: fix set hdmi switch state error when remove hdmi.
Zheng Yang [Sat, 14 Feb 2015 00:51:54 +0000 (08:51 +0800)]
hdmi: fix set hdmi switch state error when remove hdmi.

Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
9 years agoMerge branch 'develop-3.10-next' of 10.10.10.29:rk/kernel into develop-3.10-next
zsq [Fri, 13 Feb 2015 07:22:34 +0000 (15:22 +0800)]
Merge branch 'develop-3.10-next' of 10.10.10.29:rk/kernel into develop-3.10-next

9 years agoARM64: dts: act8846: ldo5 output 3.0v
Jianqun Xu [Fri, 13 Feb 2015 01:09:41 +0000 (09:09 +0800)]
ARM64: dts: act8846: ldo5 output 3.0v

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>