diff options
Diffstat (limited to 'arch/arm/mach-uniphier/sg-regs.h')
-rw-r--r-- | arch/arm/mach-uniphier/sg-regs.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/arch/arm/mach-uniphier/sg-regs.h b/arch/arm/mach-uniphier/sg-regs.h index 0497655fb5..39ffed5885 100644 --- a/arch/arm/mach-uniphier/sg-regs.h +++ b/arch/arm/mach-uniphier/sg-regs.h @@ -87,54 +87,4 @@ #define SG_PINMON0_CLK_MODE_AXOSEL_20480KHZ (0x2 << 16) #define SG_PINMON0_CLK_MODE_AXOSEL_25000KHZ_A (0x3 << 16) -#ifdef __ASSEMBLY__ - - .macro sg_set_pinsel, pin, muxval, mux_bits, reg_stride, ra, rd - ldr \ra, =(SG_PINCTRL_BASE + \pin * \mux_bits / 32 * \reg_stride) - ldr \rd, [\ra] - and \rd, \rd, #~(((1 << \mux_bits) - 1) << (\pin * \mux_bits % 32)) - orr \rd, \rd, #(\muxval << (\pin * \mux_bits % 32)) - str \rd, [\ra] - .endm - -#else - -#include <linux/types.h> -#include <linux/io.h> - -static inline void sg_set_pinsel(unsigned pin, unsigned muxval, - unsigned mux_bits, unsigned reg_stride) -{ - unsigned shift = pin * mux_bits % 32; - unsigned long reg = SG_PINCTRL_BASE + pin * mux_bits / 32 * reg_stride; - u32 mask = (1U << mux_bits) - 1; - u32 tmp; - - tmp = readl(reg); - tmp &= ~(mask << shift); - tmp |= (mask & muxval) << shift; - writel(tmp, reg); -} - -static inline void sg_set_iectrl(unsigned pin) -{ - unsigned bit = pin % 32; - unsigned long reg = SG_IECTRL + pin / 32 * 4; - u32 tmp; - - tmp = readl(reg); - tmp |= 1 << bit; - writel(tmp, reg); -} - -static inline void sg_set_iectrl_range(unsigned min, unsigned max) -{ - int i; - - for (i = min; i <= max; i++) - sg_set_iectrl(i); -} - -#endif /* __ASSEMBLY__ */ - #endif /* UNIPHIER_SG_REGS_H */ |