diff options
author | Allen Martin <amartin@nvidia.com> | 2012-03-22 14:12:39 -0700 |
---|---|---|
committer | Allen Martin <amartin@nvidia.com> | 2012-04-03 09:28:16 -0700 |
commit | 80b43dbd4f50b92db349c14b5833c177ece4a6df (patch) | |
tree | 032627c168410fd66df230b2c09da498343a1381 /src/debug.h | |
parent | 080ce0cdbe8d6a8bcc9c8864d8d1b891ab0bc93e (diff) | |
download | tegrarcm-80b43dbd4f50b92db349c14b5833c177ece4a6df.tar.gz |
tegra-rcm: Download code to tegra in recovery mode
This program is used to download BCT and code to tegra from recovery
mode. Only tegras that are configurated for "nvproduction" or "ODM
open" mode are supported (no encryption).
usage:
tegra-rcm --bct=bctfile --bootloader=blfile
--loadaddr=<loadaddr> --entryaddr=<entryaddr>
bctfile is the name of the BCT (boot configuration table). It
contains memory timing and boot device selection.
blfile is the name of the booloader file. This is the code that
downloaded and executed on the tegra SoC.
loadaddr and entryaddr are the load and entry addresses of the
bootloader in the tegra address map.
Change-Id: I34754d3976f3971bdca1daefc5d1a2c69a56bbb5
Reviewed-on: http://git-master/r/94264
Reviewed-by: Allen Martin <amartin@nvidia.com>
Tested-by: Allen Martin <amartin@nvidia.com>
Diffstat (limited to 'src/debug.h')
-rw-r--r-- | src/debug.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/debug.h b/src/debug.h new file mode 100644 index 0000000..06e7c5d --- /dev/null +++ b/src/debug.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2011, NVIDIA CORPORATION + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef DEBUG_H +#define DEBUG_H + +#include <stdio.h> +#include <stdint.h> +#include <stdarg.h> + +#ifdef DEBUG +#include <stdio.h> +#define dprintf(format, args...) __dprintf("[%s:%d] %s(): " format, __FILE__, __LINE__, __func__, ## args) +__attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...); +__attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...) +{ + va_list args; + va_start(args,format); + vfprintf(stderr, format, args); + va_end(args); +} +#else +#define dprintf(format, args...) __dprintf(format, ## args) +__attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...); +__attribute__((format(printf, 1, 2))) static inline void __dprintf(const char *format, ...) { } +#endif + +void dump_hex(uint8_t *buf, int len); + +#endif // DEBUG_H |