|
1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
2 | 2 | /* |
3 | | - * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. |
| 3 | + * Copyright (c) 2016-2023, NVIDIA CORPORATION. All rights reserved. |
4 | 4 | */ |
5 | 5 |
|
6 | 6 | #include <linux/delay.h> |
@@ -97,6 +97,7 @@ struct tegra_hsp_soc { |
97 | 97 | const struct tegra_hsp_db_map *map; |
98 | 98 | bool has_per_mb_ie; |
99 | 99 | bool has_128_bit_mb; |
| 100 | + unsigned int reg_stride; |
100 | 101 | }; |
101 | 102 |
|
102 | 103 | struct tegra_hsp { |
@@ -279,7 +280,7 @@ tegra_hsp_doorbell_create(struct tegra_hsp *hsp, const char *name, |
279 | 280 | return ERR_PTR(-ENOMEM); |
280 | 281 |
|
281 | 282 | 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; |
283 | 284 |
|
284 | 285 | db->channel.regs = hsp->regs + offset; |
285 | 286 | db->channel.hsp = hsp; |
@@ -916,24 +917,35 @@ static const struct tegra_hsp_soc tegra186_hsp_soc = { |
916 | 917 | .map = tegra186_hsp_db_map, |
917 | 918 | .has_per_mb_ie = false, |
918 | 919 | .has_128_bit_mb = false, |
| 920 | + .reg_stride = 0x100, |
919 | 921 | }; |
920 | 922 |
|
921 | 923 | static const struct tegra_hsp_soc tegra194_hsp_soc = { |
922 | 924 | .map = tegra186_hsp_db_map, |
923 | 925 | .has_per_mb_ie = true, |
924 | 926 | .has_128_bit_mb = false, |
| 927 | + .reg_stride = 0x100, |
925 | 928 | }; |
926 | 929 |
|
927 | 930 | static const struct tegra_hsp_soc tegra234_hsp_soc = { |
928 | 931 | .map = tegra186_hsp_db_map, |
929 | 932 | .has_per_mb_ie = false, |
930 | 933 | .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, |
931 | 942 | }; |
932 | 943 |
|
933 | 944 | static const struct of_device_id tegra_hsp_match[] = { |
934 | 945 | { .compatible = "nvidia,tegra186-hsp", .data = &tegra186_hsp_soc }, |
935 | 946 | { .compatible = "nvidia,tegra194-hsp", .data = &tegra194_hsp_soc }, |
936 | 947 | { .compatible = "nvidia,tegra234-hsp", .data = &tegra234_hsp_soc }, |
| 948 | + { .compatible = "nvidia,tegra264-hsp", .data = &tegra264_hsp_soc }, |
937 | 949 | { } |
938 | 950 | }; |
939 | 951 |
|
|
0 commit comments