| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <device/mmio.h> |
| 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 | } |