* [PATCH 0/3] ARM: ux500: Add initial support for power domains
@ 2014-05-09 13:05 Ulf Hansson
2014-05-09 13:05 ` [PATCH 1/3] ARM: ux500: Initial " Ulf Hansson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-05-09 13:05 UTC (permalink / raw)
To: linux-arm-kernel, Linus Walleij, Alessandro Rubini, Russell King
Cc: linux-pm, Tomasz Figa, devicetree, Rafael J. Wysocki,
Kevin Hilman, Ulf Hansson
Initial support for power domains for ux500. To enable this feature we require
to use DT, thus we need to add bindings for the ux500 specific parts as well.
The implementation of the ux500 power domains is based upon the generic power
domain.
An important note, this patchset depends on Tomasz Figa patchset, which is still
in the review phase:
[PATCH v4 0/3] Generic Device Tree based power domain look-up
http://www.spinics.net/lists/kernel/msg1738549.html
I assume that patchset will be queued through Rafael's linux pm tree. Let's see
what the prefer way is for how to deal with this patchset, after that point.
Ulf Hansson (3):
ARM: ux500: Initial support for power domains
ARM: ux500: Add DT node for ux500 power domains
ARM: ux500: Add sdi[n] devices to VAPE power domain
.../devicetree/bindings/arm/ux500/power_domain.txt | 35 +++++++++
arch/arm/boot/dts/ste-dbx5x0.dtsi | 11 +++
arch/arm/mach-ux500/Kconfig | 5 ++
arch/arm/mach-ux500/Makefile | 1 +
arch/arm/mach-ux500/pm.c | 4 +
arch/arm/mach-ux500/pm_domains.c | 77 ++++++++++++++++++++
arch/arm/mach-ux500/pm_domains.h | 17 +++++
include/dt-bindings/arm/ux500_pm_domains.h | 15 ++++
8 files changed, 165 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt
create mode 100644 arch/arm/mach-ux500/pm_domains.c
create mode 100644 arch/arm/mach-ux500/pm_domains.h
create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] ARM: ux500: Initial support for power domains
2014-05-09 13:05 [PATCH 0/3] ARM: ux500: Add initial support for power domains Ulf Hansson
@ 2014-05-09 13:05 ` Ulf Hansson
2014-05-09 13:05 ` [PATCH 2/3] ARM: ux500: Add DT node for ux500 " Ulf Hansson
2014-05-09 13:05 ` [PATCH 3/3] ARM: ux500: Add sdi[n] devices to VAPE power domain Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-05-09 13:05 UTC (permalink / raw)
To: linux-arm-kernel, Linus Walleij, Alessandro Rubini, Russell King
Cc: linux-pm, Tomasz Figa, devicetree, Rafael J. Wysocki,
Kevin Hilman, Ulf Hansson
Initial support for power domains for ux500. To enable this feature we
require to use DT, thus we need to add bindings for the ux500 specific
parts as well.
The implementation of the ux500 power domains is based upon the generic
power domain.
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
.../devicetree/bindings/arm/ux500/power_domain.txt | 35 +++++++++
arch/arm/mach-ux500/Kconfig | 5 ++
arch/arm/mach-ux500/Makefile | 1 +
arch/arm/mach-ux500/pm.c | 4 +
arch/arm/mach-ux500/pm_domains.c | 77 ++++++++++++++++++++
arch/arm/mach-ux500/pm_domains.h | 17 +++++
include/dt-bindings/arm/ux500_pm_domains.h | 15 ++++
7 files changed, 154 insertions(+)
create mode 100644 Documentation/devicetree/bindings/arm/ux500/power_domain.txt
create mode 100644 arch/arm/mach-ux500/pm_domains.c
create mode 100644 arch/arm/mach-ux500/pm_domains.h
create mode 100644 include/dt-bindings/arm/ux500_pm_domains.h
diff --git a/Documentation/devicetree/bindings/arm/ux500/power_domain.txt b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
new file mode 100644
index 0000000..1c98f01
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/ux500/power_domain.txt
@@ -0,0 +1,35 @@
+* ST-Ericsson UX500 Power Domains
+
+UX500 supports multiple power domains which are used to gate power to one or
+more peripherals on the SOC.
+
+The implementation of power domains for UX500 are based upon the generic power
+domain and use the corresponding DT bindings.
+
+==Power domain providers==
+
+Required properties:
+ - compatible: Must be "stericsson,ux500-pm-domains".
+ - #power-domain-cells : Number of cells in a power domain specifier, must be 1.
+
+Example:
+ pm_domains: pm_domains0 {
+ compatible = "stericsson,ux500-pm-domains";
+ #power-domain-cells = <1>;
+ };
+
+==Power domain consumers==
+
+Required properties:
+ - power-domains: A phandle and power domain specifier. Below are the list of
+ valid specifiers:
+
+ Index Specifier
+ ----- ---------
+ 0 DOMAIN_VAPE
+
+Example:
+ sdi0_per1@80126000 {
+ compatible = "arm,pl18x", "arm,primecell";
+ power-domains = <&pm_domains DOMAIN_VAPE>
+ };
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index b41a42d..0727fa7 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -77,4 +77,9 @@ config UX500_DEBUG_UART
Choose the UART on which kernel low-level debug messages should be
output.
+config UX500_PM_DOMAINS
+ def_bool y
+ depends on PM_RUNTIME && OF
+ select PM_GENERIC_DOMAINS
+
endif
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index de544aa..0dc5d01 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -10,5 +10,6 @@ obj-$(CONFIG_MACH_MOP500) += board-mop500-sdi.o \
board-mop500-audio.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
+obj-$(CONFIG_UX500_PM_DOMAINS) += pm_domains.o
CFLAGS_hotplug.o += -march=armv7-a
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index b80a9a2..2cb587b 100644
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -17,6 +17,7 @@
#include <linux/platform_data/arm-ux500-pm.h>
#include "db8500-regs.h"
+#include "pm_domains.h"
/* ARM WFI Standby signal register */
#define PRCM_ARM_WFI_STANDBY (prcmu_base + 0x130)
@@ -191,4 +192,7 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
/* Set up ux500 suspend callbacks. */
suspend_set_ops(UX500_SUSPEND_OPS);
+
+ /* Initialize ux500 power domains */
+ ux500_pm_domains_init();
}
diff --git a/arch/arm/mach-ux500/pm_domains.c b/arch/arm/mach-ux500/pm_domains.c
new file mode 100644
index 0000000..dbc115b
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ *
+ * Implements power domains as generic power domains for ux500.
+ */
+#include <linux/printk.h>
+#include <linux/slab.h>
+#include <linux/err.h>
+#include <linux/of.h>
+#include <linux/pm_domain.h>
+
+#include <dt-bindings/arm/ux500_pm_domains.h>
+#include "pm_domains.h"
+
+static int pd_power_off(struct generic_pm_domain *domain)
+{
+ /*
+ * Handle the gating of the power domain regulator here.
+ * Drivers/subsystems operating the devices in the power domain needs
+ * to handle register context save/restore to be able to enable power
+ * domain gating/ungating.
+ */
+ return 0;
+}
+
+static int pd_power_on(struct generic_pm_domain *domain)
+{
+ /*
+ * Handle the ungating of the power domain regulator here.
+ * Drivers/subsystems operating the devices in the power domain needs
+ * to handle register context save/restore to be able to enable power
+ * domain gating/ungating.
+ */
+ return 0;
+}
+
+static struct generic_pm_domain ux500_pm_domain_vape = {
+ .name = "VAPE",
+ .power_off = pd_power_off,
+ .power_on = pd_power_on,
+};
+
+static struct generic_pm_domain *ux500_pm_domains[NR_DOMAINS] = {
+ [DOMAIN_VAPE] = &ux500_pm_domain_vape,
+};
+
+static struct of_device_id ux500_pm_domain_matches[] = {
+ { .compatible = "stericsson,ux500-pm-domains", },
+ { },
+};
+
+int __init ux500_pm_domains_init(void)
+{
+ struct device_node *np;
+ struct genpd_onecell_data *genpd_data;
+ int i;
+
+ np = of_find_matching_node(NULL, ux500_pm_domain_matches);
+ if (!np)
+ return -ENODEV;
+
+ genpd_data = kzalloc(sizeof(*genpd_data), GFP_KERNEL);
+ if (!genpd_data)
+ return -ENOMEM;
+
+ genpd_data->domain_num = ARRAY_SIZE(ux500_pm_domains);
+ genpd_data->domains = ux500_pm_domains;
+
+ for (i = 0; i < ARRAY_SIZE(ux500_pm_domains); ++i)
+ pm_genpd_init(ux500_pm_domains[i], NULL, false);
+
+ of_genpd_add_provider(np, of_genpd_xlate_onecell, genpd_data);
+ return 0;
+}
diff --git a/arch/arm/mach-ux500/pm_domains.h b/arch/arm/mach-ux500/pm_domains.h
new file mode 100644
index 0000000..057a978
--- /dev/null
+++ b/arch/arm/mach-ux500/pm_domains.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef __MACH_UX500_PM_DOMAINS_H
+#define __MACH_UX500_PM_DOMAINS_H
+
+#ifdef CONFIG_UX500_PM_DOMAINS
+extern int __init ux500_pm_domains_init(void);
+#else
+static inline int ux500_pm_domains_init(void) { return 0; }
+#endif
+
+#endif
diff --git a/include/dt-bindings/arm/ux500_pm_domains.h b/include/dt-bindings/arm/ux500_pm_domains.h
new file mode 100644
index 0000000..73cf25a
--- /dev/null
+++ b/include/dt-bindings/arm/ux500_pm_domains.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (C) 2014 Linaro Ltd.
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ * License terms: GNU General Public License (GPL) version 2
+ */
+#ifndef _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+#define _DT_BINDINGS_ARM_UX500_PM_DOMAINS_H
+
+#define DOMAIN_VAPE 0
+
+/* Number of power domains. */
+#define NR_DOMAINS (DOMAIN_VAPE + 1)
+
+#endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] ARM: ux500: Add DT node for ux500 power domains
2014-05-09 13:05 [PATCH 0/3] ARM: ux500: Add initial support for power domains Ulf Hansson
2014-05-09 13:05 ` [PATCH 1/3] ARM: ux500: Initial " Ulf Hansson
@ 2014-05-09 13:05 ` Ulf Hansson
2014-05-09 13:05 ` [PATCH 3/3] ARM: ux500: Add sdi[n] devices to VAPE power domain Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-05-09 13:05 UTC (permalink / raw)
To: linux-arm-kernel, Linus Walleij, Alessandro Rubini, Russell King
Cc: linux-pm, Tomasz Figa, devicetree, Rafael J. Wysocki,
Kevin Hilman, Ulf Hansson
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
arch/arm/boot/dts/ste-dbx5x0.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index e41eedc..29a7013 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -43,6 +43,10 @@
interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
};
+ pm_domains: pm_domains0 {
+ compatible = "stericsson,ux500-pm-domains";
+ #power-domain-cells = <1>;
+ };
clocks {
compatible = "stericsson,u8500-clks";
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] ARM: ux500: Add sdi[n] devices to VAPE power domain
2014-05-09 13:05 [PATCH 0/3] ARM: ux500: Add initial support for power domains Ulf Hansson
2014-05-09 13:05 ` [PATCH 1/3] ARM: ux500: Initial " Ulf Hansson
2014-05-09 13:05 ` [PATCH 2/3] ARM: ux500: Add DT node for ux500 " Ulf Hansson
@ 2014-05-09 13:05 ` Ulf Hansson
2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-05-09 13:05 UTC (permalink / raw)
To: linux-arm-kernel, Linus Walleij, Alessandro Rubini, Russell King
Cc: linux-pm, Tomasz Figa, devicetree, Rafael J. Wysocki,
Kevin Hilman, Ulf Hansson
Cc: Tomasz Figa <tomasz.figa@gmail.com>
Cc: devicetree@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
arch/arm/boot/dts/ste-dbx5x0.dtsi | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index 29a7013..630690b 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -11,6 +11,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/mfd/dbx500-prcmu.h>
+#include <dt-bindings/arm/ux500_pm_domains.h>
#include "skeleton.dtsi"
/ {
@@ -840,6 +841,7 @@
clocks = <&prcc_kclk 1 5>, <&prcc_pclk 1 5>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
@@ -855,6 +857,7 @@
clocks = <&prcc_kclk 2 4>, <&prcc_pclk 2 6>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
@@ -870,6 +873,7 @@
clocks = <&prcc_kclk 3 4>, <&prcc_pclk 3 4>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
@@ -881,6 +885,7 @@
clocks = <&prcc_kclk 2 5>, <&prcc_pclk 2 7>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
@@ -896,6 +901,7 @@
clocks = <&prcc_kclk 2 2>, <&prcc_pclk 2 4>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
@@ -907,6 +913,7 @@
clocks = <&prcc_kclk 3 7>, <&prcc_pclk 3 7>;
clock-names = "sdi", "apb_pclk";
+ power-domains = <&pm_domains DOMAIN_VAPE>;
status = "disabled";
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-09 13:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 13:05 [PATCH 0/3] ARM: ux500: Add initial support for power domains Ulf Hansson
2014-05-09 13:05 ` [PATCH 1/3] ARM: ux500: Initial " Ulf Hansson
2014-05-09 13:05 ` [PATCH 2/3] ARM: ux500: Add DT node for ux500 " Ulf Hansson
2014-05-09 13:05 ` [PATCH 3/3] ARM: ux500: Add sdi[n] devices to VAPE power domain Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).