-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'imx-soc-3.19' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/shawnguo/linux into next/soc Pull "The i.MX SoC update for 3.19" from Shawn Guo - Update i.MX6 suspend code to check DDR instead of CPU type, as the difference we need to handle is between LPDDR2 and DDR3, not SoCs. - Set anatop properly for LPDDR2 in DSM mode - Add support for new SoC LS1021A which integrates dual Cortex-A7 - Add ENET initialization for i.MX6SX platform - Add cpufreq support for i.MX53 platform - Add a SNVS based poweroff driver for i.MX6 platforms - Use ARM Global Timer as clocksource on VF610 Note: the change set is built on top of tag imx-fixes-3.18-2 to resolve a conflict on file arch/arm/mach-imx/clk-vf610.c. * tag 'imx-soc-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: power: reset: imx-snvs-poweroff: add power off driver for i.mx6 ARM: imx: temporarily remove CONFIG_SOC_FSL from LS1021A ARM: imx: clk-vf610: get input clocks from assigned clocks ARM: imx: Add Freescale LS1021A SMP support ARM: imx: Add initial support for Freescale LS1021A ARM: imx53: add cpufreq support ARM: imx53: clk: add ARM clock ARM: imx: add CPU clock type ARM: imx5: add step clock, used when reprogramming PLL1 ARM: imx: add enet init for i.mx6sx ARM: imx6sx: add imx6sx iomux-gpr field define ARM: vf610: Add ARM Global Timer clocksource option ARM: imx: add anatop settings for LPDDR2 when enter DSM mode ARM: imx: replace cpu type check with ddr type check ARM: imx: Fix the removal of CONFIG_SPI option ARM: imx: clk-vf610: define PLL's clock tree Signed-off-by; Arnd Bergmann <arnd@arndb.de>
- Loading branch information
Showing
25 changed files
with
611 additions
and
75 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Documentation/devicetree/bindings/power_supply/imx-snvs-poweroff.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
i.mx6 Poweroff Driver | ||
|
||
SNVS_LPCR in SNVS module can power off the whole system by pull | ||
PMIC_ON_REQ low if PMIC_ON_REQ is connected with external PMIC. | ||
If you don't want to use PMIC_ON_REQ as power on/off control, | ||
please set status='disabled' to disable this driver. | ||
|
||
Required Properties: | ||
-compatible: "fsl,sec-v4.0-poweroff" | ||
-reg: Specifies the physical address of the SNVS_LPCR register | ||
|
||
Example: | ||
snvs@020cc000 { | ||
compatible = "fsl,sec-v4.0-mon", "simple-bus"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
ranges = <0 0x020cc000 0x4000>; | ||
..... | ||
snvs_poweroff: snvs-poweroff@38 { | ||
compatible = "fsl,sec-v4.0-poweroff"; | ||
reg = <0x38 0x4>; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright (c) 2014 Lucas Stach <l.stach@pengutronix.de>, Pengutronix | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* http://www.opensource.org/licenses/gpl-license.html | ||
* http://www.gnu.org/copyleft/gpl.html | ||
*/ | ||
|
||
#include <linux/clk.h> | ||
#include <linux/clk-provider.h> | ||
#include <linux/slab.h> | ||
|
||
struct clk_cpu { | ||
struct clk_hw hw; | ||
struct clk *div; | ||
struct clk *mux; | ||
struct clk *pll; | ||
struct clk *step; | ||
}; | ||
|
||
static inline struct clk_cpu *to_clk_cpu(struct clk_hw *hw) | ||
{ | ||
return container_of(hw, struct clk_cpu, hw); | ||
} | ||
|
||
static unsigned long clk_cpu_recalc_rate(struct clk_hw *hw, | ||
unsigned long parent_rate) | ||
{ | ||
struct clk_cpu *cpu = to_clk_cpu(hw); | ||
|
||
return clk_get_rate(cpu->div); | ||
} | ||
|
||
static long clk_cpu_round_rate(struct clk_hw *hw, unsigned long rate, | ||
unsigned long *prate) | ||
{ | ||
struct clk_cpu *cpu = to_clk_cpu(hw); | ||
|
||
return clk_round_rate(cpu->pll, rate); | ||
} | ||
|
||
static int clk_cpu_set_rate(struct clk_hw *hw, unsigned long rate, | ||
unsigned long parent_rate) | ||
{ | ||
struct clk_cpu *cpu = to_clk_cpu(hw); | ||
int ret; | ||
|
||
/* switch to PLL bypass clock */ | ||
ret = clk_set_parent(cpu->mux, cpu->step); | ||
if (ret) | ||
return ret; | ||
|
||
/* reprogram PLL */ | ||
ret = clk_set_rate(cpu->pll, rate); | ||
if (ret) { | ||
clk_set_parent(cpu->mux, cpu->pll); | ||
return ret; | ||
} | ||
/* switch back to PLL clock */ | ||
clk_set_parent(cpu->mux, cpu->pll); | ||
|
||
/* Ensure the divider is what we expect */ | ||
clk_set_rate(cpu->div, rate); | ||
|
||
return 0; | ||
} | ||
|
||
static const struct clk_ops clk_cpu_ops = { | ||
.recalc_rate = clk_cpu_recalc_rate, | ||
.round_rate = clk_cpu_round_rate, | ||
.set_rate = clk_cpu_set_rate, | ||
}; | ||
|
||
struct clk *imx_clk_cpu(const char *name, const char *parent_name, | ||
struct clk *div, struct clk *mux, struct clk *pll, | ||
struct clk *step) | ||
{ | ||
struct clk_cpu *cpu; | ||
struct clk *clk; | ||
struct clk_init_data init; | ||
|
||
cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); | ||
if (!cpu) | ||
return ERR_PTR(-ENOMEM); | ||
|
||
cpu->div = div; | ||
cpu->mux = mux; | ||
cpu->pll = pll; | ||
cpu->step = step; | ||
|
||
init.name = name; | ||
init.ops = &clk_cpu_ops; | ||
init.flags = 0; | ||
init.parent_names = &parent_name; | ||
init.num_parents = 1; | ||
|
||
cpu->hw.init = &init; | ||
|
||
clk = clk_register(NULL, &cpu->hw); | ||
if (IS_ERR(clk)) | ||
kfree(cpu); | ||
|
||
return clk; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.