68 for (j = 0; j < blk->
len; j++)
105 if (*spd_cache ==
NULL)
111 printk(
BIOS_INFO,
"SPD_CACHE: cache found, size 0x%zx\n", *spd_cache_sz);
127 data_crc =
crc16_byte(data_crc, *(spd_cache + i));
154 bool dimm_present_in_cache;
155 bool dimm_changed =
false;
157 for (i = 0; i <
SC_SPD_NUMS && !dimm_changed; i++) {
167 if (sn == 0xffffffff) {
168 if (!dimm_present_in_cache)
175 if (dimm_present_in_cache) {
#define assert(statement)
cb_err
coreboot error codes
@ CB_ERR
Generic error code.
@ CB_SUCCESS
Call completed successfully.
#define printk(level,...)
uint16_t crc16_byte(uint16_t prev_crc, uint8_t data)
static struct region_device rdev
int fmap_locate_area_as_rdev(const char *name, struct region_device *area)
int fmap_locate_area_as_rdev_rw(const char *name, struct region_device *area)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_NOTICE
BIOS_NOTICE - Unexpected but relatively insignificant.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
ssize_t rdev_eraseat(const struct region_device *rd, size_t offset, size_t size)
static size_t region_device_sz(const struct region_device *rdev)
ssize_t rdev_writeat(const struct region_device *rd, const void *b, size_t offset, size_t size)
static void * rdev_mmap_full(const struct region_device *rd)
enum cb_err get_spd_sn(u8 addr, u32 *sn)
#define SPD_PAGE_LEN_DDR4
bool check_if_dimm_changed(u8 *spd_cache, struct spd_block *blk)
static bool get_cached_dimm_present(uint8_t *spd_cache, uint8_t idx)
enum cb_err load_spd_cache(uint8_t **spd_cache, size_t *spd_cache_sz)
enum cb_err spd_fill_from_cache(uint8_t *spd_cache, struct spd_block *blk)
enum cb_err update_spd_cache(struct spd_block *blk)
bool spd_cache_is_valid(uint8_t *spd_cache, size_t spd_cache_sz)
#define SPD_CACHE_FMAP_NAME
int memcmp(const void *s1, const void *s2, size_t n)
u8 addr_map[CONFIG_DIMM_MAX]
u8 * spd_array[CONFIG_DIMM_MAX]