From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2750DC41604 for ; Tue, 6 Oct 2020 16:00:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A814D2075A for ; Tue, 6 Oct 2020 16:00:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eN5VowWt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A814D2075A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Q1cumgNK8L0NapoWXGoYoD3T9HOWT6tdjUwFs4mgkIE=; b=eN5VowWt9VdjFDkSuEpxViXqPm y+uAlTgY9A3pdhZdNY3IajPGOPGl3EtMkngutyt3whDupYUYd2orSuyrVtSk8fAme9OZFelezopFu v/hFGYX39gffceZQ+FS5eiBWjuE5Ywg0HAKI+0BWv2H0f747KLAih2yxUR2tzN+r9y+Y6CZaosm3I wmwAxGsQ5uacGj9hWMq8t6QNeUD1RFV1Yn1pkpEc8QhRW4UJUpmbXSYmB9XA3vGTbn2U0ZsvlFIGQ CEol0FxVvRM54eN6B3IyZWG92pJuLovvBzwW9uNI074v6nf5bo5drfGYNL/ZZ15b2+Qx9J3rR5g9o EmG9eNFQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPpN1-0001mO-Lj; Tue, 06 Oct 2020 15:59:19 +0000 Received: from mga07.intel.com ([134.134.136.100]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPpMy-0001ko-LU for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2020 15:59:17 +0000 IronPort-SDR: qltO6yWFzh+wzyO1culvJcU212mw5t4WY5+0tOdIiH4oyoly0K8Pd/MeYfgB5fTMTKZZtNQar1 1+0Ktu7dx75w== X-IronPort-AV: E=McAfee;i="6000,8403,9765"; a="228686915" X-IronPort-AV: E=Sophos;i="5.77,343,1596524400"; d="scan'208";a="228686915" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2020 08:59:05 -0700 IronPort-SDR: n3gTXKqyzGGj5EgagxFxtQdWpnG31/gymGCTdpqWXpw4J1yWrTGgPHLYJBa6l2D7XRL4mQgpHQ 5VLIiSoxiwvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,343,1596524400"; d="scan'208";a="343826712" Received: from zulkifl3-ilbpg0.png.intel.com ([10.88.229.114]) by orsmga008.jf.intel.com with ESMTP; 06 Oct 2020 08:59:02 -0700 From: muhammad.husaini.zulkifli@intel.com To: adrian.hunter@intel.com, michal.simek@xilinx.com, sudeep.holla@arm.com, ulf.hansson@linaro.org, linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] firmware: Keem Bay: Add support for Arm Trusted Firmware Service call Date: Tue, 6 Oct 2020 23:55:49 +0800 Message-Id: <20201006155549.3595-3-muhammad.husaini.zulkifli@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201006155549.3595-1-muhammad.husaini.zulkifli@intel.com> References: <20201006155549.3595-1-muhammad.husaini.zulkifli@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_115916_824775_81637C77 X-CRM114-Status: GOOD ( 15.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lakshmi.bai.raja.subramanian@intel.com, muhammad.husaini.zulkifli@intel.com, arnd@arndb.de, wan.ahmad.zainie.wan.mohamad@intel.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Muhammad Husaini Zulkifli Add header file to handle API function for device driver to communicate with Arm Trusted Firmware. Signed-off-by: Muhammad Husaini Zulkifli --- .../linux/firmware/intel/keembay_firmware.h | 46 +++++++++++++++++++ 1 file changed, 46 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..9adb8c87b788 --- /dev/null +++ b/include/linux/firmware/intel/keembay_firmware.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Intel Keembay SOC Firmware API Layer + * + * Copyright (C) 2020-2021, Intel Corporation + * + * Muhammad Husaini Zulkifli + */ + +#ifndef __FIRMWARE_KEEMBAY_SMC_H__ +#define __FIRMWARE_KEEMBAY_SMC_H__ + +#include + +/** + * 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 KEEMBAY_SET_SD_VOLTAGE_FUNC_ID 0x8200ff26 +#define KEEMBAY_SET_1V8_VOLT 0x01 +#define KEEMBAY_SET_3V3_VOLT 0x00 + +#if IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) +static int do_fw_invoke(u64 func_id, u64 arg0, u64 arg1) +{ + struct arm_smccc_res res; + + arm_smccc_1_1_invoke(func_id, arg0, arg1, &res); + + return res.a0; +} + +int keembay_sd_voltage_selection(int volt) +{ + return do_fw_invoke(KEEMBAY_SET_SD_VOLTAGE_FUNC_ID, volt, 0); +} +#else +static inline int keembay_sd_voltage_selection(int volt) +{ + return -ENODEV; +} +#endif + +#endif /* __FIRMWARE_KEEMBAY_SMC_H__ */ -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel