Linux-MIPS Archive on lore.kernel.org
 help / Atom feed
* [PATCH] MIPS: jazz: fix 64bit build
@ 2019-01-09 17:12 Thomas Bogendoerfer
  2019-01-09 22:19 ` Paul Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 2019-01-09 17:12 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel

64bit JAZZ builds failed with

linux-next/arch/mips/jazz/jazzdma.c: In function ‘vdma_init’:
/linux-next/arch/mips/jazz/jazzdma.c:77:30: error: implicit declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’? [-Werror=implicit-function-declaration]
  pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
                              ^~~~~~~~~
                              CKSEG1ADDR
/linux-next/arch/mips/jazz/jazzdma.c:77:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
          ^
In file included from /linux-next/arch/mips/include/asm/barrier.h:11:0,
                 from /linux-next/include/linux/compiler.h:248,
                 from /linux-next/include/linux/kernel.h:10,
                 from /linux-next/arch/mips/jazz/jazzdma.c:11:
/linux-next/arch/mips/include/asm/addrspace.h:41:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
 #define _ACAST32_  (_ATYPE_)(_ATYPE32_) /* widen if necessary */
                             ^
/linux-next/arch/mips/include/asm/addrspace.h:53:25: note: in expansion of macro ‘_ACAST32_’
 #define CPHYSADDR(a)  ((_ACAST32_(a)) & 0x1fffffff)
                         ^~~~~~~~~
/linux-next/arch/mips/jazz/jazzdma.c:84:44: note: in expansion of macro ‘CPHYSADDR’
  r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));

Using correct casts and CKSEG1ADDR when dealing with the pgtbl setup
fixes this.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 arch/mips/jazz/jazzdma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index 6256d35dbf4d..bedb5047aff3 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -74,14 +74,15 @@ static int __init vdma_init(void)
 						    get_order(VDMA_PGTBL_SIZE));
 	BUG_ON(!pgtbl);
 	dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
-	pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
+	pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl);
 
 	/*
 	 * Clear the R4030 translation table
 	 */
 	vdma_pgtbl_init();
 
-	r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));
+	r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE,
+			  CPHYSADDR((unsigned long)pgtbl));
 	r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE);
 	r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
 
-- 
2.13.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: jazz: fix 64bit build
  2019-01-09 17:12 [PATCH] MIPS: jazz: fix 64bit build Thomas Bogendoerfer
@ 2019-01-09 22:19 ` Paul Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-01-09 22:19 UTC (permalink / raw)
  To: Thomas Bogendoerfer
  Cc: Ralf Baechle, Paul Burton, James Hogan, linux-mips, linux-kernel,
	linux-mips

Hello,

Thomas Bogendoerfer wrote:
> 64bit JAZZ builds failed with
> 
> linux-next/arch/mips/jazz/jazzdma.c: In function ‘vdma_init’:
> /linux-next/arch/mips/jazz/jazzdma.c:77:30: error: implicit declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’? [-Werror=implicit-function-declaration]
> pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
> ^~~~~~~~~
> CKSEG1ADDR
> /linux-next/arch/mips/jazz/jazzdma.c:77:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
> pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
> ^
> In file included from /linux-next/arch/mips/include/asm/barrier.h:11:0,
> from /linux-next/include/linux/compiler.h:248,
> from /linux-next/include/linux/kernel.h:10,
> from /linux-next/arch/mips/jazz/jazzdma.c:11:
> /linux-next/arch/mips/include/asm/addrspace.h:41:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> #define _ACAST32_  (_ATYPE_)(_ATYPE32_) /* widen if necessary */
> ^
> /linux-next/arch/mips/include/asm/addrspace.h:53:25: note: in expansion of macro ‘_ACAST32_’
> #define CPHYSADDR(a)  ((_ACAST32_(a)) & 0x1fffffff)
> ^~~~~~~~~
> /linux-next/arch/mips/jazz/jazzdma.c:84:44: note: in expansion of macro ‘CPHYSADDR’
> r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));
> 
> Using correct casts and CKSEG1ADDR when dealing with the pgtbl setup
> fixes this.
> 
> Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>

Applied to mips-fixes.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 17:12 [PATCH] MIPS: jazz: fix 64bit build Thomas Bogendoerfer
2019-01-09 22:19 ` Paul Burton

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org linux-mips@archiver.kernel.org
	public-inbox-index linux-mips


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/ public-inbox