diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-07 12:52:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-07 12:52:46 -0400 |
commit | 664481ed45cdbda2ab853ddd3c2690b69aca9103 (patch) | |
tree | 6d0814ad0981ea94b1ffc0b54e33de38af793a43 | |
parent | d6a624eef128c97b35fcea47cd00ef22f005e7aa (diff) | |
parent | a052d2c31b7b87e9b4bdee634af666b5e830e56f (diff) |
Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh
Pull SuperH fixes from Paul Mundt.
* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
sh: fix clock-sh7757 for the latest sh_mobile_sdhi driver
serial: sh-sci: use serial_port_in/out vs sci_in/out.
sh: vsyscall: Fix up .eh_frame generation.
sh: dma: Fix up device attribute mismatch from sysdev fallout.
sh: dwarf unwinder depends on SHcompact.
sh: fix up fallout from system.h disintegration.
-rw-r--r-- | arch/sh/Kconfig.debug | 1 | ||||
-rw-r--r-- | arch/sh/boards/board-sh7785lcr.c | 1 | ||||
-rw-r--r-- | arch/sh/boards/mach-hp6xx/pm.c | 1 | ||||
-rw-r--r-- | arch/sh/drivers/dma/dma-sysfs.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/fpu.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/fpu.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4/fpu.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7757.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/shmobile/pm.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/idle.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/kgdb.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/process_32.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/vsyscall/vsyscall-sigreturn.S | 35 | ||||
-rw-r--r-- | arch/sh/kernel/vsyscall/vsyscall-trapa.S | 23 | ||||
-rw-r--r-- | arch/sh/mm/cache-sh4.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/flush-sh4.c | 1 | ||||
-rw-r--r-- | arch/sh/mm/sram.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 167 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.h | 8 |
20 files changed, 147 insertions, 105 deletions
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index c1d5a820b1aa..5f2bb4242c0f 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
@@ -61,6 +61,7 @@ config DUMP_CODE | |||
61 | config DWARF_UNWINDER | 61 | config DWARF_UNWINDER |
62 | bool "Enable the DWARF unwinder for stacktraces" | 62 | bool "Enable the DWARF unwinder for stacktraces" |
63 | select FRAME_POINTER | 63 | select FRAME_POINTER |
64 | depends on SUPERH32 | ||
64 | default n | 65 | default n |
65 | help | 66 | help |
66 | Enabling this option will make stacktraces more accurate, at | 67 | Enabling this option will make stacktraces more accurate, at |
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c index d879848f3cdd..d0d6221d7c2e 100644 --- a/arch/sh/boards/board-sh7785lcr.c +++ b/arch/sh/boards/board-sh7785lcr.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <cpu/sh7785.h> | 28 | #include <cpu/sh7785.h> |
29 | #include <asm/heartbeat.h> | 29 | #include <asm/heartbeat.h> |
30 | #include <asm/clock.h> | 30 | #include <asm/clock.h> |
31 | #include <asm/bl_bit.h> | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * NOTE: This board has 2 physical memory maps. | 34 | * NOTE: This board has 2 physical memory maps. |
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c index adc9b4bba828..8b50cf763c06 100644 --- a/arch/sh/boards/mach-hp6xx/pm.c +++ b/arch/sh/boards/mach-hp6xx/pm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/gfp.h> | 14 | #include <linux/gfp.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/hd64461.h> | 16 | #include <asm/hd64461.h> |
17 | #include <asm/bl_bit.h> | ||
17 | #include <mach/hp6xx.h> | 18 | #include <mach/hp6xx.h> |
18 | #include <cpu/dac.h> | 19 | #include <cpu/dac.h> |
19 | #include <asm/freq.h> | 20 | #include <asm/freq.h> |
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c index b1cb2715ad6e..67ee95603813 100644 --- a/arch/sh/drivers/dma/dma-sysfs.c +++ b/arch/sh/drivers/dma/dma-sysfs.c | |||
@@ -54,7 +54,7 @@ static int __init dma_subsys_init(void) | |||
54 | if (unlikely(ret)) | 54 | if (unlikely(ret)) |
55 | return ret; | 55 | return ret; |
56 | 56 | ||
57 | return device_create_file(dma_subsys.dev_root, &dev_attr_devices.attr); | 57 | return device_create_file(dma_subsys.dev_root, &dev_attr_devices); |
58 | } | 58 | } |
59 | postcore_initcall(dma_subsys_init); | 59 | postcore_initcall(dma_subsys_init); |
60 | 60 | ||
diff --git a/arch/sh/kernel/cpu/fpu.c b/arch/sh/kernel/cpu/fpu.c index 7f1b70cace35..f8f7af51c128 100644 --- a/arch/sh/kernel/cpu/fpu.c +++ b/arch/sh/kernel/cpu/fpu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | #include <asm/processor.h> | 3 | #include <asm/processor.h> |
4 | #include <asm/fpu.h> | 4 | #include <asm/fpu.h> |
5 | #include <asm/traps.h> | ||
5 | 6 | ||
6 | int init_fpu(struct task_struct *tsk) | 7 | int init_fpu(struct task_struct *tsk) |
7 | { | 8 | { |
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c index 488d24e0cdf0..98bbaa447c93 100644 --- a/arch/sh/kernel/cpu/sh2a/fpu.c +++ b/arch/sh/kernel/cpu/sh2a/fpu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/fpu.h> | 16 | #include <asm/fpu.h> |
17 | #include <asm/traps.h> | ||
17 | 18 | ||
18 | /* The PR (precision) bit in the FP Status Register must be clear when | 19 | /* The PR (precision) bit in the FP Status Register must be clear when |
19 | * an frchg instruction is executed, otherwise the instruction is undefined. | 20 | * an frchg instruction is executed, otherwise the instruction is undefined. |
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index e74cd6c0f10d..69ab4d3c8d41 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <cpu/fpu.h> | 16 | #include <cpu/fpu.h> |
17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
18 | #include <asm/fpu.h> | 18 | #include <asm/fpu.h> |
19 | #include <asm/traps.h> | ||
19 | 20 | ||
20 | /* The PR (precision) bit in the FP Status Register must be clear when | 21 | /* The PR (precision) bit in the FP Status Register must be clear when |
21 | * an frchg instruction is executed, otherwise the instruction is undefined. | 22 | * an frchg instruction is executed, otherwise the instruction is undefined. |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c index 5853989586ed..04ab5aeaf920 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c | |||
@@ -113,7 +113,7 @@ static struct clk_lookup lookups[] = { | |||
113 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), | 113 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), |
114 | 114 | ||
115 | /* MSTP32 clocks */ | 115 | /* MSTP32 clocks */ |
116 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]), | 116 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP004]), |
117 | CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]), | 117 | CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]), |
118 | CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]), | 118 | CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]), |
119 | CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]), | 119 | CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]), |
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c index a6f95ae4aae7..08d27fac8d08 100644 --- a/arch/sh/kernel/cpu/shmobile/pm.c +++ b/arch/sh/kernel/cpu/shmobile/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/suspend.h> | 16 | #include <asm/suspend.h> |
17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/bl_bit.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Notifier lists for pre/post sleep notification | 22 | * Notifier lists for pre/post sleep notification |
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 64852ecc6881..ee226e20c20c 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/irqflags.h> | 17 | #include <linux/irqflags.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/cpuidle.h> | 19 | #include <linux/cpuidle.h> |
20 | #include <asm/pgalloc.h> | ||
21 | #include <linux/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <asm/pgalloc.h> | ||
22 | #include <asm/smp.h> | 22 | #include <asm/smp.h> |
23 | #include <asm/bl_bit.h> | 23 | #include <asm/bl_bit.h> |
24 | 24 | ||
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c index efb6d398dec3..b117781bfea2 100644 --- a/arch/sh/kernel/kgdb.c +++ b/arch/sh/kernel/kgdb.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | #include <asm/traps.h> | ||
17 | 18 | ||
18 | /* Macros for single step instruction identification */ | 19 | /* Macros for single step instruction identification */ |
19 | #define OPCODE_BT(op) (((op) & 0xff00) == 0x8900) | 20 | #define OPCODE_BT(op) (((op) & 0xff00) == 0x8900) |
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index f72e3a951588..94273aaf78c1 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/mmu_context.h> | 26 | #include <asm/mmu_context.h> |
27 | #include <asm/fpu.h> | 27 | #include <asm/fpu.h> |
28 | #include <asm/syscalls.h> | 28 | #include <asm/syscalls.h> |
29 | #include <asm/switch_to.h> | ||
29 | 30 | ||
30 | void show_regs(struct pt_regs * regs) | 31 | void show_regs(struct pt_regs * regs) |
31 | { | 32 | { |
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index a17a14d32340..eaebdf6a5c77 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/smp.h> | 27 | #include <asm/smp.h> |
28 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
29 | #include <asm/sections.h> | 29 | #include <asm/sections.h> |
30 | #include <asm/setup.h> | ||
30 | 31 | ||
31 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 32 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
32 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 33 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
diff --git a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S index 555a64f124ca..23af17584054 100644 --- a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S +++ b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S | |||
@@ -34,6 +34,41 @@ __kernel_rt_sigreturn: | |||
34 | 1: .short __NR_rt_sigreturn | 34 | 1: .short __NR_rt_sigreturn |
35 | .LEND_rt_sigreturn: | 35 | .LEND_rt_sigreturn: |
36 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn | 36 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn |
37 | .previous | ||
37 | 38 | ||
38 | .section .eh_frame,"a",@progbits | 39 | .section .eh_frame,"a",@progbits |
40 | .LCIE1: | ||
41 | .ualong .LCIE1_end - .LCIE1_start | ||
42 | .LCIE1_start: | ||
43 | .ualong 0 /* CIE ID */ | ||
44 | .byte 0x1 /* Version number */ | ||
45 | .string "zRS" /* NUL-terminated augmentation string */ | ||
46 | .uleb128 0x1 /* Code alignment factor */ | ||
47 | .sleb128 -4 /* Data alignment factor */ | ||
48 | .byte 0x11 /* Return address register column */ | ||
49 | .uleb128 0x1 /* Augmentation length and data */ | ||
50 | .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */ | ||
51 | .byte 0xc, 0xf, 0x0 /* DW_CFA_def_cfa: r15 ofs 0 */ | ||
52 | |||
53 | .align 2 | ||
54 | .LCIE1_end: | ||
55 | |||
56 | .ualong .LFDE0_end-.LFDE0_start /* Length FDE0 */ | ||
57 | .LFDE0_start: | ||
58 | .ualong .LFDE0_start-.LCIE1 /* CIE pointer */ | ||
59 | .ualong .LSTART_sigreturn-. /* PC-relative start address */ | ||
60 | .ualong .LEND_sigreturn-.LSTART_sigreturn | ||
61 | .uleb128 0 /* Augmentation */ | ||
62 | .align 2 | ||
63 | .LFDE0_end: | ||
64 | |||
65 | .ualong .LFDE1_end-.LFDE1_start /* Length FDE1 */ | ||
66 | .LFDE1_start: | ||
67 | .ualong .LFDE1_start-.LCIE1 /* CIE pointer */ | ||
68 | .ualong .LSTART_rt_sigreturn-. /* PC-relative start address */ | ||
69 | .ualong .LEND_rt_sigreturn-.LSTART_rt_sigreturn | ||
70 | .uleb128 0 /* Augmentation */ | ||
71 | .align 2 | ||
72 | .LFDE1_end: | ||
73 | |||
39 | .previous | 74 | .previous |
diff --git a/arch/sh/kernel/vsyscall/vsyscall-trapa.S b/arch/sh/kernel/vsyscall/vsyscall-trapa.S index 3e70f851cdc6..0eb74d00690a 100644 --- a/arch/sh/kernel/vsyscall/vsyscall-trapa.S +++ b/arch/sh/kernel/vsyscall/vsyscall-trapa.S | |||
@@ -3,37 +3,34 @@ | |||
3 | .type __kernel_vsyscall,@function | 3 | .type __kernel_vsyscall,@function |
4 | __kernel_vsyscall: | 4 | __kernel_vsyscall: |
5 | .LSTART_vsyscall: | 5 | .LSTART_vsyscall: |
6 | /* XXX: We'll have to do something here once we opt to use the vDSO | 6 | trapa #0x10 |
7 | * page for something other than the signal trampoline.. as well as | 7 | nop |
8 | * fill out .eh_frame -- PFM. */ | ||
9 | .LEND_vsyscall: | 8 | .LEND_vsyscall: |
10 | .size __kernel_vsyscall,.-.LSTART_vsyscall | 9 | .size __kernel_vsyscall,.-.LSTART_vsyscall |
10 | .previous | ||
11 | 11 | ||
12 | .section .eh_frame,"a",@progbits | 12 | .section .eh_frame,"a",@progbits |
13 | .previous | ||
14 | .LCIE: | 13 | .LCIE: |
15 | .ualong .LCIE_end - .LCIE_start | 14 | .ualong .LCIE_end - .LCIE_start |
16 | .LCIE_start: | 15 | .LCIE_start: |
17 | .ualong 0 /* CIE ID */ | 16 | .ualong 0 /* CIE ID */ |
18 | .byte 0x1 /* Version number */ | 17 | .byte 0x1 /* Version number */ |
19 | .string "zRS" /* NUL-terminated augmentation string */ | 18 | .string "zR" /* NUL-terminated augmentation string */ |
20 | .uleb128 0x1 /* Code alignment factor */ | 19 | .uleb128 0x1 /* Code alignment factor */ |
21 | .sleb128 -4 /* Data alignment factor */ | 20 | .sleb128 -4 /* Data alignment factor */ |
22 | .byte 0x11 /* Return address register column */ | 21 | .byte 0x11 /* Return address register column */ |
23 | /* Augmentation length and data (none) */ | 22 | .uleb128 0x1 /* Augmentation length and data */ |
24 | .byte 0xc /* DW_CFA_def_cfa */ | 23 | .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */ |
25 | .uleb128 0xf /* r15 */ | 24 | .byte 0xc,0xf,0x0 /* DW_CFA_def_cfa: r15 ofs 0 */ |
26 | .uleb128 0x0 /* offset 0 */ | ||
27 | |||
28 | .align 2 | 25 | .align 2 |
29 | .LCIE_end: | 26 | .LCIE_end: |
30 | 27 | ||
31 | .ualong .LFDE_end-.LFDE_start /* Length FDE */ | 28 | .ualong .LFDE_end-.LFDE_start /* Length FDE */ |
32 | .LFDE_start: | 29 | .LFDE_start: |
33 | .ualong .LCIE /* CIE pointer */ | 30 | .ualong .LFDE_start-.LCIE /* CIE pointer */ |
34 | .ualong .LSTART_vsyscall-. /* start address */ | 31 | .ualong .LSTART_vsyscall-. /* PC-relative start address */ |
35 | .ualong .LEND_vsyscall-.LSTART_vsyscall | 32 | .ualong .LEND_vsyscall-.LSTART_vsyscall |
36 | .uleb128 0 | 33 | .uleb128 0 /* Augmentation */ |
37 | .align 2 | 34 | .align 2 |
38 | .LFDE_end: | 35 | .LFDE_end: |
39 | .previous | 36 | .previous |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 112fea12522a..0e529285b28d 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
20 | #include <asm/mmu_context.h> | 20 | #include <asm/mmu_context.h> |
21 | #include <asm/cache_insns.h> | ||
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
22 | 23 | ||
23 | /* | 24 | /* |
diff --git a/arch/sh/mm/flush-sh4.c b/arch/sh/mm/flush-sh4.c index 75a17f5bfa14..0b85dd9dd3a7 100644 --- a/arch/sh/mm/flush-sh4.c +++ b/arch/sh/mm/flush-sh4.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/mm.h> |
2 | #include <asm/mmu_context.h> | 2 | #include <asm/mmu_context.h> |
3 | #include <asm/cache_insns.h> | ||
3 | #include <asm/cacheflush.h> | 4 | #include <asm/cacheflush.h> |
4 | #include <asm/traps.h> | 5 | #include <asm/traps.h> |
5 | 6 | ||
diff --git a/arch/sh/mm/sram.c b/arch/sh/mm/sram.c index bc156ec4545e..2d8fa718d55e 100644 --- a/arch/sh/mm/sram.c +++ b/arch/sh/mm/sram.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | ||
12 | #include <asm/sram.h> | 13 | #include <asm/sram.h> |
13 | 14 | ||
14 | /* | 15 | /* |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index bf461cf99616..3158e17b665c 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -355,9 +355,6 @@ static void sci_serial_out(struct uart_port *p, int offset, int value) | |||
355 | WARN(1, "Invalid register access\n"); | 355 | WARN(1, "Invalid register access\n"); |
356 | } | 356 | } |
357 | 357 | ||
358 | #define sci_in(up, offset) (up->serial_in(up, offset)) | ||
359 | #define sci_out(up, offset, value) (up->serial_out(up, offset, value)) | ||
360 | |||
361 | static int sci_probe_regmap(struct plat_sci_port *cfg) | 358 | static int sci_probe_regmap(struct plat_sci_port *cfg) |
362 | { | 359 | { |
363 | switch (cfg->type) { | 360 | switch (cfg->type) { |
@@ -422,9 +419,9 @@ static int sci_poll_get_char(struct uart_port *port) | |||
422 | int c; | 419 | int c; |
423 | 420 | ||
424 | do { | 421 | do { |
425 | status = sci_in(port, SCxSR); | 422 | status = serial_port_in(port, SCxSR); |
426 | if (status & SCxSR_ERRORS(port)) { | 423 | if (status & SCxSR_ERRORS(port)) { |
427 | sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); | 424 | serial_port_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); |
428 | continue; | 425 | continue; |
429 | } | 426 | } |
430 | break; | 427 | break; |
@@ -433,11 +430,11 @@ static int sci_poll_get_char(struct uart_port *port) | |||
433 | if (!(status & SCxSR_RDxF(port))) | 430 | if (!(status & SCxSR_RDxF(port))) |
434 | return NO_POLL_CHAR; | 431 | return NO_POLL_CHAR; |
435 | 432 | ||
436 | c = sci_in(port, SCxRDR); | 433 | c = serial_port_in(port, SCxRDR); |
437 | 434 | ||
438 | /* Dummy read */ | 435 | /* Dummy read */ |
439 | sci_in(port, SCxSR); | 436 | serial_port_in(port, SCxSR); |
440 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 437 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
441 | 438 | ||
442 | return c; | 439 | return c; |
443 | } | 440 | } |
@@ -448,11 +445,11 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c) | |||
448 | unsigned short status; | 445 | unsigned short status; |
449 | 446 | ||
450 | do { | 447 | do { |
451 | status = sci_in(port, SCxSR); | 448 | status = serial_port_in(port, SCxSR); |
452 | } while (!(status & SCxSR_TDxE(port))); | 449 | } while (!(status & SCxSR_TDxE(port))); |
453 | 450 | ||
454 | sci_out(port, SCxTDR, c); | 451 | serial_port_out(port, SCxTDR, c); |
455 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port)); | 452 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port)); |
456 | } | 453 | } |
457 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ | 454 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ |
458 | 455 | ||
@@ -480,10 +477,10 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
480 | ((!(cflag & CRTSCTS)))) { | 477 | ((!(cflag & CRTSCTS)))) { |
481 | unsigned short status; | 478 | unsigned short status; |
482 | 479 | ||
483 | status = sci_in(port, SCSPTR); | 480 | status = serial_port_in(port, SCSPTR); |
484 | status &= ~SCSPTR_CTSIO; | 481 | status &= ~SCSPTR_CTSIO; |
485 | status |= SCSPTR_RTSIO; | 482 | status |= SCSPTR_RTSIO; |
486 | sci_out(port, SCSPTR, status); /* Set RTS = 1 */ | 483 | serial_port_out(port, SCSPTR, status); /* Set RTS = 1 */ |
487 | } | 484 | } |
488 | } | 485 | } |
489 | 486 | ||
@@ -493,13 +490,13 @@ static int sci_txfill(struct uart_port *port) | |||
493 | 490 | ||
494 | reg = sci_getreg(port, SCTFDR); | 491 | reg = sci_getreg(port, SCTFDR); |
495 | if (reg->size) | 492 | if (reg->size) |
496 | return sci_in(port, SCTFDR) & 0xff; | 493 | return serial_port_in(port, SCTFDR) & 0xff; |
497 | 494 | ||
498 | reg = sci_getreg(port, SCFDR); | 495 | reg = sci_getreg(port, SCFDR); |
499 | if (reg->size) | 496 | if (reg->size) |
500 | return sci_in(port, SCFDR) >> 8; | 497 | return serial_port_in(port, SCFDR) >> 8; |
501 | 498 | ||
502 | return !(sci_in(port, SCxSR) & SCI_TDRE); | 499 | return !(serial_port_in(port, SCxSR) & SCI_TDRE); |
503 | } | 500 | } |
504 | 501 | ||
505 | static int sci_txroom(struct uart_port *port) | 502 | static int sci_txroom(struct uart_port *port) |
@@ -513,13 +510,13 @@ static int sci_rxfill(struct uart_port *port) | |||
513 | 510 | ||
514 | reg = sci_getreg(port, SCRFDR); | 511 | reg = sci_getreg(port, SCRFDR); |
515 | if (reg->size) | 512 | if (reg->size) |
516 | return sci_in(port, SCRFDR) & 0xff; | 513 | return serial_port_in(port, SCRFDR) & 0xff; |
517 | 514 | ||
518 | reg = sci_getreg(port, SCFDR); | 515 | reg = sci_getreg(port, SCFDR); |
519 | if (reg->size) | 516 | if (reg->size) |
520 | return sci_in(port, SCFDR) & ((port->fifosize << 1) - 1); | 517 | return serial_port_in(port, SCFDR) & ((port->fifosize << 1) - 1); |
521 | 518 | ||
522 | return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; | 519 | return (serial_port_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; |
523 | } | 520 | } |
524 | 521 | ||
525 | /* | 522 | /* |
@@ -547,14 +544,14 @@ static void sci_transmit_chars(struct uart_port *port) | |||
547 | unsigned short ctrl; | 544 | unsigned short ctrl; |
548 | int count; | 545 | int count; |
549 | 546 | ||
550 | status = sci_in(port, SCxSR); | 547 | status = serial_port_in(port, SCxSR); |
551 | if (!(status & SCxSR_TDxE(port))) { | 548 | if (!(status & SCxSR_TDxE(port))) { |
552 | ctrl = sci_in(port, SCSCR); | 549 | ctrl = serial_port_in(port, SCSCR); |
553 | if (uart_circ_empty(xmit)) | 550 | if (uart_circ_empty(xmit)) |
554 | ctrl &= ~SCSCR_TIE; | 551 | ctrl &= ~SCSCR_TIE; |
555 | else | 552 | else |
556 | ctrl |= SCSCR_TIE; | 553 | ctrl |= SCSCR_TIE; |
557 | sci_out(port, SCSCR, ctrl); | 554 | serial_port_out(port, SCSCR, ctrl); |
558 | return; | 555 | return; |
559 | } | 556 | } |
560 | 557 | ||
@@ -573,27 +570,27 @@ static void sci_transmit_chars(struct uart_port *port) | |||
573 | break; | 570 | break; |
574 | } | 571 | } |
575 | 572 | ||
576 | sci_out(port, SCxTDR, c); | 573 | serial_port_out(port, SCxTDR, c); |
577 | 574 | ||
578 | port->icount.tx++; | 575 | port->icount.tx++; |
579 | } while (--count > 0); | 576 | } while (--count > 0); |
580 | 577 | ||
581 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 578 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); |
582 | 579 | ||
583 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 580 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
584 | uart_write_wakeup(port); | 581 | uart_write_wakeup(port); |
585 | if (uart_circ_empty(xmit)) { | 582 | if (uart_circ_empty(xmit)) { |
586 | sci_stop_tx(port); | 583 | sci_stop_tx(port); |
587 | } else { | 584 | } else { |
588 | ctrl = sci_in(port, SCSCR); | 585 | ctrl = serial_port_in(port, SCSCR); |
589 | 586 | ||
590 | if (port->type != PORT_SCI) { | 587 | if (port->type != PORT_SCI) { |
591 | sci_in(port, SCxSR); /* Dummy read */ | 588 | serial_port_in(port, SCxSR); /* Dummy read */ |
592 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 589 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); |
593 | } | 590 | } |
594 | 591 | ||
595 | ctrl |= SCSCR_TIE; | 592 | ctrl |= SCSCR_TIE; |
596 | sci_out(port, SCSCR, ctrl); | 593 | serial_port_out(port, SCSCR, ctrl); |
597 | } | 594 | } |
598 | } | 595 | } |
599 | 596 | ||
@@ -608,7 +605,7 @@ static void sci_receive_chars(struct uart_port *port) | |||
608 | unsigned short status; | 605 | unsigned short status; |
609 | unsigned char flag; | 606 | unsigned char flag; |
610 | 607 | ||
611 | status = sci_in(port, SCxSR); | 608 | status = serial_port_in(port, SCxSR); |
612 | if (!(status & SCxSR_RDxF(port))) | 609 | if (!(status & SCxSR_RDxF(port))) |
613 | return; | 610 | return; |
614 | 611 | ||
@@ -621,7 +618,7 @@ static void sci_receive_chars(struct uart_port *port) | |||
621 | break; | 618 | break; |
622 | 619 | ||
623 | if (port->type == PORT_SCI) { | 620 | if (port->type == PORT_SCI) { |
624 | char c = sci_in(port, SCxRDR); | 621 | char c = serial_port_in(port, SCxRDR); |
625 | if (uart_handle_sysrq_char(port, c) || | 622 | if (uart_handle_sysrq_char(port, c) || |
626 | sci_port->break_flag) | 623 | sci_port->break_flag) |
627 | count = 0; | 624 | count = 0; |
@@ -629,9 +626,9 @@ static void sci_receive_chars(struct uart_port *port) | |||
629 | tty_insert_flip_char(tty, c, TTY_NORMAL); | 626 | tty_insert_flip_char(tty, c, TTY_NORMAL); |
630 | } else { | 627 | } else { |
631 | for (i = 0; i < count; i++) { | 628 | for (i = 0; i < count; i++) { |
632 | char c = sci_in(port, SCxRDR); | 629 | char c = serial_port_in(port, SCxRDR); |
633 | 630 | ||
634 | status = sci_in(port, SCxSR); | 631 | status = serial_port_in(port, SCxSR); |
635 | #if defined(CONFIG_CPU_SH3) | 632 | #if defined(CONFIG_CPU_SH3) |
636 | /* Skip "chars" during break */ | 633 | /* Skip "chars" during break */ |
637 | if (sci_port->break_flag) { | 634 | if (sci_port->break_flag) { |
@@ -672,8 +669,8 @@ static void sci_receive_chars(struct uart_port *port) | |||
672 | } | 669 | } |
673 | } | 670 | } |
674 | 671 | ||
675 | sci_in(port, SCxSR); /* dummy read */ | 672 | serial_port_in(port, SCxSR); /* dummy read */ |
676 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 673 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
677 | 674 | ||
678 | copied += count; | 675 | copied += count; |
679 | port->icount.rx += count; | 676 | port->icount.rx += count; |
@@ -683,8 +680,8 @@ static void sci_receive_chars(struct uart_port *port) | |||
683 | /* Tell the rest of the system the news. New characters! */ | 680 | /* Tell the rest of the system the news. New characters! */ |
684 | tty_flip_buffer_push(tty); | 681 | tty_flip_buffer_push(tty); |
685 | } else { | 682 | } else { |
686 | sci_in(port, SCxSR); /* dummy read */ | 683 | serial_port_in(port, SCxSR); /* dummy read */ |
687 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 684 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
688 | } | 685 | } |
689 | } | 686 | } |
690 | 687 | ||
@@ -726,7 +723,7 @@ static void sci_break_timer(unsigned long data) | |||
726 | static int sci_handle_errors(struct uart_port *port) | 723 | static int sci_handle_errors(struct uart_port *port) |
727 | { | 724 | { |
728 | int copied = 0; | 725 | int copied = 0; |
729 | unsigned short status = sci_in(port, SCxSR); | 726 | unsigned short status = serial_port_in(port, SCxSR); |
730 | struct tty_struct *tty = port->state->port.tty; | 727 | struct tty_struct *tty = port->state->port.tty; |
731 | struct sci_port *s = to_sci_port(port); | 728 | struct sci_port *s = to_sci_port(port); |
732 | 729 | ||
@@ -804,8 +801,8 @@ static int sci_handle_fifo_overrun(struct uart_port *port) | |||
804 | if (!reg->size) | 801 | if (!reg->size) |
805 | return 0; | 802 | return 0; |
806 | 803 | ||
807 | if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) { | 804 | if ((serial_port_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) { |
808 | sci_out(port, SCLSR, 0); | 805 | serial_port_out(port, SCLSR, 0); |
809 | 806 | ||
810 | port->icount.overrun++; | 807 | port->icount.overrun++; |
811 | 808 | ||
@@ -822,7 +819,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port) | |||
822 | static int sci_handle_breaks(struct uart_port *port) | 819 | static int sci_handle_breaks(struct uart_port *port) |
823 | { | 820 | { |
824 | int copied = 0; | 821 | int copied = 0; |
825 | unsigned short status = sci_in(port, SCxSR); | 822 | unsigned short status = serial_port_in(port, SCxSR); |
826 | struct tty_struct *tty = port->state->port.tty; | 823 | struct tty_struct *tty = port->state->port.tty; |
827 | struct sci_port *s = to_sci_port(port); | 824 | struct sci_port *s = to_sci_port(port); |
828 | 825 | ||
@@ -859,8 +856,8 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) | |||
859 | struct sci_port *s = to_sci_port(port); | 856 | struct sci_port *s = to_sci_port(port); |
860 | 857 | ||
861 | if (s->chan_rx) { | 858 | if (s->chan_rx) { |
862 | u16 scr = sci_in(port, SCSCR); | 859 | u16 scr = serial_port_in(port, SCSCR); |
863 | u16 ssr = sci_in(port, SCxSR); | 860 | u16 ssr = serial_port_in(port, SCxSR); |
864 | 861 | ||
865 | /* Disable future Rx interrupts */ | 862 | /* Disable future Rx interrupts */ |
866 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 863 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
@@ -869,9 +866,9 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) | |||
869 | } else { | 866 | } else { |
870 | scr &= ~SCSCR_RIE; | 867 | scr &= ~SCSCR_RIE; |
871 | } | 868 | } |
872 | sci_out(port, SCSCR, scr); | 869 | serial_port_out(port, SCSCR, scr); |
873 | /* Clear current interrupt */ | 870 | /* Clear current interrupt */ |
874 | sci_out(port, SCxSR, ssr & ~(1 | SCxSR_RDxF(port))); | 871 | serial_port_out(port, SCxSR, ssr & ~(1 | SCxSR_RDxF(port))); |
875 | dev_dbg(port->dev, "Rx IRQ %lu: setup t-out in %u jiffies\n", | 872 | dev_dbg(port->dev, "Rx IRQ %lu: setup t-out in %u jiffies\n", |
876 | jiffies, s->rx_timeout); | 873 | jiffies, s->rx_timeout); |
877 | mod_timer(&s->rx_timer, jiffies + s->rx_timeout); | 874 | mod_timer(&s->rx_timer, jiffies + s->rx_timeout); |
@@ -909,15 +906,15 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr) | |||
909 | if (port->type == PORT_SCI) { | 906 | if (port->type == PORT_SCI) { |
910 | if (sci_handle_errors(port)) { | 907 | if (sci_handle_errors(port)) { |
911 | /* discard character in rx buffer */ | 908 | /* discard character in rx buffer */ |
912 | sci_in(port, SCxSR); | 909 | serial_port_in(port, SCxSR); |
913 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 910 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
914 | } | 911 | } |
915 | } else { | 912 | } else { |
916 | sci_handle_fifo_overrun(port); | 913 | sci_handle_fifo_overrun(port); |
917 | sci_rx_interrupt(irq, ptr); | 914 | sci_rx_interrupt(irq, ptr); |
918 | } | 915 | } |
919 | 916 | ||
920 | sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); | 917 | serial_port_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); |
921 | 918 | ||
922 | /* Kick the transmission */ | 919 | /* Kick the transmission */ |
923 | sci_tx_interrupt(irq, ptr); | 920 | sci_tx_interrupt(irq, ptr); |
@@ -931,7 +928,7 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) | |||
931 | 928 | ||
932 | /* Handle BREAKs */ | 929 | /* Handle BREAKs */ |
933 | sci_handle_breaks(port); | 930 | sci_handle_breaks(port); |
934 | sci_out(port, SCxSR, SCxSR_BREAK_CLEAR(port)); | 931 | serial_port_out(port, SCxSR, SCxSR_BREAK_CLEAR(port)); |
935 | 932 | ||
936 | return IRQ_HANDLED; | 933 | return IRQ_HANDLED; |
937 | } | 934 | } |
@@ -955,8 +952,8 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | |||
955 | struct sci_port *s = to_sci_port(port); | 952 | struct sci_port *s = to_sci_port(port); |
956 | irqreturn_t ret = IRQ_NONE; | 953 | irqreturn_t ret = IRQ_NONE; |
957 | 954 | ||
958 | ssr_status = sci_in(port, SCxSR); | 955 | ssr_status = serial_port_in(port, SCxSR); |
959 | scr_status = sci_in(port, SCSCR); | 956 | scr_status = serial_port_in(port, SCSCR); |
960 | err_enabled = scr_status & port_rx_irq_mask(port); | 957 | err_enabled = scr_status & port_rx_irq_mask(port); |
961 | 958 | ||
962 | /* Tx Interrupt */ | 959 | /* Tx Interrupt */ |
@@ -1170,7 +1167,7 @@ static void sci_free_gpios(struct sci_port *port) | |||
1170 | 1167 | ||
1171 | static unsigned int sci_tx_empty(struct uart_port *port) | 1168 | static unsigned int sci_tx_empty(struct uart_port *port) |
1172 | { | 1169 | { |
1173 | unsigned short status = sci_in(port, SCxSR); | 1170 | unsigned short status = serial_port_in(port, SCxSR); |
1174 | unsigned short in_tx_fifo = sci_txfill(port); | 1171 | unsigned short in_tx_fifo = sci_txfill(port); |
1175 | 1172 | ||
1176 | return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0; | 1173 | return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0; |
@@ -1198,7 +1195,7 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
1198 | */ | 1195 | */ |
1199 | reg = sci_getreg(port, SCFCR); | 1196 | reg = sci_getreg(port, SCFCR); |
1200 | if (reg->size) | 1197 | if (reg->size) |
1201 | sci_out(port, SCFCR, sci_in(port, SCFCR) | 1); | 1198 | serial_port_out(port, SCFCR, serial_port_in(port, SCFCR) | 1); |
1202 | } | 1199 | } |
1203 | } | 1200 | } |
1204 | 1201 | ||
@@ -1240,8 +1237,8 @@ static void sci_dma_tx_complete(void *arg) | |||
1240 | } else { | 1237 | } else { |
1241 | s->cookie_tx = -EINVAL; | 1238 | s->cookie_tx = -EINVAL; |
1242 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1239 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1243 | u16 ctrl = sci_in(port, SCSCR); | 1240 | u16 ctrl = serial_port_in(port, SCSCR); |
1244 | sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); | 1241 | serial_port_out(port, SCSCR, ctrl & ~SCSCR_TIE); |
1245 | } | 1242 | } |
1246 | } | 1243 | } |
1247 | 1244 | ||
@@ -1494,13 +1491,13 @@ static void sci_start_tx(struct uart_port *port) | |||
1494 | 1491 | ||
1495 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1492 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
1496 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1493 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1497 | u16 new, scr = sci_in(port, SCSCR); | 1494 | u16 new, scr = serial_port_in(port, SCSCR); |
1498 | if (s->chan_tx) | 1495 | if (s->chan_tx) |
1499 | new = scr | 0x8000; | 1496 | new = scr | 0x8000; |
1500 | else | 1497 | else |
1501 | new = scr & ~0x8000; | 1498 | new = scr & ~0x8000; |
1502 | if (new != scr) | 1499 | if (new != scr) |
1503 | sci_out(port, SCSCR, new); | 1500 | serial_port_out(port, SCSCR, new); |
1504 | } | 1501 | } |
1505 | 1502 | ||
1506 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && | 1503 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && |
@@ -1512,8 +1509,8 @@ static void sci_start_tx(struct uart_port *port) | |||
1512 | 1509 | ||
1513 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1510 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1514 | /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ | 1511 | /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ |
1515 | ctrl = sci_in(port, SCSCR); | 1512 | ctrl = serial_port_in(port, SCSCR); |
1516 | sci_out(port, SCSCR, ctrl | SCSCR_TIE); | 1513 | serial_port_out(port, SCSCR, ctrl | SCSCR_TIE); |
1517 | } | 1514 | } |
1518 | } | 1515 | } |
1519 | 1516 | ||
@@ -1522,40 +1519,40 @@ static void sci_stop_tx(struct uart_port *port) | |||
1522 | unsigned short ctrl; | 1519 | unsigned short ctrl; |
1523 | 1520 | ||
1524 | /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ | 1521 | /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ |
1525 | ctrl = sci_in(port, SCSCR); | 1522 | ctrl = serial_port_in(port, SCSCR); |
1526 | 1523 | ||
1527 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1524 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1528 | ctrl &= ~0x8000; | 1525 | ctrl &= ~0x8000; |
1529 | 1526 | ||
1530 | ctrl &= ~SCSCR_TIE; | 1527 | ctrl &= ~SCSCR_TIE; |
1531 | 1528 | ||
1532 | sci_out(port, SCSCR, ctrl); | 1529 | serial_port_out(port, SCSCR, ctrl); |
1533 | } | 1530 | } |
1534 | 1531 | ||
1535 | static void sci_start_rx(struct uart_port *port) | 1532 | static void sci_start_rx(struct uart_port *port) |
1536 | { | 1533 | { |
1537 | unsigned short ctrl; | 1534 | unsigned short ctrl; |
1538 | 1535 | ||
1539 | ctrl = sci_in(port, SCSCR) | port_rx_irq_mask(port); | 1536 | ctrl = serial_port_in(port, SCSCR) | port_rx_irq_mask(port); |
1540 | 1537 | ||
1541 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1538 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1542 | ctrl &= ~0x4000; | 1539 | ctrl &= ~0x4000; |
1543 | 1540 | ||
1544 | sci_out(port, SCSCR, ctrl); | 1541 | serial_port_out(port, SCSCR, ctrl); |
1545 | } | 1542 | } |
1546 | 1543 | ||
1547 | static void sci_stop_rx(struct uart_port *port) | 1544 | static void sci_stop_rx(struct uart_port *port) |
1548 | { | 1545 | { |
1549 | unsigned short ctrl; | 1546 | unsigned short ctrl; |
1550 | 1547 | ||
1551 | ctrl = sci_in(port, SCSCR); | 1548 | ctrl = serial_port_in(port, SCSCR); |
1552 | 1549 | ||
1553 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1550 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1554 | ctrl &= ~0x4000; | 1551 | ctrl &= ~0x4000; |
1555 | 1552 | ||
1556 | ctrl &= ~port_rx_irq_mask(port); | 1553 | ctrl &= ~port_rx_irq_mask(port); |
1557 | 1554 | ||
1558 | sci_out(port, SCSCR, ctrl); | 1555 | serial_port_out(port, SCSCR, ctrl); |
1559 | } | 1556 | } |
1560 | 1557 | ||
1561 | static void sci_enable_ms(struct uart_port *port) | 1558 | static void sci_enable_ms(struct uart_port *port) |
@@ -1589,13 +1586,13 @@ static void rx_timer_fn(unsigned long arg) | |||
1589 | { | 1586 | { |
1590 | struct sci_port *s = (struct sci_port *)arg; | 1587 | struct sci_port *s = (struct sci_port *)arg; |
1591 | struct uart_port *port = &s->port; | 1588 | struct uart_port *port = &s->port; |
1592 | u16 scr = sci_in(port, SCSCR); | 1589 | u16 scr = serial_port_in(port, SCSCR); |
1593 | 1590 | ||
1594 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1591 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1595 | scr &= ~0x4000; | 1592 | scr &= ~0x4000; |
1596 | enable_irq(s->cfg->irqs[1]); | 1593 | enable_irq(s->cfg->irqs[1]); |
1597 | } | 1594 | } |
1598 | sci_out(port, SCSCR, scr | SCSCR_RIE); | 1595 | serial_port_out(port, SCSCR, scr | SCSCR_RIE); |
1599 | dev_dbg(port->dev, "DMA Rx timed out\n"); | 1596 | dev_dbg(port->dev, "DMA Rx timed out\n"); |
1600 | schedule_work(&s->work_rx); | 1597 | schedule_work(&s->work_rx); |
1601 | } | 1598 | } |
@@ -1776,14 +1773,14 @@ static void sci_reset(struct uart_port *port) | |||
1776 | unsigned int status; | 1773 | unsigned int status; |
1777 | 1774 | ||
1778 | do { | 1775 | do { |
1779 | status = sci_in(port, SCxSR); | 1776 | status = serial_port_in(port, SCxSR); |
1780 | } while (!(status & SCxSR_TEND(port))); | 1777 | } while (!(status & SCxSR_TEND(port))); |
1781 | 1778 | ||
1782 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ | 1779 | serial_port_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ |
1783 | 1780 | ||
1784 | reg = sci_getreg(port, SCFCR); | 1781 | reg = sci_getreg(port, SCFCR); |
1785 | if (reg->size) | 1782 | if (reg->size) |
1786 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); | 1783 | serial_port_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); |
1787 | } | 1784 | } |
1788 | 1785 | ||
1789 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | 1786 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, |
@@ -1812,7 +1809,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1812 | 1809 | ||
1813 | sci_reset(port); | 1810 | sci_reset(port); |
1814 | 1811 | ||
1815 | smr_val = sci_in(port, SCSMR) & 3; | 1812 | smr_val = serial_port_in(port, SCSMR) & 3; |
1816 | 1813 | ||
1817 | if ((termios->c_cflag & CSIZE) == CS7) | 1814 | if ((termios->c_cflag & CSIZE) == CS7) |
1818 | smr_val |= 0x40; | 1815 | smr_val |= 0x40; |
@@ -1825,19 +1822,19 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1825 | 1822 | ||
1826 | uart_update_timeout(port, termios->c_cflag, baud); | 1823 | uart_update_timeout(port, termios->c_cflag, baud); |
1827 | 1824 | ||
1828 | sci_out(port, SCSMR, smr_val); | 1825 | serial_port_out(port, SCSMR, smr_val); |
1829 | 1826 | ||
1830 | dev_dbg(port->dev, "%s: SMR %x, t %x, SCSCR %x\n", __func__, smr_val, t, | 1827 | dev_dbg(port->dev, "%s: SMR %x, t %x, SCSCR %x\n", __func__, smr_val, t, |
1831 | s->cfg->scscr); | 1828 | s->cfg->scscr); |
1832 | 1829 | ||
1833 | if (t > 0) { | 1830 | if (t > 0) { |
1834 | if (t >= 256) { | 1831 | if (t >= 256) { |
1835 | sci_out(port, SCSMR, (sci_in(port, SCSMR) & ~3) | 1); | 1832 | serial_port_out(port, SCSMR, (serial_port_in(port, SCSMR) & ~3) | 1); |
1836 | t >>= 2; | 1833 | t >>= 2; |
1837 | } else | 1834 | } else |
1838 | sci_out(port, SCSMR, sci_in(port, SCSMR) & ~3); | 1835 | serial_port_out(port, SCSMR, serial_port_in(port, SCSMR) & ~3); |
1839 | 1836 | ||
1840 | sci_out(port, SCBRR, t); | 1837 | serial_port_out(port, SCBRR, t); |
1841 | udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */ | 1838 | udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */ |
1842 | } | 1839 | } |
1843 | 1840 | ||
@@ -1845,7 +1842,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1845 | 1842 | ||
1846 | reg = sci_getreg(port, SCFCR); | 1843 | reg = sci_getreg(port, SCFCR); |
1847 | if (reg->size) { | 1844 | if (reg->size) { |
1848 | unsigned short ctrl = sci_in(port, SCFCR); | 1845 | unsigned short ctrl = serial_port_in(port, SCFCR); |
1849 | 1846 | ||
1850 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { | 1847 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { |
1851 | if (termios->c_cflag & CRTSCTS) | 1848 | if (termios->c_cflag & CRTSCTS) |
@@ -1861,10 +1858,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1861 | */ | 1858 | */ |
1862 | ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); | 1859 | ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); |
1863 | 1860 | ||
1864 | sci_out(port, SCFCR, ctrl); | 1861 | serial_port_out(port, SCFCR, ctrl); |
1865 | } | 1862 | } |
1866 | 1863 | ||
1867 | sci_out(port, SCSCR, s->cfg->scscr); | 1864 | serial_port_out(port, SCSCR, s->cfg->scscr); |
1868 | 1865 | ||
1869 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1866 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
1870 | /* | 1867 | /* |
@@ -2166,7 +2163,7 @@ static void serial_console_write(struct console *co, const char *s, | |||
2166 | 2163 | ||
2167 | /* wait until fifo is empty and last bit has been transmitted */ | 2164 | /* wait until fifo is empty and last bit has been transmitted */ |
2168 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); | 2165 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); |
2169 | while ((sci_in(port, SCxSR) & bits) != bits) | 2166 | while ((serial_port_in(port, SCxSR) & bits) != bits) |
2170 | cpu_relax(); | 2167 | cpu_relax(); |
2171 | 2168 | ||
2172 | sci_port_disable(sci_port); | 2169 | sci_port_disable(sci_port); |
@@ -2260,12 +2257,12 @@ static int sci_runtime_suspend(struct device *dev) | |||
2260 | if (uart_console(port)) { | 2257 | if (uart_console(port)) { |
2261 | struct plat_sci_reg *reg; | 2258 | struct plat_sci_reg *reg; |
2262 | 2259 | ||
2263 | sci_port->saved_smr = sci_in(port, SCSMR); | 2260 | sci_port->saved_smr = serial_port_in(port, SCSMR); |
2264 | sci_port->saved_brr = sci_in(port, SCBRR); | 2261 | sci_port->saved_brr = serial_port_in(port, SCBRR); |
2265 | 2262 | ||
2266 | reg = sci_getreg(port, SCFCR); | 2263 | reg = sci_getreg(port, SCFCR); |
2267 | if (reg->size) | 2264 | if (reg->size) |
2268 | sci_port->saved_fcr = sci_in(port, SCFCR); | 2265 | sci_port->saved_fcr = serial_port_in(port, SCFCR); |
2269 | else | 2266 | else |
2270 | sci_port->saved_fcr = 0; | 2267 | sci_port->saved_fcr = 0; |
2271 | } | 2268 | } |
@@ -2279,13 +2276,13 @@ static int sci_runtime_resume(struct device *dev) | |||
2279 | 2276 | ||
2280 | if (uart_console(port)) { | 2277 | if (uart_console(port)) { |
2281 | sci_reset(port); | 2278 | sci_reset(port); |
2282 | sci_out(port, SCSMR, sci_port->saved_smr); | 2279 | serial_port_out(port, SCSMR, sci_port->saved_smr); |
2283 | sci_out(port, SCBRR, sci_port->saved_brr); | 2280 | serial_port_out(port, SCBRR, sci_port->saved_brr); |
2284 | 2281 | ||
2285 | if (sci_port->saved_fcr) | 2282 | if (sci_port->saved_fcr) |
2286 | sci_out(port, SCFCR, sci_port->saved_fcr); | 2283 | serial_port_out(port, SCFCR, sci_port->saved_fcr); |
2287 | 2284 | ||
2288 | sci_out(port, SCSCR, sci_port->cfg->scscr); | 2285 | serial_port_out(port, SCSCR, sci_port->cfg->scscr); |
2289 | } | 2286 | } |
2290 | return 0; | 2287 | return 0; |
2291 | } | 2288 | } |
diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h index a1a2d364f92b..4c22a1529aac 100644 --- a/drivers/tty/serial/sh-sci.h +++ b/drivers/tty/serial/sh-sci.h | |||
@@ -20,10 +20,10 @@ | |||
20 | defined(CONFIG_ARCH_SH7372) || \ | 20 | defined(CONFIG_ARCH_SH7372) || \ |
21 | defined(CONFIG_ARCH_R8A7740) | 21 | defined(CONFIG_ARCH_R8A7740) |
22 | 22 | ||
23 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) | 23 | # define SCxSR_RDxF_CLEAR(port) (serial_port_in(port, SCxSR) & 0xfffc) |
24 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) | 24 | # define SCxSR_ERROR_CLEAR(port) (serial_port_in(port, SCxSR) & 0xfd73) |
25 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) | 25 | # define SCxSR_TDxE_CLEAR(port) (serial_port_in(port, SCxSR) & 0xffdf) |
26 | # define SCxSR_BREAK_CLEAR(port) (sci_in(port, SCxSR) & 0xffe3) | 26 | # define SCxSR_BREAK_CLEAR(port) (serial_port_in(port, SCxSR) & 0xffe3) |
27 | #else | 27 | #else |
28 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) | 28 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) |
29 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) | 29 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) |