diff options
| author | dmitry pervushin <dpervushin@nvidia.com> | 2019-04-08 06:45:16 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-05-09 23:42:25 -0400 |
| commit | 95f2b73f4dafa5a3747a90dc036e6b5e08179ae9 (patch) | |
| tree | fdbfcac97cb7216aba2c5463fbfc28de59bc30f2 | |
| parent | f53216e57a81d6df41521dfa408f4be35b0b6fde (diff) | |
trusty: firmware version registration
Register version string using devm_register_firwmare_version
Bug 2330176
Bug 200489191
Change-Id: I9270920a5f8bacac4eeeb3652747f4eb5fdd557f
Reviewed-on: https://git-master.nvidia.com/r/2092325
(cherry picked from commit ebe5219b6ac45a0a4d99f1a128c2c96faaab3324)
Signed-off-by: dmitry pervushin <dpervushin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2094365
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rahul Jain (SW-TEGRA) <rahuljain@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/platform/tegra/firmwares-all.c | 33 | ||||
| -rw-r--r-- | drivers/trusty/trusty.c | 4 |
2 files changed, 4 insertions, 33 deletions
diff --git a/drivers/platform/tegra/firmwares-all.c b/drivers/platform/tegra/firmwares-all.c index 28a8ebc32..a0a483371 100644 --- a/drivers/platform/tegra/firmwares-all.c +++ b/drivers/platform/tegra/firmwares-all.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
| @@ -18,31 +18,6 @@ | |||
| 18 | #include <linux/cpu.h> | 18 | #include <linux/cpu.h> |
| 19 | #include <asm/cpu.h> | 19 | #include <asm/cpu.h> |
| 20 | 20 | ||
| 21 | #if IS_ENABLED(CONFIG_TRUSTY) | ||
| 22 | #include <linux/trusty/trusty.h> | ||
| 23 | |||
| 24 | static ssize_t tegrafw_read_trusty(struct device *dev, | ||
| 25 | char *data, size_t size) | ||
| 26 | { | ||
| 27 | const struct of_device_id trusty_of_match[] = { | ||
| 28 | {.compatible = "android,trusty-smc-v1", }, | ||
| 29 | {}, | ||
| 30 | }; | ||
| 31 | struct device_node *dn; | ||
| 32 | struct platform_device *pdev; | ||
| 33 | |||
| 34 | for_each_matching_node(dn, trusty_of_match) { | ||
| 35 | pdev = of_find_device_by_node(dn); | ||
| 36 | if (pdev == NULL) | ||
| 37 | continue; | ||
| 38 | return snprintf(data, size, "%s", | ||
| 39 | trusty_version_str_get(&pdev->dev)); | ||
| 40 | } | ||
| 41 | snprintf(data, size, "NULL"); | ||
| 42 | return 0; | ||
| 43 | } | ||
| 44 | #endif | ||
| 45 | |||
| 46 | static ssize_t tegrafw_read_denver(struct device *dev, | 21 | static ssize_t tegrafw_read_denver(struct device *dev, |
| 47 | char *version, size_t size) | 22 | char *version, size_t size) |
| 48 | { | 23 | { |
| @@ -83,12 +58,6 @@ static int __init tegra_firmwares_init(void) | |||
| 83 | check_out_of_bounds(dev, 0); | 58 | check_out_of_bounds(dev, 0); |
| 84 | *dev++ = tegrafw_register("MTS", TFW_NORMAL, tegrafw_read_denver, NULL); | 59 | *dev++ = tegrafw_register("MTS", TFW_NORMAL, tegrafw_read_denver, NULL); |
| 85 | 60 | ||
| 86 | #if IS_ENABLED(CONFIG_TRUSTY) | ||
| 87 | check_out_of_bounds(dev, 0); | ||
| 88 | *dev++ = tegrafw_register("trusty", TFW_DONT_CACHE, | ||
| 89 | tegrafw_read_trusty, NULL); | ||
| 90 | #endif | ||
| 91 | |||
| 92 | for (v = 0; v < ARRAY_SIZE(versions); v++) { | 61 | for (v = 0; v < ARRAY_SIZE(versions); v++) { |
| 93 | check_out_of_bounds(dev, 0); | 62 | check_out_of_bounds(dev, 0); |
| 94 | *dev++ = tegrafw_register_dt_string(versions[v], | 63 | *dev++ = tegrafw_register_dt_string(versions[v], |
diff --git a/drivers/trusty/trusty.c b/drivers/trusty/trusty.c index 62f897644..cb186381d 100644 --- a/drivers/trusty/trusty.c +++ b/drivers/trusty/trusty.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2013 Google, Inc. | 2 | * Copyright (C) 2013 Google, Inc. |
| 3 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | 3 | * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved. |
| 4 | * | 4 | * |
| 5 | * This software is licensed under the terms of the GNU General Public | 5 | * This software is licensed under the terms of the GNU General Public |
| 6 | * License version 2, as published by the Free Software Foundation, and | 6 | * License version 2, as published by the Free Software Foundation, and |
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/trusty/sm_err.h> | 26 | #include <linux/trusty/sm_err.h> |
| 27 | #include <linux/trusty/trusty.h> | 27 | #include <linux/trusty/trusty.h> |
| 28 | #include <soc/tegra/virt/syscalls.h> | 28 | #include <soc/tegra/virt/syscalls.h> |
| 29 | #include <linux/tegra-firmwares.h> | ||
| 29 | #include "trusty-workitem.h" | 30 | #include "trusty-workitem.h" |
| 30 | 31 | ||
| 31 | struct trusty_state; | 32 | struct trusty_state; |
| @@ -639,6 +640,7 @@ static int trusty_probe(struct platform_device *pdev) | |||
| 639 | goto err_add_children; | 640 | goto err_add_children; |
| 640 | } | 641 | } |
| 641 | 642 | ||
| 643 | devm_tegrafw_register_string(&pdev->dev, "trusty", s->version_str); | ||
| 642 | return 0; | 644 | return 0; |
| 643 | 645 | ||
| 644 | err_add_children: | 646 | err_add_children: |
