Commit graph

318 commits

Author SHA1 Message Date
Namhyung Kim cfd866f6bd ptrace: cleanup arch_ptrace() on microblaze
Remove checking @addr greater than 0 because @addr is now unsigned.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:11 -07:00
Namhyung Kim 9b05a69e05 ptrace: change signature of arch_ptrace()
Fix up the arguments to arch_ptrace() to take account of the fact that
@addr and @data are now unsigned long rather than long as of a preceding
patch in this series.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-27 18:03:10 -07:00
Linus Torvalds e0e170bd7d Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
* '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
  ...
2010-10-25 16:53:11 -07:00
Grant Likely 32c97689c4 of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch
This patch refactors the early init parsing of the chosen node so that
architectures aren't forced to provide an empty implementation of
early_init_dt_scan_chosen_arch.  Instead, if an architecture wants to
do something different, it can either use a wrapper function around
early_init_dt_scan_chosen(), or it can replace it altogether.

This patch was written in preparation to adding device tree support to
both x86 ad MIPS.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: David Daney <ddaney@caviumnetworks.com>
2010-10-21 11:10:10 -06:00
Michal Simek ccea0e6e49 microblaze: Support timer on AXI lite
New microblaze systems uses two buses. One for memories
and flashes and the second for low-speed peripherals
which can run on different CLK. This is the reason
why the kernel is trying to read clock-frequency
directly from node. If there is then the kernel will
work with it. If not then cpu CLK is used.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:52:00 +10:00
Michal Simek 02b08045a0 microblaze: Add support for little-endian Microblaze
Microblaze little-endian toolchain exports __MICROBLAZEEL__
which is used in the kernel to identify little/big endian.

The most of the changes are in loading values from DTB which
is always big endian.

Little endian platforms are based on new AXI bus which has
impact to early uartlite initialization.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:59 +10:00
Michal Simek e4f2909227 microblaze: KGDB little endian support
Just need to use little-endian opcode for brki r16, 0x18

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Jason Wessel <jason.wessel@windriver.com>
2010-10-21 15:51:58 +10:00
Michal Simek 8e2ad016b2 microblaze: Add PVR for endians plus detection
Upcomming microblaze version will support little-endian.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
2010-10-21 15:51:57 +10:00
Michal Simek 67f4aaa21c microblaze: Support early console on uart16550
Early console support reuse setting from U-BOOT that's why
it is not necessary to setup baudrates, etc.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:53 +10:00
Michal Simek 51f5fa5094 microblaze: Do not compile early console support for uartlite if is disabled
Kconfig blocks to select any other early console support that's why
this patch has no real impact on current kernel version. But it is done
because of uart16550.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:52 +10:00
Michal Simek 9a7e8d805e microblaze: Setup early console dynamically
Just setup pointer early console in run time.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:51 +10:00
Michal Simek 2af9ebe951 microblaze: Rename all uartlite early printk functions
This is done because of uart16550 early printk support

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:49 +10:00
Michal Simek e65f1e2843 microblaze: Remove additional compatible properties
Device-tree BSP generates longer compatible properties
that's why we can remove extra/old one.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:47 +10:00
Michal Simek a7d8355008 microblaze: Remove hardcoded asm instraction for PVR loading
It comes from past where pvr wasn't supported in msr instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:46 +10:00
Joe Perches 92ee8bd468 microblaze: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:45 +10:00
Michal Simek bd3b492a29 microblaze: Export missing symbols for modules
Several kernel modules requires empty_zero_page and mbc
to be exported.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:43 +10:00
Michal Simek 4e07dba7cb microblaze: Add libgcc function directly to kernel
Replaced libgcc functions with asm optimized implementation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:42 +10:00
Michal Simek 4d24d7f7ae microblaze: wire up prlimit64 and fanotify* syscalls
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:38 +10:00
Michal Simek f66efecad0 microblaze: Add new microblaze versions
PVR for 7.30.b, 8.00.a versions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:35 +10:00
Michal Simek b3ea838093 microblaze: remove OUTPUT_FORMAT from linker script
OUTPUT_FORMAT setup bigendian platform. Microblaze Linux port
is becoming bi endian that's why it is removed.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:34 +10:00
Michal Simek 600eb6110a microblaze: Fix r16 and r17 reg saving
r16 and r17 should be saved across interrupt and exception handling.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:33 +10:00
Michal Simek 69717607f0 microblaze: Report if only one timer is used
Kernel needs two timers because of clocksource and clockevent.
It is better to show warning message directly on early
console if available. If it isn't available kernel log buffer
contains it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:30 +10:00
Michal Simek 7d4320956f microblaze: Clear return value in pt_regs
Signal code uses r3 value which saved in restore_sigcontext to
rt_sigframe but it require to be zeroed. If is not zero rt_sigframe
contains wrong values.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:29 +10:00
Michal Simek 791d0a169b microblaze: Fix sys_rt_sigreturn_wrapper
Do not save return registers before rt_sigreturn is called.
_user_exception(syscall handler) already setup return address
that's why it is removed from rt_sigreturn_wrapper.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:27 +10:00
Michal Simek 0425609680 microblaze: Remove old user debugging gdb stub
Old gdb uses priviledged exception handler to handle
gdb exception. New gdb uses brki r16, 0x18 that's why
we can remove old gdb support.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:23 +10:00
Michal Simek f859f0a235 microblaze: kgdb: Remove unused variable and fix return value
I forget to remove unused variable from kgdb_arch_handle_exception.
Fix return value in microblaze_kgdb_break function.

Error log:
arch/microblaze/kernel/kgdb.c: In function 'microblaze_kgdb_break':
arch/microblaze/kernel/kgdb.c:83: warning: 'return' with a value, in function returning void
arch/microblaze/kernel/kgdb.c: In function 'kgdb_arch_handle_exception':
arch/microblaze/kernel/kgdb.c:119: warning: unused variable 'cpu'

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:51:19 +10:00
Joe Perches c4554c32a7 microblaze: Remove pr_<level> uses of KERN_<level>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-10-21 15:37:28 +10:00
Linus Torvalds 86ea51d4a2 Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6:
  spi.h: missing kernel-doc notation, please fix
  of: fix missing headers for of_address_to_resource() in MTD and SysACE drivers
  of: Fix missing includes
  ata: update for of_device to platform_device replacement
  microblaze: Fix of: eliminate of_device->node and dev_archdata->{of,prom}_node
  microblaze: Fix of/address: Merge all of the bus translation code
  booting-without-of: Remove nonexistent chapters from TOC, fix numbering
2010-08-18 09:26:17 -07:00
David Howells d7627467b7 Make do_execve() take a const filename pointer
Make do_execve() take a const filename pointer so that kernel_execve() compiles
correctly on ARM:

arch/arm/kernel/sys_arm.c:88: warning: passing argument 1 of 'do_execve' discards qualifiers from pointer target type

This also requires the argv and envp arguments to be consted twice, once for
the pointer array and once for the strings the array points to.  This is
because do_execve() passes a pointer to the filename (now const) to
copy_strings_kernel().  A simpler alternative would be to cast the filename
pointer in do_execve() when it's passed to copy_strings_kernel().

do_execve() may not change any of the strings it is passed as part of the argv
or envp lists as they are some of them in .rodata, so marking these strings as
const should be fine.

Further kernel_execve() and sys_execve() need to be changed to match.

This has been test built on x86_64, frv, arm and mips.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-17 18:07:43 -07:00
Michal Simek a8dcb878b6 microblaze: Fix of/address: Merge all of the bus translation code
Commit dbbdee9473 removed
of_irq_pci_swizzle but didn't use pci_swizzle_interrupt_pin
instead.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-08-16 14:55:46 -06:00
David Howells c788732523 Mark arguments to certain syscalls as being const
Mark arguments to certain system calls as being const where they should be but
aren't.  The list includes:

 (*) The filename arguments of various stat syscalls, execve(), various utimes
     syscalls and some mount syscalls.

 (*) The filename arguments of some syscall helpers relating to the above.

 (*) The buffer argument of various write syscalls.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-08-13 16:53:13 -07:00
Linus Torvalds 03c0c29aff Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: (63 commits)
  of/platform: Register of_platform_drivers with an "of:" prefix
  of/address: Clean up function declarations
  of/spi: call of_register_spi_devices() from spi core code
  of: Provide default of_node_to_nid() implementation.
  of/device: Make of_device_make_bus_id() usable by other code.
  of/irq: Fix endian issues in parsing interrupt specifiers
  of: Fix phandle endian issues
  of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string
  of: remove of_default_bus_ids
  of: make of_find_device_by_node generic
  microblaze: remove references to of_device and to_of_device
  sparc: remove references to of_device and to_of_device
  powerpc: remove references to of_device and to_of_device
  of/device: Replace of_device with platform_device in includes and core code
  of/device: Protect against binding of_platform_drivers to non-OF devices
  of: remove asm/of_device.h
  of: remove asm/of_platform.h
  of/platform: remove all of_bus_type and of_platform_bus_type references
  of: Merge of_platform_bus_type with platform_bus_type
  drivercore/of: Add OF style matching to platform bus
  ...

Fix up trivial conflicts in arch/microblaze/kernel/Makefile due to just
some obj-y removals by the devicetree branch, while the microblaze
updates added a new file.
2010-08-05 15:57:35 -07:00
Michal Simek 2d5973cb5a microblaze: Add KGDB support
Kgdb uses brki r16, 0x18 instruction to call
low level _debug_exception function which save
current state to pt_regs and call microblaze_kgdb_break
function. _debug_exception should be called only from
the kernel space. User space calling is not supported
because user application debugging uses different handling.

pt_regs_to_gdb_regs loads additional special registers
which can't be changed

 * Enable KGDB in Kconfig
 * Remove ancient not-tested KGDB support
 * Remove ancient _debug_exception code from entry.S

Only MMU KGDB support is supported.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Jason Wessel <jason.wessel@windriver.com>
CC: John Williams <john.williams@petalogix.com>
CC: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
CC: linux-kernel@vger.kernel.org
Acked-by: Jason Wessel <jason.wessel@windriver.com>
2010-08-04 10:45:17 +02:00
Michal Simek 751f1605e0 microblaze: Support brki rX, 0x18 for user application debugging
This is the first patch which add support for
user application debugging through brki rX, 0x18 vector.

This patch has side effect which also remove security issue
to use brki rX, 0x18 to freeze kernel.

Support for old gdb support via priviledged exception
(brk r0, r0) is still there. It will be remove in future.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:16 +02:00
Michal Simek 958063e67b microblaze: Remove nop after MSRCLR/SET, MTS, MFS instructions
We need to save instruction and the latest Microblaze shouldn't
have any problem with it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:16 +02:00
Michal Simek 0e41c90908 microblaze: Simplify syscall rutine
Syscall can be called only from userspace that's why
we don't need to check which space kernel come from.

Kernel syscall calling is not check and shouldn't come
throught this part of code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:15 +02:00
Michal Simek 0a6b08fda6 microblaze: Move PT_MODE saving to delay slot
We can save one more instruction if PT_MODE is saved in delay slot

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:14 +02:00
Michal Simek 80c5ff6b9b microblaze: Fix _interrupt function
Save instructions by using delay slot and
clear UMS only if kernel comes from user space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:13 +02:00
Michal Simek 25f6e59657 microblaze: Fix _user_exception function
Saving some instructions. Clear VMS bit if kernel comes
from kernel space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:45:12 +02:00
Michal Simek 287503fabd microblaze: Put together addik instructions
Saving instructions by adding 2/3 addik instructions to one.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:44:56 +02:00
Michal Simek 9814cc11e5 microblaze: Use delay slot in syscall macros
Saving instruction with delay slot usage.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:22 +02:00
Michal Simek da23355280 microblaze: Save kernel mode in delay slot
This change save one instruction if kernel comes from kernel
space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:21 +02:00
Michal Simek e7741075b3 microblaze: Do not mix register saving and mode setting
Separate reg saving and mode setting.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:32:20 +02:00
Michal Simek e5d2af2b96 microblaze: Move SAVE_STATE upward
SAVE_STATE macro could be used by other rutines too.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:31:09 +02:00
Michal Simek 66f7de8634 microblaze: entry.S: Macro optimization
We are not working with values from MSR that's why
we can discard it and use r11 for different purpose without
saving/restoring.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:30:07 +02:00
Michal Simek c318d483b3 microblaze: Optimize hw exception rutine
Remove set_vms because UMS is cleared and VMS is already setup.
Optimize function calling which save one additional instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:30:06 +02:00
Michal Simek b318067e2c microblaze: Implement clear_ums macro and fix SAVE_STATE macro
VMS is always setup because VM mode was before
exception/syscall/interrupt. Kernel continues in kernel mode
that's why we have to clear UMS bit if kernel comes from
user space.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:29:44 +02:00
Michal Simek 77f6d22605 microblaze: Remove additional setup for kernel_mode
PT_MODE stores information if kernel comes from user
or kernel space. If come from user space, PT_MODE
contains 0. If come from kernel store, PT_MODE contains
non zero value. We don't need to save value 1. I am using
r1 register which contains non zero value.
This change save one additional instruction.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:53 +02:00
Michal Simek 06a54604a3 microblaze: Optimize SAVE_STATE macro
SAVE_STATE macro could be used for user_exception
or interrupt functions.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:52 +02:00
Michal Simek 40eb0dc456 microblaze: Remove additional loading
We don't need to save r0 to PT_R0. It could be additional
operation.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2010-08-04 10:22:51 +02:00