in mm/proc.c [410:435]
static inline void cpu_l2cache_op(unsigned long start, unsigned long end, unsigned long op)
{
if (atl2c_base) {
unsigned long p_start = __pa(start);
unsigned long p_end = __pa(end);
unsigned long cmd;
unsigned long line_size;
/* TODO Can Use PAGE Mode to optimize if range large than PAGE_SIZE */
line_size = L2_CACHE_LINE_SIZE();
p_start = p_start & (~(line_size - 1));
p_end = (p_end + line_size - 1) & (~(line_size - 1));
cmd =
(p_start & ~(line_size - 1)) | op |
CCTL_SINGLE_CMD;
do {
L2_CMD_RDY();
L2C_W_REG(L2_CCTL_CMD_OFF, cmd);
cmd += line_size;
p_start += line_size;
} while (p_end > p_start);
cmd = CCTL_CMD_L2_SYNC;
L2_CMD_RDY();
L2C_W_REG(L2_CCTL_CMD_OFF, cmd);
L2_CMD_RDY();
}
}