aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/Kconfig21
-rw-r--r--arch/mips/include/asm/bug.h4
-rw-r--r--arch/mips/include/asm/cacheflush.h1
-rw-r--r--arch/mips/include/asm/mman.h1
-rw-r--r--arch/mips/include/asm/socket.h2
-rw-r--r--arch/mips/include/asm/system.h15
-rw-r--r--arch/mips/include/asm/unistd.h15
-rw-r--r--arch/mips/kernel/linux32.c61
-rw-r--r--arch/mips/kernel/scall32-o32.S1
-rw-r--r--arch/mips/kernel/scall64-64.S1
-rw-r--r--arch/mips/kernel/scall64-n32.S3
-rw-r--r--arch/mips/kernel/scall64-o32.S3
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/mips/lasat/sysctl.c121
-rw-r--r--arch/mips/rb532/devices.c3
15 files changed, 65 insertions, 191 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 1aad0d9f507..fd7620f025f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -358,7 +358,14 @@ config SGI_IP22
358 select SWAP_IO_SPACE 358 select SWAP_IO_SPACE
359 select SYS_HAS_CPU_R4X00 359 select SYS_HAS_CPU_R4X00
360 select SYS_HAS_CPU_R5000 360 select SYS_HAS_CPU_R5000
361 select SYS_HAS_EARLY_PRINTK 361 #
362 # Disable EARLY_PRINTK for now since it leads to overwritten prom
363 # memory during early boot on some machines.
364 #
365 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
366 # for a more details discussion
367 #
368 # select SYS_HAS_EARLY_PRINTK
362 select SYS_SUPPORTS_32BIT_KERNEL 369 select SYS_SUPPORTS_32BIT_KERNEL
363 select SYS_SUPPORTS_64BIT_KERNEL 370 select SYS_SUPPORTS_64BIT_KERNEL
364 select SYS_SUPPORTS_BIG_ENDIAN 371 select SYS_SUPPORTS_BIG_ENDIAN
@@ -410,7 +417,14 @@ config SGI_IP28
410 select SGI_HAS_ZILOG 417 select SGI_HAS_ZILOG
411 select SWAP_IO_SPACE 418 select SWAP_IO_SPACE
412 select SYS_HAS_CPU_R10000 419 select SYS_HAS_CPU_R10000
413 select SYS_HAS_EARLY_PRINTK 420 #
421 # Disable EARLY_PRINTK for now since it leads to overwritten prom
422 # memory during early boot on some machines.
423 #
424 # See http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=20091119164009.GA15038%40deprecation.cyrius.com
425 # for a more details discussion
426 #
427 # select SYS_HAS_EARLY_PRINTK
414 select SYS_SUPPORTS_64BIT_KERNEL 428 select SYS_SUPPORTS_64BIT_KERNEL
415 select SYS_SUPPORTS_BIG_ENDIAN 429 select SYS_SUPPORTS_BIG_ENDIAN
416 help 430 help
@@ -1439,6 +1453,7 @@ choice
1439 1453
1440config PAGE_SIZE_4KB 1454config PAGE_SIZE_4KB
1441 bool "4kB" 1455 bool "4kB"
1456 depends on !CPU_LOONGSON2
1442 help 1457 help
1443 This option select the standard 4kB Linux page size. On some 1458 This option select the standard 4kB Linux page size. On some
1444 R3000-family processors this is the only available page size. Using 1459 R3000-family processors this is the only available page size. Using
@@ -1763,7 +1778,7 @@ config SYS_SUPPORTS_SMARTMIPS
1763 1778
1764config ARCH_FLATMEM_ENABLE 1779config ARCH_FLATMEM_ENABLE
1765 def_bool y 1780 def_bool y
1766 depends on !NUMA 1781 depends on !NUMA && !CPU_LOONGSON2
1767 1782
1768config ARCH_DISCONTIGMEM_ENABLE 1783config ARCH_DISCONTIGMEM_ENABLE
1769 bool 1784 bool
diff --git a/arch/mips/include/asm/bug.h b/arch/mips/include/asm/bug.h
index 6cf29c26e87..540c98a810d 100644
--- a/arch/mips/include/asm/bug.h
+++ b/arch/mips/include/asm/bug.h
@@ -11,9 +11,7 @@
11static inline void __noreturn BUG(void) 11static inline void __noreturn BUG(void)
12{ 12{
13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); 13 __asm__ __volatile__("break %0" : : "i" (BRK_BUG));
14 /* Fool GCC into thinking the function doesn't return. */ 14 unreachable();
15 while (1)
16 ;
17} 15}
18 16
19#define HAVE_ARCH_BUG 17#define HAVE_ARCH_BUG
diff --git a/arch/mips/include/asm/cacheflush.h b/arch/mips/include/asm/cacheflush.h
index 03b1d69b142..40bb9fde205 100644
--- a/arch/mips/include/asm/cacheflush.h
+++ b/arch/mips/include/asm/cacheflush.h
@@ -38,6 +38,7 @@ extern void (*flush_cache_range)(struct vm_area_struct *vma,
38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn); 38extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
39extern void __flush_dcache_page(struct page *page); 39extern void __flush_dcache_page(struct page *page);
40 40
41#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
41static inline void flush_dcache_page(struct page *page) 42static inline void flush_dcache_page(struct page *page)
42{ 43{
43 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc) 44 if (cpu_has_dc_aliases || !cpu_has_ic_fills_f_dc)
diff --git a/arch/mips/include/asm/mman.h b/arch/mips/include/asm/mman.h
index a2250f390a2..c892bfb3e2c 100644
--- a/arch/mips/include/asm/mman.h
+++ b/arch/mips/include/asm/mman.h
@@ -75,6 +75,7 @@
75 75
76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ 76#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ 77#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
78#define MADV_HWPOISON 100 /* poison a page for testing */
78 79
79/* compatibility flags */ 80/* compatibility flags */
80#define MAP_FILE 0 81#define MAP_FILE 0
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h
index ae05accd9fe..9de5190f248 100644
--- a/arch/mips/include/asm/socket.h
+++ b/arch/mips/include/asm/socket.h
@@ -80,6 +80,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */
80#define SO_TIMESTAMPING 37 80#define SO_TIMESTAMPING 37
81#define SCM_TIMESTAMPING SO_TIMESTAMPING 81#define SCM_TIMESTAMPING SO_TIMESTAMPING
82 82
83#define SO_RXQ_OVFL 40
84
83#ifdef __KERNEL__ 85#ifdef __KERNEL__
84 86
85/** sock_type - Socket types 87/** sock_type - Socket types
diff --git a/arch/mips/include/asm/system.h b/arch/mips/include/asm/system.h
index fcf5f98d90c..83b5509e09e 100644
--- a/arch/mips/include/asm/system.h
+++ b/arch/mips/include/asm/system.h
@@ -12,6 +12,7 @@
12#ifndef _ASM_SYSTEM_H 12#ifndef _ASM_SYSTEM_H
13#define _ASM_SYSTEM_H 13#define _ASM_SYSTEM_H
14 14
15#include <linux/kernel.h>
15#include <linux/types.h> 16#include <linux/types.h>
16#include <linux/irqflags.h> 17#include <linux/irqflags.h>
17 18
@@ -193,10 +194,6 @@ extern __u64 __xchg_u64_unsupported_on_32bit_kernels(volatile __u64 * m, __u64 v
193#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels 194#define __xchg_u64 __xchg_u64_unsupported_on_32bit_kernels
194#endif 195#endif
195 196
196/* This function doesn't exist, so you'll get a linker error
197 if something tries to do an invalid xchg(). */
198extern void __xchg_called_with_bad_pointer(void);
199
200static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) 197static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
201{ 198{
202 switch (size) { 199 switch (size) {
@@ -205,11 +202,17 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
205 case 8: 202 case 8:
206 return __xchg_u64(ptr, x); 203 return __xchg_u64(ptr, x);
207 } 204 }
208 __xchg_called_with_bad_pointer(); 205
209 return x; 206 return x;
210} 207}
211 208
212#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) 209#define xchg(ptr, x) \
210({ \
211 BUILD_BUG_ON(sizeof(*(ptr)) & ~0xc); \
212 \
213 ((__typeof__(*(ptr))) \
214 __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))); \
215})
213 216
214extern void set_handler(unsigned long offset, void *addr, unsigned long len); 217extern void set_handler(unsigned long offset, void *addr, unsigned long len);
215extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); 218extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 8c9dfa9e901..65c679ecbe6 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -355,16 +355,17 @@
355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332) 355#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332)
356#define __NR_perf_event_open (__NR_Linux + 333) 356#define __NR_perf_event_open (__NR_Linux + 333)
357#define __NR_accept4 (__NR_Linux + 334) 357#define __NR_accept4 (__NR_Linux + 334)
358#define __NR_recvmmsg (__NR_Linux + 335)
358 359
359/* 360/*
360 * Offset of the last Linux o32 flavoured syscall 361 * Offset of the last Linux o32 flavoured syscall
361 */ 362 */
362#define __NR_Linux_syscalls 334 363#define __NR_Linux_syscalls 335
363 364
364#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 365#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
365 366
366#define __NR_O32_Linux 4000 367#define __NR_O32_Linux 4000
367#define __NR_O32_Linux_syscalls 334 368#define __NR_O32_Linux_syscalls 335
368 369
369#if _MIPS_SIM == _MIPS_SIM_ABI64 370#if _MIPS_SIM == _MIPS_SIM_ABI64
370 371
@@ -666,16 +667,17 @@
666#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291) 667#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291)
667#define __NR_perf_event_open (__NR_Linux + 292) 668#define __NR_perf_event_open (__NR_Linux + 292)
668#define __NR_accept4 (__NR_Linux + 293) 669#define __NR_accept4 (__NR_Linux + 293)
670#define __NR_recvmmsg (__NR_Linux + 294)
669 671
670/* 672/*
671 * Offset of the last Linux 64-bit flavoured syscall 673 * Offset of the last Linux 64-bit flavoured syscall
672 */ 674 */
673#define __NR_Linux_syscalls 293 675#define __NR_Linux_syscalls 294
674 676
675#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 677#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
676 678
677#define __NR_64_Linux 5000 679#define __NR_64_Linux 5000
678#define __NR_64_Linux_syscalls 293 680#define __NR_64_Linux_syscalls 294
679 681
680#if _MIPS_SIM == _MIPS_SIM_NABI32 682#if _MIPS_SIM == _MIPS_SIM_NABI32
681 683
@@ -981,16 +983,17 @@
981#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295) 983#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295)
982#define __NR_perf_event_open (__NR_Linux + 296) 984#define __NR_perf_event_open (__NR_Linux + 296)
983#define __NR_accept4 (__NR_Linux + 297) 985#define __NR_accept4 (__NR_Linux + 297)
986#define __NR_recvmmsg (__NR_Linux + 298)
984 987
985/* 988/*
986 * Offset of the last N32 flavoured syscall 989 * Offset of the last N32 flavoured syscall
987 */ 990 */
988#define __NR_Linux_syscalls 297 991#define __NR_Linux_syscalls 298
989 992
990#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 993#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
991 994
992#define __NR_N32_Linux 6000 995#define __NR_N32_Linux 6000
993#define __NR_N32_Linux_syscalls 297 996#define __NR_N32_Linux_syscalls 298
994 997
995#ifdef __KERNEL__ 998#ifdef __KERNEL__
996 999
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index b77fefaff9d..1a2793efdc4 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
265} 265}
266#endif 266#endif
267 267
268struct sysctl_args32
269{
270 compat_caddr_t name;
271 int nlen;
272 compat_caddr_t oldval;
273 compat_caddr_t oldlenp;
274 compat_caddr_t newval;
275 compat_size_t newlen;
276 unsigned int __unused[4];
277};
278
279#ifdef CONFIG_SYSCTL_SYSCALL
280
281SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
282{
283 struct sysctl_args32 tmp;
284 int error;
285 size_t oldlen;
286 size_t __user *oldlenp = NULL;
287 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
288
289 if (copy_from_user(&tmp, args, sizeof(tmp)))
290 return -EFAULT;
291
292 if (tmp.oldval && tmp.oldlenp) {
293 /* Duh, this is ugly and might not work if sysctl_args
294 is in read-only memory, but do_sysctl does indirectly
295 a lot of uaccess in both directions and we'd have to
296 basically copy the whole sysctl.c here, and
297 glibc's __sysctl uses rw memory for the structure
298 anyway. */
299 if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
300 put_user(oldlen, (size_t __user *)addr))
301 return -EFAULT;
302 oldlenp = (size_t __user *)addr;
303 }
304
305 lock_kernel();
306 error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
307 oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
308 unlock_kernel();
309 if (oldlenp) {
310 if (!error) {
311 if (get_user(oldlen, (size_t __user *)addr) ||
312 put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
313 error = -EFAULT;
314 }
315 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
316 }
317 return error;
318}
319
320#else
321
322SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
323{
324 return -ENOSYS;
325}
326
327#endif /* CONFIG_SYSCTL_SYSCALL */
328
329SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) 268SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
330{ 269{
331 int ret = 0; 270 int ret = 0;
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index fd2a9bb620d..17202bbe843 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -583,6 +583,7 @@ einval: li v0, -ENOSYS
583 sys sys_rt_tgsigqueueinfo 4 583 sys sys_rt_tgsigqueueinfo 4
584 sys sys_perf_event_open 5 584 sys sys_perf_event_open 5
585 sys sys_accept4 4 585 sys sys_accept4 4
586 sys sys_recvmmsg 5
586 .endm 587 .endm
587 588
588 /* We pre-compute the number of _instruction_ bytes needed to 589 /* We pre-compute the number of _instruction_ bytes needed to
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 18bf7f32c5e..a8a6c596eb0 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -420,4 +420,5 @@ sys_call_table:
420 PTR sys_rt_tgsigqueueinfo 420 PTR sys_rt_tgsigqueueinfo
421 PTR sys_perf_event_open 421 PTR sys_perf_event_open
422 PTR sys_accept4 422 PTR sys_accept4
423 PTR sys_recvmmsg
423 .size sys_call_table,.-sys_call_table 424 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 6ebc0797669..66b5a48676d 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
272 PTR sys_munlockall 272 PTR sys_munlockall
273 PTR sys_vhangup /* 6150 */ 273 PTR sys_vhangup /* 6150 */
274 PTR sys_pivot_root 274 PTR sys_pivot_root
275 PTR sys_32_sysctl 275 PTR compat_sys_sysctl
276 PTR sys_prctl 276 PTR sys_prctl
277 PTR compat_sys_adjtimex 277 PTR compat_sys_adjtimex
278 PTR compat_sys_setrlimit /* 6155 */ 278 PTR compat_sys_setrlimit /* 6155 */
@@ -418,4 +418,5 @@ EXPORT(sysn32_call_table)
418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */ 418 PTR compat_sys_rt_tgsigqueueinfo /* 5295 */
419 PTR sys_perf_event_open 419 PTR sys_perf_event_open
420 PTR sys_accept4 420 PTR sys_accept4
421 PTR compat_sys_recvmmsg
421 .size sysn32_call_table,.-sysn32_call_table 422 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 14dde4ca932..515f9eab2b2 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -356,7 +356,7 @@ sys_call_table:
356 PTR sys_ni_syscall /* 4150 */ 356 PTR sys_ni_syscall /* 4150 */
357 PTR sys_getsid 357 PTR sys_getsid
358 PTR sys_fdatasync 358 PTR sys_fdatasync
359 PTR sys_32_sysctl 359 PTR compat_sys_sysctl
360 PTR sys_mlock 360 PTR sys_mlock
361 PTR sys_munlock /* 4155 */ 361 PTR sys_munlock /* 4155 */
362 PTR sys_mlockall 362 PTR sys_mlockall
@@ -538,4 +538,5 @@ sys_call_table:
538 PTR compat_sys_rt_tgsigqueueinfo 538 PTR compat_sys_rt_tgsigqueueinfo
539 PTR sys_perf_event_open 539 PTR sys_perf_event_open
540 PTR sys_accept4 540 PTR sys_accept4
541 PTR compat_sys_recvmmsg
541 .size sys_call_table,.-sys_call_table 542 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 3fe1fcfa2e7..fe0d7980560 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -306,6 +306,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
306 306
307 if (cpu_has_llsc && R10000_LLSC_WAR) { 307 if (cpu_has_llsc && R10000_LLSC_WAR) {
308 __asm__ __volatile__ ( 308 __asm__ __volatile__ (
309 " .set mips3 \n"
309 " li %[err], 0 \n" 310 " li %[err], 0 \n"
310 "1: ll %[old], (%[addr]) \n" 311 "1: ll %[old], (%[addr]) \n"
311 " move %[tmp], %[new] \n" 312 " move %[tmp], %[new] \n"
@@ -320,6 +321,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
320 " "STR(PTR)" 1b, 4b \n" 321 " "STR(PTR)" 1b, 4b \n"
321 " "STR(PTR)" 2b, 4b \n" 322 " "STR(PTR)" 2b, 4b \n"
322 " .previous \n" 323 " .previous \n"
324 " .set mips0 \n"
323 : [old] "=&r" (old), 325 : [old] "=&r" (old),
324 [err] "=&r" (err), 326 [err] "=&r" (err),
325 [tmp] "=&r" (tmp) 327 [tmp] "=&r" (tmp)
@@ -329,6 +331,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
329 : "memory"); 331 : "memory");
330 } else if (cpu_has_llsc) { 332 } else if (cpu_has_llsc) {
331 __asm__ __volatile__ ( 333 __asm__ __volatile__ (
334 " .set mips3 \n"
332 " li %[err], 0 \n" 335 " li %[err], 0 \n"
333 "1: ll %[old], (%[addr]) \n" 336 "1: ll %[old], (%[addr]) \n"
334 " move %[tmp], %[new] \n" 337 " move %[tmp], %[new] \n"
@@ -347,6 +350,7 @@ static inline int mips_atomic_set(struct pt_regs *regs,
347 " "STR(PTR)" 1b, 5b \n" 350 " "STR(PTR)" 1b, 5b \n"
348 " "STR(PTR)" 2b, 5b \n" 351 " "STR(PTR)" 2b, 5b \n"
349 " .previous \n" 352 " .previous \n"
353 " .set mips0 \n"
350 : [old] "=&r" (old), 354 : [old] "=&r" (old),
351 [err] "=&r" (err), 355 [err] "=&r" (err),
352 [tmp] "=&r" (tmp) 356 [tmp] "=&r" (tmp)
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index b3deed8db61..14b9a28a4ae 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -37,23 +37,6 @@
37#include "ds1603.h" 37#include "ds1603.h"
38#endif 38#endif
39 39
40/* Strategy function to write EEPROM after changing string entry */
41int sysctl_lasatstring(ctl_table *table,
42 void *oldval, size_t *oldlenp,
43 void *newval, size_t newlen)
44{
45 int r;
46
47 r = sysctl_string(table, oldval, oldlenp, newval, newlen);
48 if (r < 0)
49 return r;
50
51 if (newval && newlen)
52 lasat_write_eeprom_info();
53
54 return 0;
55}
56
57 40
58/* And the same for proc */ 41/* And the same for proc */
59int proc_dolasatstring(ctl_table *table, int write, 42int proc_dolasatstring(ctl_table *table, int write,
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
113} 96}
114#endif 97#endif
115 98
116/* Sysctl for setting the IP addresses */
117int sysctl_lasat_intvec(ctl_table *table,
118 void *oldval, size_t *oldlenp,
119 void *newval, size_t newlen)
120{
121 int r;
122
123 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
124 if (r < 0)
125 return r;
126
127 if (newval && newlen)
128 lasat_write_eeprom_info();
129
130 return 0;
131}
132
133#ifdef CONFIG_DS1603
134/* Same for RTC */
135int sysctl_lasat_rtc(ctl_table *table,
136 void *oldval, size_t *oldlenp,
137 void *newval, size_t newlen)
138{
139 struct timespec ts;
140 int r;
141
142 read_persistent_clock(&ts);
143 rtctmp = ts.tv_sec;
144 if (rtctmp < 0)
145 rtctmp = 0;
146 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
147 if (r < 0)
148 return r;
149 if (newval && newlen)
150 rtc_mips_set_mmss(rtctmp);
151
152 return r;
153}
154#endif
155
156#ifdef CONFIG_INET 99#ifdef CONFIG_INET
157int proc_lasat_ip(ctl_table *table, int write, 100int proc_lasat_ip(ctl_table *table, int write,
158 void *buffer, size_t *lenp, loff_t *ppos) 101 void *buffer, size_t *lenp, loff_t *ppos)
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
214} 157}
215#endif 158#endif
216 159
217static int sysctl_lasat_prid(ctl_table *table,
218 void *oldval, size_t *oldlenp,
219 void *newval, size_t newlen)
220{
221 int r;
222
223 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
224 if (r < 0)
225 return r;
226 if (newval && newlen) {
227 lasat_board_info.li_eeprom_info.prid = *(int *)newval;
228 lasat_write_eeprom_info();
229 lasat_init_board_info();
230 }
231 return 0;
232}
233
234int proc_lasat_prid(ctl_table *table, int write, 160int proc_lasat_prid(ctl_table *table, int write,
235 void *buffer, size_t *lenp, loff_t *ppos) 161 void *buffer, size_t *lenp, loff_t *ppos)
236{ 162{
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
252 178
253static ctl_table lasat_table[] = { 179static ctl_table lasat_table[] = {
254 { 180 {
255 .ctl_name = CTL_UNNUMBERED,
256 .procname = "cpu-hz", 181 .procname = "cpu-hz",
257 .data = &lasat_board_info.li_cpu_hz, 182 .data = &lasat_board_info.li_cpu_hz,
258 .maxlen = sizeof(int), 183 .maxlen = sizeof(int),
259 .mode = 0444, 184 .mode = 0444,
260 .proc_handler = &proc_dointvec, 185 .proc_handler = proc_dointvec,
261 .strategy = &sysctl_intvec
262 }, 186 },
263 { 187 {
264 .ctl_name = CTL_UNNUMBERED,
265 .procname = "bus-hz", 188 .procname = "bus-hz",
266 .data = &lasat_board_info.li_bus_hz, 189 .data = &lasat_board_info.li_bus_hz,
267 .maxlen = sizeof(int), 190 .maxlen = sizeof(int),
268 .mode = 0444, 191 .mode = 0444,
269 .proc_handler = &proc_dointvec, 192 .proc_handler = proc_dointvec,
270 .strategy = &sysctl_intvec
271 }, 193 },
272 { 194 {
273 .ctl_name = CTL_UNNUMBERED,
274 .procname = "bmid", 195 .procname = "bmid",
275 .data = &lasat_board_info.li_bmid, 196 .data = &lasat_board_info.li_bmid,
276 .maxlen = sizeof(int), 197 .maxlen = sizeof(int),
277 .mode = 0444, 198 .mode = 0444,
278 .proc_handler = &proc_dointvec, 199 .proc_handler = proc_dointvec,
279 .strategy = &sysctl_intvec
280 }, 200 },
281 { 201 {
282 .ctl_name = CTL_UNNUMBERED,
283 .procname = "prid", 202 .procname = "prid",
284 .data = &lasat_board_info.li_prid, 203 .data = &lasat_board_info.li_prid,
285 .maxlen = sizeof(int), 204 .maxlen = sizeof(int),
286 .mode = 0644, 205 .mode = 0644,
287 .proc_handler = &proc_lasat_prid, 206 .proc_handler = proc_lasat_prid,
288 .strategy = &sysctl_lasat_prid 207. },
289 },
290#ifdef CONFIG_INET 208#ifdef CONFIG_INET
291 { 209 {
292 .ctl_name = CTL_UNNUMBERED,
293 .procname = "ipaddr", 210 .procname = "ipaddr",
294 .data = &lasat_board_info.li_eeprom_info.ipaddr, 211 .data = &lasat_board_info.li_eeprom_info.ipaddr,
295 .maxlen = sizeof(int), 212 .maxlen = sizeof(int),
296 .mode = 0644, 213 .mode = 0644,
297 .proc_handler = &proc_lasat_ip, 214 .proc_handler = proc_lasat_ip,
298 .strategy = &sysctl_lasat_intvec
299 }, 215 },
300 { 216 {
301 .ctl_name = CTL_UNNUMBERED,
302 .procname = "netmask", 217 .procname = "netmask",
303 .data = &lasat_board_info.li_eeprom_info.netmask, 218 .data = &lasat_board_info.li_eeprom_info.netmask,
304 .maxlen = sizeof(int), 219 .maxlen = sizeof(int),
305 .mode = 0644, 220 .mode = 0644,
306 .proc_handler = &proc_lasat_ip, 221 .proc_handler = proc_lasat_ip,
307 .strategy = &sysctl_lasat_intvec
308 }, 222 },
309#endif 223#endif
310 { 224 {
311 .ctl_name = CTL_UNNUMBERED,
312 .procname = "passwd_hash", 225 .procname = "passwd_hash",
313 .data = &lasat_board_info.li_eeprom_info.passwd_hash, 226 .data = &lasat_board_info.li_eeprom_info.passwd_hash,
314 .maxlen = 227 .maxlen =
315 sizeof(lasat_board_info.li_eeprom_info.passwd_hash), 228 sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
316 .mode = 0600, 229 .mode = 0600,
317 .proc_handler = &proc_dolasatstring, 230 .proc_handler = proc_dolasatstring,
318 .strategy = &sysctl_lasatstring
319 }, 231 },
320 { 232 {
321 .ctl_name = CTL_UNNUMBERED,
322 .procname = "boot-service", 233 .procname = "boot-service",
323 .data = &lasat_boot_to_service, 234 .data = &lasat_boot_to_service,
324 .maxlen = sizeof(int), 235 .maxlen = sizeof(int),
325 .mode = 0644, 236 .mode = 0644,
326 .proc_handler = &proc_dointvec, 237 .proc_handler = proc_dointvec,
327 .strategy = &sysctl_intvec
328 }, 238 },
329#ifdef CONFIG_DS1603 239#ifdef CONFIG_DS1603
330 { 240 {
331 .ctl_name = CTL_UNNUMBERED,
332 .procname = "rtc", 241 .procname = "rtc",
333 .data = &rtctmp, 242 .data = &rtctmp,
334 .maxlen = sizeof(int), 243 .maxlen = sizeof(int),
335 .mode = 0644, 244 .mode = 0644,
336 .proc_handler = &proc_dolasatrtc, 245 .proc_handler = proc_dolasatrtc,
337 .strategy = &sysctl_lasat_rtc
338 }, 246 },
339#endif 247#endif
340 { 248 {
341 .ctl_name = CTL_UNNUMBERED,
342 .procname = "namestr", 249 .procname = "namestr",
343 .data = &lasat_board_info.li_namestr, 250 .data = &lasat_board_info.li_namestr,
344 .maxlen = sizeof(lasat_board_info.li_namestr), 251 .maxlen = sizeof(lasat_board_info.li_namestr),
345 .mode = 0444, 252 .mode = 0444,
346 .proc_handler = &proc_dostring, 253 .proc_handler = proc_dostring,
347 .strategy = &sysctl_string
348 }, 254 },
349 { 255 {
350 .ctl_name = CTL_UNNUMBERED,
351 .procname = "typestr", 256 .procname = "typestr",
352 .data = &lasat_board_info.li_typestr, 257 .data = &lasat_board_info.li_typestr,
353 .maxlen = sizeof(lasat_board_info.li_typestr), 258 .maxlen = sizeof(lasat_board_info.li_typestr),
354 .mode = 0444, 259 .mode = 0444,
355 .proc_handler = &proc_dostring, 260 .proc_handler = proc_dostring,
356 .strategy = &sysctl_string
357 }, 261 },
358 {} 262 {}
359}; 263};
360 264
361static ctl_table lasat_root_table[] = { 265static ctl_table lasat_root_table[] = {
362 { 266 {
363 .ctl_name = CTL_UNNUMBERED,
364 .procname = "lasat", 267 .procname = "lasat",
365 .mode = 0555, 268 .mode = 0555,
366 .child = lasat_table 269 .child = lasat_table
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index 9f40e1ff9b4..041fc1afc3f 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -110,7 +110,6 @@ static struct korina_device korina_dev0_data = {
110static struct platform_device korina_dev0 = { 110static struct platform_device korina_dev0 = {
111 .id = -1, 111 .id = -1,
112 .name = "korina", 112 .name = "korina",
113 .dev.driver_data = &korina_dev0_data,
114 .resource = korina_dev0_res, 113 .resource = korina_dev0_res,
115 .num_resources = ARRAY_SIZE(korina_dev0_res), 114 .num_resources = ARRAY_SIZE(korina_dev0_res),
116}; 115};
@@ -332,6 +331,8 @@ static int __init plat_setup_devices(void)
332 /* set the uart clock to the current cpu frequency */ 331 /* set the uart clock to the current cpu frequency */
333 rb532_uart_res[0].uartclk = idt_cpu_freq; 332 rb532_uart_res[0].uartclk = idt_cpu_freq;
334 333
334 dev_set_drvdata(&korina_dev0.dev, &korina_dev0_data);
335
335 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs)); 336 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
336} 337}
337 338