1
0
Fork 0

MLK-19181-6 arm: imx8m: Fix compile warning

In file included from arch/arm/mach-imx/imx8m/soc.c:11:0:
arch/arm/mach-imx/imx8m/soc.c: In function ‘imx_gpc_set_m_core_pgc’:
./arch/arm/include/asm/io.h:44:28: warning: cast to pointer from integer of differen                                                                                                                                                         t size [-Wint-to-pointer-cast]
 #define __arch_getl(a)   (*(volatile unsigned int *)(a))
                            ^
./arch/arm/include/asm/io.h:122:31: note: in expansion of macro ‘__arch_getl’
 #define readl(c) ({ u32 __v = __arch_getl(c); __iormb(); __v; })
                               ^~~~~~~~~~~
arch/arm/mach-imx/imx8m/soc.c:427:8: note: in expansion of macro ‘readl’
  val = readl(GPC_BASE_ADDR + offset);
        ^~~~~
./arch/arm/include/asm/io.h:49:29: warning: cast to pointer from integer of differen                                                                                                                                                         t size [-Wint-to-pointer-cast]
 #define __arch_putl(v,a)  (*(volatile unsigned int *)(a) = (v))
                             ^
./arch/arm/include/asm/io.h:117:48: note: in expansion of macro ‘__arch_putl’
 #define writel(v,c) ({ u32 __v = v; __iowmb(); __arch_putl(__v,c); __v; })
                                                ^~~~~~~~~~~
arch/arm/mach-imx/imx8m/soc.c:432:2: note: in expansion of macro ‘writel’
  writel(val, GPC_BASE_ADDR + offset);
  ^~~~~~
arch/arm/mach-imx/imx8m/soc.c: In function ‘imx8m_usb_power’:
arch/arm/mach-imx/imx8m/soc.c:453:16: warning: unused variable ‘ret’ [-Wunused-varia                                                                                                                                                         ble]
  unsigned long ret;
                ^~~

Signed-off-by: Li Jun <jun.li@nxp.com>
zero-sugar
Li Jun 2018-08-10 16:30:15 +08:00
parent e7cbfb4f2d
commit 3a1e7c188d
1 changed files with 6 additions and 8 deletions

View File

@ -422,14 +422,15 @@ static uint32_t gpc_pu_m_core_offset[11] = {
void imx_gpc_set_m_core_pgc(unsigned int offset, bool pdn)
{
uintptr_t val;
uint32_t val;
uintptr_t reg = GPC_BASE_ADDR + offset;
val = readl(GPC_BASE_ADDR + offset);
val = readl(reg);
val &= ~(0x1 << PGC_PCR);
if(pdn)
val |= 0x1 << PGC_PCR;
writel(val, GPC_BASE_ADDR + offset);
writel(val, reg);
}
void imx8m_usb_power_domain(uint32_t domain_id, bool on)
@ -450,16 +451,13 @@ void imx8m_usb_power_domain(uint32_t domain_id, bool on)
int imx8m_usb_power(int usb_id, bool on)
{
unsigned long ret;
if (usb_id > 1)
return -EINVAL;
#ifdef CONFIG_SPL_BUILD
imx8m_usb_power_domain(2 + usb_id, on);
#else
ret = call_imx_sip(FSL_SIP_GPC,
FSL_SIP_CONFIG_GPC_PM_DOMAIN, 2 + usb_id, on, 0);
if (ret)
if (call_imx_sip(FSL_SIP_GPC, FSL_SIP_CONFIG_GPC_PM_DOMAIN,
2 + usb_id, on, 0))
return -EPERM;
#endif
return 0;