mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 09:42:19 +03:00
misc: mods: add support for kstable
Bug 3660609 Change-Id: Iaa6e4e048afc1a1e26d5dccc361a18322a23b47e Signed-off-by: Chris Dragan <kdragan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2726143 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Rohit Khanna <rokhanna@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
86c8a8033d
commit
d8714b7da4
@@ -1,19 +1,35 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
ccflags-y += -I$(srctree.nvidia)/include
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_TEGRA_OOT_MODULE),m)
|
||||||
|
CONFIG_MODS := m
|
||||||
|
endif
|
||||||
|
|
||||||
obj-$(CONFIG_MODS) := mods.o
|
obj-$(CONFIG_MODS) := mods.o
|
||||||
mods-y := mods_krnl.o
|
|
||||||
|
mods-y := mods_irq.o
|
||||||
|
mods-y += mods_krnl.o
|
||||||
mods-y += mods_mem.o
|
mods-y += mods_mem.o
|
||||||
mods-y += mods_irq.o
|
|
||||||
mods-$(CONFIG_TRUSTY) += mods_tz.o
|
|
||||||
mods-$(CONFIG_COMMON_CLK) += mods_clock.o
|
|
||||||
mods-$(CONFIG_ARCH_TEGRA) += mods_tegraprod.o
|
|
||||||
mods-$(CONFIG_ARCH_TEGRA_19x_SOC) += mods_ras.o
|
|
||||||
mods-$(CONFIG_PCI) += mods_pci.o
|
|
||||||
mods-$(CONFIG_ACPI) += mods_acpi.o
|
mods-$(CONFIG_ACPI) += mods_acpi.o
|
||||||
mods-$(CONFIG_DMA_SHARED_BUFFER) += mods_dmabuf.o
|
|
||||||
mods-$(CONFIG_ARCH_TEGRA) += mods_smmu_drv.o
|
|
||||||
mods-$(CONFIG_ARCH_TEGRA) += mods_oist.o
|
|
||||||
mods-$(CONFIG_DMA_ENGINE) += mods_dma.o
|
|
||||||
mods-$(CONFIG_DEBUG_FS) += mods_debugfs.o
|
|
||||||
mods-$(CONFIG_TEGRA_DC) += mods_tegradc.o
|
|
||||||
mods-$(CONFIG_TEGRA_NVADSP) += mods_adsp.o
|
mods-$(CONFIG_TEGRA_NVADSP) += mods_adsp.o
|
||||||
|
mods-$(CONFIG_COMMON_CLK) += mods_clock.o
|
||||||
|
mods-$(CONFIG_DEBUG_FS) += mods_debugfs.o
|
||||||
|
mods-$(CONFIG_DMA_ENGINE) += mods_dma.o
|
||||||
mods-$(CONFIG_NET) += mods_netdevice.o
|
mods-$(CONFIG_NET) += mods_netdevice.o
|
||||||
|
mods-$(CONFIG_ARCH_TEGRA) += mods_oist.o
|
||||||
|
mods-$(CONFIG_PCI) += mods_pci.o
|
||||||
|
mods-$(CONFIG_ARCH_TEGRA_19x_SOC) += mods_ras.o
|
||||||
|
mods-$(CONFIG_ARCH_TEGRA) += mods_smmu_drv.o
|
||||||
|
mods-$(CONFIG_TEGRA_DC) += mods_tegradc.o
|
||||||
|
mods-$(CONFIG_TRUSTY) += mods_tz.o
|
||||||
|
|
||||||
mods-objs := mods.dtb.o
|
mods-objs := mods.dtb.o
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_TEGRA_OOT_MODULE),m)
|
||||||
|
ccflags-y += -DMODS_HAS_DMABUF
|
||||||
|
ccflags-y += -DMODS_HAS_PROD
|
||||||
|
mods-$(CONFIG_DMA_SHARED_BUFFER) += mods_dmabuf.o
|
||||||
|
mods-$(CONFIG_ARCH_TEGRA) += mods_tegraprod.o
|
||||||
|
endif
|
||||||
|
|||||||
@@ -600,13 +600,15 @@ int esc_mods_register_irq_4(struct mods_client *client,
|
|||||||
int esc_mods_query_irq_3(struct mods_client *client,
|
int esc_mods_query_irq_3(struct mods_client *client,
|
||||||
struct MODS_QUERY_IRQ_3 *p);
|
struct MODS_QUERY_IRQ_3 *p);
|
||||||
|
|
||||||
#ifdef MODS_HAS_TEGRA
|
#ifdef MODS_HAS_PROD
|
||||||
|
|
||||||
/* bpmp uphy */
|
/* bpmp uphy */
|
||||||
int esc_mods_bpmp_set_pcie_state(struct mods_client *client,
|
int esc_mods_bpmp_set_pcie_state(struct mods_client *client,
|
||||||
struct MODS_SET_PCIE_STATE *p);
|
struct MODS_SET_PCIE_STATE *p);
|
||||||
int esc_mods_bpmp_init_pcie_ep_pll(struct mods_client *client,
|
int esc_mods_bpmp_init_pcie_ep_pll(struct mods_client *client,
|
||||||
struct MODS_INIT_PCIE_EP_PLL *p);
|
struct MODS_INIT_PCIE_EP_PLL *p);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODS_HAS_TEGRA
|
||||||
|
|
||||||
/* clock */
|
/* clock */
|
||||||
int esc_mods_get_clock_handle(struct mods_client *client,
|
int esc_mods_get_clock_handle(struct mods_client *client,
|
||||||
@@ -674,7 +676,7 @@ int esc_mods_net_force_link(struct mods_client *client,
|
|||||||
struct MODS_NET_DEVICE_NAME *p);
|
struct MODS_NET_DEVICE_NAME *p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MODS_HAS_TEGRA) && defined(CONFIG_DMA_SHARED_BUFFER)
|
#if defined(MODS_HAS_DMABUF) && defined(CONFIG_DMA_SHARED_BUFFER)
|
||||||
int esc_mods_dmabuf_get_phys_addr(struct mods_client *client,
|
int esc_mods_dmabuf_get_phys_addr(struct mods_client *client,
|
||||||
struct MODS_DMABUF_GET_PHYSICAL_ADDRESS *p);
|
struct MODS_DMABUF_GET_PHYSICAL_ADDRESS *p);
|
||||||
#else
|
#else
|
||||||
@@ -691,6 +693,7 @@ int esc_mods_adsp_run_app(struct mods_client *client,
|
|||||||
struct MODS_ADSP_RUN_APP_INFO *p);
|
struct MODS_ADSP_RUN_APP_INFO *p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODS_HAS_PROD
|
||||||
/* prod */
|
/* prod */
|
||||||
int mods_tegra_prod_init(const struct miscdevice *misc_dev);
|
int mods_tegra_prod_init(const struct miscdevice *misc_dev);
|
||||||
int esc_mods_tegra_prod_iterate_dt(struct mods_client *client,
|
int esc_mods_tegra_prod_iterate_dt(struct mods_client *client,
|
||||||
@@ -705,6 +708,7 @@ int esc_mods_tegra_prod_set_prod_by_name(struct mods_client *client,
|
|||||||
struct MODS_TEGRA_PROD_SET_TUPLE *tuple);
|
struct MODS_TEGRA_PROD_SET_TUPLE *tuple);
|
||||||
int esc_mods_tegra_prod_set_prod_exact(struct mods_client *client,
|
int esc_mods_tegra_prod_set_prod_exact(struct mods_client *client,
|
||||||
struct MODS_TEGRA_PROD_SET_TUPLE *tuple);
|
struct MODS_TEGRA_PROD_SET_TUPLE *tuple);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TRUSTY
|
#ifdef CONFIG_TRUSTY
|
||||||
/* trustzone app call */
|
/* trustzone app call */
|
||||||
@@ -724,7 +728,7 @@ static inline int mods_create_debugfs(struct miscdevice *modsdev)
|
|||||||
static inline void mods_remove_debugfs(void) {}
|
static inline void mods_remove_debugfs(void) {}
|
||||||
#endif /* CONFIG_DEBUG_FS */
|
#endif /* CONFIG_DEBUG_FS */
|
||||||
|
|
||||||
#if defined(MODS_HAS_TEGRA) && defined(CONFIG_DMA_SHARED_BUFFER)
|
#if defined(MODS_HAS_DMABUF) && defined(CONFIG_DMA_SHARED_BUFFER)
|
||||||
int mods_init_dmabuf(void);
|
int mods_init_dmabuf(void);
|
||||||
void mods_exit_dmabuf(void);
|
void mods_exit_dmabuf(void);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -465,8 +465,10 @@ static int __init mods_init_module(void)
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
#if defined(MODS_HAS_PROD)
|
||||||
/* tegra prod */
|
/* tegra prod */
|
||||||
mods_tegra_prod_init(&mods_dev);
|
mods_tegra_prod_init(&mods_dev);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_DMA_ENGINE)
|
#if defined(CONFIG_DMA_ENGINE)
|
||||||
mods_init_dma();
|
mods_init_dma();
|
||||||
@@ -2377,7 +2379,7 @@ static long mods_krnl_ioctl(struct file *fp,
|
|||||||
MODS_GET_RESET_HANDLE);
|
MODS_GET_RESET_HANDLE);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(MODS_HAS_TEGRA)
|
#if defined(MODS_HAS_PROD)
|
||||||
case MODS_ESC_BPMP_SET_PCIE_STATE:
|
case MODS_ESC_BPMP_SET_PCIE_STATE:
|
||||||
MODS_IOCTL(MODS_ESC_BPMP_SET_PCIE_STATE,
|
MODS_IOCTL(MODS_ESC_BPMP_SET_PCIE_STATE,
|
||||||
esc_mods_bpmp_set_pcie_state,
|
esc_mods_bpmp_set_pcie_state,
|
||||||
@@ -2389,6 +2391,8 @@ static long mods_krnl_ioctl(struct file *fp,
|
|||||||
esc_mods_bpmp_init_pcie_ep_pll,
|
esc_mods_bpmp_init_pcie_ep_pll,
|
||||||
MODS_INIT_PCIE_EP_PLL);
|
MODS_INIT_PCIE_EP_PLL);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#if defined(MODS_HAS_TEGRA)
|
||||||
case MODS_ESC_DMA_ALLOC_COHERENT:
|
case MODS_ESC_DMA_ALLOC_COHERENT:
|
||||||
MODS_IOCTL(MODS_ESC_DMA_ALLOC_COHERENT,
|
MODS_IOCTL(MODS_ESC_DMA_ALLOC_COHERENT,
|
||||||
esc_mods_dma_alloc_coherent,
|
esc_mods_dma_alloc_coherent,
|
||||||
@@ -2474,7 +2478,7 @@ static long mods_krnl_ioctl(struct file *fp,
|
|||||||
MODS_FLUSH_CPU_CACHE_RANGE);
|
MODS_FLUSH_CPU_CACHE_RANGE);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef MODS_HAS_TEGRA
|
#if defined(MODS_HAS_DMABUF)
|
||||||
case MODS_ESC_DMABUF_GET_PHYSICAL_ADDRESS:
|
case MODS_ESC_DMABUF_GET_PHYSICAL_ADDRESS:
|
||||||
MODS_IOCTL(MODS_ESC_DMABUF_GET_PHYSICAL_ADDRESS,
|
MODS_IOCTL(MODS_ESC_DMABUF_GET_PHYSICAL_ADDRESS,
|
||||||
esc_mods_dmabuf_get_phys_addr,
|
esc_mods_dmabuf_get_phys_addr,
|
||||||
@@ -2534,7 +2538,7 @@ static long mods_krnl_ioctl(struct file *fp,
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MODS_HAS_TEGRA)
|
#if defined(MODS_HAS_PROD)
|
||||||
case MODS_ESC_TEGRA_PROD_IS_SUPPORTED:
|
case MODS_ESC_TEGRA_PROD_IS_SUPPORTED:
|
||||||
MODS_IOCTL(MODS_ESC_TEGRA_PROD_IS_SUPPORTED,
|
MODS_IOCTL(MODS_ESC_TEGRA_PROD_IS_SUPPORTED,
|
||||||
esc_mods_tegra_prod_is_supported,
|
esc_mods_tegra_prod_is_supported,
|
||||||
@@ -2570,6 +2574,9 @@ static long mods_krnl_ioctl(struct file *fp,
|
|||||||
esc_mods_tegra_prod_iterate_dt,
|
esc_mods_tegra_prod_iterate_dt,
|
||||||
MODS_TEGRA_PROD_ITERATOR);
|
MODS_TEGRA_PROD_ITERATOR);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(MODS_HAS_TEGRA)
|
||||||
|
|
||||||
#ifdef CONFIG_TRUSTY
|
#ifdef CONFIG_TRUSTY
|
||||||
case MODS_ESC_SEND_TZ_MSG:
|
case MODS_ESC_SEND_TZ_MSG:
|
||||||
|
|||||||
@@ -2244,10 +2244,6 @@ static void clear_contiguous_cache(struct mods_client *client,
|
|||||||
u64 phys_start,
|
u64 phys_start,
|
||||||
u32 size)
|
u32 size)
|
||||||
{
|
{
|
||||||
#ifdef MODS_HAS_TEGRA
|
|
||||||
__flush_dcache_area((void *)(size_t)(virt_start), size);
|
|
||||||
#else
|
|
||||||
/* __flush_dcache_area is not exported in upstream kernels */
|
|
||||||
u64 end = virt_start + size;
|
u64 end = virt_start + size;
|
||||||
u64 cur;
|
u64 cur;
|
||||||
u32 d_line_shift = 4; /* Fallback for kernel 5.9 or older */
|
u32 d_line_shift = 4; /* Fallback for kernel 5.9 or older */
|
||||||
@@ -2267,7 +2263,6 @@ static void clear_contiguous_cache(struct mods_client *client,
|
|||||||
do {
|
do {
|
||||||
asm volatile("dc civac, %0" : : "r" (cur) : "memory");
|
asm volatile("dc civac, %0" : : "r" (cur) : "memory");
|
||||||
} while (cur += d_size, cur < end);
|
} while (cur += d_size, cur < end);
|
||||||
#endif
|
|
||||||
|
|
||||||
cl_debug(DEBUG_MEM_DETAILED,
|
cl_debug(DEBUG_MEM_DETAILED,
|
||||||
"clear cache virt 0x%llx phys 0x%llx size 0x%x\n",
|
"clear cache virt 0x%llx phys 0x%llx size 0x%x\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user