aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c4
-rw-r--r--arch/arm/mach-omap2/omap_device.c5
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c418
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h7
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c54
-rw-r--r--arch/arm/mach-omap2/sr_device.c27
-rw-r--r--drivers/bus/ti-sysc.c526
-rw-r--r--drivers/power/avs/smartreflex.c41
-rw-r--r--include/linux/platform_data/ti-sysc.h50
-rw-r--r--include/linux/power/smartreflex.h10
10 files changed, 1086 insertions, 56 deletions
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 20f25539d572..75bc18646df6 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -566,11 +566,11 @@ static int n8x0_menelaus_late_init(struct device *dev)
566} 566}
567#endif 567#endif
568 568
569struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { 569struct menelaus_platform_data n8x0_menelaus_platform_data = {
570 .late_init = n8x0_menelaus_late_init, 570 .late_init = n8x0_menelaus_late_init,
571}; 571};
572 572
573struct aic3x_pdata n810_aic33_data __initdata = { 573struct aic3x_pdata n810_aic33_data = {
574 .gpio_reset = 118, 574 .gpio_reset = 118,
575}; 575};
576 576
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index f0388058b7da..3b829a50d1db 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -140,6 +140,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
140 struct omap_device *od; 140 struct omap_device *od;
141 struct omap_hwmod *oh; 141 struct omap_hwmod *oh;
142 struct device_node *node = pdev->dev.of_node; 142 struct device_node *node = pdev->dev.of_node;
143 struct resource res;
143 const char *oh_name; 144 const char *oh_name;
144 int oh_cnt, i, ret = 0; 145 int oh_cnt, i, ret = 0;
145 bool device_active = false; 146 bool device_active = false;
@@ -150,6 +151,10 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
150 return -ENODEV; 151 return -ENODEV;
151 } 152 }
152 153
154 /* Use ti-sysc driver instead of omap_device? */
155 if (!omap_hwmod_parse_module_range(NULL, node, &res))
156 return -ENODEV;
157
153 hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); 158 hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL);
154 if (!hwmods) { 159 if (!hwmods) {
155 ret = -ENOMEM; 160 ret = -ENOMEM;
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 34156eca8e23..e7d23e200ecc 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -145,6 +145,8 @@
145 145
146#include <linux/platform_data/ti-sysc.h> 146#include <linux/platform_data/ti-sysc.h>
147 147
148#include <dt-bindings/bus/ti-sysc.h>
149
148#include <asm/system_misc.h> 150#include <asm/system_misc.h>
149 151
150#include "clock.h" 152#include "clock.h"
@@ -2498,7 +2500,7 @@ static void __init _setup_postsetup(struct omap_hwmod *oh)
2498 * affects the IP block hardware, or system integration hardware 2500 * affects the IP block hardware, or system integration hardware
2499 * associated with the IP block. Returns 0. 2501 * associated with the IP block. Returns 0.
2500 */ 2502 */
2501static int __init _setup(struct omap_hwmod *oh, void *data) 2503static int _setup(struct omap_hwmod *oh, void *data)
2502{ 2504{
2503 if (oh->_state != _HWMOD_STATE_INITIALIZED) 2505 if (oh->_state != _HWMOD_STATE_INITIALIZED)
2504 return 0; 2506 return 0;
@@ -3060,6 +3062,414 @@ int __init omap_hwmod_setup_one(const char *oh_name)
3060 return 0; 3062 return 0;
3061} 3063}
3062 3064
3065static void omap_hwmod_check_one(struct device *dev,
3066 const char *name, s8 v1, u8 v2)
3067{
3068 if (v1 < 0)
3069 return;
3070
3071 if (v1 != v2)
3072 dev_warn(dev, "%s %d != %d\n", name, v1, v2);
3073}
3074
3075/**
3076 * omap_hwmod_check_sysc - check sysc against platform sysc
3077 * @dev: struct device
3078 * @data: module data
3079 * @sysc_fields: new sysc configuration
3080 */
3081static int omap_hwmod_check_sysc(struct device *dev,
3082 const struct ti_sysc_module_data *data,
3083 struct sysc_regbits *sysc_fields)
3084{
3085 const struct sysc_regbits *regbits = data->cap->regbits;
3086
3087 omap_hwmod_check_one(dev, "dmadisable_shift",
3088 regbits->dmadisable_shift,
3089 sysc_fields->dmadisable_shift);
3090 omap_hwmod_check_one(dev, "midle_shift",
3091 regbits->midle_shift,
3092 sysc_fields->midle_shift);
3093 omap_hwmod_check_one(dev, "sidle_shift",
3094 regbits->sidle_shift,
3095 sysc_fields->sidle_shift);
3096 omap_hwmod_check_one(dev, "clkact_shift",
3097 regbits->clkact_shift,
3098 sysc_fields->clkact_shift);
3099 omap_hwmod_check_one(dev, "enwkup_shift",
3100 regbits->enwkup_shift,
3101 sysc_fields->enwkup_shift);
3102 omap_hwmod_check_one(dev, "srst_shift",
3103 regbits->srst_shift,
3104 sysc_fields->srst_shift);
3105 omap_hwmod_check_one(dev, "autoidle_shift",
3106 regbits->autoidle_shift,
3107 sysc_fields->autoidle_shift);
3108
3109 return 0;
3110}
3111
3112/**
3113 * omap_hwmod_init_regbits - init sysconfig specific register bits
3114 * @dev: struct device
3115 * @data: module data
3116 * @sysc_fields: new sysc configuration
3117 */
3118static int omap_hwmod_init_regbits(struct device *dev,
3119 const struct ti_sysc_module_data *data,
3120 struct sysc_regbits **sysc_fields)
3121{
3122 *sysc_fields = NULL;
3123
3124 switch (data->cap->type) {
3125 case TI_SYSC_OMAP2:
3126 case TI_SYSC_OMAP2_TIMER:
3127 *sysc_fields = &omap_hwmod_sysc_type1;
3128 break;
3129 case TI_SYSC_OMAP3_SHAM:
3130 *sysc_fields = &omap3_sham_sysc_fields;
3131 break;
3132 case TI_SYSC_OMAP3_AES:
3133 *sysc_fields = &omap3xxx_aes_sysc_fields;
3134 break;
3135 case TI_SYSC_OMAP4:
3136 case TI_SYSC_OMAP4_TIMER:
3137 *sysc_fields = &omap_hwmod_sysc_type2;
3138 break;
3139 case TI_SYSC_OMAP4_SIMPLE:
3140 *sysc_fields = &omap_hwmod_sysc_type3;
3141 break;
3142 case TI_SYSC_OMAP34XX_SR:
3143 *sysc_fields = &omap34xx_sr_sysc_fields;
3144 break;
3145 case TI_SYSC_OMAP36XX_SR:
3146 *sysc_fields = &omap36xx_sr_sysc_fields;
3147 break;
3148 case TI_SYSC_OMAP4_SR:
3149 *sysc_fields = &omap36xx_sr_sysc_fields;
3150 break;
3151 case TI_SYSC_OMAP4_MCASP:
3152 *sysc_fields = &omap_hwmod_sysc_type_mcasp;
3153 break;
3154 case TI_SYSC_OMAP4_USB_HOST_FS:
3155 *sysc_fields = &omap_hwmod_sysc_type_usb_host_fs;
3156 break;
3157 default:
3158 return -EINVAL;
3159 }
3160
3161 return omap_hwmod_check_sysc(dev, data, *sysc_fields);
3162}
3163
3164/**
3165 * omap_hwmod_init_reg_offs - initialize sysconfig register offsets
3166 * @dev: struct device
3167 * @data: module data
3168 * @rev_offs: revision register offset
3169 * @sysc_offs: sysc register offset
3170 * @syss_offs: syss register offset
3171 */
3172int omap_hwmod_init_reg_offs(struct device *dev,
3173 const struct ti_sysc_module_data *data,