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>
41 RCW_ALL
, /* Total num of bytes */
42 RCW_ALL_ALIGNED
/* Total num of bytes after aligning to 4B */
45 _Static_assert(RCW_ALL_ALIGNED
% sizeof(uint32_t) == 0,
46 "RCW_ALL_ALIGNED is not aligned");
48 /* Write an 8-bit register. Returns the number of written bytes. */
49 int rcd_write_reg(unsigned int bus
, uint8_t slave
, enum rcw_idx reg
,
52 /* Write 32 bits of memory (i.e., four 8-bit registers, not 1 32-bit register, which would
53 * involve byte swapping). Returns the number of written bytes. */
54 int rcd_write_32b(unsigned int bus
, uint8_t slave
, enum rcw_idx reg
,
57 /* Dump 32 bytes of RCD onto the screen. */
58 void dump_rcd(unsigned int bus
, uint8_t addr
);
60 #endif /* DEVICE_DRAM_RCD_H */