blob: 3270defba85c1334b62f01591293eebe407e2aee [file] [log] [blame]
Jamie Chen92ba06f2020-04-27 15:49:09 +08001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
3
4#ifndef __SPD_CACHE_H
5#define __SPD_CACHE_H
6
7#include <spd_bin.h>
8
9#define SPD_CACHE_FMAP_NAME "RW_SPD_CACHE"
10#define SC_SPD_NUMS (CONFIG_DIMM_MAX)
11#define SC_SPD_OFFSET(n) (CONFIG_DIMM_SPD_SIZE * n)
12#define SC_CRC_OFFSET (CONFIG_DIMM_MAX * CONFIG_DIMM_SPD_SIZE)
13#define SC_SPD_TOTAL_LEN (CONFIG_DIMM_MAX * CONFIG_DIMM_SPD_SIZE)
14#define SC_SPD_LEN (CONFIG_DIMM_SPD_SIZE)
15#define SC_CRC_LEN (sizeof(uint16_t))
16
17enum cb_err update_spd_cache(struct spd_block *blk);
18enum cb_err load_spd_cache(uint8_t **spd_cache, size_t *spd_cache_sz);
19bool spd_cache_is_valid(uint8_t *spd_cache, size_t spd_cache_sz);
20bool check_if_dimm_changed(u8 *spd_cache, struct spd_block *blk);
21enum cb_err spd_fill_from_cache(uint8_t *spd_cache, struct spd_block *blk);
22
23#endif