blob: 2eec4e11cfb65e84cb713f34016f0aa39fe1669f [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#include <arch/io.h>
17#include <soc/addressmap.h>
18
19#include "apbmisc.h"
20
Ken Chang41359bd2014-04-21 17:54:28 +080021static struct apbmisc *misc = (struct apbmisc *)TEGRA_APB_MISC_BASE;
22
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080023void enable_jtag(void)
24{
Julius Werner2f37bd62015-02-19 14:51:15 -080025 write32(&misc->pp_config_ctl, PP_CONFIG_CTL_JTAG);
Jimmy Zhangbf04eda2014-02-11 17:21:20 -080026}
Ken Chang41359bd2014-04-21 17:54:28 +080027
28void clamp_tristate_inputs(void)
29{
Julius Werner2f37bd62015-02-19 14:51:15 -080030 write32(&misc->pp_pinmux_global, PP_PINMUX_CLAMP_INPUTS);
Ken Chang41359bd2014-04-21 17:54:28 +080031}
Aaron Durbinbf534182014-08-04 11:40:45 -050032
33void tegra_revision_info(struct tegra_revision *id)
34{
35 uintptr_t gp_hidrev= (uintptr_t)TEGRA_APB_MISC_BASE + MISC_GP_HIDREV;
36 uint32_t reg;
37
38 reg = read32((void *)(gp_hidrev));
39
40 id->hid_fam = (reg >> 0) & 0x0f;
41 id->chip_id = (reg >> 8) & 0xff;
42 id->major = (reg >> 4) & 0x0f;
43 id->minor = (reg >> 16) & 0x07;
44}