remoteproc: qcom: Extract non-mdt related helper
In preparation for moving the mdt loader out of remoteproc let's move the somewhat unrelated resource table dummy helper to a Qualcomm "common" file. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
e7fd252262
commit
bde440eee2
|
@ -78,11 +78,15 @@ config QCOM_ADSP_PIL
|
|||
depends on QCOM_SMEM
|
||||
select MFD_SYSCON
|
||||
select QCOM_MDT_LOADER
|
||||
select QCOM_RPROC_COMMON
|
||||
select QCOM_SCM
|
||||
help
|
||||
Say y here to support the TrustZone based Peripherial Image Loader
|
||||
for the Qualcomm ADSP remote processors.
|
||||
|
||||
config QCOM_RPROC_COMMON
|
||||
tristate
|
||||
|
||||
config QCOM_MDT_LOADER
|
||||
tristate
|
||||
|
||||
|
@ -92,6 +96,7 @@ config QCOM_Q6V5_PIL
|
|||
depends on QCOM_SMEM
|
||||
depends on REMOTEPROC
|
||||
select MFD_SYSCON
|
||||
select QCOM_RPROC_COMMON
|
||||
select QCOM_SCM
|
||||
help
|
||||
Say y here to support the Qualcomm Peripherial Image Loader for the
|
||||
|
@ -104,6 +109,7 @@ config QCOM_WCNSS_PIL
|
|||
depends on QCOM_SMEM
|
||||
depends on REMOTEPROC
|
||||
select QCOM_MDT_LOADER
|
||||
select QCOM_RPROC_COMMON
|
||||
select QCOM_SCM
|
||||
help
|
||||
Say y here to support the Peripheral Image Loader for the Qualcomm
|
||||
|
|
|
@ -13,6 +13,7 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
|
|||
obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o
|
||||
obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp_pil.o
|
||||
obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o
|
||||
obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o
|
||||
obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o
|
||||
obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
|
||||
qcom_wcnss_pil-y += qcom_wcnss.o
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/soc/qcom/smem.h>
|
||||
#include <linux/soc/qcom/smem_state.h>
|
||||
|
||||
#include "qcom_common.h"
|
||||
#include "qcom_mdt_loader.h"
|
||||
#include "remoteproc_internal.h"
|
||||
|
||||
|
|
46
drivers/remoteproc/qcom_common.c
Normal file
46
drivers/remoteproc/qcom_common.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Qualcomm Peripheral Image Loader helpers
|
||||
*
|
||||
* Copyright (C) 2016 Linaro Ltd
|
||||
* Copyright (C) 2015 Sony Mobile Communications Inc
|
||||
* Copyright (c) 2012-2013, 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 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.
|
||||
*/
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/remoteproc.h>
|
||||
|
||||
#include "remoteproc_internal.h"
|
||||
#include "qcom_common.h"
|
||||
|
||||
/**
|
||||
* qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc
|
||||
* @rproc: remoteproc handle
|
||||
* @fw: firmware header
|
||||
* @tablesz: outgoing size of the table
|
||||
*
|
||||
* Returns a dummy table.
|
||||
*/
|
||||
struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
|
||||
const struct firmware *fw,
|
||||
int *tablesz)
|
||||
{
|
||||
static struct resource_table table = { .ver = 1, };
|
||||
|
||||
*tablesz = sizeof(table);
|
||||
return &table;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table);
|
||||
|
||||
MODULE_DESCRIPTION("Qualcomm Remoteproc helper driver");
|
||||
MODULE_LICENSE("GPL v2");
|
11
drivers/remoteproc/qcom_common.h
Normal file
11
drivers/remoteproc/qcom_common.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#ifndef __RPROC_QCOM_COMMON_H__
|
||||
#define __RPROC_QCOM_COMMON_H__
|
||||
|
||||
struct resource_table;
|
||||
struct rproc;
|
||||
|
||||
struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
|
||||
const struct firmware *fw,
|
||||
int *tablesz);
|
||||
|
||||
#endif
|
|
@ -26,25 +26,6 @@
|
|||
#include "remoteproc_internal.h"
|
||||
#include "qcom_mdt_loader.h"
|
||||
|
||||
/**
|
||||
* qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc
|
||||
* @rproc: remoteproc handle
|
||||
* @fw: firmware header
|
||||
* @tablesz: outgoing size of the table
|
||||
*
|
||||
* Returns a dummy table.
|
||||
*/
|
||||
struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
|
||||
const struct firmware *fw,
|
||||
int *tablesz)
|
||||
{
|
||||
static struct resource_table table = { .ver = 1, };
|
||||
|
||||
*tablesz = sizeof(table);
|
||||
return &table;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table);
|
||||
|
||||
/**
|
||||
* qcom_mdt_parse() - extract useful parameters from the mdt header
|
||||
* @fw: firmware handle
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define QCOM_MDT_TYPE_HASH (2 << 24)
|
||||
#define QCOM_MDT_RELOCATABLE BIT(27)
|
||||
|
||||
struct resource_table * qcom_mdt_find_rsc_table(struct rproc *rproc, const struct firmware *fw, int *tablesz);
|
||||
int qcom_mdt_load(struct rproc *rproc, const struct firmware *fw, const char *fw_name);
|
||||
|
||||
int qcom_mdt_parse(const struct firmware *fw, phys_addr_t *fw_addr, size_t *fw_size, bool *fw_relocate);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <linux/soc/qcom/smem_state.h>
|
||||
|
||||
#include "remoteproc_internal.h"
|
||||
#include "qcom_common.h"
|
||||
#include "qcom_mdt_loader.h"
|
||||
|
||||
#include <linux/qcom_scm.h>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/soc/qcom/smem_state.h>
|
||||
#include <linux/rpmsg/qcom_smd.h>
|
||||
|
||||
#include "qcom_common.h"
|
||||
#include "qcom_mdt_loader.h"
|
||||
#include "remoteproc_internal.h"
|
||||
#include "qcom_wcnss.h"
|
||||
|
|
Loading…
Reference in New Issue
Block a user