From patchwork Thu Dec 7 10:27:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 120956 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8180309qgn; Thu, 7 Dec 2017 02:32:32 -0800 (PST) X-Google-Smtp-Source: AGs4zManLlv+wqq6NlL/Y3fQlkHEOfwn63GZeUY1hWCFzKGXX7y6hue3deCcYufmx71AXsNBKko6 X-Received: by 10.99.124.88 with SMTP id l24mr25354220pgn.355.1512642752117; Thu, 07 Dec 2017 02:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512642752; cv=none; d=google.com; s=arc-20160816; b=lIfZMlxlyBip6GFYEJqbqwgWW4b6fVIj8cWdUSGUV7DB0Cftkt2DKEXuoutJ5JlnGw UoouN68sQ6rWcYrx/4DtlSWmXFAVfyFjY/KABh+6oBwU3C2hTvbAYgtxUXkKV0kMcu1x dHu1df9J7rmoNMenmQvbR1GJWwlkLxBicjMoslgdwrPWGi4tCiDFI/xXnY1Gn+vSWFWe 7yk5MeWCIRPaCDeK2MDI31jsNcL7qui40lPMS7GgRUQpmn+reUCqyjEFb+FI+XnPvoxZ zpbe2jK0sUJaA0ZPB3lruex+Q/WyW/E00Ldhz0YThLB7nsJdHYn4+7CEqVMpDuahyafH IzDg== 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=P58Yr7EmaP5fYjBw3qVu0Jcq86taM+MFbXjQCD+wnII=; b=VHLBYrgrZN5VSFc4xaHGTPp9vmRoXJfPXSK8zqVXyJYph5dg/v3b5GCkfHg9qk1ndI pGFSbw/Rn0SQmJL3hetkjDm4FBcQQeSCCFE1Kw6aAEsVKfRbi4GWvjZObI4XPiqvV9Pb hIIj3GVWNgG4lURrgvbXwupv+yrD3eREE7CJsVNdP/C83A8nQET3GOqYG4ecfTMEOnjn EpAouF9KH1U628qCQmerUcjqEywvURRrdpGANqKgL4AYZ5qJmMo946Erg71xM53nXdVF rozxqV3F/RJQ2I97ekH2udO2Od9idNzZyjQRxPhBDEKpiJx52kEEZKDFm/wV0BAdfBGU VpwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hsNWqVfC; 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; dmarc=pass (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 w15si3434871pgq.366.2017.12.07.02.32.31; Thu, 07 Dec 2017 02:32:32 -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=@linaro.org header.s=google header.b=hsNWqVfC; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064AbdLGKca (ORCPT + 21 others); Thu, 7 Dec 2017 05:32:30 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:41665 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752711AbdLGKaq (ORCPT ); Thu, 7 Dec 2017 05:30:46 -0500 Received: by mail-wr0-f194.google.com with SMTP id z18so6909235wrb.8 for ; Thu, 07 Dec 2017 02:30:45 -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=P58Yr7EmaP5fYjBw3qVu0Jcq86taM+MFbXjQCD+wnII=; b=hsNWqVfC6wOvIRurr0iyOo0eWf6OB78duWUOih5uJXAPaYbZBtZRyJPwBKziimpSw5 p5XJzRvDE/cCAV7wJvYCDwHW13rBrSLVQfiapez8ump1gOsR8FB6+THnBJWYPq71KPzI olknvzWzzTI8DHMXVlHzhQnbjCrJpEhPikbnI= 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=P58Yr7EmaP5fYjBw3qVu0Jcq86taM+MFbXjQCD+wnII=; b=e4oHpJTiSWCAQfcDqwe01wn5Z5VmWLY9CNG2VWpMVzscGCgKNqAz4decIT9G4cJpqn F/Mcb/xpad3wPDcgi/5FvJeVWte9c3WEiNm7O33c/VSLYnNIWWVbCVEoGAuR4ZROFtvN z61XhtitlOEMVnNtrq9SicusB/iJFSP9g26Qr8F+4kVWD0ZiL4Pqd89T1SBaO0cGaH0U H4RrnYis4pxuIjvCaXEy9aRunhs1Vmunncx5hjoRc+GYEbQx+hXhF26tAlSyXWek127q IRs67xnGaXDIxVl7Ot8vqB65aw1h7AS+1QTurXWFg26K8O7sUXgwI6PCHWghqCz2C+wj lX6Q== X-Gm-Message-State: AJaThX5iKjCs5bo5YYQ/jk/yxOxEgQ5U7eG5801kFUF4Pzw8XsZPcpdV Q8ZhxfCfsSCbBjZzQuG3kFvTJA== X-Received: by 10.223.184.42 with SMTP id h39mr23000052wrf.38.1512642645076; Thu, 07 Dec 2017 02:30:45 -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 k2sm4837734wrg.4.2017.12.07.02.30.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 02:30:44 -0800 (PST) From: srinivas.kandagatla@linaro.org To: Mark Brown , Greg Kroah-Hartman , alsa-devel@alsa-project.org Cc: sdharia@codeaurora.org, Rob Herring , Mark Rutland , Jonathan Corbet , pombredanne@nexb.com, j.neuschaefer@gmx.net, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v9 09/13] slimbus: core: add common defines required for controllers Date: Thu, 7 Dec 2017 10:27:16 +0000 Message-Id: <20171207102720.21071-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171207102720.21071-1-srinivas.kandagatla@linaro.org> References: <20171207102720.21071-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 diff --git a/drivers/slimbus/slimbus.h b/drivers/slimbus/slimbus.h index e002763e7f6e..4b71b6434549 100644 --- a/drivers/slimbus/slimbus.h +++ b/drivers/slimbus/slimbus.h @@ -9,9 +9,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 @@ -92,6 +121,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.