diff options
| author | Deepak Nibade <dnibade@nvidia.com> | 2016-03-10 05:10:08 -0500 |
|---|---|---|
| committer | Deepak Nibade <dnibade@nvidia.com> | 2016-03-15 03:05:27 -0400 |
| commit | c895f5e50e568a0f64fee8020c8cff213739db73 (patch) | |
| tree | 7535064cca90bedfaa2eaa967b5efb296c12228c /drivers/gpu | |
| parent | 379e6ecdd39844fbde4713d1c5f893840acb5ab2 (diff) | |
drm/tegra: add T186 support to TSEC
Define tsec_t186_config/tsecb_t186_config and
tsec_t186_ops for TSEC
Define .load_regs = tsec_load_streamid_regs() for TSEC
streamid support
Bug 1704301
Change-Id: Ibf3219973627802ee4301c5a23e766d9953dbc3b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1029501
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/tegra/Makefile | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/tegra/tsec_t186.c | 54 | ||||
| -rw-r--r-- | drivers/gpu/drm/tegra/tsec_t186.h | 28 |
3 files changed, 84 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/Makefile b/drivers/gpu/drm/tegra/Makefile index ff2e239fc..048a3f3c2 100644 --- a/drivers/gpu/drm/tegra/Makefile +++ b/drivers/gpu/drm/tegra/Makefile | |||
| @@ -5,6 +5,7 @@ tegra-drm-t186-y = \ | |||
| 5 | vic_t186.o \ | 5 | vic_t186.o \ |
| 6 | nvenc_t186.o \ | 6 | nvenc_t186.o \ |
| 7 | nvdec_t186.o \ | 7 | nvdec_t186.o \ |
| 8 | nvjpg_t186.o | 8 | nvjpg_t186.o \ |
| 9 | tsec_t186.o | ||
| 9 | 10 | ||
| 10 | obj-$(CONFIG_TEGRA_HOST1X) += tegra-drm-t186.o | 11 | obj-$(CONFIG_TEGRA_HOST1X) += tegra-drm-t186.o |
diff --git a/drivers/gpu/drm/tegra/tsec_t186.c b/drivers/gpu/drm/tegra/tsec_t186.c new file mode 100644 index 000000000..5a47bbc28 --- /dev/null +++ b/drivers/gpu/drm/tegra/tsec_t186.c | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "drm.h" | ||
| 18 | #include "tsec_t186.h" | ||
| 19 | |||
| 20 | #include <linux/iommu.h> | ||
| 21 | |||
| 22 | static int tsec_load_streamid_regs(struct tegra_drm_client *client) | ||
| 23 | { | ||
| 24 | struct tsec *tsec = to_tsec(client); | ||
| 25 | int streamid = -EINVAL; | ||
| 26 | |||
| 27 | streamid = iommu_get_hwid(tsec->dev->archdata.iommu, tsec->dev, 0); | ||
| 28 | |||
| 29 | if (streamid >= 0) { | ||
| 30 | tsec_writel(tsec, streamid, TSEC_THI_STREAMID0); | ||
| 31 | tsec_writel(tsec, streamid, TSEC_THI_STREAMID1); | ||
| 32 | } | ||
| 33 | |||
| 34 | return 0; | ||
| 35 | } | ||
| 36 | |||
| 37 | static const struct tegra_drm_client_ops tsec_t186_ops = { | ||
| 38 | .open_channel = tsec_open_channel, | ||
| 39 | .close_channel = tsec_close_channel, | ||
| 40 | .submit = tegra_drm_submit, | ||
| 41 | .load_regs = tsec_load_streamid_regs, | ||
| 42 | }; | ||
| 43 | |||
| 44 | const struct tsec_config tsec_t186_config = { | ||
| 45 | .ucode_name = "tegra18x/nvhost_tsec.fw", | ||
| 46 | .drm_client_ops = &tsec_t186_ops, | ||
| 47 | .class_id = HOST1X_CLASS_TSEC, | ||
| 48 | }; | ||
| 49 | |||
| 50 | const struct tsec_config tsecb_t186_config = { | ||
| 51 | .ucode_name = "tegra18x/nvhost_tsec.fw", | ||
| 52 | .drm_client_ops = &tsec_t186_ops, | ||
| 53 | .class_id = HOST1X_CLASS_TSECB, | ||
| 54 | }; | ||
diff --git a/drivers/gpu/drm/tegra/tsec_t186.h b/drivers/gpu/drm/tegra/tsec_t186.h new file mode 100644 index 000000000..e78ea2cf8 --- /dev/null +++ b/drivers/gpu/drm/tegra/tsec_t186.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved. | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms and conditions of the GNU General Public License, | ||
| 6 | * version 2, as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 11 | * more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef TEGRA_TSEC_T186_H | ||
| 18 | #define TEGRA_TSEC_T186_H | ||
| 19 | |||
| 20 | #include "tsec.h" | ||
| 21 | |||
| 22 | #define TSEC_THI_STREAMID0 0x30 | ||
| 23 | #define TSEC_THI_STREAMID1 0x34 | ||
| 24 | |||
| 25 | extern const struct tsec_config tsec_t186_config; | ||
| 26 | extern const struct tsec_config tsecb_t186_config; | ||
| 27 | |||
| 28 | #endif | ||
