Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31c8fd0a authored by Archit Saxena's avatar Archit Saxena
Browse files

drivers: soc: qcom: Add bg pil driver to 4.14



The change is to bring bg pil driver to 4.14 which
is taken from snapshot of the same driver on 4.9
commit "43ff8774753d32a76f62160f0ad1cecf69fb56e4".
("soc: qcom: Add BG PIL and feature drivers for msm8909w").

Change-Id: I430101cb1c0a4448d77e4315f3bbcf101dadb774
Signed-off-by: default avatarArchit Saxena <archsaxe@codeaurora.org>
parent ec8d33c4
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
Qualcomm Technologies Inc Blackghost(BG) PIL driver:

Blackghost(BG) PIL driver provide interface to load and boot Blackghost(BG)
SOC. Blackghost(BG) SOC is an external SOC which communicate to MSM via
SPI. The PIL driver loads firmware into memory and invoke secure app via
qseecom to transfer and handshake the boot process. Once Blackghost(BG) SOC
is booted it raises ready interrupt which is handled by BG PIL driver, and
this event is informed to other MSM drivers, other remote subsystem via
notifier framework. The PIL driver also handles interrupt for the BG SOC
crash upon arrival of which it reset and initiates ramdump collection for BG
SOC.

Required properties:
- compatible:			Must be "qcom,pil-blackghost"
- qcom,firmware-name:		Base name of the firmware image.
- qcom,bg2ap-status-gpio:	GPIO used by the blackghost to indicate status to the apps.
- qcom,bg2ap-errfatal-gpio:	GPIO used by the blackghost to indicate software error to the apps.
- qcom,ap2bg-status-gpio:	GPIO used by the apps to indicate its status to blackghost.
- qcom,ap2bg-errfatal-gpio:	GPIO used by the apps to indicate blackghost about apps reset.

Example:

	qcom,blackghost {
		compatible = "qcom,pil-blackghost";
		qcom,firmware-name = "bgelf";

		/* GPIO inputs from blackghost */
		qcom,bg2ap-status-gpio = <&msm_gpio 97 0>;
		qcom,bg2ap-errfatal-gpio = <&msm_gpio 95 0>;
		/* GPIO output to blackghost */
		qcom,ap2bg-status-gpio = <&msm_gpio 17 0>;
		qcom,ap2bg-errfatal-gpio = <&msm_gpio 23 0>;
	};
+8 −0
Original line number Diff line number Diff line
@@ -1022,6 +1022,14 @@ config MSM_BAM_DMUX
                communication between G-Link/bg_com_dev and BG processor over SPI.
                This handle the interrupts raised by BG and notify the G-link with
                interrupt event and event data.
config MSM_PIL_SSR_BG
	tristate "MSM Subsystem Blackghost(BG) Support"
	depends on MSM_PIL && MSM_SUBSYSTEM_RESTART
	help
	  Support for booting and shutting down Blackghost(BG) SOC which is
	  an external SOC. This driver communicates with Blackghost(BG) SOC
	  via pair of IPC GPIOs for inward and outward signals between MSM
	  and Blackghost(BG) SOC.

config QCOM_SOC_INFO
	bool "Chip information for QTI SoCs"
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ obj-$(CONFIG_MSM_JTAGV8) += jtagv8.o jtagv8-etm.o
obj-$(CONFIG_MSM_CDSP_LOADER) += qdsp6v2/
obj-$(CONFIG_QCOM_SMCINVOKE) += smcinvoke.o
obj-$(CONFIG_SDX_EXT_IPC) += sdx_ext_ipc.o
obj-$(CONFIG_MSM_PIL_SSR_BG) += subsys-pil-bg.o

ifdef CONFIG_MSM_SUBSYSTEM_RESTART
       obj-y += subsystem_notif.o
+45 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, 2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __BG_INTF_H_
#define __BG_INTF_H_

#define MAX_APP_NAME_SIZE 100
#define RESULT_SUCCESS 0
#define RESULT_FAILURE -1

/* tzapp command list.*/
enum bg_tz_commands {
	BGPIL_RAMDUMP,
	BGPIL_IMAGE_LOAD,
	BGPIL_AUTH_MDT,
	BGPIL_DLOAD_CONT,
	BGPIL_GET_BG_VERSION,
};

/* tzapp bg request.*/
struct tzapp_bg_req {
	uint8_t tzapp_bg_cmd;
	uint8_t padding[3];
	phys_addr_t address_fw;
	size_t size_fw;
} __attribute__ ((__packed__));

/* tzapp bg response.*/
struct tzapp_bg_rsp {
	uint32_t tzapp_bg_cmd;
	uint32_t bg_info_len;
	int32_t status;
	uint32_t bg_info[100];
} __attribute__ ((__packed__));

#endif
+840 −0

File added.

Preview size limit exceeded, changes collapsed.