t210: new sdram_lp0_save_params() function

New sdram_lp0_save_params() function for T210.

Due to its size, move the function from romstage to ramstage.

BUG=chrome-os-partner:40741
BRANCH=None
TEST=Build ok on Smaug; and check scratch registers

Change-Id: I420ac4c15262f2c6307bcd84beb6c5da0310c7c0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 38860895938c40062a9f860f75e31a539f15992b
Original-Change-Id: Iaa478969458946faedd295578fe7d72b5a32e701
Original-Signed-off-by: Yen Lin <yelin@nvidia.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/277022
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: http://review.coreboot.org/10952
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Yen Lin 2015-06-01 15:32:09 -07:00 committed by Patrick Georgi
parent 7acf2465fb
commit ae3d71a4d1
4 changed files with 965 additions and 546 deletions

View File

@ -54,9 +54,7 @@ romstage-y += power.c
romstage-y += ram_code.c romstage-y += ram_code.c
ifneq ($(CONFIG_BOOTROM_SDRAM_INIT),y) ifneq ($(CONFIG_BOOTROM_SDRAM_INIT),y)
romstage-y += sdram.c romstage-y += sdram.c
ifeq ($(CONFIG_LP0_SUPPORT),y)
romstage-y += sdram_lp0.c romstage-y += sdram_lp0.c
endif
endif endif
romstage-y += ../tegra/gpio.c romstage-y += ../tegra/gpio.c
romstage-y += ../tegra/i2c.c romstage-y += ../tegra/i2c.c
@ -78,6 +76,7 @@ ramstage-$(CONFIG_MAINBOARD_DO_DSI_INIT) += ./jdi_25x18_display/panel-jdi-lpm102
ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += dp.c ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += dp.c
ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += sor.c ramstage-$(CONFIG_MAINBOARD_DO_SOR_INIT) += sor.c
ramstage-y += sdram_lp0.c
ramstage-y += soc.c ramstage-y += soc.c
ramstage-y += spi.c ramstage-y += spi.c
ramstage-y += i2c.c ramstage-y += i2c.c

View File

@ -1076,7 +1076,4 @@ void sdram_init(const struct sdram_params *param)
sdram_set_refresh(param, emc); sdram_set_refresh(param, emc);
sdram_enable_arbiter(param); sdram_enable_arbiter(param);
sdram_lock_carveouts(param, mc); sdram_lock_carveouts(param, mc);
#if defined(CONFIG_LP0)
sdram_lp0_save_params(param);
#endif
} }

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,8 @@
#include <string.h> #include <string.h>
#include <timer.h> #include <timer.h>
#include <vendorcode/google/chromeos/chromeos.h> #include <vendorcode/google/chromeos/chromeos.h>
#include <soc/sdram.h>
#include <soc/sdram_configs.h>
#include "chip.h" #include "chip.h"
@ -144,6 +146,10 @@ static void tegra210_init(void *chip_info)
printk(BIOS_INFO, "chip %x rev %02x.%x\n", printk(BIOS_INFO, "chip %x rev %02x.%x\n",
rev.chip_id, rev.major, rev.minor); rev.chip_id, rev.major, rev.minor);
/* Save sdram parameters to scratch regs to be used in LP0 resume */
sdram_lp0_save_params(get_sdram_config());
printk(BIOS_INFO, "sdram params saved.\n");
} }
struct chip_operations soc_nvidia_tegra210_ops = { struct chip_operations soc_nvidia_tegra210_ops = {