diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-04 18:09:52 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-04 18:09:52 -0400 |
| commit | d98550e334715b2d9e45f8f0f4e1608720108640 (patch) | |
| tree | cd6a52960d479701cf6a29fd6535627481c5b27d | |
| parent | f9cc8475e7595dbb41a9567f83288e2cd7445b6c (diff) | |
| parent | d205819e2346d20fee41297ea6cf789c591abccf (diff) | |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[PATCH] powerpc: Use the ibm,pa-features property if available
powerpc: Fix incorrect might_sleep in __get_user/__put_user on kernel addresses
[PATCH] ppc32 CPM_UART: fixes and improvements
[PATCH] ppc32 CPM_UART: Fixed break send on SCC
[PATCH] powerpc/kprobes: fix singlestep out-of-line
[PATCH] powerpc/pseries: avoid crash in PCI code if mem system not up
| -rw-r--r-- | arch/powerpc/kernel/kprobes.c | 14 | ||||
| -rw-r--r-- | arch/powerpc/kernel/prom.c | 70 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/eeh_event.c | 8 | ||||
| -rw-r--r-- | arch/ppc/platforms/mpc866ads_setup.c | 2 | ||||
| -rw-r--r-- | drivers/serial/cpm_uart/cpm_uart.h | 19 | ||||
| -rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_core.c | 37 | ||||
| -rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm1.c | 2 | ||||
| -rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 | ||||
| -rw-r--r-- | include/asm-powerpc/uaccess.h | 19 | ||||
| -rw-r--r-- | include/asm-ppc/commproc.h | 1 | ||||
| -rw-r--r-- | include/asm-ppc/cpm2.h | 2 | ||||
| -rw-r--r-- | include/linux/fs_uart_pd.h | 60 |
12 files changed, 209 insertions, 27 deletions
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 856ef1a832b9..f78866367b70 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
| @@ -90,15 +90,15 @@ void __kprobes arch_remove_kprobe(struct kprobe *p) | |||
| 90 | 90 | ||
| 91 | static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) | 91 | static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) |
| 92 | { | 92 | { |
| 93 | kprobe_opcode_t insn = *p->ainsn.insn; | ||
| 94 | |||
| 95 | regs->msr |= MSR_SE; | 93 | regs->msr |= MSR_SE; |
| 96 | 94 | ||
| 97 | /* single step inline if it is a trap variant */ | 95 | /* |
| 98 | if (is_trap(insn)) | 96 | * On powerpc we should single step on the original |
| 99 | regs->nip = (unsigned long)p->addr; | 97 | * instruction even if the probed insn is a trap |
| 100 | else | 98 | * variant as values in regs could play a part in |
| 101 | regs->nip = (unsigned long)p->ainsn.insn; | 99 | * if the trap is taken or not |
| 100 | */ | ||
| 101 | regs->nip = (unsigned long)p->ainsn.insn; | ||
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) | 104 | static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 1cb69e8fb0b1..9a07f97f0712 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -885,6 +885,74 @@ void __init unflatten_device_tree(void) | |||
| 885 | DBG(" <- unflatten_device_tree()\n"); | 885 | DBG(" <- unflatten_device_tree()\n"); |
| 886 | } | 886 | } |
| 887 | 887 | ||
| 888 | /* | ||
| 889 | * ibm,pa-features is a per-cpu property that contains a string of | ||
| 890 | * attribute descriptors, each of which has a 2 byte header plus up | ||
| 891 | * to 254 bytes worth of processor attribute bits. First header | ||
| 892 | * byte specifies the number of bytes following the header. | ||
| 893 | * Second header byte is an "attribute-specifier" type, of which | ||
| 894 | * zero is the only currently-defined value. | ||
| 895 | * Implementation: Pass in the byte and bit offset for the feature | ||
| 896 | * that we are interested in. The function will return -1 if the | ||
| 897 | * pa-features property is missing, or a 1/0 to indicate if the feature | ||
| 898 | * is supported/not supported. Note that the bit numbers are | ||
| 899 | * big-endian to match the definition in PAPR. | ||
| 900 | */ | ||
| 901 | static struct ibm_pa_feature { | ||
| 902 | unsigned long cpu_features; /* CPU_FTR_xxx bit */ | ||
| 903 | unsigned int cpu_user_ftrs; /* PPC_FEATURE_xxx bit */ | ||
| 904 | unsigned char pabyte; /* byte number in ibm,pa-features */ | ||
| 905 | unsigned char pabit; /* bit number (big-endian) */ | ||
| 906 | unsigned char invert; /* if 1, pa bit set => clear feature */ | ||
| 907 | } ibm_pa_features[] __initdata = { | ||
| 908 | {0, PPC_FEATURE_HAS_MMU, 0, 0, 0}, | ||
| 909 | {0, PPC_FEATURE_HAS_FPU, 0, 1, 0}, | ||
| 910 | {CPU_FTR_SLB, 0, 0, 2, 0}, | ||
| 911 | {CPU_FTR_CTRL, 0, 0, 3, 0}, | ||
| 912 | {CPU_FTR_NOEXECUTE, 0, 0, 6, 0}, | ||
| 913 | {CPU_FTR_NODSISRALIGN, 0, 1, 1, 1}, | ||
| 914 | {CPU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0}, | ||
| 915 | }; | ||
| 916 | |||
| 917 | static void __init check_cpu_pa_features(unsigned long node) | ||
| 918 | { | ||
| 919 | unsigned char *pa_ftrs; | ||
| 920 | unsigned long len, tablelen, i, bit; | ||
| 921 | |||
| 922 | pa_ftrs = of_get_flat_dt_prop(node, "ibm,pa-features", &tablelen); | ||
| 923 | if (pa_ftrs == NULL) | ||
| 924 | return; | ||
| 925 | |||
| 926 | /* find descriptor with type == 0 */ | ||
| 927 | for (;;) { | ||
| 928 | if (tablelen < 3) | ||
| 929 | return; | ||
| 930 | len = 2 + pa_ftrs[0]; | ||
| 931 | if (tablelen < len) | ||
| 932 | return; /* descriptor 0 not found */ | ||
| 933 | if (pa_ftrs[1] == 0) | ||
| 934 | break; | ||
| 935 | tablelen -= len; | ||
| 936 | pa_ftrs += len; | ||
| 937 | } | ||
| 938 | |||
| 939 | /* loop over bits we know about */ | ||
| 940 | for (i = 0; i < ARRAY_SIZE(ibm_pa_features); ++i) { | ||
| 941 | struct ibm_pa_feature *fp = &ibm_pa_features[i]; | ||
| 942 | |||
| 943 | if (fp->pabyte >= pa_ftrs[0]) | ||
| 944 | continue; | ||
| 945 | bit = (pa_ftrs[2 + fp->pabyte] >> (7 - fp->pabit)) & 1; | ||
| 946 | if (bit ^ fp->invert) { | ||
| 947 | cur_cpu_spec->cpu_features |= fp->cpu_features; | ||
| 948 | cur_cpu_spec->cpu_user_features |= fp->cpu_user_ftrs; | ||
| 949 | } else { | ||
| 950 | cur_cpu_spec->cpu_features &= ~fp->cpu_features; | ||
| 951 | cur_cpu_spec->cpu_user_features &= ~fp->cpu_user_ftrs; | ||
| 952 | } | ||
| 953 | } | ||
| 954 | } | ||
| 955 | |||
| 888 | static int __init early_init_dt_scan_cpus(unsigned long node, | 956 | static int __init early_init_dt_scan_cpus(unsigned long node, |
| 889 | const char *uname, int depth, | 957 | const char *uname, int depth, |
| 890 | void *data) | 958 | void *data) |
| @@ -969,6 +1037,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
| 969 | } | 1037 | } |
| 970 | #endif /* CONFIG_ALTIVEC */ | 1038 | #endif /* CONFIG_ALTIVEC */ |
| 971 | 1039 | ||
| 1040 | check_cpu_pa_features(node); | ||
| 1041 | |||
| 972 | #ifdef CONFIG_PPC_PSERIES | 1042 | #ifdef CONFIG_PPC_PSERIES |
| 973 | if (nthreads > 1) | 1043 | if (nthreads > 1) |
| 974 | cur_cpu_spec->cpu_features |= CPU_FTR_SMT; | 1044 | cur_cpu_spec->cpu_features |= CPU_FTR_SMT; |
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index a1bda6f96fd1..40020c65c89e 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
| @@ -118,7 +118,15 @@ int eeh_send_failure_event (struct device_node *dn, | |||
| 118 | { | 118 | { |
| 119 | unsigned long flags; | 119 | unsigned long flags; |
| 120 | struct eeh_event *event; | 120 | struct eeh_event *event; |
| 121 | char *location; | ||
| 121 | 122 | ||
| 123 | if (!mem_init_done) { | ||
| 124 | printk(KERN_ERR "EEH: event during early boot not handled\n"); | ||
| 125 | location = (char *) get_property(dn, "ibm,loc-code", NULL); | ||
| 126 | printk(KERN_ERR "EEH: device node = %s\n", dn->full_name); | ||
| 127 | printk(KERN_ERR "EEH: PCI location = %s\n", location); | ||
| 128 | return 1; | ||
| 129 | } | ||
| 122 | event = kmalloc(sizeof(*event), GFP_ATOMIC); | 130 | event = kmalloc(sizeof(*event), GFP_ATOMIC); |
| 123 | if (event == NULL) { | 131 | if (event == NULL) { |
| 124 | printk (KERN_ERR "EEH: out of memory, event not handled\n"); | 132 | printk (KERN_ERR "EEH: out of memory, event not handled\n"); |
diff --git a/arch/ppc/platforms/mpc866ads_setup.c b/arch/ppc/platforms/mpc866ads_setup.c index 6ce3b842defe..d919dab61347 100644 --- a/arch/ppc/platforms/mpc866ads_setup.c +++ b/arch/ppc/platforms/mpc866ads_setup.c | |||
| @@ -378,7 +378,7 @@ int __init mpc866ads_init(void) | |||
| 378 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART); | 378 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC1, PPC_SYS_FUNC_UART); |
| 379 | #endif | 379 | #endif |
| 380 | 380 | ||
| 381 | #ifdef CONFIG_SERIAL_CPM_SMCer | 381 | #ifdef CONFIG_SERIAL_CPM_SMC |
| 382 | ppc_sys_device_enable(MPC8xx_CPM_SMC2); | 382 | ppc_sys_device_enable(MPC8xx_CPM_SMC2); |
| 383 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART); | 383 | ppc_sys_device_setfunc(MPC8xx_CPM_SMC2, PPC_SYS_FUNC_UART); |
| 384 | #endif | 384 | #endif |
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h index aa5eb7ddeda9..3b35cb779539 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h | |||
| @@ -5,6 +5,13 @@ | |||
| 5 | * | 5 | * |
| 6 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 6 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
| 7 | * | 7 | * |
| 8 | * 2006 (c) MontaVista Software, Inc. | ||
| 9 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
| 10 | * | ||
| 11 | * This file is licensed under the terms of the GNU General Public License | ||
| 12 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 13 | * kind, whether express or implied. | ||
| 14 | * | ||
| 8 | */ | 15 | */ |
| 9 | #ifndef CPM_UART_H | 16 | #ifndef CPM_UART_H |
| 10 | #define CPM_UART_H | 17 | #define CPM_UART_H |
| @@ -101,12 +108,13 @@ static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo | |||
| 101 | int offset; | 108 | int offset; |
| 102 | u32 val = (u32)addr; | 109 | u32 val = (u32)addr; |
| 103 | /* sane check */ | 110 | /* sane check */ |
| 104 | if ((val >= (u32)pinfo->mem_addr) && | 111 | if (likely((val >= (u32)pinfo->mem_addr)) && |
| 105 | (val<((u32)pinfo->mem_addr + pinfo->mem_size))) { | 112 | (val<((u32)pinfo->mem_addr + pinfo->mem_size))) { |
| 106 | offset = val - (u32)pinfo->mem_addr; | 113 | offset = val - (u32)pinfo->mem_addr; |
| 107 | return pinfo->dma_addr+offset; | 114 | return pinfo->dma_addr+offset; |
| 108 | } | 115 | } |
| 109 | printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val); | 116 | /* something nasty happened */ |
| 117 | BUG(); | ||
| 110 | return 0; | 118 | return 0; |
| 111 | } | 119 | } |
| 112 | 120 | ||
| @@ -115,12 +123,13 @@ static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo | |||
| 115 | int offset; | 123 | int offset; |
| 116 | u32 val = addr; | 124 | u32 val = addr; |
| 117 | /* sane check */ | 125 | /* sane check */ |
| 118 | if ((val >= pinfo->dma_addr) && | 126 | if (likely((val >= pinfo->dma_addr) && |
| 119 | (val<(pinfo->dma_addr + pinfo->mem_size))) { | 127 | (val<(pinfo->dma_addr + pinfo->mem_size)))) { |
| 120 | offset = val - (u32)pinfo->dma_addr; | 128 | offset = val - (u32)pinfo->dma_addr; |
| 121 | return (void*)(pinfo->mem_addr+offset); | 129 | return (void*)(pinfo->mem_addr+offset); |
| 122 | } | 130 | } |
| 123 | printk("%s(): address %x to translate out of range!\n", __FUNCTION__, val); | 131 | /* something nasty happened */ |
| 132 | BUG(); | ||
| 124 | return 0; | 133 | return 0; |
| 125 | } | 134 | } |
| 126 | 135 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index ced193bf9e1e..969f94900431 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
| @@ -12,7 +12,8 @@ | |||
| 12 | * | 12 | * |
| 13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
| 14 | * (C) 2004 Intracom, S.A. | 14 | * (C) 2004 Intracom, S.A. |
| 15 | * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> | 15 | * (C) 2005-2006 MontaVista Software, Inc. |
| 16 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
| 16 | * | 17 | * |
| 17 | * This program is free software; you can redistribute it and/or modify | 18 | * This program is free software; you can redistribute it and/or modify |
| 18 | * it under the terms of the GNU General Public License as published by | 19 | * it under the terms of the GNU General Public License as published by |
| @@ -81,7 +82,7 @@ early_uart_get_pdev(int index) | |||
| 81 | } | 82 | } |
| 82 | 83 | ||
| 83 | 84 | ||
| 84 | void cpm_uart_count(void) | 85 | static void cpm_uart_count(void) |
| 85 | { | 86 | { |
| 86 | cpm_uart_nr = 0; | 87 | cpm_uart_nr = 0; |
| 87 | #ifdef CONFIG_SERIAL_CPM_SMC1 | 88 | #ifdef CONFIG_SERIAL_CPM_SMC1 |
| @@ -104,6 +105,21 @@ void cpm_uart_count(void) | |||
| 104 | #endif | 105 | #endif |
| 105 | } | 106 | } |
| 106 | 107 | ||
| 108 | /* Get UART number by its id */ | ||
| 109 | static int cpm_uart_id2nr(int id) | ||
| 110 | { | ||
| 111 | int i; | ||
| 112 | if (id < UART_NR) { | ||
| 113 | for (i=0; i<UART_NR; i++) { | ||
| 114 | if (cpm_uart_port_map[i] == id) | ||
| 115 | return i; | ||
| 116 | } | ||
| 117 | } | ||
| 118 | |||
| 119 | /* not found or invalid argument */ | ||
| 120 | return -1; | ||
| 121 | } | ||
| 122 | |||
| 107 | /* | 123 | /* |
| 108 | * Check, if transmit buffers are processed | 124 | * Check, if transmit buffers are processed |
| 109 | */ | 125 | */ |
| @@ -457,7 +473,11 @@ static void cpm_uart_shutdown(struct uart_port *port) | |||
| 457 | } | 473 | } |
| 458 | 474 | ||
| 459 | /* Shut them really down and reinit buffer descriptors */ | 475 | /* Shut them really down and reinit buffer descriptors */ |
| 460 | cpm_line_cr_cmd(line, CPM_CR_STOP_TX); | 476 | if (IS_SMC(pinfo)) |
| 477 | cpm_line_cr_cmd(line, CPM_CR_STOP_TX); | ||
| 478 | else | ||
| 479 | cpm_line_cr_cmd(line, CPM_CR_GRA_STOP_TX); | ||
| 480 | |||
| 461 | cpm_uart_initbd(pinfo); | 481 | cpm_uart_initbd(pinfo); |
| 462 | } | 482 | } |
| 463 | } | 483 | } |
| @@ -1008,7 +1028,11 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con) | |||
| 1008 | int line; | 1028 | int line; |
| 1009 | u32 mem, pram; | 1029 | u32 mem, pram; |
| 1010 | 1030 | ||
| 1011 | for (line=0; line<UART_NR && cpm_uart_port_map[line]!=pdata->fs_no; line++); | 1031 | line = cpm_uart_id2nr(idx); |
| 1032 | if(line < 0) { | ||
| 1033 | printk(KERN_ERR"%s(): port %d is not registered", __FUNCTION__, idx); | ||
| 1034 | return -1; | ||
| 1035 | } | ||
| 1012 | 1036 | ||
| 1013 | pinfo = (struct uart_cpm_port *) &cpm_uart_ports[idx]; | 1037 | pinfo = (struct uart_cpm_port *) &cpm_uart_ports[idx]; |
| 1014 | 1038 | ||
| @@ -1241,8 +1265,7 @@ static int cpm_uart_drv_probe(struct device *dev) | |||
| 1241 | } | 1265 | } |
| 1242 | 1266 | ||
| 1243 | pdata = pdev->dev.platform_data; | 1267 | pdata = pdev->dev.platform_data; |
| 1244 | pr_debug("cpm_uart_drv_probe: Adding CPM UART %d\n", | 1268 | pr_debug("cpm_uart_drv_probe: Adding CPM UART %d\n", cpm_uart_id2nr(pdata->fs_no)); |
| 1245 | cpm_uart_port_map[pdata->fs_no]); | ||
| 1246 | 1269 | ||
| 1247 | if ((ret = cpm_uart_drv_get_platform_data(pdev, 0))) | 1270 | if ((ret = cpm_uart_drv_get_platform_data(pdev, 0))) |
| 1248 | return ret; | 1271 | return ret; |
| @@ -1261,7 +1284,7 @@ static int cpm_uart_drv_remove(struct device *dev) | |||
| 1261 | struct fs_uart_platform_info *pdata = pdev->dev.platform_data; | 1284 | struct fs_uart_platform_info *pdata = pdev->dev.platform_data; |
| 1262 | 1285 | ||
| 1263 | pr_debug("cpm_uart_drv_remove: Removing CPM UART %d\n", | 1286 | pr_debug("cpm_uart_drv_remove: Removing CPM UART %d\n", |
| 1264 | cpm_uart_port_map[pdata->fs_no]); | 1287 | cpm_uart_id2nr(pdata->fs_no)); |
| 1265 | 1288 | ||
| 1266 | uart_remove_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port); | 1289 | uart_remove_one_port(&cpm_reg, &cpm_uart_ports[pdata->fs_no].port); |
| 1267 | return 0; | 1290 | return 0; |
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index a5a30622637a..17406a05ce1f 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | * | 8 | * |
| 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
| 10 | * (C) 2004 Intracom, S.A. | 10 | * (C) 2004 Intracom, S.A. |
| 11 | * (C) 2006 MontaVista Software, Inc. | ||
| 12 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
| 11 | * | 13 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | 15 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index 7c6b07aeea92..4b2de08f46d0 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | * | 8 | * |
| 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
| 10 | * (C) 2004 Intracom, S.A. | 10 | * (C) 2004 Intracom, S.A. |
| 11 | * (C) 2006 MontaVista Software, Inc. | ||
| 12 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
| 11 | * | 13 | * |
| 12 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | 15 | * it under the terms of the GNU General Public License as published by |
diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h index 3872e924cdd6..d83fc29c2bbf 100644 --- a/include/asm-powerpc/uaccess.h +++ b/include/asm-powerpc/uaccess.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | #include <asm/processor.h> | 9 | #include <asm/processor.h> |
| 10 | #include <asm/page.h> | ||
| 10 | 11 | ||
| 11 | #define VERIFY_READ 0 | 12 | #define VERIFY_READ 0 |
| 12 | #define VERIFY_WRITE 1 | 13 | #define VERIFY_WRITE 1 |
| @@ -179,9 +180,11 @@ do { \ | |||
| 179 | #define __put_user_nocheck(x, ptr, size) \ | 180 | #define __put_user_nocheck(x, ptr, size) \ |
| 180 | ({ \ | 181 | ({ \ |
| 181 | long __pu_err; \ | 182 | long __pu_err; \ |
| 182 | might_sleep(); \ | 183 | __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ |
| 184 | if (!is_kernel_addr((unsigned long)__pu_addr)) \ | ||
| 185 | might_sleep(); \ | ||
| 183 | __chk_user_ptr(ptr); \ | 186 | __chk_user_ptr(ptr); \ |
| 184 | __put_user_size((x), (ptr), (size), __pu_err); \ | 187 | __put_user_size((x), __pu_addr, (size), __pu_err); \ |
| 185 | __pu_err; \ | 188 | __pu_err; \ |
| 186 | }) | 189 | }) |
| 187 | 190 | ||
| @@ -258,9 +261,11 @@ do { \ | |||
| 258 | ({ \ | 261 | ({ \ |
| 259 | long __gu_err; \ | 262 | long __gu_err; \ |
| 260 | unsigned long __gu_val; \ | 263 | unsigned long __gu_val; \ |
| 264 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
| 261 | __chk_user_ptr(ptr); \ | 265 | __chk_user_ptr(ptr); \ |
| 262 | might_sleep(); \ | 266 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
| 263 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 267 | might_sleep(); \ |
| 268 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
| 264 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 269 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
| 265 | __gu_err; \ | 270 | __gu_err; \ |
| 266 | }) | 271 | }) |
| @@ -270,9 +275,11 @@ do { \ | |||
| 270 | ({ \ | 275 | ({ \ |
| 271 | long __gu_err; \ | 276 | long __gu_err; \ |
| 272 | long long __gu_val; \ | 277 | long long __gu_val; \ |
| 278 | const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ | ||
| 273 | __chk_user_ptr(ptr); \ | 279 | __chk_user_ptr(ptr); \ |
| 274 | might_sleep(); \ | 280 | if (!is_kernel_addr((unsigned long)__gu_addr)) \ |
| 275 | __get_user_size(__gu_val, (ptr), (size), __gu_err); \ | 281 | might_sleep(); \ |
| 282 | __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ | ||
| 276 | (x) = (__typeof__(*(ptr)))__gu_val; \ | 283 | (x) = (__typeof__(*(ptr)))__gu_val; \ |
| 277 | __gu_err; \ | 284 | __gu_err; \ |
| 278 | }) | 285 | }) |
diff --git a/include/asm-ppc/commproc.h b/include/asm-ppc/commproc.h index 973e60908234..31f362966a58 100644 --- a/include/asm-ppc/commproc.h +++ b/include/asm-ppc/commproc.h | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #define CPM_CR_INIT_TX ((ushort)0x0002) | 35 | #define CPM_CR_INIT_TX ((ushort)0x0002) |
| 36 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) | 36 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) |
| 37 | #define CPM_CR_STOP_TX ((ushort)0x0004) | 37 | #define CPM_CR_STOP_TX ((ushort)0x0004) |
| 38 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) | ||
| 38 | #define CPM_CR_RESTART_TX ((ushort)0x0006) | 39 | #define CPM_CR_RESTART_TX ((ushort)0x0006) |
| 39 | #define CPM_CR_CLOSE_RX_BD ((ushort)0x0007) | 40 | #define CPM_CR_CLOSE_RX_BD ((ushort)0x0007) |
| 40 | #define CPM_CR_SET_GADDR ((ushort)0x0008) | 41 | #define CPM_CR_SET_GADDR ((ushort)0x0008) |
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h index b638b87cebe3..c70344b91049 100644 --- a/include/asm-ppc/cpm2.h +++ b/include/asm-ppc/cpm2.h | |||
| @@ -69,7 +69,7 @@ | |||
| 69 | #define CPM_CR_INIT_TX ((ushort)0x0002) | 69 | #define CPM_CR_INIT_TX ((ushort)0x0002) |
| 70 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) | 70 | #define CPM_CR_HUNT_MODE ((ushort)0x0003) |
| 71 | #define CPM_CR_STOP_TX ((ushort)0x0004) | 71 | #define CPM_CR_STOP_TX ((ushort)0x0004) |
| 72 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) | 72 | #define CPM_CR_GRA_STOP_TX ((ushort)0x0005) |
| 73 | #define CPM_CR_RESTART_TX ((ushort)0x0006) | 73 | #define CPM_CR_RESTART_TX ((ushort)0x0006) |
| 74 | #define CPM_CR_SET_GADDR ((ushort)0x0008) | 74 | #define CPM_CR_SET_GADDR ((ushort)0x0008) |
| 75 | #define CPM_CR_START_IDMA ((ushort)0x0009) | 75 | #define CPM_CR_START_IDMA ((ushort)0x0009) |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h new file mode 100644 index 000000000000..f5975126b712 --- /dev/null +++ b/include/linux/fs_uart_pd.h | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | /* | ||
| 2 | * Platform information definitions for the CPM Uart driver. | ||
| 3 | * | ||
| 4 | * 2006 (c) MontaVista Software, Inc. | ||
| 5 | * Vitaly Bordug <vbordug@ru.mvista.com> | ||
| 6 | * | ||
| 7 | * This file is licensed under the terms of the GNU General Public License | ||
| 8 | * version 2. This program is licensed "as is" without any warranty of any | ||
| 9 | * kind, whether express or implied. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef FS_UART_PD_H | ||
| 13 | #define FS_UART_PD_H | ||
| 14 | |||
| 15 | #include <linux/version.h> | ||
| 16 | #include <asm/types.h> | ||
| 17 | |||
| 18 | enum fs_uart_id { | ||
| 19 | fsid_smc1_uart, | ||
| 20 | fsid_smc2_uart, | ||
| 21 | fsid_scc1_uart, | ||
| 22 | fsid_scc2_uart, | ||
| 23 | fsid_scc3_uart, | ||
| 24 | fsid_scc4_uart, | ||
| 25 | fs_uart_nr, | ||
| 26 | }; | ||
| 27 | |||
| 28 | static inline int fs_uart_id_scc2fsid(int id) | ||
| 29 | { | ||
| 30 | return fsid_scc1_uart + id - 1; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline int fs_uart_id_fsid2scc(int id) | ||
| 34 | { | ||
| 35 | return id - fsid_scc1_uart + 1; | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline int fs_uart_id_smc2fsid(int id) | ||
| 39 | { | ||
| 40 | return fsid_smc1_uart + id - 1; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int fs_uart_id_fsid2smc(int id) | ||
| 44 | { | ||
| 45 | return id - fsid_smc1_uart + 1; | ||
| 46 | } | ||
| 47 | |||
| 48 | struct fs_uart_platform_info { | ||
| 49 | void(*init_ioports)(void); | ||
| 50 | /* device specific information */ | ||
| 51 | int fs_no; /* controller index */ | ||
| 52 | u32 uart_clk; | ||
| 53 | u8 tx_num_fifo; | ||
| 54 | u8 tx_buf_size; | ||
| 55 | u8 rx_num_fifo; | ||
| 56 | u8 rx_buf_size; | ||
| 57 | u8 brg; | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif | ||
