Skip to content

Commit 602dbba

Browse files
Stefan KristianssonJassiBrar
authored andcommitted
mailbox: tegra: add support for Tegra264
Tegra264 has a slightly different doorbell register layout than previous chips. Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Stefan Kristiansson <stefank@nvidia.com> Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
1 parent af9dbbb commit 602dbba

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

drivers/mailbox/tegra-hsp.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (c) 2016-2023, NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/delay.h>
@@ -97,6 +97,7 @@ struct tegra_hsp_soc {
9797
const struct tegra_hsp_db_map *map;
9898
bool has_per_mb_ie;
9999
bool has_128_bit_mb;
100+
unsigned int reg_stride;
100101
};
101102

102103
struct tegra_hsp {
@@ -279,7 +280,7 @@ tegra_hsp_doorbell_create(struct tegra_hsp *hsp, const char *name,
279280
return ERR_PTR(-ENOMEM);
280281

281282
offset = (1 + (hsp->num_sm / 2) + hsp->num_ss + hsp->num_as) * SZ_64K;
282-
offset += index * 0x100;
283+
offset += index * hsp->soc->reg_stride;
283284

284285
db->channel.regs = hsp->regs + offset;
285286
db->channel.hsp = hsp;
@@ -916,24 +917,35 @@ static const struct tegra_hsp_soc tegra186_hsp_soc = {
916917
.map = tegra186_hsp_db_map,
917918
.has_per_mb_ie = false,
918919
.has_128_bit_mb = false,
920+
.reg_stride = 0x100,
919921
};
920922

921923
static const struct tegra_hsp_soc tegra194_hsp_soc = {
922924
.map = tegra186_hsp_db_map,
923925
.has_per_mb_ie = true,
924926
.has_128_bit_mb = false,
927+
.reg_stride = 0x100,
925928
};
926929

927930
static const struct tegra_hsp_soc tegra234_hsp_soc = {
928931
.map = tegra186_hsp_db_map,
929932
.has_per_mb_ie = false,
930933
.has_128_bit_mb = true,
934+
.reg_stride = 0x100,
935+
};
936+
937+
static const struct tegra_hsp_soc tegra264_hsp_soc = {
938+
.map = tegra186_hsp_db_map,
939+
.has_per_mb_ie = false,
940+
.has_128_bit_mb = true,
941+
.reg_stride = 0x1000,
931942
};
932943

933944
static const struct of_device_id tegra_hsp_match[] = {
934945
{ .compatible = "nvidia,tegra186-hsp", .data = &tegra186_hsp_soc },
935946
{ .compatible = "nvidia,tegra194-hsp", .data = &tegra194_hsp_soc },
936947
{ .compatible = "nvidia,tegra234-hsp", .data = &tegra234_hsp_soc },
948+
{ .compatible = "nvidia,tegra264-hsp", .data = &tegra264_hsp_soc },
937949
{ }
938950
};
939951

0 commit comments

Comments
 (0)