1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef DEVICE_DRAM_RCD_H
4 #define DEVICE_DRAM_RCD_H
7 #include <device/i2c_simple.h>
8 #include <console/console.h>
42 RCW_ALL
, /* Total num of bytes */
43 RCW_ALL_ALIGNED
/* Total num of bytes after aligning to 4B */
46 _Static_assert(RCW_ALL_ALIGNED
% sizeof(uint32_t) == 0,
47 "RCW_ALL_ALIGNED is not aligned");
49 /* Write an 8-bit register. Returns the number of written bytes. */
50 int rcd_write_reg(unsigned int bus
, uint8_t slave
, enum rcw_idx reg
,
53 /* Write 32 bits of memory (i.e., four 8-bit registers, not 1 32-bit register, which would
54 * involve byte swapping). Returns the number of written bytes. */
55 int rcd_write_32b(unsigned int bus
, uint8_t slave
, enum rcw_idx reg
,
58 /* Dump 32 bytes of RCD onto the screen. */
59 void dump_rcd(unsigned int bus
, uint8_t addr
);
61 #endif /* DEVICE_DRAM_RCD_H */