mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
video: camera: Modify rtcpu modules for OOT tree
This patch modifies rtcpu modules to use new ivc headers, resolves cyclic dependencies between the modules, reduces the amount of modules built by linking them together and fixes other minor issues encountered with K5.15 Change-Id: I9cf2672df08ffe6c4b8aea9ac21d6cc50a92bb4e Signed-off-by: Matti Ryttylainen <mryttylainen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2787121 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Ankur Pawar <ankurp@nvidia.com> Reviewed-by: Semi Malinen <smalinen@nvidia.com> Reviewed-by: Pekka Pessi <ppessi@nvidia.com> Reviewed-by: Frank Chen <frankc@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
304123a3bf
commit
dd109353df
@@ -17,6 +17,7 @@ tegra-cactmon-objs += actmon_common.o
|
||||
obj-m += tegra-cactmon.o
|
||||
obj-m += tegra-fsicom.o
|
||||
|
||||
tegra-camera-rtcpu-objs := tegra-camera-rtcpu-base.o rtcpu/tegra-rtcpu-trace.o rtcpu/rtcpu-monitor.o
|
||||
obj-m += tegra-camera-rtcpu.o
|
||||
|
||||
obj-m += cvnas/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
LINUXINCLUDE += -I$(srctree.nvidia)/drivers/gpu/host1x/hw/
|
||||
LINUXINCLUDE += -I$(srctree.nvidia)/drivers/gpu/host1x/include
|
||||
LINUXINCLUDE += -I$(srctree.nvidia)/include
|
||||
LINUXINCLUDE += -I$(srctree.nvidia-oot)/include
|
||||
LINUXINCLUDE += -I$(srctree)/include
|
||||
LINUXINCLUDE += -I$(srctree.nvidia-oot)/drivers/platform/tegra/rtcpu
|
||||
@@ -13,7 +16,5 @@ obj-m += camera-diagnostics.o
|
||||
obj-m += debug.o
|
||||
obj-m += clk-group.o
|
||||
obj-m += hsp-mailbox-client.o
|
||||
obj-m += tegra-rtcpu-trace.o
|
||||
obj-m += rtcpu-monitor.o
|
||||
obj-m += reset-group.o
|
||||
obj-m += device-group.o
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/tegra-ivc.h>
|
||||
#include <soc/tegra/ivc_ext.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/tegra-ivc-instance.h>
|
||||
#include <soc/tegra/ivc-priv.h>
|
||||
#include <linux/wait.h>
|
||||
#include <asm/ioctls.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -113,7 +113,7 @@ static ssize_t tegra_camchar_read(struct file *fp, char __user *buffer, size_t l
|
||||
break;
|
||||
prepare_to_wait(&dev_data->waitq, &wait, TASK_INTERRUPTIBLE);
|
||||
|
||||
ret = tegra_ivc_read_user(&ch->ivc, buffer, len);
|
||||
ret = tegra_ivc_read(&ch->ivc, buffer, NULL, len);
|
||||
mutex_unlock(&dev_data->io_lock);
|
||||
|
||||
if (ret != -ENOMEM)
|
||||
@@ -153,7 +153,7 @@ static ssize_t tegra_camchar_write(struct file *fp, const char __user *buffer,
|
||||
break;
|
||||
|
||||
prepare_to_wait(&dev_data->waitq, &wait, TASK_INTERRUPTIBLE);
|
||||
ret = tegra_ivc_write_user(&ch->ivc, buffer, len);
|
||||
ret = tegra_ivc_write(&ch->ivc, buffer, NULL, len);
|
||||
mutex_unlock(&dev_data->io_lock);
|
||||
|
||||
if (ret > 0)
|
||||
@@ -200,7 +200,7 @@ static long tegra_camchar_ioctl(struct file *fp, unsigned int cmd,
|
||||
break;
|
||||
/* ioctls specific to this device */
|
||||
case CCIOGNFRAMES:
|
||||
val = ch->ivc.nframes;
|
||||
val = ch->ivc.num_frames;
|
||||
ret = put_user(val, (int __user *)arg);
|
||||
break;
|
||||
case CCIOGNBYTES:
|
||||
@@ -385,6 +385,7 @@ static const struct of_device_id camchar_of_match[] = {
|
||||
.data = (void *)"camchar-dbg", },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, camchar_of_match);
|
||||
|
||||
static struct tegra_ivc_driver camchar_driver = {
|
||||
.driver = {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tegra-ivc.h>
|
||||
#include <soc/tegra/ivc_ext.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/tegra-ivc-instance.h>
|
||||
#include <soc/tegra/ivc-priv.h>
|
||||
|
||||
static int tegra_camera_diagnostics_probe(struct tegra_ivc_channel *ch)
|
||||
{
|
||||
@@ -33,6 +33,8 @@ static const struct of_device_id camera_diagnostics_of_match[] = {
|
||||
{ },
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, camera_diagnostics_of_match);
|
||||
|
||||
static struct tegra_ivc_driver camera_diagnostics_driver = {
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/tegra-ivc.h>
|
||||
#include <soc/tegra/ivc_ext.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/nospec.h>
|
||||
|
||||
@@ -41,7 +41,7 @@ static int tegra_capture_ivc_tx_(struct tegra_capture_ivc *civc,
|
||||
ret = wait_event_interruptible(civc->write_q,
|
||||
tegra_ivc_can_write(&chan->ivc));
|
||||
if (likely(ret == 0))
|
||||
ret = tegra_ivc_write(&chan->ivc, req, len);
|
||||
ret = tegra_ivc_write(&chan->ivc, NULL, req, len);
|
||||
|
||||
mutex_unlock(&civc->ivc_wr_lock);
|
||||
|
||||
@@ -352,7 +352,7 @@ static inline void tegra_capture_ivc_recv_msg(
|
||||
|
||||
static inline void tegra_capture_ivc_recv(struct tegra_capture_ivc *civc)
|
||||
{
|
||||
struct ivc *ivc = &civc->chan->ivc;
|
||||
struct tegra_ivc *ivc = &civc->chan->ivc;
|
||||
struct device *dev = &civc->chan->dev;
|
||||
|
||||
while (tegra_ivc_can_read(ivc)) {
|
||||
@@ -486,6 +486,7 @@ static struct of_device_id tegra_capture_ivc_channel_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra186-camera-ivc-protocol-capture" },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, tegra_capture_ivc_channel_of_match);
|
||||
|
||||
static const struct tegra_ivc_channel_ops tegra_capture_ivc_ops = {
|
||||
.probe = tegra_capture_ivc_probe,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/tegra-camera-rtcpu.h>
|
||||
#include <linux/tegra-ivc.h>
|
||||
#include <soc/tegra/ivc_ext.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/platform/tegra/common.h>
|
||||
#if IS_ENABLED(CONFIG_TEGRA_BWMGR)
|
||||
@@ -32,8 +32,6 @@
|
||||
#endif
|
||||
#include <soc/tegra/fuse.h>
|
||||
|
||||
#include <dt-bindings/memory/tegra-swgroup.h>
|
||||
|
||||
#define CAMRTC_TEST_CAM_DEVICES 4
|
||||
|
||||
struct camrtc_test_device {
|
||||
@@ -287,7 +285,7 @@ static int camrtc_ivc_dbg_full_frame_xact(
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = tegra_ivc_write(&ch->ivc, req, req_size);
|
||||
ret = tegra_ivc_write(&ch->ivc, NULL, req, req_size);
|
||||
if (ret < 0) {
|
||||
dev_err(&ch->dev, "IVC write error: %d\n", ret);
|
||||
goto out;
|
||||
@@ -309,7 +307,7 @@ static int camrtc_ivc_dbg_full_frame_xact(
|
||||
|
||||
dev_dbg(&ch->dev, "rx msg\n");
|
||||
|
||||
ret = tegra_ivc_read_peek(&ch->ivc, resp, 0, resp_size);
|
||||
ret = tegra_ivc_read_peek(&ch->ivc, NULL, resp, 0, resp_size);
|
||||
if (ret < 0) {
|
||||
dev_err(&ch->dev, "IVC read error: %d\n", ret);
|
||||
break;
|
||||
@@ -919,7 +917,7 @@ static void camrtc_membw_set(struct camrtc_run_membw *membw, u32 bw)
|
||||
|
||||
if (bw == 0) {
|
||||
;
|
||||
} else if (tegra_get_chip_id() == TEGRA234) {
|
||||
} else {
|
||||
#if IS_ENABLED(CONFIG_INTERCONNECT)
|
||||
struct icc_path *icc_path;
|
||||
int ret;
|
||||
@@ -936,31 +934,6 @@ static void camrtc_membw_set(struct camrtc_run_membw *membw, u32 bw)
|
||||
|
||||
membw->icc_path = icc_path;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#if IS_ENABLED(CONFIG_TEGRA_BWMGR)
|
||||
struct tegra_bwmgr_client *bwmgr;
|
||||
unsigned long emc_rate;
|
||||
int ret;
|
||||
|
||||
bwmgr = tegra_bwmgr_register(TEGRA_BWMGR_CLIENT_CAMERA_NON_ISO);
|
||||
|
||||
if (!IS_ERR_OR_NULL(bwmgr)) {
|
||||
if (bw == 0xFFFFFFFFU)
|
||||
emc_rate = tegra_bwmgr_get_max_emc_rate();
|
||||
else
|
||||
emc_rate = tegra_bwmgr_round_rate(bw);
|
||||
|
||||
ret = tegra_bwmgr_set_emc(bwmgr,
|
||||
emc_rate, TEGRA_BWMGR_SET_EMC_SHARED_BW);
|
||||
|
||||
if (ret < 0)
|
||||
dev_info(dev, "emc request rate %lu failed, %d\n", emc_rate, ret);
|
||||
else
|
||||
dev_dbg(dev, "requested emc rate %lu\n", emc_rate);
|
||||
|
||||
membw->bwmgr = bwmgr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1979,6 +1952,7 @@ static const struct of_device_id camrtc_debug_of_match[] = {
|
||||
{ .compatible = "nvidia,tegra186-camera-ivc-protocol-debug" },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, camrtc_debug_of_match);
|
||||
|
||||
static struct tegra_ivc_driver camrtc_debug_driver = {
|
||||
.driver = {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include "drivers/video/tegra/host/nvhost_acm.h"
|
||||
|
||||
struct camrtc_device_group {
|
||||
struct device *dev;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
#include "hsp-combo.h"
|
||||
#include "linux/tegra-hsp-combo.h"
|
||||
|
||||
#include <linux/version.h>
|
||||
|
||||
@@ -326,15 +326,27 @@ static int camrtc_hsp_vm_get_fw_hash(struct camrtc_hsp *camhsp, u32 index,
|
||||
return camrtc_hsp_vm_sendrecv(camhsp, request, timeout);
|
||||
}
|
||||
|
||||
static struct device_node *hsp_vm_get_available(const struct device_node *parent)
|
||||
{
|
||||
const char *compatible = "nvidia,tegra-camrtc-hsp-vm";
|
||||
struct device_node *child;
|
||||
|
||||
for_each_child_of_node(parent, child) {
|
||||
if (of_device_is_compatible(child, compatible) &&
|
||||
of_device_is_available(child))
|
||||
break;
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
static int camrtc_hsp_vm_probe(struct camrtc_hsp *camhsp)
|
||||
{
|
||||
struct device_node *np = camhsp->dev.parent->of_node;
|
||||
int err = -ENOTSUPP;
|
||||
const char *obtain = "";
|
||||
|
||||
np = of_get_compatible_child(np, "nvidia,tegra-camrtc-hsp-vm");
|
||||
if (!of_device_is_available(np)) {
|
||||
of_node_put(np);
|
||||
np = hsp_vm_get_available(np);
|
||||
if (np == NULL) {
|
||||
dev_err(&camhsp->dev, "no hsp protocol \"%s\"\n",
|
||||
"nvidia,tegra-camrtc-hsp-vm");
|
||||
return -ENOTSUPP;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tegra-ivc.h>
|
||||
#include <soc/tegra/ivc_ext.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/tegra-camera-rtcpu.h>
|
||||
#include <linux/bitops.h>
|
||||
@@ -33,14 +33,13 @@ struct tegra_ivc_bus {
|
||||
struct tegra_ivc_region regions[];
|
||||
};
|
||||
|
||||
static void tegra_ivc_channel_ring(struct ivc *ivc)
|
||||
static void tegra_ivc_channel_ring(struct tegra_ivc *ivc, void *data)
|
||||
{
|
||||
struct tegra_ivc_channel *chan =
|
||||
container_of(ivc, struct tegra_ivc_channel, ivc);
|
||||
struct tegra_ivc_bus *bus =
|
||||
container_of(chan->dev.parent, struct tegra_ivc_bus, dev);
|
||||
struct camrtc_hsp *camhsp = (struct camrtc_hsp *) data;
|
||||
|
||||
tegra_camrtc_ivc_ring(bus->dev.parent, chan->group);
|
||||
camrtc_hsp_group_ring(camhsp, chan->group);
|
||||
}
|
||||
|
||||
struct device_type tegra_ivc_channel_type = {
|
||||
@@ -75,7 +74,8 @@ static void tegra_ivc_channel_release(struct device *dev)
|
||||
|
||||
static struct tegra_ivc_channel *tegra_ivc_channel_create(
|
||||
struct tegra_ivc_bus *bus, struct device_node *ch_node,
|
||||
struct tegra_ivc_region *region)
|
||||
struct tegra_ivc_region *region,
|
||||
struct camrtc_hsp *camhsp)
|
||||
{
|
||||
struct device *peer_device = bus->dev.parent;
|
||||
struct camrtc_tlv_ivc_setup *tlv;
|
||||
@@ -162,13 +162,15 @@ static struct tegra_ivc_channel *tegra_ivc_channel_create(
|
||||
end.tx = region->ivc_size;
|
||||
|
||||
/* Init IVC */
|
||||
ret = tegra_ivc_init_with_dma_handle(&chan->ivc,
|
||||
region->base + start.rx, region->iova + start.rx,
|
||||
region->base + start.tx, region->iova + start.tx,
|
||||
ret = tegra_ivc_init(&chan->ivc,
|
||||
NULL,
|
||||
(void *)(region->base + start.rx),
|
||||
region->iova + start.rx,
|
||||
(void *)(region->base + start.tx),
|
||||
region->iova + start.tx,
|
||||
nframes, frame_size,
|
||||
/* Device used to allocate the shared memory for IVC */
|
||||
peer_device,
|
||||
tegra_ivc_channel_ring);
|
||||
tegra_ivc_channel_ring,
|
||||
(void *)camhsp);
|
||||
if (ret) {
|
||||
dev_err(&chan->dev, "IVC initialization error: %d\n", ret);
|
||||
goto error;
|
||||
@@ -290,7 +292,8 @@ static void tegra_ivc_bus_stop(struct tegra_ivc_bus *bus)
|
||||
}
|
||||
}
|
||||
|
||||
static int tegra_ivc_bus_start(struct tegra_ivc_bus *bus)
|
||||
static int tegra_ivc_bus_start(struct tegra_ivc_bus *bus,
|
||||
struct camrtc_hsp *camhsp)
|
||||
{
|
||||
struct device_node *dn = bus->dev.parent->of_node;
|
||||
struct of_phandle_args reg_spec;
|
||||
@@ -317,7 +320,8 @@ static int tegra_ivc_bus_start(struct tegra_ivc_bus *bus)
|
||||
}
|
||||
|
||||
chan = tegra_ivc_channel_create(bus, ch_node,
|
||||
&bus->regions[i]);
|
||||
&bus->regions[i],
|
||||
camhsp);
|
||||
if (IS_ERR(chan)) {
|
||||
ret = PTR_ERR(chan);
|
||||
of_node_put(ch_node);
|
||||
@@ -339,7 +343,8 @@ error:
|
||||
* This is called during RTCPU boot to synchronize
|
||||
* (or re-synchronize in the case of PM resume).
|
||||
*/
|
||||
int tegra_ivc_bus_boot_sync(struct tegra_ivc_bus *bus)
|
||||
int tegra_ivc_bus_boot_sync(struct tegra_ivc_bus *bus,
|
||||
int (*iovm_setup)(struct device*, dma_addr_t))
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -347,7 +352,7 @@ int tegra_ivc_bus_boot_sync(struct tegra_ivc_bus *bus)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < bus->num_regions; i++) {
|
||||
int ret = tegra_camrtc_iovm_setup(bus->dev.parent,
|
||||
int ret = (*iovm_setup)(bus->dev.parent,
|
||||
bus->regions[i].iova);
|
||||
if (ret != 0) {
|
||||
dev_info(&bus->dev, "IOVM setup error: %d\n", ret);
|
||||
@@ -531,7 +536,8 @@ static unsigned tegra_ivc_bus_count_regions(const struct device_node *dev_node)
|
||||
return i;
|
||||
}
|
||||
|
||||
struct tegra_ivc_bus *tegra_ivc_bus_create(struct device *dev)
|
||||
struct tegra_ivc_bus *tegra_ivc_bus_create(struct device *dev,
|
||||
struct camrtc_hsp *camhsp)
|
||||
{
|
||||
struct tegra_ivc_bus *bus;
|
||||
unsigned num;
|
||||
@@ -566,7 +572,7 @@ struct tegra_ivc_bus *tegra_ivc_bus_create(struct device *dev)
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = tegra_ivc_bus_start(bus);
|
||||
ret = tegra_ivc_bus_start(bus, camhsp);
|
||||
if (ret) {
|
||||
dev_err(&bus->dev, "bus start failed: %d\n", ret);
|
||||
goto error;
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
#include <linux/tegra-camera-rtcpu.h>
|
||||
#include <linux/tegra-rtcpu-monitor.h>
|
||||
|
||||
#include "drivers/video/tegra/host/vi/vi_notify.h"
|
||||
#include "vi-notify.h"
|
||||
|
||||
struct tegra_camrtc_mon {
|
||||
struct device *rce_dev;
|
||||
int wdt_irq;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <linux/seq_buf.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/tegra-firmwares.h>
|
||||
#include <linux/tegra-hsp.h>
|
||||
#include <linux/tegra-ivc-bus.h>
|
||||
#include <linux/pm_domain.h>
|
||||
#include <soc/tegra/fuse.h>
|
||||
@@ -37,15 +36,12 @@
|
||||
#include <linux/version.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
#include <dt-bindings/memory/tegra-swgroup.h>
|
||||
|
||||
#include "rtcpu/clk-group.h"
|
||||
#include "rtcpu/device-group.h"
|
||||
#include "rtcpu/reset-group.h"
|
||||
#include "rtcpu/hsp-combo.h"
|
||||
#include "linux/tegra-hsp-combo.h"
|
||||
|
||||
#include "soc/tegra/camrtc-commands.h"
|
||||
#include <linux/tegra-rtcpu-coverage.h>
|
||||
|
||||
#define CAMRTC_NUM_REGS 2
|
||||
#define CAMRTC_NUM_RESETS 2
|
||||
@@ -131,7 +127,6 @@ struct tegra_cam_rtcpu {
|
||||
struct device_dma_parameters dma_parms;
|
||||
struct camrtc_hsp *hsp;
|
||||
struct tegra_rtcpu_trace *tracer;
|
||||
struct tegra_rtcpu_coverage *coverage;
|
||||
u32 cmd_timeout;
|
||||
u32 fw_version;
|
||||
u8 fw_hash[RTCPU_FW_HASH_SIZE];
|
||||
@@ -351,13 +346,9 @@ static void tegra_camrtc_init_membw(struct device *dev)
|
||||
|
||||
if (of_property_read_u32(dev->of_node, "nvidia,memory-bw", &bw) != 0) {
|
||||
;
|
||||
} else if (tegra_get_chip_id() == TEGRA234) {
|
||||
} else {
|
||||
#if IS_ENABLED(CONFIG_INTERCONNECT)
|
||||
tegra_camrtc_init_icc(dev, bw);
|
||||
#endif
|
||||
} else {
|
||||
#if IS_ENABLED(CONFIG_TEGRA_BWMGR)
|
||||
tegra_camrtc_init_bwmgr(dev, bw);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -577,24 +568,10 @@ static int tegra_camrtc_setup_shared_memory(struct device *dev)
|
||||
if (ret < 0)
|
||||
dev_err(dev, "trace boot sync failed: %d\n", ret);
|
||||
|
||||
/*
|
||||
* Set-up coverage buffer
|
||||
*/
|
||||
ret = tegra_rtcpu_coverage_boot_sync(rtcpu->coverage);
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* Not a fatal error, don't stop the sync.
|
||||
* But go ahead and remove the coverage debug FS
|
||||
* entries and release the memory.
|
||||
*/
|
||||
tegra_rtcpu_coverage_destroy(rtcpu->coverage);
|
||||
rtcpu->coverage = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set-up and activate the IVC services in firmware
|
||||
*/
|
||||
ret = tegra_ivc_bus_boot_sync(rtcpu->ivc);
|
||||
ret = tegra_ivc_bus_boot_sync(rtcpu->ivc, &tegra_camrtc_iovm_setup);
|
||||
if (ret < 0)
|
||||
dev_err(dev, "ivc-bus boot sync failed: %d\n", ret);
|
||||
|
||||
@@ -636,14 +613,6 @@ static void tegra_camrtc_ivc_notify(struct device *dev, u16 group)
|
||||
tegra_ivc_bus_notify(rtcpu->ivc, group);
|
||||
}
|
||||
|
||||
void tegra_camrtc_ivc_ring(struct device *dev, u16 group)
|
||||
{
|
||||
struct tegra_cam_rtcpu *rtcpu = dev_get_drvdata(dev);
|
||||
|
||||
camrtc_hsp_group_ring(rtcpu->hsp, group);
|
||||
}
|
||||
EXPORT_SYMBOL(tegra_camrtc_ivc_ring);
|
||||
|
||||
static int tegra_camrtc_poweron(struct device *dev, bool full_speed)
|
||||
{
|
||||
struct tegra_cam_rtcpu *rtcpu = dev_get_drvdata(dev);
|
||||
@@ -862,8 +831,6 @@ static int tegra_cam_rtcpu_remove(struct platform_device *pdev)
|
||||
|
||||
tegra_rtcpu_trace_destroy(rtcpu->tracer);
|
||||
rtcpu->tracer = NULL;
|
||||
tegra_rtcpu_coverage_destroy(rtcpu->coverage);
|
||||
rtcpu->coverage = NULL;
|
||||
|
||||
tegra_camrtc_poweroff(&pdev->dev);
|
||||
#if IS_ENABLED(CONFIG_TEGRA_BWMGR)
|
||||
@@ -927,10 +894,6 @@ static int tegra_cam_rtcpu_probe(struct platform_device *pdev)
|
||||
(void)of_property_read_u32(dev->of_node, NV(max-reboot),
|
||||
&rtcpu->max_reboot_retry);
|
||||
timeout = 2000;
|
||||
#if 0 /* disabled for OOT kernel */
|
||||
if (tegra_platform_is_vdk())
|
||||
timeout = 5000;
|
||||
#endif
|
||||
|
||||
(void)of_property_read_u32(dev->of_node, "nvidia,cmd-timeout", &timeout);
|
||||
|
||||
@@ -950,8 +913,6 @@ static int tegra_cam_rtcpu_probe(struct platform_device *pdev)
|
||||
|
||||
rtcpu->tracer = tegra_rtcpu_trace_create(dev, rtcpu->camera_devices);
|
||||
|
||||
rtcpu->coverage = tegra_rtcpu_coverage_create(dev);
|
||||
|
||||
ret = tegra_camrtc_hsp_init(dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@@ -961,7 +922,7 @@ static int tegra_cam_rtcpu_probe(struct platform_device *pdev)
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
rtcpu->ivc = tegra_ivc_bus_create(dev);
|
||||
rtcpu->ivc = tegra_ivc_bus_create(dev, rtcpu->hsp);
|
||||
if (IS_ERR(rtcpu->ivc)) {
|
||||
ret = PTR_ERR(rtcpu->ivc);
|
||||
rtcpu->ivc = NULL;
|
||||
@@ -6,19 +6,22 @@
|
||||
#ifndef _LINUX_TEGRA_IVC_BUS_H
|
||||
#define _LINUX_TEGRA_IVC_BUS_H
|
||||
|
||||
#include <linux/tegra-ivc-instance.h>
|
||||
#include <soc/tegra/ivc-priv.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/tegra-hsp-combo.h>
|
||||
|
||||
extern struct bus_type tegra_ivc_bus_type;
|
||||
extern struct device_type tegra_ivc_bus_dev_type;
|
||||
struct tegra_ivc_bus;
|
||||
struct tegra_ivc_rpc_data;
|
||||
|
||||
struct tegra_ivc_bus *tegra_ivc_bus_create(struct device *);
|
||||
struct tegra_ivc_bus *tegra_ivc_bus_create(struct device *dev,
|
||||
struct camrtc_hsp *camhsp);
|
||||
|
||||
void tegra_ivc_bus_ready(struct tegra_ivc_bus *bus, bool online);
|
||||
void tegra_ivc_bus_destroy(struct tegra_ivc_bus *bus);
|
||||
int tegra_ivc_bus_boot_sync(struct tegra_ivc_bus *bus);
|
||||
int tegra_ivc_bus_boot_sync(struct tegra_ivc_bus *bus,
|
||||
int (*iovm_setup)(struct device*, dma_addr_t));
|
||||
void tegra_ivc_bus_notify(struct tegra_ivc_bus *bus, u16 group);
|
||||
|
||||
struct tegra_ivc_driver {
|
||||
@@ -59,7 +62,7 @@ tegra_ivc_subsys_driver(__driver, \
|
||||
extern struct device_type tegra_ivc_channel_type;
|
||||
|
||||
struct tegra_ivc_channel {
|
||||
struct ivc ivc;
|
||||
struct tegra_ivc ivc;
|
||||
struct device dev;
|
||||
const struct tegra_ivc_channel_ops __rcu *ops;
|
||||
struct tegra_ivc_channel *next;
|
||||
|
||||
Reference in New Issue
Block a user