From patchwork Thu Nov 30 17:41:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 120269 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp91143qgn; Thu, 30 Nov 2017 09:47:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMY8hxEHah1090qVlziMZqMRmCcCpSVDlx532SUNHRjGR5eFMoyyWMAtj7o7+LV9Iu5i5iNQ X-Received: by 10.101.67.71 with SMTP id k7mr3059529pgq.20.1512064037693; Thu, 30 Nov 2017 09:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512064037; cv=none; d=google.com; s=arc-20160816; b=Br0qVePAzkLJXOFo++Hu1ir6ZoSPSE9CiBzsYTxJN/q9U08Ggt9TRLjfTrYePk6/Lf 5pU+Ql8A4asRJJyZRaQcNaXHgaWMXdzESXAGCWzOKd5h5Voqhve/Sf1hClxUcBJq95TB wdUwHj5tLioY/pU1K1DQp61RFGuuuHhxGLZuYosY4xvPZW3+IV5uTmZmOndvYNF0qT8I AycS1lmmjuaEK4iTmWVVHd0/68ravhAq84hWYs6DgS/p+Yqzqp2P9WEMgjs7A9B5AkXA mUs5mSKmKcn6ZoMHCSfUFh9MVI8XjWbFxKLK8OSPjns0ZJvsAnz+C3Uyw+ildHGUWpBL W5AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=o9oNm3P3o5yBklWy3JUwOVK4WBrdO6+7TZRT1O8jq0c=; b=QH0XKXgOo9duHSTKY6IYHSI69QCKkmbYVAo0Ra1uwFPspA3zzTgr4gfYhlyHYGWWkw r/SeGYbqZ0DyuqTh/dHUbwPp68T+eAvyKgnGLQgvKTsscr2AooTdfhc10N1UXkxAqcFK 7sxoiZZe+07C6amx2DOrSTsOFyPDTMIfwqZZvc+IQ2rcVyjG5TVjnx1hmDyyh24roffi 2f+r3jO2buBLkTgzkqzRsBvz1WhqcW+XDS7aSIUdP9kJ3eno2GYFeDFnlwGOnJhT1UOI MHsXSBaQfl5frxzaD6191S36gncKxraNpYFXaLMSrnPC2MY4TW3RxHBHZRKtj/h1km6w snBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=eW3GW7RH; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i81si3587894pfj.329.2017.11.30.09.47.17; Thu, 30 Nov 2017 09:47:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=eW3GW7RH; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971AbdK3RqH (ORCPT + 10 others); Thu, 30 Nov 2017 12:46:07 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38953 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753940AbdK3RqD (ORCPT ); Thu, 30 Nov 2017 12:46:03 -0500 Received: by mail-wm0-f67.google.com with SMTP id i11so13903329wmf.4 for ; Thu, 30 Nov 2017 09:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FnTdtJB5+keQn9t5XzLsh0o6l64d0Ikm14LV7p59dlc=; b=eW3GW7RHP6BvXAB71paApfS7ycD3dxcyZ/ZLlcWpnP8DVFrQKKtWlnQc60Fcj12kvT UxBK6HAdj1FYrPD0neYR/5jz80SAhtXstfNG+XGzTBxxiFB5iwHXSf6dmrg1ASrpbgW8 yHTU8T9uCrPkUXq9DKIiGSyR7CX1Ks2iXxo9A= 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; bh=FnTdtJB5+keQn9t5XzLsh0o6l64d0Ikm14LV7p59dlc=; b=m12+LXmFpNCSAb1kD/jbEavhNEIsHQlnjh+2YAS3kDElSiTE2P6oLiPv03+m8mokfi EB2l0FU7JxPQdhkNuUUroldcmoVd2Nhzd57u4OGwKQPYN7hAL40CacdMknx8nkO/lFh2 NFpEMMZ152d2VixjkLRQAcd6zVd0RxAVi3aFBS1V7ka3T2dgB17c0SOWiXuNDNHNB0wL mGSvxtG7V/AIP7PCbdGdOx1UfjeNjShm66RsP9eWxen/EaGFrZqZHv1VXqmo1s6bffLl lPq5g0sM7Vt/dgIV/vGYsvLxMmlIVQ+mrneyL1KWgK12bn5RcqgnS0qz/xbLNzyZUmK0 sR4g== X-Gm-Message-State: AJaThX4QDJIvK0nJUSDBp4UNPvSZnUCkR+H6yJC2qgfgerWByEiLiVii 4ZMV7J3URPr7NHzIxV4xba9JPw== X-Received: by 10.28.216.212 with SMTP id p203mr1308087wmg.50.1512063962399; Thu, 30 Nov 2017 09:46:02 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id 189sm2412189wmu.3.2017.11.30.09.46.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 09:46:01 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org, broonie@kernel.org, alsa-devel@alsa-project.org Cc: sdharia@codeaurora.org, bp@suse.de, poeschel@lemonage.de, treding@nvidia.com, andreas.noever@gmail.com, alan@linux.intel.com, mathieu.poirier@linaro.org, daniel@ffwll.ch, jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com, davem@davemloft.net, james.hogan@imgtec.com, michael.opdenacker@free-electrons.com, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vinod.koul@intel.com, arnd@arndb.de, srinivas.kandagatla@linaro.org Subject: [PATCH v8 09/13] slimbus: core: add common defines required for controllers Date: Thu, 30 Nov 2017 17:41:56 +0000 Message-Id: <20171130174200.6684-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130174200.6684-1-srinivas.kandagatla@linaro.org> References: <20171130174200.6684-1-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla This patch adds some common constant defines which are required for qcom slim controller driver. Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/slimbus.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index e0ae7bb1ba47..d278c951ddbf 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -18,9 +18,38 @@ #include #include +/* Standard values per SLIMbus spec needed by controllers and devices */ +#define SLIM_CL_PER_SUPERFRAME 6144 +#define SLIM_CL_PER_SUPERFRAME_DIV8 (SLIM_CL_PER_SUPERFRAME >> 3) + /* SLIMbus message types. Related to interpretation of message code. */ #define SLIM_MSG_MT_CORE 0x0 +/* + * SLIM Broadcast header format + * BYTE 0: MT[7:5] RL[4:0] + * BYTE 1: RSVD[7] MC[6:0] + * BYTE 2: RSVD[7:6] DT[5:4] PI[3:0] + */ +#define SLIM_MSG_MT_MASK GENMASK(2, 0) +#define SLIM_MSG_MT_SHIFT 5 +#define SLIM_MSG_RL_MASK GENMASK(4, 0) +#define SLIM_MSG_RL_SHIFT 0 +#define SLIM_MSG_MC_MASK GENMASK(6, 0) +#define SLIM_MSG_MC_SHIFT 0 +#define SLIM_MSG_DT_MASK GENMASK(1, 0) +#define SLIM_MSG_DT_SHIFT 4 + +#define SLIM_HEADER_GET_MT(b) ((b >> SLIM_MSG_MT_SHIFT) & SLIM_MSG_MT_MASK) +#define SLIM_HEADER_GET_RL(b) ((b >> SLIM_MSG_RL_SHIFT) & SLIM_MSG_RL_MASK) +#define SLIM_HEADER_GET_MC(b) ((b >> SLIM_MSG_MC_SHIFT) & SLIM_MSG_MC_MASK) +#define SLIM_HEADER_GET_DT(b) ((b >> SLIM_MSG_DT_SHIFT) & SLIM_MSG_DT_MASK) + +/* Device management messages used by this framework */ +#define SLIM_MSG_MC_REPORT_PRESENT 0x1 +#define SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS 0x2 +#define SLIM_MSG_MC_REPORT_ABSENT 0xF + /* Clock pause Reconfiguration messages */ #define SLIM_MSG_MC_BEGIN_RECONFIGURATION 0x40 #define SLIM_MSG_MC_NEXT_PAUSE_CLOCK 0x4A @@ -101,6 +130,10 @@ struct slim_msg_txn { #define DEFINE_SLIM_BCAST_TXN(name, mc, rl, la, msg) \ struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_BROADCAST, 0,\ 0, la, msg, } + +#define DEFINE_SLIM_EDEST_TXN(name, mc, rl, la, msg) \ + struct slim_msg_txn name = { rl, 0, mc, SLIM_MSG_DEST_ENUMADDR, 0,\ + 0, la, msg, } /** * enum slim_clk_state: SLIMbus controller's clock state used internally for * maintaining current clock state.