12 #define HECIDEV PCI_DEV(0, 0x16, 0)
36 }
while (len > csr.csr.buffer_depth - (csr.csr.buffer_write_ptr -
37 csr.csr.buffer_read_ptr));
45 size_t bytes =
MIN(
length - i,
sizeof(dword));
46 memcpy(&dword, payload + i, bytes);
98 }
while (csr.csr.buffer_write_ptr == csr.csr.buffer_read_ptr);
106 if (head->
length + 4 > 4 * csr.csr.buffer_depth || head->
length > *packet_size) {
113 }
while (((head->
length + 3) >> 2) >
114 (csr.csr.buffer_write_ptr - csr.csr.buffer_read_ptr));
116 for (i = 0; i < (head->
length + 3) >> 2; i++)
118 *packet_size = head->
length;
141 int current_position;
143 current_position = 0;
146 current_size = *message_size - current_position;
148 (&head, &message->
dwords[current_position /
sizeof(
u32)],
149 ¤t_size) == -1)
153 current_position += current_size;
155 *message_size = current_position;
159 if (current_position >= *message_size)
185 .heci_uma_addr = heci_uma_addr,
186 .heci_uma_size = heci_uma_size,
193 reply_size =
sizeof(reply);
198 die(
"HECI init failed\n");
216 RCBA32(0x40) = 0x87000080;
u8 raw[sizeof(struct arm64_kernel_header)+0x100]
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
void * memcpy(void *dest, const void *src, size_t n)
#define DIV_ROUND_UP(x, y)
void __noreturn die(const char *fmt,...)
#define dmibar_clrbits32(addr, clear)
static __always_inline void mchbar_write32(const uintptr_t offset, const uint32_t value)
static __always_inline void dmibar_write32(const uintptr_t offset, const uint32_t value)
static __always_inline uint16_t dmibar_read16(const uintptr_t offset)
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
static void wait_heci_cb_avail(int len)
static int recv_heci_packet(struct mei_header *head, u32 *packet, u32 *packet_size)
static void send_heci_packet(struct mei_header *head, u8 *payload)
static int recv_heci_message(union uma_reply *message, u32 *message_size)
void setup_heci_uma(u64 heci_uma_addr, unsigned int heci_uma_size)
static void send_heci_uma_message(const u64 heci_uma_addr, const unsigned int heci_uma_size)
static void wait_heci_ready(void)
static void send_heci_message(u8 *msg, int len, u8 hostaddress, u8 clientaddress)
static void send_heci_packet_dword(u8 *payload, size_t length)
u32 dwords[0x48/sizeof(u32)]