mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
ARM: uniphier: de-couple SG macros into base address and offset
The SG_* macros represent the address of SoC-glue registers. For a planned new SoC, its base address will be changed. Turn the SG_* macros into the offset from the base address. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
c3d8f1e8e9
commit
d41b358fb3
13 changed files with 46 additions and 41 deletions
|
@ -32,7 +32,8 @@ void sg_set_pinsel(unsigned int pin, unsigned int muxval,
|
|||
unsigned int mux_bits, unsigned int reg_stride)
|
||||
{
|
||||
unsigned int shift = pin * mux_bits % 32;
|
||||
unsigned long reg = SG_PINCTRL_BASE + pin * mux_bits / 32 * reg_stride;
|
||||
void __iomem *reg = sg_base + SG_PINCTRL_BASE +
|
||||
pin * mux_bits / 32 * reg_stride;
|
||||
u32 mask = (1U << mux_bits) - 1;
|
||||
u32 tmp;
|
||||
|
||||
|
@ -45,7 +46,7 @@ void sg_set_pinsel(unsigned int pin, unsigned int muxval,
|
|||
void sg_set_iectrl(unsigned int pin)
|
||||
{
|
||||
unsigned int bit = pin % 32;
|
||||
unsigned long reg = SG_IECTRL + pin / 32 * 4;
|
||||
void __iomem *reg = sg_base + SG_IECTRL + pin / 32 * 4;
|
||||
u32 tmp;
|
||||
|
||||
tmp = readl(reg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue