Lines Matching refs:pei_data
55 static int read_seed_from_cmos(struct pei_data *pei_data) in read_seed_from_cmos() argument
73 ret = rtc_read32(dev, CMOS_OFFSET_MRC_SEED, &pei_data->scrambler_seed); in read_seed_from_cmos()
76 &pei_data->scrambler_seed_s3); in read_seed_from_cmos()
84 pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); in read_seed_from_cmos()
86 pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); in read_seed_from_cmos()
89 c1 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed, in read_seed_from_cmos()
91 c2 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed_s3, in read_seed_from_cmos()
100 pei_data->scrambler_seed = 0; in read_seed_from_cmos()
101 pei_data->scrambler_seed_s3 = 0; in read_seed_from_cmos()
108 static int prepare_mrc_cache(struct pei_data *pei_data) in prepare_mrc_cache() argument
114 ret = read_seed_from_cmos(pei_data); in prepare_mrc_cache()
124 pei_data->mrc_input = mrc_cache->data; in prepare_mrc_cache()
125 pei_data->mrc_input_len = mrc_cache->data_size; in prepare_mrc_cache()
127 pei_data->mrc_input, pei_data->mrc_input_len, in prepare_mrc_cache()
133 static int write_seeds_to_cmos(struct pei_data *pei_data) in write_seeds_to_cmos() argument
146 rtc_write32(dev, CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed); in write_seeds_to_cmos()
148 pei_data->scrambler_seed, CMOS_OFFSET_MRC_SEED); in write_seeds_to_cmos()
150 rtc_write32(dev, CMOS_OFFSET_MRC_SEED_S3, pei_data->scrambler_seed_s3); in write_seeds_to_cmos()
152 pei_data->scrambler_seed_s3, CMOS_OFFSET_MRC_SEED_S3); in write_seeds_to_cmos()
155 c1 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed, in write_seeds_to_cmos()
157 c2 = compute_ip_checksum((u8 *)&pei_data->scrambler_seed_s3, in write_seeds_to_cmos()
180 struct pei_data *pei_data) in post_system_agent_init() argument
196 if (!pei_data->pcie_init) in post_system_agent_init()
205 static int copy_spd(struct udevice *dev, struct pei_data *peid) in copy_spd()
402 struct pei_data _pei_data __aligned(8) = { in dram_init()
455 struct pei_data *pei_data = &_pei_data; in dram_init() local
477 ret = copy_spd(dev, pei_data); in dram_init()
482 pei_data->boot_mode = gd->arch.pei_boot_mode; in dram_init()
484 debug("mrc_input %p\n", pei_data->mrc_input); in dram_init()
491 pei_data->boot_mode == PEI_BOOT_RESUME) { in dram_init()
492 ret = prepare_mrc_cache(pei_data); in dram_init()
498 if (pei_data->boot_mode == PEI_BOOT_RESUME && !pei_data->mrc_input) { in dram_init()
504 pei_data->tx_byte = sdram_console_tx_byte; in dram_init()
518 ret = mrc_common_init(dev, pei_data, false); in dram_init()
531 debug("MRC output data length %#x at %p\n", pei_data->mrc_output_len, in dram_init()
532 pei_data->mrc_output); in dram_init()
534 post_system_agent_init(dev, me_dev, pei_data); in dram_init()
538 if (pei_data->boot_mode != PEI_BOOT_RESUME) { in dram_init()
543 gd->arch.mrc_output = (char *)pei_data->mrc_output; in dram_init()
544 gd->arch.mrc_output_len = pei_data->mrc_output_len; in dram_init()
545 ret = write_seeds_to_cmos(pei_data); in dram_init()