2018-11-16 09:44:09 +08:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Passing basic information from SPL to U-Boot proper
|
|
|
|
*
|
|
|
|
* Copyright 2018 Google, Inc
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <handoff.h>
|
2020-10-31 11:38:53 +08:00
|
|
|
#include <asm/global_data.h>
|
2018-11-16 09:44:09 +08:00
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
|
|
|
void handoff_save_dram(struct spl_handoff *ho)
|
|
|
|
{
|
2020-08-12 17:55:46 +08:00
|
|
|
struct bd_info *bd = gd->bd;
|
|
|
|
int i;
|
|
|
|
|
2018-11-16 09:44:09 +08:00
|
|
|
ho->ram_size = gd->ram_size;
|
2020-08-12 17:55:46 +08:00
|
|
|
|
|
|
|
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
|
|
|
|
ho->ram_bank[i].start = bd->bi_dram[i].start;
|
|
|
|
ho->ram_bank[i].size = bd->bi_dram[i].size;
|
2018-11-16 09:44:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void handoff_load_dram_size(struct spl_handoff *ho)
|
|
|
|
{
|
|
|
|
gd->ram_size = ho->ram_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
void handoff_load_dram_banks(struct spl_handoff *ho)
|
|
|
|
{
|
2020-08-12 17:55:46 +08:00
|
|
|
struct bd_info *bd = gd->bd;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
|
|
|
|
bd->bi_dram[i].start = ho->ram_bank[i].start;
|
|
|
|
bd->bi_dram[i].size = ho->ram_bank[i].size;
|
2018-11-16 09:44:09 +08:00
|
|
|
}
|
|
|
|
}
|