]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
11 years agoENGR00273073-3 ARM: imx_v6_v7_defconfig: run save defconfig
Anson Huang [Wed, 31 Jul 2013 14:43:35 +0000 (10:43 -0400)]
ENGR00273073-3 ARM: imx_v6_v7_defconfig: run save defconfig

Run make ARCH=arm savedefconfig on imx_v6_v7_defconfig to
clean up some unnecessary/unrelated items, so that next
time when we run savedefconfig, we only see related changes.
No functional changes.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273073-2 cpufreq: add interactive governor for cpufreq
Anson Huang [Tue, 30 Jul 2013 18:29:26 +0000 (14:29 -0400)]
ENGR00273073-2 cpufreq: add interactive governor for cpufreq

cpufreq: interactive: New 'interactive' governor

This governor is designed for latency-sensitive workloads, such as
interactive user interfaces.  The interactive governor aims to be
significantly more responsive to ramp CPU quickly up when CPU-intensive
activity begins.

Existing governors sample CPU load at a particular rate, typically
every X ms.  This can lead to under-powering UI threads for the period of
time during which the user begins interacting with a previously-idle system
until the next sample period happens.

The 'interactive' governor uses a different approach. Instead of sampling
the CPU at a specified rate, the governor will check whether to scale the
CPU frequency up soon after coming out of idle.  When the CPU comes out of
idle, a timer is configured to fire within 1-2 ticks.  If the CPU is very
busy from exiting idle to when the timer fires then we assume the CPU is
underpowered and ramp to MAX speed.

If the CPU was not sufficiently busy to immediately ramp to MAX speed, then
the governor evaluates the CPU load since the last speed adjustment,
choosing the highest value between that longer-term load or the short-term
load since idle exit to determine the CPU speed to ramp to.

A realtime thread is used for scaling up, giving the remaining tasks the
CPU performance benefit, unlike existing governors which are more likely to
schedule rampup work to occur after your performance starved tasks have
completed.

The tuneables for this governor are:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_time:
    The minimum amount of time to spend at the current frequency before
    ramping down. This is to ensure that the governor has seen enough
    historic CPU load data to determine the appropriate workload.
/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    The CPU load at which to ramp to max speed.

Signed-off-by: Mike Chan <mike at android.com>
Signed-off-by: Todd Poynor <toddpoynor at google.com>
Signed-off-by: Allen Martin <amartin at nvidia.com> (submitted improvements)
Signed-off-by: Axel Haslam <axelhaslam at ti.com> (submitted improvements)
Signed-off-by: Anton Vorontsov <anton.vorontsov at linaro.org>
Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00273073-1 arm: add cpu idle notification callback
Anson Huang [Tue, 30 Jul 2013 18:25:23 +0000 (14:25 -0400)]
ENGR00273073-1 arm: add cpu idle notification callback

Some modules may need to know cpu idle status and take
actions before and after cpu idle, so we can add
notification callback when enter/exit cpu idle, then
modules only need to register this notification callback,
everytime cpu enter/exit idle, the callback chain will be
executed.

Currently only cpufreq interactive governor use this
notification, as it wants to save power, the timers of
interactive governor are only enabled when cpu is not in idle.

Signed-off-by: Anson Huang <b20788@freescale.com>
11 years agoENGR00268508 backlight:Correct the setting for bd props.fb_blank
Liu Ying [Tue, 25 Jun 2013 09:13:33 +0000 (17:13 +0800)]
ENGR00268508 backlight:Correct the setting for bd props.fb_blank

The patch of "ENGR00264855 backlight: Support backlight shared by
multiple fbs" doesn't consider that bd->props.fb_blank could be
shared by several framebuffers which use the same backlight device.
This causes the pwm backlight wrongly check the fb blank status.
This patch corrects the setting for the fb blank status by
considering all the framebuffers in question to fix the issue.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 68b97d114629f22f64b3d8c14d0a0b7d07d6ebb2)

11 years agoENGR00264855 backlight: Support backlight shared by multiple fbs
Liu Ying [Thu, 30 May 2013 05:56:17 +0000 (13:56 +0800)]
ENGR00264855 backlight: Support backlight shared by multiple fbs

One backlight device may shared by multiple framebuffers.
We don't hope blanking one of the framebuffers may turn the
backlight off for all the other framebuffers, since they are
likely active to show display content. This patch adds logic
to record each framebuffer's backlight usage to determine the
backlight device use count and whether the backlight should be
turned on or off.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 37cbf741e4dff1f757f3ade6bb861d9a2af70693)

11 years agoENGR00272973-4 ARM: imx_v6_v7_defconfig: enable PWM and bl options
Liu Ying [Mon, 29 Jul 2013 10:56:24 +0000 (18:56 +0800)]
ENGR00272973-4 ARM: imx_v6_v7_defconfig: enable PWM and bl options

This patch enables some necessary options for PWM backlight support.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-3 ARM: dts: imx: enable pwm bl for mx6 sabresd
Liu Ying [Mon, 29 Jul 2013 10:49:57 +0000 (18:49 +0800)]
ENGR00272973-3 ARM: dts: imx: enable pwm bl for mx6 sabresd

This patch enables pwm backlight support on pwm1 in mx6
sabresd dts.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-2 ARM: dts: imx: enable pwm1 for mx6 sabresd
Liu Ying [Mon, 29 Jul 2013 10:44:29 +0000 (18:44 +0800)]
ENGR00272973-2 ARM: dts: imx: enable pwm1 for mx6 sabresd

This patch enables pwm1 on pin SD1_DAT3 as display
pwm backlight controller in mx6 sabresd dts.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00272973-1 ARM: dts: imx6qdl: rename pwm0 pinctrl
Liu Ying [Tue, 30 Jul 2013 01:53:21 +0000 (09:53 +0800)]
ENGR00272973-1 ARM: dts: imx6qdl: rename pwm0 pinctrl

This patch renames pwm0 pinctrl to pwm1 to avoid confusion
on the first pwm module's name.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
11 years agoENGR00269945: ARM: imx: enable SATA support in defconfig
Shawn Guo [Thu, 25 Jul 2013 06:56:34 +0000 (14:56 +0800)]
ENGR00269945: ARM: imx: enable SATA support in defconfig

Enable SATA support in imx_v6_v7_defconfig.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: enable ahci sata on imx6q platforms
Richard Zhu [Tue, 16 Jul 2013 03:28:46 +0000 (11:28 +0800)]
ARM: dtsi: enable ahci sata on imx6q platforms

Only imx6q has the ahci sata controller, enable
it on imx6q platforms.

Signed-off-by: Richard Zhu <r65037@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoahci_imx: add ahci sata support on imx platforms
Richard Zhu [Wed, 24 Jul 2013 06:15:29 +0000 (14:15 +0800)]
ahci_imx: add ahci sata support on imx platforms

imx6q contains one Synopsys AHCI SATA controller, But it can't share
ahci_platform driver with other controllers because there are some
misalignments of the generic AHCI controller - the bits definitions of
the HBA registers, the Vendor Specific registers, the AHCI PHY clock
and the AHCI signals adjustment window(GPR13 register).

 - CAP_SSS(bit20) of the HOST_CAP is writable, default value is '0',
   should be configured to be '1'

 - bit0 (only one AHCI SATA port on imx6q) of the HOST_PORTS_IMPL
   should be set to be '1'.(default 0)

 - One Vendor Specific register HOST_TIMER1MS(offset:0xe0) should be
   configured regarding to the frequency of AHB bus clock.

 - Configurations of the AHCI PHY clock, and the signal parameters of
   the GPR13

Setup its own ahci sata driver, contained the imx6q specific
initialized codes, re-use the generic ahci_platform driver, and keep
the generic ahci_platform driver clean as much as possible.

tj: patch description reformatted

Signed-off-by: Richard Zhu <r65037@freescale.com>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: update the sata bits definitions of gpr13
Richard Zhu [Wed, 24 Jul 2013 06:15:28 +0000 (14:15 +0800)]
ARM: imx6q: update the sata bits definitions of gpr13

Replace the SATA_PHY_# by the more readable definitons.

tj: Being routed through libata branch to enable implementation of
    ahci_imx.

Signed-off-by: Richard Zhu <r65037@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx: enable IPU and display support in defconfig
Shawn Guo [Tue, 23 Jul 2013 14:49:06 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx: enable IPU and display support in defconfig

It disables DRM_IMX which is the community support of IPU/display, and
enables our internal version of IPU and display (LDB and LCD) support.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: dts: enable LDB and LCD support for imx6qdl-sabresd
Shawn Guo [Tue, 23 Jul 2013 14:49:05 +0000 (22:49 +0800)]
ENGR00240987: ARM: dts: enable LDB and LCD support for imx6qdl-sabresd

This is a fast-forward porting of LDB and LCD DTS changes from 3.5.7
kernel.

Along with the changes, the "&ldb" node gets removed from imx6q.dtsi,
since it's only used by community kernel and will conflict with our
internal LDB bindings.

While adding alias for ipu in imx6qdl.dtsi, it also sorts all those
aliases alphabetically.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx: select SRAM for ARCH_MXC
Shawn Guo [Tue, 23 Jul 2013 14:49:04 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx: select SRAM for ARCH_MXC

Most of IMX SoCs have IRAM/SRAM integrated for audio/video uses, so
let's select SRAM to build in the generic on-chip SRAM driver support.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx6q: initialize clocks for IPU
Shawn Guo [Tue, 23 Jul 2013 14:49:03 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx6q: initialize clocks for IPU

This is a fast-forward porting from 3.5.7 kernel.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ARM: imx6q: add vdoa gate clock
Shawn Guo [Tue, 23 Jul 2013 14:49:02 +0000 (22:49 +0800)]
ENGR00240987: ARM: imx6q: add vdoa gate clock

Add the missing vdoa gate clock for imx6q.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: video: port LDB and LCD FB display drivers from 3.5.7 kernel
Shawn Guo [Tue, 23 Jul 2013 14:49:01 +0000 (22:49 +0800)]
ENGR00240987: video: port LDB and LCD FB display drivers from 3.5.7 kernel

This is a fast-forward porting of LDB and LCD frame buffer drivers from
3.5.7 kernel to kernel 3.10.  The change set is kept as minimum as
possible with only making necessary code changes, which are mostly for
solving compile problems.

 * Remove <mach/*> inclusions
 * Drop __devinit and __devexit
 * Drop vm flag VM_RESERVED
 * Protect ldb_setup() with #ifndef MODULE to fix "warning: ‘ldb_setup’
   defined but not used" in module build
 * Remove fb_prepare_logo() and fb_show_logo() calls, because it breaks
   module build, and penguin logo works fine without the calls in
   mxc_ipuv3_fb.c

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00240987: ipu: port ipuv3 driver from 3.5.7 kernel
Shawn Guo [Tue, 23 Jul 2013 14:49:00 +0000 (22:49 +0800)]
ENGR00240987: ipu: port ipuv3 driver from 3.5.7 kernel

This is a fast-forward porting of ipuv3 driver from 3.5.7 kernel to
kernel 3.10.  The change set is kept as minimum as possible with only
making necessary code changes to adapt 3.10 kernel internal API and
framework updates.  Everything else should be same as 3.5.7 one.  The
change set consists of the following.

 * Remove unused Kconfig options MXC_IPU_V3D, MXC_IPU_V3EX and
   MXC_IPU_V3H
 * Comment out busfreq calls
 * Move ipu-v3.h into include/linux/, and remove all <mach/*> includes
 * Drop __devinit and __devexit
 * Remove assignment of pltfm_data->pg = imx6q_ipu_pg;
 * Use generic device_reset() API rather than ipu_pltfm_data->init()
   hook to reset IPU
 * Includes <linux/sched/rt.h> ipu_device.c to fix undeclared
   MAX_USER_RT_PRIO error
 * Change compatible string to "fsl,imx6q-ipu" to align with community
   kernel
 * Define irq_sync before irq_err in DTS to align with community kernel
 * Drop "ipu1_" and "ipu2_" from clock names to save the handling of the
   second parameter of devm_clk_get()
 * Remove the buggy csi_clk setup in ipu_clk_setup_enable() and validate
   the clock before operate on it in ipu_csi_enable_mclk()
 * Replace iram API (linux/iram_alloc.h) with generic memory pool API
   (linux/genalloc.h) in VDOA driver

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: ocram size is different between imx6q and imx6dl
Shawn Guo [Tue, 23 Jul 2013 14:48:59 +0000 (22:48 +0800)]
ARM: dts: imx: ocram size is different between imx6q and imx6dl

The ocram on imx6q is 256 KiB while on imx6dl it's 128 KiB.  Let's
have separate node for imx6q and imx6dl.  It also changes imx6q size
0x3f000 to 0x40000 to match the hardware.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add sram for imx53 and imx6q
Philipp Zabel [Tue, 23 Jul 2013 14:48:58 +0000 (22:48 +0800)]
ARM: dts: add sram for imx53 and imx6q

This patch enables the On-Chip SRAM (OCRAM) on i.MX53 and i.MX6 SoCs.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: ARM: imx: enable cpufreq and thermal support in defconfig
Shawn Guo [Thu, 18 Jul 2013 13:05:33 +0000 (21:05 +0800)]
ENGR00269945: ARM: imx: enable cpufreq and thermal support in defconfig

Enable cpufreq and thermal support in defconfig, so that cpufreq can be
used as the cpu_cooling device to throttle CPUs when passive trip point
gets crossed.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: add tempmon node for imx6q thermal support
Shawn Guo [Tue, 4 Jun 2013 07:14:06 +0000 (15:14 +0800)]
ARM: dts: imx: add tempmon node for imx6q thermal support

Mark ocotp as a syscon node and add tempmon for imx6q thermal support.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agothermal: add imx thermal driver support
Shawn Guo [Mon, 24 Jun 2013 06:30:44 +0000 (14:30 +0800)]
thermal: add imx thermal driver support

This is based on the initial imx thermal work done by
Rob Lee <rob.lee@linaro.org> (Not sure if the email address is still
valid).  Since he is no longer interested in the work and I have
rewritten a significant amount of the code, I just took the authorship
over from him.

It adds the imx thermal support using Temperature Monitor (TEMPMON)
block found on some Freescale i.MX SoCs.  The driver uses syscon regmap
interface to access TEMPMON control registers and calibration data, and
supports cpufreq as the cooling device.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agothermal: cpu_cooling: fix 'descend' check in get_property()
Shawn Guo [Tue, 28 May 2013 06:22:32 +0000 (06:22 +0000)]
thermal: cpu_cooling: fix 'descend' check in get_property()

Commit 24c7a381720843f17efb42de81f7e85aefd6f616 upstream.

The variable 'descend' is initialized as -1 in function get_property(),
and will never get any chance to be updated by the following code.

if (freq != CPUFREQ_ENTRY_INVALID && descend != -1)
descend = !!(freq > table[i].frequency);

This makes function get_property() return the wrong frequency for given
cooling level if the frequency table is sorted in ascending.  Fix it
by correcting the 'descend' check in if-condition to 'descend == -1'.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: remove board specific CLKO setup
Shawn Guo [Thu, 18 Jul 2013 06:42:28 +0000 (14:42 +0800)]
ARM: imx6q: remove board specific CLKO setup

The CLKO is widely used by imx6q board designs to clock audio codec.
Since most codecs accept 24 MHz frequency, let's initially set up CLKO
with OSC24M (cko <-- cko2 <-- osc).  Then those board specific CLKO
setup for audio codec can be removed.

The board dts files also need an update on cko reference in codec node.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add the missing cko output selection
Shawn Guo [Thu, 18 Jul 2013 05:35:40 +0000 (13:35 +0800)]
ARM: imx6q: add the missing cko output selection

The clock output on imx6q CCM_CLKO1 pad is not always cko1 clock, and
there is a multiplexer to select between cko1 and cko2.  Add this
missing selection as the clock cko.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add cko2 clocks
Shawn Guo [Thu, 18 Jul 2013 05:16:40 +0000 (13:16 +0800)]
ARM: imx6q: add cko2 clocks

It adds the missing cko2 clocks, including multiplexer, divider and
gate.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: add spdif gate clock
Shawn Guo [Thu, 18 Jul 2013 05:08:20 +0000 (13:08 +0800)]
ARM: imx6q: add spdif gate clock

It adds the missing spdif gate clock into imx6q clock driver.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: add ethernet phy fixup for KSZ9031
Sascha Hauer [Thu, 20 Jun 2013 15:34:33 +0000 (17:34 +0200)]
ARM: i.MX6: add ethernet phy fixup for KSZ9031

The KSZ9031 is used on the i.MX6 based Data Modul eDM-QMX6
board. It needs the same fixup to the rx/tx delays as other
i.MX6 boards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: add ethernet phy fixup for AR8031
Sascha Hauer [Thu, 20 Jun 2013 15:34:32 +0000 (17:34 +0200)]
ARM: i.MX6: add ethernet phy fixup for AR8031

The AR8031 is used on the i.MX6 based sabreSD, sabreauto and wandboard.
All need the same fixup, so add it for all i.MX6.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards
Sascha Hauer [Thu, 20 Jun 2013 15:34:31 +0000 (17:34 +0200)]
ARM: i.MX6: call ksz9021 phy fixup for all i.MX6 boards

In current U-Boot the sabrelite, nitrogen6x and titanium all need
the same fixup for the ksz9021 phy. Instead of limiting the fixup
to a single board apply them for all.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default
Nicolin Chen [Thu, 13 Jun 2013 11:51:04 +0000 (19:51 +0800)]
ARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default

Commit 42914fdde5bcda9f9118f20456d2c22300cda645 upstream.

Enable imx-wm8962 and PM_RUNTIME, essential for WM8962 CODEC driver.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Enable WM8962 audio support
Nicolin Chen [Fri, 14 Jun 2013 05:22:46 +0000 (13:22 +0800)]
ARM: dtsi: imx6qdl-sabresd: Enable WM8962 audio support

Commit 77b38fc36c5dc6f99d1db0a3c216724e53e5e257 upstream.

Enable WM8962 ALSA machine driver via devicetree.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Enable SSI2 and AUDMUX
Nicolin Chen [Fri, 14 Jun 2013 05:19:57 +0000 (13:19 +0800)]
ARM: dtsi: imx6qdl-sabresd: Enable SSI2 and AUDMUX

Commit 48828700188f4b054e94ac08994bc5874e77a2c5 upstream.

Enable SSI2 and its pin configuration in AUDMUX.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: Add WM8962 CODEC support
Nicolin Chen [Thu, 13 Jun 2013 11:51:01 +0000 (19:51 +0800)]
ARM: dtsi: imx6qdl-sabresd: Add WM8962 CODEC support

Commit 20426febe6026ba251afcb5bb7b32ac72837bde2 upstream.

Add WM8962 CODEC support and enable its parent I2C bus.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dtsi: imx6qdl-sabresd: add a fixed regulator for WM8962
Nicolin Chen [Thu, 13 Jun 2013 11:51:00 +0000 (19:51 +0800)]
ARM: dtsi: imx6qdl-sabresd: add a fixed regulator for WM8962

Commit fdbfb43b39e7876fba7048ab930c4c72e7ec2561 upstream.

On Sabre SD, system controls WM8962 power by pulling up/down GPIO_4_10,
so add a regulator controled by GPIO_4_10 for WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6qdl-sabresd: add clko1 iomux configuration
Nicolin Chen [Thu, 13 Jun 2013 11:50:57 +0000 (19:50 +0800)]
ARM: dts: imx6qdl-sabresd: add clko1 iomux configuration

Commit 521b43d41cd41ac8763603a7b923703d5d368bc9 upstream.

Setting GPIO_0 pad as clko1 clock output to provide MCLK for WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd
Nicolin Chen [Thu, 13 Jun 2013 11:50:56 +0000 (19:50 +0800)]
ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd

Commit e7eccc7e16acfcc3e613e7c0df7e62528d24581c upstream.

WM8962 needs 24MHz clock for its MCLK, so choose PLL4 as the parent of clko1.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: add imx-wm8962 machine driver
Nicolin Chen [Mon, 10 Jun 2013 18:43:30 +0000 (02:43 +0800)]
ASoC: fsl: add imx-wm8962 machine driver

Commit 8de2ae2a7f1fd71dc56d6b014029f93093e9c5d5 upstream.

This is the initial imx-wm8962 device-tree-only machine driver working with
fsl_ssi driver. More features can be added on top of it later.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Enable start-up and normal bias after reset in runtime resume
Nicolin Chen [Fri, 14 Jun 2013 11:49:06 +0000 (19:49 +0800)]
ASoC: wm8962: Enable start-up and normal bias after reset in runtime resume

Commit f5055f93733730b61a8a69dedbb216e6b4dd84c5 upstream.

This part of bias settings are essential for WM8962 to power up. Without it
"wm8962 0-001a: DC servo timed out" might be prompted due to power-up failure
that happens to FLL if being used.

The driver's also bringing the bias down in the suspend path so it needs to be
powered up in the resume path for symmetry.

According to dapm_pre_sequence_async(), DAPM would call pm_runtime_get_sync()
to let driver finish the bias settings in pm_runtime_resume() before the bias
level being set to STANDBY. So no need to worry about disordered settings for
VMID of WM8962.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Restore device state after reset in runtime resume
Mark Brown [Fri, 7 Jun 2013 15:19:58 +0000 (16:19 +0100)]
ASoC: wm8962: Restore device state after reset in runtime resume

Commit 9c24b1672283644adf871244771ebf387dd73f90 upstream.

After the device has been reset we need to repeat the same
initialisation we do on probe to make sure that the device is in
a known state.

Tested-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: wm8962: Add device tree binding
Nicolin Chen [Fri, 7 Jun 2013 03:23:27 +0000 (11:23 +0800)]
ASoC: wm8962: Add device tree binding

Commit d74e9e7090aeb9b61e683e5abf7ca70fa18f846b upstream.

Document the device tree binding for the WM8962 codec, and modify the
driver to extract platform data from the device tree, if present.

Based on work of WM8903 by Stephen Warren <swarren@nvidia.com>

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: WM8962: Create default platform data structure
Nicolin Chen [Thu, 6 Jun 2013 11:38:45 +0000 (19:38 +0800)]
ASoC: WM8962: Create default platform data structure

Commit e75a52c6723a61a0d768ee53794e86b7edbe54f0 upstream.

Embed a copy of struct wm8962_pdata in stuct wm8962_priv
so that there's no need to check validity of pdata any more.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: firwmare: imx: add imx6q sdma script
Shawn Guo [Tue, 16 Jul 2013 14:53:18 +0000 (22:53 +0800)]
ENGR00269945: firwmare: imx: add imx6q sdma script

Add imx6q sdma script which will be used by all i.MX6 series.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: remove old DMA binding data from gpmi node
Shawn Guo [Tue, 16 Jul 2013 09:13:00 +0000 (17:13 +0800)]
ARM: dts: imx: remove old DMA binding data from gpmi node

After mxs-dma driver adopts generic DMA device tree binding, gpmi
channel interrupt number is defined in DMA controller node, and
channel ID is listed in "dmas" property.  So the DMA channel interrupt
number in gpmi node "interrupts" property and fsl,gpmi-dma-channel which
are used by old customized DMA binding can be removed now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: use generic DMA bindings for SSI nodes
Shawn Guo [Wed, 24 Apr 2013 04:35:53 +0000 (12:35 +0800)]
ARM: dts: imx: use generic DMA bindings for SSI nodes

Updates SSI nodes to adopt generic DMA bindings.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6qdl/imx6sl: add the dma property for uart
Huang Shijie [Fri, 12 Jul 2013 10:02:09 +0000 (18:02 +0800)]
ARM: dts: imx6qdl/imx6sl: add the dma property for uart

Add the dma property for all the uart.

Note: Add the dma property does not mean we enable the dma for this
uart.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: add #dma-cells property for sdma
Huang Shijie [Tue, 2 Jul 2013 02:15:29 +0000 (10:15 +0800)]
ARM: dts: imx: add #dma-cells property for sdma

Add the #dma-cells property for all the sdma in all the imx platforms.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: move fsl_ssi to generic DMA DT bindings
Shawn Guo [Thu, 25 Apr 2013 14:37:08 +0000 (22:37 +0800)]
ASoC: fsl: move fsl_ssi to generic DMA DT bindings

It removes the temporary custom DMA bindings from fsl_ssi driver and use
the generic one instead.  It leaves imx-ssi drive unchanged regarding
those pcm flags by updating imx_pcm_dma_init() to let SSI driver decide
the flags.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: remove imx-pcm driver
Shawn Guo [Thu, 25 Apr 2013 03:18:50 +0000 (11:18 +0800)]
ASoC: fsl: remove imx-pcm driver

Commit dbdf6b54340e1671439a4a5efbd15b7a0b14eacb upstream.

With imx-pcm-dma moving to generic dmaengine pcm driver and the removal
of imx-pcm-audio/imx-fiq-pcm-audio platform device use, now imx-pcm
driver contains a few functions that are only used by imx-pcm-fiq.c.
Move these functions into imx-pcm-fiq.c and remove imx-pcm.c completely.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: remove use of imx-fiq-pcm-audio from imx-ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:49 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-fiq-pcm-audio from imx-ssi

Commit 2bf9d4bbd0fa97ff6f214484f62fc8aca64d1d00 upstream.

Rather than instantiating imx-fiq-pcm-audio to call imx_pcm_fiq_init(),
imx-ssi can just directly call it to save the use of imx-fiq-pcm-audio.
With this change, imx-ssi becomes not only a cpu DAI but also a platform
device, so updates platform device setup in eukrea-tlv320, phycore-ac97
and wm1133-ev1 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: create function imx_pcm_fiq_exit()
Shawn Guo [Thu, 25 Apr 2013 03:18:48 +0000 (11:18 +0800)]
ASoC: fsl: create function imx_pcm_fiq_exit()

Commit 88e89f5548a6e19bf837633f622764f2d1531748 upstream.

Create function imx_pcm_fiq_exit() to be paired with imx_pcm_fiq_init()
just like the pair of imx_pcm_dma_init() and imx_pcm_dma_exit().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: remove use of imx-pcm-audio from imx-ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:47 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-pcm-audio from imx-ssi

Commit 3b7d46380beae3de4a0f03ba4dcbd509c97ab503 upstream.

Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
imx-ssi can just directly call it to save the use of imx-pcm-audio.
With this change, imx-ssi becomes not only a cpu DAI but also a
platform device, so updates platform device setup in imx-mc13783 and
mx27vis-aic32x4 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoASoC: fsl: remove use of imx-pcm-audio from fsl_ssi
Shawn Guo [Thu, 25 Apr 2013 03:18:46 +0000 (11:18 +0800)]
ASoC: fsl: remove use of imx-pcm-audio from fsl_ssi

Commit bd41bc9696b5631b2c2fe26f40c8cdd99b3aeb3e upstream.

Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
fsl_ssi can just directly call it to save the use of imx-pcm-audio.
With this change, fsl_ssi becomes not only a cpu DAI but also a platform
device, so updates platform device setup in imx-sgtl5000 accordingly.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agodma: imx-sdma: move to generic device tree bindings
Shawn Guo [Thu, 30 May 2013 14:23:32 +0000 (22:23 +0800)]
dma: imx-sdma: move to generic device tree bindings

Commit 9479e17c9bb455c01b369d294e01de8fa9b0a8d3 upstream.

Update imx-sdma driver to adopt generic DMA device tree bindings.  It
calls of_dma_controller_register() with imx-sdma specific of_dma_xlate
to get the generic DMA device tree helper support.  The #dma-cells for
imx-sdma must be 3, which includes request ID, peripheral type and
priority.

The existing way of requesting channel, clients directly call
dma_request_channel(), still work there, and will be removed after
all imx-sdma clients get converted to generic DMA device tree helper.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: ARM: imx: add CONFIG_GPIO_PCA953X into defconfig
Shawn Guo [Sun, 14 Jul 2013 14:41:23 +0000 (22:41 +0800)]
ENGR00269945: ARM: imx: add CONFIG_GPIO_PCA953X into defconfig

CONFIG_GPIO_PCA953X enables driver support for MAX7310 which is used on
imx6qdl-sabreauto board for IO expanders.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: ARM: dts: add uart3 support for imx6qdl-sabreauto
Shawn Guo [Sun, 14 Jul 2013 14:21:53 +0000 (22:21 +0800)]
ENGR00269945: ARM: dts: add uart3 support for imx6qdl-sabreauto

On imx6qdl-sabreauto board, the pin function UART3_CTS is steered by the
GPIO4 of MAX7310 Expander B, while UART3_RXD and UART3_TXD are steered
by GPIO3 of MAX7310 Expander C.  And both GPIOs need to be pulled high
to assert UART3 on the board.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6qdl: add a new pinctrl for uart3
Huang Shijie [Fri, 12 Jul 2013 07:56:11 +0000 (15:56 +0800)]
ARM: dts: imx6qdl: add a new pinctrl for uart3

Add the a new pinctrl for uart3. In the imx6q{dl}-sabreauto boards,
the uart3 is used for Bluetooth.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agoENGR00269945: ARM: dts: add max7310 support for imx6qdl-sabreauto
Shawn Guo [Sun, 14 Jul 2013 14:17:16 +0000 (22:17 +0800)]
ENGR00269945: ARM: dts: add max7310 support for imx6qdl-sabreauto

On imx6qdl-sabreauto board, there are three IO expanders implemented by
max7310, which are all controlled by I2C3.  And GPIO5_4 is steering the
I2C3_SDA availability, while GPIO1_15 is used to reset max7310.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: pinctrl: support pinctrl setting assertion via gpios
Shawn Guo [Mon, 15 Jul 2013 08:31:53 +0000 (16:31 +0800)]
ENGR00269945: pinctrl: support pinctrl setting assertion via gpios

It's pretty common that on some reference design or validation boards,
one pin could be used by two devices on board, and the pin route is
controlled by a GPIO.  So to assert the pin for given device, not only
the pinmux controller in SoC needs to be set up properly but also the
GPIO needs to be pulled up/down.

The patch adds support of a device tree property "pinctrl-assert-gpios"
under client device node.  It plays pretty much like a board level pin
multiplexer, and steers the pin route by controlling the GPIOs.  When
client device has the property represent in its node, pinctrl device
tree mapping function will firstly pull up/down the GPIOs to assert the
pins for the device at board level.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: gpio: pca953x: add device_reset() call
Shawn Guo [Sun, 14 Jul 2013 13:52:38 +0000 (21:52 +0800)]
ENGR00269945: gpio: pca953x: add device_reset() call

The pca953x type of devices, e.g. max7310, may have a reset which needs
to be handled to get the device start working.  Add a device_reset()
call for that, and defer the probe if the reset controller for that is
not ready yet.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: select ARCH_HAS_RESET_CONTROLLER for IMX
Shawn Guo [Sun, 14 Jul 2013 13:39:35 +0000 (21:39 +0800)]
ENGR00269945: select ARCH_HAS_RESET_CONTROLLER for IMX

Move ARCH_HAS_RESET_CONTROLLER from HAVE_IMX_SRC to ARCH_MXC to have it
selected for the whole IMX family instead of SRC (System Reset
Controller), since GPIO could be another reset controller in many cases.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: reset: add dummy device_reset() for !CONFIG_RESET_CONTROLLER build
Shawn Guo [Sun, 14 Jul 2013 13:35:49 +0000 (21:35 +0800)]
ENGR00269945: reset: add dummy device_reset() for !CONFIG_RESET_CONTROLLER build

Add dummy device_reset() function for !CONFIG_RESET_CONTROLLER build,
so that we do not have to add #ifdef CONFIG_RESET_CONTROLLER in every
single client device drivers that call the function.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: reset: build in CONFIG_RESET_GPIO by default
Shawn Guo [Sun, 14 Jul 2013 13:10:37 +0000 (21:10 +0800)]
ENGR00269945: reset: build in CONFIG_RESET_GPIO by default

GPIO is widely used as the reset control for various devices.  Let's
build the support in by default.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: reset: register gpio-reset driver in arch_initcall
Shawn Guo [Sun, 14 Jul 2013 12:41:00 +0000 (20:41 +0800)]
ENGR00269945: reset: register gpio-reset driver in arch_initcall

It's a little bit late to register gpio-reset driver at module_init
time, because gpio-reset provides reset control via gpio for other
devices which are mostly probed at module_init time too.  And it
becomes even worse, when the gpio comes from IO expander on I2C bus,
e.g. pca953x.  In that case, gpio-reset needs to be ready before I2C
bus driver which is generally ready at subsys_initcall time.  Let's
register gpio-reset driver in arch_initcall() to have it ready early
enough.

The defer probe mechanism is not used here, because a reset controller
driver should be reasonably registered early than other devices.  More
importantly, defer probe doe not help in some nasty cases, e.g. the
gpio-pca953x device itself needs a reset from gpio-reset driver start
working.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: reset: handle cansleep case in gpio-reset
Shawn Guo [Sun, 14 Jul 2013 12:28:05 +0000 (20:28 +0800)]
ENGR00269945: reset: handle cansleep case in gpio-reset

Some gpio reset may be backed by a gpio that can sleep, e.g. pca953x
gpio output.  For such gpio, gpio_set_value_cansleep() should be
called.  Otherwise, the WARN_ON(chip->can_sleep) in gpiod_set_value()
will be hit.  Add a gpio_cansleep() check to handle cansleep gpio.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoreset: Add driver for gpio-controlled reset pins
Philipp Zabel [Thu, 30 May 2013 09:09:00 +0000 (11:09 +0200)]
reset: Add driver for gpio-controlled reset pins

This driver implements a reset controller device that toggle a gpio
connected to a reset pin of a peripheral IC. The delay between assertion
and de-assertion of the reset signal can be configured via device tree.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add more imx6q/dl pin groups
Shawn Guo [Fri, 12 Jul 2013 03:38:50 +0000 (11:38 +0800)]
ARM: dts: add more imx6q/dl pin groups

Add more imx6q/dl pin groups for those supported boards, e.g. sabresd,
sabreauto, arm2.

IPU2 pin groups are added into imx6q.dtsi, since the block is only
available on imx6q.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx: share pad macro names between imx6q and imx6dl
Shawn Guo [Fri, 12 Jul 2013 01:07:14 +0000 (09:07 +0800)]
ARM: dts: imx: share pad macro names between imx6q and imx6dl

The imx6q and imx6dl are two pin-to-pin compatible SoCs.  The same board
design can work with either chip plugged into the socket, e.g. sabresd
and sabreauto boards.

We currently define pin groups in imx6q.dtsi and imx6dl.dtsi
respectively because the pad macro names are different between two
chips.  This brings a maintenance burden on having the same label point
to the same pin group defined in two places.

The patch replaces prefix MX6Q_ and MX6DL_ with MX6QDL_ for both SoCs
pad macro names.  Then the pin groups becomes completely common between
imx6q and imx6dl and can just be moved into imx6qdl.dtsi, so that the
long term maintenance of imx6q/dt pin settings becomes easier.

Unfortunately, the change brings some dramatic diff stat, but it's all
about DTS file, and the ultimate net diff stat is good.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add more pin groups for imx6q/dl
Shawn Guo [Wed, 10 Jul 2013 03:06:17 +0000 (11:06 +0800)]
ARM: dts: add more pin groups for imx6q/dl

The patch adds pin groups that are already defined by community kernel,
so that both kernels can align on the pin group label names.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: imx6q{dl}: add DTE pads for uart
Shawn Guo [Mon, 8 Jul 2013 09:14:20 +0000 (17:14 +0800)]
ARM: dts: imx6q{dl}: add DTE pads for uart

The uart2 in the imx6q-arm2 board is used as a DTE uart,
this patch adds the necessary DTE pads for uart2.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
11 years agommc: sdhci: improve card removal check in sdhci_card_event()
Shawn Guo [Sun, 9 Jun 2013 11:49:24 +0000 (19:49 +0800)]
mmc: sdhci: improve card removal check in sdhci_card_event()

Commit 9668d765eab78d58e656177db2acb57c249b9c01 upstream.

The following error randomly appears on an imx6q board where gpio is
used to implement card-detection when mounting EXT4 rootfs during boot.

mmc1: Card removed during transfer!
mmc1: Resetting controller.
mmcblk0: unknown error -123 sending read/write command, card status 0x900
end_request: I/O error, dev mmcblk0, sector 106744
EXT4-fs error (device mmcblk0p2): ext4_find_entry:1312: inode #5011: comm swapper/0: reading directory lblock 0

It turns out that the error message comes from the card removal check
in function sdhci_card_event().  While we have a well implemented
function sdhci_do_get_cd() handling all the possible cases of
CD, the current code only checks controller internal CD case.  That
causes problem for other CD cases like gpio on above imx6q board.

Improve the check by using sdhci_do_get_cd() to cover all possible CD
cases, so that above error on the imx6q board gets fixed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: Select MIGHT_HAVE_CACHE_L2X0
Fabio Estevam [Wed, 10 Jul 2013 15:30:16 +0000 (12:30 -0300)]
ARM: imx: Select MIGHT_HAVE_CACHE_L2X0

Select MIGHT_HAVE_CACHE_L2X0 for armv6 and armv7 i.MX SoCs.

By selecting MIGHT_HAVE_CACHE_L2X0, the user still has the possibility to
disable CACHE_L2X0 selection via menuconfig.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: fix imx_init_l2cache storage class
Vincent Stehlé [Wed, 10 Jul 2013 09:45:46 +0000 (11:45 +0200)]
ARM: imx: fix imx_init_l2cache storage class

This fixes the following compilation error:

  arch/arm/mach-imx/system.c:101:123: error: static declaration of
    ‘imx_init_l2cache’ follows non-static declaration
  In file included from arch/arm/mach-imx/system.c:32:0:
  arch/arm/mach-imx/common.h:165:13: note: previous declaration of
    ‘imx_init_l2cache’ was here
  arch/arm/mach-imx/system.c:101:123: warning: ‘imx_init_l2cache’ defined but
    not used [-Wunused-function]

Signed-off-by: Vincent Stehlé <vincent.stehle@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: fix vf610 enet module clock selection
Shawn Guo [Wed, 10 Jul 2013 06:05:44 +0000 (14:05 +0800)]
ARM: imx: fix vf610 enet module clock selection

The fec/enet driver calculates MDC rate with the formula below.

  ref_freq / ((MII_SPEED + 1) x 2)

The ref_freq here is the fec internal module clock, which is missing
from clk-vf610 clock driver right now.  And clk-vf610 driver mistakenly
supplies RMII clock (50 MHz) as the source to fec.  This results in the
situation that fec driver gets ref_freq as 50 MHz, while physically it
runs at 66 MHz (fec module clock physically sources from ipg which runs
at 66 MHz).  That's why software expects MDC runs at 2.5 MHz, while the
measurement tells it runs at 3.3 MHz.  And this causes the PHY KSZ8041
keeps swithing between Full and Half mode as below.

  libphy: 400d0000.etherne:00 - Link is Up - 100/Full
  libphy: 400d0000.etherne:00 - Link is Up - 100/Half
  libphy: 400d0000.etherne:00 - Link is Up - 100/Full
  libphy: 400d0000.etherne:00 - Link is Up - 100/Half
  libphy: 400d0000.etherne:00 - Link is Up - 100/Full
  libphy: 400d0000.etherne:00 - Link is Up - 100/Half

Add the missing module clock for ENET0 and ENET1, and correct the clock
supplying in device tree to fix above issue.

Thanks to Alison Wang <b18965@freescale.com> for debugging the issue.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6: change some clocks to fixup clocks
Liu Ying [Thu, 4 Jul 2013 09:57:17 +0000 (17:57 +0800)]
ARM: imx6: change some clocks to fixup clocks

All the clocks controlled by the register 'CCM Serial Clock
Multiplexer Register 1' should be fixup clocks. This patch
changes those clocks from basic multiplexer or divider clocks
to fixup clocks.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: add common clock support for fixup mux
Liu Ying [Thu, 4 Jul 2013 09:35:46 +0000 (17:35 +0800)]
ARM: imx: add common clock support for fixup mux

One register may have several fields to control some clocks. It
is possible that the read/write values of some fields may map to
different real functional values, so writing to the other fields
in the same register may break a working clock tree. A real case
is the aclk_podf field in the register 'CCM Serial Clock Multiplexer
Register 1' of i.MX6Q/SDL SoC. This patch introduces a fixup hook
for multiplexer clock which is called before writing a value to
clock registers to support this kind of multiplexer clocks.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: add common clock support for fixup div
Liu Ying [Thu, 4 Jul 2013 09:22:26 +0000 (17:22 +0800)]
ARM: imx: add common clock support for fixup div

One register may have several fields to control some clocks. It
is possible that the read/write values of some fields may map to
different real functional values, so writing to the other fields
in the same register may break a working clock tree. A real case
is the aclk_podf field in the register 'CCM Serial Clock Multiplexer
Register 1' of i.MX6Q/SDL SoC. This patch introduces a fixup hook
for divider clock which is called before writing a value to clock
registers to support this kind of divider clocks.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: use imx specific L2 init function on imx6sl
Shawn Guo [Mon, 8 Jul 2013 13:52:33 +0000 (21:52 +0800)]
ARM: imx: use imx specific L2 init function on imx6sl

The optimized L2 prefect and power setting done in imx_init_l2cache()
can also benefit imx6sl, so let's call the function on imx6sl as well.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: let L2 initialization be a common function
Shawn Guo [Mon, 8 Jul 2013 13:45:20 +0000 (21:45 +0800)]
ARM: imx: let L2 initialization be a common function

Move imx6q L2 initialization function imx6q_init_l2cache() into
system.c, and rename it imx_init_l2cache(), so that other platforms
other than imx6q can also use the function.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: add i.MX6 specific L2 cache configuration
Dirk Behme [Fri, 26 Apr 2013 08:13:56 +0000 (10:13 +0200)]
ARM: i.MX6: add i.MX6 specific L2 cache configuration

Commit b3a9c315378ff811bf34393f2f0a6e8b9ffced3b upstream.

To improve the performance and power consumption add an i.MX6
specific L2 cache initialization.

This configuration is taken from Freescale's kernel patch

"ENGR00153601 [MX6]Adjust L2 cache parameter" [1]

with two additional improvements:

a) The L2X0_POWER_CTRL has only the two bits we set. So no need
   to read the register before. Remove the register read done
   in Freescale's patch.

b) In the L2X0_PREFETCH_CTRL register, besides the double linefill (bit[30]),
   additionally enable the instruction and data prefetch (bit[29-28]).

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
[1] http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/arch/arm/mach-mx6/mm.c?h=imx_3.0.35_12.09.01&id=814656410b40c67a10b25300e51b0477b2bb96d1

11 years agoARM: dts: i.MX6: configure L2 cache data and tag latency
Dirk Behme [Fri, 26 Apr 2013 08:13:55 +0000 (10:13 +0200)]
ARM: dts: i.MX6: configure L2 cache data and tag latency

Commit 5a5ca56e057d206db13461b84a7da3a3543e1206 upstream.

Configure the data and tag latency for the L2 cache. This improves the
system performance.

This configuration is taken from Freescale's kernel patch

"ENGR00153601 [MX6]Adjust L2 cache parameter" [1]

which does

writel(0x132, IO_ADDRESS(L2_BASE_ADDR + L2X0_TAG_LATENCY_CTRL));
writel(0x132, IO_ADDRESS(L2_BASE_ADDR + L2X0_DATA_LATENCY_CTRL));

In this patch we are doing the same via the device tree.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
[1] http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/arch/arm/mach-mx6/mm.c?h=imx_3.0.35_12.09.01&id=814656410b40c67a10b25300e51b0477b2bb96d1

11 years agoARM i.MX6DL: parent LDB DI clocks to PLL5 on i.MX6S/DL
Philipp Zabel [Fri, 28 Jun 2013 12:24:15 +0000 (14:24 +0200)]
ARM i.MX6DL: parent LDB DI clocks to PLL5 on i.MX6S/DL

i.MX6S/DL have the Video PLL post dividers fixed already in revision 1.0

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx6q: clk: add the eim_slow clock
Huang Shijie [Fri, 17 May 2013 09:15:23 +0000 (17:15 +0800)]
ARM: imx6q: clk: add the eim_slow clock

Commit 9545b2ed68eef1541219d5c6351c10e698a24f39 upstream.

Add the eim_slow clock, since the weim needs it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: clk: add different DualLite MLB clock config
Dirk Behme [Sat, 18 May 2013 07:25:28 +0000 (09:25 +0200)]
ARM: i.MX6: clk: add different DualLite MLB clock config

Commit fbcb441217dd2bce00e892fd5b2a481c2249f1a4 upstream.

The CCM_CBCMR register (address 0x02C4018) has different meaning
between the i.MX6 Quad/Dual and the i.MX6 Solo/DualLite.

Compared to the i.MX6 Quad/Dual, the CCM_CBCMR register in the
i.MX6 Solo/DualLite reuses the gpu2d_core bits for the MLB clock
configuration.

Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: disable pll8_mlb in mx6q_clks
Jiada Wang [Fri, 17 May 2013 08:40:44 +0000 (17:40 +0900)]
ARM: imx: disable pll8_mlb in mx6q_clks

Commit 7f96d2d4d86377df04c8856b8fd47b0ad58c98aa upstream.

The MLB PLL clock's operation doesn't fit for clock framework and
it should be handled internally in MLB driver.
Remove initialization of pll8_mlb clock device but leave its
declaration in mx6q_clks to avoid affecting imx6q clock numbering.

[ shawn.guo: The MLB PLL is currently implemented as an imx pllv3
  clock.  But it does not really make too much sense, because the PLL
  does not have ENABLE, POWERDOWN and DIV_SELECT bits.

  Also commit 0e57446 (ARM i.MX6: correct MLB clock configuration)
  already removes the incorrect parenting on MLB PLL, now it's safe
  and reasonable to remove the PLL completely from clock framework,
  and let MLB driver handle the PLL per its particular need. ]

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
CC: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: i.MX6: clk: add i.MX6 DualLite differences
Dirk Behme [Fri, 3 May 2013 09:08:45 +0000 (11:08 +0200)]
ARM: i.MX6: clk: add i.MX6 DualLite differences

Commit 2e603ad98460fd0efab71e618d49a2ffc9aef67b upstream.

The CCM_CBCMR register (address 0x02C4018) has different meaning
between the i.MX6 Quad/Dual and the i.MX6 Solo/DualLite.

Compared to the i.MX6 Quad/Dual, the CCM_CBCMR register in the
i.MX6 Solo/DualLite doesn't have a gpu3d_shader configuration and
moves the gpu2_core configuration at that place.

Handle these i.MX6 Quad/Dual vs. i.MX6 Solo/DualLite clock differences
by using cpu_is_mx6dl().

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoENGR00269945: ARM: imx: enable Vybrid build in defconfig
Shawn Guo [Mon, 8 Jul 2013 07:24:26 +0000 (15:24 +0800)]
ENGR00269945: ARM: imx: enable Vybrid build in defconfig

Enable Vybrid build with serial console support in defconfig.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: add low-level debug for Vybrid
Shawn Guo [Sun, 12 May 2013 09:22:17 +0000 (17:22 +0800)]
ARM: imx: add low-level debug for Vybrid

Add low-level debug support for Vybrid, so that earlyprintk can be
enabled for debugging early boot issue.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoserial: fsl_lpuart: restore UARTCR2 after watermark setup is done
Shawn Guo [Mon, 8 Jul 2013 07:05:31 +0000 (15:05 +0800)]
serial: fsl_lpuart: restore UARTCR2 after watermark setup is done

Function lpuart_setup_watermark() clears some bits in register UARTCR2
before writing FIFO configuration registers as required by hardware.
But it should restore UARTCR2 after that.  Otherwise, we end up changing
UARTCR2 register when setting up watermark, and that is not really
desirable.  At least, when low-level debug and earlyprint is enabled,
serial console is broken due to it.

Fix the problem by restoring UARTCR2 register at the end of function
lpuart_setup_watermark().

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add initial VF610 Tower board dts support
Jingchang Lu [Tue, 28 May 2013 09:12:23 +0000 (17:12 +0800)]
ARM: dts: add initial VF610 Tower board dts support

Commit e77b74ee6c4115a0fe1fdb673dbf25ffe1277205 upstream.

Add initial Freescale Vybrid VF610 Tower board support
with uart and fec enabled.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: dts: add SoC level device tree source for VF610
Jingchang Lu [Tue, 28 May 2013 09:12:22 +0000 (17:12 +0800)]
ARM: dts: add SoC level device tree source for VF610

Commit d02e13495d3a0e686c00990bc1d688336bdfe2bb upstream.

Add SoC level device tree source for Freescale Vybrid VF610.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: add initial support for VF610
Jingchang Lu [Tue, 28 May 2013 09:12:21 +0000 (17:12 +0800)]
ARM: imx: add initial support for VF610

Commit 5be913c6824e1957e03ae432b60717c21f2c53d1 upstream.

Add initial support for Freescale Vybrid VF610 SoC.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoARM: imx: add VF610 clock support
Jingchang Lu [Tue, 28 May 2013 09:12:20 +0000 (17:12 +0800)]
ARM: imx: add VF610 clock support

Commit 1f2c5fd5f0486566f73aa0149577d5f69df90bcc upstream.

Add clock support for Vybrid VF610. It uses dtc macro support to
define all clock IDs in vf610-clock.h to keep clock IDs coherence
between kernel and DT.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agopinctrl: add VF610 pinctrl driver
Jingchang Lu [Tue, 28 May 2013 09:32:08 +0000 (17:32 +0800)]
pinctrl: add VF610 pinctrl driver

Commit 78bafc66180d42f972b443b0b573a1b6ff9aa522 upstream.

Adds Freescale Vybrid VF610 pin controller
driver to IMX common pinctrl driver framework.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agopinctrl: imx: add VF610 support to imx pinctrl framework
Jingchang Lu [Tue, 28 May 2013 09:32:07 +0000 (17:32 +0800)]
pinctrl: imx: add VF610 support to imx pinctrl framework

Commit bf5a530971afbe959348af4d84d17636108e6abf upstream.

On some platforms such as VF610, offset of mux and pad ctrl register
may be zero, and the mux_mode and config_val are in one 32-bit register.
This patch adds support to imx core pinctrl framework to handle these
cases.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agotty: serial: add Freescale lpuart driver support
Jingchang Lu [Fri, 7 Jun 2013 01:20:40 +0000 (09:20 +0800)]
tty: serial: add Freescale lpuart driver support

Commit c9e2e946fb0ba5d2398feb89558f98c5c28e23e3 upstream.

Add Freescale lpuart driver support. The lpuart device
can be found on Vybrid VF610 and Layerscape LS-1 SoCs.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
11 years agoclocksource: Add Freescale Vybrid pit timer support
Jingchang Lu [Wed, 29 May 2013 08:12:17 +0000 (10:12 +0200)]
clocksource: Add Freescale Vybrid pit timer support

Commit c19672492d233e0012b60fbfa460ffac1381ee26 upstream.

Add Freescale Vybrid Family period interrupt timer support.

Signed-off-by: Jingchang Lu <b35083@freescale.com>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>