[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f268c578-69f4-3ee4-f5b2-f8b00dd21265@xilinx.com>
Date: Thu, 8 Oct 2020 09:35:33 +0200
From: Michal Simek <michal.simek@...inx.com>
To: muhammad.husaini.zulkifli@...el.com, adrian.hunter@...el.com,
michal.simek@...inx.com, andriy.shevchenko@...el.com,
ulf.hansson@...aro.org, linux-mmc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: lakshmi.bai.raja.subramanian@...el.com,
wan.ahmad.zainie.wan.mohamad@...el.com, arnd@...db.de
Subject: Re: [PATCH v4 1/4] firmware: keembay: Add support for Arm Trusted
Firmware Service call
On 08. 10. 20 4:09, muhammad.husaini.zulkifli@...el.com wrote:
> From: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
>
> Add header file to handle API function for device driver to communicate
> with Arm Trusted Firmware.
>
> Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
> ---
> .../linux/firmware/intel/keembay_firmware.h | 47 +++++++++++++++++++
> 1 file changed, 47 insertions(+)
> create mode 100644 include/linux/firmware/intel/keembay_firmware.h
>
> diff --git a/include/linux/firmware/intel/keembay_firmware.h b/include/linux/firmware/intel/keembay_firmware.h
> new file mode 100644
> index 000000000000..8a62abcdfead
> --- /dev/null
> +++ b/include/linux/firmware/intel/keembay_firmware.h
> @@ -0,0 +1,47 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Intel Keembay SOC Firmware API Layer
> + *
> + * Copyright (C) 2020-2021, Intel Corporation
> + *
> + * Muhammad Husaini Zulkifli <Muhammad.Husaini.Zulkifli@...el.com>
> + */
> +
> +#ifndef __FIRMWARE_KEEMBAY_SMC_H__
> +#define __FIRMWARE_KEEMBAY_SMC_H__
> +
> +#include <linux/arm-smccc.h>
> +
> +/*
> + * This file defines API function that can be called by device driver in order to
> + * communicate with Arm Trusted Firmware.
> + */
> +
> +/* Setting for Keem Bay IO Pad Line Voltage Selection */
> +#define ARM_SMCCC_SIP_KEEMBAY_SET_SD_VOLTAGE \
> + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
> + ARM_SMCCC_SMC_32, \
> + ARM_SMCCC_OWNER_SIP, \
> + 0xFF26)
> +
> +#define KEEMBAY_SET_1V8_VOLT 1
> +#define KEEMBAY_SET_3V3_VOLT 0
> +
> +#if IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY)
> +static inline int keembay_sd_voltage_selection(int volt)
> +{
> + struct arm_smccc_res res;
> +
> + arm_smccc_1_1_invoke(ARM_SMCCC_SIP_KEEMBAY_SET_SD_VOLTAGE, volt, &res);
> + if ((int)res.a0 < 0)
> + return -EINVAL;
> +
> + return 0;
> +}
> +#else
> +static inline int keembay_sd_voltage_selection(int volt)
> +{
> + return -ENODEV;
> +}
> +#endif
> +#endif /* __FIRMWARE_KEEMBAY_SMC_H__ */
>
This looks good to me.
Acked-by: Michal Simek <michal.simek@...inx.com>
Thanks,
Michal
Powered by blists - more mailing lists