Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4105746imb; Wed, 6 Mar 2019 05:32:40 -0800 (PST) X-Google-Smtp-Source: APXvYqx90yHmTYXZIE28zYVBDACE5nvgXlAnQ1WbgwuJfNwBS8TZQyjq2MODb7K7WNpUSX8UkHd4 X-Received: by 2002:a63:a5b:: with SMTP id z27mr6217960pgk.78.1551879160372; Wed, 06 Mar 2019 05:32:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551879160; cv=none; d=google.com; s=arc-20160816; b=hCyOfPESdfY5lotor9tIzlK8N6MQ/eyNdopfWrRRsq6BJabn0HjgGK1gyFk7dh4Llo cK8w2NE52q/ttYEFnB+nLukdDguWj7jM3ZQu9Ly260zX31S+/fD/8RP8dOxBtJVe8E+z xWfIPIUSYWs9KNMBWJzZpKvHKTtETnL2FGYXzcQqLjoOaD66Dh0hJ42tm9TzlVxiXdbn S8tyAgujw9PZvLng9efJ+rtmf1aRZ+l+xpJuXblszRkw1IyHgir4OhaFWJeO370kWyjU ew4n8KZmuDwfcbKRwChbdw/kYGif5SiXmC0Vwl7JRZeUFQdJ/sMxENFn2uj/rPNcDW/D BGKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UDGe8T7uTF1fS0LV360+rebuvgO6XlOWuD/srOZz6kA=; b=oypWLnTPGEuWWpb4vkWyiHVtfmRlqJWDoD16B5PsfcI1cGHeFKhPlImQ5tuFIRVocr bgehwoEvSGaSCdUQmYaVD6yIQiwj2vl481l2I3FqsT3hmVk/T3/liHblWRIeV9I5+Uyd hGLF1n0GvSzuNxLitSaGIFeqdDzvjGN/0nKqOV4aWqbl1tmiKAoABy7QibgBoORlbPxj lbzr1jkC68uAaJSDOq+vz0ZbF7J4BccoKyo1JNdcIzuBF7eSQpbzOEVuiDvmEf5/4oVB ykoLpn4fps/LeLBm+UzI0c/X+nELTXycpJnZfEQuXTzbOPrGZWFao7EK+gRKRL42PqSM nk4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@essensium-com.20150623.gappssmtp.com header.s=20150623 header.b="gNltG2/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi12si1460309plb.205.2019.03.06.05.32.24; Wed, 06 Mar 2019 05:32:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@essensium-com.20150623.gappssmtp.com header.s=20150623 header.b="gNltG2/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730372AbfCFLMd (ORCPT + 99 others); Wed, 6 Mar 2019 06:12:33 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:33619 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730353AbfCFLMb (ORCPT ); Wed, 6 Mar 2019 06:12:31 -0500 Received: by mail-ed1-f67.google.com with SMTP id c55so10010321edb.0 for ; Wed, 06 Mar 2019 03:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UDGe8T7uTF1fS0LV360+rebuvgO6XlOWuD/srOZz6kA=; b=gNltG2/vMtp0zBc3u0alXu4S7dYzB3TXOypx/r6LxjqJJJiN4Zy5NdS9fOu+ogGv9/ BKmzb0wR5oz2SEELAoJ++4XtWmXjdS96hY4iMAdhNE2FBWSGATmWcIovlZU6EeV7HKNz OEyKN0Bq+O2fW4dc63c4YMt2Akw1la+XrcoiX7X0XkLO8ybFH0fghOfyRNQTGL3BgYAC Rq8DIAxYP2c61dpatuPyaTyBuuup19Doi82hA+uC0ygQdiqgf2thoOcknujXqFxDKFDA vb4FZ2mG146hg65uqzLoRk4rYeO6HABhk/+SQmqE/otWVEXPCOM6Zi8kPfas/ZqOXWke dVjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UDGe8T7uTF1fS0LV360+rebuvgO6XlOWuD/srOZz6kA=; b=DGoANKNOxxPryQQielJKrKrAisfX0RL2a/I6pYtAV3hwOjswDCmwMq50cqi8Nd6wqR i2bh59bZaYQhs7Llh8P66l+DXyGnfOPcEwW5vTcOBqMlRZQxoK05y7hVp1TqRf7zoA2I 2shQXnIuj2RXYlwcifzJoKzxCZtMY9BYRvEXVoZqnc8vvRUH0X3V92OvwtTg7vMVuQbb oT9B+5bJ3tw74VtI0wFFezfoT+EsDwG85M0yZDRKgNofSrCCHzuTLkS0t1qFCin5EAoJ dT9NjBqRKWCuaHfOHwkN2Q8AgPPVfLO2BdFzl363lrdY9+w5RO1pY1dET2U60pP7IiMK BYRw== X-Gm-Message-State: APjAAAWRTC0bwD8FQUJSAzTO431giUkaNnR3Tbc/x10tSZ1brZq/5xHV TydYqqms/oHPKFTtwZc/FC69bA== X-Received: by 2002:a50:94d6:: with SMTP id t22mr23584689eda.232.1551870749143; Wed, 06 Mar 2019 03:12:29 -0800 (PST) Received: from ph-ThinkPad-E560.local.ess-mail.com (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id t25sm277879ejr.30.2019.03.06.03.12.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 03:12:28 -0800 (PST) From: Patrick Havelange To: William Breathitt Gray , Rob Herring , Mark Rutland , Shawn Guo , Li Yang , Daniel Lezcano , Thomas Gleixner , Thierry Reding , Esben Haabendal , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Jonathan Cameron Cc: Patrick Havelange Subject: [PATCH v2 1/7] include/fsl: add common FlexTimer #defines in a separate header. Date: Wed, 6 Mar 2019 12:12:02 +0100 Message-Id: <20190306111208.7454-2-patrick.havelange@essensium.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190306111208.7454-1-patrick.havelange@essensium.com> References: <20190306111208.7454-1-patrick.havelange@essensium.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Several files are/will be using the same #defines to use the Flextimer module. Regroup them in a common file. Signed-off-by: Patrick Havelange Reviewed-by: Esben Haabendal --- Changes v2 - Commit message --- include/linux/fsl/ftm.h | 88 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 include/linux/fsl/ftm.h diff --git a/include/linux/fsl/ftm.h b/include/linux/fsl/ftm.h new file mode 100644 index 000000000000..d59011acf66c --- /dev/null +++ b/include/linux/fsl/ftm.h @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef __FSL_FTM_H__ +#define __FSL_FTM_H__ + +#define FTM_SC 0x0 /* Status And Control */ +#define FTM_CNT 0x4 /* Counter */ +#define FTM_MOD 0x8 /* Modulo */ + +#define FTM_CNTIN 0x4C /* Counter Initial Value */ +#define FTM_STATUS 0x50 /* Capture And Compare Status */ +#define FTM_MODE 0x54 /* Features Mode Selection */ +#define FTM_SYNC 0x58 /* Synchronization */ +#define FTM_OUTINIT 0x5C /* Initial State For Channels Output */ +#define FTM_OUTMASK 0x60 /* Output Mask */ +#define FTM_COMBINE 0x64 /* Function For Linked Channels */ +#define FTM_DEADTIME 0x68 /* Deadtime Insertion Control */ +#define FTM_EXTTRIG 0x6C /* FTM External Trigger */ +#define FTM_POL 0x70 /* Channels Polarity */ +#define FTM_FMS 0x74 /* Fault Mode Status */ +#define FTM_FILTER 0x78 /* Input Capture Filter Control */ +#define FTM_FLTCTRL 0x7C /* Fault Control */ +#define FTM_QDCTRL 0x80 /* Quadrature Decoder Control And Status */ +#define FTM_CONF 0x84 /* Configuration */ +#define FTM_FLTPOL 0x88 /* FTM Fault Input Polarity */ +#define FTM_SYNCONF 0x8C /* Synchronization Configuration */ +#define FTM_INVCTRL 0x90 /* FTM Inverting Control */ +#define FTM_SWOCTRL 0x94 /* FTM Software Output Control */ +#define FTM_PWMLOAD 0x98 /* FTM PWM Load */ + +#define FTM_SC_CLK_MASK_SHIFT 3 +#define FTM_SC_CLK_MASK (3 << FTM_SC_CLK_MASK_SHIFT) +#define FTM_SC_TOF 0x80 +#define FTM_SC_TOIE 0x40 +#define FTM_SC_CPWMS 0x20 +#define FTM_SC_CLKS 0x18 +#define FTM_SC_PS_1 0x0 +#define FTM_SC_PS_2 0x1 +#define FTM_SC_PS_4 0x2 +#define FTM_SC_PS_8 0x3 +#define FTM_SC_PS_16 0x4 +#define FTM_SC_PS_32 0x5 +#define FTM_SC_PS_64 0x6 +#define FTM_SC_PS_128 0x7 +#define FTM_SC_PS_MASK 0x7 + +#define FTM_MODE_FAULTIE 0x80 +#define FTM_MODE_FAULTM 0x60 +#define FTM_MODE_CAPTEST 0x10 +#define FTM_MODE_PWMSYNC 0x8 +#define FTM_MODE_WPDIS 0x4 +#define FTM_MODE_INIT 0x2 +#define FTM_MODE_FTMEN 0x1 + +/* NXP Errata: The PHAFLTREN and PHBFLTREN bits are tide to zero internally + * and these bits cannot be set. Flextimer cannot use Filter in + * Quadrature Decoder Mode. + * https://community.nxp.com/thread/467648#comment-1010319 + */ +#define FTM_QDCTRL_PHAFLTREN 0x80 +#define FTM_QDCTRL_PHBFLTREN 0x40 +#define FTM_QDCTRL_PHAPOL 0x20 +#define FTM_QDCTRL_PHBPOL 0x10 +#define FTM_QDCTRL_QUADMODE 0x8 +#define FTM_QDCTRL_QUADDIR 0x4 +#define FTM_QDCTRL_TOFDIR 0x2 +#define FTM_QDCTRL_QUADEN 0x1 + +#define FTM_FMS_FAULTF 0x80 +#define FTM_FMS_WPEN 0x40 +#define FTM_FMS_FAULTIN 0x10 +#define FTM_FMS_FAULTF3 0x8 +#define FTM_FMS_FAULTF2 0x4 +#define FTM_FMS_FAULTF1 0x2 +#define FTM_FMS_FAULTF0 0x1 + +#define FTM_CSC_BASE 0xC +#define FTM_CSC_MSB 0x20 +#define FTM_CSC_MSA 0x10 +#define FTM_CSC_ELSB 0x8 +#define FTM_CSC_ELSA 0x4 +#define FTM_CSC(_channel) (FTM_CSC_BASE + ((_channel) * 8)) + +#define FTM_CV_BASE 0x10 +#define FTM_CV(_channel) (FTM_CV_BASE + ((_channel) * 8)) + +#define FTM_PS_MAX 7 + +#endif -- 2.19.1