[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 3/6] xen/arm: zynqmp: introduce zynqmp specific defines



On Tue, 18 Dec 2018, Julien Grall wrote:
> Hi Stefano,
> 
> On 12/17/18 10:10 PM, Stefano Stabellini wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxxx>
> > 
> > From: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx>
> > 
> > Introduce zynqmp specific defines for the firmware calls.
> > See EEMI:
> > https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf
> > 
> > The error codes are described, under XIlPM Error Codes:
> > https://www.xilinx.com/support/documentation/user_guides/ug1137-zynq-ultrascale-mpsoc-swdev.pdf
> > 
> > - pm_api_id
> > These are the EEMI function IDs. Unavoidable.
> > 
> > - pm_ret_status
> > These are the EEMI return statuses. Unavoidable.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx>
> > Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
> > 
> > ---
> > 
> > Changes in v7:
> > - introduce EEMI_FID
> > - remove tabs
> > 
> > Changes in v6:
> > - improve commit message
> > - remove MM_*, node ids and reset ids
> > 
> > Changes in v5:
> > - remove MMIO access related definitions
> > 
> > Changes in v4:
> > - define PM_MMIO_SHIFT
> > ---
> >   xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h | 90
> > ++++++++++++++++++++++
> >   1 file changed, 90 insertions(+)
> > 
> > diff --git a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
> > b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
> > index 43cefb5..9779b6a 100644
> > --- a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
> > +++ b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
> > @@ -15,6 +15,96 @@
> >   #define __ASM_ASM_PLATFORMS_ZYNQMP_H
> >     #include <asm/processor.h>
> > +#include <asm/smccc.h>
> > +
> > +/* Service calls.  */
> > +#define PM_GET_TRUSTZONE_VERSION   0xa03
> 
> Why does not this belong to the pm_api_id below?

You are right, I'll move it below into the enum.


> > +
> > +/* 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 > +
> > +#define EEMI_FID(fid) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
> > +                                         ARM_SMCCC_CONV_64,   \
> > +                                         ARM_SMCCC_OWNER_SIP, \
> > +                                         fid)
> > +
> > +enum pm_api_id {
> > +    /* Miscellaneous API functions: */
> > +    PM_GET_API_VERSION = 1, /* Do not change or move */
> > +    PM_SET_CONFIGURATION,
> > +    PM_GET_NODE_STATUS,
> > +    PM_GET_OP_CHARACTERISTIC,
> > +    PM_REGISTER_NOTIFIER,
> > +    /* API for suspending of PUs: */
> > +    PM_REQ_SUSPEND,
> > +    PM_SELF_SUSPEND,
> > +    PM_FORCE_POWERDOWN,
> > +    PM_ABORT_SUSPEND,
> > +    PM_REQ_WAKEUP,
> > +    PM_SET_WAKEUP_SOURCE,
> > +    PM_SYSTEM_SHUTDOWN,
> > +    /* API for managing PM slaves: */
> > +    PM_REQ_NODE,
> > +    PM_RELEASE_NODE,
> > +    PM_SET_REQUIREMENT,
> > +    PM_SET_MAX_LATENCY,
> > +    /* Direct control API functions: */
> > +    PM_RESET_ASSERT,
> > +    PM_RESET_GET_STATUS,
> > +    PM_MMIO_WRITE,
> > +    PM_MMIO_READ,
> > +    PM_INIT,
> > +    PM_FPGA_LOAD,
> > +    PM_FPGA_GET_STATUS,
> > +    PM_GET_CHIPID,
> > +    /* ID 25 is been used by U-boot to process secure boot images */
> > +    /* Secure library generic API functions */
> > +    PM_SECURE_SHA = 26,
> > +    PM_SECURE_RSA,
> > +    /* Pin control API functions */
> > +    PM_PINCTRL_REQUEST,
> > +    PM_PINCTRL_RELEASE,
> > +    PM_PINCTRL_GET_FUNCTION,
> > +    PM_PINCTRL_SET_FUNCTION,
> > +    PM_PINCTRL_CONFIG_PARAM_GET,
> > +    PM_PINCTRL_CONFIG_PARAM_SET,
> > +    /* PM IOCTL API */
> > +    PM_IOCTL,
> > +    /* API to query information from firmware */
> > +    PM_QUERY_DATA,
> > +    /* Clock control API functions */
> > +    PM_CLOCK_ENABLE,
> > +    PM_CLOCK_DISABLE,
> > +    PM_CLOCK_GETSTATE,
> > +    PM_CLOCK_SETDIVIDER,
> > +    PM_CLOCK_GETDIVIDER,
> > +    PM_CLOCK_SETRATE,
> > +    PM_CLOCK_GETRATE,
> > +    PM_CLOCK_SETPARENT,
> > +    PM_CLOCK_GETPARENT,
> > +    PM_API_MAX
> > +};
> > +
> > +/**
> > + * @XST_PM_SUCCESS:                Success
> > + * @XST_PM_INTERNAL:       Unexpected error
> > + * @XST_PM_CONFLICT:       Conflicting requirements
> > + * @XST_PM_NO_ACCESS:      Access rights violation
> > + * @XST_PM_INVALID_NODE:   Does not apply to node passed as argument
> > + * @XST_PM_DOUBLE_REQ:     Duplicate request
> > + * @XST_PM_ABORT_SUSPEND:  Target has aborted suspend
> > + */
> > +enum pm_ret_status {
> > +    XST_PM_SUCCESS = 0,
> > +    XST_PM_INTERNAL = 2000,
> > +    XST_PM_CONFLICT,
> > +    XST_PM_NO_ACCESS,
> > +    XST_PM_INVALID_NODE,
> > +    XST_PM_DOUBLE_REQ,
> > +    XST_PM_ABORT_SUSPEND,
> > +};
> >     extern bool zynqmp_eemi(struct cpu_user_regs *regs);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.