Commit 1ea4f4f8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xtensa-next-20121008' of git://github.com/czankel/xtensa-linux

Pull Xtensa patchset from Chris Zankel:
 "The Xtensa tree has been broken for some time now, and this patchset
  brings it back to life.  It has been part of the linux-next tree for
  some time.

  Most changes are inside the xtensa subdirectory; the other changes
  mostly add another rule to already existing #ifdefs to exclude Xtensa,
  where required.  The only 'common' change is to add two more sections
  ('.xt.prop' and '.xt.lit') to the white list in modpost."

* tag 'xtensa-next-20121008' of git://github.com/czankel/xtensa-linux: (27 commits)
  xtensa: Setup CROSS_COMPILE at the top
  xtensa: drop CONFIG_EMBEDDED_RAMDISK
  xtensa: fix TIOCGSERIAL and TIOCSSERIAL definitions
  xtensa: provide dummy gcc intrinsics
  xtensa: add missing symbol exports
  parport: disable for xtensa arch
  xtensa: rename MISC SR definition to avoid name clashes
  hisax: disable build for big-endian xtensa
  xtensa: fix CODA build
  xtensa: fix parallel make
  xtensa: ISS: drop unused io.c
  xtensa: ISS: exit simulator in case of halt or poweroff
  xtensa: ISS: change keyboard polling rate
  xtensa: ISS: add platform_pcibios_init
  xtensa: ISS: add dummy serial.h for ISS platform
  xtensa: change default platform clock frequency to 10MHz
  xtensa: add ARCH_WANT_OPTIONAL_GPIOLIB to xtensa config
  xtensa: set NO_IOPORT to 'n' by default
  xtensa: adopt generic io routines
  xtensa: fix ioremap
  ...
parents dea77ccd 70cefe76
...@@ -7170,6 +7170,8 @@ F: drivers/char/tlclk.c ...@@ -7170,6 +7170,8 @@ F: drivers/char/tlclk.c
TENSILICA XTENSA PORT (xtensa) TENSILICA XTENSA PORT (xtensa)
M: Chris Zankel <chris@zankel.net> M: Chris Zankel <chris@zankel.net>
M: Max Filippov <jcmvbkbc@gmail.com>
L: linux-xtensa@linux-xtensa.org
S: Maintained S: Maintained
F: arch/xtensa/ F: arch/xtensa/
......
...@@ -11,6 +11,9 @@ config XTENSA ...@@ -11,6 +11,9 @@ config XTENSA
select HAVE_GENERIC_HARDIRQS select HAVE_GENERIC_HARDIRQS
select GENERIC_IRQ_SHOW select GENERIC_IRQ_SHOW
select GENERIC_CPU_DEVICES select GENERIC_CPU_DEVICES
select MODULES_USE_ELF_RELA
select GENERIC_PCI_IOMAP
select ARCH_WANT_OPTIONAL_GPIOLIB
help help
Xtensa processors are 32-bit RISC machines designed by Tensilica Xtensa processors are 32-bit RISC machines designed by Tensilica
primarily for embedded systems. These processors are both primarily for embedded systems. These processors are both
...@@ -35,7 +38,7 @@ config ARCH_HAS_ILOG2_U64 ...@@ -35,7 +38,7 @@ config ARCH_HAS_ILOG2_U64
def_bool n def_bool n
config NO_IOPORT config NO_IOPORT
def_bool y def_bool n
config HZ config HZ
int int
...@@ -142,6 +145,7 @@ config XTENSA_PLATFORM_XT2000 ...@@ -142,6 +145,7 @@ config XTENSA_PLATFORM_XT2000
config XTENSA_PLATFORM_S6105 config XTENSA_PLATFORM_S6105
bool "S6105" bool "S6105"
select SERIAL_CONSOLE select SERIAL_CONSOLE
select NO_IOPORT
endchoice endchoice
...@@ -205,23 +209,6 @@ source "drivers/Kconfig" ...@@ -205,23 +209,6 @@ source "drivers/Kconfig"
source "fs/Kconfig" source "fs/Kconfig"
menu "Xtensa initrd options"
depends on BLK_DEV_INITRD
config EMBEDDED_RAMDISK
bool "Embed root filesystem ramdisk into the kernel"
config EMBEDDED_RAMDISK_IMAGE
string "Filename of gzipped ramdisk image"
depends on EMBEDDED_RAMDISK
default "ramdisk.gz"
help
This is the filename of the ramdisk image to be built into the
kernel. Relative pathnames are relative to arch/xtensa/boot/ramdisk/.
The ramdisk image is not part of the kernel distribution; you must
provide one yourself.
endmenu
source "arch/xtensa/Kconfig.debug" source "arch/xtensa/Kconfig.debug"
source "security/Kconfig" source "security/Kconfig"
......
...@@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom ...@@ -21,6 +21,18 @@ variant-$(CONFIG_XTENSA_VARIANT_LINUX_CUSTOM) := custom
VARIANT = $(variant-y) VARIANT = $(variant-y)
export VARIANT export VARIANT
# Test for cross compiling
ifneq ($(VARIANT),)
COMPILE_ARCH = $(shell uname -m)
ifneq ($(COMPILE_ARCH), xtensa)
ifndef CROSS_COMPILE
CROSS_COMPILE = xtensa_$(VARIANT)-
endif
endif
endif
# Platform configuration # Platform configuration
platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
...@@ -31,7 +43,7 @@ PLATFORM = $(platform-y) ...@@ -31,7 +43,7 @@ PLATFORM = $(platform-y)
export PLATFORM export PLATFORM
# temporarily until string.h is fixed # temporarily until string.h is fixed
KBUILD_CFLAGS += -ffreestanding KBUILD_CFLAGS += -ffreestanding -D__linux__
KBUILD_CFLAGS += -pipe -mlongcalls KBUILD_CFLAGS += -pipe -mlongcalls
...@@ -48,24 +60,6 @@ endif ...@@ -48,24 +60,6 @@ endif
KBUILD_DEFCONFIG := iss_defconfig KBUILD_DEFCONFIG := iss_defconfig
# ramdisk/initrd support
# You need a compressed ramdisk image, named ramdisk.gz in
# arch/xtensa/boot/ramdisk
core-$(CONFIG_EMBEDDED_RAMDISK) += arch/xtensa/boot/ramdisk/
# Test for cross compiling
ifneq ($(VARIANT),)
COMPILE_ARCH = $(shell uname -m)
ifneq ($(COMPILE_ARCH), xtensa)
ifndef CROSS_COMPILE
CROSS_COMPILE = xtensa_$(VARIANT)-
endif
endif
endif
# Only build variant and/or platform if it includes a Makefile # Only build variant and/or platform if it includes a Makefile
buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/) buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
...@@ -87,7 +81,7 @@ all: zImage ...@@ -87,7 +81,7 @@ all: zImage
bzImage : zImage bzImage : zImage
zImage zImage.initrd: vmlinux zImage: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $@ $(Q)$(MAKE) $(build)=$(boot) $@
define archhelp define archhelp
......
...@@ -25,7 +25,7 @@ bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf ...@@ -25,7 +25,7 @@ bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf
zImage zImage.initrd Image Image.initrd: $(bootdir-y) zImage Image: $(bootdir-y)
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
$(addprefix $(obj)/,$(host-progs)) $(addprefix $(obj)/,$(host-progs))
......
...@@ -20,34 +20,18 @@ boot-y := bootstrap.o ...@@ -20,34 +20,18 @@ boot-y := bootstrap.o
OBJS := $(addprefix $(obj)/,$(boot-y)) OBJS := $(addprefix $(obj)/,$(boot-y))
Image: vmlinux $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds vmlinux.tmp: vmlinux
$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
vmlinux vmlinux.tmp $^ $@
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.tmp \
--set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T arch/$(ARCH)/boot/boot-elf/boot.lds \
-o arch/$(ARCH)/boot/$@.elf $@.tmp
rm -f $@.tmp vmlinux.tmp
Image.initrd: vmlinux $(OBJS) Image: vmlinux.tmp $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
--add-section .initrd=arch/$(ARCH)/boot/ramdisk \
--set-section-flags .initrd=contents,alloc,load,load,data \
vmlinux vmlinux.tmp
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.tmp \ --add-section image=vmlinux.tmp \
--set-section-flags image=contents,alloc,load,load,data \ --set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp $(OBJS) $@.tmp
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \ -T arch/$(ARCH)/boot/boot-elf/boot.lds \
-o arch/$(ARCH)/boot/$@.elf $@.tmp -o arch/$(ARCH)/boot/$@.elf $@.tmp
rm -f $@.tmp vmlinux.tmp
zImage: Image zImage: Image
zImage.initrd: Image.initrd
...@@ -33,13 +33,6 @@ SECTIONS ...@@ -33,13 +33,6 @@ SECTIONS
__reloc_end = . ; __reloc_end = . ;
.initrd ALIGN(0x10) :
{
boot_initrd_start = . ;
*(.initrd)
boot_initrd_end = .;
}
. = ALIGN(0x10); . = ALIGN(0x10);
__image_load = . ; __image_load = . ;
.image 0xd0001000: .image 0xd0001000:
......
...@@ -21,15 +21,17 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a ...@@ -21,15 +21,17 @@ LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
zImage: vmlinux $(OBJS) $(LIBS) vmlinux.tmp: vmlinux
$(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \ $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
vmlinux vmlinux.tmp $^ $@
gzip -vf9 vmlinux.tmp
vmlinux.tmp.gz: vmlinux.tmp
$(GZIP) $(GZIP_FLAGS) $^ > $@
zImage: vmlinux.tmp.gz $(OBJS) $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
--add-section image=vmlinux.tmp.gz \ --add-section image=vmlinux.tmp.gz \
--set-section-flags image=contents,alloc,load,load,data \ --set-section-flags image=contents,alloc,load,load,data \
$(OBJS) $@.tmp $(OBJS) $@.tmp
$(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC) $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
$(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
rm -f $@.tmp $@.elf vmlinux.tmp.gz
...@@ -31,13 +31,6 @@ SECTIONS ...@@ -31,13 +31,6 @@ SECTIONS
__reloc_end = . ; __reloc_end = . ;
.initrd ALIGN(0x10) :
{
boot_initrd_start = . ;
*(.initrd)
boot_initrd_end = .;
}
. = ALIGN(0x10); . = ALIGN(0x10);
__image_load = . ; __image_load = . ;
.image 0xd0001000: AT(__image_load) .image 0xd0001000: AT(__image_load)
......
...@@ -226,17 +226,7 @@ _reloc: ...@@ -226,17 +226,7 @@ _reloc:
isync isync
movi a5, __start
movi a3, boot_initrd_start
movi a4, boot_initrd_end
sub a3, a3, a5
sub a4, a4, a5
add a3, a0, a3
add a4, a0, a4
# a2 Boot parameter list # a2 Boot parameter list
# a3 initrd_start (virtual load address)
# a4 initrd_end (virtual load address)
movi a0, _image_start movi a0, _image_start
jx a0 jx a0
......
#
# Makefile for a ramdisk image
#
BIG_ENDIAN := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big)
ifeq ($(BIG_ENDIAN),1)
OBJCOPY_ARGS := -O elf32-xtensa-be
else
OBJCOPY_ARGS := -O elf32-xtensa-le
endif
obj-y = ramdisk.o
RAMDISK_IMAGE = arch/$(ARCH)/boot/ramdisk/$(CONFIG_EMBEDDED_RAMDISK_IMAGE)
arch/$(ARCH)/boot/ramdisk/ramdisk.o:
$(Q)echo -e "dummy:" | $(AS) -o $@;
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) \
--add-section .initrd=$(RAMDISK_IMAGE) \
--set-section-flags .initrd=contents,alloc,load,load,data \
arch/$(ARCH)/boot/ramdisk/ramdisk.o $@
...@@ -540,11 +540,6 @@ CONFIG_MSDOS_PARTITION=y ...@@ -540,11 +540,6 @@ CONFIG_MSDOS_PARTITION=y
# CONFIG_NLS is not set # CONFIG_NLS is not set
# CONFIG_DLM is not set # CONFIG_DLM is not set
#
# Xtensa initrd options
#
# CONFIG_EMBEDDED_RAMDISK is not set
# #
# Kernel hacking # Kernel hacking
# #
......
...@@ -25,184 +25,54 @@ ...@@ -25,184 +25,54 @@
#define XCHAL_KIO_SIZE 0x10000000 #define XCHAL_KIO_SIZE 0x10000000
#define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x)) #define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x))
#define IO_SPACE_LIMIT ~0
#ifdef CONFIG_MMU
/* /*
* swap functions to change byte order from little-endian to big-endian and * Return the virtual address for the specified bus memory.
* vice versa.
*/
static inline unsigned short _swapw (unsigned short v)
{
return (v << 8) | (v >> 8);
}
static inline unsigned int _swapl (unsigned int v)
{
return (v << 24) | ((v & 0xff00) << 8) | ((v >> 8) & 0xff00) | (v >> 24);
}
/*
* Change virtual addresses to physical addresses and vv.
* These are trivial on the 1:1 Linux/Xtensa mapping
*/
static inline unsigned long virt_to_phys(volatile void * address)
{
return __pa(address);
}
static inline void * phys_to_virt(unsigned long address)
{
return __va(address);
}
/*
* virt_to_bus and bus_to_virt are deprecated.
*/
#define virt_to_bus(x) virt_to_phys(x)
#define bus_to_virt(x) phys_to_virt(x)
/*
* Return the virtual (cached) address for the specified bus memory.
* Note that we currently don't support any address outside the KIO segment. * Note that we currently don't support any address outside the KIO segment.
*/ */
static inline void __iomem *ioremap_nocache(unsigned long offset,
static inline void *ioremap(unsigned long offset, unsigned long size) unsigned long size)
{ {
#ifdef CONFIG_MMU
if (offset >= XCHAL_KIO_PADDR if (offset >= XCHAL_KIO_PADDR
&& offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
else else
BUG(); BUG();
#else
return (void *)offset;
#endif
} }
static inline void *ioremap_nocache(unsigned long offset, unsigned long size) static inline void __iomem *ioremap_cache(unsigned long offset,
unsigned long size)
{ {
#ifdef CONFIG_MMU
if (offset >= XCHAL_KIO_PADDR if (offset >= XCHAL_KIO_PADDR
&& offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE) && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
else else
BUG(); BUG();
#else
return (void *)offset;
#endif
}
static inline void iounmap(void *addr)
{
} }
/* #define ioremap_wc ioremap_nocache
* Generic I/O
*/
#define readb(addr) \
({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; })
#define readw(addr) \
({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; })
#define readl(addr) \
({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })
#define writeb(b, addr) (void)((*(volatile unsigned char *)(addr)) = (b))
#define writew(b, addr) (void)((*(volatile unsigned short *)(addr)) = (b))
#define writel(b, addr) (void)((*(volatile unsigned int *)(addr)) = (b))
static inline __u8 __raw_readb(const volatile void __iomem *addr) static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
{
return *(__force volatile __u8 *)(addr);
}
static inline __u16 __raw_readw(const volatile void __iomem *addr)
{
return *(__force volatile __u16 *)(addr);
}
static inline __u32 __raw_readl(const volatile void __iomem *addr)
{ {
return *(__force volatile __u32 *)(addr); return ioremap_nocache(offset, size);
} }
static inline void __raw_writeb(__u8 b, volatile void __iomem *addr)
{ static inline void iounmap(volatile void __iomem *addr)
*(__force volatile __u8 *)(addr) = b;
}
static inline void __raw_writew(__u16 b, volatile void __iomem *addr)
{
*(__force volatile __u16 *)(addr) = b;
}
static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
{ {
*(__force volatile __u32 *)(addr) = b;
} }
#endif /* CONFIG_MMU */
/* These are the definitions for the x86 IO instructions
* inb/inw/inl/outb/outw/outl, the "string" versions
* insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
* inb_p/inw_p/...
* The macros don't do byte-swapping.
*/
#define inb(port) readb((u8 *)((port)))
#define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)))
#define inw(port) readw((u16 *)((port)))
#define outw(val, port) writew((val),(u16 *)((unsigned long)(port)))
#define inl(port) readl((u32 *)((port)))
#define outl(val, port) writel((val),(u32 *)((unsigned long)(port)))
#define inb_p(port) inb((port))
#define outb_p(val, port) outb((val), (port))
#define inw_p(port) inw((port))
#define outw_p(val, port) outw((val), (port))
#define inl_p(port) inl((port))
#define outl_p(val, port) outl((val), (port))
extern void insb (unsigned long port, void *dst, unsigned long count);
extern void insw (unsigned long port, void *dst, unsigned long count);
extern void insl (unsigned long port, void *dst, unsigned long count);
extern void outsb (unsigned long port, const void *src, unsigned long count);
extern void outsw (unsigned long port, const void *src, unsigned long count);
extern void outsl (unsigned long port, const void *src, unsigned long count);
#define IO_SPACE_LIMIT ~0
#define memset_io(a,b,c) memset((void *)(a),(b),(c))
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
/* At this point the Xtensa doesn't provide byte swap instructions */
#ifdef __XTENSA_EB__
# define in_8(addr) (*(u8*)(addr))
# define in_le16(addr) _swapw(*(u16*)(addr))
# define in_le32(addr) _swapl(*(u32*)(addr))
# define out_8(b, addr) *(u8*)(addr) = (b)
# define out_le16(b, addr) *(u16*)(addr) = _swapw(b)
# define out_le32(b, addr) *(u32*)(addr) = _swapl(b)
#elif defined(__XTENSA_EL__)
# define in_8(addr) (*(u8*)(addr))
# define in_le16(addr) (*(u16*)(addr))
# define in_le32(addr) (*(u32*)(addr))
# define out_8(b, addr) *(u8*)(addr) = (b)
# define out_le16(b, addr) *(u16*)(addr) = (b)
# define out_le32(b, addr) *(u32*)(addr) = (b)
#else
# error processor byte order undefined!
#endif
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem access
*/
#define xlate_dev_mem_ptr(p) __va(p)
/* /*
* Convert a virtual cached pointer to an uncached pointer * Generic I/O
*/ */
#define xlate_dev_kmem_ptr(p) p #define readb_relaxed readb
#define readw_relaxed readw
#define readl_relaxed readl
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm-generic/io.h>
#endif /* _XTENSA_IO_H */ #endif /* _XTENSA_IO_H */
...@@ -71,8 +71,8 @@ ...@@ -71,8 +71,8 @@
#define TIOCSSOFTCAR _IOW('T', 26, unsigned int) #define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
#define TIOCLINUX _IOW('T', 28, char) #define TIOCLINUX _IOW('T', 28, char)
#define TIOCCONS _IO('T', 29) #define TIOCCONS _IO('T', 29)
#define TIOCGSERIAL _IOR('T', 30, struct serial_struct) #define TIOCGSERIAL 0x803C541E /*_IOR('T', 30, struct serial_struct)*/
#define TIOCSSERIAL _IOW('T', 31, struct serial_struct) #define TIOCSSERIAL 0x403C541F /*_IOW('T', 31, struct serial_struct)*/
#define TIOCPKT _IOW('T', 32, int) #define TIOCPKT _IOW('T', 32, int)
# define TIOCPKT_DATA 0 # define TIOCPKT_DATA 0
# define TIOCPKT_FLUSHREAD 1 # define TIOCPKT_FLUSHREAD 1
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
#define ICOUNTLEVEL 237 #define ICOUNTLEVEL 237
#define EXCVADDR 238 #define EXCVADDR 238
#define CCOMPARE 240 #define CCOMPARE 240
#define MISC 244 #define MISC_SR 244
/* Special names for read-only and write-only interrupt registers. */ /* Special names for read-only and write-only interrupt registers. */
......
...@@ -6,7 +6,7 @@ extra-y := head.o vmlinux.lds ...@@ -6,7 +6,7 @@ extra-y := head.o vmlinux.lds
obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \ obj-y := align.o entry.o irq.o coprocessor.o process.o ptrace.o \
setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \ setup.o signal.o syscall.o time.o traps.o vectors.o platform.o \
pci-dma.o io.o pci-dma.o
obj-$(CONFIG_KGDB) += xtensa-stub.o obj-$(CONFIG_KGDB) += xtensa-stub.o
obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_PCI) += pci.o
...@@ -24,6 +24,7 @@ obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o ...@@ -24,6 +24,7 @@ obj-$(CONFIG_MODULES) += xtensa_ksyms.o module.o
# Replicate rules in scripts/Makefile.build # Replicate rules in scripts/Makefile.build
sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \ sed-y = -e 's/\*(\(\.[a-z]*it\|\.ref\|\)\.text)/*(\1.literal \1.text)/g' \
-e 's/\.text\.unlikely/.literal.unlikely .text.unlikely/g' \
-e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g' -e 's/\*(\(\.text\.[a-z]*\))/*(\1.literal \1)/g'
quiet_cmd__cpp_lds_S = LDS $@ quiet_cmd__cpp_lds_S = LDS $@
......
/*
* arch/xtensa/io.c
*
* IO primitives
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Copied from sparc.
*
* Chris Zankel <chris@zankel.net>
*
*/
#include <asm/io.h>
#include <asm/byteorder.h>
void outsb(unsigned long addr, const void *src, unsigned long count) {
while (count) {
count -= 1;
writeb(*(const char *)src, addr);
src += 1;
addr += 1;
}
}
void outsw(unsigned long addr, const void *src, unsigned long count) {
while (count) {
count -= 2;
writew(*(const short *)src, addr);
src += 2;
addr += 2;
}
}
void outsl(unsigned long addr, const void *src, unsigned long count) {
while (count) {
count -= 4;
writel(*(const long *)src, addr);
src += 4;
addr += 4;
}
}
void insb(unsigned long addr, void *dst, unsigned long count) {
while (count) {
count -= 1;
*(unsigned char *)dst = readb(addr);
dst += 1;
addr += 1;
}
}
void insw(unsigned long addr, void *dst, unsigned long count) {
while (count) {
count -= 2;
*(unsigned short *)dst = readw(addr);
dst += 2;
addr += 2;
}
}
void insl(unsigned long addr, void *dst, unsigned long count) {
while (count) {
count -= 4;
/*
* XXX I am sure we are in for an unaligned trap here.
*/
*(unsigned long *)dst = readl(addr);
dst += 4;
addr += 4;
}
}
...@@ -84,12 +84,12 @@ static void xtensa_irq_unmask(struct irq_data *d) ...@@ -84,12 +84,12 @@ static void xtensa_irq_unmask(struct irq_data *d)
static void xtensa_irq_enable(struct irq_data *d) static void xtensa_irq_enable(struct irq_data *d)
{ {
variant_irq_enable(d->irq); variant_irq_enable(d->irq);
xtensa_irq_unmask(d->irq); xtensa_irq_unmask(d);
} }
static void xtensa_irq_disable(struct irq_data *d) static void xtensa_irq_disable(struct irq_data *d)
{ {
xtensa_irq_mask(d->irq); xtensa_irq_mask(d);
variant_irq_disable(d->irq); variant_irq_disable(d->irq);
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/module.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -62,6 +63,7 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag) ...@@ -62,6 +63,7 @@ dma_alloc_coherent(struct device *dev,size_t size,dma_addr_t *handle,gfp_t flag)
return (void*)uncached; return (void*)uncached;
} }
EXPORT_SYMBOL(dma_alloc_coherent);
void dma_free_coherent(struct device *hwdev, size_t size, void dma_free_coherent(struct device *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle) void *vaddr, dma_addr_t dma_handle)
...@@ -73,6 +75,7 @@ void dma_free_coherent(struct device *hwdev, size_t size, ...@@ -73,6 +75,7 @@ void dma_free_coherent(struct device *hwdev, size_t size,
free_pages(addr, get_order(size)); free_pages(addr, get_order(size));
} }
EXPORT_SYMBOL(dma_free_coherent);
void consistent_sync(void *vaddr, size_t size, int direction) void consistent_sync(void *vaddr, size_t size, int direction)
...@@ -92,3 +95,4 @@ void consistent_sync(void *vaddr, size_t size, int direction) ...@@ -92,3 +95,4 @@ void consistent_sync(void *vaddr, size_t size, int direction)
break; break;
} }
} }
EXPORT_SYMBOL(consistent_sync);
...@@ -333,7 +333,7 @@ __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, ...@@ -333,7 +333,7 @@ __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
int prot = pgprot_val(vma->vm_page_prot); int prot = pgprot_val(vma->vm_page_prot);
/* Set to write-through */ /* Set to write-through */
prot &= ~_PAGE_NO_CACHE; prot = (prot & _PAGE_CA_MASK) | _PAGE_CA_WT;
#if 0 #if 0
if (!write_combine) if (!write_combine)
prot |= _PAGE_WRITETHRU; prot |= _PAGE_WRITETHRU;
......
...@@ -40,8 +40,8 @@ _F(int, pcibios_fixup, (void), { return 0; }); ...@@ -40,8 +40,8 @@ _F(int, pcibios_fixup, (void), { return 0; });
#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
_F(void, calibrate_ccount, (void), _F(void, calibrate_ccount, (void),
{ {
printk ("ERROR: Cannot calibrate cpu frequency! Assuming 100MHz.\n"); pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n");
ccount_per_jiffy = 100 * (1000000UL/HZ); ccount_per_jiffy = 10 * (1000000UL/HZ);
}); });
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment