Jimmy Zhang | bf04eda | 2014-02-11 17:21:20 -0800 | [diff] [blame] | 1 | /* |
| 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 Zhang | bf04eda | 2014-02-11 17:21:20 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <arch/io.h> |
| 17 | #include <soc/addressmap.h> |
| 18 | |
| 19 | #include "apbmisc.h" |
| 20 | |
Ken Chang | 41359bd | 2014-04-21 17:54:28 +0800 | [diff] [blame] | 21 | static struct apbmisc *misc = (struct apbmisc *)TEGRA_APB_MISC_BASE; |
| 22 | |
Jimmy Zhang | bf04eda | 2014-02-11 17:21:20 -0800 | [diff] [blame] | 23 | void enable_jtag(void) |
| 24 | { |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 25 | write32(&misc->pp_config_ctl, PP_CONFIG_CTL_JTAG); |
Jimmy Zhang | bf04eda | 2014-02-11 17:21:20 -0800 | [diff] [blame] | 26 | } |
Ken Chang | 41359bd | 2014-04-21 17:54:28 +0800 | [diff] [blame] | 27 | |
| 28 | void clamp_tristate_inputs(void) |
| 29 | { |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 30 | write32(&misc->pp_pinmux_global, PP_PINMUX_CLAMP_INPUTS); |
Ken Chang | 41359bd | 2014-04-21 17:54:28 +0800 | [diff] [blame] | 31 | } |
Aaron Durbin | bf53418 | 2014-08-04 11:40:45 -0500 | [diff] [blame] | 32 | |
| 33 | void 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 | } |