/* write field of ipu registers, without affecting other bits. */
void ipu_write_field(int32_t ipu_index, uint32_t ID_addr, uint32_t ID_mask, uint32_t data)
/* write field of ipu registers, without affecting other bits. */
void ipu_write_field(int32_t ipu_index, uint32_t ID_addr, uint32_t ID_mask, uint32_t data)
{
    uint32_t rdata;
    ID_addr += REGS_IPU_BASE(ipu_index);
    rdata = readl(ID_addr);
    rdata &= ~ID_mask;
    rdata |= (data * (ID_mask & -ID_mask)) & ID_mask;
    writel(rdata, ID_addr);
}