Received: by 10.223.176.5 with SMTP id f5csp2365272wra; Thu, 8 Feb 2018 12:49:41 -0800 (PST) X-Google-Smtp-Source: AH8x2249sPEaRkXUW7gT2rL7lGn2PqXBriy7IluGAI1y913EDpu2Eb2CwrXevUvGqsFEeinhvUc/ X-Received: by 10.101.83.131 with SMTP id x3mr364641pgq.65.1518122981150; Thu, 08 Feb 2018 12:49:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518122981; cv=none; d=google.com; s=arc-20160816; b=e/uoWWP5KwFyjsX0WhFJCTjeyiRwJ3i2hPo4CnVQM5ouqjceoPb3/TZJ+2unudYrf0 ddon1IG7NiG9O1MpYJjqtg+wX5zpuqNoWs1xZwhP2nnm2hm5eArW5oCE3rbSEu+ktzfd Ai1EF9nmwBSBNHMmhReZuOlf9XER7h5fmN7lcywLhg749B3YRso0AoL2Wy8Nob/7oUFK 8+UbbhknfjQrgyCsu+VWUlTIoE7T3DOBnRM+0hdFSFnKBsIjEO4WNsUZ7S6b8wXXJ+3A v4T88w0dGBDTqpGgTCUadgB9igeeK4+FbipC9fjoTgukFwsKkbwJvpC2+VFp3W0ws1Hh Wzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=IoJl/WmLSJNATh0t7IZkuOgD2M7bf5i6pPVDLYUmApo=; b=t3+LQA7YKlUDB3PA0oehhuuLwnyE4sqVuiWXfWgEBfW3o+S89tktFn9DIU0vYLRiYK koxfQdDDuPdzYIO4it8t5Xvcmmq6hBpTyKuUdpPPKmioQKyqInbO/2RrKyFvUVlqMh0o Mk0uprQnsdJPlqUDU9RN4yDxJAvX863wqXclb2eg9W4gp/yqRb1v3SVSTQecd8aKDLJs rJ1Et9ZFJqO5Kiv+DYztPquJpGR3LrdeVp7P6xlFZTnAcD35q1N763KXdlqT5YpZ1hdZ 7aqtNnMx63pwidxjlqw8c1r6LnoZe3f58fE80hVFl7IWd4VtGPV+6AOq5d1XHrssnCxl UnyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=BEtmYWLx; dkim=pass header.i=@codeaurora.org header.s=default header.b=ASxKByKO; 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 c2-v6si458765plb.439.2018.02.08.12.49.13; Thu, 08 Feb 2018 12:49:41 -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=@codeaurora.org header.s=default header.b=BEtmYWLx; dkim=pass header.i=@codeaurora.org header.s=default header.b=ASxKByKO; 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 S1752268AbeBHUsP (ORCPT + 99 others); Thu, 8 Feb 2018 15:48:15 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33312 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbeBHUsN (ORCPT ); Thu, 8 Feb 2018 15:48:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id ED435607F5; Thu, 8 Feb 2018 20:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518122893; bh=+Ugfqtg6iv5+TPnblFRkkbU6NvJbU2IReb60blJ89z8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BEtmYWLxUzaHbO0WnG4IriLLi7aeoqXHbsedg2kHbzmZRIXyXrfngNItbDA81gMQ4 S/EEoMX9ZhSZGbU8lEPSqYvmxODCa+hwbFB/rKNu1mXVSnm4Vjok/kuxZ61s0xCRxZ 4Fg7RDZHAbzK3W0wRb0/7NOlDDIUQQCS8++8s/zw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E722160112; Thu, 8 Feb 2018 20:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518122891; bh=+Ugfqtg6iv5+TPnblFRkkbU6NvJbU2IReb60blJ89z8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ASxKByKO12M66n1Co9SOuT8c/65K7SizIgRNR3IpQXeIOlcC7TRoZLCmkqdzeVLjy FcQfr74Ed3Aa8i7Ttb4LFCKe2nnAobcMHMlAhpUYbqhPltYfecgAXGl4ox4Ji3rzda CDYE7pjXoh4xRb0L7mQkMQ6VLrson/dff8Kn3jyw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E722160112 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Thu, 8 Feb 2018 13:48:08 -0700 From: Jordan Crouse To: Lina Iyer Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, sboyd@codeaurora.org, rnayak@codeaurora.org, msivasub@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] drivers: qcom: add command DB driver Message-ID: <20180208204808.GA9676@jcrouse-lnx.qualcomm.com> Mail-Followup-To: Lina Iyer , andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, sboyd@codeaurora.org, rnayak@codeaurora.org, msivasub@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org References: <20180208195154.3580-1-ilina@codeaurora.org> <20180208195154.3580-2-ilina@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180208195154.3580-2-ilina@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 08, 2018 at 12:51:53PM -0700, Lina Iyer wrote: > From: Mahesh Sivasubramanian > > Command DB is a simple database in the shared memory of QCOM SoCs, that > provides information regarding shared resources. Some shared resources > in the SoC have properties that are probed dynamically at boot by the > remote processor. The information pertaining to the SoC and the platform > are made available in the shared memory. Drivers can query this > information using predefined strings. > > Signed-off-by: Mahesh Sivasubramanian > Signed-off-by: Lina Iyer > --- *snip* > diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c > new file mode 100644 > index 000000000000..050a56da76c8 > --- /dev/null > +++ b/drivers/soc/qcom/cmd-db.c > @@ -0,0 +1,321 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#define NUM_PRIORITY 2 > +#define MAX_SLV_ID 8 > +#define CMD_DB_MAGIC 0x0C0330DBUL > +#define SLAVE_ID_MASK 0x7 > +#define SLAVE_ID_SHIFT 16 > + > +#define ENTRY_HEADER(hdr) ((void *)cmd_db_header + \ > + sizeof(*cmd_db_header) + \ > + hdr->header_offset) > + > +#define RSC_OFFSET(hdr, ent) ((void *)cmd_db_header + \ > + sizeof(*cmd_db_header) + \ > + hdr.data_offset + ent.offset) > + > +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) I'm not sure if this was addressed before. Why use a custom macro and not min() or min_t()? Jordan -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project