Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
  sparc32: pass -m32 when building vmlinux.lds
  sparc: Fixes the DRM layer build on sparc.
  ide: merge <asm-sparc/ide_64.h> with <asm-sparc/ide_32.h>
  ide: <asm-sparc/ide_64.h>: use __raw_{read,write}w()
  ide: <asm-sparc/ide_32.h>: use __raw_{read,write}w()
  ide: <asm-sparc/ide_64.h>: use %r0 for outw_be()
  sparc64: Do not define BIO_VMERGE_BOUNDARY.
  • Loading branch information
Linus Torvalds committed Jul 23, 2008
2 parents 0988c37 + 4a0a088 commit e9dd54d
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 219 deletions.
1 change: 1 addition & 0 deletions arch/sparc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CHECKFLAGS += -D__sparc__
#KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
KBUILD_AFLAGS += -m32
CPPFLAGS_vmlinux.lds += -m32

#LDFLAGS_vmlinux = -N -Ttext 0xf0004000
# Since 2.5.40, the first stage is left not btfix-ed.
Expand Down
102 changes: 97 additions & 5 deletions include/asm-sparc/ide.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,100 @@
#ifndef ___ASM_SPARC_IDE_H
#define ___ASM_SPARC_IDE_H
#if defined(__sparc__) && defined(__arch64__)
#include <asm-sparc/ide_64.h>
/* ide.h: SPARC PCI specific IDE glue.
*
* Copyright (C) 1997 David S. Miller (davem@davemloft.net)
* Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
* Adaptation from sparc64 version to sparc by Pete Zaitcev.
*/

#ifndef _SPARC_IDE_H
#define _SPARC_IDE_H

#ifdef __KERNEL__

#include <asm/io.h>
#ifdef CONFIG_SPARC64
#include <asm/pgalloc.h>
#include <asm/spitfire.h>
#include <asm/cacheflush.h>
#include <asm/page.h>
#else
#include <asm-sparc/ide_32.h>
#include <asm/pgtable.h>
#include <asm/psr.h>
#endif

#undef MAX_HWIFS
#define MAX_HWIFS 2

#define __ide_insl(data_reg, buffer, wcount) \
__ide_insw(data_reg, buffer, (wcount)<<1)
#define __ide_outsl(data_reg, buffer, wcount) \
__ide_outsw(data_reg, buffer, (wcount)<<1)

/* On sparc, I/O ports and MMIO registers are accessed identically. */
#define __ide_mm_insw __ide_insw
#define __ide_mm_insl __ide_insl
#define __ide_mm_outsw __ide_outsw
#define __ide_mm_outsl __ide_outsl

static inline void __ide_insw(void __iomem *port, void *dst, u32 count)
{
#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
unsigned long end = (unsigned long)dst + (count << 1);
#endif
u16 *ps = dst;
u32 *pi;

if(((unsigned long)ps) & 0x2) {
*ps++ = __raw_readw(port);
count--;
}
pi = (u32 *)ps;
while(count >= 2) {
u32 w;

w = __raw_readw(port) << 16;
w |= __raw_readw(port);
*pi++ = w;
count -= 2;
}
ps = (u16 *)pi;
if(count)
*ps++ = __raw_readw(port);

#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
__flush_dcache_range((unsigned long)dst, end);
#endif
}

static inline void __ide_outsw(void __iomem *port, const void *src, u32 count)
{
#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
unsigned long end = (unsigned long)src + (count << 1);
#endif
const u16 *ps = src;
const u32 *pi;

if(((unsigned long)src) & 0x2) {
__raw_writew(*ps++, port);
count--;
}
pi = (const u32 *)ps;
while(count >= 2) {
u32 w;

w = *pi++;
__raw_writew((w >> 16), port);
__raw_writew(w, port);
count -= 2;
}
ps = (const u16 *)pi;
if(count)
__raw_writew(*ps, port);

#if defined(CONFIG_SPARC64) && defined(DCACHE_ALIASING_POSSIBLE)
__flush_dcache_range((unsigned long)src, end);
#endif
}

#endif /* __KERNEL__ */

#endif /* _SPARC_IDE_H */
95 changes: 0 additions & 95 deletions include/asm-sparc/ide_32.h

This file was deleted.

118 changes: 0 additions & 118 deletions include/asm-sparc/ide_64.h

This file was deleted.

1 change: 1 addition & 0 deletions include/asm-sparc/io_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ _memcpy_toio(volatile void __iomem *dst, const void *src, __kernel_size_t n)
*/
extern void __iomem *ioremap(unsigned long offset, unsigned long size);
#define ioremap_nocache(X,Y) ioremap((X),(Y))
#define ioremap_wc(X,Y) ioremap((X),(Y))
extern void iounmap(volatile void __iomem *addr);

#define ioread8(X) readb(X)
Expand Down
2 changes: 1 addition & 1 deletion include/asm-sparc/io_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/* BIO layer definitions. */
extern unsigned long kern_base, kern_size;
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
#define BIO_VMERGE_BOUNDARY 8192

static inline u8 _inb(unsigned long addr)
{
Expand Down Expand Up @@ -461,6 +460,7 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
}

#define ioremap_nocache(X,Y) ioremap((X),(Y))
#define ioremap_wc(X,Y) ioremap((X),(Y))

static inline void iounmap(volatile void __iomem *addr)
{
Expand Down

0 comments on commit e9dd54d

Please sign in to comment.