From 6b4cd2755039a0be642699e3fc2e3386daa88151 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Tue, 9 Jan 2007 10:23:00 +0900 Subject: [MIPS] PNX8550: Fix system timer initialization Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/philips/pnx8550/common/time.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c index f80acae07cee..68def3880a1c 100644 --- a/arch/mips/philips/pnx8550/common/time.c +++ b/arch/mips/philips/pnx8550/common/time.c @@ -79,6 +79,7 @@ void pnx8550_time_init(void) */ mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); cpj = (mips_hpt_frequency + HZ / 2) / HZ; + write_c0_count(0); timer_ack(); /* Setup Timer 2 */ -- cgit v1.2.3 From e16d8df0be26c8e82c4a1188af8143f2d466b12a Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Wed, 10 Jan 2007 18:53:33 +0900 Subject: [MIPS] Fix N32 SysV IPC routines Add wrappers for N32 msg{snd,rcv}. compat_sys_msg{snd,rcv} can not not be used as system call entries as is. This fix is based on Kaz Kylheku's patch. Also change a type of last argument of sysn32_semctl to match its true size. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- arch/mips/kernel/linux32.c | 16 ++++++++++++++-- arch/mips/kernel/scall64-n32.S | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index b061c9aa6302..de3fae260ff8 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c @@ -440,14 +440,26 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) } #ifdef CONFIG_MIPS32_N32 -asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, union semun arg) +asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) { /* compat_sys_semctl expects a pointer to union semun */ u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); - if (put_user(ptr_to_compat(arg.__pad), uptr)) + if (put_user(arg, uptr)) return -EFAULT; return compat_sys_semctl(semid, semnum, cmd, uptr); } + +asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg) +{ + return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); +} + +asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp, + int msgflg) +{ + return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, + compat_ptr(msgp)); +} #endif struct sysctl_args32 diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 34567d81f940..a7bff2a54723 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S @@ -187,8 +187,8 @@ EXPORT(sysn32_call_table) PTR sysn32_semctl PTR sys_shmdt /* 6065 */ PTR sys_msgget - PTR compat_sys_msgsnd - PTR compat_sys_msgrcv + PTR sysn32_msgsnd + PTR sysn32_msgrcv PTR compat_sys_msgctl PTR compat_sys_fcntl /* 6070 */ PTR sys_flock -- cgit v1.2.3 From 8a93c4968fc177844680987b31d00d1fc3bc02aa Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Thu, 21 Dec 2006 11:25:19 +0100 Subject: [MIPS] Alchemy: Fix PCI-memory access The problem was introduced in 2.6.18.3 with the casting of some 36bit-defines (PCI memory) in au1000.h to resource_size_t which may be u32 or u64 depending on the experimental CONFIG_RESOURCES_64BIT. With unset CONFIG_RESOURCES_64BIT, the pci-memory cannot be accessed because the ioremap in arch/mips/au1000/common/pci.c already used the truncated addresses. With set CONFIG_RESOURCES_64BIT, things get even worse, because PCI-scan aborts, due to resource conflict: request_resource() in arch/mips/pci/pci.c fails because the maximum iomem-address is 0xffffffff (32bit) but the pci-memory-start-address is 0x440000000 (36bit). To get pci working again, I propose the following patch: 1. remove the resource_size_t-casting from au1000.h again 2. make the casting in arch/mips/au1000/common/pci.c (it's allowed and necessary here. The 36bit-handling will be done in __fixup_bigphys_addr). With this patch pci works again like in 2.6.18.2, the gcc-compile warnings in pci.c are gone and it doesn't depend on CONFIG_EXPERIMENTAL. Signed-off-by: Alexander Bigga Signed-off-by: Ralf Baechle --- --- arch/mips/au1000/common/pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c index da591f674893..9f8ce08e173b 100644 --- a/arch/mips/au1000/common/pci.c +++ b/arch/mips/au1000/common/pci.c @@ -39,15 +39,15 @@ /* TBD */ static struct resource pci_io_resource = { - .start = PCI_IO_START, - .end = PCI_IO_END, + .start = (resource_size_t)PCI_IO_START, + .end = (resource_size_t)PCI_IO_END, .name = "PCI IO space", .flags = IORESOURCE_IO }; static struct resource pci_mem_resource = { - .start = PCI_MEM_START, - .end = PCI_MEM_END, + .start = (resource_size_t)PCI_MEM_START, + .end = (resource_size_t)PCI_MEM_END, .name = "PCI memory space", .flags = IORESOURCE_MEM }; -- cgit v1.2.3