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

Commit 3aeecfe8 authored by Oana Medvesan's avatar Oana Medvesan Committed by Matt Wagantall
Browse files

t-base400: Add reading of the MC_SSIG interreupt from the device tree.


Add support for 8996 platform

Change-Id: Iee36b86c48863794b63a92d2b28e4123e1bab998
Signed-off-by: default avatarOana Medvesan <medvesan.oana@gmail.com>
Git-commit: cb68d5f254f84bdb653c4d9b97232e6e185b518a
Git-repo: https://github.com/TrustonicNwd/tee-mobicore-driver.kernel/tree/tbase-400


Acked-by: default avatarTony Hamilton <tonyh@qti.qualcomm.com>
Signed-off-by: default avatarPuneet Mishra <puneetm@codeaurora.org>
parent 43a88c97
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -664,6 +664,10 @@ static int __init mobicore_init(void)
	if (err)
		goto fail_create_devs;

	err = irq_setup();
	if (err)
		goto fail_irq_init;

	err = irq_handler_init();
	if (err) {
		MCDRV_ERROR("Interrupts init failed!");
+3 −0
Original line number Diff line number Diff line
@@ -85,6 +85,9 @@ struct mc_device_ctx {
	bool			f_timeout;
	bool			f_mem_ext;
	bool			f_ta_auth;

	/* Interrupt */
	int				irq;
};

extern struct mc_device_ctx g_ctx;
+3 −1
Original line number Diff line number Diff line
@@ -19,10 +19,12 @@
 */
/** @{ */

#include "platform.h"

/* --- global ---- */
#define MC_FC_INVALID	((uint32_t)0)  /**< Invalid FastCall ID */

#if defined(__AARCH32__)
#if defined(CONFIG_ARM64) && !defined(MC_ARMV7_FC)

/* These should be handled as 64-bit FCs; now they are more like 32bits... */
#define MC_FC_STD64_BASE	((uint32_t)0xFF000000)
+26 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/of_irq.h>

#include "public/mc_linux.h"
#include "public/mc_admin.h"
@@ -192,15 +193,38 @@ void nqueue_cleanup(void)
		free_pages((ulong)mci_base, order);
}

int irq_setup(void)
{
	int result = 0;

	g_ctx.irq=-1;

#if defined(CONFIG_OF)
	g_ctx.irq = irq_of_parse_and_map(g_ctx.mcd->of_node, 0);
#endif
#if defined(MC_INTR_SSIQ)
 	 if (g_ctx.irq < 0)
 	      	g_ctx.irq = MC_INTR_SSIQ;
#endif

	if (g_ctx.irq <= 0) {
		MCDRV_ERROR("No IRQ number, aborting");
		result  = ENODEV;
	}
	MCDRV_DBG(" MC_INTR_SSIQ set to %d", g_ctx.irq);

	return result;
}

/* Set up S-SIQ interrupt handler */
int irq_handler_init(void)
{
	return request_irq(MC_INTR_SSIQ, irq_handler, IRQF_TRIGGER_RISING,
	return request_irq(g_ctx.irq, irq_handler, IRQF_TRIGGER_RISING,
			   MC_ADMIN_DEVNODE, NULL);
}

void irq_handler_exit(void)
{
	flush_scheduled_work();
	free_irq(MC_INTR_SSIQ, g_ctx.mcd);
	free_irq(g_ctx.irq, g_ctx.mcd);
}
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

int nqueue_init(uint16_t txq_length, uint16_t rxq_length);
void nqueue_cleanup(void);
int irq_setup(void);
int irq_handler_init(void);
void irq_handler_exit(void);

Loading