aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-03-07 10:26:43 -0500
committerArnd Bergmann <arnd@arndb.de>2018-03-07 10:26:43 -0500
commit3bf5c70d06ce1d91cc73cee68bc6c4f850192cb0 (patch)
tree7d1fab0c67d26ebde22ea4c5e7eb8625f388ccf1 /include/linux
parent18b4788badeae8ed3a9bd3c240d83dffe5db8f37 (diff)
parent695eea3d2c7f3e70e852226c338d464a6251c70b (diff)
Merge tag 'omap-for-v4.17/ti-sysc-signed' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
Pull "Driver changes for ti-sysc for v4.17" from Tony Lindgren: This series of changes enables the use device tree based sysconfig data for ti-sysc driver. As we already have SmartReflex data configured, we use that as the first driver to enable. To do that in a way where SmartReflex is not probed twice, we need to prepare the SmartReflex driver before flipping dts data on for it in the last patch of the series. To avoid regressions, we are checking the passed dts data against existing platform data since we still have it available. Then after the dts files are converted, we can simply drop the related platform data at some point in the future. * tag 'omap-for-v4.17/ti-sysc-signed' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: Enable ti-sysc to use device tree data for smartreflex PM / AVS: SmartReflex: Prepare to use device tree based probing ARM: OMAP2+: Try to parse earlycon from parent too ARM: OMAP2+: Add checks for device tree based sysconfig data ARM: OMAP2+: Add functions to allocate module data from device tree bus: ti-sysc: Handle some devices in omap_device compatible way bus: ti-sysc: Add support for platform data callbacks bus: ti-sysc: Remove unnecessary debugging statements bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init bus: ti-sysc: Handle stdout-path for debug console bus: ti-sysc: Add suspend and resume handling bus: ti-sysc: Add fck clock alias for children with notifier_block ARM: OMAP2+: Prepare to pass auxdata for smartreflex
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/platform_data/ti-sysc.h50
-rw-r--r--include/linux/power/smartreflex.h10
2 files changed, 59 insertions, 1 deletions
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 1be356330b96..80ce28d40832 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -16,6 +16,10 @@ enum ti_sysc_module_type {
16 TI_SYSC_OMAP4_USB_HOST_FS, 16 TI_SYSC_OMAP4_USB_HOST_FS,
17}; 17};
18 18
19struct ti_sysc_cookie {
20 void *data;
21};
22
19/** 23/**
20 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets 24 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
21 * @midle_shift: Offset of the midle bit 25 * @midle_shift: Offset of the midle bit
@@ -41,6 +45,7 @@ struct sysc_regbits {
41 s8 emufree_shift; 45 s8 emufree_shift;
42}; 46};
43 47
48#define SYSC_QUIRK_LEGACY_IDLE BIT(8)
44#define SYSC_QUIRK_RESET_STATUS BIT(7) 49#define SYSC_QUIRK_RESET_STATUS BIT(7)
45#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6) 50#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
46#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5) 51#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
@@ -83,4 +88,49 @@ struct sysc_config {
83 u32 quirks; 88 u32 quirks;
84}; 89};
85 90
91enum sysc_registers {
92 SYSC_REVISION,
93 SYSC_SYSCONFIG,
94 SYSC_SYSSTATUS,
95 SYSC_MAX_REGS,
96};
97
98/**
99 * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
100 * @name: legacy "ti,hwmods" module name
101 * @module_pa: physical address of the interconnect target module
102 * @module_size: size of the interconnect target module
103 * @offsets: array of register offsets as listed in enum sysc_registers
104 * @nr_offsets: number of registers
105 * @cap: interconnect target module capabilities
106 * @cfg: interconnect target module configuration
107 *
108 * This data is enough to allocate a new struct omap_hwmod_class_sysconfig
109 * based on device tree data parsed by ti-sysc driver.
110 */
111struct ti_sysc_module_data {
112 const char *name;
113 u64 module_pa;
114 u32 module_size;
115 int *offsets;
116 int nr_offsets;
117 const struct sysc_capabilities *cap;
118 struct sysc_config *cfg;
119};
120
121struct device;
122
123struct ti_sysc_platform_data {
124 struct of_dev_auxdata *auxdata;
125 int (*init_module)(struct device *dev,
126 const struct ti_sysc_module_data *data,
127 struct ti_sysc_cookie *cookie);
128 int (*enable_module)(struct device *dev,
129 const struct ti_sysc_cookie *cookie);
130 int (*idle_module)(struct device *dev,
131 const struct ti_sysc_cookie *cookie);
132 int (*shutdown_module)(struct device *dev,
133 const struct ti_sysc_cookie *cookie);
134};
135
86#endif /* __TI_SYSC_DATA_H__ */ 136#endif /* __TI_SYSC_DATA_H__ */
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index d8b187c3925d..7b81dad712de 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -143,6 +143,13 @@
143#define OMAP3430_SR_ERRWEIGHT 0x04 143#define OMAP3430_SR_ERRWEIGHT 0x04
144#define OMAP3430_SR_ERRMAXLIMIT 0x02 144#define OMAP3430_SR_ERRMAXLIMIT 0x02
145 145
146enum sr_instance {
147 OMAP_SR_MPU, /* shared with iva on omap3 */
148 OMAP_SR_CORE,
149 OMAP_SR_IVA,
150 OMAP_SR_NR,
151};
152
146struct omap_sr { 153struct omap_sr {
147 char *name; 154 char *name;
148 struct list_head node; 155 struct list_head node;
@@ -207,7 +214,6 @@ struct omap_smartreflex_dev_attr {
207 const char *sensor_voltdm_name; 214 const char *sensor_voltdm_name;
208}; 215};
209 216
210#ifdef CONFIG_POWER_AVS_OMAP
211/* 217/*
212 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR. 218 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR.
213 * The smartreflex class driver should pass the class type. 219 * The smartreflex class driver should pass the class type.
@@ -290,6 +296,8 @@ struct omap_sr_data {
290 struct voltagedomain *voltdm; 296 struct voltagedomain *voltdm;
291}; 297};
292 298
299#ifdef CONFIG_POWER_AVS_OMAP
300
293/* Smartreflex module enable/disable interface */ 301/* Smartreflex module enable/disable interface */
294void omap_sr_enable(struct voltagedomain *voltdm); 302void omap_sr_enable(struct voltagedomain *voltdm);
295void omap_sr_disable(struct voltagedomain *voltdm); 303void omap_sr_disable(struct voltagedomain *voltdm);