]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blobdiff - security/tlk_driver/ote_log.c
HACK: modify smc calls mapping for foster_e
[sojka/nv-tegra/linux-3.10.git] / security / tlk_driver / ote_log.c
index bb99eee630d201369c41bd2978c2329164de1fa1..febb8b49eae459eba6bf164b46ac2b040a9a6570 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014 NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@
 #include <asm/page.h>
 #include <linux/dma-mapping.h>
 #include <linux/string.h>
+#include <linux/of.h>
 
 #include "ote_protocol.h"
 
@@ -184,6 +185,9 @@ static int __init ote_logger_init(void)
                return ret;
        } else if (ret == -ENOTSUPP) {
                /* Node is present, but logger is disabled */
+       if (of_machine_is_compatible("nvidia,foster-e"))
+               smc_args[0] = TE_SMC_INIT_LOGGER_LEGACY;
+       else
                smc_args[0] = TE_SMC_INIT_LOGGER;
                smc_args[1] = 0;
                send_smc(smc_args[0], smc_args[1], 0);
@@ -194,7 +198,10 @@ static int __init ote_logger_init(void)
        if (circ_buf_init(&cb) != 0)
                return -1;
 
-       smc_args[0] = TE_SMC_INIT_LOGGER;
+       if (of_machine_is_compatible("nvidia,foster-e"))
+               smc_args[0] = TE_SMC_INIT_LOGGER_LEGACY;
+       else
+               smc_args[0] = TE_SMC_INIT_LOGGER;
        smc_args[1] = (uintptr_t)cb;
 
        /* enable logging only if secure firmware supports it */