/* This function is used to write to CLASS internal bus peripherals (ccu, pe-lem) from the host through indirect access registers.  */
static void class_bus_write(u32 val, u32 addr, u8 size)
/* This function is used to write to CLASS internal bus peripherals (ccu, pe-lem) from the host through indirect access registers.  */
static void class_bus_write(u32 val, u32 addr, u8 size)
{
	u32 offset = addr & 0x3;
	writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE);
	addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | PE_MEM_ACCESS_WRITE |
		(size << 24);
	writel(cpu_to_be32(val << (offset << 3)), CLASS_BUS_ACCESS_WDATA);
	writel(addr, CLASS_BUS_ACCESS_ADDR);
}