Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stefan Kristiansson and committed by
Jassi Brar
602dbbac af9dbbbb

+14 -2
+14 -2
drivers/mailbox/tegra-hsp.c
··· 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 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 { ··· 280 279 return ERR_PTR(-ENOMEM); 281 280 282 281 offset = (1 + (hsp->num_sm / 2) + hsp->num_ss + hsp->num_as) * SZ_64K; 283 - offset += index * 0x100; 282 + offset += index * hsp->soc->reg_stride; 284 283 285 284 db->channel.regs = hsp->regs + offset; 286 285 db->channel.hsp = hsp; ··· 917 916 .map = tegra186_hsp_db_map, 918 917 .has_per_mb_ie = false, 919 918 .has_128_bit_mb = false, 919 + .reg_stride = 0x100, 920 920 }; 921 921 922 922 static const struct tegra_hsp_soc tegra194_hsp_soc = { 923 923 .map = tegra186_hsp_db_map, 924 924 .has_per_mb_ie = true, 925 925 .has_128_bit_mb = false, 926 + .reg_stride = 0x100, 926 927 }; 927 928 928 929 static const struct tegra_hsp_soc tegra234_hsp_soc = { 929 930 .map = tegra186_hsp_db_map, 930 931 .has_per_mb_ie = false, 931 932 .has_128_bit_mb = true, 933 + .reg_stride = 0x100, 934 + }; 935 + 936 + static const struct tegra_hsp_soc tegra264_hsp_soc = { 937 + .map = tegra186_hsp_db_map, 938 + .has_per_mb_ie = false, 939 + .has_128_bit_mb = true, 940 + .reg_stride = 0x1000, 932 941 }; 933 942 934 943 static const struct of_device_id tegra_hsp_match[] = { 935 944 { .compatible = "nvidia,tegra186-hsp", .data = &tegra186_hsp_soc }, 936 945 { .compatible = "nvidia,tegra194-hsp", .data = &tegra194_hsp_soc }, 937 946 { .compatible = "nvidia,tegra234-hsp", .data = &tegra234_hsp_soc }, 947 + { .compatible = "nvidia,tegra264-hsp", .data = &tegra264_hsp_soc }, 938 948 { } 939 949 }; 940 950