Received: by 10.223.176.5 with SMTP id f5csp3847417wra; Mon, 29 Jan 2018 21:06:55 -0800 (PST) X-Google-Smtp-Source: AH8x2241oI6cWdafhP0+GyIHNY9B2a0GSkjlqofZj33DBhpLo+IC6cMBuZdMIjpgdsC2WRJIKzzD X-Received: by 2002:a17:902:7614:: with SMTP id k20-v6mr24118407pll.343.1517288814971; Mon, 29 Jan 2018 21:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517288814; cv=none; d=google.com; s=arc-20160816; b=MDkgqQw+81cSHBGKpf8fuFh46QVm+BR3n0falWXKnFXYYgp6iyLKVLSyJh6npcttvo cP6++6fxq+/4c80+iuLue4jwDZFQiWZztGHhAcvm+eGeQZlTClJVWWNBEO62Iai6J5ab NNXWwFXD4weSJg3rn+HpWw8x5Lv/QXWT14I01fQv6jLT/urUFqHWLwLkwMJnqvF10WFV /KriLhHwti2/rCJrD+R9RGXVpY/Dy6t7swsO213cZ+cHZURr6Be8A3Iq/J41Le1Qc+Az PrFBeUKFRLKKeEEwt8cJMG6UwJ8roLeXDLlMpsN+faJ0nJbwFJTcnEWN19Kb+P8mrUW5 PgOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=sABy8OkGMr5kHfaJwKgHDyXNhR+CUy7MG8FHqTfCRYs=; b=hE4jiRe9SJB2bOXu8CFRu93ivOW509KopwzT/H8MwkaLmDQ78XwqSh/7Nx7cMTAt5W DgUL+ctj6yFIXSMiJ4BxAd/xOGFUgNTP8JY0d7nY73raR0nNInZiknd0ECf4TJ233lyO peRhyEhW98ceM4u0FbpNzilqpgvKOiAI35BhydUm3URwl288jkXB8OEtzE8qMun6ocr4 dleb3mYYCz7zqSAm/en5gQsWxljhobsCw5QzU8fo29/bBZFHjBBIlx/wc7L6WER5EIw7 P+FraEc4z91kZJyXd76GOIyjoN4oWNh3BDC8SkkVOjL/BxqKlpkLMuZBiRsy7m70MQ8M KQyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XKNHEOdD; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p13si2996002pgn.402.2018.01.29.21.06.40; Mon, 29 Jan 2018 21:06:54 -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=@gmail.com header.s=20161025 header.b=XKNHEOdD; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbeA3FF4 (ORCPT + 99 others); Tue, 30 Jan 2018 00:05:56 -0500 Received: from mail-qt0-f179.google.com ([209.85.216.179]:33418 "EHLO mail-qt0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752076AbeA3FFy (ORCPT ); Tue, 30 Jan 2018 00:05:54 -0500 Received: by mail-qt0-f179.google.com with SMTP id d8so15769795qtm.0; Mon, 29 Jan 2018 21:05:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sABy8OkGMr5kHfaJwKgHDyXNhR+CUy7MG8FHqTfCRYs=; b=XKNHEOdDXdztpzuIBPgqObexbvzTWU/5tZdRA7DsHMZmqTa0ZSWJa9FFWWg1IwftbK mieRVUDBI57k4bpGFKSEoJQXWApoIdLpqpGh9Y6ZDKoobZNltjhqzcsCXeQ7Do460zys Sonn4JGCn9tcchvkrkBdQTXZ9g4CPgYXVbeJlz+oMT5dGLmD4o+MJGUC/AdnUoW9Gzmr YANzjpae07o37rHWriuIMrir+U5wZR97UwsQqBltCAJ+ns2zw9NcqwXfL4feJDQOyyfn VS7ajjEYPVTfJ8fGHqOCkLvVHib4MasCi1gW7KkJ+XV0sqQyXoelTydPC0dPcmuAVXga TqYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sABy8OkGMr5kHfaJwKgHDyXNhR+CUy7MG8FHqTfCRYs=; b=Z6gjz0zK/bRhGyZOseCrqqXtpbu6D7GlG8WesScY1Q11zA+80xKrKy9+FCAHWh5btr H1/BIJsSfihaPeWl1xRPG7+adqICcTd3AyrauAY01GDIWod+/UwJjKISSmzfk/CoVtHl evNrEIroV+4sDuqzlgaFgtkroolSN3jpWLqCtWt0Z6EKDdGWf8GHsQ93rP8RcTyaoAFz vHpzzZrEiQikxxjEtHVMpdLw2wWdjUxhwbwdoN/cIPf95qpVTRbqHZLPrOq7fclqxlWY oeA9oRlRh5NaojINhKs015cpcCNE9SxQ8qB8h9gmxc7Of+KPxh+Qv/6pcoXW3DgpD2ox wgtQ== X-Gm-Message-State: AKwxytc9lYfeqTMyS74E/qpqYk1pLW+4eSUZnRYaVykchnzWVVEkAhqH fGMZNQ0E1g04BlJp6g3ZO+rjFfxsdfVViozeXs0= X-Received: by 10.237.63.165 with SMTP id s34mr43919239qth.312.1517288753331; Mon, 29 Jan 2018 21:05:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.34.34 with HTTP; Mon, 29 Jan 2018 21:05:52 -0800 (PST) In-Reply-To: <1516836074-4149-3-git-send-email-jollys@xilinx.com> References: <1516836074-4149-1-git-send-email-jollys@xilinx.com> <1516836074-4149-3-git-send-email-jollys@xilinx.com> From: Shubhrajyoti Datta Date: Tue, 30 Jan 2018 10:35:52 +0530 Message-ID: Subject: Re: [PATCH v3 2/4] drivers: firmware: xilinx: Add ZynqMP firmware driver To: Jolly Shah Cc: ard.biesheuvel@linaro.org, mingo@kernel.org, Greg Kroah-Hartman , matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, Michal Simek , Rob Herring , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Jolly Shah , Rajan Vaja Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Thanks for the patch. A few questions below. On Thu, Jan 25, 2018 at 4:51 AM, Jolly Shah wrote: > This patch is adding communication layer with firmware. > Firmware driver provides an interface to firmware APIs. > Interface APIs can be used by any driver to communicate to > PMUFW(Platform Management Unit). All requests go through ATF. > > Signed-off-by: Jolly Shah > Signed-off-by: Rajan Vaja > --- > > +/** > + * zynqmp_pm_clock_enable - Enable the clock for given id > + * @clock_id: ID of the clock to be enabled Does it enable all the parents also if they are disabled? > + * > + * This function is used by master to enable the clock > + * including peripherals and PLL clocks. > + * > + * Return: Returns status, either success or error+reason. > + */ > +static int zynqmp_pm_clock_enable(u32 clock_id) > +{ > + return invoke_pm_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL); > +} > + > +/** > + * zynqmp_pm_clock_disable - Disable the clock for given id > + * @clock_id: ID of the clock to be disable > + * > + * This function is used by master to disable the clock > + * including peripherals and PLL clocks. > + * > + * Return: Returns status, either success or error+reason. > + */ > +static int zynqmp_pm_clock_disable(u32 clock_id) > +{ > + return invoke_pm_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL); > +} > + > +/** > + * zynqmp_pm_clock_getstate - Get the clock state for given id > + * @clock_id: ID of the clock to be queried > + * @state: 1/0 (Enabled/Disabled) > + * > + * This function is used by master to get the state of clock > + * including peripherals and PLL clocks. > + * > + * Return: Returns status, either success or error+reason. > + */ > +static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) > +{ > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + int ret; > + > + ret = invoke_pm_fn(PM_CLOCK_GETSTATE, clock_id, 0, 0, 0, ret_payload); > + *state = ret_payload[1]; > + > + return ret; > +} > + > +/** > + * zynqmp_pm_clock_setdivider - Set the clock divider for given id > + * @clock_id: ID of the clock > + * @div_type: TYPE_DIV1: div1 > + * TYPE_DIV2: div2 div type didnt see in the signature. > + * @divider: divider value. > + * > + * This function is used by master to set divider for any clock > + * to achieve desired rate. > + * > + * Return: Returns status, either success or error+reason. > + */ > +static int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider) > +{ > + return invoke_pm_fn(PM_CLOCK_SETDIVIDER, clock_id, divider, 0, 0, NULL); > +} > + > +/** > + * zynqmp_pm_clock_getdivider - Get the clock divider for given id > + * @clock_id: ID of the clock > + * @div_type: TYPE_DIV1: div1 > + * TYPE_DIV2: div2 didnt see this below. > + * @divider: divider value. > + * > + * This function is used by master to get divider values > + * for any clock. > + * > + * Return: Returns status, either success or error+reason. > + */ > +static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) > +{ > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + int ret; > + > + ret = invoke_pm_fn(PM_CLOCK_GETDIVIDER, clock_id, 0, 0, 0, ret_payload); > + *divider = ret_payload[1]; > + > + return ret; > +} > + > +/** > + * zynqmp_pm_clock_setrate - Set the clock rate for given id > + * @clock_id: ID of the clock > + * @rate: rate value in hz > + * > + * This function is used by master to set rate for any clock. > + * > + * Return: Returns status, either success or error+reason. > + */ So this can set rate only 4G max ? > +static int zynqmp_pm_clock_setrate(u32 clock_id, u32 rate) > +{ > + return invoke_pm_fn(PM_CLOCK_SETRATE, clock_id, rate, 0, 0, NULL); > +} > + > +/** > + * zynqmp_pm_clock_getrate - Get the clock rate for given id > + * @clock_id: ID of the clock > + * @rate: rate value in hz > + * > + * This function is used by master to get rate > + * for any clock. > + * > + * Return: Returns status, either success or error+reason. > + */ Same question here? > +static int zynqmp_pm_clock_getrate(u32 clock_id, u32 *rate) > +{ > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + int ret; > + > + ret = invoke_pm_fn(PM_CLOCK_GETRATE, clock_id, 0, 0, 0, ret_payload); > + *rate = ret_payload[1]; > + > + return ret; > +} > + Also what is the difference between set rate and set divider?