Angel Pons | a2ee761 | 2020-04-04 18:51:15 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Georgi | 40a3e32 | 2015-06-22 19:41:29 +0200 | [diff] [blame] | 2 | |
Kyösti Mälkki | 13f6650 | 2019-03-03 08:01:05 +0200 | [diff] [blame] | 3 | #include <device/mmio.h> |
Patrick Georgi | 40a3e32 | 2015-06-22 19:41:29 +0200 | [diff] [blame] | 4 | #include <soc/addressmap.h> |
| 5 | #include <soc/sdram.h> |
| 6 | #include <soc/nvidia/tegra/apbmisc.h> |
| 7 | |
| 8 | uint32_t sdram_get_ram_code(void) |
| 9 | { |
| 10 | struct apbmisc *misc = (struct apbmisc *)TEGRA_APB_MISC_BASE; |
| 11 | |
| 12 | return (read32(&misc->pp_strapping_opt_a) & |
| 13 | PP_STRAPPING_OPT_A_RAM_CODE_MASK) >> |
| 14 | PP_STRAPPING_OPT_A_RAM_CODE_SHIFT; |
| 15 | } |