patch-2.3.14 linux/include/asm-alpha/core_polaris.h

Next file: linux/include/asm-alpha/core_pyxis.h
Previous file: linux/include/asm-alpha/core_mcpcia.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/include/asm-alpha/core_polaris.h linux/include/asm-alpha/core_polaris.h
@@ -19,23 +19,23 @@
  */
 
 /* Polaris memory regions */
-#define		POLARIS_SPARSE_MEM_BASE		(IDENT_ADDR + 0xf800000000)
-#define		POLARIS_DENSE_MEM_BASE		(IDENT_ADDR + 0xf900000000)
-#define 	POLARIS_SPARSE_IO_BASE		(IDENT_ADDR + 0xf980000000)
-#define		POLARIS_SPARSE_CONFIG_BASE	(IDENT_ADDR + 0xf9c0000000)
-#define		POLARIS_IACK_BASE		(IDENT_ADDR + 0xf9f8000000)
-#define		POLARIS_DENSE_IO_BASE		(IDENT_ADDR + 0xf9fc000000)
-#define		POLARIS_DENSE_CONFIG_BASE	(IDENT_ADDR + 0xf9fe000000)
+#define POLARIS_SPARSE_MEM_BASE		(IDENT_ADDR + 0xf800000000)
+#define POLARIS_DENSE_MEM_BASE		(IDENT_ADDR + 0xf900000000)
+#define POLARIS_SPARSE_IO_BASE		(IDENT_ADDR + 0xf980000000)
+#define POLARIS_SPARSE_CONFIG_BASE	(IDENT_ADDR + 0xf9c0000000)
+#define POLARIS_IACK_BASE		(IDENT_ADDR + 0xf9f8000000)
+#define POLARIS_DENSE_IO_BASE		(IDENT_ADDR + 0xf9fc000000)
+#define POLARIS_DENSE_CONFIG_BASE	(IDENT_ADDR + 0xf9fe000000)
 
-#define		POLARIS_IACK_SC			POLARIS_IACK_BASE
+#define POLARIS_IACK_SC			POLARIS_IACK_BASE
 
 /* The Polaris command/status registers live in PCI Config space for
  * bus 0/device 0.  As such, they may be bytes, words, or doublewords.
  */
-#define		POLARIS_W_VENID		(POLARIS_DENSE_CONFIG_BASE)
-#define		POLARIS_W_DEVID		(POLARIS_DENSE_CONFIG_BASE+2)
-#define		POLARIS_W_CMD		(POLARIS_DENSE_CONFIG_BASE+4)
-#define		POLARIS_W_STATUS	(POLARIS_DENSE_CONFIG_BASE+6)
+#define POLARIS_W_VENID		(POLARIS_DENSE_CONFIG_BASE)
+#define POLARIS_W_DEVID		(POLARIS_DENSE_CONFIG_BASE+2)
+#define POLARIS_W_CMD		(POLARIS_DENSE_CONFIG_BASE+4)
+#define POLARIS_W_STATUS	(POLARIS_DENSE_CONFIG_BASE+6)
 
 /* No HAE address.  Polaris has no concept of an HAE, since it
  * supports transfers of all sizes in dense space.
@@ -62,7 +62,7 @@
     u_long	psc_pcictl2;
 };
 
- #ifdef __KERNEL__
+#ifdef __KERNEL__
 
 #ifndef __EXTERN_INLINE
 #define __EXTERN_INLINE extern inline
@@ -96,7 +96,7 @@
 
 __EXTERN_INLINE unsigned int polaris_inb(unsigned long addr)
 {
-        return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE));
+	return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE));
 }
 
 __EXTERN_INLINE void polaris_outb(unsigned char b, unsigned long addr)
@@ -107,7 +107,7 @@
 
 __EXTERN_INLINE unsigned int polaris_inw(unsigned long addr)
 {
-        return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE));
+	return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE));
 }
 
 __EXTERN_INLINE void polaris_outw(unsigned short b, unsigned long addr)
@@ -118,13 +118,13 @@
 
 __EXTERN_INLINE unsigned int polaris_inl(unsigned long addr)
 {
-        return *(vuip)(addr + POLARIS_DENSE_IO_BASE);
+	return *(vuip)(addr + POLARIS_DENSE_IO_BASE);
 }
 
 __EXTERN_INLINE void polaris_outl(unsigned int b, unsigned long addr)
 {
-        *(vuip)(addr + POLARIS_DENSE_IO_BASE) = b;
-        mb();
+	*(vuip)(addr + POLARIS_DENSE_IO_BASE) = b;
+	mb();
 }
 
 /*
@@ -136,53 +136,116 @@
 
 __EXTERN_INLINE unsigned long polaris_readb(unsigned long addr)
 {
-        return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_MEM_BASE));
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	return __kernel_ldbu(*(vucp)addr);
 }
 
 __EXTERN_INLINE unsigned long polaris_readw(unsigned long addr)
 {
-        return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_MEM_BASE));
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	return __kernel_ldwu(*(vusp)addr);
 }
 
 __EXTERN_INLINE unsigned long polaris_readl(unsigned long addr)
 {
-        return *(vuip)(addr + POLARIS_DENSE_MEM_BASE);
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	return *(vuip)addr;
 }
 
 __EXTERN_INLINE unsigned long polaris_readq(unsigned long addr)
 {
-        return *(vulp)(addr + POLARIS_DENSE_MEM_BASE);
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	return *(vulp)addr;
 }
 
 __EXTERN_INLINE void polaris_writeb(unsigned char b, unsigned long addr)
 {
-        __kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_MEM_BASE));
-        mb();
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	__kernel_stb(b, *(vucp)addr);
 }
 
 __EXTERN_INLINE void polaris_writew(unsigned short b, unsigned long addr)
 {
-        __kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_MEM_BASE));
-        mb();
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	__kernel_stw(b, *(vusp)addr);
 }
 
 __EXTERN_INLINE void polaris_writel(unsigned int b, unsigned long addr)
 {
-        *(vuip)(addr + POLARIS_DENSE_MEM_BASE) = b;
-        mb();
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	*(vuip)addr = b;
 }
 
 __EXTERN_INLINE void polaris_writeq(unsigned long b, unsigned long addr)
 {
-        *(vulp)(addr + POLARIS_DENSE_MEM_BASE) = b;
-        mb();
+#if __DEBUG_IOREMAP
+	if (addr <= 0x100000000) {
+		printk(KERN_CRIT "polaris: 0x%lx not ioremapped (%p)\n",
+		       addr, __builtin_return_address(0));
+		addr += POLARIS_DENSE_MEM_BASE;
+	}
+#endif
+
+	*(vulp)addr = b;
 }
 
-/* Find the DENSE memory area for a given bus address.  */
+__EXTERN_INLINE unsigned long polaris_ioremap(unsigned long addr)
+{
+	return POLARIS_DENSE_MEM_BASE + addr;
+}
 
-__EXTERN_INLINE unsigned long polaris_dense_mem(unsigned long addr)
+__EXTERN_INLINE int polaris_is_ioaddr(unsigned long addr)
 {
-        return POLARIS_DENSE_MEM_BASE;
+	return addr >= IDENT_ADDR + 0x8000000000UL;
 }
 
 #undef vucp
@@ -209,7 +272,8 @@
 #define __readq         polaris_readq
 #define __writel        polaris_writel
 #define __writeq        polaris_writeq
-#define dense_mem       polaris_dense_mem
+#define __ioremap       polaris_ioremap
+#define __is_ioaddr	polaris_is_ioaddr
 
 #define inb(port) __inb((port))
 #define inw(port) __inw((port))
@@ -219,15 +283,16 @@
 #define outw(v, port) __outw((v),(port))
 #define outl(v, port) __outl((v),(port))
 
-#define readb(a)        __readb((unsigned long)(a))
-#define readw(a)        __readw((unsigned long)(a))
-#define readl(a)        __readl((unsigned long)(a))
-#define readq(a)        __readq((unsigned long)(a))
-
-#define writeb(v,a)     __writeb((v),(unsigned long)(a))
-#define writew(v,a)     __writew((v),(unsigned long)(a))
-#define writel(v,a)     __writel((v),(unsigned long)(a))
-#define writeq(v,a)     __writeq((v),(unsigned long)(a))
+#if !__DEBUG_IOREMAP
+#define __raw_readb(a)		__readb((unsigned long)(a))
+#define __raw_readw(a)		__readw((unsigned long)(a))
+#define __raw_readl(a)		__readl((unsigned long)(a))
+#define __raw_readq(a)		__readq((unsigned long)(a))
+#define __raw_writeb(v,a)	__writeb((v),(unsigned long)(a))
+#define __raw_writeb(v,a)	__writew((v),(unsigned long)(a))
+#define __raw_writel(v,a)	__writel((v),(unsigned long)(a))
+#define __raw_writeq(v,a)	__writeq((v),(unsigned long)(a))
+#endif
 
 #endif /* __WANT_IO_DEF */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)