summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndre Richter <arichter@nvidia.com>2019-05-27 10:26:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2019-08-29 10:39:25 -0400
commitbc918de501e9fc3b67156cd84b4bbec99ad8b4f1 (patch)
tree8c3e7dd1b1fff25f4fb914c13e4c885c8ca17ba7 /include
parente8ca45660bdad1e8ce85f44b2be97c16091138d3 (diff)
Linux Kernel: Uart relay sysfs node.
Bug 2461581 Change-Id: Ia2fd3cc72459a6d18781ae9ea6c2a3973947f2d6 Signed-off-by: Andre Richter <arichter@nvidia.com> (cherry picked from commit 91064c5aa574fc3e719a643f24079cddb36c53de) Reviewed-on: https://git-master.nvidia.com/r/2119540 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Hardik T Shah <hardikts@nvidia.com> Reviewed-by: Phoenix Jung <pjung@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/soc/tegra/virt/syscalls.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/include/soc/tegra/virt/syscalls.h b/include/soc/tegra/virt/syscalls.h
index bacef2471..f673b7911 100644
--- a/include/soc/tegra/virt/syscalls.h
+++ b/include/soc/tegra/virt/syscalls.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2014-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (C) 2014-2019, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Hypervisor interfaces 4 * Hypervisor interfaces
5 * 5 *
@@ -46,6 +46,7 @@
46#define HVC_NR_READ_HYP_INFO 9 46#define HVC_NR_READ_HYP_INFO 9
47#define HVC_NR_GUEST_RESET 10 47#define HVC_NR_GUEST_RESET 10
48#define HVC_NR_SYSINFO_IPA 13 48#define HVC_NR_SYSINFO_IPA 13
49#define HVC_NR_UART_RELAY_INFO 518
49 50
50#define GUEST_PRIMARY 0 51#define GUEST_PRIMARY 0
51#define GUEST_IVC_SERVER 0 52#define GUEST_IVC_SERVER 0
@@ -181,6 +182,10 @@ struct hyp_server_page {
181#define _X4_X17 "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", \ 182#define _X4_X17 "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", \
182"x13", "x14", "x15", "x16", "x17" 183"x13", "x14", "x15", "x16", "x17"
183 184
185#define _X5_X17 "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", \
186"x13", "x14", "x15", "x16", "x17"
187
188
184static inline int hyp_read_gid(unsigned int *gid) 189static inline int hyp_read_gid(unsigned int *gid)
185{ 190{
186 register uint64_t r0 asm("x0"); 191 register uint64_t r0 asm("x0");
@@ -320,6 +325,31 @@ static inline uint64_t hyp_sysinfo_ipa(void)
320 return r0; 325 return r0;
321} 326}
322 327
328static inline int hyp_read_uart_relay_info(uint64_t *ipa, uint64_t *size,
329 uint64_t *num_channels,
330 uint64_t *max_msg_size)
331{
332 register uint64_t x0 asm("x0");
333 register uint64_t x1 asm("x1");
334 register uint64_t x2 asm("x2");
335 register uint64_t x3 asm("x3");
336 register uint64_t x4 asm("x4");
337
338 asm("hvc %5"
339 : "=r"(x0), "=r"(x1),
340 "=r"(x2), "=r"(x3),
341 "=r"(x4)
342 : "i"(HVC_NR_UART_RELAY_INFO)
343 : _X5_X17);
344
345 *ipa = x1;
346 *size = x2;
347 *num_channels = x3;
348 *max_msg_size = x4;
349
350 return (int)x0;
351}
352
323#undef _X3_X17 353#undef _X3_X17
324#undef _X4_X17 354#undef _X4_X17
325 355