Skip to content

Commit

Permalink
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Browse files Browse the repository at this point in the history
* 'next' of git://git.monstr.eu/linux-2.6-microblaze: (42 commits)
  microblaze: Fix build with make 3.82
  fbdev/xilinxfb: Microblaze driver support
  microblaze: Support C optimized lib functions for little-endian
  microblaze: Separate library optimized functions
  microblaze: Support timer on AXI lite
  microblaze: Add support for little-endian Microblaze
  microblaze: KGDB little endian support
  microblaze: Add PVR for endians plus detection
  net: emaclite: Add support for little-endian platforms
  microblaze: trivial: Add comment for AXI pvr
  microblaze: pci-common cleanup
  microblaze: Support early console on uart16550
  microblaze: Do not compile early console support for uartlite if is disabled
  microblaze: Setup early console dynamically
  microblaze: Rename all uartlite early printk functions
  microblaze: remove early printk uarlite console dependency from header
  microblaze: Remove additional compatible properties
  microblaze: Remove hardcoded asm instraction for PVR loading
  microblaze: Use static const char * const where possible
  microblaze: Define VMALLOC_START/END
  ...
  • Loading branch information
Linus Torvalds committed Oct 25, 2010
2 parents b20f9e5 + b843e4e commit e0e170b
Show file tree
Hide file tree
Showing 56 changed files with 1,038 additions and 201 deletions.
17 changes: 17 additions & 0 deletions arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ config CMDLINE_FORCE
Set this to have arguments from the default kernel command string
override those passed by the boot loader.

config SECCOMP
bool "Enable seccomp to safely compute untrusted bytecode"
depends on PROC_FS
default y
help
This kernel feature is useful for number crunching applications
that may need to compute untrusted bytecode during their
execution. By using pipes or other transports made available to
the process as file descriptors supporting the read/write
syscalls, it's possible to isolate those applications in
their own address space using seccomp. Once seccomp is
enabled via /proc/<pid>/seccomp, it cannot be disabled
and the task is only allowed to execute a few safe syscalls
defined by each seccomp mode.

If unsure, say Y. Only embedded should say N here.

endmenu

menu "Advanced setup"
Expand Down
2 changes: 1 addition & 1 deletion arch/microblaze/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source "lib/Kconfig.debug"

config EARLY_PRINTK
bool "Early printk function for kernel"
depends on SERIAL_UARTLITE_CONSOLE
depends on SERIAL_UARTLITE_CONSOLE || SERIAL_8250_CONSOLE
default n
help
This option turns on/off early printk messages to console.
Expand Down
11 changes: 6 additions & 5 deletions arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ KBUILD_CFLAGS += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2)
LDFLAGS :=
LDFLAGS_vmlinux :=

LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)

head-y := arch/microblaze/kernel/head.o
libs-y += arch/microblaze/lib/
libs-y += $(LIBGCC)
core-y += arch/microblaze/kernel/
core-y += arch/microblaze/mm/
core-y += arch/microblaze/platform/
Expand All @@ -72,12 +69,16 @@ export MMU DTB

all: linux.bin

BOOT_TARGETS = linux.bin linux.bin.gz simpleImage.%
# With make 3.82 we cannot mix normal and wildcard targets
BOOT_TARGETS1 = linux.bin linux.bin.gz
BOOT_TARGETS2 = simpleImage.%

archclean:
$(Q)$(MAKE) $(clean)=$(boot)

$(BOOT_TARGETS): vmlinux
$(BOOT_TARGETS1): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
$(BOOT_TARGETS2): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

define archhelp
Expand Down
4 changes: 4 additions & 0 deletions arch/microblaze/include/asm/byteorder.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef _ASM_MICROBLAZE_BYTEORDER_H
#define _ASM_MICROBLAZE_BYTEORDER_H

#ifdef __MICROBLAZEEL__
#include <linux/byteorder/little_endian.h>
#else
#include <linux/byteorder/big_endian.h>
#endif

#endif /* _ASM_MICROBLAZE_BYTEORDER_H */
9 changes: 7 additions & 2 deletions arch/microblaze/include/asm/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
"addc %0, %0, %3\n\t"
"addc %0, %0, r0\n\t"
: "+&d" (sum)
: "d" (saddr), "d" (daddr), "d" (len + proto));

: "d" (saddr), "d" (daddr),
#ifdef __MICROBLAZEEL__
"d" ((len + proto) << 8)
#else
"d" (len + proto)
#endif
);
return sum;
}

Expand Down
5 changes: 3 additions & 2 deletions arch/microblaze/include/asm/cpuinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct cpuinfo {
u32 use_exc;
u32 ver_code;
u32 mmu;
u32 endian;

/* CPU caches */
u32 use_icache;
Expand Down Expand Up @@ -76,7 +77,6 @@ struct cpuinfo {
u32 num_rd_brk;
u32 num_wr_brk;
u32 cpu_clock_freq; /* store real freq of cpu */
u32 freq_div_hz; /* store freq/HZ */

/* FPGA family */
u32 fpga_family_code;
Expand All @@ -97,7 +97,8 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu);
static inline unsigned int fcpu(struct device_node *cpu, char *n)
{
int *val;
return (val = (int *) of_get_property(cpu, n, NULL)) ? *val : 0;
return (val = (int *) of_get_property(cpu, n, NULL)) ?
be32_to_cpup(val) : 0;
}

#endif /* _ASM_MICROBLAZE_CPUINFO_H */
2 changes: 1 addition & 1 deletion arch/microblaze/include/asm/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];

#define ELF_ET_DYN_BASE (0x08000000)

#ifdef __LITTLE_ENDIAN__
#ifdef __MICROBLAZEEL__
#define ELF_DATA ELFDATA2LSB
#else
#define ELF_DATA ELFDATA2MSB
Expand Down
5 changes: 1 addition & 4 deletions arch/microblaze/include/asm/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ static inline int gpio_cansleep(unsigned int gpio)
return __gpio_cansleep(gpio);
}

/*
* Not implemented, yet.
*/
static inline int gpio_to_irq(unsigned int gpio)
{
return -ENOSYS;
return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
#define out_8(a, v) __raw_writeb((v), (a))
#define in_8(a) __raw_readb(a)

#define mmiowb()

#define ioport_map(port, nr) ((void __iomem *)(port))
#define ioport_unmap(addr)

Expand Down
3 changes: 0 additions & 3 deletions arch/microblaze/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ extern int page_is_ram(unsigned long pfn);
#define TOPHYS(addr) __virt_to_phys(addr)

#ifdef CONFIG_MMU
#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
#define WANT_PAGE_VIRTUAL 1 /* page alloc 2 relies on this */
#endif

#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,7 @@ extern void __init xilinx_pci_init(void);
static inline void __init xilinx_pci_init(void) { return; }
#endif

#include <asm-generic/pci-dma-compat.h>

#endif /* __KERNEL__ */
#endif /* __ASM_MICROBLAZE_PCI_H */
3 changes: 2 additions & 1 deletion arch/microblaze/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ extern inline void pte_free(struct mm_struct *mm, struct page *ptepage)

#define __pte_free_tlb(tlb, pte, addr) pte_free((tlb)->mm, (pte))

#define pmd_populate(mm, pmd, pte) (pmd_val(*(pmd)) = page_address(pte))
#define pmd_populate(mm, pmd, pte) \
(pmd_val(*(pmd)) = (unsigned long)page_address(pte))

#define pmd_populate_kernel(mm, pmd, pte) \
(pmd_val(*(pmd)) = (unsigned long) (pte))
Expand Down
7 changes: 7 additions & 0 deletions arch/microblaze/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ static inline int pte_file(pte_t pte) { return 0; }

#define pgprot_noncached_wc(prot) prot

/*
* All 32bit addresses are effectively valid for vmalloc...
* Sort of meaningless for non-VM targets.
*/
#define VMALLOC_START 0
#define VMALLOC_END 0xffffffff

#else /* CONFIG_MMU */

#include <asm-generic/4level-fixup.h>
Expand Down
1 change: 1 addition & 0 deletions arch/microblaze/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

/* Other Prototypes */
extern int early_uartlite_console(void);
extern int early_uart16550_console(void);

#ifdef CONFIG_PCI
/*
Expand Down
14 changes: 9 additions & 5 deletions arch/microblaze/include/asm/pvr.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@ struct pvr_s {
#define PVR0_USE_EXC_MASK 0x04000000
#define PVR0_USE_ICACHE_MASK 0x02000000
#define PVR0_USE_DCACHE_MASK 0x01000000
#define PVR0_USE_MMU 0x00800000 /* new */
#define PVR0_USE_MMU 0x00800000
#define PVR0_USE_BTC 0x00400000
#define PVR0_ENDI 0x00200000
#define PVR0_VERSION_MASK 0x0000FF00
#define PVR0_USER1_MASK 0x000000FF

/* User 2 PVR mask */
#define PVR1_USER2_MASK 0xFFFFFFFF

/* Configuration PVR masks */
#define PVR2_D_OPB_MASK 0x80000000
#define PVR2_D_OPB_MASK 0x80000000 /* or AXI */
#define PVR2_D_LMB_MASK 0x40000000
#define PVR2_I_OPB_MASK 0x20000000
#define PVR2_I_OPB_MASK 0x20000000 /* or AXI */
#define PVR2_I_LMB_MASK 0x10000000
#define PVR2_INTERRUPT_IS_EDGE_MASK 0x08000000
#define PVR2_EDGE_IS_POSITIVE_MASK 0x04000000
Expand All @@ -63,8 +65,8 @@ struct pvr_s {
#define PVR2_OPCODE_0x0_ILL_MASK 0x00000040
#define PVR2_UNALIGNED_EXC_MASK 0x00000020
#define PVR2_ILL_OPCODE_EXC_MASK 0x00000010
#define PVR2_IOPB_BUS_EXC_MASK 0x00000008
#define PVR2_DOPB_BUS_EXC_MASK 0x00000004
#define PVR2_IOPB_BUS_EXC_MASK 0x00000008 /* or AXI */
#define PVR2_DOPB_BUS_EXC_MASK 0x00000004 /* or AXI */
#define PVR2_DIV_ZERO_EXC_MASK 0x00000002
#define PVR2_FPU_EXC_MASK 0x00000001

Expand Down Expand Up @@ -208,6 +210,8 @@ struct pvr_s {
#define PVR_MMU_TLB_ACCESS(pvr) (pvr.pvr[11] & PVR11_MMU_TLB_ACCESS)
#define PVR_MMU_ZONES(pvr) (pvr.pvr[11] & PVR11_MMU_ZONES)

/* endian */
#define PVR_ENDIAN(pvr) (pvr.pvr[0] & PVR0_ENDI)

int cpu_has_pvr(void);
void get_pvr(struct pvr_s *pvr);
Expand Down
16 changes: 16 additions & 0 deletions arch/microblaze/include/asm/seccomp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef _ASM_MICROBLAZE_SECCOMP_H
#define _ASM_MICROBLAZE_SECCOMP_H

#include <linux/unistd.h>

#define __NR_seccomp_read __NR_read
#define __NR_seccomp_write __NR_write
#define __NR_seccomp_exit __NR_exit
#define __NR_seccomp_sigreturn __NR_sigreturn

#define __NR_seccomp_read_32 __NR_read
#define __NR_seccomp_write_32 __NR_write
#define __NR_seccomp_exit_32 __NR_exit
#define __NR_seccomp_sigreturn_32 __NR_sigreturn

#endif /* _ASM_MICROBLAZE_SECCOMP_H */
6 changes: 6 additions & 0 deletions arch/microblaze/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ void early_printk(const char *fmt, ...);
int setup_early_printk(char *opt);
void disable_early_printk(void);

#if defined(CONFIG_EARLY_PRINTK)
#define eprintk early_printk
#else
#define eprintk printk
#endif

void heartbeat(void);
void setup_heartbeat(void);

Expand Down
20 changes: 8 additions & 12 deletions arch/microblaze/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,19 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_SECCOMP 10 /* secure computing */
#define TIF_FREEZE 14 /* Freezing for suspend */

/* FIXME change in entry.S */
#define TIF_KERNEL_TRACE 8 /* kernel trace active */

/* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_POLLING_NRFLAG 16

#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
#define _TIF_IRET (1<<TIF_IRET)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
#define _TIF_IRET (1 << TIF_IRET)
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_FREEZE (1 << TIF_FREEZE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_SECCOMP (1 << TIF_SECCOMP)
#define _TIF_KERNEL_TRACE (1 << TIF_KERNEL_TRACE)

/* work to do in syscall trace */
#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
Expand Down
12 changes: 9 additions & 3 deletions arch/microblaze/include/asm/unaligned.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@

# ifdef __KERNEL__

# include <linux/unaligned/be_struct.h>
# include <linux/unaligned/be_byteshift.h>
# include <linux/unaligned/le_byteshift.h>
# include <linux/unaligned/generic.h>

# define get_unaligned __get_unaligned_be
# define put_unaligned __put_unaligned_be

# ifdef __MICROBLAZEEL__
# define get_unaligned __get_unaligned_le
# define put_unaligned __put_unaligned_le
# else
# define get_unaligned __get_unaligned_be
# define put_unaligned __put_unaligned_be
# endif

# endif /* __KERNEL__ */
#endif /* _ASM_MICROBLAZE_UNALIGNED_H */
5 changes: 4 additions & 1 deletion arch/microblaze/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,11 @@
#define __NR_rt_tgsigqueueinfo 365 /* new */
#define __NR_perf_event_open 366 /* new */
#define __NR_recvmmsg 367 /* new */
#define __NR_fanotify_init 368
#define __NR_fanotify_mark 369
#define __NR_prlimit64 370

#define __NR_syscalls 368
#define __NR_syscalls 371

#ifdef __KERNEL__
#ifndef __ASSEMBLY__
Expand Down
1 change: 1 addition & 0 deletions arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
CI(pvr_user2, USER2);

CI(mmu, USE_MMU);
CI(endian, ENDIAN);

CI(use_icache, USE_ICACHE);
CI(icache_tagbits, ICACHE_ADDR_TAG_BITS);
Expand Down
1 change: 1 addition & 0 deletions arch/microblaze/kernel/cpu/cpuinfo-static.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
ci->pvr_user2 = fcpu(cpu, "xlnx,pvr-user2");

ci->mmu = fcpu(cpu, "xlnx,use-mmu");
ci->endian = fcpu(cpu, "xlnx,endianness");

ci->ver_code = 0;
ci->fpga_family_code = 0;
Expand Down
2 changes: 2 additions & 0 deletions arch/microblaze/kernel/cpu/cpuinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const struct cpu_ver_key cpu_ver_lookup[] = {
{"7.20.c", 0x0e},
{"7.20.d", 0x0f},
{"7.30.a", 0x10},
{"7.30.b", 0x11},
{"8.00.a", 0x12},
{NULL, 0},
};

Expand Down
3 changes: 2 additions & 1 deletion arch/microblaze/kernel/cpu/mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
count = seq_printf(m,
"CPU-Family: MicroBlaze\n"
"FPGA-Arch: %s\n"
"CPU-Ver: %s\n"
"CPU-Ver: %s, %s endian\n"
"CPU-MHz: %d.%02d\n"
"BogoMips: %lu.%02lu\n",
fpga_family,
cpu_ver,
cpuinfo.endian ? "little" : "big",
cpuinfo.cpu_clock_freq /
1000000,
cpuinfo.cpu_clock_freq %
Expand Down
2 changes: 1 addition & 1 deletion arch/microblaze/kernel/cpu/pvr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
register unsigned tmp __asm__("r3"); \
tmp = 0x0; /* Prevent warning about unused */ \
__asm__ __volatile__ ( \
".byte 0x94,0x60,0xa0, " #pvrid "\n\t" \
"mfs %0, rpvr" #pvrid ";" \
: "=r" (tmp) : : "memory"); \
val = tmp; \
}
Expand Down
Loading

0 comments on commit e0e170b

Please sign in to comment.