Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright 2013 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. |
Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #include <arch/io.h> |
| 17 | #include <soc/addressmap.h> |
| 18 | |
| 19 | #include "pinmux.h" |
| 20 | |
| 21 | static uint32_t *pinmux_regs = (void *)TEGRA_APB_PINMUX_BASE; |
| 22 | |
| 23 | void pinmux_set_config(int pin_index, uint32_t config) |
| 24 | { |
Julius Werner | 2f37bd6 | 2015-02-19 14:51:15 -0800 | [diff] [blame] | 25 | write32(&pinmux_regs[pin_index], config); |
Gabe Black | 08d5a89 | 2013-10-03 04:35:01 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | uint32_t pinmux_get_config(int pin_index) |
| 29 | { |
| 30 | return read32(&pinmux_regs[pin_index]); |
| 31 | } |