From patchwork Wed Nov 15 14:10:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 118967 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4368253qgn; Wed, 15 Nov 2017 06:16:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMYIU3ysT3cDVrDXFEsQHuSPIJWEZaWcNy1Esr4nT8InUqDdb8dotLd7mmpxJUQ8WekmTqBf X-Received: by 10.101.91.5 with SMTP id y5mr3948014pgq.445.1510755373515; Wed, 15 Nov 2017 06:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510755373; cv=none; d=google.com; s=arc-20160816; b=fkuDJh/OhhLi7nMDMeBl2i39lGhBeDFJt3aW40zn76J5nRmoClX41EGKijet4ubRUy KIoSW7zqfoA/faUogfUpVv6DVZ/Yp/dLWm72Y9WMsRQ1ZJv1uc1GdN/XUl0yHMqtwsSW Xy+04gh0u6ECK+2Aq5nkMzCVGjqky8oueRM8XIKiw0ojCd/nie4Pei9DozjiIyGLLKax MsLix47xNwkxX8I6MyIJUOPGbVm3dgYSgKE7M+WHipGQqxB/qh8+B6SQzsVe2gbSIZsP lz7+u5p/vDVjE2MkEU6YqLed4aXXysCgpcU6B69t2G5TkIarppn35gdqwlgmenxso4Kx f9KA== 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=KE/BBrwt9UEwAJ+dvx0m1FH5I7ZKDH1o8IqPp3f93F4=; b=JApyKtgoxAdBH7lUT87tVPJn77q30/b2WeTyLCLr9LZbDJiZlAeAgWtCLTYALJ2lwO l+lWWlMCdmVxOK3pf3L6fqhOH3g2UnXjwOc42+5ZHbIjpTTKgeED53whyF9VzSp3Kk6a AapGltw7tJA5LPdnty9MXDvHZQd5IOLEWrH7MnrTGeZRS3dbzOtR4yukRvXPbC51JX4h J6BIsTUuIPSK/NGXKZQ31BlJTR7DMohc7Z3KVupq5vrgQAh4/XHvYgRUNfgrDgCNkyGu BQUP2QgnDftPpgypknlfKtbiA+AjtrqsI1QHrs7emyPPh86HAdhHF9Tc353qPyyem6tm 9aTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gizd52Mt; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 42si6334793plb.653.2017.11.15.06.16.13; Wed, 15 Nov 2017 06:16:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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=gizd52Mt; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 S932436AbdKOOQK (ORCPT + 6 others); Wed, 15 Nov 2017 09:16:10 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45238 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754624AbdKOONl (ORCPT ); Wed, 15 Nov 2017 09:13:41 -0500 Received: by mail-wr0-f193.google.com with SMTP id w95so1735716wrc.2 for ; Wed, 15 Nov 2017 06:13:40 -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=tfwldHIEU6uCDtivDFyBxsD7FV7iNaDw80GlvIE8o0Y=; b=gizd52MtxumYYYbFxz96VXwCA8t5pgV3BDIoeym0HAIE4vKGrVCmkBVFyGwt7sUtJj 7p1nStI+mIuUyhPxhl9+IkFl/wf3qipTL76CHCrZFhDG9t/IeDAtxiTy+MDUSurrgBw3 OBsSxP5vO6UgJeJ/+CoYOkwJmUUGw3oHrkVpQ= 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=tfwldHIEU6uCDtivDFyBxsD7FV7iNaDw80GlvIE8o0Y=; b=Wfs1A8lqMpu+ga2Ur0ud6Ryd/+ud2vkhkpxUPXhvg3mqEWY+YbzLeUvp9ETo48bXRs uj6j2dMw76Gx+bCo3Fm2rv8z4jlf9GArCa92IVjNY53WI/mQtYdQK6MKwJPGBSoeb2fs 8Amb/d9xCfkjC2q9loSNALhbIr2kVsoMMzDvwi5urwK1oTq2Yq3oNtrC70+U8IdQwEby XS8ANiwFvv/rJkO1Nc8YgWYF6rZJDs2/IAMGjQwHML47BNmda45IVXFk5yPihl4miQlJ SE235QHxb2GclBacZTHLjAwvbOKV2/AzS6yrTSRVTmkSk0tVqt3B2v46WxLddqUV4c1J iUIA== X-Gm-Message-State: AJaThX51B6GjSB8kpyh5xgc+rtpul9Cf9f+mglc4drPGINE+bDodNKYW V1UnqLjF1XP6hSW/iPnnvsdsTQ== X-Received: by 10.223.176.115 with SMTP id g48mr14783176wra.177.1510755219555; Wed, 15 Nov 2017 06:13:39 -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 m11sm56707wrf.56.2017.11.15.06.13.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Nov 2017 06:13:38 -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 Subject: [PATCH v7 09/13] slimbus: core: add common defines required for controllers Date: Wed, 15 Nov 2017 14:10:39 +0000 Message-Id: <20171115141043.29202-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> References: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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 4fe1892cbd4f..e1fc6d23f374 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -18,9 +18,37 @@ #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 /* Information Element management messages */ #define SLIM_MSG_MC_REQUEST_INFORMATION 0x20 @@ -116,6 +144,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.