/* Writes PE internal data memory (DMEM) from the host through indirect access registers.  */
void pe_dmem_write(int id, u32 val, u32 addr, u8 size)
/* Writes PE internal data memory (DMEM) from the host through indirect access registers.  */
void pe_dmem_write(int id, u32 val, u32 addr, u8 size)
{
	u32 offset = addr & 0x3;
	addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_WRITE |
		PE_MEM_ACCESS_DMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size);
	writel(cpu_to_be32(val << (offset << 3)), pe[id].mem_access_wdata);
	writel(addr, pe[id].mem_access_addr);
}