12 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/bitmap.h>
31 #define ILSEL_BASE 0xb8100004
32 #define ILSEL_LEVELS 15
47 static unsigned long ilsel_level_map;
49 static inline unsigned int ilsel_offset(
unsigned int bit)
54 static inline unsigned long mk_ilsel_addr(
unsigned int bit)
56 return ILSEL_BASE + ((ilsel_offset(bit) >> 1) & ~0x1);
59 static inline unsigned int mk_ilsel_shift(
unsigned int bit)
61 return (ilsel_offset(bit) & 0x3) << 2;
66 unsigned int tmp, shift;
69 pr_notice(
"enabling ILSEL set %d\n",
set);
71 addr = mk_ilsel_addr(bit);
72 shift = mk_ilsel_shift(bit);
74 pr_debug(
"%s: bit#%d: addr - 0x%08lx (shift %d, set %d)\n",
75 __func__, bit, addr, shift,
set);
78 tmp &= ~(0xf << shift);
100 pr_err(
"Aliased sources must use ilsel_enable_fixed()\n");
108 __ilsel_enable(
set, bit);
127 unsigned int bit = ilsel_offset(level - 1);
132 __ilsel_enable(
set, bit);
149 pr_notice(
"disabling ILSEL set %d\n", irq);
151 addr = mk_ilsel_addr(irq);
154 tmp &= ~(0xf << mk_ilsel_shift(irq));