linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jolly Shah <JOLLYS@xilinx.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: "ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"matt@codeblueprint.co.uk" <matt@codeblueprint.co.uk>,
	"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	Rajan Vaja <RAJANV@xilinx.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"michal.simek@xilinx.com" <michal.simek@xilinx.com>
Subject: RE: [PATCH v5 2/4] drivers: firmware: xilinx: Add ZynqMP firmware driver
Date: Mon, 12 Mar 2018 23:05:39 +0000	[thread overview]
Message-ID: <DM2PR0201MB07673298E409D07F0F748316B8D30@DM2PR0201MB0767.namprd02.prod.outlook.com> (raw)
In-Reply-To: <2fb8ee8c-35ac-b7e6-e691-84464b0c8745@arm.com>


Hi Sudeep,

> -----Original Message-----
> From: Sudeep Holla [mailto:sudeep.holla@arm.com]
> Sent: Thursday, March 08, 2018 4:19 AM
> To: Jolly Shah <JOLLYS@xilinx.com>; michal.simek@xilinx.com
> Cc: Sudeep Holla <sudeep.holla@arm.com>; ard.biesheuvel@linaro.org;
> mingo@kernel.org; gregkh@linuxfoundation.org; matt@codeblueprint.co.uk;
> hkallweit1@gmail.com; keescook@chromium.org;
> dmitry.torokhov@gmail.com; robh+dt@kernel.org; mark.rutland@arm.com;
> Rajan Vaja <RAJANV@xilinx.com>; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH v5 2/4] drivers: firmware: xilinx: Add ZynqMP firmware
> driver
> 
> 
> 
> On 07/03/18 00:44, Jolly Shah wrote:
> > Hi Sudeep,
> >
> > Thanks for the review,
> >
> >> -----Original Message-----
> >> From: Sudeep Holla [mailto:sudeep.holla@arm.com]
> >> Sent: Thursday, March 01, 2018 6:28 AM
> >> To: Jolly Shah <JOLLYS@xilinx.com>; michal.simek@xilinx.com
> >> Cc: ard.biesheuvel@linaro.org; mingo@kernel.org;
> >> gregkh@linuxfoundation.org; matt@codeblueprint.co.uk;
> >> hkallweit1@gmail.com; keescook@chromium.org;
> >> dmitry.torokhov@gmail.com; robh+dt@kernel.org; mark.rutland@arm.com;
> >> Sudeep Holla <sudeep.holla@arm.com>; Rajan Vaja <RAJANV@xilinx.com>;
> >> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> >> devicetree@vger.kernel.org; Jolly Shah <JOLLYS@xilinx.com>
> >> Subject: Re: [PATCH v5 2/4] drivers: firmware: xilinx: Add ZynqMP
> >> firmware driver
> >>
> >>
> >>
> >> On 20/02/18 19:21, 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 <jollys@xilinx.com>
> >>> Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
> >>> ---
> >>>  arch/arm64/Kconfig.platforms                    |    1 +
> >>>  drivers/firmware/Kconfig                        |    1 +
> >>>  drivers/firmware/Makefile                       |    1 +
> >>>  drivers/firmware/xilinx/Kconfig                 |    4 +
> >>>  drivers/firmware/xilinx/Makefile                |    4 +
> >>>  drivers/firmware/xilinx/zynqmp/Kconfig          |   16 +
> >>>  drivers/firmware/xilinx/zynqmp/Makefile         |    4 +
> >>>  drivers/firmware/xilinx/zynqmp/firmware.c       | 1051
> >> +++++++++++++++++++++++
> >>>  include/linux/firmware/xilinx/zynqmp/firmware.h |  590
> >>> +++++++++++++
> >>>  9 files changed, 1672 insertions(+)  create mode 100644
> >>> drivers/firmware/xilinx/Kconfig  create mode
> >>> 100644 drivers/firmware/xilinx/Makefile  create mode 100644
> >>> drivers/firmware/xilinx/zynqmp/Kconfig
> >>>  create mode 100644 drivers/firmware/xilinx/zynqmp/Makefile
> >>>  create mode 100644 drivers/firmware/xilinx/zynqmp/firmware.c
> >>>  create mode 100644 include/linux/firmware/xilinx/zynqmp/firmware.h
> >>>
> >>> +
> >>> +/**
> >>> + * zynqmp_pm_force_powerdown - PM call to request for another PU or
> >> subsystem to
> >>> + *				be powered down forcefully
> >>> + * @target:	Node ID of the targeted PU or subsystem
> >>> + * @ack:	Flag to specify whether acknowledge is requested
> >>> + *
> >>> + * Return:	Returns status, either success or error+reason
> >>> + */
> >>> +static int zynqmp_pm_force_powerdown(const u32 target,
> >>> +				     const enum zynqmp_pm_request_ack ack) {
> >>> +	return zynqmp_pm_invoke_fn(PM_FORCE_POWERDOWN, target, ack,
> >> 0, 0,
> >>> +NULL); }
> >>> +
> >>
> >> [...]
> >>
> >>> +/**
> >>> + * zynqmp_pm_system_shutdown - PM call to request a system shutdown
> >>> +or
> >> restart
> >>> + * @type:	Shutdown or restart? 0 for shutdown, 1 for restart
> >>> + * @subtype:	Specifies which system should be restarted or shut
> down
> >>> + *
> >>> + * Return:	Returns status, either success or error+reason
> >>> + */
> >>> +static int zynqmp_pm_system_shutdown(const u32 type, const u32
> >>> +subtype) {
> >>> +	return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype,
> >>> +				   0, 0, NULL);
> >>> +}
> >>> +
> >>
> >> I can't understand why you need above 2 APIs: PM_FORCE_POWERDOWN
> and
> >> PM_SYSTEM_SHUTDOWN. You should use PSCI_SYSTEM_OFF and
> >> PSCI_SYSTEM_RESET and drop these two.
> >>
> >
> > FORCE_POWERDOWN allows remote master to force power off other
> > node/domain. SYSTEM_SHUTDOWN provides interface to shutdown/restart
> > the subsystem. It supports system/subsystem restart with argument
> > value.> PSCI doesn’t
> support argument to identify between restart types.
> 
> OK, what are the types you are referring here ? or why PSCI is not sufficient ?
> How do you plan to use these APIs in Linux ?

It supports system/subsystem restart as types. For example, only APU restart, system restart, PS restart for ZynqMP
PSCI doesn’t support any argument to identify these types.
Linux, one can set the reset scope through debug interface and execute "reboot" then. Inside ATF, PSCI_SYSTEM_RESET mapped function will call EEMI API with that scope.

> 
> >>
> >>> +static const struct zynqmp_eemi_ops eemi_ops = {
> >>> +	.get_api_version = zynqmp_pm_get_api_version,
> >>> +	.get_chipid = zynqmp_pm_get_chipid,
> >>> +	.reset_assert = zynqmp_pm_reset_assert,
> >>> +	.reset_get_status = zynqmp_pm_reset_get_status,
> >>> +	.fpga_load = zynqmp_pm_fpga_load,
> >>> +	.fpga_get_status = zynqmp_pm_fpga_get_status,
> >>> +	.sha_hash = zynqmp_pm_sha_hash,
> >>> +	.rsa = zynqmp_pm_rsa,
> >>> +	.request_suspend = zynqmp_pm_request_suspend,
> >>> +	.force_powerdown = zynqmp_pm_force_powerdown,
> >>> +	.request_wakeup = zynqmp_pm_request_wakeup,
> >>> +	.set_wakeup_source = zynqmp_pm_set_wakeup_source,
> >>> +	.system_shutdown = zynqmp_pm_system_shutdown,
> >>> +	.request_node = zynqmp_pm_request_node,
> >>> +	.release_node = zynqmp_pm_release_node,
> >>> +	.set_requirement = zynqmp_pm_set_requirement,
> >>> +	.set_max_latency = zynqmp_pm_set_max_latency,
> >>> +	.set_configuration = zynqmp_pm_set_configuration,
> >>> +	.get_node_status = zynqmp_pm_get_node_status,
> >>> +	.get_operating_characteristic =
> >> zynqmp_pm_get_operating_characteristic,
> >>> +	.init_finalize = zynqmp_pm_init_finalize,
> >>> +	.set_suspend_mode = zynqmp_pm_set_suspend_mode,
> >>> +	.ioctl = zynqmp_pm_ioctl,
> >>> +	.query_data = zynqmp_pm_query_data,
> >>> +	.pinctrl_request = zynqmp_pm_pinctrl_request,
> >>> +	.pinctrl_release = zynqmp_pm_pinctrl_release,
> >>> +	.pinctrl_get_function = zynqmp_pm_pinctrl_get_function,
> >>> +	.pinctrl_set_function = zynqmp_pm_pinctrl_set_function,
> >>> +	.pinctrl_get_config = zynqmp_pm_pinctrl_get_config,
> >>> +	.pinctrl_set_config = zynqmp_pm_pinctrl_set_config,
> >>> +	.clock_enable = zynqmp_pm_clock_enable,
> >>> +	.clock_disable = zynqmp_pm_clock_disable,
> >>> +	.clock_getstate = zynqmp_pm_clock_getstate,
> >>> +	.clock_setdivider = zynqmp_pm_clock_setdivider,
> >>> +	.clock_getdivider = zynqmp_pm_clock_getdivider,
> >>> +	.clock_setrate = zynqmp_pm_clock_setrate,
> >>> +	.clock_getrate = zynqmp_pm_clock_getrate,
> >>> +	.clock_setparent = zynqmp_pm_clock_setparent,
> >>> +	.clock_getparent = zynqmp_pm_clock_getparent, };
> >>> +
> >> Instead of introducing all these in oneshot, add them as you have users of it.
> >> IOW, show the users of these functions in the series. Also I asked to
> >> split this into functional changes like clock, pinctrl, power, etc.
> >
> > It can be split into functional changes in same series but it will be
> > difficult to split between users as there are more than 10 driver
> > users for different EEMI APIs and also multiple driver users using
> > specifc EEMI APIs. They all can't be submitted as single series.
> >
> 
> Why ? Start with basic EEMI and one functionality with it's user/client driver in
> one series. Then you can top up with EEMI changes for other functionality with
> it's user. If you introduce API's without the users in a series it's hard to review
> and if there are more such unused APIs I will object it in future versions.
> 
> To start with add only clock or power APIs and functionality in this series, add
> drivers using then. Drop other functionalities like pinctrl, fpga control and other
> functionalities. IOW start something basic and simple.
> 

I am ok to break it for clock/pinctrl with users but there are multiple users for some APIs. In that case, it will create dependency issues when different owners are involved.
Also, it will hard to visualize a whole EEMI interface if its broken into such pieces. 

> --
> Regards,
> Sudeep

  reply	other threads:[~2018-03-12 23:05 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-20 19:21 [PATCH v5 0/4] drivers: firmware: xilinx: Add firmware driver support Jolly Shah
2018-02-20 19:21 ` [PATCH v5 1/4] dt-bindings: firmware: Add bindings for ZynqMP firmware Jolly Shah
2018-03-01 14:15   ` Sudeep Holla
2018-03-07 22:25     ` Jolly Shah
2018-03-08 11:48       ` Sudeep Holla
2018-03-12 23:07         ` Jolly Shah
2018-03-13 10:16           ` Sudeep Holla
2018-03-13 18:56             ` Jolly Shah
2018-03-01 21:18   ` Rob Herring
2018-02-20 19:21 ` [PATCH v5 2/4] drivers: firmware: xilinx: Add ZynqMP firmware driver Jolly Shah
2018-03-01 14:27   ` Sudeep Holla
2018-03-07  0:44     ` Jolly Shah
2018-03-08 12:18       ` Sudeep Holla
2018-03-12 23:05         ` Jolly Shah [this message]
2018-03-13 10:24           ` Sudeep Holla
2018-03-15 17:53             ` Jolly Shah
2018-03-15 17:57               ` Sudeep Holla
2018-03-14 13:22   ` Greg KH
2018-02-20 19:21 ` [PATCH v5 3/4] drivers: firmware: xilinx: Add sysfs interface Jolly Shah
2018-03-01 13:32   ` Michal Simek
2018-03-01 14:09   ` Andy Shevchenko
2018-03-01 14:44   ` Sudeep Holla
2018-03-07 22:03     ` Jolly Shah
2018-02-20 19:21 ` [PATCH v5 4/4] drivers: firmware: xilinx: Add debugfs interface Jolly Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM2PR0201MB07673298E409D07F0F748316B8D30@DM2PR0201MB0767.namprd02.prod.outlook.com \
    --to=jollys@xilinx.com \
    --cc=RAJANV@xilinx.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hkallweit1@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=michal.simek@xilinx.com \
    --cc=mingo@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).