blob: 87e80990bad88b873a5d21e8a96d168254fc1ae4 [file] [log] [blame]
Jimmy Zhangbf04eda2014-02-11 17:21:20 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2014 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080014 */
15
16#ifndef __SOC_NVIDIA_TEGRA_APBMISC_H__
17#define __SOC_NVIDIA_TEGRA_APBMISC_H__
18
19#include <stdint.h>
20
21struct apbmisc {
Tom Warren355dc1e2015-05-21 15:21:12 -070022 u32 reserved0[2]; /* ABP_MISC_PP_ offsets 00 and 04 */
23 u32 pp_strapping_opt_a; /* _STRAPPING_OPT_A_0, offset 08 */
24 u32 reserved1[6]; /* ABP_MISC_PP_ offsets 0C-20 */
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080025 u32 pp_config_ctl; /* _CONFIG_CTL_0, offset 24 */
Tom Warren355dc1e2015-05-21 15:21:12 -070026 u32 reserved2[6]; /* APB_MISC_PP_ offsets 28-3C */
Ken Chang41359bd2014-04-21 17:54:28 +080027 u32 pp_pinmux_global; /* _PINMUX_GLOBAL_0, offset 40 */
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080028};
29
30#define PP_CONFIG_CTL_TBE (1 << 7)
31#define PP_CONFIG_CTL_JTAG (1 << 6)
32
Ken Chang41359bd2014-04-21 17:54:28 +080033#define PP_PINMUX_CLAMP_INPUTS (1 << 0)
34
Aaron Durbinbf534182014-08-04 11:40:45 -050035enum {
36 MISC_GP_HIDREV = 0x804
37};
38
39struct tegra_revision {
40 int hid_fam;
41 int chip_id;
42 int major;
43 int minor;
44};
Ken Chang41359bd2014-04-21 17:54:28 +080045
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080046void enable_jtag(void);
Ken Chang41359bd2014-04-21 17:54:28 +080047void clamp_tristate_inputs(void);
Aaron Durbinbf534182014-08-04 11:40:45 -050048void tegra_revision_info(struct tegra_revision *id);
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080049
Tom Warren355dc1e2015-05-21 15:21:12 -070050enum {
51 PP_STRAPPING_OPT_A_RAM_CODE_SHIFT = 4,
52 PP_STRAPPING_OPT_A_RAM_CODE_MASK =
53 0xF << PP_STRAPPING_OPT_A_RAM_CODE_SHIFT,
54};
55
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080056#endif /* __SOC_NVIDIA_TEGRA_APBMISC_H__ */