2 * This file is part of the coreboot project.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #include <device/mmio.h>
17 #include <soc/addressmap.h>
18 #include <soc/sdram.h>
19 #include <soc/nvidia/tegra/apbmisc.h>
21 uint32_t sdram_get_ram_code(void)
23 struct apbmisc
*misc
= (struct apbmisc
*)TEGRA_APB_MISC_BASE
;
25 return (read32(&misc
->pp_strapping_opt_a
) &
26 PP_STRAPPING_OPT_A_RAM_CODE_MASK
) >>
27 PP_STRAPPING_OPT_A_RAM_CODE_SHIFT
;