nvadsp: Pass platform info to ADSP

Provision is made to pass the Tegra platform information to ADSP
("nvidia,tegra_platform" DT property, as per enum tegra_platform);
this will be useful to convey whether the platform is CMODEL, in
which case the ADSP may take CMODEL specific paths, like using
HSP shared interrupts.

Upper 16 bits of nvadsp_os_args.chip_id is used to convey the
platform information; this may be improved in future as a
separate structure member.

Bug 200745795
Bug 200746669

Change-Id: Ibd9423eebb06fc4d243c132ab1cb7c6dc558ba5e
Signed-off-by: Viswanath L <viswanathl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2622156
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Asha Talambedu <atalambedu@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Viswanath L
2021-11-08 06:52:38 +00:00
committed by Laxman Dewangan
parent 3c9d6d8db1
commit 8036a9525f
3 changed files with 13 additions and 0 deletions

View File

@@ -293,6 +293,9 @@ static int __init nvadsp_parse_dt(struct platform_device *pdev)
drv_data->adsp_os_secload = of_property_read_bool(dev->of_node, drv_data->adsp_os_secload = of_property_read_bool(dev->of_node,
"nvidia,adsp_os_secload"); "nvidia,adsp_os_secload");
of_property_read_u32(dev->of_node, "nvidia,tegra_platform",
&drv_data->tegra_platform);
if (drv_data->adsp_unit_fpga) { if (drv_data->adsp_unit_fpga) {
for (iter = 0; iter < ADSP_UNIT_FPGA_RESET_END; iter++) { for (iter = 0; iter < ADSP_UNIT_FPGA_RESET_END; iter++) {
if (of_property_read_u32_index(dev->of_node, if (of_property_read_u32_index(dev->of_node,

View File

@@ -238,6 +238,9 @@ struct nvadsp_drv_data {
/* CO mem in backdoor boot */ /* CO mem in backdoor boot */
struct resource co_mem; struct resource co_mem;
/* enum tegra_platform */
u32 tegra_platform;
}; };
#define ADSP_CONFIG 0x04 #define ADSP_CONFIG 0x04

View File

@@ -797,6 +797,13 @@ static void nvadsp_set_shared_mem(struct platform_device *pdev,
*/ */
os_args->chip_id = chip_id; os_args->chip_id = chip_id;
/*
* Tegra platform is encoded in the upper 16 bits
* of chip_id; can be improved to make this a
* separate member in nvadsp_os_args
*/
os_args->chip_id |= (drv_data->tegra_platform << 16);
drv_data->shared_adsp_os_data = shared_mem; drv_data->shared_adsp_os_data = shared_mem;
} }