Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750992AbdFSNlH (ORCPT ); Mon, 19 Jun 2017 09:41:07 -0400 Received: from mail-co1nam03on0041.outbound.protection.outlook.com ([104.47.40.41]:2016 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750757AbdFSNlD (ORCPT ); Mon, 19 Jun 2017 09:41:03 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=nxp.com; From: Leonard Crestez To: Shawn Guo , Srinivas Kandagatla , Zhang Rui , Eduardo Valentin , Rob Herring , Mark Rutland , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= , Fabio Estevam CC: Bai Ping , Anson Huang , Dong Aisheng , Octavian Purdila , , , , Subject: [PATCH] thermal: imx: interpret fsl,tempmon-data through nvmem Date: Mon, 19 Jun 2017 16:40:43 +0300 Message-ID: X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131423532548840139;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39410400002)(39850400002)(39380400002)(39450400003)(39840400002)(39860400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(50466002)(5660300001)(47776003)(189998001)(6666003)(6636002)(356003)(5820100001)(54906002)(77096006)(8656002)(4326008)(6306002)(7416002)(118296001)(53936002)(105606002)(81166006)(39060400002)(498600001)(50226002)(106466001)(104016004)(85426001)(2906002)(23676002)(86362001)(8676002)(38730400002)(33646002)(305945005)(36756003)(966005)(2870700001)(8936002)(50986999)(142933001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0640;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD044;1:1k718WqeNA4VjUEPWqSRo3IUXYaMuBYAF6vzhdywvZkrz7G1xQ1d5Ou8RDTA1C9CPKI1K14/mDkrJLVMFEo+IZCqyZ8MiSAHS3SC2QkC6+g1k9hPi5LEoYYasFW7q1F8L6txCc5RONQZMrg/+O0fiD1YfdAw4rDnMu5PXBYjIHA6TN8pza1qDzw2QYEMH++3FbA7YyOREYOxlOxZfENQKSexpOLIWl9sQcNdcB8XDb82TYVVBVtVJGU3Nd05tSibGu7i6w55P+LcX95ns7LD1EVnoGLYCSMI8fdRkKPvN7LOrIeGbtVBtMKrTkjVssEKdbftZCbn8Glx/FXPYObodl8JDV1ssfxItkOritK8vAOrFN7ERdvkTKXlx0eiNbGmG6ZqMv+lmrVc+jXxCF0XOcHZ0PvilIPL15CqwqkdsdLabN+0HAFh98YYLALk6XPczVGyOvdy4lJ7gpIRfN7gZslxviNQ0rJJknWfQHLf1dWKGBEpDw6T8kPA6Y297uRtE6QM1STnuye8xd8yuvqwhP3UM45da4/8D0HFwcEBkC8JhEhNRueVLraaUl7lG/P0nMS6CPTS0zmcnS5dNmWtWSQtF0SmfOK0oIg+B2Ro4tntAghHnhur4ty0F2VV/XJL X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2e7bc28-fdf5-420c-b124-08d4b718cf19 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:DM2PR0301MB0640; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0640;3:0Mzsq19HHqArc9mdbo/2M7vyA4PxommB7hVLIWASTina4Cs4q2nrLA1c//CZs8Bl6MiJV1vI6jURap8+GJw9SBGYflfKu5e8ETO+HD20j8rAqFU9E+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QYbiAl7r/5mnKZBrquTxYPkFeqcjyoVzzIRlDmlldosKiZj8lFMXUSe5EC3yRPsFKvnSFtDMorhe0LgXReZWHJ+OGrYsdw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(264314650089876); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13016025)(5005006)(13018025)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123556025)(20161123561025)(20161123565025)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM2PR0301MB0640;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM2PR0301MB0640; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTJQUjAzMDFNQjA2NDA7NDpYRU4rNXZndEg2UXVja2FlM0JRRFY0RUNr?= =?utf-8?B?SlRyZEFuYXFJRjFvZUpRTkdHVzhMRDFYZDBZYmx1ZmJXdVNXM25jOVVPSWR3?= =?utf-8?B?SnJmRmdyWmkvLzduUlNvNHBaT3hJVmc1bk9KN083K1hnRmxKS01mM2s5Qkxw?= =?utf-8?B?WHVFU0ZlZTV5V3J0QzNQYzBkSHdKTmlrU1NwYitBZU9vcEdyTUE0TFZoTVdD?= =?utf-8?B?M0p5RWpMMGtGQ0hKS0xoYm0xb214bksyOTk4WHVMVlNFUXJobzJqRnVvVW51?= =?utf-8?B?c3dPWklFcjlvTFNtUWlqTDFUcytKd3lRcU9QNGxVcUZCa0ZQZzRqUC9hMm5k?= =?utf-8?B?ZkFNcm40V1ZjY041dW1FRmRKbGl2M0svNDZJcW0vV3VpSXh0UmQ3VXZTS3Ro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UpoS2XgM1ndZ4WqgIuPfcZyK5k7B3PaVoaJ5Nodw8FPTgRIQ3gEpwRAy+XqNl60hqvYx2PdgEPM5jwAOmv2bM3Zh4NxSWUm+4RDkcT+uY+u2nnXdwWvOIumAzh5qaSUKRyp892WwoAC5nHPC4BRp+xDNmGG3sH4Fl/WD/s4XFN2HVOev6aoBcshpkwMutaULfnLXKGm/Gvfi2CvRNkI+P76Bth3UHMDavKgE9t6C/BEVr1lLfAAnGaOByhi9JJotQ1kl6Gzfgyr04WFHrhWIgSQsYlbm1y2wfVsOB4axa9H7yBSvLzSm98OXmhSq9bwA1czoHH6TVxKBcmVFcxvJ81RoOVI01oXVZDF2ebK/qJj6HHkpLjuL4Z3xPrcKc6u9XEIAP53v9DGRpTLAb7xSqwhq6hMktua9cKR1dFGFyqrkvi73eRSF4Ib0KdkOvcJ736P6PdDnsCgQbdHPQ3XVkWcgw2a5XJbJQwVOjv9mOeLSmLs9Rolm8QaWoIc6ezwOE9Ni/UdK7mi8/dZ3mMy3JiLvsPh0yqV3dVIq8xH1+bYDIspsf8oDgk4uxPseNPa1H1EQGIDuQZYfx5v3avjyRsSMS3bNwItFWQ51n5SYuS9uQqZLja16Vbe4rRijzWPm9bsIEvv4Ibk9GgkmYrWsYE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 13:40:54.5252 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0640 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 8193 Lines: 236 On imx6sx accessing the ocotp memory area directly is wrong because the ocotp clock needs to be enabled first. Fix this by reinterpreting the fsl,tempmon-data phandle as a reference to a nvmem_device and doing all the read through that. This clock requirement does not apply to older imx6qdl chips because there the ocotp access clock (clk_ipg_s) is always enabled. This is visible by comparing the "System Clocks, Gating, and Override" tables (OCOTP rows) in the 6DQ and 6SX manuals: http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6SXRM.pdf http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf This happens to work right now without this patch because the ocotp clock might be enabled for some other reason. In particular it might be enabled from the bootloader and it only gets disabled late during boot in clk_disable_unused, after imx-thermal has completed probing. If imx-thermal is compiled as a module then the system can hang on probe. This makes IMX_THERMAL depend on NVMEM_IMX_OCOTP but that driver seems be already available for all chips that contain tempmon so it's acceptable. Reported-by: Lothar Waßmann Signed-off-by: Leonard Crestez --- This was reported as a comment to a patch adding tempmon support for imx6ul (which is very similar to imx6sx). Since it already affects a supported chip this patch is sent as a separate bugfix. Link: https://lkml.org/lkml/2017/6/9/578 There are various other ways to fix this problem. The main advantage of this solution is that it does not add a new binding but rather preserves compatibility with old DTBs. It also aligns with the idea that devicetree describes hardware relationships rather than a specific linux implementation. An alternative would have been to add a nvmem-cells binding to imx-thermal and use that if available instead of fsl,tempmon-data. It might not be good to sidestep the official nvmem bindings, the devicetree people were added so that they have an opportunity to object. In theory the "thermal grade" is a two-bit quantity and might be a candidate for using a cell with a "bits" binding. However this causes the nvmem core to issue reads of length and alignment less than 4 to the imx-ocotp driver so additional fixes might be required. drivers/nvmem/core.c | 15 ++++++++++++ drivers/thermal/Kconfig | 2 +- drivers/thermal/imx_thermal.c | 53 ++++++++++++++++++++++++++---------------- include/linux/nvmem-consumer.h | 6 +++++ 4 files changed, 55 insertions(+), 21 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 8c830a8..66502ca 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -630,6 +630,21 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *id) return __nvmem_device_get(nvmem_np, NULL, NULL); } EXPORT_SYMBOL_GPL(of_nvmem_device_get); + +/** + * of_nvmem_device_phandle_get() - Get nvmem device from a given phandle + * + * @nvmem_np: Device tree node for the nvmem device + * + * Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device + * on success. + */ +struct nvmem_device *of_nvmem_device_phandle_get(struct device_node *nvmem_np) +{ + + return __nvmem_device_get(nvmem_np, NULL, NULL); +} +EXPORT_SYMBOL_GPL(of_nvmem_device_phandle_get); #endif /** diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index b5b5fac..a427936 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -206,7 +206,7 @@ config HISI_THERMAL config IMX_THERMAL tristate "Temperature sensor driver for Freescale i.MX SoCs" depends on (ARCH_MXC && CPU_THERMAL) || COMPILE_TEST - depends on MFD_SYSCON + depends on NVMEM_IMX_OCOTP depends on OF help Support for Temperature Monitor (TEMPMON) found on Freescale i.MX SoCs. diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index fb648a4..1cf35bd 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -24,6 +24,7 @@ #include #include #include +#include #define REG_SET 0x4 #define REG_CLR 0x8 @@ -55,8 +56,8 @@ #define TEMPSENSE2_PANIC_VALUE_SHIFT 16 #define TEMPSENSE2_PANIC_VALUE_MASK 0xfff0000 -#define OCOTP_MEM0 0x0480 -#define OCOTP_ANA1 0x04e0 +#define OCOTP_MEM0_OFFSET 32 +#define OCOTP_ANA1_OFFSET 56 /* The driver supports 1 passive trip point and 1 critical trip point */ enum imx_thermal_trip { @@ -347,29 +348,39 @@ static struct thermal_zone_device_ops imx_tz_ops = { static int imx_get_sensor_data(struct platform_device *pdev) { struct imx_thermal_data *data = platform_get_drvdata(pdev); - struct regmap *map; + struct device_node *ocotp_np; + struct nvmem_device *ocotp; int t1, n1; int ret; u32 val; u64 temp64; - map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, - "fsl,tempmon-data"); - if (IS_ERR(map)) { - ret = PTR_ERR(map); - dev_err(&pdev->dev, "failed to get sensor regmap: %d\n", ret); + ocotp_np = of_parse_phandle(pdev->dev.of_node, "fsl,tempmon-data", 0); + if (IS_ERR(ocotp_np)) { + ret = PTR_ERR(ocotp_np); + dev_err(&pdev->dev, "failed to parse fsl,tempmon-data phandle: %d\n", ret); + return ret; + } + ocotp = of_nvmem_device_phandle_get(ocotp_np); + of_node_put(ocotp_np); + if (IS_ERR(ocotp)) { + ret = PTR_ERR(ocotp); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "failed to get fsl,tempmon-data nvmem device: %d\n", ret); return ret; } - ret = regmap_read(map, OCOTP_ANA1, &val); - if (ret) { + ret = nvmem_device_read(ocotp, OCOTP_ANA1_OFFSET, sizeof(val), &val); + if (ret != sizeof(val)) { dev_err(&pdev->dev, "failed to read sensor data: %d\n", ret); - return ret; + ret = -EIO; + goto out; } if (val == 0 || val == ~0) { dev_err(&pdev->dev, "invalid sensor calibration data\n"); - return -EINVAL; + ret = -EINVAL; + goto out; } /* @@ -404,10 +415,11 @@ static int imx_get_sensor_data(struct platform_device *pdev) data->c2 = n1 * data->c1 + 1000 * t1; /* use OTP for thermal grade */ - ret = regmap_read(map, OCOTP_MEM0, &val); - if (ret) { - dev_err(&pdev->dev, "failed to read temp grade: %d\n", ret); - return ret; + ret = nvmem_device_read(ocotp, OCOTP_MEM0_OFFSET, sizeof(val), &val); + if (ret != sizeof(val)) { + dev_err(&pdev->dev, "failed to read sensor data: %d\n", ret); + ret = -EIO; + goto out; } /* The maximum die temp is specified by the Temperature Grade */ @@ -437,7 +449,10 @@ static int imx_get_sensor_data(struct platform_device *pdev) data->temp_critical = data->temp_max - (1000 * 5); data->temp_passive = data->temp_max - (1000 * 10); - return 0; + ret = 0; +out: + nvmem_device_put(ocotp); + return ret; } static irqreturn_t imx_thermal_alarm_irq(int irq, void *dev) @@ -513,10 +528,8 @@ static int imx_thermal_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data); ret = imx_get_sensor_data(pdev); - if (ret) { - dev_err(&pdev->dev, "failed to get sensor data\n"); + if (ret) return ret; - } /* Make sure sensor is in known good state for measurements */ regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index c2256d7..3606167 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h @@ -140,6 +140,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *name); struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *name); +struct nvmem_device *of_nvmem_device_phandle_get(struct device_node *nvmem_np); #else static inline struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *name) @@ -152,6 +153,11 @@ static inline struct nvmem_device *of_nvmem_device_get(struct device_node *np, { return ERR_PTR(-ENOSYS); } + +static inline struct nvmem_device *of_nvmem_device_phandle_get(struct device_node *nvmem_np) +{ + return ERR_PTR(-ENOSYS); +} #endif /* CONFIG_NVMEM && CONFIG_OF */ #endif /* ifndef _LINUX_NVMEM_CONSUMER_H */ -- 2.7.4