Commit Graph

13 Commits

Author SHA1 Message Date
Preetham Chandru Ramchandra
1ae12540fe tegra_bootloader_debug: Register as platform driver
UEFI will pass bl_prof_dataptr and bl_prof_ro_ptr in DT node.
Register the driver as platform driver and get bl_prof_dataptr and
bl_prof_ro_ptr from DT.

Bug 3804913

Change-Id: I78ba764650e7b8c76dafbcb355f441e70e83a569
Signed-off-by: Preetham Chandru Ramchandra <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2991624
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-11-02 18:07:33 -07:00
praagarwal
45903d628b tegra_bootloader_debug: change bl_bcp_ptr variable
change bl_bcp_ptr variable name to a relevent name, boot_cfg_dataptr,
for tegra_bl_bcp_arg as mentioned in a previous file
tegra_bootloader_debug_init.c for 5.15

Bug 3896536

Change-Id: I039ca2b0578d476908c1b6ee8327971dac82038b
Signed-off-by: praagarwal <praagarwal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2916405
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-07 22:23:30 -07:00
praagarwal
a88e0ab87c tegra_bootloader_debug: Add functions to read from cmd line
Add functions to tegra_bootloader_debug to read addresses
from kernel command line for 5.15.

Bug 3896536

Change-Id: Ie0f75bab54b9455ce465740a2ab06a54046657fd
Signed-off-by: praagarwal <praagarwal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2908980
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-06 01:51:05 -07:00
Deepak Nibade
cec42e4059 tegra_bootloader_debug: fix crash in absence of bootloader parameters
In absence of bl_debug_data parameter passed from Bootloader, value of
tegra_bl_debug_data_start will be 0.

This triggers a kernel panic on systems where parameter is not specified
and the module is loaded.

Fix this by first checking tegra_bl_debug_data_start and
tegra_bl_debug_data_size before accessing them.

Also add a check upfront to check if mandatory bootloader parameter
tegra_bl_prof_start is passed or not. If this parameter is not passed,
bail out the driver initialization.

Bug 3996651

Change-Id: Ibb78d6cefdae1f79ecb09836b833899deacb03ce
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2900710
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-16 06:28:12 -07:00
Deepak Nibade
a87c10d72c tegra_bootloader_debug: update access to profiler carveout
Guest VM has access to all of the profiler carveout right now so that
it can read full carveout and dump all the entries.

Right now address and size of Guest VM owned profiler carveout is parsed
from kernel command line. And the address of full profiler carveout
(containing logs of other VMs too) is calculated based on assumptions.

Current architecture is now getting reworked so that only a privileged
Guest VM can access full carveout and that too in read-only mode. Each
VM will have read-write access to its own carveout to read/write
profiler entries of that VM.

Update tegra_bootloader_debug_init.c to parse tegra_bl_prof_ro_start and
tegra_bl_prof_ro_size from kernel command line. These values indicate
address and size of the full read only carveout.

In tegra_bootloader_debuginit(), map the address of read only carveout
to tegra_bl_mapped_prof_ro_start and set is_privileged_vm to true.
Only privileged VM will be assigned this read only address by BL.

tegra_bl_mapped_prof_start continues to map to read-write carveout
owned by the VM.

Update profiler_show() so that it reads entries from the read-only
carveout if is_privileged_vm is set, otherwise it reads from read
write carveout.

Bug 3566403

Change-Id: I3c1e5d42d67f7724c6fa43b7e27f08ce2cd607b7
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2868921
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-31 13:23:04 -07:00
Bharat Nihalani
ae8499fa84 tegra_bootloader_debug: use runtime debugfs check
When kernel command line debugfs=off is specified instead of
disabling CONFIG_DEBUG_FS in defconfig to disable Debug-FS,
debugfs functions like debugfs_create_dir will fail.

Use function debugfs_initialized() to check if debugfs
functionality is enabled before calling any debugfs functions.

This allows us to by-pass debugfs initialization if debugfs
is not enabled.

Bug 3896536

Change-Id: I18182f2e5f8a6b466286980907b2019961ff7e39
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864651
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:12:02 -08:00
Ketan Patil
d831cd1882 driver: platform: tegra: Fix typecast warnings
Sparse is reporting typecast warnings in tegra_bootloader_debug driver,
fix them by forcing typecast.

Bug 3528414

Change-Id: Iad12b917b9a36cfca328051e7cfb0e742681eb23
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2718125
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864630
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:58 -08:00
Ketan Patil
c0e1a29863 driver: platform: tegra: Make variables static
Sparse is reporting following warnings:
- warning: symbol 'usc' was not declared.
- warning: symbol 'gr_mb1' was not declared.
- warning: symbol 'gr_mb2' was not declared.
- warning: symbol 'gr_cpu_bl' was not declared.
Fix these issues by making these variables static.

Bug 3528414

Change-Id: I939555040184d90751370838572607d4176aa3e6
Signed-off-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2718090
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864629
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:53 -08:00
Anvesh Salveru
a0571a42ae tegra_bootloader_debug: dump full carvedout region
This change dumps the bootloader profiling data from the
complete 64KB carvedout memory which include MB1, MB2 and
HYP profiling data.

Bug 3512531

Change-Id: I22726ec25d61900ecc7a47b6973d069959846fb7
Signed-off-by: Anvesh Salveru <asalveru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2692615
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864628
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:49 -08:00
Anvesh Salveru
ddc2be88c6 tegra_bootloader_debug: sysfs to add profile point
This change creates a sysfs entry to add a new profiling
record in bootloader profiler memory.

Bug 3512531

Change-Id: I580efe0872e1801b1d3b61fa7698ed7aed7fa9ec
Signed-off-by: Anvesh Salveru <asalveru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2691788
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864627
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:44 -08:00
Anvesh Salveru
d0ab12f322 tegra_bootloader_debug: api to add profiling point
This change exports an api to add a new profiling
record in bootloader profiler memory.

Bug 3512531

Change-Id: I60fe25ab33bf607632c99a15acc24647956d4138
Signed-off-by: Anvesh Salveru <asalveru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2692037
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864626
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:40 -08:00
Anvesh Salveru
28e5701fd6 tegra_bootloader_debug: move profiler to sysfs
Add changes to use sysfs file system for reading bootloader
profiling data. Golden debug registers dump for mb1, mb2 and
cpu_bl continue to use debugfs file system.

Bug 3512531
Bug 3896536

Change-Id: I34d337cc8cfb8f36f7ae833ad8cee8dd3f1d90f0
Signed-off-by: Anvesh Salveru <asalveru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2690043
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864625
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-05 04:11:35 -08:00
Laxman Dewangan
7c00563944 platform/tegra: Add bootloader debug driver
Add bootloader debug driver which provides debug functionality
from user space.

bug 3583607

Change-Id: I8bdd2712e755b370b3e157bcdcd3329122729fea
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2708549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2022-05-06 05:22:34 -07:00