diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-06-29 02:38:06 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-06-29 22:31:18 +0900 |
commit | 69492fb4c56d82142e0312474369d8da97d5182d (patch) | |
tree | 2ca572f75e9644a215679dca55e197981f5910cf /arch/arm/mach-uniphier/sg-regs.h | |
parent | e3d5d3ac5bbbddddf830a918e59c13f7a8d9ef6c (diff) | |
download | u-boot-69492fb4c56d82142e0312474369d8da97d5182d.tar.gz u-boot-69492fb4c56d82142e0312474369d8da97d5182d.tar.xz u-boot-69492fb4c56d82142e0312474369d8da97d5182d.zip |
ARM: uniphier: move sg_set_{pinsel, iectrl} to more relevant places
Move the sg_set_pinsel macro to arch/arm/mach-uniphier/arm32/debug_ll.S
since it is not used anywhere else.
Move the C functions sg_set_{pinsel,iectrl} to debug-uart.c since they
are not used anywhere else.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier/sg-regs.h')
-rw-r--r-- | arch/arm/mach-uniphier/sg-regs.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/arch/arm/mach-uniphier/sg-regs.h b/arch/arm/mach-uniphier/sg-regs.h index 8aed826c96..39ffed5885 100644 --- a/arch/arm/mach-uniphier/sg-regs.h +++ b/arch/arm/mach-uniphier/sg-regs.h @@ -87,46 +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); -} - -#endif /* __ASSEMBLY__ */ - #endif /* UNIPHIER_SG_REGS_H */ |