From 2622434ee0108c65808a63f067e72d0bbc75b372 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 30 Jul 2009 14:31:23 +0200 Subject: microblaze: Add checking mechanism for MSR instruction It was necessary to use fourth parameter(r8) in early_printk to show messages on console. Signed-off-by: Michal Simek --- arch/microblaze/include/asm/setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h index 27f8daf..ed67c9e 100644 --- a/arch/microblaze/include/asm/setup.h +++ b/arch/microblaze/include/asm/setup.h @@ -38,7 +38,7 @@ extern void early_console_reg_tlb_alloc(unsigned int addr); void time_init(void); void init_IRQ(void); void machine_early_init(const char *cmdline, unsigned int ram, - unsigned int fdt); + unsigned int fdt, unsigned int msr); void machine_restart(char *cmd); void machine_shutdown(void); -- cgit v1.1 From d5b37092aae1edaa638b156b16d09854ad6a1ec0 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 24 Aug 2009 13:25:16 +0200 Subject: microblaze: Implement include/asm/syscall.h. Signed-off-by: Edgar E. Iglesias Signed-off-by: Michal Simek --- arch/microblaze/include/asm/syscall.h | 99 +++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 arch/microblaze/include/asm/syscall.h (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/syscall.h b/arch/microblaze/include/asm/syscall.h new file mode 100644 index 0000000..048dfcd --- /dev/null +++ b/arch/microblaze/include/asm/syscall.h @@ -0,0 +1,99 @@ +#ifndef __ASM_MICROBLAZE_SYSCALL_H +#define __ASM_MICROBLAZE_SYSCALL_H + +#include +#include +#include + +/* The system call number is given by the user in R12 */ +static inline long syscall_get_nr(struct task_struct *task, + struct pt_regs *regs) +{ + return regs->r12; +} + +static inline void syscall_rollback(struct task_struct *task, + struct pt_regs *regs) +{ + /* TODO. */ +} + +static inline long syscall_get_error(struct task_struct *task, + struct pt_regs *regs) +{ + return IS_ERR_VALUE(regs->r3) ? regs->r3 : 0; +} + +static inline long syscall_get_return_value(struct task_struct *task, + struct pt_regs *regs) +{ + return regs->r3; +} + +static inline void syscall_set_return_value(struct task_struct *task, + struct pt_regs *regs, + int error, long val) +{ + if (error) + regs->r3 = -error; + else + regs->r3 = val; +} + +static inline microblaze_reg_t microblaze_get_syscall_arg(struct pt_regs *regs, + unsigned int n) +{ + switch (n) { + case 5: return regs->r10; + case 4: return regs->r9; + case 3: return regs->r8; + case 2: return regs->r7; + case 1: return regs->r6; + case 0: return regs->r5; + default: + BUG(); + } + return ~0; +} + +static inline void microblaze_set_syscall_arg(struct pt_regs *regs, + unsigned int n, + unsigned long val) +{ + switch (n) { + case 5: + regs->r10 = val; + case 4: + regs->r9 = val; + case 3: + regs->r8 = val; + case 2: + regs->r7 = val; + case 1: + regs->r6 = val; + case 0: + regs->r5 = val; + default: + BUG(); + } +} + +static inline void syscall_get_arguments(struct task_struct *task, + struct pt_regs *regs, + unsigned int i, unsigned int n, + unsigned long *args) +{ + while (n--) + *args++ = microblaze_get_syscall_arg(regs, i++); +} + +static inline void syscall_set_arguments(struct task_struct *task, + struct pt_regs *regs, + unsigned int i, unsigned int n, + const unsigned long *args) +{ + while (n--) + microblaze_set_syscall_arg(regs, i++, *args++); +} + +#endif /* __ASM_MICROBLAZE_SYSCALL_H */ -- cgit v1.1 From afc26cb39e1e74c87a1b5eb013ead2590b91489c Mon Sep 17 00:00:00 2001 From: Julie Zhu Date: Mon, 27 Jul 2009 11:45:32 -0600 Subject: microblaze: Add architectural support for USB EHCI host controllers Add architectural support for USB EHCI host controllers. It has been tested using the USB EHCI host controller from Xilinx Inc., using both High Speed devices and Full Speed devices. Signed-off-by: Julie Zhu Signed-off-by: Michal Simek --- arch/microblaze/include/asm/io.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 7c3ec13..fc9997b 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h @@ -210,6 +210,9 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size, #define in_be32(a) __raw_readl((const void __iomem __force *)(a)) #define in_be16(a) __raw_readw(a) +#define writel_be(v, a) out_be32((__force unsigned *)a, v) +#define readl_be(a) in_be32((__force unsigned *)a) + /* * Little endian */ -- cgit v1.1 From 7ba3fe55d0187cb16c5b205bb131893031b10e66 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Thu, 10 Sep 2009 08:16:46 +0200 Subject: microblaze: Remove ipc.h file which points to non-existing asm-generic file Signed-off-by: Michal Simek --- arch/microblaze/include/asm/ipc.h | 1 - 1 file changed, 1 deletion(-) delete mode 100644 arch/microblaze/include/asm/ipc.h (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/ipc.h b/arch/microblaze/include/asm/ipc.h deleted file mode 100644 index a46e3d9..0000000 --- a/arch/microblaze/include/asm/ipc.h +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.1 From 19086765140e979d955b536f87e755af43f3fdf5 Mon Sep 17 00:00:00 2001 From: John Williams Date: Mon, 22 Jun 2009 01:38:12 +0200 Subject: microblaze: Copy ppc asm-compat.h for clean handling of constants in asm and C Provides the ASM_CONST macro for creating asm-safe constants. No users yet, we'll be using it in upcoming page.h commit, for generating the LOAD_OFFSET macro Signed-off-by: John Williams --- arch/microblaze/include/asm/asm-compat.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 arch/microblaze/include/asm/asm-compat.h (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/asm-compat.h b/arch/microblaze/include/asm/asm-compat.h new file mode 100644 index 0000000..e7bc9dc --- /dev/null +++ b/arch/microblaze/include/asm/asm-compat.h @@ -0,0 +1,17 @@ +#ifndef _ASM_MICROBLAZE_ASM_COMPAT_H +#define _ASM_MICROBLAZE_ASM_COMPAT_H + +#include + +#ifdef __ASSEMBLY__ +# define stringify_in_c(...) __VA_ARGS__ +# define ASM_CONST(x) x +#else +/* This version of stringify will deal with commas... */ +# define __stringify_in_c(...) #__VA_ARGS__ +# define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " " +# define __ASM_CONST(x) x##UL +# define ASM_CONST(x) __ASM_CONST(x) +#endif + +#endif /* _ASM_MICROBLAZE_ASM_COMPAT_H */ -- cgit v1.1 From a1253977dff4a033d61a7a96608f5a0bbb36dbf6 Mon Sep 17 00:00:00 2001 From: John Williams Date: Mon, 22 Jun 2009 01:38:13 +0200 Subject: microblaze: Create the LOAD_OFFSET macro used to compute VMA vs LMA offsets LOAD_OFFSET is the offset between the physical load address and the kernel's virtual address. It will be used in the upcoming commit to vmlinux.ld.S to make sure that the LMAs of sections in vmlinux are correct. Signed-off-by: John Williams --- arch/microblaze/include/asm/page.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/microblaze/include') diff --git a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h index 72aceae..880c988 100644 --- a/arch/microblaze/include/asm/page.h +++ b/arch/microblaze/include/asm/page.h @@ -17,6 +17,7 @@ #include #include +#include #include #ifdef __KERNEL__ @@ -26,6 +27,8 @@ #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) +#define LOAD_OFFSET ASM_CONST((CONFIG_KERNEL_START-CONFIG_KERNEL_BASE_ADDR)) + #ifndef __ASSEMBLY__ #define PAGE_UP(addr) (((addr)+((PAGE_SIZE)-1))&(~((PAGE_SIZE)-1))) -- cgit v1.1