All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: julien.grall@arm.com, sstabellini@kernel.org, xen-devel@lists.xen.org
Subject: Re: [RFC v1 5/6] xen/arm: zynqmp: Forward plaform specific firmware calls
Date: Tue, 31 Jan 2017 10:52:51 +0100	[thread overview]
Message-ID: <20170131095251.GF14990@toto> (raw)
In-Reply-To: <1485796915-9372-6-git-send-email-edgar.iglesias@gmail.com>

On Mon, Jan 30, 2017 at 06:21:54PM +0100, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> 
> Forward platform specific firmware calls from the hardware
> domain to firmware.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> ---
>  xen/arch/arm/platforms/xilinx-zynqmp.c | 63 ++++++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
> 
> diff --git a/xen/arch/arm/platforms/xilinx-zynqmp.c b/xen/arch/arm/platforms/xilinx-zynqmp.c
> index 2adee91..bde7f52 100644
> --- a/xen/arch/arm/platforms/xilinx-zynqmp.c
> +++ b/xen/arch/arm/platforms/xilinx-zynqmp.c
> @@ -19,6 +19,46 @@
>  
>  #include <asm/platform.h>
>  
> +/* Service calls.  */
> +#define SVC_MASK             0x3F000000
> +#define SVC_SIP              0x02000000    /* SoC Implementation Specific.  */
> +
> +/* SMC function IDs for SiP Service queries */
> +#define ZYNQMP_SIP_SVC_CALL_COUNT       0xff00
> +#define ZYNQMP_SIP_SVC_UID              0xff01
> +#define ZYNQMP_SIP_SVC_VERSION          0xff03
> +
> +enum pm_api_id {
> +    /* Miscellaneous API functions: */
> +    GET_API_VERSION = 1,
> +    SET_CONFIGURATION,

These pm_api_id enums are a left over and not needed, I'll remove them from
future versions of this patch.

Cheers,
Edgar


> +    GET_NODE_STATUS,
> +    GET_OPERATING_CHARACTERISTIC,
> +    REGISTER_NOTIFIER,
> +    /* API for suspending of PUs: */
> +    REQUEST_SUSPEND,
> +    SELF_SUSPEND,
> +    FORCE_POWERDOWN,
> +    ABORT_SUSPEND,
> +    REQUEST_WAKEUP,
> +    SET_WAKEUP_SOURCE,
> +    SYSTEM_SHUTDOWN,
> +    /* API for managing PM slaves: */
> +    REQUEST_NODE,
> +    RELEASE_NODE,
> +    SET_REQUIREMENT,
> +    SET_MAX_LATENCY,
> +    /* Direct control API functions: */
> +    RESET_ASSERT,
> +    RESET_GET_STATUS,
> +    MMIO_WRITE,
> +    MMIO_READ,
> +    PM_INIT,
> +    FPGA_LOAD,
> +    FPGA_GET_STATUS,
> +    GET_CHIPID,
> +};
> +
>  static const char * const zynqmp_dt_compat[] __initconst =
>  {
>      "xlnx,zynqmp",
> @@ -32,8 +72,31 @@ static const struct dt_device_match zynqmp_blacklist_dev[] __initconst =
>      { /* sentinel */ },
>  };
>  
> +bool zynqmp_hvc(struct cpu_user_regs *regs)
> +{
> +    uint32_t fid = regs->x0;
> +    uint32_t svc = fid & SVC_MASK;
> +    register_t ret[4];
> +
> +    /* We only forward SiP service calls from the hw domain to firmware.  */
> +    if ( svc != SVC_SIP || !is_hardware_domain(current->domain) )
> +        return false;
> +
> +    /* Forward the call.  */
> +    call_smcc64(regs->x0, regs->x1, regs->x2, regs->x3,
> +                regs->x4, regs->x5, regs->x6, ret);
> +
> +    /* Transfer return values into guest registers.  */
> +    regs->x0 = ret[0];
> +    regs->x1 = ret[1];
> +    regs->x2 = ret[2];
> +    regs->x3 = ret[3];
> +    return true;
> +}
> +
>  PLATFORM_START(xgene_storm, "Xilinx ZynqMP")
>      .compatible = zynqmp_dt_compat,
> +    .hvc = zynqmp_hvc,
>      .blacklist_dev = zynqmp_blacklist_dev,
>  PLATFORM_END
>  
> -- 
> 2.7.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-01-31  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 17:21 [RFC v1 0/6] zynqmp: Add forwarding of platform specific firmware calls Edgar E. Iglesias
2017-01-30 17:21 ` [RFC v1 1/6] xen/arm: traps: Reorder early overwrite of FID Edgar E. Iglesias
2017-01-30 17:21 ` [RFC v1 2/6] xen/arm: Introduce platform_hvc Edgar E. Iglesias
2017-01-30 17:21 ` [RFC v1 3/6] xen/arm: Allow platform_hvc to handle guest SMC calls Edgar E. Iglesias
2017-01-30 17:21 ` [RFC v1 4/6] xen/arm: Introduce call_smcc64 Edgar E. Iglesias
2017-01-30 17:21 ` [RFC v1 5/6] xen/arm: zynqmp: Forward plaform specific firmware calls Edgar E. Iglesias
2017-01-31  9:52   ` Edgar E. Iglesias [this message]
2017-01-30 17:21 ` [RFC v1 6/6] xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node Edgar E. Iglesias

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=20170131095251.GF14990@toto \
    --to=edgar.iglesias@xilinx.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.