diff options
Diffstat (limited to 'arch')
179 files changed, 2376 insertions, 4326 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c8f528284a94..257033c691f2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -17,6 +17,7 @@ config ARM | |||
17 | select HAVE_KRETPROBES if (HAVE_KPROBES) | 17 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
18 | select HAVE_FTRACE if (!XIP_KERNEL) | 18 | select HAVE_FTRACE if (!XIP_KERNEL) |
19 | select HAVE_DYNAMIC_FTRACE if (HAVE_FTRACE) | 19 | select HAVE_DYNAMIC_FTRACE if (HAVE_FTRACE) |
20 | select HAVE_GENERIC_DMA_COHERENT | ||
20 | help | 21 | help |
21 | The ARM series is a line of low-power-consumption RISC chip designs | 22 | The ARM series is a line of low-power-consumption RISC chip designs |
22 | licensed by ARM Ltd and targeted at embedded applications and | 23 | licensed by ARM Ltd and targeted at embedded applications and |
@@ -234,6 +235,7 @@ config ARCH_VERSATILE | |||
234 | config ARCH_AT91 | 235 | config ARCH_AT91 |
235 | bool "Atmel AT91" | 236 | bool "Atmel AT91" |
236 | select GENERIC_GPIO | 237 | select GENERIC_GPIO |
238 | select HAVE_CLK | ||
237 | help | 239 | help |
238 | This enables support for systems based on the Atmel AT91RM9200, | 240 | This enables support for systems based on the Atmel AT91RM9200, |
239 | AT91SAM9 and AT91CAP9 processors. | 241 | AT91SAM9 and AT91CAP9 processors. |
@@ -267,7 +269,6 @@ config ARCH_EP93XX | |||
267 | select ARM_VIC | 269 | select ARM_VIC |
268 | select GENERIC_GPIO | 270 | select GENERIC_GPIO |
269 | select HAVE_CLK | 271 | select HAVE_CLK |
270 | select HAVE_CLK | ||
271 | select ARCH_REQUIRE_GPIOLIB | 272 | select ARCH_REQUIRE_GPIOLIB |
272 | help | 273 | help |
273 | This enables support for the Cirrus EP93xx series of CPUs. | 274 | This enables support for the Cirrus EP93xx series of CPUs. |
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c index 333a82a3717e..db7b3e38ef1d 100644 --- a/arch/arm/mm/consistent.c +++ b/arch/arm/mm/consistent.c | |||
@@ -274,6 +274,11 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
274 | void * | 274 | void * |
275 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) | 275 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp) |
276 | { | 276 | { |
277 | void *memory; | ||
278 | |||
279 | if (dma_alloc_from_coherent(dev, size, handle, &memory)) | ||
280 | return memory; | ||
281 | |||
277 | if (arch_is_coherent()) { | 282 | if (arch_is_coherent()) { |
278 | void *virt; | 283 | void *virt; |
279 | 284 | ||
@@ -362,6 +367,9 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr | |||
362 | 367 | ||
363 | WARN_ON(irqs_disabled()); | 368 | WARN_ON(irqs_disabled()); |
364 | 369 | ||
370 | if (dma_release_from_coherent(dev, get_order(size), cpu_addr)) | ||
371 | return; | ||
372 | |||
365 | if (arch_is_coherent()) { | 373 | if (arch_is_coherent()) { |
366 | kfree(cpu_addr); | 374 | kfree(cpu_addr); |
367 | return; | 375 | return; |
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig index 2a92cb1886ca..7a64fcef9d07 100644 --- a/arch/cris/arch-v32/drivers/Kconfig +++ b/arch/cris/arch-v32/drivers/Kconfig | |||
@@ -641,6 +641,7 @@ config PCI | |||
641 | bool | 641 | bool |
642 | depends on ETRAX_CARDBUS | 642 | depends on ETRAX_CARDBUS |
643 | default y | 643 | default y |
644 | select HAVE_GENERIC_DMA_COHERENT | ||
644 | 645 | ||
645 | config ETRAX_IOP_FW_LOAD | 646 | config ETRAX_IOP_FW_LOAD |
646 | tristate "IO-processor hotplug firmware loading support" | 647 | tristate "IO-processor hotplug firmware loading support" |
diff --git a/arch/cris/arch-v32/drivers/pci/dma.c b/arch/cris/arch-v32/drivers/pci/dma.c index e0364654fc44..fbe65954ee6c 100644 --- a/arch/cris/arch-v32/drivers/pci/dma.c +++ b/arch/cris/arch-v32/drivers/pci/dma.c | |||
@@ -15,35 +15,16 @@ | |||
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <asm/io.h> | 16 | #include <asm/io.h> |
17 | 17 | ||
18 | struct dma_coherent_mem { | ||
19 | void *virt_base; | ||
20 | u32 device_base; | ||
21 | int size; | ||
22 | int flags; | ||
23 | unsigned long *bitmap; | ||
24 | }; | ||
25 | |||
26 | void *dma_alloc_coherent(struct device *dev, size_t size, | 18 | void *dma_alloc_coherent(struct device *dev, size_t size, |
27 | dma_addr_t *dma_handle, gfp_t gfp) | 19 | dma_addr_t *dma_handle, gfp_t gfp) |
28 | { | 20 | { |
29 | void *ret; | 21 | void *ret; |
30 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | ||
31 | int order = get_order(size); | 22 | int order = get_order(size); |
32 | /* ignore region specifiers */ | 23 | /* ignore region specifiers */ |
33 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM); | 24 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM); |
34 | 25 | ||
35 | if (mem) { | 26 | if (dma_alloc_from_coherent(dev, size, dma_handle, &ret)) |
36 | int page = bitmap_find_free_region(mem->bitmap, mem->size, | 27 | return ret; |
37 | order); | ||
38 | if (page >= 0) { | ||
39 | *dma_handle = mem->device_base + (page << PAGE_SHIFT); | ||
40 | ret = mem->virt_base + (page << PAGE_SHIFT); | ||
41 | memset(ret, 0, size); | ||
42 | return ret; | ||
43 | } | ||
44 | if (mem->flags & DMA_MEMORY_EXCLUSIVE) | ||
45 | return NULL; | ||
46 | } | ||
47 | 28 | ||
48 | if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff)) | 29 | if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff)) |
49 | gfp |= GFP_DMA; | 30 | gfp |= GFP_DMA; |
@@ -60,90 +41,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size, | |||
60 | void dma_free_coherent(struct device *dev, size_t size, | 41 | void dma_free_coherent(struct device *dev, size_t size, |
61 | void *vaddr, dma_addr_t dma_handle) | 42 | void *vaddr, dma_addr_t dma_handle) |
62 | { | 43 | { |
63 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | ||
64 | int order = get_order(size); | 44 | int order = get_order(size); |
65 | 45 | ||
66 | if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { | 46 | if (!dma_release_from_coherent(dev, order, vaddr)) |
67 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; | ||
68 | |||
69 | bitmap_release_region(mem->bitmap, page, order); | ||
70 | } else | ||
71 | free_pages((unsigned long)vaddr, order); | 47 | free_pages((unsigned long)vaddr, order); |
72 | } | 48 | } |
73 | 49 | ||
74 | int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
75 | dma_addr_t device_addr, size_t size, int flags) | ||
76 | { | ||
77 | void __iomem *mem_base; | ||
78 | int pages = size >> PAGE_SHIFT; | ||
79 | int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); | ||
80 | |||
81 | if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) | ||
82 | goto out; | ||
83 | if (!size) | ||
84 | goto out; | ||
85 | if (dev->dma_mem) | ||
86 | goto out; | ||
87 | |||
88 | /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */ | ||
89 | |||
90 | mem_base = ioremap(bus_addr, size); | ||
91 | if (!mem_base) | ||
92 | goto out; | ||
93 | |||
94 | dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); | ||
95 | if (!dev->dma_mem) | ||
96 | goto iounmap_out; | ||
97 | dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL); | ||
98 | if (!dev->dma_mem->bitmap) | ||
99 | goto free1_out; | ||
100 | |||
101 | dev->dma_mem->virt_base = mem_base; | ||
102 | dev->dma_mem->device_base = device_addr; | ||
103 | dev->dma_mem->size = pages; | ||
104 | dev->dma_mem->flags = flags; | ||
105 | |||
106 | if (flags & DMA_MEMORY_MAP) | ||
107 | return DMA_MEMORY_MAP; | ||
108 | |||
109 | return DMA_MEMORY_IO; | ||
110 | |||
111 | free1_out: | ||
112 | kfree(dev->dma_mem); | ||
113 | iounmap_out: | ||
114 | iounmap(mem_base); | ||
115 | out: | ||
116 | return 0; | ||
117 | } | ||
118 | EXPORT_SYMBOL(dma_declare_coherent_memory); | ||
119 | |||
120 | void dma_release_declared_memory(struct device *dev) | ||
121 | { | ||
122 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
123 | |||
124 | if(!mem) | ||
125 | return; | ||
126 | dev->dma_mem = NULL; | ||
127 | iounmap(mem->virt_base); | ||
128 | kfree(mem->bitmap); | ||
129 | kfree(mem); | ||
130 | } | ||
131 | EXPORT_SYMBOL(dma_release_declared_memory); | ||
132 | |||
133 | void *dma_mark_declared_memory_occupied(struct device *dev, | ||
134 | dma_addr_t device_addr, size_t size) | ||
135 | { | ||
136 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
137 | int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
138 | int pos, err; | ||
139 | |||
140 | if (!mem) | ||
141 | return ERR_PTR(-EINVAL); | ||
142 | |||
143 | pos = (device_addr - mem->device_base) >> PAGE_SHIFT; | ||
144 | err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); | ||
145 | if (err != 0) | ||
146 | return ERR_PTR(err); | ||
147 | return mem->virt_base + (pos << PAGE_SHIFT); | ||
148 | } | ||
149 | EXPORT_SYMBOL(dma_mark_declared_memory_occupied); | ||
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c index c45fc7f5a979..b0f615759e97 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <linux/hugetlb.h> | 14 | #include <linux/hugetlb.h> |
15 | #include <linux/pagemap.h> | 15 | #include <linux/pagemap.h> |
16 | #include <linux/module.h> | ||
16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
17 | #include <linux/sysctl.h> | 18 | #include <linux/sysctl.h> |
18 | #include <linux/log2.h> | 19 | #include <linux/log2.h> |
@@ -21,7 +22,8 @@ | |||
21 | #include <asm/tlb.h> | 22 | #include <asm/tlb.h> |
22 | #include <asm/tlbflush.h> | 23 | #include <asm/tlbflush.h> |
23 | 24 | ||
24 | unsigned int hpage_shift=HPAGE_SHIFT_DEFAULT; | 25 | unsigned int hpage_shift = HPAGE_SHIFT_DEFAULT; |
26 | EXPORT_SYMBOL(hpage_shift); | ||
25 | 27 | ||
26 | pte_t * | 28 | pte_t * |
27 | huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz) | 29 | huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz) |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index b4c4eaa5dd26..4da736e25333 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -3,6 +3,7 @@ config MIPS | |||
3 | default y | 3 | default y |
4 | select HAVE_IDE | 4 | select HAVE_IDE |
5 | select HAVE_OPROFILE | 5 | select HAVE_OPROFILE |
6 | select HAVE_ARCH_KGDB | ||
6 | # Horrible source of confusion. Die, die, die ... | 7 | # Horrible source of confusion. Die, die, die ... |
7 | select EMBEDDED | 8 | select EMBEDDED |
8 | select RTC_LIB | 9 | select RTC_LIB |
@@ -34,7 +35,6 @@ config BASLER_EXCITE | |||
34 | select SYS_HAS_CPU_RM9000 | 35 | select SYS_HAS_CPU_RM9000 |
35 | select SYS_SUPPORTS_32BIT_KERNEL | 36 | select SYS_SUPPORTS_32BIT_KERNEL |
36 | select SYS_SUPPORTS_BIG_ENDIAN | 37 | select SYS_SUPPORTS_BIG_ENDIAN |
37 | select SYS_SUPPORTS_KGDB | ||
38 | help | 38 | help |
39 | The eXcite is a smart camera platform manufactured by | 39 | The eXcite is a smart camera platform manufactured by |
40 | Basler Vision Technologies AG. | 40 | Basler Vision Technologies AG. |
@@ -280,7 +280,6 @@ config PMC_MSP | |||
280 | select SYS_HAS_CPU_MIPS32_R2 | 280 | select SYS_HAS_CPU_MIPS32_R2 |
281 | select SYS_SUPPORTS_32BIT_KERNEL | 281 | select SYS_SUPPORTS_32BIT_KERNEL |
282 | select SYS_SUPPORTS_BIG_ENDIAN | 282 | select SYS_SUPPORTS_BIG_ENDIAN |
283 | select SYS_SUPPORTS_KGDB | ||
284 | select IRQ_CPU | 283 | select IRQ_CPU |
285 | select SERIAL_8250 | 284 | select SERIAL_8250 |
286 | select SERIAL_8250_CONSOLE | 285 | select SERIAL_8250_CONSOLE |
@@ -306,7 +305,6 @@ config PMC_YOSEMITE | |||
306 | select SYS_SUPPORTS_64BIT_KERNEL | 305 | select SYS_SUPPORTS_64BIT_KERNEL |
307 | select SYS_SUPPORTS_BIG_ENDIAN | 306 | select SYS_SUPPORTS_BIG_ENDIAN |
308 | select SYS_SUPPORTS_HIGHMEM | 307 | select SYS_SUPPORTS_HIGHMEM |
309 | select SYS_SUPPORTS_KGDB | ||
310 | select SYS_SUPPORTS_SMP | 308 | select SYS_SUPPORTS_SMP |
311 | help | 309 | help |
312 | Yosemite is an evaluation board for the RM9000x2 processor | 310 | Yosemite is an evaluation board for the RM9000x2 processor |
@@ -359,7 +357,6 @@ config SGI_IP27 | |||
359 | select SYS_HAS_CPU_R10000 | 357 | select SYS_HAS_CPU_R10000 |
360 | select SYS_SUPPORTS_64BIT_KERNEL | 358 | select SYS_SUPPORTS_64BIT_KERNEL |
361 | select SYS_SUPPORTS_BIG_ENDIAN | 359 | select SYS_SUPPORTS_BIG_ENDIAN |
362 | select SYS_SUPPORTS_KGDB | ||
363 | select SYS_SUPPORTS_NUMA | 360 | select SYS_SUPPORTS_NUMA |
364 | select SYS_SUPPORTS_SMP | 361 | select SYS_SUPPORTS_SMP |
365 | select GENERIC_HARDIRQS_NO__DO_IRQ | 362 | select GENERIC_HARDIRQS_NO__DO_IRQ |
@@ -475,7 +472,6 @@ config SIBYTE_SWARM | |||
475 | select SYS_HAS_CPU_SB1 | 472 | select SYS_HAS_CPU_SB1 |
476 | select SYS_SUPPORTS_BIG_ENDIAN | 473 | select SYS_SUPPORTS_BIG_ENDIAN |
477 | select SYS_SUPPORTS_HIGHMEM | 474 | select SYS_SUPPORTS_HIGHMEM |
478 | select SYS_SUPPORTS_KGDB | ||
479 | select SYS_SUPPORTS_LITTLE_ENDIAN | 475 | select SYS_SUPPORTS_LITTLE_ENDIAN |
480 | select ZONE_DMA32 if 64BIT | 476 | select ZONE_DMA32 if 64BIT |
481 | 477 | ||
@@ -868,7 +864,6 @@ config SOC_PNX8550 | |||
868 | select SYS_HAS_EARLY_PRINTK | 864 | select SYS_HAS_EARLY_PRINTK |
869 | select SYS_SUPPORTS_32BIT_KERNEL | 865 | select SYS_SUPPORTS_32BIT_KERNEL |
870 | select GENERIC_HARDIRQS_NO__DO_IRQ | 866 | select GENERIC_HARDIRQS_NO__DO_IRQ |
871 | select SYS_SUPPORTS_KGDB | ||
872 | select GENERIC_GPIO | 867 | select GENERIC_GPIO |
873 | 868 | ||
874 | config SWAP_IO_SPACE | 869 | config SWAP_IO_SPACE |
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug index f18cf92650e3..765c8e287d2b 100644 --- a/arch/mips/Kconfig.debug +++ b/arch/mips/Kconfig.debug | |||
@@ -34,28 +34,6 @@ config SMTC_IDLE_HOOK_DEBUG | |||
34 | arch/mips/kernel/smtc.c. This debugging option result in significant | 34 | arch/mips/kernel/smtc.c. This debugging option result in significant |
35 | overhead so should be disabled in production kernels. | 35 | overhead so should be disabled in production kernels. |
36 | 36 | ||
37 | config KGDB | ||
38 | bool "Remote GDB kernel debugging" | ||
39 | depends on DEBUG_KERNEL && SYS_SUPPORTS_KGDB | ||
40 | select DEBUG_INFO | ||
41 | help | ||
42 | If you say Y here, it will be possible to remotely debug the MIPS | ||
43 | kernel using gdb. This enlarges your kernel image disk size by | ||
44 | several megabytes and requires a machine with more than 16 MB, | ||
45 | better 32 MB RAM to avoid excessive linking time. This is only | ||
46 | useful for kernel hackers. If unsure, say N. | ||
47 | |||
48 | config SYS_SUPPORTS_KGDB | ||
49 | bool | ||
50 | |||
51 | config GDB_CONSOLE | ||
52 | bool "Console output to GDB" | ||
53 | depends on KGDB | ||
54 | help | ||
55 | If you are using GDB for remote debugging over a serial port and | ||
56 | would like kernel messages to be formatted into GDB $O packets so | ||
57 | that GDB prints them as program output, say 'Y'. | ||
58 | |||
59 | config SB1XXX_CORELIS | 37 | config SB1XXX_CORELIS |
60 | bool "Corelis Debugger" | 38 | bool "Corelis Debugger" |
61 | depends on SIBYTE_SB1xxx_SOC | 39 | depends on SIBYTE_SB1xxx_SOC |
diff --git a/arch/mips/au1000/Kconfig b/arch/mips/au1000/Kconfig index 1fe97cccead1..e4a057d80ab6 100644 --- a/arch/mips/au1000/Kconfig +++ b/arch/mips/au1000/Kconfig | |||
@@ -134,4 +134,3 @@ config SOC_AU1X00 | |||
134 | select SYS_HAS_CPU_MIPS32_R1 | 134 | select SYS_HAS_CPU_MIPS32_R1 |
135 | select SYS_SUPPORTS_32BIT_KERNEL | 135 | select SYS_SUPPORTS_32BIT_KERNEL |
136 | select SYS_SUPPORTS_APM_EMULATION | 136 | select SYS_SUPPORTS_APM_EMULATION |
137 | select SYS_SUPPORTS_KGDB | ||
diff --git a/arch/mips/au1000/common/Makefile b/arch/mips/au1000/common/Makefile index dd0e19dacfcf..df48fd65bbf3 100644 --- a/arch/mips/au1000/common/Makefile +++ b/arch/mips/au1000/common/Makefile | |||
@@ -9,7 +9,6 @@ obj-y += prom.o irq.o puts.o time.o reset.o \ | |||
9 | au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ | 9 | au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ |
10 | sleeper.o cputable.o dma.o dbdma.o gpio.o | 10 | sleeper.o cputable.o dma.o dbdma.o gpio.o |
11 | 11 | ||
12 | obj-$(CONFIG_KGDB) += dbg_io.o | ||
13 | obj-$(CONFIG_PCI) += pci.o | 12 | obj-$(CONFIG_PCI) += pci.o |
14 | 13 | ||
15 | EXTRA_CFLAGS += -Werror | 14 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/au1000/common/dbg_io.c b/arch/mips/au1000/common/dbg_io.c deleted file mode 100644 index af5be7df2f2a..000000000000 --- a/arch/mips/au1000/common/dbg_io.c +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | #include <linux/types.h> | ||
2 | |||
3 | #include <asm/mach-au1x00/au1000.h> | ||
4 | |||
5 | #ifdef CONFIG_KGDB | ||
6 | |||
7 | /* | ||
8 | * FIXME the user should be able to select the | ||
9 | * uart to be used for debugging. | ||
10 | */ | ||
11 | #define DEBUG_BASE UART_DEBUG_BASE | ||
12 | |||
13 | #define UART16550_BAUD_2400 2400 | ||
14 | #define UART16550_BAUD_4800 4800 | ||
15 | #define UART16550_BAUD_9600 9600 | ||
16 | #define UART16550_BAUD_19200 19200 | ||
17 | #define UART16550_BAUD_38400 38400 | ||
18 | #define UART16550_BAUD_57600 57600 | ||
19 | #define UART16550_BAUD_115200 115200 | ||
20 | |||
21 | #define UART16550_PARITY_NONE 0 | ||
22 | #define UART16550_PARITY_ODD 0x08 | ||
23 | #define UART16550_PARITY_EVEN 0x18 | ||
24 | #define UART16550_PARITY_MARK 0x28 | ||
25 | #define UART16550_PARITY_SPACE 0x38 | ||
26 | |||
27 | #define UART16550_DATA_5BIT 0x0 | ||
28 | #define UART16550_DATA_6BIT 0x1 | ||
29 | #define UART16550_DATA_7BIT 0x2 | ||
30 | #define UART16550_DATA_8BIT 0x3 | ||
31 | |||
32 | #define UART16550_STOP_1BIT 0x0 | ||
33 | #define UART16550_STOP_2BIT 0x4 | ||
34 | |||
35 | |||
36 | #define UART_RX 0 /* Receive buffer */ | ||
37 | #define UART_TX 4 /* Transmit buffer */ | ||
38 | #define UART_IER 8 /* Interrupt Enable Register */ | ||
39 | #define UART_IIR 0xC /* Interrupt ID Register */ | ||
40 | #define UART_FCR 0x10 /* FIFO Control Register */ | ||
41 | #define UART_LCR 0x14 /* Line Control Register */ | ||
42 | #define UART_MCR 0x18 /* Modem Control Register */ | ||
43 | #define UART_LSR 0x1C /* Line Status Register */ | ||
44 | #define UART_MSR 0x20 /* Modem Status Register */ | ||
45 | #define UART_CLK 0x28 /* Baud Rat4e Clock Divider */ | ||
46 | #define UART_MOD_CNTRL 0x100 /* Module Control */ | ||
47 | |||
48 | /* memory-mapped read/write of the port */ | ||
49 | #define UART16550_READ(y) (au_readl(DEBUG_BASE + y) & 0xff) | ||
50 | #define UART16550_WRITE(y, z) (au_writel(z & 0xff, DEBUG_BASE + y)) | ||
51 | |||
52 | extern unsigned long calc_clock(void); | ||
53 | |||
54 | void debugInit(u32 baud, u8 data, u8 parity, u8 stop) | ||
55 | { | ||
56 | if (UART16550_READ(UART_MOD_CNTRL) != 0x3) | ||
57 | UART16550_WRITE(UART_MOD_CNTRL, 3); | ||
58 | calc_clock(); | ||
59 | |||
60 | /* disable interrupts */ | ||
61 | UART16550_WRITE(UART_IER, 0); | ||
62 | |||
63 | /* set up baud rate */ | ||
64 | { | ||
65 | u32 divisor; | ||
66 | |||
67 | /* set divisor */ | ||
68 | divisor = get_au1x00_uart_baud_base() / baud; | ||
69 | UART16550_WRITE(UART_CLK, divisor & 0xffff); | ||
70 | } | ||
71 | |||
72 | /* set data format */ | ||
73 | UART16550_WRITE(UART_LCR, (data | parity | stop)); | ||
74 | } | ||
75 | |||
76 | static int remoteDebugInitialized; | ||
77 | |||
78 | u8 getDebugChar(void) | ||
79 | { | ||
80 | if (!remoteDebugInitialized) { | ||
81 | remoteDebugInitialized = 1; | ||
82 | debugInit(UART16550_BAUD_115200, | ||
83 | UART16550_DATA_8BIT, | ||
84 | UART16550_PARITY_NONE, | ||
85 | UART16550_STOP_1BIT); | ||
86 | } | ||
87 | |||
88 | while ((UART16550_READ(UART_LSR) & 0x1) == 0); | ||
89 | return UART16550_READ(UART_RX); | ||
90 | } | ||
91 | |||
92 | |||
93 | int putDebugChar(u8 byte) | ||
94 | { | ||
95 | if (!remoteDebugInitialized) { | ||
96 | remoteDebugInitialized = 1; | ||
97 | debugInit(UART16550_BAUD_115200, | ||
98 | UART16550_DATA_8BIT, | ||
99 | UART16550_PARITY_NONE, | ||
100 | UART16550_STOP_1BIT); | ||
101 | } | ||
102 | |||
103 | while ((UART16550_READ(UART_LSR) & 0x40) == 0); | ||
104 | UART16550_WRITE(UART_TX, byte); | ||
105 | |||
106 | return 1; | ||
107 | } | ||
108 | |||
109 | #endif | ||
diff --git a/arch/mips/au1000/db1x00/init.c b/arch/mips/au1000/db1x00/init.c index 5ebe0de5e459..847413514964 100644 --- a/arch/mips/au1000/db1x00/init.c +++ b/arch/mips/au1000/db1x00/init.c | |||
@@ -57,6 +57,6 @@ void __init prom_init(void) | |||
57 | if (!memsize_str) | 57 | if (!memsize_str) |
58 | memsize = 0x04000000; | 58 | memsize = 0x04000000; |
59 | else | 59 | else |
60 | memsize = strict_strtol(memsize_str, 0, NULL); | 60 | strict_strtol(memsize_str, 0, &memsize); |
61 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 61 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
62 | } | 62 | } |
diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c index 33a4aebe0cba..3bae13c28954 100644 --- a/arch/mips/au1000/mtx-1/init.c +++ b/arch/mips/au1000/mtx-1/init.c | |||
@@ -55,6 +55,6 @@ void __init prom_init(void) | |||
55 | if (!memsize_str) | 55 | if (!memsize_str) |
56 | memsize = 0x04000000; | 56 | memsize = 0x04000000; |
57 | else | 57 | else |
58 | memsize = strict_strtol(memsize_str, 0, NULL); | 58 | strict_strtol(memsize_str, 0, &memsize); |
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 59 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
60 | } | 60 | } |
diff --git a/arch/mips/au1000/pb1000/init.c b/arch/mips/au1000/pb1000/init.c index 3837365d613d..8a9c7d57208d 100644 --- a/arch/mips/au1000/pb1000/init.c +++ b/arch/mips/au1000/pb1000/init.c | |||
@@ -52,6 +52,6 @@ void __init prom_init(void) | |||
52 | if (!memsize_str) | 52 | if (!memsize_str) |
53 | memsize = 0x04000000; | 53 | memsize = 0x04000000; |
54 | else | 54 | else |
55 | memsize = strict_strtol(memsize_str, 0, NULL); | 55 | strict_strtol(memsize_str, 0, &memsize); |
56 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 56 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
57 | } | 57 | } |
diff --git a/arch/mips/au1000/pb1100/init.c b/arch/mips/au1000/pb1100/init.c index 8355483f3de2..7c6792308bc5 100644 --- a/arch/mips/au1000/pb1100/init.c +++ b/arch/mips/au1000/pb1100/init.c | |||
@@ -54,7 +54,7 @@ void __init prom_init(void) | |||
54 | if (!memsize_str) | 54 | if (!memsize_str) |
55 | memsize = 0x04000000; | 55 | memsize = 0x04000000; |
56 | else | 56 | else |
57 | memsize = strict_strtol(memsize_str, 0, NULL); | 57 | strict_strtol(memsize_str, 0, &memsize); |
58 | 58 | ||
59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 59 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
60 | } | 60 | } |
diff --git a/arch/mips/au1000/pb1200/init.c b/arch/mips/au1000/pb1200/init.c index 09fd63b86062..e9b2a0fd48ae 100644 --- a/arch/mips/au1000/pb1200/init.c +++ b/arch/mips/au1000/pb1200/init.c | |||
@@ -53,6 +53,6 @@ void __init prom_init(void) | |||
53 | if (!memsize_str) | 53 | if (!memsize_str) |
54 | memsize = 0x08000000; | 54 | memsize = 0x08000000; |
55 | else | 55 | else |
56 | memsize = strict_strtol(memsize_str, 0, NULL); | 56 | strict_strtol(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 58 | } |
diff --git a/arch/mips/au1000/pb1500/init.c b/arch/mips/au1000/pb1500/init.c index 49f51e165863..3b6e395cf952 100644 --- a/arch/mips/au1000/pb1500/init.c +++ b/arch/mips/au1000/pb1500/init.c | |||
@@ -53,6 +53,6 @@ void __init prom_init(void) | |||
53 | if (!memsize_str) | 53 | if (!memsize_str) |
54 | memsize = 0x04000000; | 54 | memsize = 0x04000000; |
55 | else | 55 | else |
56 | memsize = strict_strtol(memsize_str, 0, NULL); | 56 | strict_strtol(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 58 | } |
diff --git a/arch/mips/au1000/pb1550/init.c b/arch/mips/au1000/pb1550/init.c index 1b5f58434bb7..e1055a13a1a0 100644 --- a/arch/mips/au1000/pb1550/init.c +++ b/arch/mips/au1000/pb1550/init.c | |||
@@ -53,6 +53,6 @@ void __init prom_init(void) | |||
53 | if (!memsize_str) | 53 | if (!memsize_str) |
54 | memsize = 0x08000000; | 54 | memsize = 0x08000000; |
55 | else | 55 | else |
56 | memsize = strict_strtol(memsize_str, 0, NULL); | 56 | strict_strtol(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 58 | } |
diff --git a/arch/mips/au1000/xxs1500/init.c b/arch/mips/au1000/xxs1500/init.c index b849bf501c04..7516434760a1 100644 --- a/arch/mips/au1000/xxs1500/init.c +++ b/arch/mips/au1000/xxs1500/init.c | |||
@@ -53,6 +53,6 @@ void __init prom_init(void) | |||
53 | if (!memsize_str) | 53 | if (!memsize_str) |
54 | memsize = 0x04000000; | 54 | memsize = 0x04000000; |
55 | else | 55 | else |
56 | memsize = strict_strtol(memsize_str, 0, NULL); | 56 | strict_strtol(memsize_str, 0, &memsize); |
57 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
58 | } | 58 | } |
diff --git a/arch/mips/basler/excite/Makefile b/arch/mips/basler/excite/Makefile index 519142c2e4ef..cff29cf46d03 100644 --- a/arch/mips/basler/excite/Makefile +++ b/arch/mips/basler/excite/Makefile | |||
@@ -5,5 +5,4 @@ | |||
5 | obj-$(CONFIG_BASLER_EXCITE) += excite_irq.o excite_prom.o excite_setup.o \ | 5 | obj-$(CONFIG_BASLER_EXCITE) += excite_irq.o excite_prom.o excite_setup.o \ |
6 | excite_device.o excite_procfs.o | 6 | excite_device.o excite_procfs.o |
7 | 7 | ||
8 | obj-$(CONFIG_KGDB) += excite_dbg_io.o | ||
9 | obj-m += excite_iodev.o | 8 | obj-m += excite_iodev.o |
diff --git a/arch/mips/basler/excite/excite_dbg_io.c b/arch/mips/basler/excite/excite_dbg_io.c deleted file mode 100644 index d289e3a868cf..000000000000 --- a/arch/mips/basler/excite/excite_dbg_io.c +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 by Basler Vision Technologies AG | ||
3 | * Author: Thomas Koeller <thomas.koeller@baslerweb.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/linkage.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/kernel.h> | ||
23 | #include <asm/gdb-stub.h> | ||
24 | #include <asm/rm9k-ocd.h> | ||
25 | #include <excite.h> | ||
26 | |||
27 | #if defined(CONFIG_SERIAL_8250) && CONFIG_SERIAL_8250_NR_UARTS > 1 | ||
28 | #error Debug port used by serial driver | ||
29 | #endif | ||
30 | |||
31 | #define UART_CLK 25000000 | ||
32 | #define BASE_BAUD (UART_CLK / 16) | ||
33 | #define REGISTER_BASE_0 0x0208UL | ||
34 | #define REGISTER_BASE_1 0x0238UL | ||
35 | |||
36 | #define REGISTER_BASE_DBG REGISTER_BASE_1 | ||
37 | |||
38 | #define CPRR 0x0004 | ||
39 | #define UACFG 0x0200 | ||
40 | #define UAINTS 0x0204 | ||
41 | #define UARBR (REGISTER_BASE_DBG + 0x0000) | ||
42 | #define UATHR (REGISTER_BASE_DBG + 0x0004) | ||
43 | #define UADLL (REGISTER_BASE_DBG + 0x0008) | ||
44 | #define UAIER (REGISTER_BASE_DBG + 0x000c) | ||
45 | #define UADLH (REGISTER_BASE_DBG + 0x0010) | ||
46 | #define UAIIR (REGISTER_BASE_DBG + 0x0014) | ||
47 | #define UAFCR (REGISTER_BASE_DBG + 0x0018) | ||
48 | #define UALCR (REGISTER_BASE_DBG + 0x001c) | ||
49 | #define UAMCR (REGISTER_BASE_DBG + 0x0020) | ||
50 | #define UALSR (REGISTER_BASE_DBG + 0x0024) | ||
51 | #define UAMSR (REGISTER_BASE_DBG + 0x0028) | ||
52 | #define UASCR (REGISTER_BASE_DBG + 0x002c) | ||
53 | |||
54 | #define PARITY_NONE 0 | ||
55 | #define PARITY_ODD 0x08 | ||
56 | #define PARITY_EVEN 0x18 | ||
57 | #define PARITY_MARK 0x28 | ||
58 | #define PARITY_SPACE 0x38 | ||
59 | |||
60 | #define DATA_5BIT 0x0 | ||
61 | #define DATA_6BIT 0x1 | ||
62 | #define DATA_7BIT 0x2 | ||
63 | #define DATA_8BIT 0x3 | ||
64 | |||
65 | #define STOP_1BIT 0x0 | ||
66 | #define STOP_2BIT 0x4 | ||
67 | |||
68 | #define BAUD_DBG 57600 | ||
69 | #define PARITY_DBG PARITY_NONE | ||
70 | #define DATA_DBG DATA_8BIT | ||
71 | #define STOP_DBG STOP_1BIT | ||
72 | |||
73 | /* Initialize the serial port for KGDB debugging */ | ||
74 | void __init excite_kgdb_init(void) | ||
75 | { | ||
76 | const u32 divisor = BASE_BAUD / BAUD_DBG; | ||
77 | |||
78 | /* Take the UART out of reset */ | ||
79 | titan_writel(0x00ff1cff, CPRR); | ||
80 | titan_writel(0x00000000, UACFG); | ||
81 | titan_writel(0x00000002, UACFG); | ||
82 | |||
83 | titan_writel(0x0, UALCR); | ||
84 | titan_writel(0x0, UAIER); | ||
85 | |||
86 | /* Disable FIFOs */ | ||
87 | titan_writel(0x00, UAFCR); | ||
88 | |||
89 | titan_writel(0x80, UALCR); | ||
90 | titan_writel(divisor & 0xff, UADLL); | ||
91 | titan_writel((divisor & 0xff00) >> 8, UADLH); | ||
92 | titan_writel(0x0, UALCR); | ||
93 | |||
94 | titan_writel(DATA_DBG | PARITY_DBG | STOP_DBG, UALCR); | ||
95 | |||
96 | /* Enable receiver interrupt */ | ||
97 | titan_readl(UARBR); | ||
98 | titan_writel(0x1, UAIER); | ||
99 | } | ||
100 | |||
101 | int getDebugChar(void) | ||
102 | { | ||
103 | while (!(titan_readl(UALSR) & 0x1)); | ||
104 | return titan_readl(UARBR); | ||
105 | } | ||
106 | |||
107 | int putDebugChar(int data) | ||
108 | { | ||
109 | while (!(titan_readl(UALSR) & 0x20)); | ||
110 | titan_writel(data, UATHR); | ||
111 | return 1; | ||
112 | } | ||
113 | |||
114 | /* KGDB interrupt handler */ | ||
115 | asmlinkage void excite_kgdb_inthdl(void) | ||
116 | { | ||
117 | if (unlikely( | ||
118 | ((titan_readl(UAIIR) & 0x7) == 4) | ||
119 | && ((titan_readl(UARBR) & 0xff) == 0x3))) | ||
120 | set_async_breakpoint(®s->cp0_epc); | ||
121 | } | ||
diff --git a/arch/mips/basler/excite/excite_irq.c b/arch/mips/basler/excite/excite_irq.c index 4903e067916b..934e0a6b1011 100644 --- a/arch/mips/basler/excite/excite_irq.c +++ b/arch/mips/basler/excite/excite_irq.c | |||
@@ -50,10 +50,6 @@ void __init arch_init_irq(void) | |||
50 | mips_cpu_irq_init(); | 50 | mips_cpu_irq_init(); |
51 | rm7k_cpu_irq_init(); | 51 | rm7k_cpu_irq_init(); |
52 | rm9k_cpu_irq_init(); | 52 | rm9k_cpu_irq_init(); |
53 | |||
54 | #ifdef CONFIG_KGDB | ||
55 | excite_kgdb_init(); | ||
56 | #endif | ||
57 | } | 53 | } |
58 | 54 | ||
59 | asmlinkage void plat_irq_dispatch(void) | 55 | asmlinkage void plat_irq_dispatch(void) |
@@ -90,9 +86,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
90 | msgint = msgintflags & msgintmask & (0x1 << (TITAN_MSGINT % 0x20)); | 86 | msgint = msgintflags & msgintmask & (0x1 << (TITAN_MSGINT % 0x20)); |
91 | if ((pending & (1 << TITAN_IRQ)) && msgint) { | 87 | if ((pending & (1 << TITAN_IRQ)) && msgint) { |
92 | ocd_writel(msgint, INTP0Clear0 + (TITAN_MSGINT / 0x20 * 0x10)); | 88 | ocd_writel(msgint, INTP0Clear0 + (TITAN_MSGINT / 0x20 * 0x10)); |
93 | #if defined(CONFIG_KGDB) | ||
94 | excite_kgdb_inthdl(); | ||
95 | #endif | ||
96 | do_IRQ(TITAN_IRQ); | 89 | do_IRQ(TITAN_IRQ); |
97 | return; | 90 | return; |
98 | } | 91 | } |
diff --git a/arch/mips/basler/excite/excite_setup.c b/arch/mips/basler/excite/excite_setup.c index 6dd8f0d46d09..d66b3b8edf2a 100644 --- a/arch/mips/basler/excite/excite_setup.c +++ b/arch/mips/basler/excite/excite_setup.c | |||
@@ -95,13 +95,13 @@ static int __init excite_init_console(void) | |||
95 | /* Take the DUART out of reset */ | 95 | /* Take the DUART out of reset */ |
96 | titan_writel(0x00ff1cff, CPRR); | 96 | titan_writel(0x00ff1cff, CPRR); |
97 | 97 | ||
98 | #if defined(CONFIG_KGDB) || (CONFIG_SERIAL_8250_NR_UARTS > 1) | 98 | #if (CONFIG_SERIAL_8250_NR_UARTS > 1) |
99 | /* Enable both ports */ | 99 | /* Enable both ports */ |
100 | titan_writel(MASK_SER0 | MASK_SER1, UACFG); | 100 | titan_writel(MASK_SER0 | MASK_SER1, UACFG); |
101 | #else | 101 | #else |
102 | /* Enable port #0 only */ | 102 | /* Enable port #0 only */ |
103 | titan_writel(MASK_SER0, UACFG); | 103 | titan_writel(MASK_SER0, UACFG); |
104 | #endif /* defined(CONFIG_KGDB) */ | 104 | #endif |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * Set up serial port #0. Do not use autodetection; the result is | 107 | * Set up serial port #0. Do not use autodetection; the result is |
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig index 2678b7ec3351..eb44b72254af 100644 --- a/arch/mips/configs/cobalt_defconfig +++ b/arch/mips/configs/cobalt_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.23-rc5 | 3 | # Linux kernel version: 2.6.26 |
4 | # Thu Sep 6 13:14:29 2007 | 4 | # Fri Jul 25 10:25:34 2008 |
5 | # | 5 | # |
6 | CONFIG_MIPS=y | 6 | CONFIG_MIPS=y |
7 | 7 | ||
@@ -10,9 +10,11 @@ CONFIG_MIPS=y | |||
10 | # | 10 | # |
11 | # CONFIG_MACH_ALCHEMY is not set | 11 | # CONFIG_MACH_ALCHEMY is not set |
12 | # CONFIG_BASLER_EXCITE is not set | 12 | # CONFIG_BASLER_EXCITE is not set |
13 | # CONFIG_BCM47XX is not set | ||
13 | CONFIG_MIPS_COBALT=y | 14 | CONFIG_MIPS_COBALT=y |
14 | # CONFIG_MACH_DECSTATION is not set | 15 | # CONFIG_MACH_DECSTATION is not set |
15 | # CONFIG_MACH_JAZZ is not set | 16 | # CONFIG_MACH_JAZZ is not set |
17 | # CONFIG_LASAT is not set | ||
16 | # CONFIG_LEMOTE_FULONG is not set | 18 | # CONFIG_LEMOTE_FULONG is not set |
17 | # CONFIG_MIPS_MALTA is not set | 19 | # CONFIG_MIPS_MALTA is not set |
18 | # CONFIG_MIPS_SIM is not set | 20 | # CONFIG_MIPS_SIM is not set |
@@ -24,6 +26,7 @@ CONFIG_MIPS_COBALT=y | |||
24 | # CONFIG_PMC_YOSEMITE is not set | 26 | # CONFIG_PMC_YOSEMITE is not set |
25 | # CONFIG_SGI_IP22 is not set | 27 | # CONFIG_SGI_IP22 is not set |
26 | # CONFIG_SGI_IP27 is not set | 28 | # CONFIG_SGI_IP27 is not set |
29 | # CONFIG_SGI_IP28 is not set | ||
27 | # CONFIG_SGI_IP32 is not set | 30 | # CONFIG_SGI_IP32 is not set |
28 | # CONFIG_SIBYTE_CRHINE is not set | 31 | # CONFIG_SIBYTE_CRHINE is not set |
29 | # CONFIG_SIBYTE_CARMEL is not set | 32 | # CONFIG_SIBYTE_CARMEL is not set |
@@ -34,19 +37,25 @@ CONFIG_MIPS_COBALT=y | |||
34 | # CONFIG_SIBYTE_SENTOSA is not set | 37 | # CONFIG_SIBYTE_SENTOSA is not set |
35 | # CONFIG_SIBYTE_BIGSUR is not set | 38 | # CONFIG_SIBYTE_BIGSUR is not set |
36 | # CONFIG_SNI_RM is not set | 39 | # CONFIG_SNI_RM is not set |
37 | # CONFIG_TOSHIBA_JMR3927 is not set | 40 | # CONFIG_MACH_TX39XX is not set |
38 | # CONFIG_TOSHIBA_RBTX4927 is not set | 41 | # CONFIG_MACH_TX49XX is not set |
39 | # CONFIG_TOSHIBA_RBTX4938 is not set | 42 | # CONFIG_MIKROTIK_RB532 is not set |
40 | # CONFIG_WR_PPMC is not set | 43 | # CONFIG_WR_PPMC is not set |
41 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 44 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
42 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 45 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
43 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 46 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
47 | CONFIG_ARCH_SUPPORTS_OPROFILE=y | ||
44 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 48 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
45 | CONFIG_GENERIC_HWEIGHT=y | 49 | CONFIG_GENERIC_HWEIGHT=y |
46 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 50 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
51 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
47 | CONFIG_GENERIC_TIME=y | 52 | CONFIG_GENERIC_TIME=y |
53 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
48 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | 54 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y |
49 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | 55 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y |
56 | CONFIG_CEVT_GT641XX=y | ||
57 | CONFIG_CEVT_R4K=y | ||
58 | CONFIG_CSRC_R4K=y | ||
50 | CONFIG_DMA_NONCOHERENT=y | 59 | CONFIG_DMA_NONCOHERENT=y |
51 | CONFIG_DMA_NEED_PCI_MAP_STATE=y | 60 | CONFIG_DMA_NEED_PCI_MAP_STATE=y |
52 | CONFIG_EARLY_PRINTK=y | 61 | CONFIG_EARLY_PRINTK=y |
@@ -108,6 +117,7 @@ CONFIG_CPU_HAS_SYNC=y | |||
108 | CONFIG_GENERIC_HARDIRQS=y | 117 | CONFIG_GENERIC_HARDIRQS=y |
109 | CONFIG_GENERIC_IRQ_PROBE=y | 118 | CONFIG_GENERIC_IRQ_PROBE=y |
110 | CONFIG_ARCH_FLATMEM_ENABLE=y | 119 | CONFIG_ARCH_FLATMEM_ENABLE=y |
120 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
111 | CONFIG_SELECT_MEMORY_MODEL=y | 121 | CONFIG_SELECT_MEMORY_MODEL=y |
112 | CONFIG_FLATMEM_MANUAL=y | 122 | CONFIG_FLATMEM_MANUAL=y |
113 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 123 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -115,10 +125,16 @@ CONFIG_FLATMEM_MANUAL=y | |||
115 | CONFIG_FLATMEM=y | 125 | CONFIG_FLATMEM=y |
116 | CONFIG_FLAT_NODE_MEM_MAP=y | 126 | CONFIG_FLAT_NODE_MEM_MAP=y |
117 | # CONFIG_SPARSEMEM_STATIC is not set | 127 | # CONFIG_SPARSEMEM_STATIC is not set |
128 | # CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | ||
129 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
118 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 130 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
119 | # CONFIG_RESOURCES_64BIT is not set | 131 | # CONFIG_RESOURCES_64BIT is not set |
120 | CONFIG_ZONE_DMA_FLAG=0 | 132 | CONFIG_ZONE_DMA_FLAG=0 |
121 | CONFIG_VIRT_TO_BUS=y | 133 | CONFIG_VIRT_TO_BUS=y |
134 | # CONFIG_TICK_ONESHOT is not set | ||
135 | # CONFIG_NO_HZ is not set | ||
136 | # CONFIG_HIGH_RES_TIMERS is not set | ||
137 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
122 | # CONFIG_HZ_48 is not set | 138 | # CONFIG_HZ_48 is not set |
123 | # CONFIG_HZ_100 is not set | 139 | # CONFIG_HZ_100 is not set |
124 | # CONFIG_HZ_128 is not set | 140 | # CONFIG_HZ_128 is not set |
@@ -151,23 +167,28 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
151 | # CONFIG_POSIX_MQUEUE is not set | 167 | # CONFIG_POSIX_MQUEUE is not set |
152 | # CONFIG_BSD_PROCESS_ACCT is not set | 168 | # CONFIG_BSD_PROCESS_ACCT is not set |
153 | # CONFIG_TASKSTATS is not set | 169 | # CONFIG_TASKSTATS is not set |
154 | # CONFIG_USER_NS is not set | ||
155 | # CONFIG_AUDIT is not set | 170 | # CONFIG_AUDIT is not set |
156 | # CONFIG_IKCONFIG is not set | 171 | # CONFIG_IKCONFIG is not set |
157 | CONFIG_LOG_BUF_SHIFT=14 | 172 | CONFIG_LOG_BUF_SHIFT=14 |
158 | CONFIG_SYSFS_DEPRECATED=y | 173 | # CONFIG_CGROUPS is not set |
174 | # CONFIG_GROUP_SCHED is not set | ||
175 | # CONFIG_SYSFS_DEPRECATED_V2 is not set | ||
159 | CONFIG_RELAY=y | 176 | CONFIG_RELAY=y |
177 | # CONFIG_NAMESPACES is not set | ||
160 | # CONFIG_BLK_DEV_INITRD is not set | 178 | # CONFIG_BLK_DEV_INITRD is not set |
161 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | 179 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set |
162 | CONFIG_SYSCTL=y | 180 | CONFIG_SYSCTL=y |
163 | CONFIG_EMBEDDED=y | 181 | CONFIG_EMBEDDED=y |
164 | CONFIG_SYSCTL_SYSCALL=y | 182 | CONFIG_SYSCTL_SYSCALL=y |
183 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
165 | CONFIG_KALLSYMS=y | 184 | CONFIG_KALLSYMS=y |
166 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 185 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
167 | CONFIG_HOTPLUG=y | 186 | CONFIG_HOTPLUG=y |
168 | CONFIG_PRINTK=y | 187 | CONFIG_PRINTK=y |
169 | CONFIG_BUG=y | 188 | CONFIG_BUG=y |
170 | CONFIG_ELF_CORE=y | 189 | CONFIG_ELF_CORE=y |
190 | CONFIG_PCSPKR_PLATFORM=y | ||
191 | CONFIG_COMPAT_BRK=y | ||
171 | CONFIG_BASE_FULL=y | 192 | CONFIG_BASE_FULL=y |
172 | CONFIG_FUTEX=y | 193 | CONFIG_FUTEX=y |
173 | CONFIG_ANON_INODES=y | 194 | CONFIG_ANON_INODES=y |
@@ -177,23 +198,37 @@ CONFIG_TIMERFD=y | |||
177 | CONFIG_EVENTFD=y | 198 | CONFIG_EVENTFD=y |
178 | CONFIG_SHMEM=y | 199 | CONFIG_SHMEM=y |
179 | CONFIG_VM_EVENT_COUNTERS=y | 200 | CONFIG_VM_EVENT_COUNTERS=y |
180 | CONFIG_SLAB=y | 201 | CONFIG_SLUB_DEBUG=y |
181 | # CONFIG_SLUB is not set | 202 | # CONFIG_SLAB is not set |
203 | CONFIG_SLUB=y | ||
182 | # CONFIG_SLOB is not set | 204 | # CONFIG_SLOB is not set |
205 | # CONFIG_PROFILING is not set | ||
206 | # CONFIG_MARKERS is not set | ||
207 | CONFIG_HAVE_OPROFILE=y | ||
208 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
209 | # CONFIG_HAVE_KPROBES is not set | ||
210 | # CONFIG_HAVE_KRETPROBES is not set | ||
211 | # CONFIG_HAVE_DMA_ATTRS is not set | ||
212 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
213 | # CONFIG_HAVE_CLK is not set | ||
214 | CONFIG_PROC_PAGE_MONITOR=y | ||
215 | CONFIG_SLABINFO=y | ||
183 | CONFIG_RT_MUTEXES=y | 216 | CONFIG_RT_MUTEXES=y |
184 | # CONFIG_TINY_SHMEM is not set | 217 | # CONFIG_TINY_SHMEM is not set |
185 | CONFIG_BASE_SMALL=0 | 218 | CONFIG_BASE_SMALL=0 |
186 | CONFIG_MODULES=y | 219 | CONFIG_MODULES=y |
220 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
187 | CONFIG_MODULE_UNLOAD=y | 221 | CONFIG_MODULE_UNLOAD=y |
188 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 222 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
189 | # CONFIG_MODVERSIONS is not set | 223 | # CONFIG_MODVERSIONS is not set |
190 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 224 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
191 | # CONFIG_KMOD is not set | 225 | CONFIG_KMOD=y |
192 | CONFIG_BLOCK=y | 226 | CONFIG_BLOCK=y |
193 | # CONFIG_LBD is not set | 227 | # CONFIG_LBD is not set |
194 | # CONFIG_BLK_DEV_IO_TRACE is not set | 228 | # CONFIG_BLK_DEV_IO_TRACE is not set |
195 | # CONFIG_LSF is not set | 229 | # CONFIG_LSF is not set |
196 | # CONFIG_BLK_DEV_BSG is not set | 230 | # CONFIG_BLK_DEV_BSG is not set |
231 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
197 | 232 | ||
198 | # | 233 | # |
199 | # IO Schedulers | 234 | # IO Schedulers |
@@ -207,18 +242,18 @@ CONFIG_DEFAULT_AS=y | |||
207 | # CONFIG_DEFAULT_CFQ is not set | 242 | # CONFIG_DEFAULT_CFQ is not set |
208 | # CONFIG_DEFAULT_NOOP is not set | 243 | # CONFIG_DEFAULT_NOOP is not set |
209 | CONFIG_DEFAULT_IOSCHED="anticipatory" | 244 | CONFIG_DEFAULT_IOSCHED="anticipatory" |
245 | CONFIG_CLASSIC_RCU=y | ||
210 | 246 | ||
211 | # | 247 | # |
212 | # Bus options (PCI, PCMCIA, EISA, ISA, TC) | 248 | # Bus options (PCI, PCMCIA, EISA, ISA, TC) |
213 | # | 249 | # |
214 | CONFIG_HW_HAS_PCI=y | 250 | CONFIG_HW_HAS_PCI=y |
215 | CONFIG_PCI=y | 251 | CONFIG_PCI=y |
252 | CONFIG_PCI_DOMAINS=y | ||
216 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 253 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
254 | CONFIG_PCI_LEGACY=y | ||
217 | CONFIG_MMU=y | 255 | CONFIG_MMU=y |
218 | 256 | CONFIG_I8253=y | |
219 | # | ||
220 | # PCCARD (PCMCIA/CardBus) support | ||
221 | # | ||
222 | # CONFIG_PCCARD is not set | 257 | # CONFIG_PCCARD is not set |
223 | # CONFIG_HOTPLUG_PCI is not set | 258 | # CONFIG_HOTPLUG_PCI is not set |
224 | 259 | ||
@@ -232,8 +267,8 @@ CONFIG_TRAD_SIGNALS=y | |||
232 | # | 267 | # |
233 | # Power management options | 268 | # Power management options |
234 | # | 269 | # |
270 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
235 | # CONFIG_PM is not set | 271 | # CONFIG_PM is not set |
236 | CONFIG_SUSPEND_UP_POSSIBLE=y | ||
237 | 272 | ||
238 | # | 273 | # |
239 | # Networking | 274 | # Networking |
@@ -250,6 +285,7 @@ CONFIG_XFRM=y | |||
250 | CONFIG_XFRM_USER=y | 285 | CONFIG_XFRM_USER=y |
251 | # CONFIG_XFRM_SUB_POLICY is not set | 286 | # CONFIG_XFRM_SUB_POLICY is not set |
252 | CONFIG_XFRM_MIGRATE=y | 287 | CONFIG_XFRM_MIGRATE=y |
288 | # CONFIG_XFRM_STATISTICS is not set | ||
253 | CONFIG_NET_KEY=y | 289 | CONFIG_NET_KEY=y |
254 | CONFIG_NET_KEY_MIGRATE=y | 290 | CONFIG_NET_KEY_MIGRATE=y |
255 | CONFIG_INET=y | 291 | CONFIG_INET=y |
@@ -269,6 +305,7 @@ CONFIG_IP_FIB_HASH=y | |||
269 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | 305 | CONFIG_INET_XFRM_MODE_TRANSPORT=y |
270 | CONFIG_INET_XFRM_MODE_TUNNEL=y | 306 | CONFIG_INET_XFRM_MODE_TUNNEL=y |
271 | CONFIG_INET_XFRM_MODE_BEET=y | 307 | CONFIG_INET_XFRM_MODE_BEET=y |
308 | # CONFIG_INET_LRO is not set | ||
272 | CONFIG_INET_DIAG=y | 309 | CONFIG_INET_DIAG=y |
273 | CONFIG_INET_TCP_DIAG=y | 310 | CONFIG_INET_TCP_DIAG=y |
274 | # CONFIG_TCP_CONG_ADVANCED is not set | 311 | # CONFIG_TCP_CONG_ADVANCED is not set |
@@ -276,8 +313,6 @@ CONFIG_TCP_CONG_CUBIC=y | |||
276 | CONFIG_DEFAULT_TCP_CONG="cubic" | 313 | CONFIG_DEFAULT_TCP_CONG="cubic" |
277 | # CONFIG_TCP_MD5SIG is not set | 314 | # CONFIG_TCP_MD5SIG is not set |
278 | # CONFIG_IPV6 is not set | 315 | # CONFIG_IPV6 is not set |
279 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
280 | # CONFIG_INET6_TUNNEL is not set | ||
281 | # CONFIG_NETWORK_SECMARK is not set | 316 | # CONFIG_NETWORK_SECMARK is not set |
282 | # CONFIG_NETFILTER is not set | 317 | # CONFIG_NETFILTER is not set |
283 | # CONFIG_IP_DCCP is not set | 318 | # CONFIG_IP_DCCP is not set |
@@ -294,10 +329,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
294 | # CONFIG_LAPB is not set | 329 | # CONFIG_LAPB is not set |
295 | # CONFIG_ECONET is not set | 330 | # CONFIG_ECONET is not set |
296 | # CONFIG_WAN_ROUTER is not set | 331 | # CONFIG_WAN_ROUTER is not set |
297 | |||
298 | # | ||
299 | # QoS and/or fair queueing | ||
300 | # | ||
301 | # CONFIG_NET_SCHED is not set | 332 | # CONFIG_NET_SCHED is not set |
302 | 333 | ||
303 | # | 334 | # |
@@ -305,6 +336,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
305 | # | 336 | # |
306 | # CONFIG_NET_PKTGEN is not set | 337 | # CONFIG_NET_PKTGEN is not set |
307 | # CONFIG_HAMRADIO is not set | 338 | # CONFIG_HAMRADIO is not set |
339 | # CONFIG_CAN is not set | ||
308 | # CONFIG_IRDA is not set | 340 | # CONFIG_IRDA is not set |
309 | # CONFIG_BT is not set | 341 | # CONFIG_BT is not set |
310 | # CONFIG_AF_RXRPC is not set | 342 | # CONFIG_AF_RXRPC is not set |
@@ -326,9 +358,12 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
326 | # | 358 | # |
327 | # Generic Driver Options | 359 | # Generic Driver Options |
328 | # | 360 | # |
361 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
329 | CONFIG_STANDALONE=y | 362 | CONFIG_STANDALONE=y |
330 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 363 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
331 | CONFIG_FW_LOADER=y | 364 | CONFIG_FW_LOADER=y |
365 | CONFIG_FIRMWARE_IN_KERNEL=y | ||
366 | CONFIG_EXTRA_FIRMWARE="" | ||
332 | # CONFIG_SYS_HYPERVISOR is not set | 367 | # CONFIG_SYS_HYPERVISOR is not set |
333 | # CONFIG_CONNECTOR is not set | 368 | # CONFIG_CONNECTOR is not set |
334 | CONFIG_MTD=y | 369 | CONFIG_MTD=y |
@@ -337,6 +372,7 @@ CONFIG_MTD=y | |||
337 | CONFIG_MTD_PARTITIONS=y | 372 | CONFIG_MTD_PARTITIONS=y |
338 | # CONFIG_MTD_REDBOOT_PARTS is not set | 373 | # CONFIG_MTD_REDBOOT_PARTS is not set |
339 | # CONFIG_MTD_CMDLINE_PARTS is not set | 374 | # CONFIG_MTD_CMDLINE_PARTS is not set |
375 | # CONFIG_MTD_AR7_PARTS is not set | ||
340 | 376 | ||
341 | # | 377 | # |
342 | # User Modules And Translation Layers | 378 | # User Modules And Translation Layers |
@@ -350,6 +386,7 @@ CONFIG_MTD_BLKDEVS=y | |||
350 | # CONFIG_INFTL is not set | 386 | # CONFIG_INFTL is not set |
351 | # CONFIG_RFD_FTL is not set | 387 | # CONFIG_RFD_FTL is not set |
352 | # CONFIG_SSFDC is not set | 388 | # CONFIG_SSFDC is not set |
389 | # CONFIG_MTD_OOPS is not set | ||
353 | 390 | ||
354 | # | 391 | # |
355 | # RAM/ROM/Flash chip drivers | 392 | # RAM/ROM/Flash chip drivers |
@@ -384,6 +421,7 @@ CONFIG_MTD_PHYSMAP=y | |||
384 | CONFIG_MTD_PHYSMAP_START=0x0 | 421 | CONFIG_MTD_PHYSMAP_START=0x0 |
385 | CONFIG_MTD_PHYSMAP_LEN=0x0 | 422 | CONFIG_MTD_PHYSMAP_LEN=0x0 |
386 | CONFIG_MTD_PHYSMAP_BANKWIDTH=0 | 423 | CONFIG_MTD_PHYSMAP_BANKWIDTH=0 |
424 | # CONFIG_MTD_INTEL_VR_NOR is not set | ||
387 | # CONFIG_MTD_PLATRAM is not set | 425 | # CONFIG_MTD_PLATRAM is not set |
388 | 426 | ||
389 | # | 427 | # |
@@ -423,7 +461,9 @@ CONFIG_BLK_DEV_LOOP=y | |||
423 | # CONFIG_BLK_DEV_RAM is not set | 461 | # CONFIG_BLK_DEV_RAM is not set |
424 | # CONFIG_CDROM_PKTCDVD is not set | 462 | # CONFIG_CDROM_PKTCDVD is not set |
425 | # CONFIG_ATA_OVER_ETH is not set | 463 | # CONFIG_ATA_OVER_ETH is not set |
464 | # CONFIG_BLK_DEV_HD is not set | ||
426 | # CONFIG_MISC_DEVICES is not set | 465 | # CONFIG_MISC_DEVICES is not set |
466 | CONFIG_HAVE_IDE=y | ||
427 | # CONFIG_IDE is not set | 467 | # CONFIG_IDE is not set |
428 | 468 | ||
429 | # | 469 | # |
@@ -462,10 +502,15 @@ CONFIG_SCSI_WAIT_SCAN=m | |||
462 | # CONFIG_SCSI_FC_ATTRS is not set | 502 | # CONFIG_SCSI_FC_ATTRS is not set |
463 | # CONFIG_SCSI_ISCSI_ATTRS is not set | 503 | # CONFIG_SCSI_ISCSI_ATTRS is not set |
464 | # CONFIG_SCSI_SAS_LIBSAS is not set | 504 | # CONFIG_SCSI_SAS_LIBSAS is not set |
505 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
465 | # CONFIG_SCSI_LOWLEVEL is not set | 506 | # CONFIG_SCSI_LOWLEVEL is not set |
507 | # CONFIG_SCSI_DH is not set | ||
466 | CONFIG_ATA=y | 508 | CONFIG_ATA=y |
467 | # CONFIG_ATA_NONSTANDARD is not set | 509 | # CONFIG_ATA_NONSTANDARD is not set |
510 | CONFIG_SATA_PMP=y | ||
468 | # CONFIG_SATA_AHCI is not set | 511 | # CONFIG_SATA_AHCI is not set |
512 | # CONFIG_SATA_SIL24 is not set | ||
513 | CONFIG_ATA_SFF=y | ||
469 | # CONFIG_SATA_SVW is not set | 514 | # CONFIG_SATA_SVW is not set |
470 | # CONFIG_ATA_PIIX is not set | 515 | # CONFIG_ATA_PIIX is not set |
471 | # CONFIG_SATA_MV is not set | 516 | # CONFIG_SATA_MV is not set |
@@ -475,7 +520,6 @@ CONFIG_ATA=y | |||
475 | # CONFIG_SATA_PROMISE is not set | 520 | # CONFIG_SATA_PROMISE is not set |
476 | # CONFIG_SATA_SX4 is not set | 521 | # CONFIG_SATA_SX4 is not set |
477 | # CONFIG_SATA_SIL is not set | 522 | # CONFIG_SATA_SIL is not set |
478 | # CONFIG_SATA_SIL24 is not set | ||
479 | # CONFIG_SATA_SIS is not set | 523 | # CONFIG_SATA_SIS is not set |
480 | # CONFIG_SATA_ULI is not set | 524 | # CONFIG_SATA_ULI is not set |
481 | # CONFIG_SATA_VIA is not set | 525 | # CONFIG_SATA_VIA is not set |
@@ -504,7 +548,9 @@ CONFIG_ATA=y | |||
504 | # CONFIG_PATA_MPIIX is not set | 548 | # CONFIG_PATA_MPIIX is not set |
505 | # CONFIG_PATA_OLDPIIX is not set | 549 | # CONFIG_PATA_OLDPIIX is not set |
506 | # CONFIG_PATA_NETCELL is not set | 550 | # CONFIG_PATA_NETCELL is not set |
551 | # CONFIG_PATA_NINJA32 is not set | ||
507 | # CONFIG_PATA_NS87410 is not set | 552 | # CONFIG_PATA_NS87410 is not set |
553 | # CONFIG_PATA_NS87415 is not set | ||
508 | # CONFIG_PATA_OPTI is not set | 554 | # CONFIG_PATA_OPTI is not set |
509 | # CONFIG_PATA_OPTIDMA is not set | 555 | # CONFIG_PATA_OPTIDMA is not set |
510 | # CONFIG_PATA_PDC_OLD is not set | 556 | # CONFIG_PATA_PDC_OLD is not set |
@@ -518,29 +564,27 @@ CONFIG_ATA=y | |||
518 | CONFIG_PATA_VIA=y | 564 | CONFIG_PATA_VIA=y |
519 | # CONFIG_PATA_WINBOND is not set | 565 | # CONFIG_PATA_WINBOND is not set |
520 | # CONFIG_PATA_PLATFORM is not set | 566 | # CONFIG_PATA_PLATFORM is not set |
567 | # CONFIG_PATA_SCH is not set | ||
521 | # CONFIG_MD is not set | 568 | # CONFIG_MD is not set |
569 | # CONFIG_FUSION is not set | ||
522 | 570 | ||
523 | # | 571 | # |
524 | # Fusion MPT device support | 572 | # IEEE 1394 (FireWire) support |
525 | # | 573 | # |
526 | # CONFIG_FUSION is not set | ||
527 | # CONFIG_FUSION_SPI is not set | ||
528 | # CONFIG_FUSION_FC is not set | ||
529 | # CONFIG_FUSION_SAS is not set | ||
530 | 574 | ||
531 | # | 575 | # |
532 | # IEEE 1394 (FireWire) support | 576 | # Enable only one of the two stacks, unless you know what you are doing |
533 | # | 577 | # |
534 | # CONFIG_FIREWIRE is not set | 578 | # CONFIG_FIREWIRE is not set |
535 | # CONFIG_IEEE1394 is not set | 579 | # CONFIG_IEEE1394 is not set |
536 | # CONFIG_I2O is not set | 580 | # CONFIG_I2O is not set |
537 | CONFIG_NETDEVICES=y | 581 | CONFIG_NETDEVICES=y |
538 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
539 | # CONFIG_DUMMY is not set | 582 | # CONFIG_DUMMY is not set |
540 | # CONFIG_BONDING is not set | 583 | # CONFIG_BONDING is not set |
541 | # CONFIG_MACVLAN is not set | 584 | # CONFIG_MACVLAN is not set |
542 | # CONFIG_EQUALIZER is not set | 585 | # CONFIG_EQUALIZER is not set |
543 | # CONFIG_TUN is not set | 586 | # CONFIG_TUN is not set |
587 | # CONFIG_VETH is not set | ||
544 | # CONFIG_ARCNET is not set | 588 | # CONFIG_ARCNET is not set |
545 | # CONFIG_PHYLIB is not set | 589 | # CONFIG_PHYLIB is not set |
546 | CONFIG_NET_ETHERNET=y | 590 | CONFIG_NET_ETHERNET=y |
@@ -562,7 +606,12 @@ CONFIG_TULIP=y | |||
562 | # CONFIG_DM9102 is not set | 606 | # CONFIG_DM9102 is not set |
563 | # CONFIG_ULI526X is not set | 607 | # CONFIG_ULI526X is not set |
564 | # CONFIG_HP100 is not set | 608 | # CONFIG_HP100 is not set |
609 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
610 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
611 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
612 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
565 | # CONFIG_NET_PCI is not set | 613 | # CONFIG_NET_PCI is not set |
614 | # CONFIG_B44 is not set | ||
566 | # CONFIG_NETDEV_1000 is not set | 615 | # CONFIG_NETDEV_1000 is not set |
567 | # CONFIG_NETDEV_10000 is not set | 616 | # CONFIG_NETDEV_10000 is not set |
568 | # CONFIG_TR is not set | 617 | # CONFIG_TR is not set |
@@ -572,6 +621,7 @@ CONFIG_TULIP=y | |||
572 | # | 621 | # |
573 | # CONFIG_WLAN_PRE80211 is not set | 622 | # CONFIG_WLAN_PRE80211 is not set |
574 | # CONFIG_WLAN_80211 is not set | 623 | # CONFIG_WLAN_80211 is not set |
624 | # CONFIG_IWLWIFI_LEDS is not set | ||
575 | 625 | ||
576 | # | 626 | # |
577 | # USB Network Adapters | 627 | # USB Network Adapters |
@@ -580,7 +630,6 @@ CONFIG_TULIP=y | |||
580 | # CONFIG_USB_KAWETH is not set | 630 | # CONFIG_USB_KAWETH is not set |
581 | # CONFIG_USB_PEGASUS is not set | 631 | # CONFIG_USB_PEGASUS is not set |
582 | # CONFIG_USB_RTL8150 is not set | 632 | # CONFIG_USB_RTL8150 is not set |
583 | # CONFIG_USB_USBNET_MII is not set | ||
584 | # CONFIG_USB_USBNET is not set | 633 | # CONFIG_USB_USBNET is not set |
585 | # CONFIG_WAN is not set | 634 | # CONFIG_WAN is not set |
586 | # CONFIG_FDDI is not set | 635 | # CONFIG_FDDI is not set |
@@ -588,7 +637,6 @@ CONFIG_TULIP=y | |||
588 | # CONFIG_PPP is not set | 637 | # CONFIG_PPP is not set |
589 | # CONFIG_SLIP is not set | 638 | # CONFIG_SLIP is not set |
590 | # CONFIG_NET_FC is not set | 639 | # CONFIG_NET_FC is not set |
591 | # CONFIG_SHAPER is not set | ||
592 | # CONFIG_NETCONSOLE is not set | 640 | # CONFIG_NETCONSOLE is not set |
593 | # CONFIG_NETPOLL is not set | 641 | # CONFIG_NETPOLL is not set |
594 | # CONFIG_NET_POLL_CONTROLLER is not set | 642 | # CONFIG_NET_POLL_CONTROLLER is not set |
@@ -607,7 +655,6 @@ CONFIG_INPUT_POLLDEV=y | |||
607 | # | 655 | # |
608 | # CONFIG_INPUT_MOUSEDEV is not set | 656 | # CONFIG_INPUT_MOUSEDEV is not set |
609 | # CONFIG_INPUT_JOYDEV is not set | 657 | # CONFIG_INPUT_JOYDEV is not set |
610 | # CONFIG_INPUT_TSDEV is not set | ||
611 | CONFIG_INPUT_EVDEV=y | 658 | CONFIG_INPUT_EVDEV=y |
612 | # CONFIG_INPUT_EVBUG is not set | 659 | # CONFIG_INPUT_EVBUG is not set |
613 | 660 | ||
@@ -642,7 +689,9 @@ CONFIG_VT=y | |||
642 | CONFIG_VT_CONSOLE=y | 689 | CONFIG_VT_CONSOLE=y |
643 | CONFIG_HW_CONSOLE=y | 690 | CONFIG_HW_CONSOLE=y |
644 | CONFIG_VT_HW_CONSOLE_BINDING=y | 691 | CONFIG_VT_HW_CONSOLE_BINDING=y |
692 | CONFIG_DEVKMEM=y | ||
645 | # CONFIG_SERIAL_NONSTANDARD is not set | 693 | # CONFIG_SERIAL_NONSTANDARD is not set |
694 | # CONFIG_NOZOMI is not set | ||
646 | 695 | ||
647 | # | 696 | # |
648 | # Serial drivers | 697 | # Serial drivers |
@@ -664,65 +713,122 @@ CONFIG_UNIX98_PTYS=y | |||
664 | CONFIG_LEGACY_PTYS=y | 713 | CONFIG_LEGACY_PTYS=y |
665 | CONFIG_LEGACY_PTY_COUNT=256 | 714 | CONFIG_LEGACY_PTY_COUNT=256 |
666 | # CONFIG_IPMI_HANDLER is not set | 715 | # CONFIG_IPMI_HANDLER is not set |
667 | # CONFIG_WATCHDOG is not set | ||
668 | # CONFIG_HW_RANDOM is not set | 716 | # CONFIG_HW_RANDOM is not set |
669 | # CONFIG_RTC is not set | ||
670 | CONFIG_COBALT_LCD=y | ||
671 | # CONFIG_R3964 is not set | 717 | # CONFIG_R3964 is not set |
672 | # CONFIG_APPLICOM is not set | 718 | # CONFIG_APPLICOM is not set |
673 | # CONFIG_DRM is not set | ||
674 | # CONFIG_RAW_DRIVER is not set | 719 | # CONFIG_RAW_DRIVER is not set |
675 | # CONFIG_TCG_TPM is not set | 720 | # CONFIG_TCG_TPM is not set |
676 | CONFIG_DEVPORT=y | 721 | CONFIG_DEVPORT=y |
677 | # CONFIG_I2C is not set | 722 | # CONFIG_I2C is not set |
678 | |||
679 | # | ||
680 | # SPI support | ||
681 | # | ||
682 | # CONFIG_SPI is not set | 723 | # CONFIG_SPI is not set |
683 | # CONFIG_SPI_MASTER is not set | ||
684 | # CONFIG_W1 is not set | 724 | # CONFIG_W1 is not set |
685 | # CONFIG_POWER_SUPPLY is not set | 725 | # CONFIG_POWER_SUPPLY is not set |
686 | # CONFIG_HWMON is not set | 726 | # CONFIG_HWMON is not set |
727 | # CONFIG_THERMAL is not set | ||
728 | # CONFIG_THERMAL_HWMON is not set | ||
729 | # CONFIG_WATCHDOG is not set | ||
730 | |||
731 | # | ||
732 | # Sonics Silicon Backplane | ||
733 | # | ||
734 | CONFIG_SSB_POSSIBLE=y | ||
735 | # CONFIG_SSB is not set | ||
687 | 736 | ||
688 | # | 737 | # |
689 | # Multifunction device drivers | 738 | # Multifunction device drivers |
690 | # | 739 | # |
740 | # CONFIG_MFD_CORE is not set | ||
691 | # CONFIG_MFD_SM501 is not set | 741 | # CONFIG_MFD_SM501 is not set |
742 | # CONFIG_HTC_PASIC3 is not set | ||
692 | 743 | ||
693 | # | 744 | # |
694 | # Multimedia devices | 745 | # Multimedia devices |
695 | # | 746 | # |
747 | |||
748 | # | ||
749 | # Multimedia core support | ||
750 | # | ||
696 | # CONFIG_VIDEO_DEV is not set | 751 | # CONFIG_VIDEO_DEV is not set |
697 | # CONFIG_DVB_CORE is not set | 752 | # CONFIG_DVB_CORE is not set |
753 | # CONFIG_VIDEO_MEDIA is not set | ||
754 | |||
755 | # | ||
756 | # Multimedia drivers | ||
757 | # | ||
698 | # CONFIG_DAB is not set | 758 | # CONFIG_DAB is not set |
699 | 759 | ||
700 | # | 760 | # |
701 | # Graphics support | 761 | # Graphics support |
702 | # | 762 | # |
763 | # CONFIG_DRM is not set | ||
764 | # CONFIG_VGASTATE is not set | ||
765 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
766 | CONFIG_FB=y | ||
767 | # CONFIG_FIRMWARE_EDID is not set | ||
768 | # CONFIG_FB_DDC is not set | ||
769 | # CONFIG_FB_CFB_FILLRECT is not set | ||
770 | # CONFIG_FB_CFB_COPYAREA is not set | ||
771 | # CONFIG_FB_CFB_IMAGEBLIT is not set | ||
772 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
773 | # CONFIG_FB_SYS_FILLRECT is not set | ||
774 | # CONFIG_FB_SYS_COPYAREA is not set | ||
775 | # CONFIG_FB_SYS_IMAGEBLIT is not set | ||
776 | # CONFIG_FB_FOREIGN_ENDIAN is not set | ||
777 | # CONFIG_FB_SYS_FOPS is not set | ||
778 | # CONFIG_FB_SVGALIB is not set | ||
779 | # CONFIG_FB_MACMODES is not set | ||
780 | # CONFIG_FB_BACKLIGHT is not set | ||
781 | # CONFIG_FB_MODE_HELPERS is not set | ||
782 | # CONFIG_FB_TILEBLITTING is not set | ||
783 | |||
784 | # | ||
785 | # Frame buffer hardware drivers | ||
786 | # | ||
787 | # CONFIG_FB_CIRRUS is not set | ||
788 | # CONFIG_FB_PM2 is not set | ||
789 | # CONFIG_FB_CYBER2000 is not set | ||
790 | # CONFIG_FB_ASILIANT is not set | ||
791 | # CONFIG_FB_IMSTT is not set | ||
792 | # CONFIG_FB_S1D13XXX is not set | ||
793 | # CONFIG_FB_NVIDIA is not set | ||
794 | # CONFIG_FB_RIVA is not set | ||
795 | # CONFIG_FB_MATROX is not set | ||
796 | # CONFIG_FB_RADEON is not set | ||
797 | # CONFIG_FB_ATY128 is not set | ||
798 | # CONFIG_FB_ATY is not set | ||
799 | # CONFIG_FB_S3 is not set | ||
800 | # CONFIG_FB_SAVAGE is not set | ||
801 | # CONFIG_FB_SIS is not set | ||
802 | # CONFIG_FB_NEOMAGIC is not set | ||
803 | # CONFIG_FB_KYRO is not set | ||
804 | # CONFIG_FB_3DFX is not set | ||
805 | # CONFIG_FB_VOODOO1 is not set | ||
806 | # CONFIG_FB_VT8623 is not set | ||
807 | # CONFIG_FB_TRIDENT is not set | ||
808 | # CONFIG_FB_ARK is not set | ||
809 | # CONFIG_FB_PM3 is not set | ||
810 | # CONFIG_FB_CARMINE is not set | ||
811 | CONFIG_FB_COBALT=y | ||
812 | # CONFIG_FB_VIRTUAL is not set | ||
703 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 813 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
704 | 814 | ||
705 | # | 815 | # |
706 | # Display device support | 816 | # Display device support |
707 | # | 817 | # |
708 | # CONFIG_DISPLAY_SUPPORT is not set | 818 | # CONFIG_DISPLAY_SUPPORT is not set |
709 | # CONFIG_VGASTATE is not set | ||
710 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
711 | # CONFIG_FB is not set | ||
712 | 819 | ||
713 | # | 820 | # |
714 | # Console display driver support | 821 | # Console display driver support |
715 | # | 822 | # |
716 | # CONFIG_VGA_CONSOLE is not set | 823 | # CONFIG_VGA_CONSOLE is not set |
717 | CONFIG_DUMMY_CONSOLE=y | 824 | CONFIG_DUMMY_CONSOLE=y |
718 | 825 | # CONFIG_FRAMEBUFFER_CONSOLE is not set | |
719 | # | 826 | # CONFIG_LOGO is not set |
720 | # Sound | ||
721 | # | ||
722 | # CONFIG_SOUND is not set | 827 | # CONFIG_SOUND is not set |
723 | CONFIG_HID_SUPPORT=y | 828 | CONFIG_HID_SUPPORT=y |
724 | CONFIG_HID=m | 829 | CONFIG_HID=m |
725 | # CONFIG_HID_DEBUG is not set | 830 | # CONFIG_HID_DEBUG is not set |
831 | # CONFIG_HIDRAW is not set | ||
726 | 832 | ||
727 | # | 833 | # |
728 | # USB Input Devices | 834 | # USB Input Devices |
@@ -743,6 +849,7 @@ CONFIG_USB_ARCH_HAS_OHCI=y | |||
743 | CONFIG_USB_ARCH_HAS_EHCI=y | 849 | CONFIG_USB_ARCH_HAS_EHCI=y |
744 | CONFIG_USB=m | 850 | CONFIG_USB=m |
745 | # CONFIG_USB_DEBUG is not set | 851 | # CONFIG_USB_DEBUG is not set |
852 | # CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set | ||
746 | 853 | ||
747 | # | 854 | # |
748 | # Miscellaneous USB options | 855 | # Miscellaneous USB options |
@@ -751,15 +858,18 @@ CONFIG_USB=m | |||
751 | # CONFIG_USB_DEVICE_CLASS is not set | 858 | # CONFIG_USB_DEVICE_CLASS is not set |
752 | # CONFIG_USB_DYNAMIC_MINORS is not set | 859 | # CONFIG_USB_DYNAMIC_MINORS is not set |
753 | # CONFIG_USB_OTG is not set | 860 | # CONFIG_USB_OTG is not set |
861 | # CONFIG_USB_OTG_WHITELIST is not set | ||
862 | # CONFIG_USB_OTG_BLACKLIST_HUB is not set | ||
754 | 863 | ||
755 | # | 864 | # |
756 | # USB Host Controller Drivers | 865 | # USB Host Controller Drivers |
757 | # | 866 | # |
867 | # CONFIG_USB_C67X00_HCD is not set | ||
758 | CONFIG_USB_EHCI_HCD=m | 868 | CONFIG_USB_EHCI_HCD=m |
759 | # CONFIG_USB_EHCI_SPLIT_ISO is not set | ||
760 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set | 869 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set |
761 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | 870 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set |
762 | # CONFIG_USB_ISP116X_HCD is not set | 871 | # CONFIG_USB_ISP116X_HCD is not set |
872 | # CONFIG_USB_ISP1760_HCD is not set | ||
763 | CONFIG_USB_OHCI_HCD=m | 873 | CONFIG_USB_OHCI_HCD=m |
764 | # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set | 874 | # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set |
765 | # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set | 875 | # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set |
@@ -773,6 +883,7 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y | |||
773 | # | 883 | # |
774 | # CONFIG_USB_ACM is not set | 884 | # CONFIG_USB_ACM is not set |
775 | # CONFIG_USB_PRINTER is not set | 885 | # CONFIG_USB_PRINTER is not set |
886 | # CONFIG_USB_WDM is not set | ||
776 | 887 | ||
777 | # | 888 | # |
778 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | 889 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
@@ -785,6 +896,7 @@ CONFIG_USB_STORAGE=m | |||
785 | # CONFIG_USB_STORAGE_DEBUG is not set | 896 | # CONFIG_USB_STORAGE_DEBUG is not set |
786 | # CONFIG_USB_STORAGE_DATAFAB is not set | 897 | # CONFIG_USB_STORAGE_DATAFAB is not set |
787 | # CONFIG_USB_STORAGE_FREECOM is not set | 898 | # CONFIG_USB_STORAGE_FREECOM is not set |
899 | # CONFIG_USB_STORAGE_ISD200 is not set | ||
788 | # CONFIG_USB_STORAGE_DPCM is not set | 900 | # CONFIG_USB_STORAGE_DPCM is not set |
789 | # CONFIG_USB_STORAGE_USBAT is not set | 901 | # CONFIG_USB_STORAGE_USBAT is not set |
790 | # CONFIG_USB_STORAGE_SDDR09 is not set | 902 | # CONFIG_USB_STORAGE_SDDR09 is not set |
@@ -793,6 +905,7 @@ CONFIG_USB_STORAGE=m | |||
793 | # CONFIG_USB_STORAGE_ALAUDA is not set | 905 | # CONFIG_USB_STORAGE_ALAUDA is not set |
794 | # CONFIG_USB_STORAGE_ONETOUCH is not set | 906 | # CONFIG_USB_STORAGE_ONETOUCH is not set |
795 | # CONFIG_USB_STORAGE_KARMA is not set | 907 | # CONFIG_USB_STORAGE_KARMA is not set |
908 | # CONFIG_USB_STORAGE_CYPRESS_ATACB is not set | ||
796 | # CONFIG_USB_LIBUSUAL is not set | 909 | # CONFIG_USB_LIBUSUAL is not set |
797 | 910 | ||
798 | # | 911 | # |
@@ -800,15 +913,11 @@ CONFIG_USB_STORAGE=m | |||
800 | # | 913 | # |
801 | # CONFIG_USB_MDC800 is not set | 914 | # CONFIG_USB_MDC800 is not set |
802 | # CONFIG_USB_MICROTEK is not set | 915 | # CONFIG_USB_MICROTEK is not set |
803 | CONFIG_USB_MON=y | 916 | # CONFIG_USB_MON is not set |
804 | 917 | ||
805 | # | 918 | # |
806 | # USB port drivers | 919 | # USB port drivers |
807 | # | 920 | # |
808 | |||
809 | # | ||
810 | # USB Serial Converter support | ||
811 | # | ||
812 | # CONFIG_USB_SERIAL is not set | 921 | # CONFIG_USB_SERIAL is not set |
813 | 922 | ||
814 | # | 923 | # |
@@ -833,16 +942,10 @@ CONFIG_USB_MON=y | |||
833 | # CONFIG_USB_LD is not set | 942 | # CONFIG_USB_LD is not set |
834 | # CONFIG_USB_TRANCEVIBRATOR is not set | 943 | # CONFIG_USB_TRANCEVIBRATOR is not set |
835 | # CONFIG_USB_IOWARRIOR is not set | 944 | # CONFIG_USB_IOWARRIOR is not set |
836 | 945 | # CONFIG_USB_ISIGHTFW is not set | |
837 | # | ||
838 | # USB DSL modem support | ||
839 | # | ||
840 | |||
841 | # | ||
842 | # USB Gadget Support | ||
843 | # | ||
844 | # CONFIG_USB_GADGET is not set | 946 | # CONFIG_USB_GADGET is not set |
845 | # CONFIG_MMC is not set | 947 | # CONFIG_MMC is not set |
948 | # CONFIG_MEMSTICK is not set | ||
846 | CONFIG_NEW_LEDS=y | 949 | CONFIG_NEW_LEDS=y |
847 | CONFIG_LEDS_CLASS=y | 950 | CONFIG_LEDS_CLASS=y |
848 | 951 | ||
@@ -858,6 +961,8 @@ CONFIG_LEDS_COBALT_RAQ=y | |||
858 | CONFIG_LEDS_TRIGGERS=y | 961 | CONFIG_LEDS_TRIGGERS=y |
859 | # CONFIG_LEDS_TRIGGER_TIMER is not set | 962 | # CONFIG_LEDS_TRIGGER_TIMER is not set |
860 | # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set | 963 | # CONFIG_LEDS_TRIGGER_HEARTBEAT is not set |
964 | # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set | ||
965 | # CONFIG_ACCESSIBILITY is not set | ||
861 | # CONFIG_INFINIBAND is not set | 966 | # CONFIG_INFINIBAND is not set |
862 | CONFIG_RTC_LIB=y | 967 | CONFIG_RTC_LIB=y |
863 | CONFIG_RTC_CLASS=y | 968 | CONFIG_RTC_CLASS=y |
@@ -882,9 +987,10 @@ CONFIG_RTC_INTF_DEV=y | |||
882 | # Platform RTC drivers | 987 | # Platform RTC drivers |
883 | # | 988 | # |
884 | CONFIG_RTC_DRV_CMOS=y | 989 | CONFIG_RTC_DRV_CMOS=y |
990 | # CONFIG_RTC_DRV_DS1511 is not set | ||
885 | # CONFIG_RTC_DRV_DS1553 is not set | 991 | # CONFIG_RTC_DRV_DS1553 is not set |
886 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
887 | # CONFIG_RTC_DRV_DS1742 is not set | 992 | # CONFIG_RTC_DRV_DS1742 is not set |
993 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
888 | # CONFIG_RTC_DRV_M48T86 is not set | 994 | # CONFIG_RTC_DRV_M48T86 is not set |
889 | # CONFIG_RTC_DRV_M48T59 is not set | 995 | # CONFIG_RTC_DRV_M48T59 is not set |
890 | # CONFIG_RTC_DRV_V3020 is not set | 996 | # CONFIG_RTC_DRV_V3020 is not set |
@@ -892,23 +998,7 @@ CONFIG_RTC_DRV_CMOS=y | |||
892 | # | 998 | # |
893 | # on-CPU RTC drivers | 999 | # on-CPU RTC drivers |
894 | # | 1000 | # |
895 | 1001 | # CONFIG_DMADEVICES is not set | |
896 | # | ||
897 | # DMA Engine support | ||
898 | # | ||
899 | # CONFIG_DMA_ENGINE is not set | ||
900 | |||
901 | # | ||
902 | # DMA Clients | ||
903 | # | ||
904 | |||
905 | # | ||
906 | # DMA Devices | ||
907 | # | ||
908 | |||
909 | # | ||
910 | # Userspace I/O | ||
911 | # | ||
912 | # CONFIG_UIO is not set | 1002 | # CONFIG_UIO is not set |
913 | 1003 | ||
914 | # | 1004 | # |
@@ -923,22 +1013,22 @@ CONFIG_EXT3_FS=y | |||
923 | CONFIG_EXT3_FS_XATTR=y | 1013 | CONFIG_EXT3_FS_XATTR=y |
924 | CONFIG_EXT3_FS_POSIX_ACL=y | 1014 | CONFIG_EXT3_FS_POSIX_ACL=y |
925 | CONFIG_EXT3_FS_SECURITY=y | 1015 | CONFIG_EXT3_FS_SECURITY=y |
926 | # CONFIG_EXT4DEV_FS is not set | 1016 | CONFIG_EXT4DEV_FS=y |
1017 | CONFIG_EXT4DEV_FS_XATTR=y | ||
1018 | CONFIG_EXT4DEV_FS_POSIX_ACL=y | ||
1019 | CONFIG_EXT4DEV_FS_SECURITY=y | ||
927 | CONFIG_JBD=y | 1020 | CONFIG_JBD=y |
928 | # CONFIG_JBD_DEBUG is not set | 1021 | CONFIG_JBD2=y |
929 | CONFIG_FS_MBCACHE=y | 1022 | CONFIG_FS_MBCACHE=y |
930 | # CONFIG_REISERFS_FS is not set | 1023 | # CONFIG_REISERFS_FS is not set |
931 | # CONFIG_JFS_FS is not set | 1024 | # CONFIG_JFS_FS is not set |
932 | CONFIG_FS_POSIX_ACL=y | 1025 | CONFIG_FS_POSIX_ACL=y |
933 | # CONFIG_XFS_FS is not set | 1026 | # CONFIG_XFS_FS is not set |
934 | # CONFIG_GFS2_FS is not set | ||
935 | # CONFIG_OCFS2_FS is not set | 1027 | # CONFIG_OCFS2_FS is not set |
936 | # CONFIG_MINIX_FS is not set | 1028 | CONFIG_DNOTIFY=y |
937 | # CONFIG_ROMFS_FS is not set | ||
938 | CONFIG_INOTIFY=y | 1029 | CONFIG_INOTIFY=y |
939 | CONFIG_INOTIFY_USER=y | 1030 | CONFIG_INOTIFY_USER=y |
940 | # CONFIG_QUOTA is not set | 1031 | # CONFIG_QUOTA is not set |
941 | CONFIG_DNOTIFY=y | ||
942 | # CONFIG_AUTOFS_FS is not set | 1032 | # CONFIG_AUTOFS_FS is not set |
943 | # CONFIG_AUTOFS4_FS is not set | 1033 | # CONFIG_AUTOFS4_FS is not set |
944 | # CONFIG_FUSE_FS is not set | 1034 | # CONFIG_FUSE_FS is not set |
@@ -967,7 +1057,6 @@ CONFIG_SYSFS=y | |||
967 | CONFIG_TMPFS=y | 1057 | CONFIG_TMPFS=y |
968 | CONFIG_TMPFS_POSIX_ACL=y | 1058 | CONFIG_TMPFS_POSIX_ACL=y |
969 | # CONFIG_HUGETLB_PAGE is not set | 1059 | # CONFIG_HUGETLB_PAGE is not set |
970 | CONFIG_RAMFS=y | ||
971 | CONFIG_CONFIGFS_FS=y | 1060 | CONFIG_CONFIGFS_FS=y |
972 | 1061 | ||
973 | # | 1062 | # |
@@ -983,32 +1072,28 @@ CONFIG_CONFIGFS_FS=y | |||
983 | # CONFIG_JFFS2_FS is not set | 1072 | # CONFIG_JFFS2_FS is not set |
984 | # CONFIG_CRAMFS is not set | 1073 | # CONFIG_CRAMFS is not set |
985 | # CONFIG_VXFS_FS is not set | 1074 | # CONFIG_VXFS_FS is not set |
1075 | # CONFIG_MINIX_FS is not set | ||
986 | # CONFIG_HPFS_FS is not set | 1076 | # CONFIG_HPFS_FS is not set |
987 | # CONFIG_QNX4FS_FS is not set | 1077 | # CONFIG_QNX4FS_FS is not set |
1078 | # CONFIG_ROMFS_FS is not set | ||
988 | # CONFIG_SYSV_FS is not set | 1079 | # CONFIG_SYSV_FS is not set |
989 | # CONFIG_UFS_FS is not set | 1080 | # CONFIG_UFS_FS is not set |
990 | 1081 | CONFIG_NETWORK_FILESYSTEMS=y | |
991 | # | ||
992 | # Network File Systems | ||
993 | # | ||
994 | CONFIG_NFS_FS=y | 1082 | CONFIG_NFS_FS=y |
995 | CONFIG_NFS_V3=y | 1083 | CONFIG_NFS_V3=y |
996 | CONFIG_NFS_V3_ACL=y | 1084 | CONFIG_NFS_V3_ACL=y |
997 | # CONFIG_NFS_V4 is not set | 1085 | # CONFIG_NFS_V4 is not set |
998 | # CONFIG_NFS_DIRECTIO is not set | ||
999 | CONFIG_NFSD=y | 1086 | CONFIG_NFSD=y |
1000 | CONFIG_NFSD_V2_ACL=y | 1087 | CONFIG_NFSD_V2_ACL=y |
1001 | CONFIG_NFSD_V3=y | 1088 | CONFIG_NFSD_V3=y |
1002 | CONFIG_NFSD_V3_ACL=y | 1089 | CONFIG_NFSD_V3_ACL=y |
1003 | # CONFIG_NFSD_V4 is not set | 1090 | # CONFIG_NFSD_V4 is not set |
1004 | CONFIG_NFSD_TCP=y | ||
1005 | CONFIG_LOCKD=y | 1091 | CONFIG_LOCKD=y |
1006 | CONFIG_LOCKD_V4=y | 1092 | CONFIG_LOCKD_V4=y |
1007 | CONFIG_EXPORTFS=y | 1093 | CONFIG_EXPORTFS=y |
1008 | CONFIG_NFS_ACL_SUPPORT=y | 1094 | CONFIG_NFS_ACL_SUPPORT=y |
1009 | CONFIG_NFS_COMMON=y | 1095 | CONFIG_NFS_COMMON=y |
1010 | CONFIG_SUNRPC=y | 1096 | CONFIG_SUNRPC=y |
1011 | # CONFIG_SUNRPC_BIND34 is not set | ||
1012 | # CONFIG_RPCSEC_GSS_KRB5 is not set | 1097 | # CONFIG_RPCSEC_GSS_KRB5 is not set |
1013 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 1098 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
1014 | # CONFIG_SMB_FS is not set | 1099 | # CONFIG_SMB_FS is not set |
@@ -1022,34 +1107,26 @@ CONFIG_SUNRPC=y | |||
1022 | # | 1107 | # |
1023 | # CONFIG_PARTITION_ADVANCED is not set | 1108 | # CONFIG_PARTITION_ADVANCED is not set |
1024 | CONFIG_MSDOS_PARTITION=y | 1109 | CONFIG_MSDOS_PARTITION=y |
1025 | |||
1026 | # | ||
1027 | # Native Language Support | ||
1028 | # | ||
1029 | # CONFIG_NLS is not set | 1110 | # CONFIG_NLS is not set |
1030 | |||
1031 | # | ||
1032 | # Distributed Lock Manager | ||
1033 | # | ||
1034 | # CONFIG_DLM is not set | 1111 | # CONFIG_DLM is not set |
1035 | 1112 | ||
1036 | # | 1113 | # |
1037 | # Profiling support | ||
1038 | # | ||
1039 | # CONFIG_PROFILING is not set | ||
1040 | |||
1041 | # | ||
1042 | # Kernel hacking | 1114 | # Kernel hacking |
1043 | # | 1115 | # |
1044 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | 1116 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y |
1045 | # CONFIG_PRINTK_TIME is not set | 1117 | # CONFIG_PRINTK_TIME is not set |
1118 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1046 | CONFIG_ENABLE_MUST_CHECK=y | 1119 | CONFIG_ENABLE_MUST_CHECK=y |
1120 | CONFIG_FRAME_WARN=1024 | ||
1047 | # CONFIG_MAGIC_SYSRQ is not set | 1121 | # CONFIG_MAGIC_SYSRQ is not set |
1048 | # CONFIG_UNUSED_SYMBOLS is not set | 1122 | # CONFIG_UNUSED_SYMBOLS is not set |
1049 | # CONFIG_DEBUG_FS is not set | 1123 | # CONFIG_DEBUG_FS is not set |
1050 | # CONFIG_HEADERS_CHECK is not set | 1124 | # CONFIG_HEADERS_CHECK is not set |
1051 | # CONFIG_DEBUG_KERNEL is not set | 1125 | # CONFIG_DEBUG_KERNEL is not set |
1052 | CONFIG_CROSSCOMPILE=y | 1126 | # CONFIG_SLUB_DEBUG_ON is not set |
1127 | # CONFIG_SLUB_STATS is not set | ||
1128 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
1129 | # CONFIG_SAMPLES is not set | ||
1053 | CONFIG_CMDLINE="" | 1130 | CONFIG_CMDLINE="" |
1054 | 1131 | ||
1055 | # | 1132 | # |
@@ -1057,14 +1134,95 @@ CONFIG_CMDLINE="" | |||
1057 | # | 1134 | # |
1058 | # CONFIG_KEYS is not set | 1135 | # CONFIG_KEYS is not set |
1059 | # CONFIG_SECURITY is not set | 1136 | # CONFIG_SECURITY is not set |
1060 | # CONFIG_CRYPTO is not set | 1137 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set |
1138 | CONFIG_CRYPTO=y | ||
1139 | |||
1140 | # | ||
1141 | # Crypto core or helper | ||
1142 | # | ||
1143 | # CONFIG_CRYPTO_MANAGER is not set | ||
1144 | # CONFIG_CRYPTO_GF128MUL is not set | ||
1145 | # CONFIG_CRYPTO_NULL is not set | ||
1146 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1147 | # CONFIG_CRYPTO_AUTHENC is not set | ||
1148 | # CONFIG_CRYPTO_TEST is not set | ||
1149 | |||
1150 | # | ||
1151 | # Authenticated Encryption with Associated Data | ||
1152 | # | ||
1153 | # CONFIG_CRYPTO_CCM is not set | ||
1154 | # CONFIG_CRYPTO_GCM is not set | ||
1155 | # CONFIG_CRYPTO_SEQIV is not set | ||
1156 | |||
1157 | # | ||
1158 | # Block modes | ||
1159 | # | ||
1160 | # CONFIG_CRYPTO_CBC is not set | ||
1161 | # CONFIG_CRYPTO_CTR is not set | ||
1162 | # CONFIG_CRYPTO_CTS is not set | ||
1163 | # CONFIG_CRYPTO_ECB is not set | ||
1164 | # CONFIG_CRYPTO_LRW is not set | ||
1165 | # CONFIG_CRYPTO_PCBC is not set | ||
1166 | # CONFIG_CRYPTO_XTS is not set | ||
1167 | |||
1168 | # | ||
1169 | # Hash modes | ||
1170 | # | ||
1171 | # CONFIG_CRYPTO_HMAC is not set | ||
1172 | # CONFIG_CRYPTO_XCBC is not set | ||
1173 | |||
1174 | # | ||
1175 | # Digest | ||
1176 | # | ||
1177 | # CONFIG_CRYPTO_CRC32C is not set | ||
1178 | # CONFIG_CRYPTO_MD4 is not set | ||
1179 | # CONFIG_CRYPTO_MD5 is not set | ||
1180 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
1181 | # CONFIG_CRYPTO_RMD128 is not set | ||
1182 | # CONFIG_CRYPTO_RMD160 is not set | ||
1183 | # CONFIG_CRYPTO_RMD256 is not set | ||
1184 | # CONFIG_CRYPTO_RMD320 is not set | ||
1185 | # CONFIG_CRYPTO_SHA1 is not set | ||
1186 | # CONFIG_CRYPTO_SHA256 is not set | ||
1187 | # CONFIG_CRYPTO_SHA512 is not set | ||
1188 | # CONFIG_CRYPTO_TGR192 is not set | ||
1189 | # CONFIG_CRYPTO_WP512 is not set | ||
1190 | |||
1191 | # | ||
1192 | # Ciphers | ||
1193 | # | ||
1194 | # CONFIG_CRYPTO_AES is not set | ||
1195 | # CONFIG_CRYPTO_ANUBIS is not set | ||
1196 | # CONFIG_CRYPTO_ARC4 is not set | ||
1197 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
1198 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1199 | # CONFIG_CRYPTO_CAST5 is not set | ||
1200 | # CONFIG_CRYPTO_CAST6 is not set | ||
1201 | # CONFIG_CRYPTO_DES is not set | ||
1202 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1203 | # CONFIG_CRYPTO_KHAZAD is not set | ||
1204 | # CONFIG_CRYPTO_SALSA20 is not set | ||
1205 | # CONFIG_CRYPTO_SEED is not set | ||
1206 | # CONFIG_CRYPTO_SERPENT is not set | ||
1207 | # CONFIG_CRYPTO_TEA is not set | ||
1208 | # CONFIG_CRYPTO_TWOFISH is not set | ||
1209 | |||
1210 | # | ||
1211 | # Compression | ||
1212 | # | ||
1213 | # CONFIG_CRYPTO_DEFLATE is not set | ||
1214 | # CONFIG_CRYPTO_LZO is not set | ||
1215 | CONFIG_CRYPTO_HW=y | ||
1216 | # CONFIG_CRYPTO_DEV_HIFN_795X is not set | ||
1061 | 1217 | ||
1062 | # | 1218 | # |
1063 | # Library routines | 1219 | # Library routines |
1064 | # | 1220 | # |
1065 | CONFIG_BITREVERSE=y | 1221 | CONFIG_BITREVERSE=y |
1222 | # CONFIG_GENERIC_FIND_FIRST_BIT is not set | ||
1066 | # CONFIG_CRC_CCITT is not set | 1223 | # CONFIG_CRC_CCITT is not set |
1067 | # CONFIG_CRC16 is not set | 1224 | CONFIG_CRC16=y |
1225 | # CONFIG_CRC_T10DIF is not set | ||
1068 | # CONFIG_CRC_ITU_T is not set | 1226 | # CONFIG_CRC_ITU_T is not set |
1069 | CONFIG_CRC32=y | 1227 | CONFIG_CRC32=y |
1070 | # CONFIG_CRC7 is not set | 1228 | # CONFIG_CRC7 is not set |
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig index ebb8ad62b3a3..a279165e3a7d 100644 --- a/arch/mips/configs/db1000_defconfig +++ b/arch/mips/configs/db1000_defconfig | |||
@@ -1092,7 +1092,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1092 | CONFIG_LOG_BUF_SHIFT=14 | 1092 | CONFIG_LOG_BUF_SHIFT=14 |
1093 | CONFIG_CROSSCOMPILE=y | 1093 | CONFIG_CROSSCOMPILE=y |
1094 | CONFIG_CMDLINE="" | 1094 | CONFIG_CMDLINE="" |
1095 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1096 | 1095 | ||
1097 | # | 1096 | # |
1098 | # Security options | 1097 | # Security options |
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig index ad4e5ef65592..8944d15caf13 100644 --- a/arch/mips/configs/db1100_defconfig +++ b/arch/mips/configs/db1100_defconfig | |||
@@ -1092,7 +1092,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1092 | CONFIG_LOG_BUF_SHIFT=14 | 1092 | CONFIG_LOG_BUF_SHIFT=14 |
1093 | CONFIG_CROSSCOMPILE=y | 1093 | CONFIG_CROSSCOMPILE=y |
1094 | CONFIG_CMDLINE="" | 1094 | CONFIG_CMDLINE="" |
1095 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1096 | 1095 | ||
1097 | # | 1096 | # |
1098 | # Security options | 1097 | # Security options |
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig index d0dc2e83ad35..ab17973107fd 100644 --- a/arch/mips/configs/db1200_defconfig +++ b/arch/mips/configs/db1200_defconfig | |||
@@ -1174,7 +1174,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1174 | CONFIG_LOG_BUF_SHIFT=14 | 1174 | CONFIG_LOG_BUF_SHIFT=14 |
1175 | CONFIG_CROSSCOMPILE=y | 1175 | CONFIG_CROSSCOMPILE=y |
1176 | CONFIG_CMDLINE="mem=48M" | 1176 | CONFIG_CMDLINE="mem=48M" |
1177 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1178 | 1177 | ||
1179 | # | 1178 | # |
1180 | # Security options | 1179 | # Security options |
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig index 9155082313c8..b65803f19352 100644 --- a/arch/mips/configs/db1500_defconfig +++ b/arch/mips/configs/db1500_defconfig | |||
@@ -1392,7 +1392,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1392 | CONFIG_LOG_BUF_SHIFT=14 | 1392 | CONFIG_LOG_BUF_SHIFT=14 |
1393 | CONFIG_CROSSCOMPILE=y | 1393 | CONFIG_CROSSCOMPILE=y |
1394 | CONFIG_CMDLINE="" | 1394 | CONFIG_CMDLINE="" |
1395 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1396 | 1395 | ||
1397 | # | 1396 | # |
1398 | # Security options | 1397 | # Security options |
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig index e4e324422cd9..a190ac07740b 100644 --- a/arch/mips/configs/db1550_defconfig +++ b/arch/mips/configs/db1550_defconfig | |||
@@ -1209,7 +1209,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1209 | CONFIG_LOG_BUF_SHIFT=14 | 1209 | CONFIG_LOG_BUF_SHIFT=14 |
1210 | CONFIG_CROSSCOMPILE=y | 1210 | CONFIG_CROSSCOMPILE=y |
1211 | CONFIG_CMDLINE="" | 1211 | CONFIG_CMDLINE="" |
1212 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1213 | 1212 | ||
1214 | # | 1213 | # |
1215 | # Security options | 1214 | # Security options |
diff --git a/arch/mips/configs/excite_defconfig b/arch/mips/configs/excite_defconfig index 3572e80356d2..4e465e945991 100644 --- a/arch/mips/configs/excite_defconfig +++ b/arch/mips/configs/excite_defconfig | |||
@@ -1269,7 +1269,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1269 | CONFIG_LOG_BUF_SHIFT=14 | 1269 | CONFIG_LOG_BUF_SHIFT=14 |
1270 | CONFIG_CROSSCOMPILE=y | 1270 | CONFIG_CROSSCOMPILE=y |
1271 | CONFIG_CMDLINE="" | 1271 | CONFIG_CMDLINE="" |
1272 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1273 | 1272 | ||
1274 | # | 1273 | # |
1275 | # Security options | 1274 | # Security options |
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index 138c575a0151..831d3e5a1ea6 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig | |||
@@ -943,7 +943,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
943 | # CONFIG_DEBUG_KERNEL is not set | 943 | # CONFIG_DEBUG_KERNEL is not set |
944 | CONFIG_CROSSCOMPILE=y | 944 | CONFIG_CROSSCOMPILE=y |
945 | CONFIG_CMDLINE="" | 945 | CONFIG_CMDLINE="" |
946 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
947 | 946 | ||
948 | # | 947 | # |
949 | # Security options | 948 | # Security options |
diff --git a/arch/mips/configs/msp71xx_defconfig b/arch/mips/configs/msp71xx_defconfig index 59d19472b161..dd13db4d0fb9 100644 --- a/arch/mips/configs/msp71xx_defconfig +++ b/arch/mips/configs/msp71xx_defconfig | |||
@@ -1415,8 +1415,6 @@ CONFIG_FORCED_INLINING=y | |||
1415 | CONFIG_CROSSCOMPILE=y | 1415 | CONFIG_CROSSCOMPILE=y |
1416 | CONFIG_CMDLINE="" | 1416 | CONFIG_CMDLINE="" |
1417 | # CONFIG_DEBUG_STACK_USAGE is not set | 1417 | # CONFIG_DEBUG_STACK_USAGE is not set |
1418 | # CONFIG_KGDB is not set | ||
1419 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1420 | # CONFIG_RUNTIME_DEBUG is not set | 1418 | # CONFIG_RUNTIME_DEBUG is not set |
1421 | # CONFIG_MIPS_UNCACHED is not set | 1419 | # CONFIG_MIPS_UNCACHED is not set |
1422 | 1420 | ||
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig index bacf0dd0e345..db9272677aa2 100644 --- a/arch/mips/configs/mtx1_defconfig +++ b/arch/mips/configs/mtx1_defconfig | |||
@@ -3020,7 +3020,6 @@ CONFIG_MAGIC_SYSRQ=y | |||
3020 | # CONFIG_DEBUG_KERNEL is not set | 3020 | # CONFIG_DEBUG_KERNEL is not set |
3021 | CONFIG_CROSSCOMPILE=y | 3021 | CONFIG_CROSSCOMPILE=y |
3022 | CONFIG_CMDLINE="" | 3022 | CONFIG_CMDLINE="" |
3023 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
3024 | 3023 | ||
3025 | # | 3024 | # |
3026 | # Security options | 3025 | # Security options |
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig index 6dfe6f793cef..9e21e333a2fc 100644 --- a/arch/mips/configs/pb1100_defconfig +++ b/arch/mips/configs/pb1100_defconfig | |||
@@ -1085,7 +1085,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1085 | CONFIG_LOG_BUF_SHIFT=14 | 1085 | CONFIG_LOG_BUF_SHIFT=14 |
1086 | CONFIG_CROSSCOMPILE=y | 1086 | CONFIG_CROSSCOMPILE=y |
1087 | CONFIG_CMDLINE="" | 1087 | CONFIG_CMDLINE="" |
1088 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1089 | 1088 | ||
1090 | # | 1089 | # |
1091 | # Security options | 1090 | # Security options |
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig index c965a87e6a96..af67ed4f71ae 100644 --- a/arch/mips/configs/pb1500_defconfig +++ b/arch/mips/configs/pb1500_defconfig | |||
@@ -1202,7 +1202,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1202 | CONFIG_LOG_BUF_SHIFT=14 | 1202 | CONFIG_LOG_BUF_SHIFT=14 |
1203 | CONFIG_CROSSCOMPILE=y | 1203 | CONFIG_CROSSCOMPILE=y |
1204 | CONFIG_CMDLINE="" | 1204 | CONFIG_CMDLINE="" |
1205 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1206 | 1205 | ||
1207 | # | 1206 | # |
1208 | # Security options | 1207 | # Security options |
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig index 0778996c682f..7956f56cbf3e 100644 --- a/arch/mips/configs/pb1550_defconfig +++ b/arch/mips/configs/pb1550_defconfig | |||
@@ -1195,7 +1195,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
1195 | CONFIG_LOG_BUF_SHIFT=14 | 1195 | CONFIG_LOG_BUF_SHIFT=14 |
1196 | CONFIG_CROSSCOMPILE=y | 1196 | CONFIG_CROSSCOMPILE=y |
1197 | CONFIG_CMDLINE="" | 1197 | CONFIG_CMDLINE="" |
1198 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1199 | 1198 | ||
1200 | # | 1199 | # |
1201 | # Security options | 1200 | # Security options |
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig index 37c7b5ffd474..723bd5176a35 100644 --- a/arch/mips/configs/pnx8550-jbs_defconfig +++ b/arch/mips/configs/pnx8550-jbs_defconfig | |||
@@ -1216,10 +1216,8 @@ CONFIG_DEBUG_MUTEXES=y | |||
1216 | CONFIG_FORCED_INLINING=y | 1216 | CONFIG_FORCED_INLINING=y |
1217 | # CONFIG_RCU_TORTURE_TEST is not set | 1217 | # CONFIG_RCU_TORTURE_TEST is not set |
1218 | CONFIG_CROSSCOMPILE=y | 1218 | CONFIG_CROSSCOMPILE=y |
1219 | CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" | 1219 | CONFIG_CMDLINE="console=ttyS1,38400n8 root=/dev/nfs ip=bootp" |
1220 | # CONFIG_DEBUG_STACK_USAGE is not set | 1220 | # CONFIG_DEBUG_STACK_USAGE is not set |
1221 | # CONFIG_KGDB is not set | ||
1222 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1223 | # CONFIG_RUNTIME_DEBUG is not set | 1221 | # CONFIG_RUNTIME_DEBUG is not set |
1224 | 1222 | ||
1225 | # | 1223 | # |
diff --git a/arch/mips/configs/pnx8550-stb810_defconfig b/arch/mips/configs/pnx8550-stb810_defconfig index 893e5c4ab66d..b5052fb42e9e 100644 --- a/arch/mips/configs/pnx8550-stb810_defconfig +++ b/arch/mips/configs/pnx8550-stb810_defconfig | |||
@@ -1206,10 +1206,8 @@ CONFIG_DEBUG_SLAB=y | |||
1206 | CONFIG_FORCED_INLINING=y | 1206 | CONFIG_FORCED_INLINING=y |
1207 | # CONFIG_RCU_TORTURE_TEST is not set | 1207 | # CONFIG_RCU_TORTURE_TEST is not set |
1208 | CONFIG_CROSSCOMPILE=y | 1208 | CONFIG_CROSSCOMPILE=y |
1209 | CONFIG_CMDLINE="console=ttyS1,38400n8 kgdb=ttyS0 root=/dev/nfs ip=bootp" | 1209 | CONFIG_CMDLINE="console=ttyS1,38400n8 root=/dev/nfs ip=bootp" |
1210 | # CONFIG_DEBUG_STACK_USAGE is not set | 1210 | # CONFIG_DEBUG_STACK_USAGE is not set |
1211 | # CONFIG_KGDB is not set | ||
1212 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
1213 | # CONFIG_RUNTIME_DEBUG is not set | 1211 | # CONFIG_RUNTIME_DEBUG is not set |
1214 | 1212 | ||
1215 | # | 1213 | # |
diff --git a/arch/mips/configs/rbtx49xx_defconfig b/arch/mips/configs/rbtx49xx_defconfig index e42aed5a38bb..c7c0864b8ce9 100644 --- a/arch/mips/configs/rbtx49xx_defconfig +++ b/arch/mips/configs/rbtx49xx_defconfig | |||
@@ -742,7 +742,6 @@ CONFIG_DEBUG_FS=y | |||
742 | # CONFIG_DEBUG_KERNEL is not set | 742 | # CONFIG_DEBUG_KERNEL is not set |
743 | # CONFIG_SAMPLES is not set | 743 | # CONFIG_SAMPLES is not set |
744 | CONFIG_CMDLINE="" | 744 | CONFIG_CMDLINE="" |
745 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
746 | 745 | ||
747 | # | 746 | # |
748 | # Security options | 747 | # Security options |
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig index 1ea97865f2ce..a9acaa2f9da3 100644 --- a/arch/mips/configs/sb1250-swarm_defconfig +++ b/arch/mips/configs/sb1250-swarm_defconfig | |||
@@ -963,7 +963,6 @@ CONFIG_ENABLE_MUST_CHECK=y | |||
963 | # CONFIG_DEBUG_KERNEL is not set | 963 | # CONFIG_DEBUG_KERNEL is not set |
964 | # CONFIG_SAMPLES is not set | 964 | # CONFIG_SAMPLES is not set |
965 | CONFIG_CMDLINE="" | 965 | CONFIG_CMDLINE="" |
966 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
967 | # CONFIG_SB1XXX_CORELIS is not set | 966 | # CONFIG_SB1XXX_CORELIS is not set |
968 | 967 | ||
969 | # | 968 | # |
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig index 7f86c43d1bda..ea8249c75b3f 100644 --- a/arch/mips/configs/yosemite_defconfig +++ b/arch/mips/configs/yosemite_defconfig | |||
@@ -827,8 +827,6 @@ CONFIG_FORCED_INLINING=y | |||
827 | CONFIG_CROSSCOMPILE=y | 827 | CONFIG_CROSSCOMPILE=y |
828 | CONFIG_CMDLINE="" | 828 | CONFIG_CMDLINE="" |
829 | # CONFIG_DEBUG_STACK_USAGE is not set | 829 | # CONFIG_DEBUG_STACK_USAGE is not set |
830 | # CONFIG_KGDB is not set | ||
831 | CONFIG_SYS_SUPPORTS_KGDB=y | ||
832 | # CONFIG_RUNTIME_DEBUG is not set | 830 | # CONFIG_RUNTIME_DEBUG is not set |
833 | 831 | ||
834 | # | 832 | # |
diff --git a/arch/mips/emma2rh/markeins/platform.c b/arch/mips/emma2rh/markeins/platform.c index 11567702b155..d70627de7cfe 100644 --- a/arch/mips/emma2rh/markeins/platform.c +++ b/arch/mips/emma2rh/markeins/platform.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/bcache.h> | 34 | #include <asm/bcache.h> |
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | #include <asm/reboot.h> | 36 | #include <asm/reboot.h> |
37 | #include <asm/gdb-stub.h> | ||
38 | #include <asm/traps.h> | 37 | #include <asm/traps.h> |
39 | #include <asm/debug.h> | 38 | #include <asm/debug.h> |
40 | 39 | ||
diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c index 62bfb455d1b1..a56c4b804b07 100644 --- a/arch/mips/emma2rh/markeins/setup.c +++ b/arch/mips/emma2rh/markeins/setup.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <asm/bcache.h> | 41 | #include <asm/bcache.h> |
42 | #include <asm/irq.h> | 42 | #include <asm/irq.h> |
43 | #include <asm/reboot.h> | 43 | #include <asm/reboot.h> |
44 | #include <asm/gdb-stub.h> | ||
45 | #include <asm/traps.h> | 44 | #include <asm/traps.h> |
46 | #include <asm/debug.h> | 45 | #include <asm/debug.h> |
47 | 46 | ||
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 0fd31974ba28..706f93974797 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -71,7 +71,7 @@ obj-$(CONFIG_MIPS32_COMPAT) += linux32.o ptrace32.o signal32.o | |||
71 | obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o | 71 | obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o |
72 | obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o | 72 | obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o |
73 | 73 | ||
74 | obj-$(CONFIG_KGDB) += gdb-low.o gdb-stub.o | 74 | obj-$(CONFIG_KGDB) += kgdb.o |
75 | obj-$(CONFIG_PROC_FS) += proc.o | 75 | obj-$(CONFIG_PROC_FS) += proc.o |
76 | 76 | ||
77 | obj-$(CONFIG_64BIT) += cpu-bugs64.o | 77 | obj-$(CONFIG_64BIT) += cpu-bugs64.o |
diff --git a/arch/mips/kernel/gdb-low.S b/arch/mips/kernel/gdb-low.S deleted file mode 100644 index 2c446063636a..000000000000 --- a/arch/mips/kernel/gdb-low.S +++ /dev/null | |||
@@ -1,394 +0,0 @@ | |||
1 | /* | ||
2 | * gdb-low.S contains the low-level trap handler for the GDB stub. | ||
3 | * | ||
4 | * Copyright (C) 1995 Andreas Busse | ||
5 | */ | ||
6 | #include <linux/sys.h> | ||
7 | |||
8 | #include <asm/asm.h> | ||
9 | #include <asm/errno.h> | ||
10 | #include <asm/irqflags.h> | ||
11 | #include <asm/mipsregs.h> | ||
12 | #include <asm/regdef.h> | ||
13 | #include <asm/stackframe.h> | ||
14 | #include <asm/gdb-stub.h> | ||
15 | |||
16 | #ifdef CONFIG_32BIT | ||
17 | #define DMFC0 mfc0 | ||
18 | #define DMTC0 mtc0 | ||
19 | #define LDC1 lwc1 | ||
20 | #define SDC1 lwc1 | ||
21 | #endif | ||
22 | #ifdef CONFIG_64BIT | ||
23 | #define DMFC0 dmfc0 | ||
24 | #define DMTC0 dmtc0 | ||
25 | #define LDC1 ldc1 | ||
26 | #define SDC1 ldc1 | ||
27 | #endif | ||
28 | |||
29 | /* | ||
30 | * [jsun] We reserves about 2x GDB_FR_SIZE in stack. The lower (addressed) | ||
31 | * part is used to store registers and passed to exception handler. | ||
32 | * The upper part is reserved for "call func" feature where gdb client | ||
33 | * saves some of the regs, setups call frame and passes args. | ||
34 | * | ||
35 | * A trace shows about 200 bytes are used to store about half of all regs. | ||
36 | * The rest should be big enough for frame setup and passing args. | ||
37 | */ | ||
38 | |||
39 | /* | ||
40 | * The low level trap handler | ||
41 | */ | ||
42 | .align 5 | ||
43 | NESTED(trap_low, GDB_FR_SIZE, sp) | ||
44 | .set noat | ||
45 | .set noreorder | ||
46 | |||
47 | mfc0 k0, CP0_STATUS | ||
48 | sll k0, 3 /* extract cu0 bit */ | ||
49 | bltz k0, 1f | ||
50 | move k1, sp | ||
51 | |||
52 | /* | ||
53 | * Called from user mode, go somewhere else. | ||
54 | */ | ||
55 | mfc0 k0, CP0_CAUSE | ||
56 | andi k0, k0, 0x7c | ||
57 | #ifdef CONFIG_64BIT | ||
58 | dsll k0, k0, 1 | ||
59 | #endif | ||
60 | PTR_L k1, saved_vectors(k0) | ||
61 | jr k1 | ||
62 | nop | ||
63 | 1: | ||
64 | move k0, sp | ||
65 | PTR_SUBU sp, k1, GDB_FR_SIZE*2 # see comment above | ||
66 | LONG_S k0, GDB_FR_REG29(sp) | ||
67 | LONG_S $2, GDB_FR_REG2(sp) | ||
68 | |||
69 | /* | ||
70 | * First save the CP0 and special registers | ||
71 | */ | ||
72 | |||
73 | mfc0 v0, CP0_STATUS | ||
74 | LONG_S v0, GDB_FR_STATUS(sp) | ||
75 | mfc0 v0, CP0_CAUSE | ||
76 | LONG_S v0, GDB_FR_CAUSE(sp) | ||
77 | DMFC0 v0, CP0_EPC | ||
78 | LONG_S v0, GDB_FR_EPC(sp) | ||
79 | DMFC0 v0, CP0_BADVADDR | ||
80 | LONG_S v0, GDB_FR_BADVADDR(sp) | ||
81 | mfhi v0 | ||
82 | LONG_S v0, GDB_FR_HI(sp) | ||
83 | mflo v0 | ||
84 | LONG_S v0, GDB_FR_LO(sp) | ||
85 | |||
86 | /* | ||
87 | * Now the integer registers | ||
88 | */ | ||
89 | |||
90 | LONG_S zero, GDB_FR_REG0(sp) /* I know... */ | ||
91 | LONG_S $1, GDB_FR_REG1(sp) | ||
92 | /* v0 already saved */ | ||
93 | LONG_S $3, GDB_FR_REG3(sp) | ||
94 | LONG_S $4, GDB_FR_REG4(sp) | ||
95 | LONG_S $5, GDB_FR_REG5(sp) | ||
96 | LONG_S $6, GDB_FR_REG6(sp) | ||
97 | LONG_S $7, GDB_FR_REG7(sp) | ||
98 | LONG_S $8, GDB_FR_REG8(sp) | ||
99 | LONG_S $9, GDB_FR_REG9(sp) | ||
100 | LONG_S $10, GDB_FR_REG10(sp) | ||
101 | LONG_S $11, GDB_FR_REG11(sp) | ||
102 | LONG_S $12, GDB_FR_REG12(sp) | ||
103 | LONG_S $13, GDB_FR_REG13(sp) | ||
104 | LONG_S $14, GDB_FR_REG14(sp) | ||
105 | LONG_S $15, GDB_FR_REG15(sp) | ||
106 | LONG_S $16, GDB_FR_REG16(sp) | ||
107 | LONG_S $17, GDB_FR_REG17(sp) | ||
108 | LONG_S $18, GDB_FR_REG18(sp) | ||
109 | LONG_S $19, GDB_FR_REG19(sp) | ||
110 | LONG_S $20, GDB_FR_REG20(sp) | ||
111 | LONG_S $21, GDB_FR_REG21(sp) | ||
112 | LONG_S $22, GDB_FR_REG22(sp) | ||
113 | LONG_S $23, GDB_FR_REG23(sp) | ||
114 | LONG_S $24, GDB_FR_REG24(sp) | ||
115 | LONG_S $25, GDB_FR_REG25(sp) | ||
116 | LONG_S $26, GDB_FR_REG26(sp) | ||
117 | LONG_S $27, GDB_FR_REG27(sp) | ||
118 | LONG_S $28, GDB_FR_REG28(sp) | ||
119 | /* sp already saved */ | ||
120 | LONG_S $30, GDB_FR_REG30(sp) | ||
121 | LONG_S $31, GDB_FR_REG31(sp) | ||
122 | |||
123 | CLI /* disable interrupts */ | ||
124 | TRACE_IRQS_OFF | ||
125 | |||
126 | /* | ||
127 | * Followed by the floating point registers | ||
128 | */ | ||
129 | mfc0 v0, CP0_STATUS /* FPU enabled? */ | ||
130 | srl v0, v0, 16 | ||
131 | andi v0, v0, (ST0_CU1 >> 16) | ||
132 | |||
133 | beqz v0,2f /* disabled, skip */ | ||
134 | nop | ||
135 | |||
136 | SDC1 $0, GDB_FR_FPR0(sp) | ||
137 | SDC1 $1, GDB_FR_FPR1(sp) | ||
138 | SDC1 $2, GDB_FR_FPR2(sp) | ||
139 | SDC1 $3, GDB_FR_FPR3(sp) | ||
140 | SDC1 $4, GDB_FR_FPR4(sp) | ||
141 | SDC1 $5, GDB_FR_FPR5(sp) | ||
142 | SDC1 $6, GDB_FR_FPR6(sp) | ||
143 | SDC1 $7, GDB_FR_FPR7(sp) | ||
144 | SDC1 $8, GDB_FR_FPR8(sp) | ||
145 | SDC1 $9, GDB_FR_FPR9(sp) | ||
146 | SDC1 $10, GDB_FR_FPR10(sp) | ||
147 | SDC1 $11, GDB_FR_FPR11(sp) | ||
148 | SDC1 $12, GDB_FR_FPR12(sp) | ||
149 | SDC1 $13, GDB_FR_FPR13(sp) | ||
150 | SDC1 $14, GDB_FR_FPR14(sp) | ||
151 | SDC1 $15, GDB_FR_FPR15(sp) | ||
152 | SDC1 $16, GDB_FR_FPR16(sp) | ||
153 | SDC1 $17, GDB_FR_FPR17(sp) | ||
154 | SDC1 $18, GDB_FR_FPR18(sp) | ||
155 | SDC1 $19, GDB_FR_FPR19(sp) | ||
156 | SDC1 $20, GDB_FR_FPR20(sp) | ||
157 | SDC1 $21, GDB_FR_FPR21(sp) | ||
158 | SDC1 $22, GDB_FR_FPR22(sp) | ||
159 | SDC1 $23, GDB_FR_FPR23(sp) | ||
160 | SDC1 $24, GDB_FR_FPR24(sp) | ||
161 | SDC1 $25, GDB_FR_FPR25(sp) | ||
162 | SDC1 $26, GDB_FR_FPR26(sp) | ||
163 | SDC1 $27, GDB_FR_FPR27(sp) | ||
164 | SDC1 $28, GDB_FR_FPR28(sp) | ||
165 | SDC1 $29, GDB_FR_FPR29(sp) | ||
166 | SDC1 $30, GDB_FR_FPR30(sp) | ||
167 | SDC1 $31, GDB_FR_FPR31(sp) | ||
168 | |||
169 | /* | ||
170 | * FPU control registers | ||
171 | */ | ||
172 | |||
173 | cfc1 v0, CP1_STATUS | ||
174 | LONG_S v0, GDB_FR_FSR(sp) | ||
175 | cfc1 v0, CP1_REVISION | ||
176 | LONG_S v0, GDB_FR_FIR(sp) | ||
177 | |||
178 | /* | ||
179 | * Current stack frame ptr | ||
180 | */ | ||
181 | |||
182 | 2: | ||
183 | LONG_S sp, GDB_FR_FRP(sp) | ||
184 | |||
185 | /* | ||
186 | * CP0 registers (R4000/R4400 unused registers skipped) | ||
187 | */ | ||
188 | |||
189 | mfc0 v0, CP0_INDEX | ||
190 | LONG_S v0, GDB_FR_CP0_INDEX(sp) | ||
191 | mfc0 v0, CP0_RANDOM | ||
192 | LONG_S v0, GDB_FR_CP0_RANDOM(sp) | ||
193 | DMFC0 v0, CP0_ENTRYLO0 | ||
194 | LONG_S v0, GDB_FR_CP0_ENTRYLO0(sp) | ||
195 | DMFC0 v0, CP0_ENTRYLO1 | ||
196 | LONG_S v0, GDB_FR_CP0_ENTRYLO1(sp) | ||
197 | DMFC0 v0, CP0_CONTEXT | ||
198 | LONG_S v0, GDB_FR_CP0_CONTEXT(sp) | ||
199 | mfc0 v0, CP0_PAGEMASK | ||
200 | LONG_S v0, GDB_FR_CP0_PAGEMASK(sp) | ||
201 | mfc0 v0, CP0_WIRED | ||
202 | LONG_S v0, GDB_FR_CP0_WIRED(sp) | ||
203 | DMFC0 v0, CP0_ENTRYHI | ||
204 | LONG_S v0, GDB_FR_CP0_ENTRYHI(sp) | ||
205 | mfc0 v0, CP0_PRID | ||
206 | LONG_S v0, GDB_FR_CP0_PRID(sp) | ||
207 | |||
208 | .set at | ||
209 | |||
210 | /* | ||
211 | * Continue with the higher level handler | ||
212 | */ | ||
213 | |||
214 | move a0,sp | ||
215 | |||
216 | jal handle_exception | ||
217 | nop | ||
218 | |||
219 | /* | ||
220 | * Restore all writable registers, in reverse order | ||
221 | */ | ||
222 | |||
223 | .set noat | ||
224 | |||
225 | LONG_L v0, GDB_FR_CP0_ENTRYHI(sp) | ||
226 | LONG_L v1, GDB_FR_CP0_WIRED(sp) | ||
227 | DMTC0 v0, CP0_ENTRYHI | ||
228 | mtc0 v1, CP0_WIRED | ||
229 | LONG_L v0, GDB_FR_CP0_PAGEMASK(sp) | ||
230 | LONG_L v1, GDB_FR_CP0_ENTRYLO1(sp) | ||
231 | mtc0 v0, CP0_PAGEMASK | ||
232 | DMTC0 v1, CP0_ENTRYLO1 | ||
233 | LONG_L v0, GDB_FR_CP0_ENTRYLO0(sp) | ||
234 | LONG_L v1, GDB_FR_CP0_INDEX(sp) | ||
235 | DMTC0 v0, CP0_ENTRYLO0 | ||
236 | LONG_L v0, GDB_FR_CP0_CONTEXT(sp) | ||
237 | mtc0 v1, CP0_INDEX | ||
238 | DMTC0 v0, CP0_CONTEXT | ||
239 | |||
240 | |||
241 | /* | ||
242 | * Next, the floating point registers | ||
243 | */ | ||
244 | mfc0 v0, CP0_STATUS /* check if the FPU is enabled */ | ||
245 | srl v0, v0, 16 | ||
246 | andi v0, v0, (ST0_CU1 >> 16) | ||
247 | |||
248 | beqz v0, 3f /* disabled, skip */ | ||
249 | nop | ||
250 | |||
251 | LDC1 $31, GDB_FR_FPR31(sp) | ||
252 | LDC1 $30, GDB_FR_FPR30(sp) | ||
253 | LDC1 $29, GDB_FR_FPR29(sp) | ||
254 | LDC1 $28, GDB_FR_FPR28(sp) | ||
255 | LDC1 $27, GDB_FR_FPR27(sp) | ||
256 | LDC1 $26, GDB_FR_FPR26(sp) | ||
257 | LDC1 $25, GDB_FR_FPR25(sp) | ||
258 | LDC1 $24, GDB_FR_FPR24(sp) | ||
259 | LDC1 $23, GDB_FR_FPR23(sp) | ||
260 | LDC1 $22, GDB_FR_FPR22(sp) | ||
261 | LDC1 $21, GDB_FR_FPR21(sp) | ||
262 | LDC1 $20, GDB_FR_FPR20(sp) | ||
263 | LDC1 $19, GDB_FR_FPR19(sp) | ||
264 | LDC1 $18, GDB_FR_FPR18(sp) | ||
265 | LDC1 $17, GDB_FR_FPR17(sp) | ||
266 | LDC1 $16, GDB_FR_FPR16(sp) | ||
267 | LDC1 $15, GDB_FR_FPR15(sp) | ||
268 | LDC1 $14, GDB_FR_FPR14(sp) | ||
269 | LDC1 $13, GDB_FR_FPR13(sp) | ||
270 | LDC1 $12, GDB_FR_FPR12(sp) | ||
271 | LDC1 $11, GDB_FR_FPR11(sp) | ||
272 | LDC1 $10, GDB_FR_FPR10(sp) | ||
273 | LDC1 $9, GDB_FR_FPR9(sp) | ||
274 | LDC1 $8, GDB_FR_FPR8(sp) | ||
275 | LDC1 $7, GDB_FR_FPR7(sp) | ||
276 | LDC1 $6, GDB_FR_FPR6(sp) | ||
277 | LDC1 $5, GDB_FR_FPR5(sp) | ||
278 | LDC1 $4, GDB_FR_FPR4(sp) | ||
279 | LDC1 $3, GDB_FR_FPR3(sp) | ||
280 | LDC1 $2, GDB_FR_FPR2(sp) | ||
281 | LDC1 $1, GDB_FR_FPR1(sp) | ||
282 | LDC1 $0, GDB_FR_FPR0(sp) | ||
283 | |||
284 | /* | ||
285 | * Now the CP0 and integer registers | ||
286 | */ | ||
287 | |||
288 | 3: | ||
289 | #ifdef CONFIG_MIPS_MT_SMTC | ||
290 | /* Read-modify write of Status must be atomic */ | ||
291 | mfc0 t2, CP0_TCSTATUS | ||
292 | ori t1, t2, TCSTATUS_IXMT | ||
293 | mtc0 t1, CP0_TCSTATUS | ||
294 | andi t2, t2, TCSTATUS_IXMT | ||
295 | _ehb | ||
296 | DMT 9 # dmt t1 | ||
297 | jal mips_ihb | ||
298 | nop | ||
299 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
300 | mfc0 t0, CP0_STATUS | ||
301 | ori t0, 0x1f | ||
302 | xori t0, 0x1f | ||
303 | mtc0 t0, CP0_STATUS | ||
304 | #ifdef CONFIG_MIPS_MT_SMTC | ||
305 | andi t1, t1, VPECONTROL_TE | ||
306 | beqz t1, 9f | ||
307 | nop | ||
308 | EMT # emt | ||
309 | 9: | ||
310 | mfc0 t1, CP0_TCSTATUS | ||
311 | xori t1, t1, TCSTATUS_IXMT | ||
312 | or t1, t1, t2 | ||
313 | mtc0 t1, CP0_TCSTATUS | ||
314 | _ehb | ||
315 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
316 | LONG_L v0, GDB_FR_STATUS(sp) | ||
317 | LONG_L v1, GDB_FR_EPC(sp) | ||
318 | mtc0 v0, CP0_STATUS | ||
319 | DMTC0 v1, CP0_EPC | ||
320 | LONG_L v0, GDB_FR_HI(sp) | ||
321 | LONG_L v1, GDB_FR_LO(sp) | ||
322 | mthi v0 | ||
323 | mtlo v1 | ||
324 | LONG_L $31, GDB_FR_REG31(sp) | ||
325 | LONG_L $30, GDB_FR_REG30(sp) | ||
326 | LONG_L $28, GDB_FR_REG28(sp) | ||
327 | LONG_L $27, GDB_FR_REG27(sp) | ||
328 | LONG_L $26, GDB_FR_REG26(sp) | ||
329 | LONG_L $25, GDB_FR_REG25(sp) | ||
330 | LONG_L $24, GDB_FR_REG24(sp) | ||
331 | LONG_L $23, GDB_FR_REG23(sp) | ||
332 | LONG_L $22, GDB_FR_REG22(sp) | ||
333 | LONG_L $21, GDB_FR_REG21(sp) | ||
334 | LONG_L $20, GDB_FR_REG20(sp) | ||
335 | LONG_L $19, GDB_FR_REG19(sp) | ||
336 | LONG_L $18, GDB_FR_REG18(sp) | ||
337 | LONG_L $17, GDB_FR_REG17(sp) | ||
338 | LONG_L $16, GDB_FR_REG16(sp) | ||
339 | LONG_L $15, GDB_FR_REG15(sp) | ||
340 | LONG_L $14, GDB_FR_REG14(sp) | ||
341 | LONG_L $13, GDB_FR_REG13(sp) | ||
342 | LONG_L $12, GDB_FR_REG12(sp) | ||
343 | LONG_L $11, GDB_FR_REG11(sp) | ||
344 | LONG_L $10, GDB_FR_REG10(sp) | ||
345 | LONG_L $9, GDB_FR_REG9(sp) | ||
346 | LONG_L $8, GDB_FR_REG8(sp) | ||
347 | LONG_L $7, GDB_FR_REG7(sp) | ||
348 | LONG_L $6, GDB_FR_REG6(sp) | ||
349 | LONG_L $5, GDB_FR_REG5(sp) | ||
350 | LONG_L $4, GDB_FR_REG4(sp) | ||
351 | LONG_L $3, GDB_FR_REG3(sp) | ||
352 | LONG_L $2, GDB_FR_REG2(sp) | ||
353 | LONG_L $1, GDB_FR_REG1(sp) | ||
354 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
355 | LONG_L k0, GDB_FR_EPC(sp) | ||
356 | LONG_L $29, GDB_FR_REG29(sp) /* Deallocate stack */ | ||
357 | jr k0 | ||
358 | rfe | ||
359 | #else | ||
360 | LONG_L sp, GDB_FR_REG29(sp) /* Deallocate stack */ | ||
361 | |||
362 | .set mips3 | ||
363 | eret | ||
364 | .set mips0 | ||
365 | #endif | ||
366 | .set at | ||
367 | .set reorder | ||
368 | END(trap_low) | ||
369 | |||
370 | LEAF(kgdb_read_byte) | ||
371 | 4: lb t0, (a0) | ||
372 | sb t0, (a1) | ||
373 | li v0, 0 | ||
374 | jr ra | ||
375 | .section __ex_table,"a" | ||
376 | PTR 4b, kgdbfault | ||
377 | .previous | ||
378 | END(kgdb_read_byte) | ||
379 | |||
380 | LEAF(kgdb_write_byte) | ||
381 | 5: sb a0, (a1) | ||
382 | li v0, 0 | ||
383 | jr ra | ||
384 | .section __ex_table,"a" | ||
385 | PTR 5b, kgdbfault | ||
386 | .previous | ||
387 | END(kgdb_write_byte) | ||
388 | |||
389 | .type kgdbfault@function | ||
390 | .ent kgdbfault | ||
391 | |||
392 | kgdbfault: li v0, -EFAULT | ||
393 | jr ra | ||
394 | .end kgdbfault | ||
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c deleted file mode 100644 index 25f4eab8ea9c..000000000000 --- a/arch/mips/kernel/gdb-stub.c +++ /dev/null | |||
@@ -1,1155 +0,0 @@ | |||
1 | /* | ||
2 | * arch/mips/kernel/gdb-stub.c | ||
3 | * | ||
4 | * Originally written by Glenn Engel, Lake Stevens Instrument Division | ||
5 | * | ||
6 | * Contributed by HP Systems | ||
7 | * | ||
8 | * Modified for SPARC by Stu Grossman, Cygnus Support. | ||
9 | * | ||
10 | * Modified for Linux/MIPS (and MIPS in general) by Andreas Busse | ||
11 | * Send complaints, suggestions etc. to <andy@waldorf-gmbh.de> | ||
12 | * | ||
13 | * Copyright (C) 1995 Andreas Busse | ||
14 | * | ||
15 | * Copyright (C) 2003 MontaVista Software Inc. | ||
16 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * To enable debugger support, two things need to happen. One, a | ||
21 | * call to set_debug_traps() is necessary in order to allow any breakpoints | ||
22 | * or error conditions to be properly intercepted and reported to gdb. | ||
23 | * Two, a breakpoint needs to be generated to begin communication. This | ||
24 | * is most easily accomplished by a call to breakpoint(). Breakpoint() | ||
25 | * simulates a breakpoint by executing a BREAK instruction. | ||
26 | * | ||
27 | * | ||
28 | * The following gdb commands are supported: | ||
29 | * | ||
30 | * command function Return value | ||
31 | * | ||
32 | * g return the value of the CPU registers hex data or ENN | ||
33 | * G set the value of the CPU registers OK or ENN | ||
34 | * | ||
35 | * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN | ||
36 | * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN | ||
37 | * | ||
38 | * c Resume at current address SNN ( signal NN) | ||
39 | * cAA..AA Continue at address AA..AA SNN | ||
40 | * | ||
41 | * s Step one instruction SNN | ||
42 | * sAA..AA Step one instruction from AA..AA SNN | ||
43 | * | ||
44 | * k kill | ||
45 | * | ||
46 | * ? What was the last sigval ? SNN (signal NN) | ||
47 | * | ||
48 | * bBB..BB Set baud rate to BB..BB OK or BNN, then sets | ||
49 | * baud rate | ||
50 | * | ||
51 | * All commands and responses are sent with a packet which includes a | ||
52 | * checksum. A packet consists of | ||
53 | * | ||
54 | * $<packet info>#<checksum>. | ||
55 | * | ||
56 | * where | ||
57 | * <packet info> :: <characters representing the command or response> | ||
58 | * <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>> | ||
59 | * | ||
60 | * When a packet is received, it is first acknowledged with either '+' or '-'. | ||
61 | * '+' indicates a successful transfer. '-' indicates a failed transfer. | ||
62 | * | ||
63 | * Example: | ||
64 | * | ||
65 | * Host: Reply: | ||
66 | * $m0,10#2a +$00010203040506070809101112131415#42 | ||
67 | * | ||
68 | * | ||
69 | * ============== | ||
70 | * MORE EXAMPLES: | ||
71 | * ============== | ||
72 | * | ||
73 | * For reference -- the following are the steps that one | ||
74 | * company took (RidgeRun Inc) to get remote gdb debugging | ||
75 | * going. In this scenario the host machine was a PC and the | ||
76 | * target platform was a Galileo EVB64120A MIPS evaluation | ||
77 | * board. | ||
78 | * | ||
79 | * Step 1: | ||
80 | * First download gdb-5.0.tar.gz from the internet. | ||
81 | * and then build/install the package. | ||
82 | * | ||
83 | * Example: | ||
84 | * $ tar zxf gdb-5.0.tar.gz | ||
85 | * $ cd gdb-5.0 | ||
86 | * $ ./configure --target=mips-linux-elf | ||
87 | * $ make | ||
88 | * $ install | ||
89 | * $ which mips-linux-elf-gdb | ||
90 | * /usr/local/bin/mips-linux-elf-gdb | ||
91 | * | ||
92 | * Step 2: | ||
93 | * Configure linux for remote debugging and build it. | ||
94 | * | ||
95 | * Example: | ||
96 | * $ cd ~/linux | ||
97 | * $ make menuconfig <go to "Kernel Hacking" and turn on remote debugging> | ||
98 | * $ make | ||
99 | * | ||
100 | * Step 3: | ||
101 | * Download the kernel to the remote target and start | ||
102 | * the kernel running. It will promptly halt and wait | ||
103 | * for the host gdb session to connect. It does this | ||
104 | * since the "Kernel Hacking" option has defined | ||
105 | * CONFIG_KGDB which in turn enables your calls | ||
106 | * to: | ||
107 | * set_debug_traps(); | ||
108 | * breakpoint(); | ||
109 | * | ||
110 | * Step 4: | ||
111 | * Start the gdb session on the host. | ||
112 | * | ||
113 | * Example: | ||
114 | * $ mips-linux-elf-gdb vmlinux | ||
115 | * (gdb) set remotebaud 115200 | ||
116 | * (gdb) target remote /dev/ttyS1 | ||
117 | * ...at this point you are connected to | ||
118 | * the remote target and can use gdb | ||
119 | * in the normal fasion. Setting | ||
120 | * breakpoints, single stepping, | ||
121 | * printing variables, etc. | ||
122 | */ | ||
123 | #include <linux/string.h> | ||
124 | #include <linux/kernel.h> | ||
125 | #include <linux/signal.h> | ||
126 | #include <linux/sched.h> | ||
127 | #include <linux/mm.h> | ||
128 | #include <linux/console.h> | ||
129 | #include <linux/init.h> | ||
130 | #include <linux/smp.h> | ||
131 | #include <linux/spinlock.h> | ||
132 | #include <linux/slab.h> | ||
133 | #include <linux/reboot.h> | ||
134 | |||
135 | #include <asm/asm.h> | ||
136 | #include <asm/cacheflush.h> | ||
137 | #include <asm/mipsregs.h> | ||
138 | #include <asm/pgtable.h> | ||
139 | #include <asm/system.h> | ||
140 | #include <asm/gdb-stub.h> | ||
141 | #include <asm/inst.h> | ||
142 | |||
143 | /* | ||
144 | * external low-level support routines | ||
145 | */ | ||
146 | |||
147 | extern int putDebugChar(char c); /* write a single character */ | ||
148 | extern char getDebugChar(void); /* read and return a single char */ | ||
149 | extern void trap_low(void); | ||
150 | |||
151 | /* | ||
152 | * breakpoint and test functions | ||
153 | */ | ||
154 | extern void breakpoint(void); | ||
155 | extern void breakinst(void); | ||
156 | extern void async_breakpoint(void); | ||
157 | extern void async_breakinst(void); | ||
158 | extern void adel(void); | ||
159 | |||
160 | /* | ||
161 | * local prototypes | ||
162 | */ | ||
163 | |||
164 | static void getpacket(char *buffer); | ||
165 | static void putpacket(char *buffer); | ||
166 | static int computeSignal(int tt); | ||
167 | static int hex(unsigned char ch); | ||
168 | static int hexToInt(char **ptr, int *intValue); | ||
169 | static int hexToLong(char **ptr, long *longValue); | ||
170 | static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault); | ||
171 | void handle_exception(struct gdb_regs *regs); | ||
172 | |||
173 | int kgdb_enabled; | ||
174 | |||
175 | /* | ||
176 | * spin locks for smp case | ||
177 | */ | ||
178 | static DEFINE_SPINLOCK(kgdb_lock); | ||
179 | static raw_spinlock_t kgdb_cpulock[NR_CPUS] = { | ||
180 | [0 ... NR_CPUS-1] = __RAW_SPIN_LOCK_UNLOCKED, | ||
181 | }; | ||
182 | |||
183 | /* | ||
184 | * BUFMAX defines the maximum number of characters in inbound/outbound buffers | ||
185 | * at least NUMREGBYTES*2 are needed for register packets | ||
186 | */ | ||
187 | #define BUFMAX 2048 | ||
188 | |||
189 | static char input_buffer[BUFMAX]; | ||
190 | static char output_buffer[BUFMAX]; | ||
191 | static int initialized; /* !0 means we've been initialized */ | ||
192 | static int kgdb_started; | ||
193 | static const char hexchars[]="0123456789abcdef"; | ||
194 | |||
195 | /* Used to prevent crashes in memory access. Note that they'll crash anyway if | ||
196 | we haven't set up fault handlers yet... */ | ||
197 | int kgdb_read_byte(unsigned char *address, unsigned char *dest); | ||
198 | int kgdb_write_byte(unsigned char val, unsigned char *dest); | ||
199 | |||
200 | /* | ||
201 | * Convert ch from a hex digit to an int | ||
202 | */ | ||
203 | static int hex(unsigned char ch) | ||
204 | { | ||
205 | if (ch >= 'a' && ch <= 'f') | ||
206 | return ch-'a'+10; | ||
207 | if (ch >= '0' && ch <= '9') | ||
208 | return ch-'0'; | ||
209 | if (ch >= 'A' && ch <= 'F') | ||
210 | return ch-'A'+10; | ||
211 | return -1; | ||
212 | } | ||
213 | |||
214 | /* | ||
215 | * scan for the sequence $<data>#<checksum> | ||
216 | */ | ||
217 | static void getpacket(char *buffer) | ||
218 | { | ||
219 | unsigned char checksum; | ||
220 | unsigned char xmitcsum; | ||
221 | int i; | ||
222 | int count; | ||
223 | unsigned char ch; | ||
224 | |||
225 | do { | ||
226 | /* | ||
227 | * wait around for the start character, | ||
228 | * ignore all other characters | ||
229 | */ | ||
230 | while ((ch = (getDebugChar() & 0x7f)) != '$') ; | ||
231 | |||
232 | checksum = 0; | ||
233 | xmitcsum = -1; | ||
234 | count = 0; | ||
235 | |||
236 | /* | ||
237 | * now, read until a # or end of buffer is found | ||
238 | */ | ||
239 | while (count < BUFMAX) { | ||
240 | ch = getDebugChar(); | ||
241 | if (ch == '#') | ||
242 | break; | ||
243 | checksum = checksum + ch; | ||
244 | buffer[count] = ch; | ||
245 | count = count + 1; | ||
246 | } | ||
247 | |||
248 | if (count >= BUFMAX) | ||
249 | continue; | ||
250 | |||
251 | buffer[count] = 0; | ||
252 | |||
253 | if (ch == '#') { | ||
254 | xmitcsum = hex(getDebugChar() & 0x7f) << 4; | ||
255 | xmitcsum |= hex(getDebugChar() & 0x7f); | ||
256 | |||
257 | if (checksum != xmitcsum) | ||
258 | putDebugChar('-'); /* failed checksum */ | ||
259 | else { | ||
260 | putDebugChar('+'); /* successful transfer */ | ||
261 | |||
262 | /* | ||
263 | * if a sequence char is present, | ||
264 | * reply the sequence ID | ||
265 | */ | ||
266 | if (buffer[2] == ':') { | ||
267 | putDebugChar(buffer[0]); | ||
268 | putDebugChar(buffer[1]); | ||
269 | |||
270 | /* | ||
271 | * remove sequence chars from buffer | ||
272 | */ | ||
273 | count = strlen(buffer); | ||
274 | for (i=3; i <= count; i++) | ||
275 | buffer[i-3] = buffer[i]; | ||
276 | } | ||
277 | } | ||
278 | } | ||
279 | } | ||
280 | while (checksum != xmitcsum); | ||
281 | } | ||
282 | |||
283 | /* | ||
284 | * send the packet in buffer. | ||
285 | */ | ||
286 | static void putpacket(char *buffer) | ||
287 | { | ||
288 | unsigned char checksum; | ||
289 | int count; | ||
290 | unsigned char ch; | ||
291 | |||
292 | /* | ||
293 | * $<packet info>#<checksum>. | ||
294 | */ | ||
295 | |||
296 | do { | ||
297 | putDebugChar('$'); | ||
298 | checksum = 0; | ||
299 | count = 0; | ||
300 | |||
301 | while ((ch = buffer[count]) != 0) { | ||
302 | if (!(putDebugChar(ch))) | ||
303 | return; | ||
304 | checksum += ch; | ||
305 | count += 1; | ||
306 | } | ||
307 | |||
308 | putDebugChar('#'); | ||
309 | putDebugChar(hexchars[checksum >> 4]); | ||
310 | putDebugChar(hexchars[checksum & 0xf]); | ||
311 | |||
312 | } | ||
313 | while ((getDebugChar() & 0x7f) != '+'); | ||
314 | } | ||
315 | |||
316 | |||
317 | /* | ||
318 | * Convert the memory pointed to by mem into hex, placing result in buf. | ||
319 | * Return a pointer to the last char put in buf (null), in case of mem fault, | ||
320 | * return 0. | ||
321 | * may_fault is non-zero if we are reading from arbitrary memory, but is currently | ||
322 | * not used. | ||
323 | */ | ||
324 | static unsigned char *mem2hex(char *mem, char *buf, int count, int may_fault) | ||
325 | { | ||
326 | unsigned char ch; | ||
327 | |||
328 | while (count-- > 0) { | ||
329 | if (kgdb_read_byte(mem++, &ch) != 0) | ||
330 | return 0; | ||
331 | *buf++ = hexchars[ch >> 4]; | ||
332 | *buf++ = hexchars[ch & 0xf]; | ||
333 | } | ||
334 | |||
335 | *buf = 0; | ||
336 | |||
337 | return buf; | ||
338 | } | ||
339 | |||
340 | /* | ||
341 | * convert the hex array pointed to by buf into binary to be placed in mem | ||
342 | * return a pointer to the character AFTER the last byte written | ||
343 | * may_fault is non-zero if we are reading from arbitrary memory, but is currently | ||
344 | * not used. | ||
345 | */ | ||
346 | static char *hex2mem(char *buf, char *mem, int count, int binary, int may_fault) | ||
347 | { | ||
348 | int i; | ||
349 | unsigned char ch; | ||
350 | |||
351 | for (i=0; i<count; i++) | ||
352 | { | ||
353 | if (binary) { | ||
354 | ch = *buf++; | ||
355 | if (ch == 0x7d) | ||
356 | ch = 0x20 ^ *buf++; | ||
357 | } | ||
358 | else { | ||
359 | ch = hex(*buf++) << 4; | ||
360 | ch |= hex(*buf++); | ||
361 | } | ||
362 | if (kgdb_write_byte(ch, mem++) != 0) | ||
363 | return 0; | ||
364 | } | ||
365 | |||
366 | return mem; | ||
367 | } | ||
368 | |||
369 | /* | ||
370 | * This table contains the mapping between SPARC hardware trap types, and | ||
371 | * signals, which are primarily what GDB understands. It also indicates | ||
372 | * which hardware traps we need to commandeer when initializing the stub. | ||
373 | */ | ||
374 | static struct hard_trap_info { | ||
375 | unsigned char tt; /* Trap type code for MIPS R3xxx and R4xxx */ | ||
376 | unsigned char signo; /* Signal that we map this trap into */ | ||
377 | } hard_trap_info[] = { | ||
378 | { 6, SIGBUS }, /* instruction bus error */ | ||
379 | { 7, SIGBUS }, /* data bus error */ | ||
380 | { 9, SIGTRAP }, /* break */ | ||
381 | { 10, SIGILL }, /* reserved instruction */ | ||
382 | /* { 11, SIGILL }, */ /* CPU unusable */ | ||
383 | { 12, SIGFPE }, /* overflow */ | ||
384 | { 13, SIGTRAP }, /* trap */ | ||
385 | { 14, SIGSEGV }, /* virtual instruction cache coherency */ | ||
386 | { 15, SIGFPE }, /* floating point exception */ | ||
387 | { 23, SIGSEGV }, /* watch */ | ||
388 | { 31, SIGSEGV }, /* virtual data cache coherency */ | ||
389 | { 0, 0} /* Must be last */ | ||
390 | }; | ||
391 | |||
392 | /* Save the normal trap handlers for user-mode traps. */ | ||
393 | void *saved_vectors[32]; | ||
394 | |||
395 | /* | ||
396 | * Set up exception handlers for tracing and breakpoints | ||
397 | */ | ||
398 | void set_debug_traps(void) | ||
399 | { | ||
400 | struct hard_trap_info *ht; | ||
401 | unsigned long flags; | ||
402 | unsigned char c; | ||
403 | |||
404 | local_irq_save(flags); | ||
405 | for (ht = hard_trap_info; ht->tt && ht->signo; ht++) | ||
406 | saved_vectors[ht->tt] = set_except_vector(ht->tt, trap_low); | ||
407 | |||
408 | putDebugChar('+'); /* 'hello world' */ | ||
409 | /* | ||
410 | * In case GDB is started before us, ack any packets | ||
411 | * (presumably "$?#xx") sitting there. | ||
412 | */ | ||
413 | while((c = getDebugChar()) != '$'); | ||
414 | while((c = getDebugChar()) != '#'); | ||
415 | c = getDebugChar(); /* eat first csum byte */ | ||
416 | c = getDebugChar(); /* eat second csum byte */ | ||
417 | putDebugChar('+'); /* ack it */ | ||
418 | |||
419 | initialized = 1; | ||
420 | local_irq_restore(flags); | ||
421 | } | ||
422 | |||
423 | void restore_debug_traps(void) | ||
424 | { | ||
425 | struct hard_trap_info *ht; | ||
426 | unsigned long flags; | ||
427 | |||
428 | local_irq_save(flags); | ||
429 | for (ht = hard_trap_info; ht->tt && ht->signo; ht++) | ||
430 | set_except_vector(ht->tt, saved_vectors[ht->tt]); | ||
431 | local_irq_restore(flags); | ||
432 | } | ||
433 | |||
434 | /* | ||
435 | * Convert the MIPS hardware trap type code to a Unix signal number. | ||
436 | */ | ||
437 | static int computeSignal(int tt) | ||
438 | { | ||
439 | struct hard_trap_info *ht; | ||
440 | |||
441 | for (ht = hard_trap_info; ht->tt && ht->signo; ht++) | ||
442 | if (ht->tt == tt) | ||
443 | return ht->signo; | ||
444 | |||
445 | return SIGHUP; /* default for things we don't know about */ | ||
446 | } | ||
447 | |||
448 | /* | ||
449 | * While we find nice hex chars, build an int. | ||
450 | * Return number of chars processed. | ||
451 | */ | ||
452 | static int hexToInt(char **ptr, int *intValue) | ||
453 | { | ||
454 | int numChars = 0; | ||
455 | int hexValue; | ||
456 | |||
457 | *intValue = 0; | ||
458 | |||
459 | while (**ptr) { | ||
460 | hexValue = hex(**ptr); | ||
461 | if (hexValue < 0) | ||
462 | break; | ||
463 | |||
464 | *intValue = (*intValue << 4) | hexValue; | ||
465 | numChars ++; | ||
466 | |||
467 | (*ptr)++; | ||
468 | } | ||
469 | |||
470 | return (numChars); | ||
471 | } | ||
472 | |||
473 | static int hexToLong(char **ptr, long *longValue) | ||
474 | { | ||
475 | int numChars = 0; | ||
476 | int hexValue; | ||
477 | |||
478 | *longValue = 0; | ||
479 | |||
480 | while (**ptr) { | ||
481 | hexValue = hex(**ptr); | ||
482 | if (hexValue < 0) | ||
483 | break; | ||
484 | |||
485 | *longValue = (*longValue << 4) | hexValue; | ||
486 | numChars ++; | ||
487 | |||
488 | (*ptr)++; | ||
489 | } | ||
490 | |||
491 | return numChars; | ||
492 | } | ||
493 | |||
494 | |||
495 | #if 0 | ||
496 | /* | ||
497 | * Print registers (on target console) | ||
498 | * Used only to debug the stub... | ||
499 | */ | ||
500 | void show_gdbregs(struct gdb_regs * regs) | ||
501 | { | ||
502 | /* | ||
503 | * Saved main processor registers | ||
504 | */ | ||
505 | printk("$0 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", | ||
506 | regs->reg0, regs->reg1, regs->reg2, regs->reg3, | ||
507 | regs->reg4, regs->reg5, regs->reg6, regs->reg7); | ||
508 | printk("$8 : %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", | ||
509 | regs->reg8, regs->reg9, regs->reg10, regs->reg11, | ||
510 | regs->reg12, regs->reg13, regs->reg14, regs->reg15); | ||
511 | printk("$16: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", | ||
512 | regs->reg16, regs->reg17, regs->reg18, regs->reg19, | ||
513 | regs->reg20, regs->reg21, regs->reg22, regs->reg23); | ||
514 | printk("$24: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", | ||
515 | regs->reg24, regs->reg25, regs->reg26, regs->reg27, | ||
516 | regs->reg28, regs->reg29, regs->reg30, regs->reg31); | ||
517 | |||
518 | /* | ||
519 | * Saved cp0 registers | ||
520 | */ | ||
521 | printk("epc : %08lx\nStatus: %08lx\nCause : %08lx\n", | ||
522 | regs->cp0_epc, regs->cp0_status, regs->cp0_cause); | ||
523 | } | ||
524 | #endif /* dead code */ | ||
525 | |||
526 | /* | ||
527 | * We single-step by setting breakpoints. When an exception | ||
528 | * is handled, we need to restore the instructions hoisted | ||
529 | * when the breakpoints were set. | ||
530 | * | ||
531 | * This is where we save the original instructions. | ||
532 | */ | ||
533 | static struct gdb_bp_save { | ||
534 | unsigned long addr; | ||
535 | unsigned int val; | ||
536 | } step_bp[2]; | ||
537 | |||
538 | #define BP 0x0000000d /* break opcode */ | ||
539 | |||
540 | /* | ||
541 | * Set breakpoint instructions for single stepping. | ||
542 | */ | ||
543 | static void single_step(struct gdb_regs *regs) | ||
544 | { | ||
545 | union mips_instruction insn; | ||
546 | unsigned long targ; | ||
547 | int is_branch, is_cond, i; | ||
548 | |||
549 | targ = regs->cp0_epc; | ||
550 | insn.word = *(unsigned int *)targ; | ||
551 | is_branch = is_cond = 0; | ||
552 | |||
553 | switch (insn.i_format.opcode) { | ||
554 | /* | ||
555 | * jr and jalr are in r_format format. | ||
556 | */ | ||
557 | case spec_op: | ||
558 | switch (insn.r_format.func) { | ||
559 | case jalr_op: | ||
560 | case jr_op: | ||
561 | targ = *(®s->reg0 + insn.r_format.rs); | ||
562 | is_branch = 1; | ||
563 | break; | ||
564 | } | ||
565 | break; | ||
566 | |||
567 | /* | ||
568 | * This group contains: | ||
569 | * bltz_op, bgez_op, bltzl_op, bgezl_op, | ||
570 | * bltzal_op, bgezal_op, bltzall_op, bgezall_op. | ||
571 | */ | ||
572 | case bcond_op: | ||
573 | is_branch = is_cond = 1; | ||
574 | targ += 4 + (insn.i_format.simmediate << 2); | ||
575 | break; | ||
576 | |||
577 | /* | ||
578 | * These are unconditional and in j_format. | ||
579 | */ | ||
580 | case jal_op: | ||
581 | case j_op: | ||
582 | is_branch = 1; | ||
583 | targ += 4; | ||
584 | targ >>= 28; | ||
585 | targ <<= 28; | ||
586 | targ |= (insn.j_format.target << 2); | ||
587 | break; | ||
588 | |||
589 | /* | ||
590 | * These are conditional. | ||
591 | */ | ||
592 | case beq_op: | ||
593 | case beql_op: | ||
594 | case bne_op: | ||
595 | case bnel_op: | ||
596 | case blez_op: | ||
597 | case blezl_op: | ||
598 | case bgtz_op: | ||
599 | case bgtzl_op: | ||
600 | case cop0_op: | ||
601 | case cop1_op: | ||
602 | case cop2_op: | ||
603 | case cop1x_op: | ||
604 | is_branch = is_cond = 1; | ||
605 | targ += 4 + (insn.i_format.simmediate << 2); | ||
606 | break; | ||
607 | } | ||
608 | |||
609 | if (is_branch) { | ||
610 | i = 0; | ||
611 | if (is_cond && targ != (regs->cp0_epc + 8)) { | ||
612 | step_bp[i].addr = regs->cp0_epc + 8; | ||
613 | step_bp[i++].val = *(unsigned *)(regs->cp0_epc + 8); | ||
614 | *(unsigned *)(regs->cp0_epc + 8) = BP; | ||
615 | } | ||
616 | step_bp[i].addr = targ; | ||
617 | step_bp[i].val = *(unsigned *)targ; | ||
618 | *(unsigned *)targ = BP; | ||
619 | } else { | ||
620 | step_bp[0].addr = regs->cp0_epc + 4; | ||
621 | step_bp[0].val = *(unsigned *)(regs->cp0_epc + 4); | ||
622 | *(unsigned *)(regs->cp0_epc + 4) = BP; | ||
623 | } | ||
624 | } | ||
625 | |||
626 | /* | ||
627 | * If asynchronously interrupted by gdb, then we need to set a breakpoint | ||
628 | * at the interrupted instruction so that we wind up stopped with a | ||
629 | * reasonable stack frame. | ||
630 | */ | ||
631 | static struct gdb_bp_save async_bp; | ||
632 | |||
633 | /* | ||
634 | * Swap the interrupted EPC with our asynchronous breakpoint routine. | ||
635 | * This is safer than stuffing the breakpoint in-place, since no cache | ||
636 | * flushes (or resulting smp_call_functions) are required. The | ||
637 | * assumption is that only one CPU will be handling asynchronous bp's, | ||
638 | * and only one can be active at a time. | ||
639 | */ | ||
640 | extern spinlock_t smp_call_lock; | ||
641 | |||
642 | void set_async_breakpoint(unsigned long *epc) | ||
643 | { | ||
644 | /* skip breaking into userland */ | ||
645 | if ((*epc & 0x80000000) == 0) | ||
646 | return; | ||
647 | |||
648 | #ifdef CONFIG_SMP | ||
649 | /* avoid deadlock if someone is make IPC */ | ||
650 | if (spin_is_locked(&smp_call_lock)) | ||
651 | return; | ||
652 | #endif | ||
653 | |||
654 | async_bp.addr = *epc; | ||
655 | *epc = (unsigned long)async_breakpoint; | ||
656 | } | ||
657 | |||
658 | #ifdef CONFIG_SMP | ||
659 | static void kgdb_wait(void *arg) | ||
660 | { | ||
661 | unsigned flags; | ||
662 | int cpu = smp_processor_id(); | ||
663 | |||
664 | local_irq_save(flags); | ||
665 | |||
666 | __raw_spin_lock(&kgdb_cpulock[cpu]); | ||
667 | __raw_spin_unlock(&kgdb_cpulock[cpu]); | ||
668 | |||
669 | local_irq_restore(flags); | ||
670 | } | ||
671 | #endif | ||
672 | |||
673 | /* | ||
674 | * GDB stub needs to call kgdb_wait on all processor with interrupts | ||
675 | * disabled, so it uses it's own special variant. | ||
676 | */ | ||
677 | static int kgdb_smp_call_kgdb_wait(void) | ||
678 | { | ||
679 | #ifdef CONFIG_SMP | ||
680 | cpumask_t mask = cpu_online_map; | ||
681 | struct call_data_struct data; | ||
682 | int cpu = smp_processor_id(); | ||
683 | int cpus; | ||
684 | |||
685 | /* | ||
686 | * Can die spectacularly if this CPU isn't yet marked online | ||
687 | */ | ||
688 | BUG_ON(!cpu_online(cpu)); | ||
689 | |||
690 | cpu_clear(cpu, mask); | ||
691 | cpus = cpus_weight(mask); | ||
692 | if (!cpus) | ||
693 | return 0; | ||
694 | |||
695 | if (spin_is_locked(&smp_call_lock)) { | ||
696 | /* | ||
697 | * Some other processor is trying to make us do something | ||
698 | * but we're not going to respond... give up | ||
699 | */ | ||
700 | return -1; | ||
701 | } | ||
702 | |||
703 | /* | ||
704 | * We will continue here, accepting the fact that | ||
705 | * the kernel may deadlock if another CPU attempts | ||
706 | * to call smp_call_function now... | ||
707 | */ | ||
708 | |||
709 | data.func = kgdb_wait; | ||
710 | data.info = NULL; | ||
711 | atomic_set(&data.started, 0); | ||
712 | data.wait = 0; | ||
713 | |||
714 | spin_lock(&smp_call_lock); | ||
715 | call_data = &data; | ||
716 | mb(); | ||
717 | |||
718 | core_send_ipi_mask(mask, SMP_CALL_FUNCTION); | ||
719 | |||
720 | /* Wait for response */ | ||
721 | /* FIXME: lock-up detection, backtrace on lock-up */ | ||
722 | while (atomic_read(&data.started) != cpus) | ||
723 | barrier(); | ||
724 | |||
725 | call_data = NULL; | ||
726 | spin_unlock(&smp_call_lock); | ||
727 | #endif | ||
728 | |||
729 | return 0; | ||
730 | } | ||
731 | |||
732 | /* | ||
733 | * This function does all command processing for interfacing to gdb. It | ||
734 | * returns 1 if you should skip the instruction at the trap address, 0 | ||
735 | * otherwise. | ||
736 | */ | ||
737 | void handle_exception(struct gdb_regs *regs) | ||
738 | { | ||
739 | int trap; /* Trap type */ | ||
740 | int sigval; | ||
741 | long addr; | ||
742 | int length; | ||
743 | char *ptr; | ||
744 | unsigned long *stack; | ||
745 | int i; | ||
746 | int bflag = 0; | ||
747 | |||
748 | kgdb_started = 1; | ||
749 | |||
750 | /* | ||
751 | * acquire the big kgdb spinlock | ||
752 | */ | ||
753 | if (!spin_trylock(&kgdb_lock)) { | ||
754 | /* | ||
755 | * some other CPU has the lock, we should go back to | ||
756 | * receive the gdb_wait IPC | ||
757 | */ | ||
758 | return; | ||
759 | } | ||
760 | |||
761 | /* | ||
762 | * If we're in async_breakpoint(), restore the real EPC from | ||
763 | * the breakpoint. | ||
764 | */ | ||
765 | if (regs->cp0_epc == (unsigned long)async_breakinst) { | ||
766 | regs->cp0_epc = async_bp.addr; | ||
767 | async_bp.addr = 0; | ||
768 | } | ||
769 | |||
770 | /* | ||
771 | * acquire the CPU spinlocks | ||
772 | */ | ||
773 | for_each_online_cpu(i) | ||
774 | if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0) | ||
775 | panic("kgdb: couldn't get cpulock %d\n", i); | ||
776 | |||
777 | /* | ||
778 | * force other cpus to enter kgdb | ||
779 | */ | ||
780 | kgdb_smp_call_kgdb_wait(); | ||
781 | |||
782 | /* | ||
783 | * If we're in breakpoint() increment the PC | ||
784 | */ | ||
785 | trap = (regs->cp0_cause & 0x7c) >> 2; | ||
786 | if (trap == 9 && regs->cp0_epc == (unsigned long)breakinst) | ||
787 | regs->cp0_epc += 4; | ||
788 | |||
789 | /* | ||
790 | * If we were single_stepping, restore the opcodes hoisted | ||
791 | * for the breakpoint[s]. | ||
792 | */ | ||
793 | if (step_bp[0].addr) { | ||
794 | *(unsigned *)step_bp[0].addr = step_bp[0].val; | ||
795 | step_bp[0].addr = 0; | ||
796 | |||
797 | if (step_bp[1].addr) { | ||
798 | *(unsigned *)step_bp[1].addr = step_bp[1].val; | ||
799 | step_bp[1].addr = 0; | ||
800 | } | ||
801 | } | ||
802 | |||
803 | stack = (long *)regs->reg29; /* stack ptr */ | ||
804 | sigval = computeSignal(trap); | ||
805 | |||
806 | /* | ||
807 | * reply to host that an exception has occurred | ||
808 | */ | ||
809 | ptr = output_buffer; | ||
810 | |||
811 | /* | ||
812 | * Send trap type (converted to signal) | ||
813 | */ | ||
814 | *ptr++ = 'T'; | ||
815 | *ptr++ = hexchars[sigval >> 4]; | ||
816 | *ptr++ = hexchars[sigval & 0xf]; | ||
817 | |||
818 | /* | ||
819 | * Send Error PC | ||
820 | */ | ||
821 | *ptr++ = hexchars[REG_EPC >> 4]; | ||
822 | *ptr++ = hexchars[REG_EPC & 0xf]; | ||
823 | *ptr++ = ':'; | ||
824 | ptr = mem2hex((char *)®s->cp0_epc, ptr, sizeof(long), 0); | ||
825 | *ptr++ = ';'; | ||
826 | |||
827 | /* | ||
828 | * Send frame pointer | ||
829 | */ | ||
830 | *ptr++ = hexchars[REG_FP >> 4]; | ||
831 | *ptr++ = hexchars[REG_FP & 0xf]; | ||
832 | *ptr++ = ':'; | ||
833 | ptr = mem2hex((char *)®s->reg30, ptr, sizeof(long), 0); | ||
834 | *ptr++ = ';'; | ||
835 | |||
836 | /* | ||
837 | * Send stack pointer | ||
838 | */ | ||
839 | *ptr++ = hexchars[REG_SP >> 4]; | ||
840 | *ptr++ = hexchars[REG_SP & 0xf]; | ||
841 | *ptr++ = ':'; | ||
842 | ptr = mem2hex((char *)®s->reg29, ptr, sizeof(long), 0); | ||
843 | *ptr++ = ';'; | ||
844 | |||
845 | *ptr++ = 0; | ||
846 | putpacket(output_buffer); /* send it off... */ | ||
847 | |||
848 | /* | ||
849 | * Wait for input from remote GDB | ||
850 | */ | ||
851 | while (1) { | ||
852 | output_buffer[0] = 0; | ||
853 | getpacket(input_buffer); | ||
854 | |||
855 | switch (input_buffer[0]) | ||
856 | { | ||
857 | case '?': | ||
858 | output_buffer[0] = 'S'; | ||
859 | output_buffer[1] = hexchars[sigval >> 4]; | ||
860 | output_buffer[2] = hexchars[sigval & 0xf]; | ||
861 | output_buffer[3] = 0; | ||
862 | break; | ||
863 | |||
864 | /* | ||
865 | * Detach debugger; let CPU run | ||
866 | */ | ||
867 | case 'D': | ||
868 | putpacket(output_buffer); | ||
869 | goto finish_kgdb; | ||
870 | break; | ||
871 | |||
872 | case 'd': | ||
873 | /* toggle debug flag */ | ||
874 | break; | ||
875 | |||
876 | /* | ||
877 | * Return the value of the CPU registers | ||
878 | */ | ||
879 | case 'g': | ||
880 | ptr = output_buffer; | ||
881 | ptr = mem2hex((char *)®s->reg0, ptr, 32*sizeof(long), 0); /* r0...r31 */ | ||
882 | ptr = mem2hex((char *)®s->cp0_status, ptr, 6*sizeof(long), 0); /* cp0 */ | ||
883 | ptr = mem2hex((char *)®s->fpr0, ptr, 32*sizeof(long), 0); /* f0...31 */ | ||
884 | ptr = mem2hex((char *)®s->cp1_fsr, ptr, 2*sizeof(long), 0); /* cp1 */ | ||
885 | ptr = mem2hex((char *)®s->frame_ptr, ptr, 2*sizeof(long), 0); /* frp */ | ||
886 | ptr = mem2hex((char *)®s->cp0_index, ptr, 16*sizeof(long), 0); /* cp0 */ | ||
887 | break; | ||
888 | |||
889 | /* | ||
890 | * set the value of the CPU registers - return OK | ||
891 | */ | ||
892 | case 'G': | ||
893 | { | ||
894 | ptr = &input_buffer[1]; | ||
895 | hex2mem(ptr, (char *)®s->reg0, 32*sizeof(long), 0, 0); | ||
896 | ptr += 32*(2*sizeof(long)); | ||
897 | hex2mem(ptr, (char *)®s->cp0_status, 6*sizeof(long), 0, 0); | ||
898 | ptr += 6*(2*sizeof(long)); | ||
899 | hex2mem(ptr, (char *)®s->fpr0, 32*sizeof(long), 0, 0); | ||
900 | ptr += 32*(2*sizeof(long)); | ||
901 | hex2mem(ptr, (char *)®s->cp1_fsr, 2*sizeof(long), 0, 0); | ||
902 | ptr += 2*(2*sizeof(long)); | ||
903 | hex2mem(ptr, (char *)®s->frame_ptr, 2*sizeof(long), 0, 0); | ||
904 | ptr += 2*(2*sizeof(long)); | ||
905 | hex2mem(ptr, (char *)®s->cp0_index, 16*sizeof(long), 0, 0); | ||
906 | strcpy(output_buffer, "OK"); | ||
907 | } | ||
908 | break; | ||
909 | |||
910 | /* | ||
911 | * mAA..AA,LLLL Read LLLL bytes at address AA..AA | ||
912 | */ | ||
913 | case 'm': | ||
914 | ptr = &input_buffer[1]; | ||
915 | |||
916 | if (hexToLong(&ptr, &addr) | ||
917 | && *ptr++ == ',' | ||
918 | && hexToInt(&ptr, &length)) { | ||
919 | if (mem2hex((char *)addr, output_buffer, length, 1)) | ||
920 | break; | ||
921 | strcpy(output_buffer, "E03"); | ||
922 | } else | ||
923 | strcpy(output_buffer, "E01"); | ||
924 | break; | ||
925 | |||
926 | /* | ||
927 | * XAA..AA,LLLL: Write LLLL escaped binary bytes at address AA.AA | ||
928 | */ | ||
929 | case 'X': | ||
930 | bflag = 1; | ||
931 | /* fall through */ | ||
932 | |||
933 | /* | ||
934 | * MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK | ||
935 | */ | ||
936 | case 'M': | ||
937 | ptr = &input_buffer[1]; | ||
938 | |||
939 | if (hexToLong(&ptr, &addr) | ||
940 | && *ptr++ == ',' | ||
941 | && hexToInt(&ptr, &length) | ||
942 | && *ptr++ == ':') { | ||
943 | if (hex2mem(ptr, (char *)addr, length, bflag, 1)) | ||
944 | strcpy(output_buffer, "OK"); | ||
945 | else | ||
946 | strcpy(output_buffer, "E03"); | ||
947 | } | ||
948 | else | ||
949 | strcpy(output_buffer, "E02"); | ||
950 | break; | ||
951 | |||
952 | /* | ||
953 | * cAA..AA Continue at address AA..AA(optional) | ||
954 | */ | ||
955 | case 'c': | ||
956 | /* try to read optional parameter, pc unchanged if no parm */ | ||
957 | |||
958 | ptr = &input_buffer[1]; | ||
959 | if (hexToLong(&ptr, &addr)) | ||
960 | regs->cp0_epc = addr; | ||
961 | |||
962 | goto exit_kgdb_exception; | ||
963 | break; | ||
964 | |||
965 | /* | ||
966 | * kill the program; let us try to restart the machine | ||
967 | * Reset the whole machine. | ||
968 | */ | ||
969 | case 'k': | ||
970 | case 'r': | ||
971 | machine_restart("kgdb restarts machine"); | ||
972 | break; | ||
973 | |||
974 | /* | ||
975 | * Step to next instruction | ||
976 | */ | ||
977 | case 's': | ||
978 | /* | ||
979 | * There is no single step insn in the MIPS ISA, so we | ||
980 | * use breakpoints and continue, instead. | ||
981 | */ | ||
982 | single_step(regs); | ||
983 | goto exit_kgdb_exception; | ||
984 | /* NOTREACHED */ | ||
985 | break; | ||
986 | |||
987 | /* | ||
988 | * Set baud rate (bBB) | ||
989 | * FIXME: Needs to be written | ||
990 | */ | ||
991 | case 'b': | ||
992 | { | ||
993 | #if 0 | ||
994 | int baudrate; | ||
995 | extern void set_timer_3(); | ||
996 | |||
997 | ptr = &input_buffer[1]; | ||
998 | if (!hexToInt(&ptr, &baudrate)) | ||
999 | { | ||
1000 | strcpy(output_buffer, "B01"); | ||
1001 | break; | ||
1002 | } | ||
1003 | |||
1004 | /* Convert baud rate to uart clock divider */ | ||
1005 | |||
1006 | switch (baudrate) | ||
1007 | { | ||
1008 | case 38400: | ||
1009 | baudrate = 16; | ||
1010 | break; | ||
1011 | case 19200: | ||
1012 | baudrate = 33; | ||
1013 | break; | ||
1014 | case 9600: | ||
1015 | baudrate = 65; | ||
1016 | break; | ||
1017 | default: | ||
1018 | baudrate = 0; | ||
1019 | strcpy(output_buffer, "B02"); | ||
1020 | goto x1; | ||
1021 | } | ||
1022 | |||
1023 | if (baudrate) { | ||
1024 | putpacket("OK"); /* Ack before changing speed */ | ||
1025 | set_timer_3(baudrate); /* Set it */ | ||
1026 | } | ||
1027 | #endif | ||
1028 | } | ||
1029 | break; | ||
1030 | |||
1031 | } /* switch */ | ||
1032 | |||
1033 | /* | ||
1034 | * reply to the request | ||
1035 | */ | ||
1036 | |||
1037 | putpacket(output_buffer); | ||
1038 | |||
1039 | } /* while */ | ||
1040 | |||
1041 | return; | ||
1042 | |||
1043 | finish_kgdb: | ||
1044 | restore_debug_traps(); | ||
1045 | |||
1046 | exit_kgdb_exception: | ||
1047 | /* release locks so other CPUs can go */ | ||
1048 | for_each_online_cpu(i) | ||
1049 | __raw_spin_unlock(&kgdb_cpulock[i]); | ||
1050 | spin_unlock(&kgdb_lock); | ||
1051 | |||
1052 | __flush_cache_all(); | ||
1053 | return; | ||
1054 | } | ||
1055 | |||
1056 | /* | ||
1057 | * This function will generate a breakpoint exception. It is used at the | ||
1058 | * beginning of a program to sync up with a debugger and can be used | ||
1059 | * otherwise as a quick means to stop program execution and "break" into | ||
1060 | * the debugger. | ||
1061 | */ | ||
1062 | void breakpoint(void) | ||
1063 | { | ||
1064 | if (!initialized) | ||
1065 | return; | ||
1066 | |||
1067 | __asm__ __volatile__( | ||
1068 | ".globl breakinst\n\t" | ||
1069 | ".set\tnoreorder\n\t" | ||
1070 | "nop\n" | ||
1071 | "breakinst:\tbreak\n\t" | ||
1072 | "nop\n\t" | ||
1073 | ".set\treorder" | ||
1074 | ); | ||
1075 | } | ||
1076 | |||
1077 | /* Nothing but the break; don't pollute any registers */ | ||
1078 | void async_breakpoint(void) | ||
1079 | { | ||
1080 | __asm__ __volatile__( | ||
1081 | ".globl async_breakinst\n\t" | ||
1082 | ".set\tnoreorder\n\t" | ||
1083 | "nop\n" | ||
1084 | "async_breakinst:\tbreak\n\t" | ||
1085 | "nop\n\t" | ||
1086 | ".set\treorder" | ||
1087 | ); | ||
1088 | } | ||
1089 | |||
1090 | void adel(void) | ||
1091 | { | ||
1092 | __asm__ __volatile__( | ||
1093 | ".globl\tadel\n\t" | ||
1094 | "lui\t$8,0x8000\n\t" | ||
1095 | "lw\t$9,1($8)\n\t" | ||
1096 | ); | ||
1097 | } | ||
1098 | |||
1099 | /* | ||
1100 | * malloc is needed by gdb client in "call func()", even a private one | ||
1101 | * will make gdb happy | ||
1102 | */ | ||
1103 | static void __used *malloc(size_t size) | ||
1104 | { | ||
1105 | return kmalloc(size, GFP_ATOMIC); | ||
1106 | } | ||
1107 | |||
1108 | static void __used free(void *where) | ||
1109 | { | ||
1110 | kfree(where); | ||
1111 | } | ||
1112 | |||
1113 | #ifdef CONFIG_GDB_CONSOLE | ||
1114 | |||
1115 | void gdb_putsn(const char *str, int l) | ||
1116 | { | ||
1117 | char outbuf[18]; | ||
1118 | |||
1119 | if (!kgdb_started) | ||
1120 | return; | ||
1121 | |||
1122 | outbuf[0]='O'; | ||
1123 | |||
1124 | while(l) { | ||
1125 | int i = (l>8)?8:l; | ||
1126 | mem2hex((char *)str, &outbuf[1], i, 0); | ||
1127 | outbuf[(i*2)+1]=0; | ||
1128 | putpacket(outbuf); | ||
1129 | str += i; | ||
1130 | l -= i; | ||
1131 | } | ||
1132 | } | ||
1133 | |||
1134 | static void gdb_console_write(struct console *con, const char *s, unsigned n) | ||
1135 | { | ||
1136 | gdb_putsn(s, n); | ||
1137 | } | ||
1138 | |||
1139 | static struct console gdb_console = { | ||
1140 | .name = "gdb", | ||
1141 | .write = gdb_console_write, | ||
1142 | .flags = CON_PRINTBUFFER, | ||
1143 | .index = -1 | ||
1144 | }; | ||
1145 | |||
1146 | static int __init register_gdb_console(void) | ||
1147 | { | ||
1148 | register_console(&gdb_console); | ||
1149 | |||
1150 | return 0; | ||
1151 | } | ||
1152 | |||
1153 | console_initcall(register_gdb_console); | ||
1154 | |||
1155 | #endif | ||
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index 6045b9a51a35..4b4007b3083a 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c | |||
@@ -21,11 +21,16 @@ | |||
21 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
23 | #include <linux/kallsyms.h> | 23 | #include <linux/kallsyms.h> |
24 | #include <linux/kgdb.h> | ||
24 | 25 | ||
25 | #include <asm/atomic.h> | 26 | #include <asm/atomic.h> |
26 | #include <asm/system.h> | 27 | #include <asm/system.h> |
27 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
28 | 29 | ||
30 | #ifdef CONFIG_KGDB | ||
31 | int kgdb_early_setup; | ||
32 | #endif | ||
33 | |||
29 | static unsigned long irq_map[NR_IRQS / BITS_PER_LONG]; | 34 | static unsigned long irq_map[NR_IRQS / BITS_PER_LONG]; |
30 | 35 | ||
31 | int allocate_irqno(void) | 36 | int allocate_irqno(void) |
@@ -126,33 +131,22 @@ asmlinkage void spurious_interrupt(void) | |||
126 | atomic_inc(&irq_err_count); | 131 | atomic_inc(&irq_err_count); |
127 | } | 132 | } |
128 | 133 | ||
129 | #ifdef CONFIG_KGDB | ||
130 | extern void breakpoint(void); | ||
131 | extern void set_debug_traps(void); | ||
132 | |||
133 | static int kgdb_flag = 1; | ||
134 | static int __init nokgdb(char *str) | ||
135 | { | ||
136 | kgdb_flag = 0; | ||
137 | return 1; | ||
138 | } | ||
139 | __setup("nokgdb", nokgdb); | ||
140 | #endif | ||
141 | |||
142 | void __init init_IRQ(void) | 134 | void __init init_IRQ(void) |
143 | { | 135 | { |
144 | int i; | 136 | int i; |
145 | 137 | ||
138 | #ifdef CONFIG_KGDB | ||
139 | if (kgdb_early_setup) | ||
140 | return; | ||
141 | #endif | ||
142 | |||
146 | for (i = 0; i < NR_IRQS; i++) | 143 | for (i = 0; i < NR_IRQS; i++) |
147 | set_irq_noprobe(i); | 144 | set_irq_noprobe(i); |
148 | 145 | ||
149 | arch_init_irq(); | 146 | arch_init_irq(); |
150 | 147 | ||
151 | #ifdef CONFIG_KGDB | 148 | #ifdef CONFIG_KGDB |
152 | if (kgdb_flag) { | 149 | if (!kgdb_early_setup) |
153 | printk("Wait for gdb client connection ...\n"); | 150 | kgdb_early_setup = 1; |
154 | set_debug_traps(); | ||
155 | breakpoint(); | ||
156 | } | ||
157 | #endif | 151 | #endif |
158 | } | 152 | } |
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c new file mode 100644 index 000000000000..c5a8b2d21ca4 --- /dev/null +++ b/arch/mips/kernel/kgdb.c | |||
@@ -0,0 +1,281 @@ | |||
1 | /* | ||
2 | * Originally written by Glenn Engel, Lake Stevens Instrument Division | ||
3 | * | ||
4 | * Contributed by HP Systems | ||
5 | * | ||
6 | * Modified for Linux/MIPS (and MIPS in general) by Andreas Busse | ||
7 | * Send complaints, suggestions etc. to <andy@waldorf-gmbh.de> | ||
8 | * | ||
9 | * Copyright (C) 1995 Andreas Busse | ||
10 | * | ||
11 | * Copyright (C) 2003 MontaVista Software Inc. | ||
12 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
13 | * | ||
14 | * Copyright (C) 2004-2005 MontaVista Software Inc. | ||
15 | * Author: Manish Lachwani, mlachwani@mvista.com or manish@koffee-break.com | ||
16 | * | ||
17 | * Copyright (C) 2007-2008 Wind River Systems, Inc. | ||
18 | * Author/Maintainer: Jason Wessel, jason.wessel@windriver.com | ||
19 | * | ||
20 | * This file is licensed under the terms of the GNU General Public License | ||
21 | * version 2. This program is licensed "as is" without any warranty of any | ||
22 | * kind, whether express or implied. | ||
23 | */ | ||
24 | |||
25 | #include <linux/ptrace.h> /* for linux pt_regs struct */ | ||
26 | #include <linux/kgdb.h> | ||
27 | #include <linux/kdebug.h> | ||
28 | #include <linux/sched.h> | ||
29 | #include <asm/inst.h> | ||
30 | #include <asm/fpu.h> | ||
31 | #include <asm/cacheflush.h> | ||
32 | #include <asm/processor.h> | ||
33 | #include <asm/sigcontext.h> | ||
34 | |||
35 | static struct hard_trap_info { | ||
36 | unsigned char tt; /* Trap type code for MIPS R3xxx and R4xxx */ | ||
37 | unsigned char signo; /* Signal that we map this trap into */ | ||
38 | } hard_trap_info[] = { | ||
39 | { 6, SIGBUS }, /* instruction bus error */ | ||
40 | { 7, SIGBUS }, /* data bus error */ | ||
41 | { 9, SIGTRAP }, /* break */ | ||
42 | /* { 11, SIGILL }, */ /* CPU unusable */ | ||
43 | { 12, SIGFPE }, /* overflow */ | ||
44 | { 13, SIGTRAP }, /* trap */ | ||
45 | { 14, SIGSEGV }, /* virtual instruction cache coherency */ | ||
46 | { 15, SIGFPE }, /* floating point exception */ | ||
47 | { 23, SIGSEGV }, /* watch */ | ||
48 | { 31, SIGSEGV }, /* virtual data cache coherency */ | ||
49 | { 0, 0} /* Must be last */ | ||
50 | }; | ||
51 | |||
52 | void arch_kgdb_breakpoint(void) | ||
53 | { | ||
54 | __asm__ __volatile__( | ||
55 | ".globl breakinst\n\t" | ||
56 | ".set\tnoreorder\n\t" | ||
57 | "nop\n" | ||
58 | "breakinst:\tbreak\n\t" | ||
59 | "nop\n\t" | ||
60 | ".set\treorder"); | ||
61 | } | ||
62 | |||
63 | static void kgdb_call_nmi_hook(void *ignored) | ||
64 | { | ||
65 | kgdb_nmicallback(raw_smp_processor_id(), (void *)0); | ||
66 | } | ||
67 | |||
68 | void kgdb_roundup_cpus(unsigned long flags) | ||
69 | { | ||
70 | local_irq_enable(); | ||
71 | smp_call_function(kgdb_call_nmi_hook, NULL, NULL); | ||
72 | local_irq_disable(); | ||
73 | } | ||
74 | |||
75 | static int compute_signal(int tt) | ||
76 | { | ||
77 | struct hard_trap_info *ht; | ||
78 | |||
79 | for (ht = hard_trap_info; ht->tt && ht->signo; ht++) | ||
80 | if (ht->tt == tt) | ||
81 | return ht->signo; | ||
82 | |||
83 | return SIGHUP; /* default for things we don't know about */ | ||
84 | } | ||
85 | |||
86 | void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) | ||
87 | { | ||
88 | int reg; | ||
89 | |||
90 | #if (KGDB_GDB_REG_SIZE == 32) | ||
91 | u32 *ptr = (u32 *)gdb_regs; | ||
92 | #else | ||
93 | u64 *ptr = (u64 *)gdb_regs; | ||
94 | #endif | ||
95 | |||
96 | for (reg = 0; reg < 32; reg++) | ||
97 | *(ptr++) = regs->regs[reg]; | ||
98 | |||
99 | *(ptr++) = regs->cp0_status; | ||
100 | *(ptr++) = regs->lo; | ||
101 | *(ptr++) = regs->hi; | ||
102 | *(ptr++) = regs->cp0_badvaddr; | ||
103 | *(ptr++) = regs->cp0_cause; | ||
104 | *(ptr++) = regs->cp0_epc; | ||
105 | |||
106 | /* FP REGS */ | ||
107 | if (!(current && (regs->cp0_status & ST0_CU1))) | ||
108 | return; | ||
109 | |||
110 | save_fp(current); | ||
111 | for (reg = 0; reg < 32; reg++) | ||
112 | *(ptr++) = current->thread.fpu.fpr[reg]; | ||
113 | } | ||
114 | |||
115 | void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) | ||
116 | { | ||
117 | int reg; | ||
118 | |||
119 | #if (KGDB_GDB_REG_SIZE == 32) | ||
120 | const u32 *ptr = (u32 *)gdb_regs; | ||
121 | #else | ||
122 | const u64 *ptr = (u64 *)gdb_regs; | ||
123 | #endif | ||
124 | |||
125 | for (reg = 0; reg < 32; reg++) | ||
126 | regs->regs[reg] = *(ptr++); | ||
127 | |||
128 | regs->cp0_status = *(ptr++); | ||
129 | regs->lo = *(ptr++); | ||
130 | regs->hi = *(ptr++); | ||
131 | regs->cp0_badvaddr = *(ptr++); | ||
132 | regs->cp0_cause = *(ptr++); | ||
133 | regs->cp0_epc = *(ptr++); | ||
134 | |||
135 | /* FP REGS from current */ | ||
136 | if (!(current && (regs->cp0_status & ST0_CU1))) | ||
137 | return; | ||
138 | |||
139 | for (reg = 0; reg < 32; reg++) | ||
140 | current->thread.fpu.fpr[reg] = *(ptr++); | ||
141 | restore_fp(current); | ||
142 | } | ||
143 | |||
144 | /* | ||
145 | * Similar to regs_to_gdb_regs() except that process is sleeping and so | ||
146 | * we may not be able to get all the info. | ||
147 | */ | ||
148 | void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) | ||
149 | { | ||
150 | int reg; | ||
151 | struct thread_info *ti = task_thread_info(p); | ||
152 | unsigned long ksp = (unsigned long)ti + THREAD_SIZE - 32; | ||
153 | struct pt_regs *regs = (struct pt_regs *)ksp - 1; | ||
154 | #if (KGDB_GDB_REG_SIZE == 32) | ||
155 | u32 *ptr = (u32 *)gdb_regs; | ||
156 | #else | ||
157 | u64 *ptr = (u64 *)gdb_regs; | ||
158 | #endif | ||
159 | |||
160 | for (reg = 0; reg < 16; reg++) | ||
161 | *(ptr++) = regs->regs[reg]; | ||
162 | |||
163 | /* S0 - S7 */ | ||
164 | for (reg = 16; reg < 24; reg++) | ||
165 | *(ptr++) = regs->regs[reg]; | ||
166 | |||
167 | for (reg = 24; reg < 28; reg++) | ||
168 | *(ptr++) = 0; | ||
169 | |||
170 | /* GP, SP, FP, RA */ | ||
171 | for (reg = 28; reg < 32; reg++) | ||
172 | *(ptr++) = regs->regs[reg]; | ||
173 | |||
174 | *(ptr++) = regs->cp0_status; | ||
175 | *(ptr++) = regs->lo; | ||
176 | *(ptr++) = regs->hi; | ||
177 | *(ptr++) = regs->cp0_badvaddr; | ||
178 | *(ptr++) = regs->cp0_cause; | ||
179 | *(ptr++) = regs->cp0_epc; | ||
180 | } | ||
181 | |||
182 | /* | ||
183 | * Calls linux_debug_hook before the kernel dies. If KGDB is enabled, | ||
184 | * then try to fall into the debugger | ||
185 | */ | ||
186 | static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | ||
187 | void *ptr) | ||
188 | { | ||
189 | struct die_args *args = (struct die_args *)ptr; | ||
190 | struct pt_regs *regs = args->regs; | ||
191 | int trap = (regs->cp0_cause & 0x7c) >> 2; | ||
192 | |||
193 | if (fixup_exception(regs)) | ||
194 | return NOTIFY_DONE; | ||
195 | |||
196 | /* Userpace events, ignore. */ | ||
197 | if (user_mode(regs)) | ||
198 | return NOTIFY_DONE; | ||
199 | |||
200 | if (atomic_read(&kgdb_active) != -1) | ||
201 | kgdb_nmicallback(smp_processor_id(), regs); | ||
202 | |||
203 | if (kgdb_handle_exception(trap, compute_signal(trap), 0, regs)) | ||
204 | return NOTIFY_DONE; | ||
205 | |||
206 | if (atomic_read(&kgdb_setting_breakpoint)) | ||
207 | if ((trap == 9) && (regs->cp0_epc == (unsigned long)breakinst)) | ||
208 | regs->cp0_epc += 4; | ||
209 | |||
210 | /* In SMP mode, __flush_cache_all does IPI */ | ||
211 | local_irq_enable(); | ||
212 | __flush_cache_all(); | ||
213 | |||
214 | return NOTIFY_STOP; | ||
215 | } | ||
216 | |||
217 | static struct notifier_block kgdb_notifier = { | ||
218 | .notifier_call = kgdb_mips_notify, | ||
219 | }; | ||
220 | |||
221 | /* | ||
222 | * Handle the 's' and 'c' commands | ||
223 | */ | ||
224 | int kgdb_arch_handle_exception(int vector, int signo, int err_code, | ||
225 | char *remcom_in_buffer, char *remcom_out_buffer, | ||
226 | struct pt_regs *regs) | ||
227 | { | ||
228 | char *ptr; | ||
229 | unsigned long address; | ||
230 | int cpu = smp_processor_id(); | ||
231 | |||
232 | switch (remcom_in_buffer[0]) { | ||
233 | case 's': | ||
234 | case 'c': | ||
235 | /* handle the optional parameter */ | ||
236 | ptr = &remcom_in_buffer[1]; | ||
237 | if (kgdb_hex2long(&ptr, &address)) | ||
238 | regs->cp0_epc = address; | ||
239 | |||
240 | atomic_set(&kgdb_cpu_doing_single_step, -1); | ||
241 | if (remcom_in_buffer[0] == 's') | ||
242 | if (kgdb_contthread) | ||
243 | atomic_set(&kgdb_cpu_doing_single_step, cpu); | ||
244 | |||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | return -1; | ||
249 | } | ||
250 | |||
251 | struct kgdb_arch arch_kgdb_ops; | ||
252 | |||
253 | /* | ||
254 | * We use kgdb_early_setup so that functions we need to call now don't | ||
255 | * cause trouble when called again later. | ||
256 | */ | ||
257 | int kgdb_arch_init(void) | ||
258 | { | ||
259 | union mips_instruction insn = { | ||
260 | .r_format = { | ||
261 | .opcode = spec_op, | ||
262 | .func = break_op, | ||
263 | } | ||
264 | }; | ||
265 | memcpy(arch_kgdb_ops.gdb_bpt_instr, insn.byte, BREAK_INSTR_SIZE); | ||
266 | |||
267 | register_die_notifier(&kgdb_notifier); | ||
268 | |||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | /* | ||
273 | * kgdb_arch_exit - Perform any architecture specific uninitalization. | ||
274 | * | ||
275 | * This function will handle the uninitalization of any architecture | ||
276 | * specific callbacks, for dynamic registration and unregistration. | ||
277 | */ | ||
278 | void kgdb_arch_exit(void) | ||
279 | { | ||
280 | unregister_die_notifier(&kgdb_notifier); | ||
281 | } | ||
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index b8ea4e9d0d87..426cced1e9dc 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/ptrace.h> | 25 | #include <linux/ptrace.h> |
26 | #include <linux/kgdb.h> | ||
27 | #include <linux/kdebug.h> | ||
26 | 28 | ||
27 | #include <asm/bootinfo.h> | 29 | #include <asm/bootinfo.h> |
28 | #include <asm/branch.h> | 30 | #include <asm/branch.h> |
@@ -425,6 +427,10 @@ asmlinkage void do_be(struct pt_regs *regs) | |||
425 | printk(KERN_ALERT "%s bus error, epc == %0*lx, ra == %0*lx\n", | 427 | printk(KERN_ALERT "%s bus error, epc == %0*lx, ra == %0*lx\n", |
426 | data ? "Data" : "Instruction", | 428 | data ? "Data" : "Instruction", |
427 | field, regs->cp0_epc, field, regs->regs[31]); | 429 | field, regs->cp0_epc, field, regs->regs[31]); |
430 | if (notify_die(DIE_OOPS, "bus error", regs, SIGBUS, 0, 0) | ||
431 | == NOTIFY_STOP) | ||
432 | return; | ||
433 | |||
428 | die_if_kernel("Oops", regs); | 434 | die_if_kernel("Oops", regs); |
429 | force_sig(SIGBUS, current); | 435 | force_sig(SIGBUS, current); |
430 | } | 436 | } |
@@ -623,6 +629,9 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) | |||
623 | { | 629 | { |
624 | siginfo_t info; | 630 | siginfo_t info; |
625 | 631 | ||
632 | if (notify_die(DIE_FP, "FP exception", regs, SIGFPE, 0, 0) | ||
633 | == NOTIFY_STOP) | ||
634 | return; | ||
626 | die_if_kernel("FP exception in kernel code", regs); | 635 | die_if_kernel("FP exception in kernel code", regs); |
627 | 636 | ||
628 | if (fcr31 & FPU_CSR_UNI_X) { | 637 | if (fcr31 & FPU_CSR_UNI_X) { |
@@ -682,6 +691,9 @@ static void do_trap_or_bp(struct pt_regs *regs, unsigned int code, | |||
682 | siginfo_t info; | 691 | siginfo_t info; |
683 | char b[40]; | 692 | char b[40]; |
684 | 693 | ||
694 | if (notify_die(DIE_TRAP, str, regs, code, 0, 0) == NOTIFY_STOP) | ||
695 | return; | ||
696 | |||
685 | /* | 697 | /* |
686 | * A short test says that IRIX 5.3 sends SIGTRAP for all trap | 698 | * A short test says that IRIX 5.3 sends SIGTRAP for all trap |
687 | * insns, even for trap and break codes that indicate arithmetic | 699 | * insns, even for trap and break codes that indicate arithmetic |
@@ -762,6 +774,10 @@ asmlinkage void do_ri(struct pt_regs *regs) | |||
762 | unsigned int opcode = 0; | 774 | unsigned int opcode = 0; |
763 | int status = -1; | 775 | int status = -1; |
764 | 776 | ||
777 | if (notify_die(DIE_RI, "RI Fault", regs, SIGSEGV, 0, 0) | ||
778 | == NOTIFY_STOP) | ||
779 | return; | ||
780 | |||
765 | die_if_kernel("Reserved instruction in kernel code", regs); | 781 | die_if_kernel("Reserved instruction in kernel code", regs); |
766 | 782 | ||
767 | if (unlikely(compute_return_epc(regs) < 0)) | 783 | if (unlikely(compute_return_epc(regs) < 0)) |
@@ -1537,6 +1553,11 @@ void __init trap_init(void) | |||
1537 | extern char except_vec4; | 1553 | extern char except_vec4; |
1538 | unsigned long i; | 1554 | unsigned long i; |
1539 | 1555 | ||
1556 | #if defined(CONFIG_KGDB) | ||
1557 | if (kgdb_early_setup) | ||
1558 | return; /* Already done */ | ||
1559 | #endif | ||
1560 | |||
1540 | if (cpu_has_veic || cpu_has_vint) | 1561 | if (cpu_has_veic || cpu_has_vint) |
1541 | ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64); | 1562 | ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64); |
1542 | else | 1563 | else |
diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c index a782549ac80e..f0cf46adb978 100644 --- a/arch/mips/mm/tlb-r3k.c +++ b/arch/mips/mm/tlb-r3k.c | |||
@@ -246,10 +246,6 @@ void __init add_wired_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
246 | old_pagemask = read_c0_pagemask(); | 246 | old_pagemask = read_c0_pagemask(); |
247 | w = read_c0_wired(); | 247 | w = read_c0_wired(); |
248 | write_c0_wired(w + 1); | 248 | write_c0_wired(w + 1); |
249 | if (read_c0_wired() != w + 1) { | ||
250 | printk("[tlbwired] No WIRED reg?\n"); | ||
251 | return; | ||
252 | } | ||
253 | write_c0_index(w << 8); | 249 | write_c0_index(w << 8); |
254 | write_c0_pagemask(pagemask); | 250 | write_c0_pagemask(pagemask); |
255 | write_c0_entryhi(entryhi); | 251 | write_c0_entryhi(entryhi); |
diff --git a/arch/mips/mti-malta/Makefile b/arch/mips/mti-malta/Makefile index f8064446e812..3b7dd722c32a 100644 --- a/arch/mips/mti-malta/Makefile +++ b/arch/mips/mti-malta/Makefile | |||
@@ -13,7 +13,6 @@ obj-y := malta-amon.o malta-cmdline.o \ | |||
13 | 13 | ||
14 | obj-$(CONFIG_EARLY_PRINTK) += malta-console.o | 14 | obj-$(CONFIG_EARLY_PRINTK) += malta-console.o |
15 | obj-$(CONFIG_PCI) += malta-pci.o | 15 | obj-$(CONFIG_PCI) += malta-pci.o |
16 | obj-$(CONFIG_KGDB) += malta-kgdb.o | ||
17 | 16 | ||
18 | # FIXME FIXME FIXME | 17 | # FIXME FIXME FIXME |
19 | obj-$(CONFIG_MIPS_MT_SMTC) += malta_smtc.o | 18 | obj-$(CONFIG_MIPS_MT_SMTC) += malta_smtc.o |
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c index c0653021a171..4832af251668 100644 --- a/arch/mips/mti-malta/malta-init.c +++ b/arch/mips/mti-malta/malta-init.c | |||
@@ -37,15 +37,6 @@ | |||
37 | 37 | ||
38 | #include <asm/mips-boards/malta.h> | 38 | #include <asm/mips-boards/malta.h> |
39 | 39 | ||
40 | #ifdef CONFIG_KGDB | ||
41 | extern int rs_kgdb_hook(int, int); | ||
42 | extern int rs_putDebugChar(char); | ||
43 | extern char rs_getDebugChar(void); | ||
44 | extern int saa9730_kgdb_hook(int); | ||
45 | extern int saa9730_putDebugChar(char); | ||
46 | extern char saa9730_getDebugChar(void); | ||
47 | #endif | ||
48 | |||
49 | int prom_argc; | 40 | int prom_argc; |
50 | int *_prom_argv, *_prom_envp; | 41 | int *_prom_argv, *_prom_envp; |
51 | 42 | ||
@@ -173,51 +164,6 @@ static void __init console_config(void) | |||
173 | } | 164 | } |
174 | #endif | 165 | #endif |
175 | 166 | ||
176 | #ifdef CONFIG_KGDB | ||
177 | void __init kgdb_config(void) | ||
178 | { | ||
179 | extern int (*generic_putDebugChar)(char); | ||
180 | extern char (*generic_getDebugChar)(void); | ||
181 | char *argptr; | ||
182 | int line, speed; | ||
183 | |||
184 | argptr = prom_getcmdline(); | ||
185 | if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) { | ||
186 | argptr += strlen("kgdb=ttyS"); | ||
187 | if (*argptr != '0' && *argptr != '1') | ||
188 | printk("KGDB: Unknown serial line /dev/ttyS%c, " | ||
189 | "falling back to /dev/ttyS1\n", *argptr); | ||
190 | line = *argptr == '0' ? 0 : 1; | ||
191 | printk("KGDB: Using serial line /dev/ttyS%d for session\n", line); | ||
192 | |||
193 | speed = 0; | ||
194 | if (*++argptr == ',') | ||
195 | { | ||
196 | int c; | ||
197 | while ((c = *++argptr) && ('0' <= c && c <= '9')) | ||
198 | speed = speed * 10 + c - '0'; | ||
199 | } | ||
200 | { | ||
201 | speed = rs_kgdb_hook(line, speed); | ||
202 | generic_putDebugChar = rs_putDebugChar; | ||
203 | generic_getDebugChar = rs_getDebugChar; | ||
204 | } | ||
205 | |||
206 | pr_info("KGDB: Using serial line /dev/ttyS%d at %d for " | ||
207 | "session, please connect your debugger\n", | ||
208 | line ? 1 : 0, speed); | ||
209 | |||
210 | { | ||
211 | char *s; | ||
212 | for (s = "Please connect GDB to this port\r\n"; *s; ) | ||
213 | generic_putDebugChar(*s++); | ||
214 | } | ||
215 | |||
216 | /* Breakpoint is invoked after interrupts are initialised */ | ||
217 | } | ||
218 | } | ||
219 | #endif | ||
220 | |||
221 | static void __init mips_nmi_setup(void) | 167 | static void __init mips_nmi_setup(void) |
222 | { | 168 | { |
223 | void *base; | 169 | void *base; |
diff --git a/arch/mips/mti-malta/malta-kgdb.c b/arch/mips/mti-malta/malta-kgdb.c deleted file mode 100644 index 6a1854de4579..000000000000 --- a/arch/mips/mti-malta/malta-kgdb.c +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * This is the interface to the remote debugger stub. | ||
19 | */ | ||
20 | #include <linux/types.h> | ||
21 | #include <linux/serial.h> | ||
22 | #include <linux/serialP.h> | ||
23 | #include <linux/serial_reg.h> | ||
24 | |||
25 | #include <asm/serial.h> | ||
26 | #include <asm/io.h> | ||
27 | |||
28 | static struct serial_state rs_table[] = { | ||
29 | SERIAL_PORT_DFNS /* Defined in serial.h */ | ||
30 | }; | ||
31 | |||
32 | static struct async_struct kdb_port_info = {0}; | ||
33 | |||
34 | int (*generic_putDebugChar)(char); | ||
35 | char (*generic_getDebugChar)(void); | ||
36 | |||
37 | static __inline__ unsigned int serial_in(struct async_struct *info, int offset) | ||
38 | { | ||
39 | return inb(info->port + offset); | ||
40 | } | ||
41 | |||
42 | static __inline__ void serial_out(struct async_struct *info, int offset, | ||
43 | int value) | ||
44 | { | ||
45 | outb(value, info->port+offset); | ||
46 | } | ||
47 | |||
48 | int rs_kgdb_hook(int tty_no, int speed) { | ||
49 | int t; | ||
50 | struct serial_state *ser = &rs_table[tty_no]; | ||
51 | |||
52 | kdb_port_info.state = ser; | ||
53 | kdb_port_info.magic = SERIAL_MAGIC; | ||
54 | kdb_port_info.port = ser->port; | ||
55 | kdb_port_info.flags = ser->flags; | ||
56 | |||
57 | /* | ||
58 | * Clear all interrupts | ||
59 | */ | ||
60 | serial_in(&kdb_port_info, UART_LSR); | ||
61 | serial_in(&kdb_port_info, UART_RX); | ||
62 | serial_in(&kdb_port_info, UART_IIR); | ||
63 | serial_in(&kdb_port_info, UART_MSR); | ||
64 | |||
65 | /* | ||
66 | * Now, initialize the UART | ||
67 | */ | ||
68 | serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8); /* reset DLAB */ | ||
69 | if (kdb_port_info.flags & ASYNC_FOURPORT) { | ||
70 | kdb_port_info.MCR = UART_MCR_DTR | UART_MCR_RTS; | ||
71 | t = UART_MCR_DTR | UART_MCR_OUT1; | ||
72 | } else { | ||
73 | kdb_port_info.MCR | ||
74 | = UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2; | ||
75 | t = UART_MCR_DTR | UART_MCR_RTS; | ||
76 | } | ||
77 | |||
78 | kdb_port_info.MCR = t; /* no interrupts, please */ | ||
79 | serial_out(&kdb_port_info, UART_MCR, kdb_port_info.MCR); | ||
80 | |||
81 | /* | ||
82 | * and set the speed of the serial port | ||
83 | */ | ||
84 | if (speed == 0) | ||
85 | speed = 9600; | ||
86 | |||
87 | t = kdb_port_info.state->baud_base / speed; | ||
88 | /* set DLAB */ | ||
89 | serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8 | UART_LCR_DLAB); | ||
90 | serial_out(&kdb_port_info, UART_DLL, t & 0xff);/* LS of divisor */ | ||
91 | serial_out(&kdb_port_info, UART_DLM, t >> 8); /* MS of divisor */ | ||
92 | /* reset DLAB */ | ||
93 | serial_out(&kdb_port_info, UART_LCR, UART_LCR_WLEN8); | ||
94 | |||
95 | return speed; | ||
96 | } | ||
97 | |||
98 | int putDebugChar(char c) | ||
99 | { | ||
100 | return generic_putDebugChar(c); | ||
101 | } | ||
102 | |||
103 | char getDebugChar(void) | ||
104 | { | ||
105 | return generic_getDebugChar(); | ||
106 | } | ||
107 | |||
108 | int rs_putDebugChar(char c) | ||
109 | { | ||
110 | |||
111 | if (!kdb_port_info.state) { /* need to init device first */ | ||
112 | return 0; | ||
113 | } | ||
114 | |||
115 | while ((serial_in(&kdb_port_info, UART_LSR) & UART_LSR_THRE) == 0) | ||
116 | ; | ||
117 | |||
118 | serial_out(&kdb_port_info, UART_TX, c); | ||
119 | |||
120 | return 1; | ||
121 | } | ||
122 | |||
123 | char rs_getDebugChar(void) | ||
124 | { | ||
125 | if (!kdb_port_info.state) { /* need to init device first */ | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | while (!(serial_in(&kdb_port_info, UART_LSR) & 1)) | ||
130 | ; | ||
131 | |||
132 | return serial_in(&kdb_port_info, UART_RX); | ||
133 | } | ||
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c index e7cad54936ca..dc78b8983eeb 100644 --- a/arch/mips/mti-malta/malta-setup.c +++ b/arch/mips/mti-malta/malta-setup.c | |||
@@ -199,10 +199,6 @@ void __init plat_mem_setup(void) | |||
199 | */ | 199 | */ |
200 | enable_dma(4); | 200 | enable_dma(4); |
201 | 201 | ||
202 | #ifdef CONFIG_KGDB | ||
203 | kgdb_config(); | ||
204 | #endif | ||
205 | |||
206 | #ifdef CONFIG_DMA_COHERENT | 202 | #ifdef CONFIG_DMA_COHERENT |
207 | if (mips_revision_sconid != MIPS_REVISION_SCON_BONITO) | 203 | if (mips_revision_sconid != MIPS_REVISION_SCON_BONITO) |
208 | panic("Hardware DMA cache coherency not supported"); | 204 | panic("Hardware DMA cache coherency not supported"); |
diff --git a/arch/mips/nxp/pnx8550/common/Makefile b/arch/mips/nxp/pnx8550/common/Makefile index 31cc1a5cec3b..dd9e7b1f7fd3 100644 --- a/arch/mips/nxp/pnx8550/common/Makefile +++ b/arch/mips/nxp/pnx8550/common/Makefile | |||
@@ -24,6 +24,5 @@ | |||
24 | 24 | ||
25 | obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o | 25 | obj-y := setup.o prom.o int.o reset.o time.o proc.o platform.o |
26 | obj-$(CONFIG_PCI) += pci.o | 26 | obj-$(CONFIG_PCI) += pci.o |
27 | obj-$(CONFIG_KGDB) += gdb_hook.o | ||
28 | 27 | ||
29 | EXTRA_CFLAGS += -Werror | 28 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/nxp/pnx8550/common/gdb_hook.c b/arch/mips/nxp/pnx8550/common/gdb_hook.c deleted file mode 100644 index ad4624f6d9bc..000000000000 --- a/arch/mips/nxp/pnx8550/common/gdb_hook.c +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * ######################################################################## | ||
6 | * | ||
7 | * This program is free software; you can distribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License (Version 2) as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
14 | * for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
19 | * | ||
20 | * ######################################################################## | ||
21 | * | ||
22 | * This is the interface to the remote debugger stub. | ||
23 | * | ||
24 | */ | ||
25 | #include <linux/types.h> | ||
26 | #include <linux/serial.h> | ||
27 | #include <linux/serialP.h> | ||
28 | #include <linux/serial_reg.h> | ||
29 | #include <linux/serial_ip3106.h> | ||
30 | |||
31 | #include <asm/serial.h> | ||
32 | #include <asm/io.h> | ||
33 | |||
34 | #include <uart.h> | ||
35 | |||
36 | static struct serial_state rs_table[IP3106_NR_PORTS] = { | ||
37 | }; | ||
38 | static struct async_struct kdb_port_info = {0}; | ||
39 | |||
40 | void rs_kgdb_hook(int tty_no) | ||
41 | { | ||
42 | struct serial_state *ser = &rs_table[tty_no]; | ||
43 | |||
44 | kdb_port_info.state = ser; | ||
45 | kdb_port_info.magic = SERIAL_MAGIC; | ||
46 | kdb_port_info.port = tty_no; | ||
47 | kdb_port_info.flags = ser->flags; | ||
48 | |||
49 | /* | ||
50 | * Clear all interrupts | ||
51 | */ | ||
52 | /* Clear all the transmitter FIFO counters (pointer and status) */ | ||
53 | ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_TX_RST; | ||
54 | /* Clear all the receiver FIFO counters (pointer and status) */ | ||
55 | ip3106_lcr(UART_BASE, tty_no) |= IP3106_UART_LCR_RX_RST; | ||
56 | /* Clear all interrupts */ | ||
57 | ip3106_iclr(UART_BASE, tty_no) = IP3106_UART_INT_ALLRX | | ||
58 | IP3106_UART_INT_ALLTX; | ||
59 | |||
60 | /* | ||
61 | * Now, initialize the UART | ||
62 | */ | ||
63 | ip3106_lcr(UART_BASE, tty_no) = IP3106_UART_LCR_8BIT; | ||
64 | ip3106_baud(UART_BASE, tty_no) = 5; // 38400 Baud | ||
65 | } | ||
66 | |||
67 | int putDebugChar(char c) | ||
68 | { | ||
69 | /* Wait until FIFO not full */ | ||
70 | while (((ip3106_fifo(UART_BASE, kdb_port_info.port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16) | ||
71 | ; | ||
72 | /* Send one char */ | ||
73 | ip3106_fifo(UART_BASE, kdb_port_info.port) = c; | ||
74 | |||
75 | return 1; | ||
76 | } | ||
77 | |||
78 | char getDebugChar(void) | ||
79 | { | ||
80 | char ch; | ||
81 | |||
82 | /* Wait until there is a char in the FIFO */ | ||
83 | while (!((ip3106_fifo(UART_BASE, kdb_port_info.port) & | ||
84 | IP3106_UART_FIFO_RXFIFO) >> 8)) | ||
85 | ; | ||
86 | /* Read one char */ | ||
87 | ch = ip3106_fifo(UART_BASE, kdb_port_info.port) & | ||
88 | IP3106_UART_FIFO_RBRTHR; | ||
89 | /* Advance the RX FIFO read pointer */ | ||
90 | ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_NEXT; | ||
91 | return (ch); | ||
92 | } | ||
93 | |||
94 | void rs_disable_debug_interrupts(void) | ||
95 | { | ||
96 | ip3106_ien(UART_BASE, kdb_port_info.port) = 0; /* Disable all interrupts */ | ||
97 | } | ||
98 | |||
99 | void rs_enable_debug_interrupts(void) | ||
100 | { | ||
101 | /* Clear all the transmitter FIFO counters (pointer and status) */ | ||
102 | ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_TX_RST; | ||
103 | /* Clear all the receiver FIFO counters (pointer and status) */ | ||
104 | ip3106_lcr(UART_BASE, kdb_port_info.port) |= IP3106_UART_LCR_RX_RST; | ||
105 | /* Clear all interrupts */ | ||
106 | ip3106_iclr(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX | | ||
107 | IP3106_UART_INT_ALLTX; | ||
108 | ip3106_ien(UART_BASE, kdb_port_info.port) = IP3106_UART_INT_ALLRX; /* Enable RX interrupts */ | ||
109 | } | ||
diff --git a/arch/mips/nxp/pnx8550/common/int.c b/arch/mips/nxp/pnx8550/common/int.c index aad03429a5e3..f080f114a1bf 100644 --- a/arch/mips/nxp/pnx8550/common/int.c +++ b/arch/mips/nxp/pnx8550/common/int.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | 35 | ||
36 | #include <asm/io.h> | 36 | #include <asm/io.h> |
37 | #include <asm/gdb-stub.h> | ||
38 | #include <int.h> | 37 | #include <int.h> |
39 | #include <uart.h> | 38 | #include <uart.h> |
40 | 39 | ||
diff --git a/arch/mips/nxp/pnx8550/common/proc.c b/arch/mips/nxp/pnx8550/common/proc.c index 18b125e3b65d..acf1fa889444 100644 --- a/arch/mips/nxp/pnx8550/common/proc.c +++ b/arch/mips/nxp/pnx8550/common/proc.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/random.h> | 22 | #include <linux/random.h> |
23 | 23 | ||
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/gdb-stub.h> | ||
26 | #include <int.h> | 25 | #include <int.h> |
27 | #include <uart.h> | 26 | #include <uart.h> |
28 | 27 | ||
diff --git a/arch/mips/nxp/pnx8550/common/setup.c b/arch/mips/nxp/pnx8550/common/setup.c index 92d764c97701..2aed50fef10f 100644 --- a/arch/mips/nxp/pnx8550/common/setup.c +++ b/arch/mips/nxp/pnx8550/common/setup.c | |||
@@ -47,7 +47,6 @@ extern void pnx8550_machine_halt(void); | |||
47 | extern void pnx8550_machine_power_off(void); | 47 | extern void pnx8550_machine_power_off(void); |
48 | extern struct resource ioport_resource; | 48 | extern struct resource ioport_resource; |
49 | extern struct resource iomem_resource; | 49 | extern struct resource iomem_resource; |
50 | extern void rs_kgdb_hook(int tty_no); | ||
51 | extern char *prom_getcmdline(void); | 50 | extern char *prom_getcmdline(void); |
52 | 51 | ||
53 | struct resource standard_io_resources[] = { | 52 | struct resource standard_io_resources[] = { |
@@ -142,16 +141,5 @@ void __init plat_mem_setup(void) | |||
142 | ip3106_baud(UART_BASE, pnx8550_console_port) = 5; | 141 | ip3106_baud(UART_BASE, pnx8550_console_port) = 5; |
143 | } | 142 | } |
144 | 143 | ||
145 | #ifdef CONFIG_KGDB | ||
146 | argptr = prom_getcmdline(); | ||
147 | if ((argptr = strstr(argptr, "kgdb=ttyS")) != NULL) { | ||
148 | int line; | ||
149 | argptr += strlen("kgdb=ttyS"); | ||
150 | line = *argptr == '0' ? 0 : 1; | ||
151 | rs_kgdb_hook(line); | ||
152 | pr_info("KGDB: Using ttyS%i for session, " | ||
153 | "please connect your debugger\n", line ? 1 : 0); | ||
154 | } | ||
155 | #endif | ||
156 | return; | 144 | return; |
157 | } | 145 | } |
diff --git a/arch/mips/pci/ops-tx3927.c b/arch/mips/pci/ops-tx3927.c index 8a17a39e5bf2..31c150196595 100644 --- a/arch/mips/pci/ops-tx3927.c +++ b/arch/mips/pci/ops-tx3927.c | |||
@@ -37,45 +37,48 @@ | |||
37 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
38 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/interrupt.h> | ||
40 | 41 | ||
41 | #include <asm/addrspace.h> | 42 | #include <asm/addrspace.h> |
43 | #include <asm/txx9irq.h> | ||
44 | #include <asm/txx9/pci.h> | ||
42 | #include <asm/txx9/tx3927.h> | 45 | #include <asm/txx9/tx3927.h> |
43 | 46 | ||
44 | static inline int mkaddr(unsigned char bus, unsigned char dev_fn, | 47 | static int mkaddr(struct pci_bus *bus, unsigned char devfn, unsigned char where) |
45 | unsigned char where) | ||
46 | { | 48 | { |
47 | if (bus == 0 && dev_fn >= PCI_DEVFN(TX3927_PCIC_MAX_DEVNU, 0)) | 49 | if (bus->parent == NULL && |
48 | return PCIBIOS_DEVICE_NOT_FOUND; | 50 | devfn >= PCI_DEVFN(TX3927_PCIC_MAX_DEVNU, 0)) |
49 | 51 | return -1; | |
50 | tx3927_pcicptr->ica = ((bus & 0xff) << 0x10) | | 52 | tx3927_pcicptr->ica = |
51 | ((dev_fn & 0xff) << 0x08) | | 53 | ((bus->number & 0xff) << 0x10) | |
52 | (where & 0xfc); | 54 | ((devfn & 0xff) << 0x08) | |
55 | (where & 0xfc) | (bus->parent ? 1 : 0); | ||
53 | 56 | ||
54 | /* clear M_ABORT and Disable M_ABORT Int. */ | 57 | /* clear M_ABORT and Disable M_ABORT Int. */ |
55 | tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT; | 58 | tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT; |
56 | tx3927_pcicptr->pcistatim &= ~PCI_STATUS_REC_MASTER_ABORT; | 59 | tx3927_pcicptr->pcistatim &= ~PCI_STATUS_REC_MASTER_ABORT; |
57 | 60 | return 0; | |
58 | return PCIBIOS_SUCCESSFUL; | ||
59 | } | 61 | } |
60 | 62 | ||
61 | static inline int check_abort(void) | 63 | static inline int check_abort(void) |
62 | { | 64 | { |
63 | if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT) | 65 | if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT) { |
64 | tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT; | 66 | tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT; |
65 | tx3927_pcicptr->pcistatim |= PCI_STATUS_REC_MASTER_ABORT; | 67 | tx3927_pcicptr->pcistatim |= PCI_STATUS_REC_MASTER_ABORT; |
68 | /* flush write buffer */ | ||
69 | iob(); | ||
66 | return PCIBIOS_DEVICE_NOT_FOUND; | 70 | return PCIBIOS_DEVICE_NOT_FOUND; |
67 | 71 | } | |
68 | return PCIBIOS_SUCCESSFUL; | 72 | return PCIBIOS_SUCCESSFUL; |
69 | } | 73 | } |
70 | 74 | ||
71 | static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, | 75 | static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, |
72 | int where, int size, u32 * val) | 76 | int where, int size, u32 * val) |
73 | { | 77 | { |
74 | int ret; | 78 | if (mkaddr(bus, devfn, where)) { |
75 | 79 | *val = 0xffffffff; | |
76 | ret = mkaddr(bus->number, devfn, where); | 80 | return PCIBIOS_DEVICE_NOT_FOUND; |
77 | if (ret) | 81 | } |
78 | return ret; | ||
79 | 82 | ||
80 | switch (size) { | 83 | switch (size) { |
81 | case 1: | 84 | case 1: |
@@ -97,11 +100,8 @@ static int tx3927_pci_read_config(struct pci_bus *bus, unsigned int devfn, | |||
97 | static int tx3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, | 100 | static int tx3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, |
98 | int where, int size, u32 val) | 101 | int where, int size, u32 val) |
99 | { | 102 | { |
100 | int ret; | 103 | if (mkaddr(bus, devfn, where)) |
101 | 104 | return PCIBIOS_DEVICE_NOT_FOUND; | |
102 | ret = mkaddr(bus->number, devfn, where); | ||
103 | if (ret) | ||
104 | return ret; | ||
105 | 105 | ||
106 | switch (size) { | 106 | switch (size) { |
107 | case 1: | 107 | case 1: |
@@ -117,11 +117,6 @@ static int tx3927_pci_write_config(struct pci_bus *bus, unsigned int devfn, | |||
117 | tx3927_pcicptr->icd = cpu_to_le32(val); | 117 | tx3927_pcicptr->icd = cpu_to_le32(val); |
118 | } | 118 | } |
119 | 119 | ||
120 | if (tx3927_pcicptr->pcistat & PCI_STATUS_REC_MASTER_ABORT) | ||
121 | tx3927_pcicptr->pcistat |= PCI_STATUS_REC_MASTER_ABORT; | ||
122 | tx3927_pcicptr->pcistatim |= PCI_STATUS_REC_MASTER_ABORT; | ||
123 | return PCIBIOS_DEVICE_NOT_FOUND; | ||
124 | |||
125 | return check_abort(); | 120 | return check_abort(); |
126 | } | 121 | } |
127 | 122 | ||
@@ -202,3 +197,34 @@ void __init tx3927_pcic_setup(struct pci_controller *channel, | |||
202 | PCI_COMMAND_PARITY | PCI_COMMAND_SERR; | 197 | PCI_COMMAND_PARITY | PCI_COMMAND_SERR; |
203 | local_irq_restore(flags); | 198 | local_irq_restore(flags); |
204 | } | 199 | } |
200 | |||
201 | static irqreturn_t tx3927_pcierr_interrupt(int irq, void *dev_id) | ||
202 | { | ||
203 | struct pt_regs *regs = get_irq_regs(); | ||
204 | |||
205 | if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) { | ||
206 | printk(KERN_WARNING "PCI error interrupt at 0x%08lx.\n", | ||
207 | regs->cp0_epc); | ||
208 | printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", | ||
209 | tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat); | ||
210 | } | ||
211 | if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) { | ||
212 | /* clear all pci errors */ | ||
213 | tx3927_pcicptr->pcistat |= TX3927_PCIC_PCISTATIM_ALL; | ||
214 | tx3927_pcicptr->istat = TX3927_PCIC_IIM_ALL; | ||
215 | tx3927_pcicptr->tstat = TX3927_PCIC_TIM_ALL; | ||
216 | tx3927_pcicptr->lbstat = TX3927_PCIC_LBIM_ALL; | ||
217 | return IRQ_HANDLED; | ||
218 | } | ||
219 | console_verbose(); | ||
220 | panic("PCI error."); | ||
221 | } | ||
222 | |||
223 | void __init tx3927_setup_pcierr_irq(void) | ||
224 | { | ||
225 | if (request_irq(TXX9_IRQ_BASE + TX3927_IR_PCI, | ||
226 | tx3927_pcierr_interrupt, | ||
227 | IRQF_DISABLED, "PCI error", | ||
228 | (void *)TX3927_PCIC_REG)) | ||
229 | printk(KERN_WARNING "Failed to request irq for PCIERR\n"); | ||
230 | } | ||
diff --git a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c index c6b49bccd274..5989e747527f 100644 --- a/arch/mips/pci/ops-tx4927.c +++ b/arch/mips/pci/ops-tx4927.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * option) any later version. | 16 | * option) any later version. |
17 | */ | 17 | */ |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/interrupt.h> | ||
20 | #include <asm/txx9/pci.h> | ||
19 | #include <asm/txx9/tx4927pcic.h> | 21 | #include <asm/txx9/tx4927pcic.h> |
20 | 22 | ||
21 | static struct { | 23 | static struct { |
@@ -85,6 +87,8 @@ static int check_abort(struct tx4927_pcic_reg __iomem *pcicptr) | |||
85 | __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff) | 87 | __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff) |
86 | | (PCI_STATUS_REC_MASTER_ABORT << 16), | 88 | | (PCI_STATUS_REC_MASTER_ABORT << 16), |
87 | &pcicptr->pcistatus); | 89 | &pcicptr->pcistatus); |
90 | /* flush write buffer */ | ||
91 | iob(); | ||
88 | code = PCIBIOS_DEVICE_NOT_FOUND; | 92 | code = PCIBIOS_DEVICE_NOT_FOUND; |
89 | } | 93 | } |
90 | return code; | 94 | return code; |
@@ -192,6 +196,28 @@ static struct { | |||
192 | .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */ | 196 | .gbwc = 0xfe0, /* 4064 GBUSCLK for CCFG.GTOT=0b11 */ |
193 | }; | 197 | }; |
194 | 198 | ||
199 | char *__devinit tx4927_pcibios_setup(char *str) | ||
200 | { | ||
201 | unsigned long val; | ||
202 | |||
203 | if (!strncmp(str, "trdyto=", 7)) { | ||
204 | if (strict_strtoul(str + 7, 0, &val) == 0) | ||
205 | tx4927_pci_opts.trdyto = val; | ||
206 | return NULL; | ||
207 | } | ||
208 | if (!strncmp(str, "retryto=", 8)) { | ||
209 | if (strict_strtoul(str + 8, 0, &val) == 0) | ||
210 | tx4927_pci_opts.retryto = val; | ||
211 | return NULL; | ||
212 | } | ||
213 | if (!strncmp(str, "gbwc=", 5)) { | ||
214 | if (strict_strtoul(str + 5, 0, &val) == 0) | ||
215 | tx4927_pci_opts.gbwc = val; | ||
216 | return NULL; | ||
217 | } | ||
218 | return str; | ||
219 | } | ||
220 | |||
195 | void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr, | 221 | void __init tx4927_pcic_setup(struct tx4927_pcic_reg __iomem *pcicptr, |
196 | struct pci_controller *channel, int extarb) | 222 | struct pci_controller *channel, int extarb) |
197 | { | 223 | { |
@@ -406,3 +432,95 @@ void tx4927_report_pcic_status(void) | |||
406 | tx4927_report_pcic_status1(pcicptrs[i].pcicptr); | 432 | tx4927_report_pcic_status1(pcicptrs[i].pcicptr); |
407 | } | 433 | } |
408 | } | 434 | } |
435 | |||
436 | static void tx4927_dump_pcic_settings1(struct tx4927_pcic_reg __iomem *pcicptr) | ||
437 | { | ||
438 | int i; | ||
439 | __u32 __iomem *preg = (__u32 __iomem *)pcicptr; | ||
440 | |||
441 | printk(KERN_INFO "tx4927 pcic (0x%p) settings:", pcicptr); | ||
442 | for (i = 0; i < sizeof(struct tx4927_pcic_reg); i += 4, preg++) { | ||
443 | if (i % 32 == 0) { | ||
444 | printk(KERN_CONT "\n"); | ||
445 | printk(KERN_INFO "%04x:", i); | ||
446 | } | ||
447 | /* skip registers with side-effects */ | ||
448 | if (i == offsetof(struct tx4927_pcic_reg, g2pintack) | ||
449 | || i == offsetof(struct tx4927_pcic_reg, g2pspc) | ||
450 | || i == offsetof(struct tx4927_pcic_reg, g2pcfgadrs) | ||
451 | || i == offsetof(struct tx4927_pcic_reg, g2pcfgdata)) { | ||
452 | printk(KERN_CONT " XXXXXXXX"); | ||
453 | continue; | ||
454 | } | ||
455 | printk(KERN_CONT " %08x", __raw_readl(preg)); | ||
456 | } | ||
457 | printk(KERN_CONT "\n"); | ||
458 | } | ||
459 | |||
460 | void tx4927_dump_pcic_settings(void) | ||
461 | { | ||
462 | int i; | ||
463 | |||
464 | for (i = 0; i < ARRAY_SIZE(pcicptrs); i++) { | ||
465 | if (pcicptrs[i].pcicptr) | ||
466 | tx4927_dump_pcic_settings1(pcicptrs[i].pcicptr); | ||
467 | } | ||
468 | } | ||
469 | |||
470 | irqreturn_t tx4927_pcierr_interrupt(int irq, void *dev_id) | ||
471 | { | ||
472 | struct pt_regs *regs = get_irq_regs(); | ||
473 | struct tx4927_pcic_reg __iomem *pcicptr = | ||
474 | (struct tx4927_pcic_reg __iomem *)(unsigned long)dev_id; | ||
475 | |||
476 | if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) { | ||
477 | printk(KERN_WARNING "PCIERR interrupt at 0x%0*lx\n", | ||
478 | (int)(2 * sizeof(unsigned long)), regs->cp0_epc); | ||
479 | tx4927_report_pcic_status1(pcicptr); | ||
480 | } | ||
481 | if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) { | ||
482 | /* clear all pci errors */ | ||
483 | __raw_writel((__raw_readl(&pcicptr->pcistatus) & 0x0000ffff) | ||
484 | | (TX4927_PCIC_PCISTATUS_ALL << 16), | ||
485 | &pcicptr->pcistatus); | ||
486 | __raw_writel(TX4927_PCIC_G2PSTATUS_ALL, &pcicptr->g2pstatus); | ||
487 | __raw_writel(TX4927_PCIC_PBASTATUS_ALL, &pcicptr->pbastatus); | ||
488 | __raw_writel(TX4927_PCIC_PCICSTATUS_ALL, &pcicptr->pcicstatus); | ||
489 | return IRQ_HANDLED; | ||
490 | } | ||
491 | console_verbose(); | ||
492 | tx4927_dump_pcic_settings1(pcicptr); | ||
493 | panic("PCI error."); | ||
494 | } | ||
495 | |||
496 | #ifdef CONFIG_TOSHIBA_FPCIB0 | ||
497 | static void __init tx4927_quirk_slc90e66_bridge(struct pci_dev *dev) | ||
498 | { | ||
499 | struct tx4927_pcic_reg __iomem *pcicptr = pci_bus_to_pcicptr(dev->bus); | ||
500 | |||
501 | if (!pcicptr) | ||
502 | return; | ||
503 | if (__raw_readl(&pcicptr->pbacfg) & TX4927_PCIC_PBACFG_PBAEN) { | ||
504 | /* Reset Bus Arbiter */ | ||
505 | __raw_writel(TX4927_PCIC_PBACFG_RPBA, &pcicptr->pbacfg); | ||
506 | /* | ||
507 | * swap reqBP and reqXP (raise priority of SLC90E66). | ||
508 | * SLC90E66(PCI-ISA bridge) is connected to REQ2 on | ||
509 | * PCI Backplane board. | ||
510 | */ | ||
511 | __raw_writel(0x72543610, &pcicptr->pbareqport); | ||
512 | __raw_writel(0, &pcicptr->pbabm); | ||
513 | /* Use Fixed ParkMaster (required by SLC90E66) */ | ||
514 | __raw_writel(TX4927_PCIC_PBACFG_FIXPA, &pcicptr->pbacfg); | ||
515 | /* Enable Bus Arbiter */ | ||
516 | __raw_writel(TX4927_PCIC_PBACFG_FIXPA | | ||
517 | TX4927_PCIC_PBACFG_PBAEN, | ||
518 | &pcicptr->pbacfg); | ||
519 | printk(KERN_INFO "PCI: Use Fixed Park Master (REQPORT %08x)\n", | ||
520 | __raw_readl(&pcicptr->pbareqport)); | ||
521 | } | ||
522 | } | ||
523 | #define PCI_DEVICE_ID_EFAR_SLC90E66_0 0x9460 | ||
524 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_0, | ||
525 | tx4927_quirk_slc90e66_bridge); | ||
526 | #endif | ||
diff --git a/arch/mips/pci/pci-tx4927.c b/arch/mips/pci/pci-tx4927.c index 27e86a09dd41..aaa900596792 100644 --- a/arch/mips/pci/pci-tx4927.c +++ b/arch/mips/pci/pci-tx4927.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/interrupt.h> | ||
18 | #include <asm/txx9/generic.h> | 19 | #include <asm/txx9/generic.h> |
19 | #include <asm/txx9/tx4927.h> | 20 | #include <asm/txx9/tx4927.h> |
20 | 21 | ||
@@ -81,3 +82,12 @@ int __init tx4927_pciclk66_setup(void) | |||
81 | pciclk = -1; | 82 | pciclk = -1; |
82 | return pciclk; | 83 | return pciclk; |
83 | } | 84 | } |
85 | |||
86 | void __init tx4927_setup_pcierr_irq(void) | ||
87 | { | ||
88 | if (request_irq(TXX9_IRQ_BASE + TX4927_IR_PCIERR, | ||
89 | tx4927_pcierr_interrupt, | ||
90 | IRQF_DISABLED, "PCI error", | ||
91 | (void *)TX4927_PCIC_REG)) | ||
92 | printk(KERN_WARNING "Failed to request irq for PCIERR\n"); | ||
93 | } | ||
diff --git a/arch/mips/pci/pci-tx4938.c b/arch/mips/pci/pci-tx4938.c index e5375511c2b7..60e2c52c2c5e 100644 --- a/arch/mips/pci/pci-tx4938.c +++ b/arch/mips/pci/pci-tx4938.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/pci.h> | 16 | #include <linux/pci.h> |
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/interrupt.h> | ||
18 | #include <asm/txx9/generic.h> | 19 | #include <asm/txx9/generic.h> |
19 | #include <asm/txx9/tx4938.h> | 20 | #include <asm/txx9/tx4938.h> |
20 | 21 | ||
@@ -132,3 +133,12 @@ int tx4938_pcic1_map_irq(const struct pci_dev *dev, u8 slot) | |||
132 | } | 133 | } |
133 | return -1; | 134 | return -1; |
134 | } | 135 | } |
136 | |||
137 | void __init tx4938_setup_pcierr_irq(void) | ||
138 | { | ||
139 | if (request_irq(TXX9_IRQ_BASE + TX4938_IR_PCIERR, | ||
140 | tx4927_pcierr_interrupt, | ||
141 | IRQF_DISABLED, "PCI error", | ||
142 | (void *)TX4927_PCIC_REG)) | ||
143 | printk(KERN_WARNING "Failed to request irq for PCIERR\n"); | ||
144 | } | ||
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 77bd5b68dc43..c7fe6ec621e6 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -328,7 +328,11 @@ EXPORT_SYMBOL(PCIBIOS_MIN_IO); | |||
328 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); | 328 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); |
329 | #endif | 329 | #endif |
330 | 330 | ||
331 | char *pcibios_setup(char *str) | 331 | char * (*pcibios_plat_setup)(char *str) __devinitdata; |
332 | |||
333 | char *__devinit pcibios_setup(char *str) | ||
332 | { | 334 | { |
335 | if (pcibios_plat_setup) | ||
336 | return pcibios_plat_setup(str); | ||
333 | return str; | 337 | return str; |
334 | } | 338 | } |
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c b/arch/mips/pmc-sierra/msp71xx/msp_serial.c index 9de34302e5f4..f7261628d8a6 100644 --- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c +++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c | |||
@@ -38,68 +38,6 @@ | |||
38 | #include <msp_int.h> | 38 | #include <msp_int.h> |
39 | #include <msp_regs.h> | 39 | #include <msp_regs.h> |
40 | 40 | ||
41 | #ifdef CONFIG_KGDB | ||
42 | /* | ||
43 | * kgdb uses serial port 1 so the console can remain on port 0. | ||
44 | * To use port 0 change the definition to read as follows: | ||
45 | * #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART0_BASE) | ||
46 | */ | ||
47 | #define DEBUG_PORT_BASE KSEG1ADDR(MSP_UART1_BASE) | ||
48 | |||
49 | int putDebugChar(char c) | ||
50 | { | ||
51 | volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE; | ||
52 | uint32_t val = (uint32_t)c; | ||
53 | |||
54 | local_irq_disable(); | ||
55 | while( !(uart[5] & 0x20) ); /* Wait for TXRDY */ | ||
56 | uart[0] = val; | ||
57 | while( !(uart[5] & 0x20) ); /* Wait for TXRDY */ | ||
58 | local_irq_enable(); | ||
59 | |||
60 | return 1; | ||
61 | } | ||
62 | |||
63 | char getDebugChar(void) | ||
64 | { | ||
65 | volatile uint32_t *uart = (volatile uint32_t *)DEBUG_PORT_BASE; | ||
66 | uint32_t val; | ||
67 | |||
68 | while( !(uart[5] & 0x01) ); /* Wait for RXRDY */ | ||
69 | val = uart[0]; | ||
70 | |||
71 | return (char)val; | ||
72 | } | ||
73 | |||
74 | void initDebugPort(unsigned int uartclk, unsigned int baudrate) | ||
75 | { | ||
76 | unsigned int baud_divisor = (uartclk + 8 * baudrate)/(16 * baudrate); | ||
77 | |||
78 | /* Enable FIFOs */ | ||
79 | writeb(UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | | ||
80 | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_4, | ||
81 | (char *)DEBUG_PORT_BASE + (UART_FCR * 4)); | ||
82 | |||
83 | /* Select brtc divisor */ | ||
84 | writeb(UART_LCR_DLAB, (char *)DEBUG_PORT_BASE + (UART_LCR * 4)); | ||
85 | |||
86 | /* Store divisor lsb */ | ||
87 | writeb(baud_divisor, (char *)DEBUG_PORT_BASE + (UART_TX * 4)); | ||
88 | |||
89 | /* Store divisor msb */ | ||
90 | writeb(baud_divisor >> 8, (char *)DEBUG_PORT_BASE + (UART_IER * 4)); | ||
91 | |||
92 | /* Set 8N1 mode */ | ||
93 | writeb(UART_LCR_WLEN8, (char *)DEBUG_PORT_BASE + (UART_LCR * 4)); | ||
94 | |||
95 | /* Disable flow control */ | ||
96 | writeb(0, (char *)DEBUG_PORT_BASE + (UART_MCR * 4)); | ||
97 | |||
98 | /* Disable receive interrupt(!) */ | ||
99 | writeb(0, (char *)DEBUG_PORT_BASE + (UART_IER * 4)); | ||
100 | } | ||
101 | #endif | ||
102 | |||
103 | void __init msp_serial_setup(void) | 41 | void __init msp_serial_setup(void) |
104 | { | 42 | { |
105 | char *s; | 43 | char *s; |
@@ -139,17 +77,6 @@ void __init msp_serial_setup(void) | |||
139 | case MACH_MSP7120_FPGA: | 77 | case MACH_MSP7120_FPGA: |
140 | /* Enable UART1 on MSP4200 and MSP7120 */ | 78 | /* Enable UART1 on MSP4200 and MSP7120 */ |
141 | *GPIO_CFG2_REG = 0x00002299; | 79 | *GPIO_CFG2_REG = 0x00002299; |
142 | |||
143 | #ifdef CONFIG_KGDB | ||
144 | /* Initialize UART1 for kgdb since PMON doesn't */ | ||
145 | if( DEBUG_PORT_BASE == KSEG1ADDR(MSP_UART1_BASE) ) { | ||
146 | if( mips_machtype == MACH_MSP4200_FPGA | ||
147 | || mips_machtype == MACH_MSP7120_FPGA ) | ||
148 | initDebugPort(uartclk, 19200); | ||
149 | else | ||
150 | initDebugPort(uartclk, 57600); | ||
151 | } | ||
152 | #endif | ||
153 | break; | 80 | break; |
154 | 81 | ||
155 | default: | 82 | default: |
diff --git a/arch/mips/pmc-sierra/yosemite/Makefile b/arch/mips/pmc-sierra/yosemite/Makefile index 8fd9a04e3534..b16f95c3df65 100644 --- a/arch/mips/pmc-sierra/yosemite/Makefile +++ b/arch/mips/pmc-sierra/yosemite/Makefile | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | obj-y += irq.o prom.o py-console.o setup.o | 5 | obj-y += irq.o prom.o py-console.o setup.o |
6 | 6 | ||
7 | obj-$(CONFIG_KGDB) += dbg_io.o | ||
8 | obj-$(CONFIG_SMP) += smp.o | 7 | obj-$(CONFIG_SMP) += smp.o |
9 | 8 | ||
10 | EXTRA_CFLAGS += -Werror | 9 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/pmc-sierra/yosemite/dbg_io.c b/arch/mips/pmc-sierra/yosemite/dbg_io.c deleted file mode 100644 index 6362c702e389..000000000000 --- a/arch/mips/pmc-sierra/yosemite/dbg_io.c +++ /dev/null | |||
@@ -1,180 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PMC-Sierra | ||
3 | * Author: Manish Lachwani (lachwani@pmc-sierra.com) | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
11 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
13 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
14 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
15 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
16 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
17 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
18 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
19 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License along | ||
22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * Support for KGDB for the Yosemite board. We make use of single serial | ||
28 | * port to be used for KGDB as well as console. The second serial port | ||
29 | * seems to be having a problem. Single IRQ is allocated for both the | ||
30 | * ports. Hence, the interrupt routing code needs to figure out whether | ||
31 | * the interrupt came from channel A or B. | ||
32 | */ | ||
33 | |||
34 | #include <asm/serial.h> | ||
35 | |||
36 | /* | ||
37 | * Baud rate, Parity, Data and Stop bit settings for the | ||
38 | * serial port on the Yosemite. Note that the Early printk | ||
39 | * patch has been added. So, we should be all set to go | ||
40 | */ | ||
41 | #define YOSEMITE_BAUD_2400 2400 | ||
42 | #define YOSEMITE_BAUD_4800 4800 | ||
43 | #define YOSEMITE_BAUD_9600 9600 | ||
44 | #define YOSEMITE_BAUD_19200 19200 | ||
45 | #define YOSEMITE_BAUD_38400 38400 | ||
46 | #define YOSEMITE_BAUD_57600 57600 | ||
47 | #define YOSEMITE_BAUD_115200 115200 | ||
48 | |||
49 | #define YOSEMITE_PARITY_NONE 0 | ||
50 | #define YOSEMITE_PARITY_ODD 0x08 | ||
51 | #define YOSEMITE_PARITY_EVEN 0x18 | ||
52 | #define YOSEMITE_PARITY_MARK 0x28 | ||
53 | #define YOSEMITE_PARITY_SPACE 0x38 | ||
54 | |||
55 | #define YOSEMITE_DATA_5BIT 0x0 | ||
56 | #define YOSEMITE_DATA_6BIT 0x1 | ||
57 | #define YOSEMITE_DATA_7BIT 0x2 | ||
58 | #define YOSEMITE_DATA_8BIT 0x3 | ||
59 | |||
60 | #define YOSEMITE_STOP_1BIT 0x0 | ||
61 | #define YOSEMITE_STOP_2BIT 0x4 | ||
62 | |||
63 | /* This is crucial */ | ||
64 | #define SERIAL_REG_OFS 0x1 | ||
65 | |||
66 | #define SERIAL_RCV_BUFFER 0x0 | ||
67 | #define SERIAL_TRANS_HOLD 0x0 | ||
68 | #define SERIAL_SEND_BUFFER 0x0 | ||
69 | #define SERIAL_INTR_ENABLE (1 * SERIAL_REG_OFS) | ||
70 | #define SERIAL_INTR_ID (2 * SERIAL_REG_OFS) | ||
71 | #define SERIAL_DATA_FORMAT (3 * SERIAL_REG_OFS) | ||
72 | #define SERIAL_LINE_CONTROL (3 * SERIAL_REG_OFS) | ||
73 | #define SERIAL_MODEM_CONTROL (4 * SERIAL_REG_OFS) | ||
74 | #define SERIAL_RS232_OUTPUT (4 * SERIAL_REG_OFS) | ||
75 | #define SERIAL_LINE_STATUS (5 * SERIAL_REG_OFS) | ||
76 | #define SERIAL_MODEM_STATUS (6 * SERIAL_REG_OFS) | ||
77 | #define SERIAL_RS232_INPUT (6 * SERIAL_REG_OFS) | ||
78 | #define SERIAL_SCRATCH_PAD (7 * SERIAL_REG_OFS) | ||
79 | |||
80 | #define SERIAL_DIVISOR_LSB (0 * SERIAL_REG_OFS) | ||
81 | #define SERIAL_DIVISOR_MSB (1 * SERIAL_REG_OFS) | ||
82 | |||
83 | /* | ||
84 | * Functions to READ and WRITE to serial port 0 | ||
85 | */ | ||
86 | #define SERIAL_READ(ofs) (*((volatile unsigned char*) \ | ||
87 | (TITAN_SERIAL_BASE + ofs))) | ||
88 | |||
89 | #define SERIAL_WRITE(ofs, val) ((*((volatile unsigned char*) \ | ||
90 | (TITAN_SERIAL_BASE + ofs))) = val) | ||
91 | |||
92 | /* | ||
93 | * Functions to READ and WRITE to serial port 1 | ||
94 | */ | ||
95 | #define SERIAL_READ_1(ofs) (*((volatile unsigned char*) \ | ||
96 | (TITAN_SERIAL_BASE_1 + ofs))) | ||
97 | |||
98 | #define SERIAL_WRITE_1(ofs, val) ((*((volatile unsigned char*) \ | ||
99 | (TITAN_SERIAL_BASE_1 + ofs))) = val) | ||
100 | |||
101 | /* | ||
102 | * Second serial port initialization | ||
103 | */ | ||
104 | void init_second_port(void) | ||
105 | { | ||
106 | /* Disable Interrupts */ | ||
107 | SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x0); | ||
108 | SERIAL_WRITE_1(SERIAL_INTR_ENABLE, 0x0); | ||
109 | |||
110 | { | ||
111 | unsigned int divisor; | ||
112 | |||
113 | SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x80); | ||
114 | divisor = TITAN_SERIAL_BASE_BAUD / YOSEMITE_BAUD_115200; | ||
115 | SERIAL_WRITE_1(SERIAL_DIVISOR_LSB, divisor & 0xff); | ||
116 | |||
117 | SERIAL_WRITE_1(SERIAL_DIVISOR_MSB, | ||
118 | (divisor & 0xff00) >> 8); | ||
119 | SERIAL_WRITE_1(SERIAL_LINE_CONTROL, 0x0); | ||
120 | } | ||
121 | |||
122 | SERIAL_WRITE_1(SERIAL_DATA_FORMAT, YOSEMITE_DATA_8BIT | | ||
123 | YOSEMITE_PARITY_NONE | YOSEMITE_STOP_1BIT); | ||
124 | |||
125 | /* Enable Interrupts */ | ||
126 | SERIAL_WRITE_1(SERIAL_INTR_ENABLE, 0xf); | ||
127 | } | ||
128 | |||
129 | /* Initialize the serial port for KGDB debugging */ | ||
130 | void debugInit(unsigned int baud, unsigned char data, unsigned char parity, | ||
131 | unsigned char stop) | ||
132 | { | ||
133 | /* Disable Interrupts */ | ||
134 | SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x0); | ||
135 | SERIAL_WRITE(SERIAL_INTR_ENABLE, 0x0); | ||
136 | |||
137 | { | ||
138 | unsigned int divisor; | ||
139 | |||
140 | SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x80); | ||
141 | |||
142 | divisor = TITAN_SERIAL_BASE_BAUD / baud; | ||
143 | SERIAL_WRITE(SERIAL_DIVISOR_LSB, divisor & 0xff); | ||
144 | |||
145 | SERIAL_WRITE(SERIAL_DIVISOR_MSB, (divisor & 0xff00) >> 8); | ||
146 | SERIAL_WRITE(SERIAL_LINE_CONTROL, 0x0); | ||
147 | } | ||
148 | |||
149 | SERIAL_WRITE(SERIAL_DATA_FORMAT, data | parity | stop); | ||
150 | } | ||
151 | |||
152 | static int remoteDebugInitialized = 0; | ||
153 | |||
154 | unsigned char getDebugChar(void) | ||
155 | { | ||
156 | if (!remoteDebugInitialized) { | ||
157 | remoteDebugInitialized = 1; | ||
158 | debugInit(YOSEMITE_BAUD_115200, | ||
159 | YOSEMITE_DATA_8BIT, | ||
160 | YOSEMITE_PARITY_NONE, YOSEMITE_STOP_1BIT); | ||
161 | } | ||
162 | |||
163 | while ((SERIAL_READ(SERIAL_LINE_STATUS) & 0x1) == 0); | ||
164 | return SERIAL_READ(SERIAL_RCV_BUFFER); | ||
165 | } | ||
166 | |||
167 | int putDebugChar(unsigned char byte) | ||
168 | { | ||
169 | if (!remoteDebugInitialized) { | ||
170 | remoteDebugInitialized = 1; | ||
171 | debugInit(YOSEMITE_BAUD_115200, | ||
172 | YOSEMITE_DATA_8BIT, | ||
173 | YOSEMITE_PARITY_NONE, YOSEMITE_STOP_1BIT); | ||
174 | } | ||
175 | |||
176 | while ((SERIAL_READ(SERIAL_LINE_STATUS) & 0x20) == 0); | ||
177 | SERIAL_WRITE(SERIAL_SEND_BUFFER, byte); | ||
178 | |||
179 | return 1; | ||
180 | } | ||
diff --git a/arch/mips/pmc-sierra/yosemite/irq.c b/arch/mips/pmc-sierra/yosemite/irq.c index 4decc2807867..5f673eba142c 100644 --- a/arch/mips/pmc-sierra/yosemite/irq.c +++ b/arch/mips/pmc-sierra/yosemite/irq.c | |||
@@ -141,10 +141,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | #ifdef CONFIG_KGDB | ||
145 | extern void init_second_port(void); | ||
146 | #endif | ||
147 | |||
148 | /* | 144 | /* |
149 | * Initialize the next level interrupt handler | 145 | * Initialize the next level interrupt handler |
150 | */ | 146 | */ |
@@ -156,11 +152,6 @@ void __init arch_init_irq(void) | |||
156 | rm7k_cpu_irq_init(); | 152 | rm7k_cpu_irq_init(); |
157 | rm9k_cpu_irq_init(); | 153 | rm9k_cpu_irq_init(); |
158 | 154 | ||
159 | #ifdef CONFIG_KGDB | ||
160 | /* At this point, initialize the second serial port */ | ||
161 | init_second_port(); | ||
162 | #endif | ||
163 | |||
164 | #ifdef CONFIG_GDB_CONSOLE | 155 | #ifdef CONFIG_GDB_CONSOLE |
165 | register_gdb_console(); | 156 | register_gdb_console(); |
166 | #endif | 157 | #endif |
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index b2fe82dba0a5..00a1c7877bf4 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c | |||
@@ -64,7 +64,8 @@ static struct resource rb532_dev3_ctl_res[] = { | |||
64 | 64 | ||
65 | void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val) | 65 | void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val) |
66 | { | 66 | { |
67 | unsigned flags, data; | 67 | unsigned long flags; |
68 | unsigned data; | ||
68 | unsigned i = 0; | 69 | unsigned i = 0; |
69 | 70 | ||
70 | spin_lock_irqsave(&dev3.lock, flags); | 71 | spin_lock_irqsave(&dev3.lock, flags); |
@@ -90,7 +91,7 @@ EXPORT_SYMBOL(get_434_reg); | |||
90 | 91 | ||
91 | void set_latch_u5(unsigned char or_mask, unsigned char nand_mask) | 92 | void set_latch_u5(unsigned char or_mask, unsigned char nand_mask) |
92 | { | 93 | { |
93 | unsigned flags; | 94 | unsigned long flags; |
94 | 95 | ||
95 | spin_lock_irqsave(&dev3.lock, flags); | 96 | spin_lock_irqsave(&dev3.lock, flags); |
96 | 97 | ||
diff --git a/arch/mips/rb532/time.c b/arch/mips/rb532/time.c index db74edf8cefb..8e7a46855b50 100644 --- a/arch/mips/rb532/time.c +++ b/arch/mips/rb532/time.c | |||
@@ -49,8 +49,8 @@ static unsigned long __init cal_r4koff(void) | |||
49 | 49 | ||
50 | void __init plat_time_init(void) | 50 | void __init plat_time_init(void) |
51 | { | 51 | { |
52 | unsigned int est_freq, flags; | 52 | unsigned int est_freq; |
53 | unsigned long r4k_offset; | 53 | unsigned long flags, r4k_offset; |
54 | 54 | ||
55 | local_irq_save(flags); | 55 | local_irq_save(flags); |
56 | 56 | ||
diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c index 5f389ee26fca..896a1ef84829 100644 --- a/arch/mips/sgi-ip22/ip22-setup.c +++ b/arch/mips/sgi-ip22/ip22-setup.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
21 | #include <asm/reboot.h> | 21 | #include <asm/reboot.h> |
22 | #include <asm/time.h> | 22 | #include <asm/time.h> |
23 | #include <asm/gdb-stub.h> | ||
24 | #include <asm/io.h> | 23 | #include <asm/io.h> |
25 | #include <asm/traps.h> | 24 | #include <asm/traps.h> |
26 | #include <asm/sgialib.h> | 25 | #include <asm/sgialib.h> |
@@ -81,30 +80,6 @@ void __init plat_mem_setup(void) | |||
81 | add_preferred_console("arc", 0, NULL); | 80 | add_preferred_console("arc", 0, NULL); |
82 | } | 81 | } |
83 | 82 | ||
84 | #ifdef CONFIG_KGDB | ||
85 | { | ||
86 | char *kgdb_ttyd = prom_getcmdline(); | ||
87 | |||
88 | if ((kgdb_ttyd = strstr(kgdb_ttyd, "kgdb=ttyd")) != NULL) { | ||
89 | int line; | ||
90 | kgdb_ttyd += strlen("kgdb=ttyd"); | ||
91 | if (*kgdb_ttyd != '1' && *kgdb_ttyd != '2') | ||
92 | printk(KERN_INFO "KGDB: Uknown serial line /dev/ttyd%c" | ||
93 | ", falling back to /dev/ttyd1\n", *kgdb_ttyd); | ||
94 | line = *kgdb_ttyd == '2' ? 0 : 1; | ||
95 | printk(KERN_INFO "KGDB: Using serial line /dev/ttyd%d for " | ||
96 | "session\n", line ? 1 : 2); | ||
97 | rs_kgdb_hook(line); | ||
98 | |||
99 | printk(KERN_INFO "KGDB: Using serial line /dev/ttyd%d for " | ||
100 | "session, please connect your debugger\n", line ? 1:2); | ||
101 | |||
102 | kgdb_enabled = 1; | ||
103 | /* Breakpoints and stuff are in sgi_irq_setup() */ | ||
104 | } | ||
105 | } | ||
106 | #endif | ||
107 | |||
108 | #if defined(CONFIG_VT) && defined(CONFIG_SGI_NEWPORT_CONSOLE) | 83 | #if defined(CONFIG_VT) && defined(CONFIG_SGI_NEWPORT_CONSOLE) |
109 | { | 84 | { |
110 | ULONG *gfxinfo; | 85 | ULONG *gfxinfo; |
diff --git a/arch/mips/sgi-ip27/Makefile b/arch/mips/sgi-ip27/Makefile index e0a6871d56e4..31f4931b8484 100644 --- a/arch/mips/sgi-ip27/Makefile +++ b/arch/mips/sgi-ip27/Makefile | |||
@@ -7,7 +7,6 @@ obj-y := ip27-berr.o ip27-irq.o ip27-init.o ip27-klconfig.o ip27-klnuma.o \ | |||
7 | ip27-xtalk.o | 7 | ip27-xtalk.o |
8 | 8 | ||
9 | obj-$(CONFIG_EARLY_PRINTK) += ip27-console.o | 9 | obj-$(CONFIG_EARLY_PRINTK) += ip27-console.o |
10 | obj-$(CONFIG_KGDB) += ip27-dbgio.o | ||
11 | obj-$(CONFIG_SMP) += ip27-smp.o | 10 | obj-$(CONFIG_SMP) += ip27-smp.o |
12 | 11 | ||
13 | EXTRA_CFLAGS += -Werror | 12 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/sgi-ip27/ip27-dbgio.c b/arch/mips/sgi-ip27/ip27-dbgio.c deleted file mode 100644 index 08fd88b36f80..000000000000 --- a/arch/mips/sgi-ip27/ip27-dbgio.c +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms of the GNU General Public License as published by the | ||
4 | * Free Software Foundation; either version 2 of the License, or (at your | ||
5 | * option) any later version. | ||
6 | * | ||
7 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
8 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
9 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
10 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
11 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
12 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
13 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
14 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
15 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
16 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | * | ||
22 | * Copyright 2004 Ralf Baechle <ralf@linux-mips.org> | ||
23 | */ | ||
24 | #include <asm/sn/addrs.h> | ||
25 | #include <asm/sn/sn0/hub.h> | ||
26 | #include <asm/sn/klconfig.h> | ||
27 | #include <asm/sn/ioc3.h> | ||
28 | #include <asm/sn/sn_private.h> | ||
29 | |||
30 | #include <linux/serial.h> | ||
31 | #include <linux/serial_core.h> | ||
32 | #include <linux/serial_reg.h> | ||
33 | |||
34 | #define IOC3_CLK (22000000 / 3) | ||
35 | #define IOC3_FLAGS (0) | ||
36 | |||
37 | static inline struct ioc3_uartregs *console_uart(void) | ||
38 | { | ||
39 | struct ioc3 *ioc3; | ||
40 | |||
41 | ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(get_nasid())->memory_base; | ||
42 | |||
43 | return &ioc3->sregs.uarta; | ||
44 | } | ||
45 | |||
46 | unsigned char getDebugChar(void) | ||
47 | { | ||
48 | struct ioc3_uartregs *uart = console_uart(); | ||
49 | |||
50 | while ((uart->iu_lsr & UART_LSR_DR) == 0); | ||
51 | return uart->iu_rbr; | ||
52 | } | ||
53 | |||
54 | void putDebugChar(unsigned char c) | ||
55 | { | ||
56 | struct ioc3_uartregs *uart = console_uart(); | ||
57 | |||
58 | while ((uart->iu_lsr & UART_LSR_THRE) == 0); | ||
59 | uart->iu_thr = c; | ||
60 | } | ||
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index db372a0f106d..a35818ed4263 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
@@ -57,30 +57,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask); | |||
57 | extern unsigned long ht_eoi_space; | 57 | extern unsigned long ht_eoi_space; |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef CONFIG_KGDB | ||
61 | #include <asm/gdb-stub.h> | ||
62 | extern void breakpoint(void); | ||
63 | static int kgdb_irq; | ||
64 | #ifdef CONFIG_GDB_CONSOLE | ||
65 | extern void register_gdb_console(void); | ||
66 | #endif | ||
67 | |||
68 | /* kgdb is on when configured. Pass "nokgdb" kernel arg to turn it off */ | ||
69 | static int kgdb_flag = 1; | ||
70 | static int __init nokgdb(char *str) | ||
71 | { | ||
72 | kgdb_flag = 0; | ||
73 | return 1; | ||
74 | } | ||
75 | __setup("nokgdb", nokgdb); | ||
76 | |||
77 | /* Default to UART1 */ | ||
78 | int kgdb_port = 1; | ||
79 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
80 | extern char sb1250_duart_present[]; | ||
81 | #endif | ||
82 | #endif | ||
83 | |||
84 | static struct irq_chip bcm1480_irq_type = { | 60 | static struct irq_chip bcm1480_irq_type = { |
85 | .name = "BCM1480-IMR", | 61 | .name = "BCM1480-IMR", |
86 | .ack = ack_bcm1480_irq, | 62 | .ack = ack_bcm1480_irq, |
@@ -355,61 +331,10 @@ void __init arch_init_irq(void) | |||
355 | * does its own management of IP7. | 331 | * does its own management of IP7. |
356 | */ | 332 | */ |
357 | 333 | ||
358 | #ifdef CONFIG_KGDB | ||
359 | imask |= STATUSF_IP6; | ||
360 | #endif | ||
361 | /* Enable necessary IPs, disable the rest */ | 334 | /* Enable necessary IPs, disable the rest */ |
362 | change_c0_status(ST0_IM, imask); | 335 | change_c0_status(ST0_IM, imask); |
363 | |||
364 | #ifdef CONFIG_KGDB | ||
365 | if (kgdb_flag) { | ||
366 | kgdb_irq = K_BCM1480_INT_UART_0 + kgdb_port; | ||
367 | |||
368 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
369 | sb1250_duart_present[kgdb_port] = 0; | ||
370 | #endif | ||
371 | /* Setup uart 1 settings, mapper */ | ||
372 | /* QQQ FIXME */ | ||
373 | __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port))); | ||
374 | |||
375 | __raw_writeq(IMR_IP6_VAL, | ||
376 | IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) + | ||
377 | (kgdb_irq << 3))); | ||
378 | bcm1480_unmask_irq(0, kgdb_irq); | ||
379 | |||
380 | #ifdef CONFIG_GDB_CONSOLE | ||
381 | register_gdb_console(); | ||
382 | #endif | ||
383 | printk("Waiting for GDB on UART port %d\n", kgdb_port); | ||
384 | set_debug_traps(); | ||
385 | breakpoint(); | ||
386 | } | ||
387 | #endif | ||
388 | } | ||
389 | |||
390 | #ifdef CONFIG_KGDB | ||
391 | |||
392 | #include <linux/delay.h> | ||
393 | |||
394 | #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
395 | #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
396 | |||
397 | static void bcm1480_kgdb_interrupt(void) | ||
398 | { | ||
399 | /* | ||
400 | * Clear break-change status (allow some time for the remote | ||
401 | * host to stop the break, since we would see another | ||
402 | * interrupt on the end-of-break too) | ||
403 | */ | ||
404 | kstat.irqs[smp_processor_id()][kgdb_irq]++; | ||
405 | mdelay(500); | ||
406 | duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT | | ||
407 | M_DUART_RX_EN | M_DUART_TX_EN); | ||
408 | set_async_breakpoint(&get_irq_regs()->cp0_epc); | ||
409 | } | 336 | } |
410 | 337 | ||
411 | #endif /* CONFIG_KGDB */ | ||
412 | |||
413 | extern void bcm1480_mailbox_interrupt(void); | 338 | extern void bcm1480_mailbox_interrupt(void); |
414 | 339 | ||
415 | static inline void dispatch_ip2(void) | 340 | static inline void dispatch_ip2(void) |
@@ -462,11 +387,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
462 | bcm1480_mailbox_interrupt(); | 387 | bcm1480_mailbox_interrupt(); |
463 | #endif | 388 | #endif |
464 | 389 | ||
465 | #ifdef CONFIG_KGDB | ||
466 | else if (pending & CAUSEF_IP6) | ||
467 | bcm1480_kgdb_interrupt(); /* KGDB (uart 1) */ | ||
468 | #endif | ||
469 | |||
470 | else if (pending & CAUSEF_IP2) | 390 | else if (pending & CAUSEF_IP2) |
471 | dispatch_ip2(); | 391 | dispatch_ip2(); |
472 | } | 392 | } |
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c index fd9604d5555a..3de30f79db3f 100644 --- a/arch/mips/sibyte/cfe/setup.c +++ b/arch/mips/sibyte/cfe/setup.c | |||
@@ -59,10 +59,6 @@ int cfe_cons_handle; | |||
59 | extern unsigned long initrd_start, initrd_end; | 59 | extern unsigned long initrd_start, initrd_end; |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | #ifdef CONFIG_KGDB | ||
63 | extern int kgdb_port; | ||
64 | #endif | ||
65 | |||
66 | static void __noreturn cfe_linux_exit(void *arg) | 62 | static void __noreturn cfe_linux_exit(void *arg) |
67 | { | 63 | { |
68 | int warm = *(int *)arg; | 64 | int warm = *(int *)arg; |
@@ -246,9 +242,6 @@ void __init prom_init(void) | |||
246 | int argc = fw_arg0; | 242 | int argc = fw_arg0; |
247 | char **envp = (char **) fw_arg2; | 243 | char **envp = (char **) fw_arg2; |
248 | int *prom_vec = (int *) fw_arg3; | 244 | int *prom_vec = (int *) fw_arg3; |
249 | #ifdef CONFIG_KGDB | ||
250 | char *arg; | ||
251 | #endif | ||
252 | 245 | ||
253 | _machine_restart = cfe_linux_restart; | 246 | _machine_restart = cfe_linux_restart; |
254 | _machine_halt = cfe_linux_halt; | 247 | _machine_halt = cfe_linux_halt; |
@@ -309,13 +302,6 @@ void __init prom_init(void) | |||
309 | } | 302 | } |
310 | } | 303 | } |
311 | 304 | ||
312 | #ifdef CONFIG_KGDB | ||
313 | if ((arg = strstr(arcs_cmdline, "kgdb=duart")) != NULL) | ||
314 | kgdb_port = (arg[10] == '0') ? 0 : 1; | ||
315 | else | ||
316 | kgdb_port = 1; | ||
317 | #endif | ||
318 | |||
319 | #ifdef CONFIG_BLK_DEV_INITRD | 305 | #ifdef CONFIG_BLK_DEV_INITRD |
320 | { | 306 | { |
321 | char *ptr; | 307 | char *ptr; |
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index eac9065ffe0c..a5158483986e 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -57,16 +57,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); | |||
57 | extern unsigned long ldt_eoi_space; | 57 | extern unsigned long ldt_eoi_space; |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef CONFIG_KGDB | ||
61 | static int kgdb_irq; | ||
62 | |||
63 | /* Default to UART1 */ | ||
64 | int kgdb_port = 1; | ||
65 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
66 | extern char sb1250_duart_present[]; | ||
67 | #endif | ||
68 | #endif | ||
69 | |||
70 | static struct irq_chip sb1250_irq_type = { | 60 | static struct irq_chip sb1250_irq_type = { |
71 | .name = "SB1250-IMR", | 61 | .name = "SB1250-IMR", |
72 | .ack = ack_sb1250_irq, | 62 | .ack = ack_sb1250_irq, |
@@ -313,55 +303,10 @@ void __init arch_init_irq(void) | |||
313 | * does its own management of IP7. | 303 | * does its own management of IP7. |
314 | */ | 304 | */ |
315 | 305 | ||
316 | #ifdef CONFIG_KGDB | ||
317 | imask |= STATUSF_IP6; | ||
318 | #endif | ||
319 | /* Enable necessary IPs, disable the rest */ | 306 | /* Enable necessary IPs, disable the rest */ |
320 | change_c0_status(ST0_IM, imask); | 307 | change_c0_status(ST0_IM, imask); |
321 | |||
322 | #ifdef CONFIG_KGDB | ||
323 | if (kgdb_flag) { | ||
324 | kgdb_irq = K_INT_UART_0 + kgdb_port; | ||
325 | |||
326 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
327 | sb1250_duart_present[kgdb_port] = 0; | ||
328 | #endif | ||
329 | /* Setup uart 1 settings, mapper */ | ||
330 | __raw_writeq(M_DUART_IMR_BRK, | ||
331 | IOADDR(A_DUART_IMRREG(kgdb_port))); | ||
332 | |||
333 | __raw_writeq(IMR_IP6_VAL, | ||
334 | IOADDR(A_IMR_REGISTER(0, | ||
335 | R_IMR_INTERRUPT_MAP_BASE) + | ||
336 | (kgdb_irq << 3))); | ||
337 | sb1250_unmask_irq(0, kgdb_irq); | ||
338 | } | ||
339 | #endif | ||
340 | } | ||
341 | |||
342 | #ifdef CONFIG_KGDB | ||
343 | |||
344 | #include <linux/delay.h> | ||
345 | |||
346 | #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
347 | #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
348 | |||
349 | static void sb1250_kgdb_interrupt(void) | ||
350 | { | ||
351 | /* | ||
352 | * Clear break-change status (allow some time for the remote | ||
353 | * host to stop the break, since we would see another | ||
354 | * interrupt on the end-of-break too) | ||
355 | */ | ||
356 | kstat_this_cpu.irqs[kgdb_irq]++; | ||
357 | mdelay(500); | ||
358 | duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT | | ||
359 | M_DUART_RX_EN | M_DUART_TX_EN); | ||
360 | set_async_breakpoint(&get_irq_regs()->cp0_epc); | ||
361 | } | 308 | } |
362 | 309 | ||
363 | #endif /* CONFIG_KGDB */ | ||
364 | |||
365 | extern void sb1250_mailbox_interrupt(void); | 310 | extern void sb1250_mailbox_interrupt(void); |
366 | 311 | ||
367 | static inline void dispatch_ip2(void) | 312 | static inline void dispatch_ip2(void) |
@@ -407,11 +352,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
407 | sb1250_mailbox_interrupt(); | 352 | sb1250_mailbox_interrupt(); |
408 | #endif | 353 | #endif |
409 | 354 | ||
410 | #ifdef CONFIG_KGDB | ||
411 | else if (pending & CAUSEF_IP6) /* KGDB (uart 1) */ | ||
412 | sb1250_kgdb_interrupt(); | ||
413 | #endif | ||
414 | |||
415 | else if (pending & CAUSEF_IP2) | 355 | else if (pending & CAUSEF_IP2) |
416 | dispatch_ip2(); | 356 | dispatch_ip2(); |
417 | else | 357 | else |
diff --git a/arch/mips/sibyte/swarm/Makefile b/arch/mips/sibyte/swarm/Makefile index 255d692bfa18..f18ba9201bbc 100644 --- a/arch/mips/sibyte/swarm/Makefile +++ b/arch/mips/sibyte/swarm/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o | 1 | obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o |
2 | 2 | ||
3 | obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o | 3 | obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o |
4 | obj-$(CONFIG_KGDB) += dbg_io.o | ||
diff --git a/arch/mips/sibyte/swarm/dbg_io.c b/arch/mips/sibyte/swarm/dbg_io.c deleted file mode 100644 index b97ae3048482..000000000000 --- a/arch/mips/sibyte/swarm/dbg_io.c +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * kgdb debug routines for SiByte boards. | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software Inc. | ||
5 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | /* -------------------- BEGINNING OF CONFIG --------------------- */ | ||
15 | |||
16 | #include <linux/delay.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/sibyte/sb1250.h> | ||
19 | #include <asm/sibyte/sb1250_regs.h> | ||
20 | #include <asm/sibyte/sb1250_uart.h> | ||
21 | #include <asm/sibyte/sb1250_int.h> | ||
22 | #include <asm/addrspace.h> | ||
23 | |||
24 | /* | ||
25 | * We use the second serial port for kgdb traffic. | ||
26 | * 115200, 8, N, 1. | ||
27 | */ | ||
28 | |||
29 | #define BAUD_RATE 115200 | ||
30 | #define CLK_DIVISOR V_DUART_BAUD_RATE(BAUD_RATE) | ||
31 | #define DATA_BITS V_DUART_BITS_PER_CHAR_8 /* or 7 */ | ||
32 | #define PARITY V_DUART_PARITY_MODE_NONE /* or even */ | ||
33 | #define STOP_BITS M_DUART_STOP_BIT_LEN_1 /* or 2 */ | ||
34 | |||
35 | static int duart_initialized = 0; /* 0: need to be init'ed by kgdb */ | ||
36 | |||
37 | /* -------------------- END OF CONFIG --------------------- */ | ||
38 | extern int kgdb_port; | ||
39 | |||
40 | #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
41 | #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
42 | |||
43 | void putDebugChar(unsigned char c); | ||
44 | unsigned char getDebugChar(void); | ||
45 | static void | ||
46 | duart_init(int clk_divisor, int data, int parity, int stop) | ||
47 | { | ||
48 | duart_out(R_DUART_MODE_REG_1, data | parity); | ||
49 | duart_out(R_DUART_MODE_REG_2, stop); | ||
50 | duart_out(R_DUART_CLK_SEL, clk_divisor); | ||
51 | |||
52 | duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN); /* enable rx and tx */ | ||
53 | } | ||
54 | |||
55 | void | ||
56 | putDebugChar(unsigned char c) | ||
57 | { | ||
58 | if (!duart_initialized) { | ||
59 | duart_initialized = 1; | ||
60 | duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS); | ||
61 | } | ||
62 | while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0); | ||
63 | duart_out(R_DUART_TX_HOLD, c); | ||
64 | } | ||
65 | |||
66 | unsigned char | ||
67 | getDebugChar(void) | ||
68 | { | ||
69 | if (!duart_initialized) { | ||
70 | duart_initialized = 1; | ||
71 | duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS); | ||
72 | } | ||
73 | while ((duart_in(R_DUART_STATUS) & M_DUART_RX_RDY) == 0) ; | ||
74 | return duart_in(R_DUART_RX_HOLD); | ||
75 | } | ||
76 | |||
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig index 6de4c5aa92be..840fe757c48d 100644 --- a/arch/mips/txx9/Kconfig +++ b/arch/mips/txx9/Kconfig | |||
@@ -1,3 +1,27 @@ | |||
1 | config MACH_TX39XX | ||
2 | bool | ||
3 | select MACH_TXX9 | ||
4 | select SYS_HAS_CPU_TX39XX | ||
5 | |||
6 | config MACH_TX49XX | ||
7 | bool | ||
8 | select MACH_TXX9 | ||
9 | select CEVT_R4K | ||
10 | select CSRC_R4K | ||
11 | select IRQ_CPU | ||
12 | select SYS_HAS_CPU_TX49XX | ||
13 | select SYS_SUPPORTS_64BIT_KERNEL | ||
14 | |||
15 | config MACH_TXX9 | ||
16 | bool | ||
17 | select DMA_NONCOHERENT | ||
18 | select SWAP_IO_SPACE | ||
19 | select SYS_HAS_EARLY_PRINTK | ||
20 | select SYS_SUPPORTS_32BIT_KERNEL | ||
21 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
22 | select SYS_SUPPORTS_BIG_ENDIAN | ||
23 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
24 | |||
1 | config TOSHIBA_JMR3927 | 25 | config TOSHIBA_JMR3927 |
2 | bool "Toshiba JMR-TX3927 board" | 26 | bool "Toshiba JMR-TX3927 board" |
3 | depends on MACH_TX39XX | 27 | depends on MACH_TX39XX |
@@ -24,68 +48,37 @@ config TOSHIBA_RBTX4938 | |||
24 | config SOC_TX3927 | 48 | config SOC_TX3927 |
25 | bool | 49 | bool |
26 | select CEVT_TXX9 | 50 | select CEVT_TXX9 |
27 | select DMA_NONCOHERENT | ||
28 | select HAS_TXX9_SERIAL | 51 | select HAS_TXX9_SERIAL |
29 | select HW_HAS_PCI | 52 | select HW_HAS_PCI |
30 | select IRQ_TXX9 | 53 | select IRQ_TXX9 |
31 | select SWAP_IO_SPACE | ||
32 | select SYS_HAS_CPU_TX39XX | ||
33 | select SYS_SUPPORTS_32BIT_KERNEL | ||
34 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
35 | select SYS_SUPPORTS_BIG_ENDIAN | ||
36 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
37 | select GPIO_TXX9 | 54 | select GPIO_TXX9 |
38 | 55 | ||
39 | config SOC_TX4927 | 56 | config SOC_TX4927 |
40 | bool | 57 | bool |
41 | select CEVT_R4K | ||
42 | select CSRC_R4K | ||
43 | select CEVT_TXX9 | 58 | select CEVT_TXX9 |
44 | select DMA_NONCOHERENT | ||
45 | select HAS_TXX9_SERIAL | 59 | select HAS_TXX9_SERIAL |
46 | select HW_HAS_PCI | 60 | select HW_HAS_PCI |
47 | select IRQ_CPU | ||
48 | select IRQ_TXX9 | 61 | select IRQ_TXX9 |
49 | select PCI_TX4927 | 62 | select PCI_TX4927 |
50 | select SWAP_IO_SPACE | ||
51 | select SYS_HAS_CPU_TX49XX | ||
52 | select SYS_SUPPORTS_32BIT_KERNEL | ||
53 | select SYS_SUPPORTS_64BIT_KERNEL | ||
54 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
55 | select SYS_SUPPORTS_BIG_ENDIAN | ||
56 | select SYS_SUPPORTS_KGDB | ||
57 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
58 | select GPIO_TXX9 | 63 | select GPIO_TXX9 |
59 | 64 | ||
60 | config SOC_TX4938 | 65 | config SOC_TX4938 |
61 | bool | 66 | bool |
62 | select CEVT_R4K | ||
63 | select CSRC_R4K | ||
64 | select CEVT_TXX9 | 67 | select CEVT_TXX9 |
65 | select DMA_NONCOHERENT | ||
66 | select HAS_TXX9_SERIAL | 68 | select HAS_TXX9_SERIAL |
67 | select HW_HAS_PCI | 69 | select HW_HAS_PCI |
68 | select IRQ_CPU | ||
69 | select IRQ_TXX9 | 70 | select IRQ_TXX9 |
70 | select PCI_TX4927 | 71 | select PCI_TX4927 |
71 | select SWAP_IO_SPACE | ||
72 | select SYS_HAS_CPU_TX49XX | ||
73 | select SYS_SUPPORTS_32BIT_KERNEL | ||
74 | select SYS_SUPPORTS_64BIT_KERNEL | ||
75 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
76 | select SYS_SUPPORTS_BIG_ENDIAN | ||
77 | select SYS_SUPPORTS_KGDB | ||
78 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
79 | select GPIO_TXX9 | 72 | select GPIO_TXX9 |
80 | 73 | ||
81 | config TOSHIBA_FPCIB0 | 74 | config TOSHIBA_FPCIB0 |
82 | bool "FPCIB0 Backplane Support" | 75 | bool "FPCIB0 Backplane Support" |
83 | depends on PCI && (MACH_TX39XX || MACH_TX49XX) | 76 | depends on PCI && MACH_TXX9 |
84 | select I8259 | 77 | select I8259 |
85 | 78 | ||
86 | config PICMG_PCI_BACKPLANE_DEFAULT | 79 | config PICMG_PCI_BACKPLANE_DEFAULT |
87 | bool "Support for PICMG PCI Backplane" | 80 | bool "Support for PICMG PCI Backplane" |
88 | depends on PCI && (MACH_TX39XX || MACH_TX49XX) | 81 | depends on PCI && MACH_TXX9 |
89 | default y if !TOSHIBA_FPCIB0 | 82 | default y if !TOSHIBA_FPCIB0 |
90 | 83 | ||
91 | if TOSHIBA_RBTX4938 | 84 | if TOSHIBA_RBTX4938 |
diff --git a/arch/mips/txx9/generic/Makefile b/arch/mips/txx9/generic/Makefile index 9c120771e65f..9bb34af26b73 100644 --- a/arch/mips/txx9/generic/Makefile +++ b/arch/mips/txx9/generic/Makefile | |||
@@ -4,9 +4,9 @@ | |||
4 | 4 | ||
5 | obj-y += setup.o | 5 | obj-y += setup.o |
6 | obj-$(CONFIG_PCI) += pci.o | 6 | obj-$(CONFIG_PCI) += pci.o |
7 | obj-$(CONFIG_SOC_TX3927) += setup_tx3927.o irq_tx3927.o | ||
7 | obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o | 8 | obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o |
8 | obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o | 9 | obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o |
9 | obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o | 10 | obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o |
10 | obj-$(CONFIG_KGDB) += dbgio.o | ||
11 | 11 | ||
12 | EXTRA_CFLAGS += -Werror | 12 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/txx9/generic/dbgio.c b/arch/mips/txx9/generic/dbgio.c deleted file mode 100644 index 33b9c672a322..000000000000 --- a/arch/mips/txx9/generic/dbgio.c +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/mips/tx4938/common/dbgio.c | ||
3 | * | ||
4 | * kgdb interface for gdb | ||
5 | * | ||
6 | * Author: MontaVista Software, Inc. | ||
7 | * source@mvista.com | ||
8 | * | ||
9 | * Copyright 2005 MontaVista Software Inc. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | ||
24 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
25 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License along | ||
28 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
29 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
30 | * | ||
31 | * Support for TX4938 in 2.6 - Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp> | ||
32 | */ | ||
33 | |||
34 | #include <linux/types> | ||
35 | |||
36 | extern u8 txx9_sio_kdbg_rd(void); | ||
37 | extern int txx9_sio_kdbg_wr( u8 ch ); | ||
38 | |||
39 | u8 getDebugChar(void) | ||
40 | { | ||
41 | return (txx9_sio_kdbg_rd()); | ||
42 | } | ||
43 | |||
44 | int putDebugChar(u8 byte) | ||
45 | { | ||
46 | return (txx9_sio_kdbg_wr(byte)); | ||
47 | } | ||
48 | |||
diff --git a/arch/mips/txx9/generic/irq_tx3927.c b/arch/mips/txx9/generic/irq_tx3927.c new file mode 100644 index 000000000000..c683f593eda2 --- /dev/null +++ b/arch/mips/txx9/generic/irq_tx3927.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Common tx3927 irq handler | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright 2001 MontaVista Software Inc. | ||
9 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
10 | */ | ||
11 | #include <linux/init.h> | ||
12 | #include <asm/txx9irq.h> | ||
13 | #include <asm/txx9/tx3927.h> | ||
14 | |||
15 | void __init tx3927_irq_init(void) | ||
16 | { | ||
17 | int i; | ||
18 | |||
19 | txx9_irq_init(TX3927_IRC_REG); | ||
20 | /* raise priority for timers, sio */ | ||
21 | for (i = 0; i < TX3927_NR_TMR; i++) | ||
22 | txx9_irq_set_pri(TX3927_IR_TMR(i), 6); | ||
23 | for (i = 0; i < TX3927_NR_SIO; i++) | ||
24 | txx9_irq_set_pri(TX3927_IR_SIO(i), 7); | ||
25 | } | ||
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c index 0b92d8c13208..7b637a7c0e66 100644 --- a/arch/mips/txx9/generic/pci.c +++ b/arch/mips/txx9/generic/pci.c | |||
@@ -386,3 +386,39 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
386 | { | 386 | { |
387 | return txx9_board_vec->pci_map_irq(dev, slot, pin); | 387 | return txx9_board_vec->pci_map_irq(dev, slot, pin); |
388 | } | 388 | } |
389 | |||
390 | char * (*txx9_board_pcibios_setup)(char *str) __devinitdata; | ||
391 | |||
392 | char *__devinit txx9_pcibios_setup(char *str) | ||
393 | { | ||
394 | if (txx9_board_pcibios_setup && !txx9_board_pcibios_setup(str)) | ||
395 | return NULL; | ||
396 | if (!strcmp(str, "picmg")) { | ||
397 | /* PICMG compliant backplane (TOSHIBA JMB-PICMG-ATX | ||
398 | (5V or 3.3V), JMB-PICMG-L2 (5V only), etc.) */ | ||
399 | txx9_pci_option |= TXX9_PCI_OPT_PICMG; | ||
400 | return NULL; | ||
401 | } else if (!strcmp(str, "nopicmg")) { | ||
402 | /* non-PICMG compliant backplane (TOSHIBA | ||
403 | RBHBK4100,RBHBK4200, Interface PCM-PCM05, etc.) */ | ||
404 | txx9_pci_option &= ~TXX9_PCI_OPT_PICMG; | ||
405 | return NULL; | ||
406 | } else if (!strncmp(str, "clk=", 4)) { | ||
407 | char *val = str + 4; | ||
408 | txx9_pci_option &= ~TXX9_PCI_OPT_CLK_MASK; | ||
409 | if (strcmp(val, "33") == 0) | ||
410 | txx9_pci_option |= TXX9_PCI_OPT_CLK_33; | ||
411 | else if (strcmp(val, "66") == 0) | ||
412 | txx9_pci_option |= TXX9_PCI_OPT_CLK_66; | ||
413 | else /* "auto" */ | ||
414 | txx9_pci_option |= TXX9_PCI_OPT_CLK_AUTO; | ||
415 | return NULL; | ||
416 | } else if (!strncmp(str, "err=", 4)) { | ||
417 | if (!strcmp(str + 4, "panic")) | ||
418 | txx9_pci_err_action = TXX9_PCI_ERR_PANIC; | ||
419 | else if (!strcmp(str + 4, "ignore")) | ||
420 | txx9_pci_err_action = TXX9_PCI_ERR_IGNORE; | ||
421 | return NULL; | ||
422 | } | ||
423 | return str; | ||
424 | } | ||
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 8c60c78b9a9e..1bc57d0f4c5c 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -20,9 +20,13 @@ | |||
20 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/serial_core.h> | ||
23 | #include <asm/bootinfo.h> | 25 | #include <asm/bootinfo.h> |
24 | #include <asm/time.h> | 26 | #include <asm/time.h> |
27 | #include <asm/reboot.h> | ||
25 | #include <asm/txx9/generic.h> | 28 | #include <asm/txx9/generic.h> |
29 | #include <asm/txx9/pci.h> | ||
26 | #ifdef CONFIG_CPU_TX49XX | 30 | #ifdef CONFIG_CPU_TX49XX |
27 | #include <asm/txx9/tx4938.h> | 31 | #include <asm/txx9/tx4938.h> |
28 | #endif | 32 | #endif |
@@ -187,6 +191,117 @@ char * __init prom_getcmdline(void) | |||
187 | return &(arcs_cmdline[0]); | 191 | return &(arcs_cmdline[0]); |
188 | } | 192 | } |
189 | 193 | ||
194 | static void __noreturn txx9_machine_halt(void) | ||
195 | { | ||
196 | local_irq_disable(); | ||
197 | clear_c0_status(ST0_IM); | ||
198 | while (1) { | ||
199 | if (cpu_wait) { | ||
200 | (*cpu_wait)(); | ||
201 | if (cpu_has_counter) { | ||
202 | /* | ||
203 | * Clear counter interrupt while it | ||
204 | * breaks WAIT instruction even if | ||
205 | * masked. | ||
206 | */ | ||
207 | write_c0_compare(0); | ||
208 | } | ||
209 | } | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /* Watchdog support */ | ||
214 | void __init txx9_wdt_init(unsigned long base) | ||
215 | { | ||
216 | struct resource res = { | ||
217 | .start = base, | ||
218 | .end = base + 0x100 - 1, | ||
219 | .flags = IORESOURCE_MEM, | ||
220 | }; | ||
221 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
222 | } | ||
223 | |||
224 | /* SPI support */ | ||
225 | void __init txx9_spi_init(int busid, unsigned long base, int irq) | ||
226 | { | ||
227 | struct resource res[] = { | ||
228 | { | ||
229 | .start = base, | ||
230 | .end = base + 0x20 - 1, | ||
231 | .flags = IORESOURCE_MEM, | ||
232 | }, { | ||
233 | .start = irq, | ||
234 | .flags = IORESOURCE_IRQ, | ||
235 | }, | ||
236 | }; | ||
237 | platform_device_register_simple("spi_txx9", busid, | ||
238 | res, ARRAY_SIZE(res)); | ||
239 | } | ||
240 | |||
241 | void __init txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr) | ||
242 | { | ||
243 | struct platform_device *pdev = | ||
244 | platform_device_alloc("tc35815-mac", id); | ||
245 | if (!pdev || | ||
246 | platform_device_add_data(pdev, ethaddr, 6) || | ||
247 | platform_device_add(pdev)) | ||
248 | platform_device_put(pdev); | ||
249 | } | ||
250 | |||
251 | void __init txx9_sio_init(unsigned long baseaddr, int irq, | ||
252 | unsigned int line, unsigned int sclk, int nocts) | ||
253 | { | ||
254 | #ifdef CONFIG_SERIAL_TXX9 | ||
255 | struct uart_port req; | ||
256 | |||
257 | memset(&req, 0, sizeof(req)); | ||
258 | req.line = line; | ||
259 | req.iotype = UPIO_MEM; | ||
260 | req.membase = ioremap(baseaddr, 0x24); | ||
261 | req.mapbase = baseaddr; | ||
262 | req.irq = irq; | ||
263 | if (!nocts) | ||
264 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; | ||
265 | if (sclk) { | ||
266 | req.flags |= UPF_MAGIC_MULTIPLIER /*USE_SCLK*/; | ||
267 | req.uartclk = sclk; | ||
268 | } else | ||
269 | req.uartclk = TXX9_IMCLK; | ||
270 | early_serial_txx9_setup(&req); | ||
271 | #endif /* CONFIG_SERIAL_TXX9 */ | ||
272 | } | ||
273 | |||
274 | #ifdef CONFIG_EARLY_PRINTK | ||
275 | static void __init null_prom_putchar(char c) | ||
276 | { | ||
277 | } | ||
278 | void (*txx9_prom_putchar)(char c) __initdata = null_prom_putchar; | ||
279 | |||
280 | void __init prom_putchar(char c) | ||
281 | { | ||
282 | txx9_prom_putchar(c); | ||
283 | } | ||
284 | |||
285 | static void __iomem *early_txx9_sio_port; | ||
286 | |||
287 | static void __init early_txx9_sio_putchar(char c) | ||
288 | { | ||
289 | #define TXX9_SICISR 0x0c | ||
290 | #define TXX9_SITFIFO 0x1c | ||
291 | #define TXX9_SICISR_TXALS 0x00000002 | ||
292 | while (!(__raw_readl(early_txx9_sio_port + TXX9_SICISR) & | ||
293 | TXX9_SICISR_TXALS)) | ||
294 | ; | ||
295 | __raw_writel(c, early_txx9_sio_port + TXX9_SITFIFO); | ||
296 | } | ||
297 | |||
298 | void __init txx9_sio_putchar_init(unsigned long baseaddr) | ||
299 | { | ||
300 | early_txx9_sio_port = ioremap(baseaddr, 0x24); | ||
301 | txx9_prom_putchar = early_txx9_sio_putchar; | ||
302 | } | ||
303 | #endif /* CONFIG_EARLY_PRINTK */ | ||
304 | |||
190 | /* wrappers */ | 305 | /* wrappers */ |
191 | void __init plat_mem_setup(void) | 306 | void __init plat_mem_setup(void) |
192 | { | 307 | { |
@@ -194,6 +309,15 @@ void __init plat_mem_setup(void) | |||
194 | ioport_resource.end = ~0UL; /* no limit */ | 309 | ioport_resource.end = ~0UL; /* no limit */ |
195 | iomem_resource.start = 0; | 310 | iomem_resource.start = 0; |
196 | iomem_resource.end = ~0UL; /* no limit */ | 311 | iomem_resource.end = ~0UL; /* no limit */ |
312 | |||
313 | /* fallback restart/halt routines */ | ||
314 | _machine_restart = (void (*)(char *))txx9_machine_halt; | ||
315 | _machine_halt = txx9_machine_halt; | ||
316 | pm_power_off = txx9_machine_halt; | ||
317 | |||
318 | #ifdef CONFIG_PCI | ||
319 | pcibios_plat_setup = txx9_pcibios_setup; | ||
320 | #endif | ||
197 | txx9_board_vec->mem_setup(); | 321 | txx9_board_vec->mem_setup(); |
198 | } | 322 | } |
199 | 323 | ||
diff --git a/arch/mips/txx9/generic/setup_tx3927.c b/arch/mips/txx9/generic/setup_tx3927.c new file mode 100644 index 000000000000..7bd963d37fc3 --- /dev/null +++ b/arch/mips/txx9/generic/setup_tx3927.c | |||
@@ -0,0 +1,130 @@ | |||
1 | /* | ||
2 | * TX3927 setup routines | ||
3 | * Based on linux/arch/mips/txx9/jmr3927/setup.c | ||
4 | * | ||
5 | * Copyright 2001 MontaVista Software Inc. | ||
6 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
7 | * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org) | ||
8 | * | ||
9 | * This file is subject to the terms and conditions of the GNU General Public | ||
10 | * License. See the file "COPYING" in the main directory of this archive | ||
11 | * for more details. | ||
12 | */ | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/ioport.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/param.h> | ||
17 | #include <linux/io.h> | ||
18 | #include <asm/mipsregs.h> | ||
19 | #include <asm/txx9irq.h> | ||
20 | #include <asm/txx9tmr.h> | ||
21 | #include <asm/txx9pio.h> | ||
22 | #include <asm/txx9/generic.h> | ||
23 | #include <asm/txx9/tx3927.h> | ||
24 | |||
25 | void __init tx3927_wdt_init(void) | ||
26 | { | ||
27 | txx9_wdt_init(TX3927_TMR_REG(2)); | ||
28 | } | ||
29 | |||
30 | void __init tx3927_setup(void) | ||
31 | { | ||
32 | int i; | ||
33 | unsigned int conf; | ||
34 | |||
35 | /* don't enable - see errata */ | ||
36 | txx9_ccfg_toeon = 0; | ||
37 | if (strstr(prom_getcmdline(), "toeon") != NULL) | ||
38 | txx9_ccfg_toeon = 1; | ||
39 | |||
40 | txx9_reg_res_init(TX3927_REV_PCODE(), TX3927_REG_BASE, | ||
41 | TX3927_REG_SIZE); | ||
42 | |||
43 | /* SDRAMC,ROMC are configured by PROM */ | ||
44 | for (i = 0; i < 8; i++) { | ||
45 | if (!(tx3927_romcptr->cr[i] & 0x8)) | ||
46 | continue; /* disabled */ | ||
47 | txx9_ce_res[i].start = (unsigned long)TX3927_ROMC_BA(i); | ||
48 | txx9_ce_res[i].end = | ||
49 | txx9_ce_res[i].start + TX3927_ROMC_SIZE(i) - 1; | ||
50 | request_resource(&iomem_resource, &txx9_ce_res[i]); | ||
51 | } | ||
52 | |||
53 | /* clocks */ | ||
54 | txx9_gbus_clock = txx9_cpu_clock / 2; | ||
55 | /* change default value to udelay/mdelay take reasonable time */ | ||
56 | loops_per_jiffy = txx9_cpu_clock / HZ / 2; | ||
57 | |||
58 | /* CCFG */ | ||
59 | /* enable Timeout BusError */ | ||
60 | if (txx9_ccfg_toeon) | ||
61 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_TOE; | ||
62 | |||
63 | /* clear BusErrorOnWrite flag */ | ||
64 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW; | ||
65 | if (read_c0_conf() & TX39_CONF_WBON) | ||
66 | /* Disable PCI snoop */ | ||
67 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP; | ||
68 | else | ||
69 | /* Enable PCI SNOOP - with write through only */ | ||
70 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_PSNP; | ||
71 | /* do reset on watchdog */ | ||
72 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR; | ||
73 | |||
74 | printk(KERN_INFO "TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n", | ||
75 | tx3927_ccfgptr->crir, | ||
76 | tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg); | ||
77 | |||
78 | /* TMR */ | ||
79 | for (i = 0; i < TX3927_NR_TMR; i++) | ||
80 | txx9_tmr_init(TX3927_TMR_REG(i)); | ||
81 | |||
82 | /* DMA */ | ||
83 | tx3927_dmaptr->mcr = 0; | ||
84 | for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) { | ||
85 | /* reset channel */ | ||
86 | tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST; | ||
87 | tx3927_dmaptr->ch[i].ccr = 0; | ||
88 | } | ||
89 | /* enable DMA */ | ||
90 | #ifdef __BIG_ENDIAN | ||
91 | tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN; | ||
92 | #else | ||
93 | tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN | TX3927_DMA_MCR_LE; | ||
94 | #endif | ||
95 | |||
96 | /* PIO */ | ||
97 | __raw_writel(0, &tx3927_pioptr->maskcpu); | ||
98 | __raw_writel(0, &tx3927_pioptr->maskext); | ||
99 | txx9_gpio_init(TX3927_PIO_REG, 0, 16); | ||
100 | |||
101 | conf = read_c0_conf(); | ||
102 | if (!(conf & TX39_CONF_ICE)) | ||
103 | printk(KERN_INFO "TX3927 I-Cache disabled.\n"); | ||
104 | if (!(conf & TX39_CONF_DCE)) | ||
105 | printk(KERN_INFO "TX3927 D-Cache disabled.\n"); | ||
106 | else if (!(conf & TX39_CONF_WBON)) | ||
107 | printk(KERN_INFO "TX3927 D-Cache WriteThrough.\n"); | ||
108 | else if (!(conf & TX39_CONF_CWFON)) | ||
109 | printk(KERN_INFO "TX3927 D-Cache WriteBack.\n"); | ||
110 | else | ||
111 | printk(KERN_INFO "TX3927 D-Cache WriteBack (CWF) .\n"); | ||
112 | } | ||
113 | |||
114 | void __init tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr) | ||
115 | { | ||
116 | txx9_clockevent_init(TX3927_TMR_REG(evt_tmrnr), | ||
117 | TXX9_IRQ_BASE + TX3927_IR_TMR(evt_tmrnr), | ||
118 | TXX9_IMCLK); | ||
119 | txx9_clocksource_init(TX3927_TMR_REG(src_tmrnr), TXX9_IMCLK); | ||
120 | } | ||
121 | |||
122 | void __init tx3927_sio_init(unsigned int sclk, unsigned int cts_mask) | ||
123 | { | ||
124 | int i; | ||
125 | |||
126 | for (i = 0; i < 2; i++) | ||
127 | txx9_sio_init(TX3927_SIO_REG(i), | ||
128 | TXX9_IRQ_BASE + TX3927_IR_SIO(i), | ||
129 | i, sclk, (1 << i) & cts_mask); | ||
130 | } | ||
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c index 89d6e28add93..f80d4b7a694d 100644 --- a/arch/mips/txx9/generic/setup_tx4927.c +++ b/arch/mips/txx9/generic/setup_tx4927.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/ioport.h> | 14 | #include <linux/ioport.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/serial_core.h> | ||
17 | #include <linux/param.h> | 16 | #include <linux/param.h> |
18 | #include <asm/txx9irq.h> | 17 | #include <asm/txx9irq.h> |
19 | #include <asm/txx9tmr.h> | 18 | #include <asm/txx9tmr.h> |
@@ -21,7 +20,7 @@ | |||
21 | #include <asm/txx9/generic.h> | 20 | #include <asm/txx9/generic.h> |
22 | #include <asm/txx9/tx4927.h> | 21 | #include <asm/txx9/tx4927.h> |
23 | 22 | ||
24 | void __init tx4927_wdr_init(void) | 23 | static void __init tx4927_wdr_init(void) |
25 | { | 24 | { |
26 | /* clear WatchDogReset (W1C) */ | 25 | /* clear WatchDogReset (W1C) */ |
27 | tx4927_ccfg_set(TX4927_CCFG_WDRST); | 26 | tx4927_ccfg_set(TX4927_CCFG_WDRST); |
@@ -29,6 +28,11 @@ void __init tx4927_wdr_init(void) | |||
29 | tx4927_ccfg_set(TX4927_CCFG_WR); | 28 | tx4927_ccfg_set(TX4927_CCFG_WR); |
30 | } | 29 | } |
31 | 30 | ||
31 | void __init tx4927_wdt_init(void) | ||
32 | { | ||
33 | txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); | ||
34 | } | ||
35 | |||
32 | static struct resource tx4927_sdram_resource[4]; | 36 | static struct resource tx4927_sdram_resource[4]; |
33 | 37 | ||
34 | void __init tx4927_setup(void) | 38 | void __init tx4927_setup(void) |
@@ -173,22 +177,12 @@ void __init tx4927_time_init(unsigned int tmrnr) | |||
173 | TXX9_IMCLK); | 177 | TXX9_IMCLK); |
174 | } | 178 | } |
175 | 179 | ||
176 | void __init tx4927_setup_serial(void) | 180 | void __init tx4927_sio_init(unsigned int sclk, unsigned int cts_mask) |
177 | { | 181 | { |
178 | #ifdef CONFIG_SERIAL_TXX9 | ||
179 | int i; | 182 | int i; |
180 | struct uart_port req; | 183 | |
181 | 184 | for (i = 0; i < 2; i++) | |
182 | for (i = 0; i < 2; i++) { | 185 | txx9_sio_init(TX4927_SIO_REG(i) & 0xfffffffffULL, |
183 | memset(&req, 0, sizeof(req)); | 186 | TXX9_IRQ_BASE + TX4927_IR_SIO(i), |
184 | req.line = i; | 187 | i, sclk, (1 << i) & cts_mask); |
185 | req.iotype = UPIO_MEM; | ||
186 | req.membase = (unsigned char __iomem *)TX4927_SIO_REG(i); | ||
187 | req.mapbase = TX4927_SIO_REG(i) & 0xfffffffffULL; | ||
188 | req.irq = TXX9_IRQ_BASE + TX4927_IR_SIO(i); | ||
189 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; | ||
190 | req.uartclk = TXX9_IMCLK; | ||
191 | early_serial_txx9_setup(&req); | ||
192 | } | ||
193 | #endif /* CONFIG_SERIAL_TXX9 */ | ||
194 | } | 188 | } |
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 317378d8579d..f3040b9ba059 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/ioport.h> | 14 | #include <linux/ioport.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/serial_core.h> | ||
17 | #include <linux/param.h> | 16 | #include <linux/param.h> |
18 | #include <asm/txx9irq.h> | 17 | #include <asm/txx9irq.h> |
19 | #include <asm/txx9tmr.h> | 18 | #include <asm/txx9tmr.h> |
@@ -21,7 +20,7 @@ | |||
21 | #include <asm/txx9/generic.h> | 20 | #include <asm/txx9/generic.h> |
22 | #include <asm/txx9/tx4938.h> | 21 | #include <asm/txx9/tx4938.h> |
23 | 22 | ||
24 | void __init tx4938_wdr_init(void) | 23 | static void __init tx4938_wdr_init(void) |
25 | { | 24 | { |
26 | /* clear WatchDogReset (W1C) */ | 25 | /* clear WatchDogReset (W1C) */ |
27 | tx4938_ccfg_set(TX4938_CCFG_WDRST); | 26 | tx4938_ccfg_set(TX4938_CCFG_WDRST); |
@@ -29,6 +28,11 @@ void __init tx4938_wdr_init(void) | |||
29 | tx4938_ccfg_set(TX4938_CCFG_WR); | 28 | tx4938_ccfg_set(TX4938_CCFG_WR); |
30 | } | 29 | } |
31 | 30 | ||
31 | void __init tx4938_wdt_init(void) | ||
32 | { | ||
33 | txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL); | ||
34 | } | ||
35 | |||
32 | static struct resource tx4938_sdram_resource[4]; | 36 | static struct resource tx4938_sdram_resource[4]; |
33 | static struct resource tx4938_sram_resource; | 37 | static struct resource tx4938_sram_resource; |
34 | 38 | ||
@@ -233,11 +237,9 @@ void __init tx4938_time_init(unsigned int tmrnr) | |||
233 | TXX9_IMCLK); | 237 | TXX9_IMCLK); |
234 | } | 238 | } |
235 | 239 | ||
236 | void __init tx4938_setup_serial(void) | 240 | void __init tx4938_sio_init(unsigned int sclk, unsigned int cts_mask) |
237 | { | 241 | { |
238 | #ifdef CONFIG_SERIAL_TXX9 | ||
239 | int i; | 242 | int i; |
240 | struct uart_port req; | ||
241 | unsigned int ch_mask = 0; | 243 | unsigned int ch_mask = 0; |
242 | 244 | ||
243 | if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL) | 245 | if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL) |
@@ -245,15 +247,24 @@ void __init tx4938_setup_serial(void) | |||
245 | for (i = 0; i < 2; i++) { | 247 | for (i = 0; i < 2; i++) { |
246 | if ((1 << i) & ch_mask) | 248 | if ((1 << i) & ch_mask) |
247 | continue; | 249 | continue; |
248 | memset(&req, 0, sizeof(req)); | 250 | txx9_sio_init(TX4938_SIO_REG(i) & 0xfffffffffULL, |
249 | req.line = i; | 251 | TXX9_IRQ_BASE + TX4938_IR_SIO(i), |
250 | req.iotype = UPIO_MEM; | 252 | i, sclk, (1 << i) & cts_mask); |
251 | req.membase = (unsigned char __iomem *)TX4938_SIO_REG(i); | ||
252 | req.mapbase = TX4938_SIO_REG(i) & 0xfffffffffULL; | ||
253 | req.irq = TXX9_IRQ_BASE + TX4938_IR_SIO(i); | ||
254 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; | ||
255 | req.uartclk = TXX9_IMCLK; | ||
256 | early_serial_txx9_setup(&req); | ||
257 | } | 253 | } |
258 | #endif /* CONFIG_SERIAL_TXX9 */ | 254 | } |
255 | |||
256 | void __init tx4938_spi_init(int busid) | ||
257 | { | ||
258 | txx9_spi_init(busid, TX4938_SPI_REG & 0xfffffffffULL, | ||
259 | TXX9_IRQ_BASE + TX4938_IR_SPI); | ||
260 | } | ||
261 | |||
262 | void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1) | ||
263 | { | ||
264 | u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg); | ||
265 | |||
266 | if (addr0 && (pcfg & TX4938_PCFG_ETH0_SEL)) | ||
267 | txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH0, addr0); | ||
268 | if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL)) | ||
269 | txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1); | ||
259 | } | 270 | } |
diff --git a/arch/mips/txx9/generic/smsc_fdc37m81x.c b/arch/mips/txx9/generic/smsc_fdc37m81x.c index 69e487467fa5..a2b2d62d88e3 100644 --- a/arch/mips/txx9/generic/smsc_fdc37m81x.c +++ b/arch/mips/txx9/generic/smsc_fdc37m81x.c | |||
@@ -15,8 +15,6 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/txx9/smsc_fdc37m81x.h> | 16 | #include <asm/txx9/smsc_fdc37m81x.h> |
17 | 17 | ||
18 | #define DEBUG | ||
19 | |||
20 | /* Common Registers */ | 18 | /* Common Registers */ |
21 | #define SMSC_FDC37M81X_CONFIG_INDEX 0x00 | 19 | #define SMSC_FDC37M81X_CONFIG_INDEX 0x00 |
22 | #define SMSC_FDC37M81X_CONFIG_DATA 0x01 | 20 | #define SMSC_FDC37M81X_CONFIG_DATA 0x01 |
@@ -55,7 +53,7 @@ | |||
55 | #define SMSC_FDC37M81X_CONFIG_EXIT 0xaa | 53 | #define SMSC_FDC37M81X_CONFIG_EXIT 0xaa |
56 | #define SMSC_FDC37M81X_CHIP_ID 0x4d | 54 | #define SMSC_FDC37M81X_CHIP_ID 0x4d |
57 | 55 | ||
58 | static unsigned long g_smsc_fdc37m81x_base = 0; | 56 | static unsigned long g_smsc_fdc37m81x_base; |
59 | 57 | ||
60 | static inline unsigned char smsc_fdc37m81x_rd(unsigned char index) | 58 | static inline unsigned char smsc_fdc37m81x_rd(unsigned char index) |
61 | { | 59 | { |
@@ -107,7 +105,8 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port) | |||
107 | u8 chip_id; | 105 | u8 chip_id; |
108 | 106 | ||
109 | if (g_smsc_fdc37m81x_base) | 107 | if (g_smsc_fdc37m81x_base) |
110 | printk("smsc_fdc37m81x_init() stepping on old base=0x%0*lx\n", | 108 | printk(KERN_WARNING "%s: stepping on old base=0x%0*lx\n", |
109 | __func__, | ||
111 | field, g_smsc_fdc37m81x_base); | 110 | field, g_smsc_fdc37m81x_base); |
112 | 111 | ||
113 | g_smsc_fdc37m81x_base = port; | 112 | g_smsc_fdc37m81x_base = port; |
@@ -118,7 +117,7 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port) | |||
118 | if (chip_id == SMSC_FDC37M81X_CHIP_ID) | 117 | if (chip_id == SMSC_FDC37M81X_CHIP_ID) |
119 | smsc_fdc37m81x_config_end(); | 118 | smsc_fdc37m81x_config_end(); |
120 | else { | 119 | else { |
121 | printk("smsc_fdc37m81x_init() unknow chip id 0x%02x\n", | 120 | printk(KERN_WARNING "%s: unknow chip id 0x%02x\n", __func__, |
122 | chip_id); | 121 | chip_id); |
123 | g_smsc_fdc37m81x_base = 0; | 122 | g_smsc_fdc37m81x_base = 0; |
124 | } | 123 | } |
@@ -127,22 +126,23 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port) | |||
127 | } | 126 | } |
128 | 127 | ||
129 | #ifdef DEBUG | 128 | #ifdef DEBUG |
130 | void smsc_fdc37m81x_config_dump_one(char *key, u8 dev, u8 reg) | 129 | static void smsc_fdc37m81x_config_dump_one(const char *key, u8 dev, u8 reg) |
131 | { | 130 | { |
132 | printk("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg, | 131 | printk(KERN_INFO "%s: dev=0x%02x reg=0x%02x val=0x%02x\n", |
132 | key, dev, reg, | ||
133 | smsc_fdc37m81x_rd(reg)); | 133 | smsc_fdc37m81x_rd(reg)); |
134 | } | 134 | } |
135 | 135 | ||
136 | void smsc_fdc37m81x_config_dump(void) | 136 | void smsc_fdc37m81x_config_dump(void) |
137 | { | 137 | { |
138 | u8 orig; | 138 | u8 orig; |
139 | char *fname = "smsc_fdc37m81x_config_dump()"; | 139 | const char *fname = __func__; |
140 | 140 | ||
141 | smsc_fdc37m81x_config_beg(); | 141 | smsc_fdc37m81x_config_beg(); |
142 | 142 | ||
143 | orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM); | 143 | orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM); |
144 | 144 | ||
145 | printk("%s: common\n", fname); | 145 | printk(KERN_INFO "%s: common\n", fname); |
146 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, | 146 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, |
147 | SMSC_FDC37M81X_DNUM); | 147 | SMSC_FDC37M81X_DNUM); |
148 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, | 148 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, |
@@ -154,7 +154,7 @@ void smsc_fdc37m81x_config_dump(void) | |||
154 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, | 154 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, |
155 | SMSC_FDC37M81X_PMGT); | 155 | SMSC_FDC37M81X_PMGT); |
156 | 156 | ||
157 | printk("%s: keyboard\n", fname); | 157 | printk(KERN_INFO "%s: keyboard\n", fname); |
158 | smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD); | 158 | smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD); |
159 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD, | 159 | smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD, |
160 | SMSC_FDC37M81X_ACTIVE); | 160 | SMSC_FDC37M81X_ACTIVE); |
diff --git a/arch/mips/txx9/jmr3927/Makefile b/arch/mips/txx9/jmr3927/Makefile index ba292c945669..20d61ac543e5 100644 --- a/arch/mips/txx9/jmr3927/Makefile +++ b/arch/mips/txx9/jmr3927/Makefile | |||
@@ -3,6 +3,5 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y += prom.o irq.o setup.o | 5 | obj-y += prom.o irq.o setup.o |
6 | obj-$(CONFIG_KGDB) += kgdb_io.o | ||
7 | 6 | ||
8 | EXTRA_CFLAGS += -Werror | 7 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/txx9/jmr3927/irq.c b/arch/mips/txx9/jmr3927/irq.c index 070c9a115e57..6ec626c9473f 100644 --- a/arch/mips/txx9/jmr3927/irq.c +++ b/arch/mips/txx9/jmr3927/irq.c | |||
@@ -30,15 +30,11 @@ | |||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 30 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
31 | */ | 31 | */ |
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/sched.h> | ||
34 | #include <linux/types.h> | 33 | #include <linux/types.h> |
35 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
36 | 35 | ||
37 | #include <asm/io.h> | 36 | #include <asm/io.h> |
38 | #include <asm/mipsregs.h> | 37 | #include <asm/mipsregs.h> |
39 | #include <asm/system.h> | ||
40 | |||
41 | #include <asm/processor.h> | ||
42 | #include <asm/txx9/generic.h> | 38 | #include <asm/txx9/generic.h> |
43 | #include <asm/txx9/jmr3927.h> | 39 | #include <asm/txx9/jmr3927.h> |
44 | 40 | ||
@@ -46,13 +42,6 @@ | |||
46 | #error JMR3927_IRQ_END > NR_IRQS | 42 | #error JMR3927_IRQ_END > NR_IRQS |
47 | #endif | 43 | #endif |
48 | 44 | ||
49 | static unsigned char irc_level[TX3927_NUM_IR] = { | ||
50 | 5, 5, 5, 5, 5, 5, /* INT[5:0] */ | ||
51 | 7, 7, /* SIO */ | ||
52 | 5, 5, 5, 0, 0, /* DMA, PIO, PCI */ | ||
53 | 6, 6, 6 /* TMR */ | ||
54 | }; | ||
55 | |||
56 | /* | 45 | /* |
57 | * CP0_STATUS is a thread's resource (saved/restored on context switch). | 46 | * CP0_STATUS is a thread's resource (saved/restored on context switch). |
58 | * So disable_irq/enable_irq MUST handle IOC/IRC registers. | 47 | * So disable_irq/enable_irq MUST handle IOC/IRC registers. |
@@ -103,26 +92,18 @@ static int jmr3927_irq_dispatch(int pending) | |||
103 | return irq; | 92 | return irq; |
104 | } | 93 | } |
105 | 94 | ||
106 | #ifdef CONFIG_PCI | 95 | static struct irq_chip jmr3927_irq_ioc = { |
107 | static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id) | 96 | .name = "jmr3927_ioc", |
108 | { | 97 | .ack = mask_irq_ioc, |
109 | printk(KERN_WARNING "PCI error interrupt (irq 0x%x).\n", irq); | 98 | .mask = mask_irq_ioc, |
110 | printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", | 99 | .mask_ack = mask_irq_ioc, |
111 | tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat); | 100 | .unmask = unmask_irq_ioc, |
112 | |||
113 | return IRQ_HANDLED; | ||
114 | } | ||
115 | static struct irqaction pcierr_action = { | ||
116 | .handler = jmr3927_pcierr_interrupt, | ||
117 | .mask = CPU_MASK_NONE, | ||
118 | .name = "PCI error", | ||
119 | }; | 101 | }; |
120 | #endif | ||
121 | |||
122 | static void __init jmr3927_irq_init(void); | ||
123 | 102 | ||
124 | void __init jmr3927_irq_setup(void) | 103 | void __init jmr3927_irq_setup(void) |
125 | { | 104 | { |
105 | int i; | ||
106 | |||
126 | txx9_irq_dispatch = jmr3927_irq_dispatch; | 107 | txx9_irq_dispatch = jmr3927_irq_dispatch; |
127 | /* Now, interrupt control disabled, */ | 108 | /* Now, interrupt control disabled, */ |
128 | /* all IRC interrupts are masked, */ | 109 | /* all IRC interrupts are masked, */ |
@@ -138,34 +119,10 @@ void __init jmr3927_irq_setup(void) | |||
138 | /* clear PCI Reset interrupts */ | 119 | /* clear PCI Reset interrupts */ |
139 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); | 120 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); |
140 | 121 | ||
141 | jmr3927_irq_init(); | 122 | tx3927_irq_init(); |
123 | for (i = JMR3927_IRQ_IOC; i < JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC; i++) | ||
124 | set_irq_chip_and_handler(i, &jmr3927_irq_ioc, handle_level_irq); | ||
142 | 125 | ||
143 | /* setup IOC interrupt 1 (PCI, MODEM) */ | 126 | /* setup IOC interrupt 1 (PCI, MODEM) */ |
144 | set_irq_chained_handler(JMR3927_IRQ_IOCINT, handle_simple_irq); | 127 | set_irq_chained_handler(JMR3927_IRQ_IOCINT, handle_simple_irq); |
145 | |||
146 | #ifdef CONFIG_PCI | ||
147 | setup_irq(JMR3927_IRQ_IRC_PCI, &pcierr_action); | ||
148 | #endif | ||
149 | |||
150 | /* enable all CPU interrupt bits. */ | ||
151 | set_c0_status(ST0_IM); /* IE bit is still 0. */ | ||
152 | } | ||
153 | |||
154 | static struct irq_chip jmr3927_irq_ioc = { | ||
155 | .name = "jmr3927_ioc", | ||
156 | .ack = mask_irq_ioc, | ||
157 | .mask = mask_irq_ioc, | ||
158 | .mask_ack = mask_irq_ioc, | ||
159 | .unmask = unmask_irq_ioc, | ||
160 | }; | ||
161 | |||
162 | static void __init jmr3927_irq_init(void) | ||
163 | { | ||
164 | u32 i; | ||
165 | |||
166 | txx9_irq_init(TX3927_IRC_REG); | ||
167 | for (i = 0; i < TXx9_MAX_IR; i++) | ||
168 | txx9_irq_set_pri(i, irc_level[i]); | ||
169 | for (i = JMR3927_IRQ_IOC; i < JMR3927_IRQ_IOC + JMR3927_NR_IRQ_IOC; i++) | ||
170 | set_irq_chip_and_handler(i, &jmr3927_irq_ioc, handle_level_irq); | ||
171 | } | 128 | } |
diff --git a/arch/mips/txx9/jmr3927/kgdb_io.c b/arch/mips/txx9/jmr3927/kgdb_io.c deleted file mode 100644 index 5bd757e56f79..000000000000 --- a/arch/mips/txx9/jmr3927/kgdb_io.c +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | /* | ||
2 | * BRIEF MODULE DESCRIPTION | ||
3 | * Low level uart routines to directly access a TX[34]927 SIO. | ||
4 | * | ||
5 | * Copyright 2001 MontaVista Software Inc. | ||
6 | * Author: MontaVista Software, Inc. | ||
7 | * ahennessy@mvista.com or source@mvista.com | ||
8 | * | ||
9 | * Based on arch/mips/ddb5xxx/ddb5477/kgdb_io.c | ||
10 | * | ||
11 | * Copyright (C) 2000-2001 Toshiba Corporation | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify it | ||
14 | * under the terms of the GNU General Public License as published by the | ||
15 | * Free Software Foundation; either version 2 of the License, or (at your | ||
16 | * option) any later version. | ||
17 | * | ||
18 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
21 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
24 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
25 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
28 | * | ||
29 | * You should have received a copy of the GNU General Public License along | ||
30 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
31 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
32 | */ | ||
33 | |||
34 | #include <asm/txx9/jmr3927.h> | ||
35 | |||
36 | #define TIMEOUT 0xffffff | ||
37 | |||
38 | static int remoteDebugInitialized = 0; | ||
39 | static void debugInit(int baud); | ||
40 | |||
41 | int putDebugChar(unsigned char c) | ||
42 | { | ||
43 | int i = 0; | ||
44 | |||
45 | if (!remoteDebugInitialized) { | ||
46 | remoteDebugInitialized = 1; | ||
47 | debugInit(38400); | ||
48 | } | ||
49 | |||
50 | do { | ||
51 | slow_down(); | ||
52 | i++; | ||
53 | if (i>TIMEOUT) { | ||
54 | break; | ||
55 | } | ||
56 | } while (!(tx3927_sioptr(0)->cisr & TXx927_SICISR_TXALS)); | ||
57 | tx3927_sioptr(0)->tfifo = c; | ||
58 | |||
59 | return 1; | ||
60 | } | ||
61 | |||
62 | unsigned char getDebugChar(void) | ||
63 | { | ||
64 | int i = 0; | ||
65 | int dicr; | ||
66 | char c; | ||
67 | |||
68 | if (!remoteDebugInitialized) { | ||
69 | remoteDebugInitialized = 1; | ||
70 | debugInit(38400); | ||
71 | } | ||
72 | |||
73 | /* diable RX int. */ | ||
74 | dicr = tx3927_sioptr(0)->dicr; | ||
75 | tx3927_sioptr(0)->dicr = 0; | ||
76 | |||
77 | do { | ||
78 | slow_down(); | ||
79 | i++; | ||
80 | if (i>TIMEOUT) { | ||
81 | break; | ||
82 | } | ||
83 | } while (tx3927_sioptr(0)->disr & TXx927_SIDISR_UVALID) | ||
84 | ; | ||
85 | c = tx3927_sioptr(0)->rfifo; | ||
86 | |||
87 | /* clear RX int. status */ | ||
88 | tx3927_sioptr(0)->disr &= ~TXx927_SIDISR_RDIS; | ||
89 | /* enable RX int. */ | ||
90 | tx3927_sioptr(0)->dicr = dicr; | ||
91 | |||
92 | return c; | ||
93 | } | ||
94 | |||
95 | static void debugInit(int baud) | ||
96 | { | ||
97 | tx3927_sioptr(0)->lcr = 0x020; | ||
98 | tx3927_sioptr(0)->dicr = 0; | ||
99 | tx3927_sioptr(0)->disr = 0x4100; | ||
100 | tx3927_sioptr(0)->cisr = 0x014; | ||
101 | tx3927_sioptr(0)->fcr = 0; | ||
102 | tx3927_sioptr(0)->flcr = 0x02; | ||
103 | tx3927_sioptr(0)->bgr = ((JMR3927_BASE_BAUD + baud / 2) / baud) | | ||
104 | TXx927_SIBGR_BCLK_T0; | ||
105 | } | ||
diff --git a/arch/mips/txx9/jmr3927/prom.c b/arch/mips/txx9/jmr3927/prom.c index 2cadb423face..70c4c8ec3e84 100644 --- a/arch/mips/txx9/jmr3927/prom.c +++ b/arch/mips/txx9/jmr3927/prom.c | |||
@@ -36,41 +36,18 @@ | |||
36 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 36 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
37 | */ | 37 | */ |
38 | #include <linux/init.h> | 38 | #include <linux/init.h> |
39 | #include <linux/kernel.h> | ||
39 | #include <asm/bootinfo.h> | 40 | #include <asm/bootinfo.h> |
40 | #include <asm/txx9/generic.h> | 41 | #include <asm/txx9/generic.h> |
41 | #include <asm/txx9/jmr3927.h> | 42 | #include <asm/txx9/jmr3927.h> |
42 | 43 | ||
43 | #define TIMEOUT 0xffffff | ||
44 | |||
45 | void | ||
46 | prom_putchar(char c) | ||
47 | { | ||
48 | int i = 0; | ||
49 | |||
50 | do { | ||
51 | i++; | ||
52 | if (i>TIMEOUT) | ||
53 | break; | ||
54 | } while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS)); | ||
55 | tx3927_sioptr(1)->tfifo = c; | ||
56 | return; | ||
57 | } | ||
58 | |||
59 | void | ||
60 | puts(const char *cp) | ||
61 | { | ||
62 | while (*cp) | ||
63 | prom_putchar(*cp++); | ||
64 | prom_putchar('\r'); | ||
65 | prom_putchar('\n'); | ||
66 | } | ||
67 | |||
68 | void __init jmr3927_prom_init(void) | 44 | void __init jmr3927_prom_init(void) |
69 | { | 45 | { |
70 | /* CCFG */ | 46 | /* CCFG */ |
71 | if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) | 47 | if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) |
72 | puts("Warning: TX3927 TLB off\n"); | 48 | printk(KERN_ERR "TX3927 TLB off\n"); |
73 | 49 | ||
74 | prom_init_cmdline(); | 50 | prom_init_cmdline(); |
75 | add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); | 51 | add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); |
52 | txx9_sio_putchar_init(TX3927_SIO_REG(1)); | ||
76 | } | 53 | } |
diff --git a/arch/mips/txx9/jmr3927/setup.c b/arch/mips/txx9/jmr3927/setup.c index 03647ebe4130..87db41be8a56 100644 --- a/arch/mips/txx9/jmr3927/setup.c +++ b/arch/mips/txx9/jmr3927/setup.c | |||
@@ -32,27 +32,18 @@ | |||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <linux/ioport.h> | 33 | #include <linux/ioport.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/pm.h> | ||
36 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
37 | #include <linux/gpio.h> | 36 | #include <linux/gpio.h> |
38 | #ifdef CONFIG_SERIAL_TXX9 | ||
39 | #include <linux/serial_core.h> | ||
40 | #endif | ||
41 | #include <asm/txx9tmr.h> | ||
42 | #include <asm/txx9pio.h> | ||
43 | #include <asm/reboot.h> | 37 | #include <asm/reboot.h> |
38 | #include <asm/txx9pio.h> | ||
44 | #include <asm/txx9/generic.h> | 39 | #include <asm/txx9/generic.h> |
45 | #include <asm/txx9/pci.h> | 40 | #include <asm/txx9/pci.h> |
46 | #include <asm/txx9/jmr3927.h> | 41 | #include <asm/txx9/jmr3927.h> |
47 | #include <asm/mipsregs.h> | 42 | #include <asm/mipsregs.h> |
48 | 43 | ||
49 | extern void puts(const char *cp); | 44 | static void jmr3927_machine_restart(char *command) |
50 | |||
51 | /* don't enable - see errata */ | ||
52 | static int jmr3927_ccfg_toeon; | ||
53 | |||
54 | static inline void do_reset(void) | ||
55 | { | 45 | { |
46 | local_irq_disable(); | ||
56 | #if 1 /* Resetting PCI bus */ | 47 | #if 1 /* Resetting PCI bus */ |
57 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); | 48 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); |
58 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_PCI, JMR3927_IOC_RESET_ADDR); | 49 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_PCI, JMR3927_IOC_RESET_ADDR); |
@@ -61,33 +52,13 @@ static inline void do_reset(void) | |||
61 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); | 52 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); |
62 | #endif | 53 | #endif |
63 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_CPU, JMR3927_IOC_RESET_ADDR); | 54 | jmr3927_ioc_reg_out(JMR3927_IOC_RESET_CPU, JMR3927_IOC_RESET_ADDR); |
64 | } | 55 | /* fallback */ |
65 | 56 | (*_machine_halt)(); | |
66 | static void jmr3927_machine_restart(char *command) | ||
67 | { | ||
68 | local_irq_disable(); | ||
69 | puts("Rebooting..."); | ||
70 | do_reset(); | ||
71 | } | ||
72 | |||
73 | static void jmr3927_machine_halt(void) | ||
74 | { | ||
75 | puts("JMR-TX3927 halted.\n"); | ||
76 | while (1); | ||
77 | } | ||
78 | |||
79 | static void jmr3927_machine_power_off(void) | ||
80 | { | ||
81 | puts("JMR-TX3927 halted. Please turn off the power.\n"); | ||
82 | while (1); | ||
83 | } | 57 | } |
84 | 58 | ||
85 | static void __init jmr3927_time_init(void) | 59 | static void __init jmr3927_time_init(void) |
86 | { | 60 | { |
87 | txx9_clockevent_init(TX3927_TMR_REG(0), | 61 | tx3927_time_init(0, 1); |
88 | TXX9_IRQ_BASE + JMR3927_IRQ_IRC_TMR(0), | ||
89 | JMR3927_IMCLK); | ||
90 | txx9_clocksource_init(TX3927_TMR_REG(1), JMR3927_IMCLK); | ||
91 | } | 62 | } |
92 | 63 | ||
93 | #define DO_WRITE_THROUGH | 64 | #define DO_WRITE_THROUGH |
@@ -102,11 +73,6 @@ static void __init jmr3927_mem_setup(void) | |||
102 | set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); | 73 | set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); |
103 | 74 | ||
104 | _machine_restart = jmr3927_machine_restart; | 75 | _machine_restart = jmr3927_machine_restart; |
105 | _machine_halt = jmr3927_machine_halt; | ||
106 | pm_power_off = jmr3927_machine_power_off; | ||
107 | |||
108 | /* Reboot on panic */ | ||
109 | panic_timeout = 180; | ||
110 | 76 | ||
111 | /* cache setup */ | 77 | /* cache setup */ |
112 | { | 78 | { |
@@ -125,7 +91,8 @@ static void __init jmr3927_mem_setup(void) | |||
125 | #endif | 91 | #endif |
126 | 92 | ||
127 | conf = read_c0_conf(); | 93 | conf = read_c0_conf(); |
128 | conf &= ~(TX39_CONF_ICE | TX39_CONF_DCE | TX39_CONF_WBON | TX39_CONF_CWFON); | 94 | conf &= ~(TX39_CONF_ICE | TX39_CONF_DCE | |
95 | TX39_CONF_WBON | TX39_CONF_CWFON); | ||
129 | conf |= mips_ic_disable ? 0 : TX39_CONF_ICE; | 96 | conf |= mips_ic_disable ? 0 : TX39_CONF_ICE; |
130 | conf |= mips_dc_disable ? 0 : TX39_CONF_DCE; | 97 | conf |= mips_dc_disable ? 0 : TX39_CONF_DCE; |
131 | conf |= mips_config_wbon ? TX39_CONF_WBON : 0; | 98 | conf |= mips_config_wbon ? TX39_CONF_WBON : 0; |
@@ -138,47 +105,14 @@ static void __init jmr3927_mem_setup(void) | |||
138 | /* initialize board */ | 105 | /* initialize board */ |
139 | jmr3927_board_init(); | 106 | jmr3927_board_init(); |
140 | 107 | ||
141 | argptr = prom_getcmdline(); | 108 | tx3927_sio_init(0, 1 << 1); /* ch1: noCTS */ |
142 | |||
143 | if ((argptr = strstr(argptr, "toeon")) != NULL) | ||
144 | jmr3927_ccfg_toeon = 1; | ||
145 | argptr = prom_getcmdline(); | ||
146 | if ((argptr = strstr(argptr, "ip=")) == NULL) { | ||
147 | argptr = prom_getcmdline(); | ||
148 | strcat(argptr, " ip=bootp"); | ||
149 | } | ||
150 | |||
151 | #ifdef CONFIG_SERIAL_TXX9 | ||
152 | { | ||
153 | extern int early_serial_txx9_setup(struct uart_port *port); | ||
154 | int i; | ||
155 | struct uart_port req; | ||
156 | for(i = 0; i < 2; i++) { | ||
157 | memset(&req, 0, sizeof(req)); | ||
158 | req.line = i; | ||
159 | req.iotype = UPIO_MEM; | ||
160 | req.membase = (unsigned char __iomem *)TX3927_SIO_REG(i); | ||
161 | req.mapbase = TX3927_SIO_REG(i); | ||
162 | req.irq = i == 0 ? | ||
163 | JMR3927_IRQ_IRC_SIO0 : JMR3927_IRQ_IRC_SIO1; | ||
164 | if (i == 0) | ||
165 | req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/; | ||
166 | req.uartclk = JMR3927_IMCLK; | ||
167 | early_serial_txx9_setup(&req); | ||
168 | } | ||
169 | } | ||
170 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE | 109 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE |
171 | argptr = prom_getcmdline(); | 110 | argptr = prom_getcmdline(); |
172 | if ((argptr = strstr(argptr, "console=")) == NULL) { | 111 | if (!strstr(argptr, "console=")) |
173 | argptr = prom_getcmdline(); | ||
174 | strcat(argptr, " console=ttyS1,115200"); | 112 | strcat(argptr, " console=ttyS1,115200"); |
175 | } | ||
176 | #endif | ||
177 | #endif | 113 | #endif |
178 | } | 114 | } |
179 | 115 | ||
180 | static void tx3927_setup(void); | ||
181 | |||
182 | static void __init jmr3927_pci_setup(void) | 116 | static void __init jmr3927_pci_setup(void) |
183 | { | 117 | { |
184 | #ifdef CONFIG_PCI | 118 | #ifdef CONFIG_PCI |
@@ -199,32 +133,13 @@ static void __init jmr3927_pci_setup(void) | |||
199 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); | 133 | jmr3927_ioc_reg_out(0, JMR3927_IOC_RESET_ADDR); |
200 | } | 134 | } |
201 | tx3927_pcic_setup(c, JMR3927_SDRAM_SIZE, extarb); | 135 | tx3927_pcic_setup(c, JMR3927_SDRAM_SIZE, extarb); |
136 | tx3927_setup_pcierr_irq(); | ||
202 | #endif /* CONFIG_PCI */ | 137 | #endif /* CONFIG_PCI */ |
203 | } | 138 | } |
204 | 139 | ||
205 | static void __init jmr3927_board_init(void) | 140 | static void __init jmr3927_board_init(void) |
206 | { | 141 | { |
207 | tx3927_setup(); | ||
208 | jmr3927_pci_setup(); | ||
209 | |||
210 | /* SIO0 DTR on */ | ||
211 | jmr3927_ioc_reg_out(0, JMR3927_IOC_DTR_ADDR); | ||
212 | |||
213 | jmr3927_led_set(0); | ||
214 | |||
215 | printk("JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n", | ||
216 | jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK, | ||
217 | jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK, | ||
218 | jmr3927_dipsw1(), jmr3927_dipsw2(), | ||
219 | jmr3927_dipsw3(), jmr3927_dipsw4()); | ||
220 | } | ||
221 | |||
222 | static void __init tx3927_setup(void) | ||
223 | { | ||
224 | int i; | ||
225 | |||
226 | txx9_cpu_clock = JMR3927_CORECLK; | 142 | txx9_cpu_clock = JMR3927_CORECLK; |
227 | txx9_gbus_clock = JMR3927_GBUSCLK; | ||
228 | /* SDRAMC are configured by PROM */ | 143 | /* SDRAMC are configured by PROM */ |
229 | 144 | ||
230 | /* ROMC */ | 145 | /* ROMC */ |
@@ -233,74 +148,32 @@ static void __init tx3927_setup(void) | |||
233 | tx3927_romcptr->cr[3] = JMR3927_ROMCE3 | 0x0003f698; | 148 | tx3927_romcptr->cr[3] = JMR3927_ROMCE3 | 0x0003f698; |
234 | tx3927_romcptr->cr[5] = JMR3927_ROMCE5 | 0x0000f218; | 149 | tx3927_romcptr->cr[5] = JMR3927_ROMCE5 | 0x0000f218; |
235 | 150 | ||
236 | /* CCFG */ | ||
237 | /* enable Timeout BusError */ | ||
238 | if (jmr3927_ccfg_toeon) | ||
239 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_TOE; | ||
240 | |||
241 | /* clear BusErrorOnWrite flag */ | ||
242 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW; | ||
243 | /* Disable PCI snoop */ | ||
244 | tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP; | ||
245 | /* do reset on watchdog */ | ||
246 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR; | ||
247 | |||
248 | #ifdef DO_WRITE_THROUGH | ||
249 | /* Enable PCI SNOOP - with write through only */ | ||
250 | tx3927_ccfgptr->ccfg |= TX3927_CCFG_PSNP; | ||
251 | #endif | ||
252 | |||
253 | /* Pin selection */ | 151 | /* Pin selection */ |
254 | tx3927_ccfgptr->pcfg &= ~TX3927_PCFG_SELALL; | 152 | tx3927_ccfgptr->pcfg &= ~TX3927_PCFG_SELALL; |
255 | tx3927_ccfgptr->pcfg |= | 153 | tx3927_ccfgptr->pcfg |= |
256 | TX3927_PCFG_SELSIOC(0) | TX3927_PCFG_SELSIO_ALL | | 154 | TX3927_PCFG_SELSIOC(0) | TX3927_PCFG_SELSIO_ALL | |
257 | (TX3927_PCFG_SELDMA_ALL & ~TX3927_PCFG_SELDMA(1)); | 155 | (TX3927_PCFG_SELDMA_ALL & ~TX3927_PCFG_SELDMA(1)); |
258 | 156 | ||
259 | printk("TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n", | 157 | tx3927_setup(); |
260 | tx3927_ccfgptr->crir, | ||
261 | tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg); | ||
262 | |||
263 | /* TMR */ | ||
264 | for (i = 0; i < TX3927_NR_TMR; i++) | ||
265 | txx9_tmr_init(TX3927_TMR_REG(i)); | ||
266 | |||
267 | /* DMA */ | ||
268 | tx3927_dmaptr->mcr = 0; | ||
269 | for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) { | ||
270 | /* reset channel */ | ||
271 | tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST; | ||
272 | tx3927_dmaptr->ch[i].ccr = 0; | ||
273 | } | ||
274 | /* enable DMA */ | ||
275 | #ifdef __BIG_ENDIAN | ||
276 | tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN; | ||
277 | #else | ||
278 | tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN | TX3927_DMA_MCR_LE; | ||
279 | #endif | ||
280 | 158 | ||
281 | /* PIO */ | ||
282 | /* PIO[15:12] connected to LEDs */ | 159 | /* PIO[15:12] connected to LEDs */ |
283 | __raw_writel(0x0000f000, &tx3927_pioptr->dir); | 160 | __raw_writel(0x0000f000, &tx3927_pioptr->dir); |
284 | __raw_writel(0, &tx3927_pioptr->maskcpu); | ||
285 | __raw_writel(0, &tx3927_pioptr->maskext); | ||
286 | txx9_gpio_init(TX3927_PIO_REG, 0, 16); | ||
287 | gpio_request(11, "dipsw1"); | 161 | gpio_request(11, "dipsw1"); |
288 | gpio_request(10, "dipsw2"); | 162 | gpio_request(10, "dipsw2"); |
289 | { | ||
290 | unsigned int conf; | ||
291 | 163 | ||
292 | conf = read_c0_conf(); | 164 | jmr3927_pci_setup(); |
293 | if (!(conf & TX39_CONF_ICE)) | 165 | |
294 | printk("TX3927 I-Cache disabled.\n"); | 166 | /* SIO0 DTR on */ |
295 | if (!(conf & TX39_CONF_DCE)) | 167 | jmr3927_ioc_reg_out(0, JMR3927_IOC_DTR_ADDR); |
296 | printk("TX3927 D-Cache disabled.\n"); | 168 | |
297 | else if (!(conf & TX39_CONF_WBON)) | 169 | jmr3927_led_set(0); |
298 | printk("TX3927 D-Cache WriteThrough.\n"); | 170 | |
299 | else if (!(conf & TX39_CONF_CWFON)) | 171 | printk(KERN_INFO |
300 | printk("TX3927 D-Cache WriteBack.\n"); | 172 | "JMR-TX3927 (Rev %d) --- IOC(Rev %d) DIPSW:%d,%d,%d,%d\n", |
301 | else | 173 | jmr3927_ioc_reg_in(JMR3927_IOC_BREV_ADDR) & JMR3927_REV_MASK, |
302 | printk("TX3927 D-Cache WriteBack (CWF) .\n"); | 174 | jmr3927_ioc_reg_in(JMR3927_IOC_REV_ADDR) & JMR3927_REV_MASK, |
303 | } | 175 | jmr3927_dipsw1(), jmr3927_dipsw2(), |
176 | jmr3927_dipsw3(), jmr3927_dipsw4()); | ||
304 | } | 177 | } |
305 | 178 | ||
306 | /* This trick makes rtc-ds1742 driver usable as is. */ | 179 | /* This trick makes rtc-ds1742 driver usable as is. */ |
@@ -316,42 +189,21 @@ static unsigned long jmr3927_swizzle_addr_b(unsigned long port) | |||
316 | #endif | 189 | #endif |
317 | } | 190 | } |
318 | 191 | ||
319 | static int __init jmr3927_rtc_init(void) | 192 | static void __init jmr3927_rtc_init(void) |
320 | { | 193 | { |
321 | static struct resource __initdata res = { | 194 | static struct resource __initdata res = { |
322 | .start = JMR3927_IOC_NVRAMB_ADDR - IO_BASE, | 195 | .start = JMR3927_IOC_NVRAMB_ADDR - IO_BASE, |
323 | .end = JMR3927_IOC_NVRAMB_ADDR - IO_BASE + 0x800 - 1, | 196 | .end = JMR3927_IOC_NVRAMB_ADDR - IO_BASE + 0x800 - 1, |
324 | .flags = IORESOURCE_MEM, | 197 | .flags = IORESOURCE_MEM, |
325 | }; | 198 | }; |
326 | struct platform_device *dev; | 199 | platform_device_register_simple("rtc-ds1742", -1, &res, 1); |
327 | dev = platform_device_register_simple("rtc-ds1742", -1, &res, 1); | ||
328 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
329 | } | ||
330 | |||
331 | /* Watchdog support */ | ||
332 | |||
333 | static int __init txx9_wdt_init(unsigned long base) | ||
334 | { | ||
335 | struct resource res = { | ||
336 | .start = base, | ||
337 | .end = base + 0x100 - 1, | ||
338 | .flags = IORESOURCE_MEM, | ||
339 | }; | ||
340 | struct platform_device *dev = | ||
341 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
342 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
343 | } | ||
344 | |||
345 | static int __init jmr3927_wdt_init(void) | ||
346 | { | ||
347 | return txx9_wdt_init(TX3927_TMR_REG(2)); | ||
348 | } | 200 | } |
349 | 201 | ||
350 | static void __init jmr3927_device_init(void) | 202 | static void __init jmr3927_device_init(void) |
351 | { | 203 | { |
352 | __swizzle_addr_b = jmr3927_swizzle_addr_b; | 204 | __swizzle_addr_b = jmr3927_swizzle_addr_b; |
353 | jmr3927_rtc_init(); | 205 | jmr3927_rtc_init(); |
354 | jmr3927_wdt_init(); | 206 | tx3927_wdt_init(); |
355 | } | 207 | } |
356 | 208 | ||
357 | struct txx9_board_vec jmr3927_vec __initdata = { | 209 | struct txx9_board_vec jmr3927_vec __initdata = { |
diff --git a/arch/mips/txx9/rbtx4927/irq.c b/arch/mips/txx9/rbtx4927/irq.c index cd748a930328..00cd5231da30 100644 --- a/arch/mips/txx9/rbtx4927/irq.c +++ b/arch/mips/txx9/rbtx4927/irq.c | |||
@@ -27,85 +27,86 @@ | |||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 27 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
28 | */ | 28 | */ |
29 | /* | 29 | /* |
30 | IRQ Device | 30 | * I8259A_IRQ_BASE+00 |
31 | 00 RBTX4927-ISA/00 | 31 | * I8259A_IRQ_BASE+01 PS2/Keyboard |
32 | 01 RBTX4927-ISA/01 PS2/Keyboard | 32 | * I8259A_IRQ_BASE+02 Cascade RBTX4927-ISA (irqs 8-15) |
33 | 02 RBTX4927-ISA/02 Cascade RBTX4927-ISA (irqs 8-15) | 33 | * I8259A_IRQ_BASE+03 |
34 | 03 RBTX4927-ISA/03 | 34 | * I8259A_IRQ_BASE+04 |
35 | 04 RBTX4927-ISA/04 | 35 | * I8259A_IRQ_BASE+05 |
36 | 05 RBTX4927-ISA/05 | 36 | * I8259A_IRQ_BASE+06 |
37 | 06 RBTX4927-ISA/06 | 37 | * I8259A_IRQ_BASE+07 |
38 | 07 RBTX4927-ISA/07 | 38 | * I8259A_IRQ_BASE+08 |
39 | 08 RBTX4927-ISA/08 | 39 | * I8259A_IRQ_BASE+09 |
40 | 09 RBTX4927-ISA/09 | 40 | * I8259A_IRQ_BASE+10 |
41 | 10 RBTX4927-ISA/10 | 41 | * I8259A_IRQ_BASE+11 |
42 | 11 RBTX4927-ISA/11 | 42 | * I8259A_IRQ_BASE+12 PS2/Mouse (not supported at this time) |
43 | 12 RBTX4927-ISA/12 PS2/Mouse (not supported at this time) | 43 | * I8259A_IRQ_BASE+13 |
44 | 13 RBTX4927-ISA/13 | 44 | * I8259A_IRQ_BASE+14 IDE |
45 | 14 RBTX4927-ISA/14 IDE | 45 | * I8259A_IRQ_BASE+15 |
46 | 15 RBTX4927-ISA/15 | 46 | * |
47 | 47 | * MIPS_CPU_IRQ_BASE+00 Software 0 | |
48 | 16 TX4927-CP0/00 Software 0 | 48 | * MIPS_CPU_IRQ_BASE+01 Software 1 |
49 | 17 TX4927-CP0/01 Software 1 | 49 | * MIPS_CPU_IRQ_BASE+02 Cascade TX4927-CP0 |
50 | 18 TX4927-CP0/02 Cascade TX4927-CP0 | 50 | * MIPS_CPU_IRQ_BASE+03 Multiplexed -- do not use |
51 | 19 TX4927-CP0/03 Multiplexed -- do not use | 51 | * MIPS_CPU_IRQ_BASE+04 Multiplexed -- do not use |
52 | 20 TX4927-CP0/04 Multiplexed -- do not use | 52 | * MIPS_CPU_IRQ_BASE+05 Multiplexed -- do not use |
53 | 21 TX4927-CP0/05 Multiplexed -- do not use | 53 | * MIPS_CPU_IRQ_BASE+06 Multiplexed -- do not use |
54 | 22 TX4927-CP0/06 Multiplexed -- do not use | 54 | * MIPS_CPU_IRQ_BASE+07 CPU TIMER |
55 | 23 TX4927-CP0/07 CPU TIMER | 55 | * |
56 | 56 | * TXX9_IRQ_BASE+00 | |
57 | 24 TX4927-PIC/00 | 57 | * TXX9_IRQ_BASE+01 |
58 | 25 TX4927-PIC/01 | 58 | * TXX9_IRQ_BASE+02 |
59 | 26 TX4927-PIC/02 | 59 | * TXX9_IRQ_BASE+03 Cascade RBTX4927-IOC |
60 | 27 TX4927-PIC/03 Cascade RBTX4927-IOC | 60 | * TXX9_IRQ_BASE+04 |
61 | 28 TX4927-PIC/04 | 61 | * TXX9_IRQ_BASE+05 RBTX4927 RTL-8019AS ethernet |
62 | 29 TX4927-PIC/05 RBTX4927 RTL-8019AS ethernet | 62 | * TXX9_IRQ_BASE+06 |
63 | 30 TX4927-PIC/06 | 63 | * TXX9_IRQ_BASE+07 |
64 | 31 TX4927-PIC/07 | 64 | * TXX9_IRQ_BASE+08 TX4927 SerialIO Channel 0 |
65 | 32 TX4927-PIC/08 TX4927 SerialIO Channel 0 | 65 | * TXX9_IRQ_BASE+09 TX4927 SerialIO Channel 1 |
66 | 33 TX4927-PIC/09 TX4927 SerialIO Channel 1 | 66 | * TXX9_IRQ_BASE+10 |
67 | 34 TX4927-PIC/10 | 67 | * TXX9_IRQ_BASE+11 |
68 | 35 TX4927-PIC/11 | 68 | * TXX9_IRQ_BASE+12 |
69 | 36 TX4927-PIC/12 | 69 | * TXX9_IRQ_BASE+13 |
70 | 37 TX4927-PIC/13 | 70 | * TXX9_IRQ_BASE+14 |
71 | 38 TX4927-PIC/14 | 71 | * TXX9_IRQ_BASE+15 |
72 | 39 TX4927-PIC/15 | 72 | * TXX9_IRQ_BASE+16 TX4927 PCI PCI-C |
73 | 40 TX4927-PIC/16 TX4927 PCI PCI-C | 73 | * TXX9_IRQ_BASE+17 |
74 | 41 TX4927-PIC/17 | 74 | * TXX9_IRQ_BASE+18 |
75 | 42 TX4927-PIC/18 | 75 | * TXX9_IRQ_BASE+19 |
76 | 43 TX4927-PIC/19 | 76 | * TXX9_IRQ_BASE+20 |
77 | 44 TX4927-PIC/20 | 77 | * TXX9_IRQ_BASE+21 |
78 | 45 TX4927-PIC/21 | 78 | * TXX9_IRQ_BASE+22 TX4927 PCI PCI-ERR |
79 | 46 TX4927-PIC/22 TX4927 PCI PCI-ERR | 79 | * TXX9_IRQ_BASE+23 TX4927 PCI PCI-PMA (not used) |
80 | 47 TX4927-PIC/23 TX4927 PCI PCI-PMA (not used) | 80 | * TXX9_IRQ_BASE+24 |
81 | 48 TX4927-PIC/24 | 81 | * TXX9_IRQ_BASE+25 |
82 | 49 TX4927-PIC/25 | 82 | * TXX9_IRQ_BASE+26 |
83 | 50 TX4927-PIC/26 | 83 | * TXX9_IRQ_BASE+27 |
84 | 51 TX4927-PIC/27 | 84 | * TXX9_IRQ_BASE+28 |
85 | 52 TX4927-PIC/28 | 85 | * TXX9_IRQ_BASE+29 |
86 | 53 TX4927-PIC/29 | 86 | * TXX9_IRQ_BASE+30 |
87 | 54 TX4927-PIC/30 | 87 | * TXX9_IRQ_BASE+31 |
88 | 55 TX4927-PIC/31 | 88 | * |
89 | 89 | * RBTX4927_IRQ_IOC+00 FPCIB0 PCI-D (SouthBridge) | |
90 | 56 RBTX4927-IOC/00 FPCIB0 PCI-D PJ4/A PJ5/B SB/C PJ6/D PJ7/A (SouthBridge/NotUsed) [RTL-8139=PJ4] | 90 | * RBTX4927_IRQ_IOC+01 FPCIB0 PCI-C (SouthBridge) |
91 | 57 RBTX4927-IOC/01 FPCIB0 PCI-C PJ4/D PJ5/A SB/B PJ6/C PJ7/D (SouthBridge/NotUsed) [RTL-8139=PJ5] | 91 | * RBTX4927_IRQ_IOC+02 FPCIB0 PCI-B (SouthBridge/IDE/pin=1,INTR) |
92 | 58 RBTX4927-IOC/02 FPCIB0 PCI-B PJ4/C PJ5/D SB/A PJ6/B PJ7/C (SouthBridge/IDE/pin=1,INTR) [RTL-8139=NotSupported] | 92 | * RBTX4927_IRQ_IOC+03 FPCIB0 PCI-A (SouthBridge/USB/pin=4) |
93 | 59 RBTX4927-IOC/03 FPCIB0 PCI-A PJ4/B PJ5/C SB/D PJ6/A PJ7/B (SouthBridge/USB/pin=4) [RTL-8139=PJ6] | 93 | * RBTX4927_IRQ_IOC+04 |
94 | 60 RBTX4927-IOC/04 | 94 | * RBTX4927_IRQ_IOC+05 |
95 | 61 RBTX4927-IOC/05 | 95 | * RBTX4927_IRQ_IOC+06 |
96 | 62 RBTX4927-IOC/06 | 96 | * RBTX4927_IRQ_IOC+07 |
97 | 63 RBTX4927-IOC/07 | 97 | * |
98 | 98 | * NOTES: | |
99 | NOTES: | 99 | * SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58 |
100 | SouthBridge/INTR is mapped to SouthBridge/A=PCI-B/#58 | 100 | * SouthBridge/ISA/pin=0 no pci irq used by this device |
101 | SouthBridge/ISA/pin=0 no pci irq used by this device | 101 | * SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR |
102 | SouthBridge/IDE/pin=1 no pci irq used by this device, using INTR via ISA IRQ14 | 102 | * via ISA IRQ14 |
103 | SouthBridge/USB/pin=4 using pci irq SouthBridge/D=PCI-A=#59 | 103 | * SouthBridge/USB/pin=4 using pci irq SouthBridge/D=PCI-A=#59 |
104 | SouthBridge/PMC/pin=0 no pci irq used by this device | 104 | * SouthBridge/PMC/pin=0 no pci irq used by this device |
105 | SuperIO/PS2/Keyboard, using INTR via ISA IRQ1 | 105 | * SuperIO/PS2/Keyboard, using INTR via ISA IRQ1 |
106 | SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported) | 106 | * SuperIO/PS2/Mouse, using INTR via ISA IRQ12 (mouse not currently supported) |
107 | JP7 is not bus master -- do NOT use -- only 4 pci bus master's allowed -- SouthBridge, JP4, JP5, JP6 | 107 | * JP7 is not bus master -- do NOT use -- only 4 pci bus master's |
108 | */ | 108 | * allowed -- SouthBridge, JP4, JP5, JP6 |
109 | */ | ||
109 | 110 | ||
110 | #include <linux/init.h> | 111 | #include <linux/init.h> |
111 | #include <linux/types.h> | 112 | #include <linux/types.h> |
@@ -134,7 +135,7 @@ static int toshiba_rbtx4927_irq_nested(int sw_irq) | |||
134 | level3 = readb(rbtx4927_imstat_addr) & 0x1f; | 135 | level3 = readb(rbtx4927_imstat_addr) & 0x1f; |
135 | if (level3) | 136 | if (level3) |
136 | sw_irq = RBTX4927_IRQ_IOC + fls(level3) - 1; | 137 | sw_irq = RBTX4927_IRQ_IOC + fls(level3) - 1; |
137 | return (sw_irq); | 138 | return sw_irq; |
138 | } | 139 | } |
139 | 140 | ||
140 | static void __init toshiba_rbtx4927_irq_ioc_init(void) | 141 | static void __init toshiba_rbtx4927_irq_ioc_init(void) |
diff --git a/arch/mips/txx9/rbtx4927/prom.c b/arch/mips/txx9/rbtx4927/prom.c index 5c0de54ebdd2..1dc0a5b1956b 100644 --- a/arch/mips/txx9/rbtx4927/prom.c +++ b/arch/mips/txx9/rbtx4927/prom.c | |||
@@ -38,4 +38,5 @@ void __init rbtx4927_prom_init(void) | |||
38 | { | 38 | { |
39 | prom_init_cmdline(); | 39 | prom_init_cmdline(); |
40 | add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM); | 40 | add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM); |
41 | txx9_sio_putchar_init(TX4927_SIO_REG(0) & 0xfffffffffULL); | ||
41 | } | 42 | } |
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c index 3da20ea3e55c..0d39bafea794 100644 --- a/arch/mips/txx9/rbtx4927/setup.c +++ b/arch/mips/txx9/rbtx4927/setup.c | |||
@@ -46,12 +46,9 @@ | |||
46 | #include <linux/kernel.h> | 46 | #include <linux/kernel.h> |
47 | #include <linux/types.h> | 47 | #include <linux/types.h> |
48 | #include <linux/ioport.h> | 48 | #include <linux/ioport.h> |
49 | #include <linux/interrupt.h> | ||
50 | #include <linux/pm.h> | ||
51 | #include <linux/platform_device.h> | 49 | #include <linux/platform_device.h> |
52 | #include <linux/delay.h> | 50 | #include <linux/delay.h> |
53 | #include <asm/io.h> | 51 | #include <asm/io.h> |
54 | #include <asm/processor.h> | ||
55 | #include <asm/reboot.h> | 52 | #include <asm/reboot.h> |
56 | #include <asm/txx9/generic.h> | 53 | #include <asm/txx9/generic.h> |
57 | #include <asm/txx9/pci.h> | 54 | #include <asm/txx9/pci.h> |
@@ -103,6 +100,7 @@ static void __init tx4927_pci_setup(void) | |||
103 | tx4927_report_pciclk(); | 100 | tx4927_report_pciclk(); |
104 | tx4927_pcic_setup(tx4927_pcicptr, c, extarb); | 101 | tx4927_pcic_setup(tx4927_pcicptr, c, extarb); |
105 | } | 102 | } |
103 | tx4927_setup_pcierr_irq(); | ||
106 | } | 104 | } |
107 | 105 | ||
108 | static void __init tx4937_pci_setup(void) | 106 | static void __init tx4937_pci_setup(void) |
@@ -149,6 +147,7 @@ static void __init tx4937_pci_setup(void) | |||
149 | tx4938_report_pciclk(); | 147 | tx4938_report_pciclk(); |
150 | tx4927_pcic_setup(tx4938_pcicptr, c, extarb); | 148 | tx4927_pcic_setup(tx4938_pcicptr, c, extarb); |
151 | } | 149 | } |
150 | tx4938_setup_pcierr_irq(); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | static void __init rbtx4927_arch_init(void) | 153 | static void __init rbtx4927_arch_init(void) |
@@ -165,17 +164,8 @@ static void __init rbtx4937_arch_init(void) | |||
165 | #define rbtx4937_arch_init NULL | 164 | #define rbtx4937_arch_init NULL |
166 | #endif /* CONFIG_PCI */ | 165 | #endif /* CONFIG_PCI */ |
167 | 166 | ||
168 | static void __noreturn wait_forever(void) | ||
169 | { | ||
170 | while (1) | ||
171 | if (cpu_wait) | ||
172 | (*cpu_wait)(); | ||
173 | } | ||
174 | |||
175 | static void toshiba_rbtx4927_restart(char *command) | 167 | static void toshiba_rbtx4927_restart(char *command) |
176 | { | 168 | { |
177 | printk(KERN_NOTICE "System Rebooting...\n"); | ||
178 | |||
179 | /* enable the s/w reset register */ | 169 | /* enable the s/w reset register */ |
180 | writeb(1, rbtx4927_softresetlock_addr); | 170 | writeb(1, rbtx4927_softresetlock_addr); |
181 | 171 | ||
@@ -186,24 +176,8 @@ static void toshiba_rbtx4927_restart(char *command) | |||
186 | /* do a s/w reset */ | 176 | /* do a s/w reset */ |
187 | writeb(1, rbtx4927_softreset_addr); | 177 | writeb(1, rbtx4927_softreset_addr); |
188 | 178 | ||
189 | /* do something passive while waiting for reset */ | 179 | /* fallback */ |
190 | local_irq_disable(); | 180 | (*_machine_halt)(); |
191 | wait_forever(); | ||
192 | /* no return */ | ||
193 | } | ||
194 | |||
195 | static void toshiba_rbtx4927_halt(void) | ||
196 | { | ||
197 | printk(KERN_NOTICE "System Halted\n"); | ||
198 | local_irq_disable(); | ||
199 | wait_forever(); | ||
200 | /* no return */ | ||
201 | } | ||
202 | |||
203 | static void toshiba_rbtx4927_power_off(void) | ||
204 | { | ||
205 | toshiba_rbtx4927_halt(); | ||
206 | /* no return */ | ||
207 | } | 181 | } |
208 | 182 | ||
209 | static void __init rbtx4927_clock_init(void); | 183 | static void __init rbtx4927_clock_init(void); |
@@ -214,9 +188,6 @@ static void __init rbtx4927_mem_setup(void) | |||
214 | u32 cp0_config; | 188 | u32 cp0_config; |
215 | char *argptr; | 189 | char *argptr; |
216 | 190 | ||
217 | /* f/w leaves this on at startup */ | ||
218 | clear_c0_status(ST0_ERL); | ||
219 | |||
220 | /* enable caches -- HCP5 does this, pmon does not */ | 191 | /* enable caches -- HCP5 does this, pmon does not */ |
221 | cp0_config = read_c0_config(); | 192 | cp0_config = read_c0_config(); |
222 | cp0_config = cp0_config & ~(TX49_CONF_IC | TX49_CONF_DC); | 193 | cp0_config = cp0_config & ~(TX49_CONF_IC | TX49_CONF_DC); |
@@ -231,37 +202,21 @@ static void __init rbtx4927_mem_setup(void) | |||
231 | } | 202 | } |
232 | 203 | ||
233 | _machine_restart = toshiba_rbtx4927_restart; | 204 | _machine_restart = toshiba_rbtx4927_restart; |
234 | _machine_halt = toshiba_rbtx4927_halt; | ||
235 | pm_power_off = toshiba_rbtx4927_power_off; | ||
236 | 205 | ||
237 | #ifdef CONFIG_PCI | 206 | #ifdef CONFIG_PCI |
238 | txx9_alloc_pci_controller(&txx9_primary_pcic, | 207 | txx9_alloc_pci_controller(&txx9_primary_pcic, |
239 | RBTX4927_PCIMEM, RBTX4927_PCIMEM_SIZE, | 208 | RBTX4927_PCIMEM, RBTX4927_PCIMEM_SIZE, |
240 | RBTX4927_PCIIO, RBTX4927_PCIIO_SIZE); | 209 | RBTX4927_PCIIO, RBTX4927_PCIIO_SIZE); |
210 | txx9_board_pcibios_setup = tx4927_pcibios_setup; | ||
241 | #else | 211 | #else |
242 | set_io_port_base(KSEG1 + RBTX4927_ISA_IO_OFFSET); | 212 | set_io_port_base(KSEG1 + RBTX4927_ISA_IO_OFFSET); |
243 | #endif | 213 | #endif |
244 | 214 | ||
245 | tx4927_setup_serial(); | 215 | tx4927_sio_init(0, 0); |
246 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE | 216 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE |
247 | argptr = prom_getcmdline(); | 217 | argptr = prom_getcmdline(); |
248 | if (strstr(argptr, "console=") == NULL) { | 218 | if (!strstr(argptr, "console=")) |
249 | strcat(argptr, " console=ttyS0,38400"); | 219 | strcat(argptr, " console=ttyS0,38400"); |
250 | } | ||
251 | #endif | ||
252 | |||
253 | #ifdef CONFIG_ROOT_NFS | ||
254 | argptr = prom_getcmdline(); | ||
255 | if (strstr(argptr, "root=") == NULL) { | ||
256 | strcat(argptr, " root=/dev/nfs rw"); | ||
257 | } | ||
258 | #endif | ||
259 | |||
260 | #ifdef CONFIG_IP_PNP | ||
261 | argptr = prom_getcmdline(); | ||
262 | if (strstr(argptr, "ip=") == NULL) { | ||
263 | strcat(argptr, " ip=any"); | ||
264 | } | ||
265 | #endif | 220 | #endif |
266 | } | 221 | } |
267 | 222 | ||
@@ -324,19 +279,17 @@ static void __init rbtx4927_time_init(void) | |||
324 | tx4927_time_init(0); | 279 | tx4927_time_init(0); |
325 | } | 280 | } |
326 | 281 | ||
327 | static int __init toshiba_rbtx4927_rtc_init(void) | 282 | static void __init toshiba_rbtx4927_rtc_init(void) |
328 | { | 283 | { |
329 | struct resource res = { | 284 | struct resource res = { |
330 | .start = RBTX4927_BRAMRTC_BASE - IO_BASE, | 285 | .start = RBTX4927_BRAMRTC_BASE - IO_BASE, |
331 | .end = RBTX4927_BRAMRTC_BASE - IO_BASE + 0x800 - 1, | 286 | .end = RBTX4927_BRAMRTC_BASE - IO_BASE + 0x800 - 1, |
332 | .flags = IORESOURCE_MEM, | 287 | .flags = IORESOURCE_MEM, |
333 | }; | 288 | }; |
334 | struct platform_device *dev = | 289 | platform_device_register_simple("rtc-ds1742", -1, &res, 1); |
335 | platform_device_register_simple("rtc-ds1742", -1, &res, 1); | ||
336 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
337 | } | 290 | } |
338 | 291 | ||
339 | static int __init rbtx4927_ne_init(void) | 292 | static void __init rbtx4927_ne_init(void) |
340 | { | 293 | { |
341 | struct resource res[] = { | 294 | struct resource res[] = { |
342 | { | 295 | { |
@@ -348,36 +301,14 @@ static int __init rbtx4927_ne_init(void) | |||
348 | .flags = IORESOURCE_IRQ, | 301 | .flags = IORESOURCE_IRQ, |
349 | } | 302 | } |
350 | }; | 303 | }; |
351 | struct platform_device *dev = | 304 | platform_device_register_simple("ne", -1, res, ARRAY_SIZE(res)); |
352 | platform_device_register_simple("ne", -1, | ||
353 | res, ARRAY_SIZE(res)); | ||
354 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
355 | } | ||
356 | |||
357 | /* Watchdog support */ | ||
358 | |||
359 | static int __init txx9_wdt_init(unsigned long base) | ||
360 | { | ||
361 | struct resource res = { | ||
362 | .start = base, | ||
363 | .end = base + 0x100 - 1, | ||
364 | .flags = IORESOURCE_MEM, | ||
365 | }; | ||
366 | struct platform_device *dev = | ||
367 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
368 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
369 | } | ||
370 | |||
371 | static int __init rbtx4927_wdt_init(void) | ||
372 | { | ||
373 | return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL); | ||
374 | } | 305 | } |
375 | 306 | ||
376 | static void __init rbtx4927_device_init(void) | 307 | static void __init rbtx4927_device_init(void) |
377 | { | 308 | { |
378 | toshiba_rbtx4927_rtc_init(); | 309 | toshiba_rbtx4927_rtc_init(); |
379 | rbtx4927_ne_init(); | 310 | rbtx4927_ne_init(); |
380 | rbtx4927_wdt_init(); | 311 | tx4927_wdt_init(); |
381 | } | 312 | } |
382 | 313 | ||
383 | struct txx9_board_vec rbtx4927_vec __initdata = { | 314 | struct txx9_board_vec rbtx4927_vec __initdata = { |
diff --git a/arch/mips/txx9/rbtx4938/irq.c b/arch/mips/txx9/rbtx4938/irq.c index 3971a061657a..ca2f8306ce93 100644 --- a/arch/mips/txx9/rbtx4938/irq.c +++ b/arch/mips/txx9/rbtx4938/irq.c | |||
@@ -11,59 +11,57 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | /* | 13 | /* |
14 | IRQ Device | 14 | * MIPS_CPU_IRQ_BASE+00 Software 0 |
15 | 15 | * MIPS_CPU_IRQ_BASE+01 Software 1 | |
16 | 16 TX4938-CP0/00 Software 0 | 16 | * MIPS_CPU_IRQ_BASE+02 Cascade TX4938-CP0 |
17 | 17 TX4938-CP0/01 Software 1 | 17 | * MIPS_CPU_IRQ_BASE+03 Multiplexed -- do not use |
18 | 18 TX4938-CP0/02 Cascade TX4938-CP0 | 18 | * MIPS_CPU_IRQ_BASE+04 Multiplexed -- do not use |
19 | 19 TX4938-CP0/03 Multiplexed -- do not use | 19 | * MIPS_CPU_IRQ_BASE+05 Multiplexed -- do not use |
20 | 20 TX4938-CP0/04 Multiplexed -- do not use | 20 | * MIPS_CPU_IRQ_BASE+06 Multiplexed -- do not use |
21 | 21 TX4938-CP0/05 Multiplexed -- do not use | 21 | * MIPS_CPU_IRQ_BASE+07 CPU TIMER |
22 | 22 TX4938-CP0/06 Multiplexed -- do not use | 22 | * |
23 | 23 TX4938-CP0/07 CPU TIMER | 23 | * TXX9_IRQ_BASE+00 |
24 | 24 | * TXX9_IRQ_BASE+01 | |
25 | 24 TX4938-PIC/00 | 25 | * TXX9_IRQ_BASE+02 Cascade RBTX4938-IOC |
26 | 25 TX4938-PIC/01 | 26 | * TXX9_IRQ_BASE+03 RBTX4938 RTL-8019AS Ethernet |
27 | 26 TX4938-PIC/02 Cascade RBTX4938-IOC | 27 | * TXX9_IRQ_BASE+04 |
28 | 27 TX4938-PIC/03 RBTX4938 RTL-8019AS Ethernet | 28 | * TXX9_IRQ_BASE+05 TX4938 ETH1 |
29 | 28 TX4938-PIC/04 | 29 | * TXX9_IRQ_BASE+06 TX4938 ETH0 |
30 | 29 TX4938-PIC/05 TX4938 ETH1 | 30 | * TXX9_IRQ_BASE+07 |
31 | 30 TX4938-PIC/06 TX4938 ETH0 | 31 | * TXX9_IRQ_BASE+08 TX4938 SIO 0 |
32 | 31 TX4938-PIC/07 | 32 | * TXX9_IRQ_BASE+09 TX4938 SIO 1 |
33 | 32 TX4938-PIC/08 TX4938 SIO 0 | 33 | * TXX9_IRQ_BASE+10 TX4938 DMA0 |
34 | 33 TX4938-PIC/09 TX4938 SIO 1 | 34 | * TXX9_IRQ_BASE+11 TX4938 DMA1 |
35 | 34 TX4938-PIC/10 TX4938 DMA0 | 35 | * TXX9_IRQ_BASE+12 TX4938 DMA2 |
36 | 35 TX4938-PIC/11 TX4938 DMA1 | 36 | * TXX9_IRQ_BASE+13 TX4938 DMA3 |
37 | 36 TX4938-PIC/12 TX4938 DMA2 | 37 | * TXX9_IRQ_BASE+14 |
38 | 37 TX4938-PIC/13 TX4938 DMA3 | 38 | * TXX9_IRQ_BASE+15 |
39 | 38 TX4938-PIC/14 | 39 | * TXX9_IRQ_BASE+16 TX4938 PCIC |
40 | 39 TX4938-PIC/15 | 40 | * TXX9_IRQ_BASE+17 TX4938 TMR0 |
41 | 40 TX4938-PIC/16 TX4938 PCIC | 41 | * TXX9_IRQ_BASE+18 TX4938 TMR1 |
42 | 41 TX4938-PIC/17 TX4938 TMR0 | 42 | * TXX9_IRQ_BASE+19 TX4938 TMR2 |
43 | 42 TX4938-PIC/18 TX4938 TMR1 | 43 | * TXX9_IRQ_BASE+20 |
44 | 43 TX4938-PIC/19 TX4938 TMR2 | 44 | * TXX9_IRQ_BASE+21 |
45 | 44 TX4938-PIC/20 | 45 | * TXX9_IRQ_BASE+22 TX4938 PCIERR |
46 | 45 TX4938-PIC/21 | 46 | * TXX9_IRQ_BASE+23 |
47 | 46 TX4938-PIC/22 TX4938 PCIERR | 47 | * TXX9_IRQ_BASE+24 |
48 | 47 TX4938-PIC/23 | 48 | * TXX9_IRQ_BASE+25 |
49 | 48 TX4938-PIC/24 | 49 | * TXX9_IRQ_BASE+26 |
50 | 49 TX4938-PIC/25 | 50 | * TXX9_IRQ_BASE+27 |
51 | 50 TX4938-PIC/26 | 51 | * TXX9_IRQ_BASE+28 |
52 | 51 TX4938-PIC/27 | 52 | * TXX9_IRQ_BASE+29 |
53 | 52 TX4938-PIC/28 | 53 | * TXX9_IRQ_BASE+30 |
54 | 53 TX4938-PIC/29 | 54 | * TXX9_IRQ_BASE+31 TX4938 SPI |
55 | 54 TX4938-PIC/30 | 55 | * |
56 | 55 TX4938-PIC/31 TX4938 SPI | 56 | * RBTX4938_IRQ_IOC+00 PCI-D |
57 | 57 | * RBTX4938_IRQ_IOC+01 PCI-C | |
58 | 56 RBTX4938-IOC/00 PCI-D | 58 | * RBTX4938_IRQ_IOC+02 PCI-B |
59 | 57 RBTX4938-IOC/01 PCI-C | 59 | * RBTX4938_IRQ_IOC+03 PCI-A |
60 | 58 RBTX4938-IOC/02 PCI-B | 60 | * RBTX4938_IRQ_IOC+04 RTC |
61 | 59 RBTX4938-IOC/03 PCI-A | 61 | * RBTX4938_IRQ_IOC+05 ATA |
62 | 60 RBTX4938-IOC/04 RTC | 62 | * RBTX4938_IRQ_IOC+06 MODEM |
63 | 61 RBTX4938-IOC/05 ATA | 63 | * RBTX4938_IRQ_IOC+07 SWINT |
64 | 62 RBTX4938-IOC/06 MODEM | 64 | */ |
65 | 63 RBTX4938-IOC/07 SWINT | ||
66 | */ | ||
67 | #include <linux/init.h> | 65 | #include <linux/init.h> |
68 | #include <linux/interrupt.h> | 66 | #include <linux/interrupt.h> |
69 | #include <asm/mipsregs.h> | 67 | #include <asm/mipsregs.h> |
@@ -93,9 +91,6 @@ static int toshiba_rbtx4938_irq_nested(int sw_irq) | |||
93 | return sw_irq; | 91 | return sw_irq; |
94 | } | 92 | } |
95 | 93 | ||
96 | /**********************************************************************************/ | ||
97 | /* Functions for ioc */ | ||
98 | /**********************************************************************************/ | ||
99 | static void __init | 94 | static void __init |
100 | toshiba_rbtx4938_irq_ioc_init(void) | 95 | toshiba_rbtx4938_irq_ioc_init(void) |
101 | { | 96 | { |
diff --git a/arch/mips/txx9/rbtx4938/prom.c b/arch/mips/txx9/rbtx4938/prom.c index ee189519ce5a..d73123cd2ab9 100644 --- a/arch/mips/txx9/rbtx4938/prom.c +++ b/arch/mips/txx9/rbtx4938/prom.c | |||
@@ -22,4 +22,5 @@ void __init rbtx4938_prom_init(void) | |||
22 | prom_init_cmdline(); | 22 | prom_init_cmdline(); |
23 | #endif | 23 | #endif |
24 | add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM); | 24 | add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM); |
25 | txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL); | ||
25 | } | 26 | } |
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c index 6c2b99bb8af6..9ab48dec0fe8 100644 --- a/arch/mips/txx9/rbtx4938/setup.c +++ b/arch/mips/txx9/rbtx4938/setup.c | |||
@@ -13,9 +13,6 @@ | |||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/ioport.h> | 14 | #include <linux/ioport.h> |
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/console.h> | ||
18 | #include <linux/pm.h> | ||
19 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
20 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
21 | 18 | ||
@@ -28,33 +25,14 @@ | |||
28 | #include <asm/txx9/spi.h> | 25 | #include <asm/txx9/spi.h> |
29 | #include <asm/txx9pio.h> | 26 | #include <asm/txx9pio.h> |
30 | 27 | ||
31 | static void rbtx4938_machine_halt(void) | ||
32 | { | ||
33 | printk(KERN_NOTICE "System Halted\n"); | ||
34 | local_irq_disable(); | ||
35 | |||
36 | while (1) | ||
37 | __asm__(".set\tmips3\n\t" | ||
38 | "wait\n\t" | ||
39 | ".set\tmips0"); | ||
40 | } | ||
41 | |||
42 | static void rbtx4938_machine_power_off(void) | ||
43 | { | ||
44 | rbtx4938_machine_halt(); | ||
45 | /* no return */ | ||
46 | } | ||
47 | |||
48 | static void rbtx4938_machine_restart(char *command) | 28 | static void rbtx4938_machine_restart(char *command) |
49 | { | 29 | { |
50 | local_irq_disable(); | 30 | local_irq_disable(); |
51 | |||
52 | printk("Rebooting..."); | ||
53 | writeb(1, rbtx4938_softresetlock_addr); | 31 | writeb(1, rbtx4938_softresetlock_addr); |
54 | writeb(1, rbtx4938_sfvol_addr); | 32 | writeb(1, rbtx4938_sfvol_addr); |
55 | writeb(1, rbtx4938_softreset_addr); | 33 | writeb(1, rbtx4938_softreset_addr); |
56 | while(1) | 34 | /* fallback */ |
57 | ; | 35 | (*_machine_halt)(); |
58 | } | 36 | } |
59 | 37 | ||
60 | static void __init rbtx4938_pci_setup(void) | 38 | static void __init rbtx4938_pci_setup(void) |
@@ -121,6 +99,7 @@ static void __init rbtx4938_pci_setup(void) | |||
121 | register_pci_controller(c); | 99 | register_pci_controller(c); |
122 | tx4927_pcic_setup(tx4938_pcic1ptr, c, 0); | 100 | tx4927_pcic_setup(tx4938_pcic1ptr, c, 0); |
123 | } | 101 | } |
102 | tx4938_setup_pcierr_irq(); | ||
124 | #endif /* CONFIG_PCI */ | 103 | #endif /* CONFIG_PCI */ |
125 | } | 104 | } |
126 | 105 | ||
@@ -151,19 +130,7 @@ static int __init rbtx4938_ethaddr_init(void) | |||
151 | if (sum) | 130 | if (sum) |
152 | printk(KERN_WARNING "seeprom: bad checksum.\n"); | 131 | printk(KERN_WARNING "seeprom: bad checksum.\n"); |
153 | } | 132 | } |
154 | for (i = 0; i < 2; i++) { | 133 | tx4938_ethaddr_init(&dat[4], &dat[4 + 6]); |
155 | unsigned int id = | ||
156 | TXX9_IRQ_BASE + (i ? TX4938_IR_ETH1 : TX4938_IR_ETH0); | ||
157 | struct platform_device *pdev; | ||
158 | if (!(__raw_readq(&tx4938_ccfgptr->pcfg) & | ||
159 | (i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL))) | ||
160 | continue; | ||
161 | pdev = platform_device_alloc("tc35815-mac", id); | ||
162 | if (!pdev || | ||
163 | platform_device_add_data(pdev, &dat[4 + 6 * i], 6) || | ||
164 | platform_device_add(pdev)) | ||
165 | platform_device_put(pdev); | ||
166 | } | ||
167 | #endif /* CONFIG_PCI */ | 134 | #endif /* CONFIG_PCI */ |
168 | return 0; | 135 | return 0; |
169 | } | 136 | } |
@@ -193,51 +160,36 @@ static void __init rbtx4938_mem_setup(void) | |||
193 | 160 | ||
194 | #ifdef CONFIG_PCI | 161 | #ifdef CONFIG_PCI |
195 | txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0); | 162 | txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0); |
163 | txx9_board_pcibios_setup = tx4927_pcibios_setup; | ||
196 | #else | 164 | #else |
197 | set_io_port_base(RBTX4938_ETHER_BASE); | 165 | set_io_port_base(RBTX4938_ETHER_BASE); |
198 | #endif | 166 | #endif |
199 | 167 | ||
200 | tx4938_setup_serial(); | 168 | tx4938_sio_init(7372800, 0); |
201 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE | 169 | #ifdef CONFIG_SERIAL_TXX9_CONSOLE |
202 | argptr = prom_getcmdline(); | 170 | argptr = prom_getcmdline(); |
203 | if (strstr(argptr, "console=") == NULL) { | 171 | if (!strstr(argptr, "console=")) |
204 | strcat(argptr, " console=ttyS0,38400"); | 172 | strcat(argptr, " console=ttyS0,38400"); |
205 | } | ||
206 | #endif | 173 | #endif |
207 | 174 | ||
208 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61 | 175 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_PIO58_61 |
209 | printk("PIOSEL: disabling both ata and nand selection\n"); | 176 | printk(KERN_INFO "PIOSEL: disabling both ata and nand selection\n"); |
210 | local_irq_disable(); | ||
211 | txx9_clear64(&tx4938_ccfgptr->pcfg, | 177 | txx9_clear64(&tx4938_ccfgptr->pcfg, |
212 | TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL); | 178 | TX4938_PCFG_NDF_SEL | TX4938_PCFG_ATA_SEL); |
213 | #endif | 179 | #endif |
214 | 180 | ||
215 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND | 181 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_NAND |
216 | printk("PIOSEL: enabling nand selection\n"); | 182 | printk(KERN_INFO "PIOSEL: enabling nand selection\n"); |
217 | txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL); | 183 | txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL); |
218 | txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL); | 184 | txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL); |
219 | #endif | 185 | #endif |
220 | 186 | ||
221 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA | 187 | #ifdef CONFIG_TOSHIBA_RBTX4938_MPLEX_ATA |
222 | printk("PIOSEL: enabling ata selection\n"); | 188 | printk(KERN_INFO "PIOSEL: enabling ata selection\n"); |
223 | txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL); | 189 | txx9_set64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_ATA_SEL); |
224 | txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL); | 190 | txx9_clear64(&tx4938_ccfgptr->pcfg, TX4938_PCFG_NDF_SEL); |
225 | #endif | 191 | #endif |
226 | 192 | ||
227 | #ifdef CONFIG_IP_PNP | ||
228 | argptr = prom_getcmdline(); | ||
229 | if (strstr(argptr, "ip=") == NULL) { | ||
230 | strcat(argptr, " ip=any"); | ||
231 | } | ||
232 | #endif | ||
233 | |||
234 | |||
235 | #ifdef CONFIG_FB | ||
236 | { | ||
237 | conswitchp = &dummy_con; | ||
238 | } | ||
239 | #endif | ||
240 | |||
241 | rbtx4938_spi_setup(); | 193 | rbtx4938_spi_setup(); |
242 | pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg); /* updated */ | 194 | pcfg = ____raw_readq(&tx4938_ccfgptr->pcfg); /* updated */ |
243 | /* fixup piosel */ | 195 | /* fixup piosel */ |
@@ -258,11 +210,9 @@ static void __init rbtx4938_mem_setup(void) | |||
258 | rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff; | 210 | rbtx4938_fpga_resource.end = CPHYSADDR(RBTX4938_FPGA_REG_ADDR) + 0xffff; |
259 | rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 211 | rbtx4938_fpga_resource.flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
260 | if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource)) | 212 | if (request_resource(&txx9_ce_res[2], &rbtx4938_fpga_resource)) |
261 | printk("request resource for fpga failed\n"); | 213 | printk(KERN_ERR "request resource for fpga failed\n"); |
262 | 214 | ||
263 | _machine_restart = rbtx4938_machine_restart; | 215 | _machine_restart = rbtx4938_machine_restart; |
264 | _machine_halt = rbtx4938_machine_halt; | ||
265 | pm_power_off = rbtx4938_machine_power_off; | ||
266 | 216 | ||
267 | writeb(0xff, rbtx4938_led_addr); | 217 | writeb(0xff, rbtx4938_led_addr); |
268 | printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", | 218 | printk(KERN_INFO "RBTX4938 --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", |
@@ -270,7 +220,7 @@ static void __init rbtx4938_mem_setup(void) | |||
270 | readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr)); | 220 | readb(rbtx4938_dipsw_addr), readb(rbtx4938_bdipsw_addr)); |
271 | } | 221 | } |
272 | 222 | ||
273 | static int __init rbtx4938_ne_init(void) | 223 | static void __init rbtx4938_ne_init(void) |
274 | { | 224 | { |
275 | struct resource res[] = { | 225 | struct resource res[] = { |
276 | { | 226 | { |
@@ -282,10 +232,7 @@ static int __init rbtx4938_ne_init(void) | |||
282 | .flags = IORESOURCE_IRQ, | 232 | .flags = IORESOURCE_IRQ, |
283 | } | 233 | } |
284 | }; | 234 | }; |
285 | struct platform_device *dev = | 235 | platform_device_register_simple("ne", -1, res, ARRAY_SIZE(res)); |
286 | platform_device_register_simple("ne", -1, | ||
287 | res, ARRAY_SIZE(res)); | ||
288 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
289 | } | 236 | } |
290 | 237 | ||
291 | static DEFINE_SPINLOCK(rbtx4938_spi_gpio_lock); | 238 | static DEFINE_SPINLOCK(rbtx4938_spi_gpio_lock); |
@@ -321,24 +268,6 @@ static struct gpio_chip rbtx4938_spi_gpio_chip = { | |||
321 | .ngpio = 3, | 268 | .ngpio = 3, |
322 | }; | 269 | }; |
323 | 270 | ||
324 | /* SPI support */ | ||
325 | |||
326 | static void __init txx9_spi_init(unsigned long base, int irq) | ||
327 | { | ||
328 | struct resource res[] = { | ||
329 | { | ||
330 | .start = base, | ||
331 | .end = base + 0x20 - 1, | ||
332 | .flags = IORESOURCE_MEM, | ||
333 | }, { | ||
334 | .start = irq, | ||
335 | .flags = IORESOURCE_IRQ, | ||
336 | }, | ||
337 | }; | ||
338 | platform_device_register_simple("spi_txx9", 0, | ||
339 | res, ARRAY_SIZE(res)); | ||
340 | } | ||
341 | |||
342 | static int __init rbtx4938_spi_init(void) | 271 | static int __init rbtx4938_spi_init(void) |
343 | { | 272 | { |
344 | struct spi_board_info srtc_info = { | 273 | struct spi_board_info srtc_info = { |
@@ -361,7 +290,7 @@ static int __init rbtx4938_spi_init(void) | |||
361 | gpio_direction_output(16 + SEEPROM2_CS, 1); | 290 | gpio_direction_output(16 + SEEPROM2_CS, 1); |
362 | gpio_request(16 + SEEPROM3_CS, "seeprom3"); | 291 | gpio_request(16 + SEEPROM3_CS, "seeprom3"); |
363 | gpio_direction_output(16 + SEEPROM3_CS, 1); | 292 | gpio_direction_output(16 + SEEPROM3_CS, 1); |
364 | txx9_spi_init(TX4938_SPI_REG & 0xfffffffffULL, RBTX4938_IRQ_IRC_SPI); | 293 | tx4938_spi_init(0); |
365 | return 0; | 294 | return 0; |
366 | } | 295 | } |
367 | 296 | ||
@@ -372,30 +301,11 @@ static void __init rbtx4938_arch_init(void) | |||
372 | rbtx4938_spi_init(); | 301 | rbtx4938_spi_init(); |
373 | } | 302 | } |
374 | 303 | ||
375 | /* Watchdog support */ | ||
376 | |||
377 | static int __init txx9_wdt_init(unsigned long base) | ||
378 | { | ||
379 | struct resource res = { | ||
380 | .start = base, | ||
381 | .end = base + 0x100 - 1, | ||
382 | .flags = IORESOURCE_MEM, | ||
383 | }; | ||
384 | struct platform_device *dev = | ||
385 | platform_device_register_simple("txx9wdt", -1, &res, 1); | ||
386 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | ||
387 | } | ||
388 | |||
389 | static int __init rbtx4938_wdt_init(void) | ||
390 | { | ||
391 | return txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL); | ||
392 | } | ||
393 | |||
394 | static void __init rbtx4938_device_init(void) | 304 | static void __init rbtx4938_device_init(void) |
395 | { | 305 | { |
396 | rbtx4938_ethaddr_init(); | 306 | rbtx4938_ethaddr_init(); |
397 | rbtx4938_ne_init(); | 307 | rbtx4938_ne_init(); |
398 | rbtx4938_wdt_init(); | 308 | tx4938_wdt_init(); |
399 | } | 309 | } |
400 | 310 | ||
401 | struct txx9_board_vec rbtx4938_vec __initdata = { | 311 | struct txx9_board_vec rbtx4938_vec __initdata = { |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 587da5e0990f..63c9cafda9c4 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -42,6 +42,9 @@ config GENERIC_HARDIRQS | |||
42 | bool | 42 | bool |
43 | default y | 43 | default y |
44 | 44 | ||
45 | config HAVE_GET_USER_PAGES_FAST | ||
46 | def_bool PPC64 | ||
47 | |||
45 | config HAVE_SETUP_PER_CPU_AREA | 48 | config HAVE_SETUP_PER_CPU_AREA |
46 | def_bool PPC64 | 49 | def_bool PPC64 |
47 | 50 | ||
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts index 7345743d3d96..fbc930410ff6 100644 --- a/arch/powerpc/boot/dts/mpc832x_mds.dts +++ b/arch/powerpc/boot/dts/mpc832x_mds.dts | |||
@@ -68,6 +68,7 @@ | |||
68 | #address-cells = <1>; | 68 | #address-cells = <1>; |
69 | #size-cells = <1>; | 69 | #size-cells = <1>; |
70 | device_type = "soc"; | 70 | device_type = "soc"; |
71 | compatible = "simple-bus"; | ||
71 | ranges = <0x0 0xe0000000 0x00100000>; | 72 | ranges = <0x0 0xe0000000 0x00100000>; |
72 | reg = <0xe0000000 0x00000200>; | 73 | reg = <0xe0000000 0x00000200>; |
73 | bus-frequency = <132000000>; | 74 | bus-frequency = <132000000>; |
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts index e74c045a0f8c..b157d1885a28 100644 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts | |||
@@ -51,6 +51,7 @@ | |||
51 | #address-cells = <1>; | 51 | #address-cells = <1>; |
52 | #size-cells = <1>; | 52 | #size-cells = <1>; |
53 | device_type = "soc"; | 53 | device_type = "soc"; |
54 | compatible = "simple-bus"; | ||
54 | ranges = <0x0 0xe0000000 0x00100000>; | 55 | ranges = <0x0 0xe0000000 0x00100000>; |
55 | reg = <0xe0000000 0x00000200>; | 56 | reg = <0xe0000000 0x00000200>; |
56 | bus-frequency = <0>; | 57 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts index 8dfab5662585..700e076ef3f5 100644 --- a/arch/powerpc/boot/dts/mpc8349emitx.dts +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts | |||
@@ -52,6 +52,7 @@ | |||
52 | #address-cells = <1>; | 52 | #address-cells = <1>; |
53 | #size-cells = <1>; | 53 | #size-cells = <1>; |
54 | device_type = "soc"; | 54 | device_type = "soc"; |
55 | compatible = "simple-bus"; | ||
55 | ranges = <0x0 0xe0000000 0x00100000>; | 56 | ranges = <0x0 0xe0000000 0x00100000>; |
56 | reg = <0xe0000000 0x00000200>; | 57 | reg = <0xe0000000 0x00000200>; |
57 | bus-frequency = <0>; // from bootloader | 58 | bus-frequency = <0>; // from bootloader |
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts index 49ca3497eefb..cdd3063258ea 100644 --- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts +++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts | |||
@@ -50,6 +50,7 @@ | |||
50 | #address-cells = <1>; | 50 | #address-cells = <1>; |
51 | #size-cells = <1>; | 51 | #size-cells = <1>; |
52 | device_type = "soc"; | 52 | device_type = "soc"; |
53 | compatible = "simple-bus"; | ||
53 | ranges = <0x0 0xe0000000 0x00100000>; | 54 | ranges = <0x0 0xe0000000 0x00100000>; |
54 | reg = <0xe0000000 0x00000200>; | 55 | reg = <0xe0000000 0x00000200>; |
55 | bus-frequency = <0>; // from bootloader | 56 | bus-frequency = <0>; // from bootloader |
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts index ba586cb7afbb..783241c00240 100644 --- a/arch/powerpc/boot/dts/mpc834x_mds.dts +++ b/arch/powerpc/boot/dts/mpc834x_mds.dts | |||
@@ -57,6 +57,7 @@ | |||
57 | #address-cells = <1>; | 57 | #address-cells = <1>; |
58 | #size-cells = <1>; | 58 | #size-cells = <1>; |
59 | device_type = "soc"; | 59 | device_type = "soc"; |
60 | compatible = "simple-bus"; | ||
60 | ranges = <0x0 0xe0000000 0x00100000>; | 61 | ranges = <0x0 0xe0000000 0x00100000>; |
61 | reg = <0xe0000000 0x00000200>; | 62 | reg = <0xe0000000 0x00000200>; |
62 | bus-frequency = <0>; | 63 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts index 3701dae1ee02..a3b76a709951 100644 --- a/arch/powerpc/boot/dts/mpc836x_mds.dts +++ b/arch/powerpc/boot/dts/mpc836x_mds.dts | |||
@@ -61,6 +61,7 @@ | |||
61 | #address-cells = <1>; | 61 | #address-cells = <1>; |
62 | #size-cells = <1>; | 62 | #size-cells = <1>; |
63 | device_type = "soc"; | 63 | device_type = "soc"; |
64 | compatible = "simple-bus"; | ||
64 | ranges = <0x0 0xe0000000 0x00100000>; | 65 | ranges = <0x0 0xe0000000 0x00100000>; |
65 | reg = <0xe0000000 0x00000200>; | 66 | reg = <0xe0000000 0x00000200>; |
66 | bus-frequency = <264000000>; | 67 | bus-frequency = <264000000>; |
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts index 8acd1d6577f2..89c9202f8bd7 100644 --- a/arch/powerpc/boot/dts/mpc836x_rdk.dts +++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts | |||
@@ -149,18 +149,14 @@ | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | crypto@30000 { | 151 | crypto@30000 { |
152 | compatible = "fsl,sec2-crypto"; | 152 | compatible = "fsl,sec2.0"; |
153 | reg = <0x30000 0x10000>; | 153 | reg = <0x30000 0x10000>; |
154 | interrupts = <11 8>; | 154 | interrupts = <11 0x8>; |
155 | interrupt-parent = <&ipic>; | 155 | interrupt-parent = <&ipic>; |
156 | num-channels = <4>; | 156 | fsl,num-channels = <4>; |
157 | channel-fifo-len = <24>; | 157 | fsl,channel-fifo-len = <24>; |
158 | exec-units-mask = <0x7e>; | 158 | fsl,exec-units-mask = <0x7e>; |
159 | /* | 159 | fsl,descriptor-types-mask = <0x01010ebf>; |
160 | * desc mask is for rev1.x, we need runtime fixup | ||
161 | * for >=2.x | ||
162 | */ | ||
163 | descriptor-types-mask = <0x1010ebf>; | ||
164 | }; | 160 | }; |
165 | 161 | ||
166 | ipic: interrupt-controller@700 { | 162 | ipic: interrupt-controller@700 { |
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts index 0a700cb5f611..432782b6d20a 100644 --- a/arch/powerpc/boot/dts/mpc8377_mds.dts +++ b/arch/powerpc/boot/dts/mpc8377_mds.dts | |||
@@ -117,6 +117,7 @@ | |||
117 | #address-cells = <1>; | 117 | #address-cells = <1>; |
118 | #size-cells = <1>; | 118 | #size-cells = <1>; |
119 | device_type = "soc"; | 119 | device_type = "soc"; |
120 | compatible = "simple-bus"; | ||
120 | ranges = <0x0 0xe0000000 0x00100000>; | 121 | ranges = <0x0 0xe0000000 0x00100000>; |
121 | reg = <0xe0000000 0x00000200>; | 122 | reg = <0xe0000000 0x00000200>; |
122 | bus-frequency = <0>; | 123 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts index 29c8c76a58f7..ed32c8ddafe3 100644 --- a/arch/powerpc/boot/dts/mpc8378_mds.dts +++ b/arch/powerpc/boot/dts/mpc8378_mds.dts | |||
@@ -117,6 +117,7 @@ | |||
117 | #address-cells = <1>; | 117 | #address-cells = <1>; |
118 | #size-cells = <1>; | 118 | #size-cells = <1>; |
119 | device_type = "soc"; | 119 | device_type = "soc"; |
120 | compatible = "simple-bus"; | ||
120 | ranges = <0x0 0xe0000000 0x00100000>; | 121 | ranges = <0x0 0xe0000000 0x00100000>; |
121 | reg = <0xe0000000 0x00000200>; | 122 | reg = <0xe0000000 0x00000200>; |
122 | bus-frequency = <0>; | 123 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts index d641a8985ea3..f4db9ed4a301 100644 --- a/arch/powerpc/boot/dts/mpc8379_mds.dts +++ b/arch/powerpc/boot/dts/mpc8379_mds.dts | |||
@@ -117,6 +117,7 @@ | |||
117 | #address-cells = <1>; | 117 | #address-cells = <1>; |
118 | #size-cells = <1>; | 118 | #size-cells = <1>; |
119 | device_type = "soc"; | 119 | device_type = "soc"; |
120 | compatible = "simple-bus"; | ||
120 | ranges = <0x0 0xe0000000 0x00100000>; | 121 | ranges = <0x0 0xe0000000 0x00100000>; |
121 | reg = <0xe0000000 0x00000200>; | 122 | reg = <0xe0000000 0x00000200>; |
122 | bus-frequency = <0>; | 123 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts index 02cfa24a1695..1505d6855eff 100644 --- a/arch/powerpc/boot/dts/mpc8536ds.dts +++ b/arch/powerpc/boot/dts/mpc8536ds.dts | |||
@@ -49,6 +49,7 @@ | |||
49 | #address-cells = <1>; | 49 | #address-cells = <1>; |
50 | #size-cells = <1>; | 50 | #size-cells = <1>; |
51 | device_type = "soc"; | 51 | device_type = "soc"; |
52 | compatible = "simple-bus"; | ||
52 | ranges = <0x0 0xffe00000 0x100000>; | 53 | ranges = <0x0 0xffe00000 0x100000>; |
53 | reg = <0xffe00000 0x1000>; | 54 | reg = <0xffe00000 0x1000>; |
54 | bus-frequency = <0>; // Filled out by uboot. | 55 | bus-frequency = <0>; // Filled out by uboot. |
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts index f2273a872b11..9568bfaff8f7 100644 --- a/arch/powerpc/boot/dts/mpc8540ads.dts +++ b/arch/powerpc/boot/dts/mpc8540ads.dts | |||
@@ -53,6 +53,7 @@ | |||
53 | #address-cells = <1>; | 53 | #address-cells = <1>; |
54 | #size-cells = <1>; | 54 | #size-cells = <1>; |
55 | device_type = "soc"; | 55 | device_type = "soc"; |
56 | compatible = "simple-bus"; | ||
56 | ranges = <0x0 0xe0000000 0x100000>; | 57 | ranges = <0x0 0xe0000000 0x100000>; |
57 | reg = <0xe0000000 0x100000>; // CCSRBAR 1M | 58 | reg = <0xe0000000 0x100000>; // CCSRBAR 1M |
58 | bus-frequency = <0>; | 59 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts index c4469f19ff82..6480f4fd96e0 100644 --- a/arch/powerpc/boot/dts/mpc8541cds.dts +++ b/arch/powerpc/boot/dts/mpc8541cds.dts | |||
@@ -53,6 +53,7 @@ | |||
53 | #address-cells = <1>; | 53 | #address-cells = <1>; |
54 | #size-cells = <1>; | 54 | #size-cells = <1>; |
55 | device_type = "soc"; | 55 | device_type = "soc"; |
56 | compatible = "simple-bus"; | ||
56 | ranges = <0x0 0xe0000000 0x100000>; | 57 | ranges = <0x0 0xe0000000 0x100000>; |
57 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M | 58 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M |
58 | bus-frequency = <0>; | 59 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts index 7d3829d3495e..f1fb20737e3e 100644 --- a/arch/powerpc/boot/dts/mpc8544ds.dts +++ b/arch/powerpc/boot/dts/mpc8544ds.dts | |||
@@ -54,6 +54,7 @@ | |||
54 | #address-cells = <1>; | 54 | #address-cells = <1>; |
55 | #size-cells = <1>; | 55 | #size-cells = <1>; |
56 | device_type = "soc"; | 56 | device_type = "soc"; |
57 | compatible = "simple-bus"; | ||
57 | 58 | ||
58 | ranges = <0x0 0xe0000000 0x100000>; | 59 | ranges = <0x0 0xe0000000 0x100000>; |
59 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M | 60 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M |
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts index d84466bb7eca..431b496270dc 100644 --- a/arch/powerpc/boot/dts/mpc8548cds.dts +++ b/arch/powerpc/boot/dts/mpc8548cds.dts | |||
@@ -58,6 +58,7 @@ | |||
58 | #address-cells = <1>; | 58 | #address-cells = <1>; |
59 | #size-cells = <1>; | 59 | #size-cells = <1>; |
60 | device_type = "soc"; | 60 | device_type = "soc"; |
61 | compatible = "simple-bus"; | ||
61 | ranges = <0x0 0xe0000000 0x100000>; | 62 | ranges = <0x0 0xe0000000 0x100000>; |
62 | reg = <0xe0000000 0x1000>; // CCSRBAR | 63 | reg = <0xe0000000 0x1000>; // CCSRBAR |
63 | bus-frequency = <0>; | 64 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts index e03a78006283..d833a5c4f476 100644 --- a/arch/powerpc/boot/dts/mpc8555cds.dts +++ b/arch/powerpc/boot/dts/mpc8555cds.dts | |||
@@ -53,6 +53,7 @@ | |||
53 | #address-cells = <1>; | 53 | #address-cells = <1>; |
54 | #size-cells = <1>; | 54 | #size-cells = <1>; |
55 | device_type = "soc"; | 55 | device_type = "soc"; |
56 | compatible = "simple-bus"; | ||
56 | ranges = <0x0 0xe0000000 0x100000>; | 57 | ranges = <0x0 0xe0000000 0x100000>; |
57 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M | 58 | reg = <0xe0000000 0x1000>; // CCSRBAR 1M |
58 | bus-frequency = <0>; | 59 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts index ba8159de040b..4d1f2f284094 100644 --- a/arch/powerpc/boot/dts/mpc8560ads.dts +++ b/arch/powerpc/boot/dts/mpc8560ads.dts | |||
@@ -53,6 +53,7 @@ | |||
53 | #address-cells = <1>; | 53 | #address-cells = <1>; |
54 | #size-cells = <1>; | 54 | #size-cells = <1>; |
55 | device_type = "soc"; | 55 | device_type = "soc"; |
56 | compatible = "simple-bus"; | ||
56 | ranges = <0x0 0xe0000000 0x100000>; | 57 | ranges = <0x0 0xe0000000 0x100000>; |
57 | reg = <0xe0000000 0x200>; | 58 | reg = <0xe0000000 0x200>; |
58 | bus-frequency = <330000000>; | 59 | bus-frequency = <330000000>; |
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts index 9c30a34821dc..a15f10343f53 100644 --- a/arch/powerpc/boot/dts/mpc8568mds.dts +++ b/arch/powerpc/boot/dts/mpc8568mds.dts | |||
@@ -60,6 +60,7 @@ | |||
60 | #address-cells = <1>; | 60 | #address-cells = <1>; |
61 | #size-cells = <1>; | 61 | #size-cells = <1>; |
62 | device_type = "soc"; | 62 | device_type = "soc"; |
63 | compatible = "simple-bus"; | ||
63 | ranges = <0x0 0xe0000000 0x100000>; | 64 | ranges = <0x0 0xe0000000 0x100000>; |
64 | reg = <0xe0000000 0x1000>; | 65 | reg = <0xe0000000 0x1000>; |
65 | bus-frequency = <0>; | 66 | bus-frequency = <0>; |
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts index 08c61e3daecc..e124dd18fb5a 100644 --- a/arch/powerpc/boot/dts/mpc8572ds.dts +++ b/arch/powerpc/boot/dts/mpc8572ds.dts | |||
@@ -68,6 +68,7 @@ | |||
68 | #address-cells = <1>; | 68 | #address-cells = <1>; |
69 | #size-cells = <1>; | 69 | #size-cells = <1>; |
70 | device_type = "soc"; | 70 | device_type = "soc"; |
71 | compatible = "simple-bus"; | ||
71 | ranges = <0x0 0xffe00000 0x100000>; | 72 | ranges = <0x0 0xffe00000 0x100000>; |
72 | reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed | 73 | reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed |
73 | bus-frequency = <0>; // Filled out by uboot. | 74 | bus-frequency = <0>; // Filled out by uboot. |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 9f856a0c3e38..1a09719c7628 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -636,10 +636,6 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf, | |||
636 | retval = -EIO; | 636 | retval = -EIO; |
637 | } else if (retval == H_PARAMETER) { | 637 | } else if (retval == H_PARAMETER) { |
638 | retval = -EINVAL; | 638 | retval = -EINVAL; |
639 | } else { | ||
640 | printk(KERN_WARNING "%s: received unknown hv return code %ld", | ||
641 | __func__, retval); | ||
642 | retval = -EIO; | ||
643 | } | 639 | } |
644 | 640 | ||
645 | return retval; | 641 | return retval; |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 6b66cd85b433..3635be61f899 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -375,7 +375,7 @@ static int vsr_get(struct task_struct *target, const struct user_regset *regset, | |||
375 | flush_vsx_to_thread(target); | 375 | flush_vsx_to_thread(target); |
376 | 376 | ||
377 | for (i = 0; i < 32 ; i++) | 377 | for (i = 0; i < 32 ; i++) |
378 | buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET]; | 378 | buf[i] = target->thread.fpr[i][TS_VSRLOWOFFSET]; |
379 | ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, | 379 | ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, |
380 | buf, 0, 32 * sizeof(double)); | 380 | buf, 0, 32 * sizeof(double)); |
381 | 381 | ||
@@ -394,7 +394,7 @@ static int vsr_set(struct task_struct *target, const struct user_regset *regset, | |||
394 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, | 394 | ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, |
395 | buf, 0, 32 * sizeof(double)); | 395 | buf, 0, 32 * sizeof(double)); |
396 | for (i = 0; i < 32 ; i++) | 396 | for (i = 0; i < 32 ; i++) |
397 | current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i]; | 397 | target->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i]; |
398 | 398 | ||
399 | 399 | ||
400 | return ret; | 400 | return ret; |
@@ -975,15 +975,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
975 | case PTRACE_GETVSRREGS: | 975 | case PTRACE_GETVSRREGS: |
976 | return copy_regset_to_user(child, &user_ppc_native_view, | 976 | return copy_regset_to_user(child, &user_ppc_native_view, |
977 | REGSET_VSX, | 977 | REGSET_VSX, |
978 | 0, (32 * sizeof(vector128) + | 978 | 0, 32 * sizeof(double), |
979 | sizeof(u32)), | ||
980 | (void __user *) data); | 979 | (void __user *) data); |
981 | 980 | ||
982 | case PTRACE_SETVSRREGS: | 981 | case PTRACE_SETVSRREGS: |
983 | return copy_regset_from_user(child, &user_ppc_native_view, | 982 | return copy_regset_from_user(child, &user_ppc_native_view, |
984 | REGSET_VSX, | 983 | REGSET_VSX, |
985 | 0, (32 * sizeof(vector128) + | 984 | 0, 32 * sizeof(double), |
986 | sizeof(u32)), | ||
987 | (const void __user *) data); | 985 | (const void __user *) data); |
988 | #endif | 986 | #endif |
989 | #ifdef CONFIG_SPE | 987 | #ifdef CONFIG_SPE |
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c index 67bf1a1e7e14..197d49c790ad 100644 --- a/arch/powerpc/kernel/ptrace32.c +++ b/arch/powerpc/kernel/ptrace32.c | |||
@@ -294,6 +294,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
294 | case PTRACE_SETFPREGS: | 294 | case PTRACE_SETFPREGS: |
295 | case PTRACE_GETVRREGS: | 295 | case PTRACE_GETVRREGS: |
296 | case PTRACE_SETVRREGS: | 296 | case PTRACE_SETVRREGS: |
297 | case PTRACE_GETVSRREGS: | ||
298 | case PTRACE_SETVSRREGS: | ||
297 | case PTRACE_GETREGS64: | 299 | case PTRACE_GETREGS64: |
298 | case PTRACE_SETREGS64: | 300 | case PTRACE_SETREGS64: |
299 | case PPC_PTRACE_GETFPREGS: | 301 | case PPC_PTRACE_GETFPREGS: |
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile index 1c00e0196f6c..e7392b45a5ef 100644 --- a/arch/powerpc/mm/Makefile +++ b/arch/powerpc/mm/Makefile | |||
@@ -12,7 +12,8 @@ obj-y := fault.o mem.o \ | |||
12 | mmu_context_$(CONFIG_WORD_SIZE).o | 12 | mmu_context_$(CONFIG_WORD_SIZE).o |
13 | hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o | 13 | hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o |
14 | obj-$(CONFIG_PPC64) += hash_utils_64.o \ | 14 | obj-$(CONFIG_PPC64) += hash_utils_64.o \ |
15 | slb_low.o slb.o stab.o mmap.o $(hash-y) | 15 | slb_low.o slb.o stab.o \ |
16 | gup.o mmap.o $(hash-y) | ||
16 | obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o | 17 | obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o |
17 | obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ | 18 | obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ |
18 | tlb_$(CONFIG_WORD_SIZE).o | 19 | tlb_$(CONFIG_WORD_SIZE).o |
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c new file mode 100644 index 000000000000..9fdf4d6335e4 --- /dev/null +++ b/arch/powerpc/mm/gup.c | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | * Lockless get_user_pages_fast for powerpc | ||
3 | * | ||
4 | * Copyright (C) 2008 Nick Piggin | ||
5 | * Copyright (C) 2008 Novell Inc. | ||
6 | */ | ||
7 | #undef DEBUG | ||
8 | |||
9 | #include <linux/sched.h> | ||
10 | #include <linux/mm.h> | ||
11 | #include <linux/hugetlb.h> | ||
12 | #include <linux/vmstat.h> | ||
13 | #include <linux/pagemap.h> | ||
14 | #include <linux/rwsem.h> | ||
15 | #include <asm/pgtable.h> | ||
16 | |||
17 | /* | ||
18 | * The performance critical leaf functions are made noinline otherwise gcc | ||
19 | * inlines everything into a single function which results in too much | ||
20 | * register pressure. | ||
21 | */ | ||
22 | static noinline int gup_pte_range(pmd_t pmd, unsigned long addr, | ||
23 | unsigned long end, int write, struct page **pages, int *nr) | ||
24 | { | ||
25 | unsigned long mask, result; | ||
26 | pte_t *ptep; | ||
27 | |||
28 | result = _PAGE_PRESENT|_PAGE_USER; | ||
29 | if (write) | ||
30 | result |= _PAGE_RW; | ||
31 | mask = result | _PAGE_SPECIAL; | ||
32 | |||
33 | ptep = pte_offset_kernel(&pmd, addr); | ||
34 | do { | ||
35 | pte_t pte = *ptep; | ||
36 | struct page *page; | ||
37 | |||
38 | if ((pte_val(pte) & mask) != result) | ||
39 | return 0; | ||
40 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); | ||
41 | page = pte_page(pte); | ||
42 | if (!page_cache_get_speculative(page)) | ||
43 | return 0; | ||
44 | if (unlikely(pte != *ptep)) { | ||
45 | put_page(page); | ||
46 | return 0; | ||
47 | } | ||
48 | pages[*nr] = page; | ||
49 | (*nr)++; | ||
50 | |||
51 | } while (ptep++, addr += PAGE_SIZE, addr != end); | ||
52 | |||
53 | return 1; | ||
54 | } | ||
55 | |||
56 | #ifdef CONFIG_HUGETLB_PAGE | ||
57 | static noinline int gup_huge_pte(pte_t *ptep, struct hstate *hstate, | ||
58 | unsigned long *addr, unsigned long end, | ||
59 | int write, struct page **pages, int *nr) | ||
60 | { | ||
61 | unsigned long mask; | ||
62 | unsigned long pte_end; | ||
63 | struct page *head, *page; | ||
64 | pte_t pte; | ||
65 | int refs; | ||
66 | |||
67 | pte_end = (*addr + huge_page_size(hstate)) & huge_page_mask(hstate); | ||
68 | if (pte_end < end) | ||
69 | end = pte_end; | ||
70 | |||
71 | pte = *ptep; | ||
72 | mask = _PAGE_PRESENT|_PAGE_USER; | ||
73 | if (write) | ||
74 | mask |= _PAGE_RW; | ||
75 | if ((pte_val(pte) & mask) != mask) | ||
76 | return 0; | ||
77 | /* hugepages are never "special" */ | ||
78 | VM_BUG_ON(!pfn_valid(pte_pfn(pte))); | ||
79 | |||
80 | refs = 0; | ||
81 | head = pte_page(pte); | ||
82 | page = head + ((*addr & ~huge_page_mask(hstate)) >> PAGE_SHIFT); | ||
83 | do { | ||
84 | VM_BUG_ON(compound_head(page) != head); | ||
85 | pages[*nr] = page; | ||
86 | (*nr)++; | ||
87 | page++; | ||
88 | refs++; | ||
89 | } while (*addr += PAGE_SIZE, *addr != end); | ||
90 | |||
91 | if (!page_cache_add_speculative(head, refs)) { | ||
92 | *nr -= refs; | ||
93 | return 0; | ||
94 | } | ||
95 | if (unlikely(pte != *ptep)) { | ||
96 | /* Could be optimized better */ | ||
97 | while (*nr) { | ||
98 | put_page(page); | ||
99 | (*nr)--; | ||
100 | } | ||
101 | } | ||
102 | |||
103 | return 1; | ||
104 | } | ||
105 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
106 | |||
107 | static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end, | ||
108 | int write, struct page **pages, int *nr) | ||
109 | { | ||
110 | unsigned long next; | ||
111 | pmd_t *pmdp; | ||
112 | |||
113 | pmdp = pmd_offset(&pud, addr); | ||
114 | do { | ||
115 | pmd_t pmd = *pmdp; | ||
116 | |||
117 | next = pmd_addr_end(addr, end); | ||
118 | if (pmd_none(pmd)) | ||
119 | return 0; | ||
120 | if (!gup_pte_range(pmd, addr, next, write, pages, nr)) | ||
121 | return 0; | ||
122 | } while (pmdp++, addr = next, addr != end); | ||
123 | |||
124 | return 1; | ||
125 | } | ||
126 | |||
127 | static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end, | ||
128 | int write, struct page **pages, int *nr) | ||
129 | { | ||
130 | unsigned long next; | ||
131 | pud_t *pudp; | ||
132 | |||
133 | pudp = pud_offset(&pgd, addr); | ||
134 | do { | ||
135 | pud_t pud = *pudp; | ||
136 | |||
137 | next = pud_addr_end(addr, end); | ||
138 | if (pud_none(pud)) | ||
139 | return 0; | ||
140 | if (!gup_pmd_range(pud, addr, next, write, pages, nr)) | ||
141 | return 0; | ||
142 | } while (pudp++, addr = next, addr != end); | ||
143 | |||
144 | return 1; | ||
145 | } | ||
146 | |||
147 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
148 | struct page **pages) | ||
149 | { | ||
150 | struct mm_struct *mm = current->mm; | ||
151 | unsigned long addr, len, end; | ||
152 | unsigned long next; | ||
153 | pgd_t *pgdp; | ||
154 | int psize, nr = 0; | ||
155 | unsigned int shift; | ||
156 | |||
157 | pr_debug("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read"); | ||
158 | |||
159 | start &= PAGE_MASK; | ||
160 | addr = start; | ||
161 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
162 | end = start + len; | ||
163 | |||
164 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | ||
165 | start, len))) | ||
166 | goto slow_irqon; | ||
167 | |||
168 | pr_debug(" aligned: %lx .. %lx\n", start, end); | ||
169 | |||
170 | #ifdef CONFIG_HUGETLB_PAGE | ||
171 | /* We bail out on slice boundary crossing when hugetlb is | ||
172 | * enabled in order to not have to deal with two different | ||
173 | * page table formats | ||
174 | */ | ||
175 | if (addr < SLICE_LOW_TOP) { | ||
176 | if (end > SLICE_LOW_TOP) | ||
177 | goto slow_irqon; | ||
178 | |||
179 | if (unlikely(GET_LOW_SLICE_INDEX(addr) != | ||
180 | GET_LOW_SLICE_INDEX(end - 1))) | ||
181 | goto slow_irqon; | ||
182 | } else { | ||
183 | if (unlikely(GET_HIGH_SLICE_INDEX(addr) != | ||
184 | GET_HIGH_SLICE_INDEX(end - 1))) | ||
185 | goto slow_irqon; | ||
186 | } | ||
187 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
188 | |||
189 | /* | ||
190 | * XXX: batch / limit 'nr', to avoid large irq off latency | ||
191 | * needs some instrumenting to determine the common sizes used by | ||
192 | * important workloads (eg. DB2), and whether limiting the batch size | ||
193 | * will decrease performance. | ||
194 | * | ||
195 | * It seems like we're in the clear for the moment. Direct-IO is | ||
196 | * the main guy that batches up lots of get_user_pages, and even | ||
197 | * they are limited to 64-at-a-time which is not so many. | ||
198 | */ | ||
199 | /* | ||
200 | * This doesn't prevent pagetable teardown, but does prevent | ||
201 | * the pagetables from being freed on powerpc. | ||
202 | * | ||
203 | * So long as we atomically load page table pointers versus teardown, | ||
204 | * we can follow the address down to the the page and take a ref on it. | ||
205 | */ | ||
206 | local_irq_disable(); | ||
207 | |||
208 | psize = get_slice_psize(mm, addr); | ||
209 | shift = mmu_psize_defs[psize].shift; | ||
210 | |||
211 | #ifdef CONFIG_HUGETLB_PAGE | ||
212 | if (unlikely(mmu_huge_psizes[psize])) { | ||
213 | pte_t *ptep; | ||
214 | unsigned long a = addr; | ||
215 | unsigned long sz = ((1UL) << shift); | ||
216 | struct hstate *hstate = size_to_hstate(sz); | ||
217 | |||
218 | BUG_ON(!hstate); | ||
219 | /* | ||
220 | * XXX: could be optimized to avoid hstate | ||
221 | * lookup entirely (just use shift) | ||
222 | */ | ||
223 | |||
224 | do { | ||
225 | VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, a)].shift); | ||
226 | ptep = huge_pte_offset(mm, a); | ||
227 | pr_debug(" %016lx: huge ptep %p\n", a, ptep); | ||
228 | if (!ptep || !gup_huge_pte(ptep, hstate, &a, end, write, pages, | ||
229 | &nr)) | ||
230 | goto slow; | ||
231 | } while (a != end); | ||
232 | } else | ||
233 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
234 | { | ||
235 | pgdp = pgd_offset(mm, addr); | ||
236 | do { | ||
237 | pgd_t pgd = *pgdp; | ||
238 | |||
239 | VM_BUG_ON(shift != mmu_psize_defs[get_slice_psize(mm, addr)].shift); | ||
240 | pr_debug(" %016lx: normal pgd %p\n", addr, (void *)pgd); | ||
241 | next = pgd_addr_end(addr, end); | ||
242 | if (pgd_none(pgd)) | ||
243 | goto slow; | ||
244 | if (!gup_pud_range(pgd, addr, next, write, pages, &nr)) | ||
245 | goto slow; | ||
246 | } while (pgdp++, addr = next, addr != end); | ||
247 | } | ||
248 | local_irq_enable(); | ||
249 | |||
250 | VM_BUG_ON(nr != (end - start) >> PAGE_SHIFT); | ||
251 | return nr; | ||
252 | |||
253 | { | ||
254 | int ret; | ||
255 | |||
256 | slow: | ||
257 | local_irq_enable(); | ||
258 | slow_irqon: | ||
259 | pr_debug(" slow path ! nr = %d\n", nr); | ||
260 | |||
261 | /* Try to get the remaining pages with get_user_pages */ | ||
262 | start += nr << PAGE_SHIFT; | ||
263 | pages += nr; | ||
264 | |||
265 | down_read(&mm->mmap_sem); | ||
266 | ret = get_user_pages(current, mm, start, | ||
267 | (end - start) >> PAGE_SHIFT, write, 0, pages, NULL); | ||
268 | up_read(&mm->mmap_sem); | ||
269 | |||
270 | /* Have to be a bit careful with return values */ | ||
271 | if (nr > 0) { | ||
272 | if (ret < 0) | ||
273 | ret = nr; | ||
274 | else | ||
275 | ret += nr; | ||
276 | } | ||
277 | |||
278 | return ret; | ||
279 | } | ||
280 | } | ||
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index dd4be4aee314..ec43477caa63 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -105,6 +105,7 @@ static void __init mpc832x_sys_setup_arch(void) | |||
105 | static struct of_device_id mpc832x_ids[] = { | 105 | static struct of_device_id mpc832x_ids[] = { |
106 | { .type = "soc", }, | 106 | { .type = "soc", }, |
107 | { .compatible = "soc", }, | 107 | { .compatible = "soc", }, |
108 | { .compatible = "simple-bus", }, | ||
108 | { .type = "qe", }, | 109 | { .type = "qe", }, |
109 | { .compatible = "fsl,qe", }, | 110 | { .compatible = "fsl,qe", }, |
110 | {}, | 111 | {}, |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index f049d692d4c8..0300268ce5b8 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | |||
@@ -115,6 +115,7 @@ static void __init mpc832x_rdb_setup_arch(void) | |||
115 | static struct of_device_id mpc832x_ids[] = { | 115 | static struct of_device_id mpc832x_ids[] = { |
116 | { .type = "soc", }, | 116 | { .type = "soc", }, |
117 | { .compatible = "soc", }, | 117 | { .compatible = "soc", }, |
118 | { .compatible = "simple-bus", }, | ||
118 | { .type = "qe", }, | 119 | { .type = "qe", }, |
119 | { .compatible = "fsl,qe", }, | 120 | { .compatible = "fsl,qe", }, |
120 | {}, | 121 | {}, |
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c index 7301d77a08ee..76092d37c7d9 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c | |||
@@ -41,6 +41,7 @@ | |||
41 | 41 | ||
42 | static struct of_device_id __initdata mpc834x_itx_ids[] = { | 42 | static struct of_device_id __initdata mpc834x_itx_ids[] = { |
43 | { .compatible = "fsl,pq2pro-localbus", }, | 43 | { .compatible = "fsl,pq2pro-localbus", }, |
44 | { .compatible = "simple-bus", }, | ||
44 | {}, | 45 | {}, |
45 | }; | 46 | }; |
46 | 47 | ||
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c index 30d509aa9f08..fc3f2ed1f3e9 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c | |||
@@ -111,6 +111,7 @@ static void __init mpc834x_mds_init_IRQ(void) | |||
111 | static struct of_device_id mpc834x_ids[] = { | 111 | static struct of_device_id mpc834x_ids[] = { |
112 | { .type = "soc", }, | 112 | { .type = "soc", }, |
113 | { .compatible = "soc", }, | 113 | { .compatible = "soc", }, |
114 | { .compatible = "simple-bus", }, | ||
114 | {}, | 115 | {}, |
115 | }; | 116 | }; |
116 | 117 | ||
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 75b80e836576..9d46e5bdd101 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c | |||
@@ -136,6 +136,7 @@ static void __init mpc836x_mds_setup_arch(void) | |||
136 | static struct of_device_id mpc836x_ids[] = { | 136 | static struct of_device_id mpc836x_ids[] = { |
137 | { .type = "soc", }, | 137 | { .type = "soc", }, |
138 | { .compatible = "soc", }, | 138 | { .compatible = "soc", }, |
139 | { .compatible = "simple-bus", }, | ||
139 | { .type = "qe", }, | 140 | { .type = "qe", }, |
140 | { .compatible = "fsl,qe", }, | 141 | { .compatible = "fsl,qe", }, |
141 | {}, | 142 | {}, |
diff --git a/arch/powerpc/platforms/83xx/sbc834x.c b/arch/powerpc/platforms/83xx/sbc834x.c index fc21f5c15bab..156c4e218009 100644 --- a/arch/powerpc/platforms/83xx/sbc834x.c +++ b/arch/powerpc/platforms/83xx/sbc834x.c | |||
@@ -83,6 +83,7 @@ static void __init sbc834x_init_IRQ(void) | |||
83 | static struct __initdata of_device_id sbc834x_ids[] = { | 83 | static struct __initdata of_device_id sbc834x_ids[] = { |
84 | { .type = "soc", }, | 84 | { .type = "soc", }, |
85 | { .compatible = "soc", }, | 85 | { .compatible = "soc", }, |
86 | { .compatible = "simple-bus", }, | ||
86 | {}, | 87 | {}, |
87 | }; | 88 | }; |
88 | 89 | ||
diff --git a/arch/powerpc/platforms/85xx/ksi8560.c b/arch/powerpc/platforms/85xx/ksi8560.c index 2145adeb220c..8a3b117b6ce2 100644 --- a/arch/powerpc/platforms/85xx/ksi8560.c +++ b/arch/powerpc/platforms/85xx/ksi8560.c | |||
@@ -222,6 +222,7 @@ static void ksi8560_show_cpuinfo(struct seq_file *m) | |||
222 | 222 | ||
223 | static struct of_device_id __initdata of_bus_ids[] = { | 223 | static struct of_device_id __initdata of_bus_ids[] = { |
224 | { .type = "soc", }, | 224 | { .type = "soc", }, |
225 | { .type = "simple-bus", }, | ||
225 | { .name = "cpm", }, | 226 | { .name = "cpm", }, |
226 | { .name = "localbus", }, | 227 | { .name = "localbus", }, |
227 | {}, | 228 | {}, |
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c index 6b846aa1ced9..1bf5aefdfeb1 100644 --- a/arch/powerpc/platforms/85xx/mpc8536_ds.c +++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c | |||
@@ -91,6 +91,7 @@ static void __init mpc8536_ds_setup_arch(void) | |||
91 | static struct of_device_id __initdata mpc8536_ds_ids[] = { | 91 | static struct of_device_id __initdata mpc8536_ds_ids[] = { |
92 | { .type = "soc", }, | 92 | { .type = "soc", }, |
93 | { .compatible = "soc", }, | 93 | { .compatible = "soc", }, |
94 | { .compatible = "simple-bus", }, | ||
94 | {}, | 95 | {}, |
95 | }; | 96 | }; |
96 | 97 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c index ba498d6f2d02..d17807a6b89a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c | |||
@@ -230,6 +230,7 @@ static struct of_device_id __initdata of_bus_ids[] = { | |||
230 | { .type = "soc", }, | 230 | { .type = "soc", }, |
231 | { .name = "cpm", }, | 231 | { .name = "cpm", }, |
232 | { .name = "localbus", }, | 232 | { .name = "localbus", }, |
233 | { .compatible = "simple-bus", }, | ||
233 | {}, | 234 | {}, |
234 | }; | 235 | }; |
235 | 236 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index 00c535806647..483b65cbabae 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -186,6 +186,7 @@ static int __init mpc8544_ds_probe(void) | |||
186 | static struct of_device_id __initdata mpc85xxds_ids[] = { | 186 | static struct of_device_id __initdata mpc85xxds_ids[] = { |
187 | { .type = "soc", }, | 187 | { .type = "soc", }, |
188 | { .compatible = "soc", }, | 188 | { .compatible = "soc", }, |
189 | { .compatible = "simple-bus", }, | ||
189 | {}, | 190 | {}, |
190 | }; | 191 | }; |
191 | 192 | ||
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 43a459f63e31..2494c5155919 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -260,6 +260,7 @@ machine_arch_initcall(mpc85xx_mds, board_fixups); | |||
260 | static struct of_device_id mpc85xx_ids[] = { | 260 | static struct of_device_id mpc85xx_ids[] = { |
261 | { .type = "soc", }, | 261 | { .type = "soc", }, |
262 | { .compatible = "soc", }, | 262 | { .compatible = "soc", }, |
263 | { .compatible = "simple-bus", }, | ||
263 | { .type = "qe", }, | 264 | { .type = "qe", }, |
264 | { .compatible = "fsl,qe", }, | 265 | { .compatible = "fsl,qe", }, |
265 | {}, | 266 | {}, |
diff --git a/arch/powerpc/platforms/85xx/sbc8560.c b/arch/powerpc/platforms/85xx/sbc8560.c index 2c580cd24e4f..6509ade71668 100644 --- a/arch/powerpc/platforms/85xx/sbc8560.c +++ b/arch/powerpc/platforms/85xx/sbc8560.c | |||
@@ -217,6 +217,7 @@ static struct of_device_id __initdata of_bus_ids[] = { | |||
217 | { .type = "soc", }, | 217 | { .type = "soc", }, |
218 | { .name = "cpm", }, | 218 | { .name = "cpm", }, |
219 | { .name = "localbus", }, | 219 | { .name = "localbus", }, |
220 | { .compatible = "simple-bus", }, | ||
220 | {}, | 221 | {}, |
221 | }; | 222 | }; |
222 | 223 | ||
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig index 6fc849e51e48..71d7562e190b 100644 --- a/arch/powerpc/platforms/8xx/Kconfig +++ b/arch/powerpc/platforms/8xx/Kconfig | |||
@@ -105,6 +105,16 @@ config 8xx_COPYBACK | |||
105 | 105 | ||
106 | If in doubt, say Y here. | 106 | If in doubt, say Y here. |
107 | 107 | ||
108 | config 8xx_GPIO | ||
109 | bool "GPIO API Support" | ||
110 | select GENERIC_GPIO | ||
111 | select ARCH_REQUIRE_GPIOLIB | ||
112 | help | ||
113 | Saying Y here will cause the ports on an MPC8xx processor to be used | ||
114 | with the GPIO API. If you say N here, the kernel needs less memory. | ||
115 | |||
116 | If in doubt, say Y here. | ||
117 | |||
108 | config 8xx_CPU6 | 118 | config 8xx_CPU6 |
109 | bool "CPU6 Silicon Errata (860 Pre Rev. C)" | 119 | bool "CPU6 Silicon Errata (860 Pre Rev. C)" |
110 | help | 120 | help |
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 1d0968775c0a..4c900efa164e 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig | |||
@@ -254,6 +254,8 @@ config CPM2 | |||
254 | select CPM | 254 | select CPM |
255 | select PPC_LIB_RHEAP | 255 | select PPC_LIB_RHEAP |
256 | select PPC_PCI_CHOICE | 256 | select PPC_PCI_CHOICE |
257 | select ARCH_REQUIRE_GPIOLIB | ||
258 | select GENERIC_GPIO | ||
257 | help | 259 | help |
258 | The CPM2 (Communications Processor Module) is a coprocessor on | 260 | The CPM2 (Communications Processor Module) is a coprocessor on |
259 | embedded CPUs made by Freescale. Selecting this option means that | 261 | embedded CPUs made by Freescale. Selecting this option means that |
@@ -281,6 +283,7 @@ config FSL_ULI1575 | |||
281 | 283 | ||
282 | config CPM | 284 | config CPM |
283 | bool | 285 | bool |
286 | select PPC_CLOCK | ||
284 | 287 | ||
285 | config OF_RTC | 288 | config OF_RTC |
286 | bool | 289 | bool |
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c index 69288f653144..3233fe84d158 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c | |||
@@ -96,6 +96,12 @@ static int pmi_notifier(struct notifier_block *nb, | |||
96 | struct cpufreq_frequency_table *cbe_freqs; | 96 | struct cpufreq_frequency_table *cbe_freqs; |
97 | u8 node; | 97 | u8 node; |
98 | 98 | ||
99 | /* Should this really be called for CPUFREQ_ADJUST, CPUFREQ_INCOMPATIBLE | ||
100 | * and CPUFREQ_NOTIFY policy events?) | ||
101 | */ | ||
102 | if (event == CPUFREQ_START) | ||
103 | return 0; | ||
104 | |||
99 | cbe_freqs = cpufreq_frequency_get_table(policy->cpu); | 105 | cbe_freqs = cpufreq_frequency_get_table(policy->cpu); |
100 | node = cbe_cpu_to_node(policy->cpu); | 106 | node = cbe_cpu_to_node(policy->cpu); |
101 | 107 | ||
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c index 661df42830b9..4a04823e8423 100644 --- a/arch/powerpc/sysdev/cpm1.c +++ b/arch/powerpc/sysdev/cpm1.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/irq.h> | 31 | #include <linux/irq.h> |
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/spinlock.h> | ||
33 | #include <asm/page.h> | 34 | #include <asm/page.h> |
34 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
35 | #include <asm/8xx_immap.h> | 36 | #include <asm/8xx_immap.h> |
@@ -42,6 +43,10 @@ | |||
42 | 43 | ||
43 | #include <asm/fs_pd.h> | 44 | #include <asm/fs_pd.h> |
44 | 45 | ||
46 | #ifdef CONFIG_8xx_GPIO | ||
47 | #include <linux/of_gpio.h> | ||
48 | #endif | ||
49 | |||
45 | #define CPM_MAP_SIZE (0x4000) | 50 | #define CPM_MAP_SIZE (0x4000) |
46 | 51 | ||
47 | cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ | 52 | cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */ |
@@ -290,20 +295,24 @@ struct cpm_ioport16 { | |||
290 | __be16 res[3]; | 295 | __be16 res[3]; |
291 | }; | 296 | }; |
292 | 297 | ||
293 | struct cpm_ioport32 { | 298 | struct cpm_ioport32b { |
294 | __be32 dir, par, sor; | 299 | __be32 dir, par, odr, dat; |
300 | }; | ||
301 | |||
302 | struct cpm_ioport32e { | ||
303 | __be32 dir, par, sor, odr, dat; | ||
295 | }; | 304 | }; |
296 | 305 | ||
297 | static void cpm1_set_pin32(int port, int pin, int flags) | 306 | static void cpm1_set_pin32(int port, int pin, int flags) |
298 | { | 307 | { |
299 | struct cpm_ioport32 __iomem *iop; | 308 | struct cpm_ioport32e __iomem *iop; |
300 | pin = 1 << (31 - pin); | 309 | pin = 1 << (31 - pin); |
301 | 310 | ||
302 | if (port == CPM_PORTB) | 311 | if (port == CPM_PORTB) |
303 | iop = (struct cpm_ioport32 __iomem *) | 312 | iop = (struct cpm_ioport32e __iomem *) |
304 | &mpc8xx_immr->im_cpm.cp_pbdir; | 313 | &mpc8xx_immr->im_cpm.cp_pbdir; |
305 | else | 314 | else |
306 | iop = (struct cpm_ioport32 __iomem *) | 315 | iop = (struct cpm_ioport32e __iomem *) |
307 | &mpc8xx_immr->im_cpm.cp_pedir; | 316 | &mpc8xx_immr->im_cpm.cp_pedir; |
308 | 317 | ||
309 | if (flags & CPM_PIN_OUTPUT) | 318 | if (flags & CPM_PIN_OUTPUT) |
@@ -498,3 +507,251 @@ int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode) | |||
498 | 507 | ||
499 | return 0; | 508 | return 0; |
500 | } | 509 | } |
510 | |||
511 | /* | ||
512 | * GPIO LIB API implementation | ||
513 | */ | ||
514 | #ifdef CONFIG_8xx_GPIO | ||
515 | |||
516 | struct cpm1_gpio16_chip { | ||
517 | struct of_mm_gpio_chip mm_gc; | ||
518 | spinlock_t lock; | ||
519 | |||
520 | /* shadowed data register to clear/set bits safely */ | ||
521 | u16 cpdata; | ||
522 | }; | ||
523 | |||
524 | static inline struct cpm1_gpio16_chip * | ||
525 | to_cpm1_gpio16_chip(struct of_mm_gpio_chip *mm_gc) | ||
526 | { | ||
527 | return container_of(mm_gc, struct cpm1_gpio16_chip, mm_gc); | ||
528 | } | ||
529 | |||
530 | static void cpm1_gpio16_save_regs(struct of_mm_gpio_chip *mm_gc) | ||
531 | { | ||
532 | struct cpm1_gpio16_chip *cpm1_gc = to_cpm1_gpio16_chip(mm_gc); | ||
533 | struct cpm_ioport16 __iomem *iop = mm_gc->regs; | ||
534 | |||
535 | cpm1_gc->cpdata = in_be16(&iop->dat); | ||
536 | } | ||
537 | |||
538 | static int cpm1_gpio16_get(struct gpio_chip *gc, unsigned int gpio) | ||
539 | { | ||
540 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
541 | struct cpm_ioport16 __iomem *iop = mm_gc->regs; | ||
542 | u16 pin_mask; | ||
543 | |||
544 | pin_mask = 1 << (15 - gpio); | ||
545 | |||
546 | return !!(in_be16(&iop->dat) & pin_mask); | ||
547 | } | ||
548 | |||
549 | static void cpm1_gpio16_set(struct gpio_chip *gc, unsigned int gpio, int value) | ||
550 | { | ||
551 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
552 | struct cpm1_gpio16_chip *cpm1_gc = to_cpm1_gpio16_chip(mm_gc); | ||
553 | struct cpm_ioport16 __iomem *iop = mm_gc->regs; | ||
554 | unsigned long flags; | ||
555 | u16 pin_mask = 1 << (15 - gpio); | ||
556 | |||
557 | spin_lock_irqsave(&cpm1_gc->lock, flags); | ||
558 | |||
559 | if (value) | ||
560 | cpm1_gc->cpdata |= pin_mask; | ||
561 | else | ||
562 | cpm1_gc->cpdata &= ~pin_mask; | ||
563 | |||
564 | out_be16(&iop->dat, cpm1_gc->cpdata); | ||
565 | |||
566 | spin_unlock_irqrestore(&cpm1_gc->lock, flags); | ||
567 | } | ||
568 | |||
569 | static int cpm1_gpio16_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | ||
570 | { | ||
571 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
572 | struct cpm_ioport16 __iomem *iop = mm_gc->regs; | ||
573 | u16 pin_mask; | ||
574 | |||
575 | pin_mask = 1 << (15 - gpio); | ||
576 | |||
577 | setbits16(&iop->dir, pin_mask); | ||
578 | |||
579 | cpm1_gpio16_set(gc, gpio, val); | ||
580 | |||
581 | return 0; | ||
582 | } | ||
583 | |||
584 | static int cpm1_gpio16_dir_in(struct gpio_chip *gc, unsigned int gpio) | ||
585 | { | ||
586 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
587 | struct cpm_ioport16 __iomem *iop = mm_gc->regs; | ||
588 | u16 pin_mask; | ||
589 | |||
590 | pin_mask = 1 << (15 - gpio); | ||
591 | |||
592 | clrbits16(&iop->dir, pin_mask); | ||
593 | |||
594 | return 0; | ||
595 | } | ||
596 | |||
597 | int cpm1_gpiochip_add16(struct device_node *np) | ||
598 | { | ||
599 | struct cpm1_gpio16_chip *cpm1_gc; | ||
600 | struct of_mm_gpio_chip *mm_gc; | ||
601 | struct of_gpio_chip *of_gc; | ||
602 | struct gpio_chip *gc; | ||
603 | |||
604 | cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL); | ||
605 | if (!cpm1_gc) | ||
606 | return -ENOMEM; | ||
607 | |||
608 | spin_lock_init(&cpm1_gc->lock); | ||
609 | |||
610 | mm_gc = &cpm1_gc->mm_gc; | ||
611 | of_gc = &mm_gc->of_gc; | ||
612 | gc = &of_gc->gc; | ||
613 | |||
614 | mm_gc->save_regs = cpm1_gpio16_save_regs; | ||
615 | of_gc->gpio_cells = 2; | ||
616 | gc->ngpio = 16; | ||
617 | gc->direction_input = cpm1_gpio16_dir_in; | ||
618 | gc->direction_output = cpm1_gpio16_dir_out; | ||
619 | gc->get = cpm1_gpio16_get; | ||
620 | gc->set = cpm1_gpio16_set; | ||
621 | |||
622 | return of_mm_gpiochip_add(np, mm_gc); | ||
623 | } | ||
624 | |||
625 | struct cpm1_gpio32_chip { | ||
626 | struct of_mm_gpio_chip mm_gc; | ||
627 | spinlock_t lock; | ||
628 | |||
629 | /* shadowed data register to clear/set bits safely */ | ||
630 | u32 cpdata; | ||
631 | }; | ||
632 | |||
633 | static inline struct cpm1_gpio32_chip * | ||
634 | to_cpm1_gpio32_chip(struct of_mm_gpio_chip *mm_gc) | ||
635 | { | ||
636 | return container_of(mm_gc, struct cpm1_gpio32_chip, mm_gc); | ||
637 | } | ||
638 | |||
639 | static void cpm1_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc) | ||
640 | { | ||
641 | struct cpm1_gpio32_chip *cpm1_gc = to_cpm1_gpio32_chip(mm_gc); | ||
642 | struct cpm_ioport32b __iomem *iop = mm_gc->regs; | ||
643 | |||
644 | cpm1_gc->cpdata = in_be32(&iop->dat); | ||
645 | } | ||
646 | |||
647 | static int cpm1_gpio32_get(struct gpio_chip *gc, unsigned int gpio) | ||
648 | { | ||
649 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
650 | struct cpm_ioport32b __iomem *iop = mm_gc->regs; | ||
651 | u32 pin_mask; | ||
652 | |||
653 | pin_mask = 1 << (31 - gpio); | ||
654 | |||
655 | return !!(in_be32(&iop->dat) & pin_mask); | ||
656 | } | ||
657 | |||
658 | static void cpm1_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value) | ||
659 | { | ||
660 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
661 | struct cpm1_gpio32_chip *cpm1_gc = to_cpm1_gpio32_chip(mm_gc); | ||
662 | struct cpm_ioport32b __iomem *iop = mm_gc->regs; | ||
663 | unsigned long flags; | ||
664 | u32 pin_mask = 1 << (31 - gpio); | ||
665 | |||
666 | spin_lock_irqsave(&cpm1_gc->lock, flags); | ||
667 | |||
668 | if (value) | ||
669 | cpm1_gc->cpdata |= pin_mask; | ||
670 | else | ||
671 | cpm1_gc->cpdata &= ~pin_mask; | ||
672 | |||
673 | out_be32(&iop->dat, cpm1_gc->cpdata); | ||
674 | |||
675 | spin_unlock_irqrestore(&cpm1_gc->lock, flags); | ||
676 | } | ||
677 | |||
678 | static int cpm1_gpio32_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | ||
679 | { | ||
680 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
681 | struct cpm_ioport32b __iomem *iop = mm_gc->regs; | ||
682 | u32 pin_mask; | ||
683 | |||
684 | pin_mask = 1 << (31 - gpio); | ||
685 | |||
686 | setbits32(&iop->dir, pin_mask); | ||
687 | |||
688 | cpm1_gpio32_set(gc, gpio, val); | ||
689 | |||
690 | return 0; | ||
691 | } | ||
692 | |||
693 | static int cpm1_gpio32_dir_in(struct gpio_chip *gc, unsigned int gpio) | ||
694 | { | ||
695 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
696 | struct cpm_ioport32b __iomem *iop = mm_gc->regs; | ||
697 | u32 pin_mask; | ||
698 | |||
699 | pin_mask = 1 << (31 - gpio); | ||
700 | |||
701 | clrbits32(&iop->dir, pin_mask); | ||
702 | |||
703 | return 0; | ||
704 | } | ||
705 | |||
706 | int cpm1_gpiochip_add32(struct device_node *np) | ||
707 | { | ||
708 | struct cpm1_gpio32_chip *cpm1_gc; | ||
709 | struct of_mm_gpio_chip *mm_gc; | ||
710 | struct of_gpio_chip *of_gc; | ||
711 | struct gpio_chip *gc; | ||
712 | |||
713 | cpm1_gc = kzalloc(sizeof(*cpm1_gc), GFP_KERNEL); | ||
714 | if (!cpm1_gc) | ||
715 | return -ENOMEM; | ||
716 | |||
717 | spin_lock_init(&cpm1_gc->lock); | ||
718 | |||
719 | mm_gc = &cpm1_gc->mm_gc; | ||
720 | of_gc = &mm_gc->of_gc; | ||
721 | gc = &of_gc->gc; | ||
722 | |||
723 | mm_gc->save_regs = cpm1_gpio32_save_regs; | ||
724 | of_gc->gpio_cells = 2; | ||
725 | gc->ngpio = 32; | ||
726 | gc->direction_input = cpm1_gpio32_dir_in; | ||
727 | gc->direction_output = cpm1_gpio32_dir_out; | ||
728 | gc->get = cpm1_gpio32_get; | ||
729 | gc->set = cpm1_gpio32_set; | ||
730 | |||
731 | return of_mm_gpiochip_add(np, mm_gc); | ||
732 | } | ||
733 | |||
734 | static int cpm_init_par_io(void) | ||
735 | { | ||
736 | struct device_node *np; | ||
737 | |||
738 | for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank-a") | ||
739 | cpm1_gpiochip_add16(np); | ||
740 | |||
741 | for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank-b") | ||
742 | cpm1_gpiochip_add32(np); | ||
743 | |||
744 | for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank-c") | ||
745 | cpm1_gpiochip_add16(np); | ||
746 | |||
747 | for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank-d") | ||
748 | cpm1_gpiochip_add16(np); | ||
749 | |||
750 | /* Port E uses CPM2 layout */ | ||
751 | for_each_compatible_node(np, NULL, "fsl,cpm1-pario-bank-e") | ||
752 | cpm2_gpiochip_add32(np); | ||
753 | return 0; | ||
754 | } | ||
755 | arch_initcall(cpm_init_par_io); | ||
756 | |||
757 | #endif /* CONFIG_8xx_GPIO */ | ||
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c index 5a6c5dfc53ef..f1c3395633b9 100644 --- a/arch/powerpc/sysdev/cpm2.c +++ b/arch/powerpc/sysdev/cpm2.c | |||
@@ -115,16 +115,10 @@ EXPORT_SYMBOL(cpm_command); | |||
115 | * Baud rate clocks are zero-based in the driver code (as that maps | 115 | * Baud rate clocks are zero-based in the driver code (as that maps |
116 | * to port numbers). Documentation uses 1-based numbering. | 116 | * to port numbers). Documentation uses 1-based numbering. |
117 | */ | 117 | */ |
118 | #define BRG_INT_CLK (get_brgfreq()) | 118 | void __cpm2_setbrg(uint brg, uint rate, uint clk, int div16, int src) |
119 | #define BRG_UART_CLK (BRG_INT_CLK/16) | ||
120 | |||
121 | /* This function is used by UARTS, or anything else that uses a 16x | ||
122 | * oversampled clock. | ||
123 | */ | ||
124 | void | ||
125 | cpm_setbrg(uint brg, uint rate) | ||
126 | { | 119 | { |
127 | u32 __iomem *bp; | 120 | u32 __iomem *bp; |
121 | u32 val; | ||
128 | 122 | ||
129 | /* This is good enough to get SMCs running..... | 123 | /* This is good enough to get SMCs running..... |
130 | */ | 124 | */ |
@@ -135,34 +129,14 @@ cpm_setbrg(uint brg, uint rate) | |||
135 | brg -= 4; | 129 | brg -= 4; |
136 | } | 130 | } |
137 | bp += brg; | 131 | bp += brg; |
138 | out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN); | 132 | val = (((clk / rate) - 1) << 1) | CPM_BRG_EN | src; |
139 | |||
140 | cpm2_unmap(bp); | ||
141 | } | ||
142 | |||
143 | /* This function is used to set high speed synchronous baud rate | ||
144 | * clocks. | ||
145 | */ | ||
146 | void | ||
147 | cpm2_fastbrg(uint brg, uint rate, int div16) | ||
148 | { | ||
149 | u32 __iomem *bp; | ||
150 | u32 val; | ||
151 | |||
152 | if (brg < 4) { | ||
153 | bp = cpm2_map_size(im_brgc1, 16); | ||
154 | } else { | ||
155 | bp = cpm2_map_size(im_brgc5, 16); | ||
156 | brg -= 4; | ||
157 | } | ||
158 | bp += brg; | ||
159 | val = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN; | ||
160 | if (div16) | 133 | if (div16) |
161 | val |= CPM_BRG_DIV16; | 134 | val |= CPM_BRG_DIV16; |
162 | 135 | ||
163 | out_be32(bp, val); | 136 | out_be32(bp, val); |
164 | cpm2_unmap(bp); | 137 | cpm2_unmap(bp); |
165 | } | 138 | } |
139 | EXPORT_SYMBOL(__cpm2_setbrg); | ||
166 | 140 | ||
167 | int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) | 141 | int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode) |
168 | { | 142 | { |
@@ -377,3 +351,14 @@ void cpm2_set_pin(int port, int pin, int flags) | |||
377 | else | 351 | else |
378 | clrbits32(&iop[port].odr, pin); | 352 | clrbits32(&iop[port].odr, pin); |
379 | } | 353 | } |
354 | |||
355 | static int cpm_init_par_io(void) | ||
356 | { | ||
357 | struct device_node *np; | ||
358 | |||
359 | for_each_compatible_node(np, NULL, "fsl,cpm2-pario-bank") | ||
360 | cpm2_gpiochip_add32(np); | ||
361 | return 0; | ||
362 | } | ||
363 | arch_initcall(cpm_init_par_io); | ||
364 | |||
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index e4b7296acb2c..53da8a079f96 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
22 | #include <linux/spinlock.h> | ||
23 | #include <linux/of.h> | ||
22 | 24 | ||
23 | #include <asm/udbg.h> | 25 | #include <asm/udbg.h> |
24 | #include <asm/io.h> | 26 | #include <asm/io.h> |
@@ -28,6 +30,10 @@ | |||
28 | 30 | ||
29 | #include <mm/mmu_decl.h> | 31 | #include <mm/mmu_decl.h> |
30 | 32 | ||
33 | #if defined(CONFIG_CPM2) || defined(CONFIG_8xx_GPIO) | ||
34 | #include <linux/of_gpio.h> | ||
35 | #endif | ||
36 | |||
31 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM | 37 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM |
32 | static u32 __iomem *cpm_udbg_txdesc = | 38 | static u32 __iomem *cpm_udbg_txdesc = |
33 | (u32 __iomem __force *)CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; | 39 | (u32 __iomem __force *)CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; |
@@ -207,3 +213,120 @@ dma_addr_t cpm_muram_dma(void __iomem *addr) | |||
207 | return muram_pbase + ((u8 __iomem *)addr - muram_vbase); | 213 | return muram_pbase + ((u8 __iomem *)addr - muram_vbase); |
208 | } | 214 | } |
209 | EXPORT_SYMBOL(cpm_muram_dma); | 215 | EXPORT_SYMBOL(cpm_muram_dma); |
216 | |||
217 | #if defined(CONFIG_CPM2) || defined(CONFIG_8xx_GPIO) | ||
218 | |||
219 | struct cpm2_ioports { | ||
220 | u32 dir, par, sor, odr, dat; | ||
221 | u32 res[3]; | ||
222 | }; | ||
223 | |||
224 | struct cpm2_gpio32_chip { | ||
225 | struct of_mm_gpio_chip mm_gc; | ||
226 | spinlock_t lock; | ||
227 | |||
228 | /* shadowed data register to clear/set bits safely */ | ||
229 | u32 cpdata; | ||
230 | }; | ||
231 | |||
232 | static inline struct cpm2_gpio32_chip * | ||
233 | to_cpm2_gpio32_chip(struct of_mm_gpio_chip *mm_gc) | ||
234 | { | ||
235 | return container_of(mm_gc, struct cpm2_gpio32_chip, mm_gc); | ||
236 | } | ||
237 | |||
238 | static void cpm2_gpio32_save_regs(struct of_mm_gpio_chip *mm_gc) | ||
239 | { | ||
240 | struct cpm2_gpio32_chip *cpm2_gc = to_cpm2_gpio32_chip(mm_gc); | ||
241 | struct cpm2_ioports __iomem *iop = mm_gc->regs; | ||
242 | |||
243 | cpm2_gc->cpdata = in_be32(&iop->dat); | ||
244 | } | ||
245 | |||
246 | static int cpm2_gpio32_get(struct gpio_chip *gc, unsigned int gpio) | ||
247 | { | ||
248 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
249 | struct cpm2_ioports __iomem *iop = mm_gc->regs; | ||
250 | u32 pin_mask; | ||
251 | |||
252 | pin_mask = 1 << (31 - gpio); | ||
253 | |||
254 | return !!(in_be32(&iop->dat) & pin_mask); | ||
255 | } | ||
256 | |||
257 | static void cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value) | ||
258 | { | ||
259 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
260 | struct cpm2_gpio32_chip *cpm2_gc = to_cpm2_gpio32_chip(mm_gc); | ||
261 | struct cpm2_ioports __iomem *iop = mm_gc->regs; | ||
262 | unsigned long flags; | ||
263 | u32 pin_mask = 1 << (31 - gpio); | ||
264 | |||
265 | spin_lock_irqsave(&cpm2_gc->lock, flags); | ||
266 | |||
267 | if (value) | ||
268 | cpm2_gc->cpdata |= pin_mask; | ||
269 | else | ||
270 | cpm2_gc->cpdata &= ~pin_mask; | ||
271 | |||
272 | out_be32(&iop->dat, cpm2_gc->cpdata); | ||
273 | |||
274 | spin_unlock_irqrestore(&cpm2_gc->lock, flags); | ||
275 | } | ||
276 | |||
277 | static int cpm2_gpio32_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | ||
278 | { | ||
279 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
280 | struct cpm2_ioports __iomem *iop = mm_gc->regs; | ||
281 | u32 pin_mask; | ||
282 | |||
283 | pin_mask = 1 << (31 - gpio); | ||
284 | |||
285 | setbits32(&iop->dir, pin_mask); | ||
286 | |||
287 | cpm2_gpio32_set(gc, gpio, val); | ||
288 | |||
289 | return 0; | ||
290 | } | ||
291 | |||
292 | static int cpm2_gpio32_dir_in(struct gpio_chip *gc, unsigned int gpio) | ||
293 | { | ||
294 | struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc); | ||
295 | struct cpm2_ioports __iomem *iop = mm_gc->regs; | ||
296 | u32 pin_mask; | ||
297 | |||
298 | pin_mask = 1 << (31 - gpio); | ||
299 | |||
300 | clrbits32(&iop->dir, pin_mask); | ||
301 | |||
302 | return 0; | ||
303 | } | ||
304 | |||
305 | int cpm2_gpiochip_add32(struct device_node *np) | ||
306 | { | ||
307 | struct cpm2_gpio32_chip *cpm2_gc; | ||
308 | struct of_mm_gpio_chip *mm_gc; | ||
309 | struct of_gpio_chip *of_gc; | ||
310 | struct gpio_chip *gc; | ||
311 | |||
312 | cpm2_gc = kzalloc(sizeof(*cpm2_gc), GFP_KERNEL); | ||
313 | if (!cpm2_gc) | ||
314 | return -ENOMEM; | ||
315 | |||
316 | spin_lock_init(&cpm2_gc->lock); | ||
317 | |||
318 | mm_gc = &cpm2_gc->mm_gc; | ||
319 | of_gc = &mm_gc->of_gc; | ||
320 | gc = &of_gc->gc; | ||
321 | |||
322 | mm_gc->save_regs = cpm2_gpio32_save_regs; | ||
323 | of_gc->gpio_cells = 2; | ||
324 | gc->ngpio = 32; | ||
325 | gc->direction_input = cpm2_gpio32_dir_in; | ||
326 | gc->direction_output = cpm2_gpio32_dir_out; | ||
327 | gc->get = cpm2_gpio32_get; | ||
328 | gc->set = cpm2_gpio32_set; | ||
329 | |||
330 | return of_mm_gpiochip_add(np, mm_gc); | ||
331 | } | ||
332 | #endif /* CONFIG_CPM2 || CONFIG_8xx_GPIO */ | ||
diff --git a/arch/powerpc/sysdev/rtc_cmos_setup.c b/arch/powerpc/sysdev/rtc_cmos_setup.c index c09ddc0dbeb3..c1879ebfd4f4 100644 --- a/arch/powerpc/sysdev/rtc_cmos_setup.c +++ b/arch/powerpc/sysdev/rtc_cmos_setup.c | |||
@@ -21,6 +21,7 @@ static int __init add_rtc(void) | |||
21 | struct device_node *np; | 21 | struct device_node *np; |
22 | struct platform_device *pd; | 22 | struct platform_device *pd; |
23 | struct resource res[2]; | 23 | struct resource res[2]; |
24 | unsigned int num_res = 1; | ||
24 | int ret; | 25 | int ret; |
25 | 26 | ||
26 | memset(&res, 0, sizeof(res)); | 27 | memset(&res, 0, sizeof(res)); |
@@ -41,14 +42,24 @@ static int __init add_rtc(void) | |||
41 | if (res[0].start != RTC_PORT(0)) | 42 | if (res[0].start != RTC_PORT(0)) |
42 | return -EINVAL; | 43 | return -EINVAL; |
43 | 44 | ||
44 | /* Use a fixed interrupt value of 8 since on PPC if we are using this | 45 | np = of_find_compatible_node(NULL, NULL, "chrp,iic"); |
45 | * its off an i8259 which we ensure has interrupt numbers 0..15. */ | 46 | if (!np) |
46 | res[1].start = 8; | 47 | np = of_find_compatible_node(NULL, NULL, "pnpPNP,000"); |
47 | res[1].end = 8; | 48 | if (np) { |
48 | res[1].flags = IORESOURCE_IRQ; | 49 | of_node_put(np); |
50 | /* | ||
51 | * Use a fixed interrupt value of 8 since on PPC if we are | ||
52 | * using this its off an i8259 which we ensure has interrupt | ||
53 | * numbers 0..15. | ||
54 | */ | ||
55 | res[1].start = 8; | ||
56 | res[1].end = 8; | ||
57 | res[1].flags = IORESOURCE_IRQ; | ||
58 | num_res++; | ||
59 | } | ||
49 | 60 | ||
50 | pd = platform_device_register_simple("rtc_cmos", -1, | 61 | pd = platform_device_register_simple("rtc_cmos", -1, |
51 | &res[0], 2); | 62 | &res[0], num_res); |
52 | 63 | ||
53 | if (IS_ERR(pd)) | 64 | if (IS_ERR(pd)) |
54 | return PTR_ERR(pd); | 65 | return PTR_ERR(pd); |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 2ed88122be93..8d41908e2513 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -317,6 +317,9 @@ config ARCH_ENABLE_MEMORY_HOTPLUG | |||
317 | def_bool y | 317 | def_bool y |
318 | depends on SPARSEMEM | 318 | depends on SPARSEMEM |
319 | 319 | ||
320 | config ARCH_ENABLE_MEMORY_HOTREMOVE | ||
321 | def_bool y | ||
322 | |||
320 | source "mm/Kconfig" | 323 | source "mm/Kconfig" |
321 | 324 | ||
322 | comment "I/O subsystem configuration" | 325 | comment "I/O subsystem configuration" |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index d003a6e16afb..328a20e880b5 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1732,3 +1732,40 @@ compat_sys_timerfd_gettime_wrapper: | |||
1732 | lgfr %r2,%r2 # int | 1732 | lgfr %r2,%r2 # int |
1733 | llgtr %r3,%r3 # struct compat_itimerspec * | 1733 | llgtr %r3,%r3 # struct compat_itimerspec * |
1734 | jg compat_sys_timerfd_gettime | 1734 | jg compat_sys_timerfd_gettime |
1735 | |||
1736 | .globl compat_sys_signalfd4_wrapper | ||
1737 | compat_sys_signalfd4_wrapper: | ||
1738 | lgfr %r2,%r2 # int | ||
1739 | llgtr %r3,%r3 # compat_sigset_t * | ||
1740 | llgfr %r4,%r4 # compat_size_t | ||
1741 | lgfr %r5,%r5 # int | ||
1742 | jg compat_sys_signalfd4 | ||
1743 | |||
1744 | .globl sys_eventfd2_wrapper | ||
1745 | sys_eventfd2_wrapper: | ||
1746 | llgfr %r2,%r2 # unsigned int | ||
1747 | lgfr %r3,%r3 # int | ||
1748 | jg sys_eventfd2 | ||
1749 | |||
1750 | .globl sys_inotify_init1_wrapper | ||
1751 | sys_inotify_init1_wrapper: | ||
1752 | lgfr %r2,%r2 # int | ||
1753 | jg sys_inotify_init1 | ||
1754 | |||
1755 | .globl sys_pipe2_wrapper | ||
1756 | sys_pipe2_wrapper: | ||
1757 | llgtr %r2,%r2 # u32 * | ||
1758 | lgfr %r3,%r3 # int | ||
1759 | jg sys_pipe2 # branch to system call | ||
1760 | |||
1761 | .globl sys_dup3_wrapper | ||
1762 | sys_dup3_wrapper: | ||
1763 | llgfr %r2,%r2 # unsigned int | ||
1764 | llgfr %r3,%r3 # unsigned int | ||
1765 | lgfr %r4,%r4 # int | ||
1766 | jg sys_dup3 # branch to system call | ||
1767 | |||
1768 | .globl sys_epoll_create1_wrapper | ||
1769 | sys_epoll_create1_wrapper: | ||
1770 | lgfr %r2,%r2 # int | ||
1771 | jg sys_epoll_create1 # branch to system call | ||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 54b2779b5e2f..2dcf590faba6 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -1705,7 +1705,10 @@ void __init setup_ipl(void) | |||
1705 | 1705 | ||
1706 | void __init ipl_update_parameters(void) | 1706 | void __init ipl_update_parameters(void) |
1707 | { | 1707 | { |
1708 | if (diag308(DIAG308_STORE, &ipl_block) == DIAG308_RC_OK) | 1708 | int rc; |
1709 | |||
1710 | rc = diag308(DIAG308_STORE, &ipl_block); | ||
1711 | if ((rc == DIAG308_RC_OK) || (rc == DIAG308_RC_NOCONFIG)) | ||
1709 | diag308_set_works = 1; | 1712 | diag308_set_works = 1; |
1710 | } | 1713 | } |
1711 | 1714 | ||
diff --git a/arch/s390/kernel/mem_detect.c b/arch/s390/kernel/mem_detect.c index 18ed7abe16c5..9872999c66d1 100644 --- a/arch/s390/kernel/mem_detect.c +++ b/arch/s390/kernel/mem_detect.c | |||
@@ -9,27 +9,6 @@ | |||
9 | #include <asm/sclp.h> | 9 | #include <asm/sclp.h> |
10 | #include <asm/setup.h> | 10 | #include <asm/setup.h> |
11 | 11 | ||
12 | static int memory_fast_detect(struct mem_chunk *chunk) | ||
13 | { | ||
14 | unsigned long val0 = 0; | ||
15 | unsigned long val1 = 0xc; | ||
16 | int rc = -EOPNOTSUPP; | ||
17 | |||
18 | if (ipl_flags & IPL_NSS_VALID) | ||
19 | return -EOPNOTSUPP; | ||
20 | asm volatile( | ||
21 | " diag %1,%2,0x260\n" | ||
22 | "0: lhi %0,0\n" | ||
23 | "1:\n" | ||
24 | EX_TABLE(0b,1b) | ||
25 | : "+d" (rc), "+d" (val0), "+d" (val1) : : "cc"); | ||
26 | |||
27 | if (rc || val0 != val1) | ||
28 | return -EOPNOTSUPP; | ||
29 | chunk->size = val0 + 1; | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static inline int tprot(unsigned long addr) | 12 | static inline int tprot(unsigned long addr) |
34 | { | 13 | { |
35 | int rc = -EFAULT; | 14 | int rc = -EFAULT; |
@@ -84,8 +63,6 @@ void detect_memory_layout(struct mem_chunk chunk[]) | |||
84 | unsigned long flags, cr0; | 63 | unsigned long flags, cr0; |
85 | 64 | ||
86 | memset(chunk, 0, MEMORY_CHUNKS * sizeof(struct mem_chunk)); | 65 | memset(chunk, 0, MEMORY_CHUNKS * sizeof(struct mem_chunk)); |
87 | if (memory_fast_detect(&chunk[0]) == 0) | ||
88 | return; | ||
89 | /* Disable IRQs, DAT and low address protection so tprot does the | 66 | /* Disable IRQs, DAT and low address protection so tprot does the |
90 | * right thing and we don't get scheduled away with low address | 67 | * right thing and we don't get scheduled away with low address |
91 | * protection disabled. | 68 | * protection disabled. |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index c87ec687d4c6..c66d35e55142 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -330,3 +330,9 @@ SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) | |||
330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) | 330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) |
331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime_wrapper) /* 320 */ | 331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime_wrapper) /* 320 */ |
332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime_wrapper) | 332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime_wrapper) |
333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4_wrapper) | ||
334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) | ||
335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) | ||
336 | SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */ | ||
337 | SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper) | ||
338 | SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) | ||
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index ab70d9bd9261..ca114fe46ffb 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -1348,7 +1348,7 @@ early_param("stp", early_parse_stp); | |||
1348 | /* | 1348 | /* |
1349 | * Reset STP attachment. | 1349 | * Reset STP attachment. |
1350 | */ | 1350 | */ |
1351 | static void stp_reset(void) | 1351 | static void __init stp_reset(void) |
1352 | { | 1352 | { |
1353 | int rc; | 1353 | int rc; |
1354 | 1354 | ||
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index eae21a8ac72d..fc6ab6094df8 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
@@ -43,7 +43,7 @@ void __udelay(unsigned long usecs) | |||
43 | local_bh_disable(); | 43 | local_bh_disable(); |
44 | local_irq_save(flags); | 44 | local_irq_save(flags); |
45 | if (raw_irqs_disabled_flags(flags)) { | 45 | if (raw_irqs_disabled_flags(flags)) { |
46 | old_cc = S390_lowcore.clock_comparator; | 46 | old_cc = local_tick_disable(); |
47 | S390_lowcore.clock_comparator = -1ULL; | 47 | S390_lowcore.clock_comparator = -1ULL; |
48 | __ctl_store(cr0, 0, 0); | 48 | __ctl_store(cr0, 0, 0); |
49 | dummy = (cr0 & 0xffff00e0) | 0x00000800; | 49 | dummy = (cr0 & 0xffff00e0) | 0x00000800; |
@@ -65,7 +65,7 @@ void __udelay(unsigned long usecs) | |||
65 | 65 | ||
66 | if (raw_irqs_disabled_flags(flags)) { | 66 | if (raw_irqs_disabled_flags(flags)) { |
67 | __ctl_load(cr0, 0, 0); | 67 | __ctl_load(cr0, 0, 0); |
68 | S390_lowcore.clock_comparator = old_cc; | 68 | local_tick_enable(old_cc); |
69 | } | 69 | } |
70 | if (!irq_context) | 70 | if (!irq_context) |
71 | _local_bh_enable(); | 71 | _local_bh_enable(); |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 4993b0f594eb..1169130a97ef 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -179,7 +179,7 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
179 | int rc; | 179 | int rc; |
180 | 180 | ||
181 | pgdat = NODE_DATA(nid); | 181 | pgdat = NODE_DATA(nid); |
182 | zone = pgdat->node_zones + ZONE_NORMAL; | 182 | zone = pgdat->node_zones + ZONE_MOVABLE; |
183 | rc = vmem_add_mapping(start, size); | 183 | rc = vmem_add_mapping(start, size); |
184 | if (rc) | 184 | if (rc) |
185 | return rc; | 185 | return rc; |
@@ -189,3 +189,14 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
189 | return rc; | 189 | return rc; |
190 | } | 190 | } |
191 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 191 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
192 | |||
193 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
194 | int remove_memory(u64 start, u64 size) | ||
195 | { | ||
196 | unsigned long start_pfn, end_pfn; | ||
197 | |||
198 | start_pfn = PFN_DOWN(start); | ||
199 | end_pfn = start_pfn + PFN_DOWN(size); | ||
200 | return offline_pages(start_pfn, end_pfn, 120 * HZ); | ||
201 | } | ||
202 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 2b742206ba07..cb992c3d6b71 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -11,6 +11,7 @@ config SUPERH | |||
11 | select HAVE_CLK | 11 | select HAVE_CLK |
12 | select HAVE_IDE | 12 | select HAVE_IDE |
13 | select HAVE_OPROFILE | 13 | select HAVE_OPROFILE |
14 | select HAVE_GENERIC_DMA_COHERENT | ||
14 | help | 15 | help |
15 | The SuperH is a RISC processor targeted for use in embedded systems | 16 | The SuperH is a RISC processor targeted for use in embedded systems |
16 | and consumer electronics; it was also used in the Sega Dreamcast | 17 | and consumer electronics; it was also used in the Sega Dreamcast |
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 6c0b8a2de143..627315ecdb52 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/scatterlist.h> | 5 | #include <linux/scatterlist.h> |
6 | #include <asm/cacheflush.h> | 6 | #include <asm/cacheflush.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | #include <asm-generic/dma-coherent.h> | ||
8 | 9 | ||
9 | extern struct bus_type pci_bus_type; | 10 | extern struct bus_type pci_bus_type; |
10 | 11 | ||
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 8277982d0938..b2ce014401b5 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -28,21 +28,10 @@ void *dma_alloc_coherent(struct device *dev, size_t size, | |||
28 | dma_addr_t *dma_handle, gfp_t gfp) | 28 | dma_addr_t *dma_handle, gfp_t gfp) |
29 | { | 29 | { |
30 | void *ret, *ret_nocache; | 30 | void *ret, *ret_nocache; |
31 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | ||
32 | int order = get_order(size); | 31 | int order = get_order(size); |
33 | 32 | ||
34 | if (mem) { | 33 | if (dma_alloc_from_coherent(dev, size, dma_handle, &ret)) |
35 | int page = bitmap_find_free_region(mem->bitmap, mem->size, | 34 | return ret; |
36 | order); | ||
37 | if (page >= 0) { | ||
38 | *dma_handle = mem->device_base + (page << PAGE_SHIFT); | ||
39 | ret = mem->virt_base + (page << PAGE_SHIFT); | ||
40 | memset(ret, 0, size); | ||
41 | return ret; | ||
42 | } | ||
43 | if (mem->flags & DMA_MEMORY_EXCLUSIVE) | ||
44 | return NULL; | ||
45 | } | ||
46 | 35 | ||
47 | ret = (void *)__get_free_pages(gfp, order); | 36 | ret = (void *)__get_free_pages(gfp, order); |
48 | if (!ret) | 37 | if (!ret) |
@@ -72,11 +61,7 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
72 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | 61 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; |
73 | int order = get_order(size); | 62 | int order = get_order(size); |
74 | 63 | ||
75 | if (mem && vaddr >= mem->virt_base && vaddr < (mem->virt_base + (mem->size << PAGE_SHIFT))) { | 64 | if (!dma_release_from_coherent(dev, order, vaddr)) { |
76 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; | ||
77 | |||
78 | bitmap_release_region(mem->bitmap, page, order); | ||
79 | } else { | ||
80 | WARN_ON(irqs_disabled()); /* for portability */ | 65 | WARN_ON(irqs_disabled()); /* for portability */ |
81 | BUG_ON(mem && mem->flags & DMA_MEMORY_EXCLUSIVE); | 66 | BUG_ON(mem && mem->flags & DMA_MEMORY_EXCLUSIVE); |
82 | free_pages((unsigned long)phys_to_virt(dma_handle), order); | 67 | free_pages((unsigned long)phys_to_virt(dma_handle), order); |
@@ -85,83 +70,6 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
85 | } | 70 | } |
86 | EXPORT_SYMBOL(dma_free_coherent); | 71 | EXPORT_SYMBOL(dma_free_coherent); |
87 | 72 | ||
88 | int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
89 | dma_addr_t device_addr, size_t size, int flags) | ||
90 | { | ||
91 | void __iomem *mem_base = NULL; | ||
92 | int pages = size >> PAGE_SHIFT; | ||
93 | int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); | ||
94 | |||
95 | if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) | ||
96 | goto out; | ||
97 | if (!size) | ||
98 | goto out; | ||
99 | if (dev->dma_mem) | ||
100 | goto out; | ||
101 | |||
102 | /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */ | ||
103 | |||
104 | mem_base = ioremap_nocache(bus_addr, size); | ||
105 | if (!mem_base) | ||
106 | goto out; | ||
107 | |||
108 | dev->dma_mem = kmalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); | ||
109 | if (!dev->dma_mem) | ||
110 | goto out; | ||
111 | dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL); | ||
112 | if (!dev->dma_mem->bitmap) | ||
113 | goto free1_out; | ||
114 | |||
115 | dev->dma_mem->virt_base = mem_base; | ||
116 | dev->dma_mem->device_base = device_addr; | ||
117 | dev->dma_mem->size = pages; | ||
118 | dev->dma_mem->flags = flags; | ||
119 | |||
120 | if (flags & DMA_MEMORY_MAP) | ||
121 | return DMA_MEMORY_MAP; | ||
122 | |||
123 | return DMA_MEMORY_IO; | ||
124 | |||
125 | free1_out: | ||
126 | kfree(dev->dma_mem); | ||
127 | out: | ||
128 | if (mem_base) | ||
129 | iounmap(mem_base); | ||
130 | return 0; | ||
131 | } | ||
132 | EXPORT_SYMBOL(dma_declare_coherent_memory); | ||
133 | |||
134 | void dma_release_declared_memory(struct device *dev) | ||
135 | { | ||
136 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
137 | |||
138 | if (!mem) | ||
139 | return; | ||
140 | dev->dma_mem = NULL; | ||
141 | iounmap(mem->virt_base); | ||
142 | kfree(mem->bitmap); | ||
143 | kfree(mem); | ||
144 | } | ||
145 | EXPORT_SYMBOL(dma_release_declared_memory); | ||
146 | |||
147 | void *dma_mark_declared_memory_occupied(struct device *dev, | ||
148 | dma_addr_t device_addr, size_t size) | ||
149 | { | ||
150 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
151 | int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
152 | int pos, err; | ||
153 | |||
154 | if (!mem) | ||
155 | return ERR_PTR(-EINVAL); | ||
156 | |||
157 | pos = (device_addr - mem->device_base) >> PAGE_SHIFT; | ||
158 | err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); | ||
159 | if (err != 0) | ||
160 | return ERR_PTR(err); | ||
161 | return mem->virt_base + (pos << PAGE_SHIFT); | ||
162 | } | ||
163 | EXPORT_SYMBOL(dma_mark_declared_memory_occupied); | ||
164 | |||
165 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 73 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
166 | enum dma_data_direction direction) | 74 | enum dma_data_direction direction) |
167 | { | 75 | { |
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 5047490fc299..d741f35d7b3a 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -362,19 +362,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data) | |||
362 | if (tty == NULL) | 362 | if (tty == NULL) |
363 | return IRQ_NONE; | 363 | return IRQ_NONE; |
364 | 364 | ||
365 | if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && | 365 | tty_wakeup(tty); |
366 | (tty->ldisc.write_wakeup != NULL)) | ||
367 | (tty->ldisc.write_wakeup)(tty); | ||
368 | |||
369 | /* | ||
370 | * BLOCKING mode | ||
371 | * In blocking mode, everything sleeps on tty->write_wait. | ||
372 | * Sleeping in the console driver would break non-blocking | ||
373 | * writes. | ||
374 | */ | ||
375 | |||
376 | if (waitqueue_active(&tty->write_wait)) | ||
377 | wake_up_interruptible(&tty->write_wait); | ||
378 | return IRQ_HANDLED; | 366 | return IRQ_HANDLED; |
379 | } | 367 | } |
380 | 368 | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b6fa2877b173..3d0f2b6a5a16 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -30,6 +30,7 @@ config X86 | |||
30 | select HAVE_FTRACE | 30 | select HAVE_FTRACE |
31 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) | 31 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) |
32 | select HAVE_ARCH_KGDB if !X86_VOYAGER | 32 | select HAVE_ARCH_KGDB if !X86_VOYAGER |
33 | select HAVE_GENERIC_DMA_COHERENT if X86_32 | ||
33 | select HAVE_EFFICIENT_UNALIGNED_ACCESS | 34 | select HAVE_EFFICIENT_UNALIGNED_ACCESS |
34 | 35 | ||
35 | config ARCH_DEFCONFIG | 36 | config ARCH_DEFCONFIG |
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 9220cf46aa10..c2502eb9aa83 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c | |||
@@ -73,7 +73,6 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
73 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 73 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
74 | 74 | ||
75 | cpumask_t saved_mask; | 75 | cpumask_t saved_mask; |
76 | cpumask_of_cpu_ptr(new_mask, cpu); | ||
77 | int retval; | 76 | int retval; |
78 | unsigned int eax, ebx, ecx, edx; | 77 | unsigned int eax, ebx, ecx, edx; |
79 | unsigned int edx_part; | 78 | unsigned int edx_part; |
@@ -92,7 +91,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, | |||
92 | 91 | ||
93 | /* Make sure we are running on right CPU */ | 92 | /* Make sure we are running on right CPU */ |
94 | saved_mask = current->cpus_allowed; | 93 | saved_mask = current->cpus_allowed; |
95 | retval = set_cpus_allowed_ptr(current, new_mask); | 94 | retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
96 | if (retval) | 95 | if (retval) |
97 | return -1; | 96 | return -1; |
98 | 97 | ||
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 74697408576f..22d7d050905d 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -29,9 +29,6 @@ | |||
29 | 29 | ||
30 | #define CMD_SET_TYPE(cmd, t) ((cmd)->data[1] |= ((t) << 28)) | 30 | #define CMD_SET_TYPE(cmd, t) ((cmd)->data[1] |= ((t) << 28)) |
31 | 31 | ||
32 | #define to_pages(addr, size) \ | ||
33 | (round_up(((addr) & ~PAGE_MASK) + (size), PAGE_SIZE) >> PAGE_SHIFT) | ||
34 | |||
35 | #define EXIT_LOOP_COUNT 10000000 | 32 | #define EXIT_LOOP_COUNT 10000000 |
36 | 33 | ||
37 | static DEFINE_RWLOCK(amd_iommu_devtable_lock); | 34 | static DEFINE_RWLOCK(amd_iommu_devtable_lock); |
@@ -185,7 +182,7 @@ static int iommu_flush_pages(struct amd_iommu *iommu, u16 domid, | |||
185 | u64 address, size_t size) | 182 | u64 address, size_t size) |
186 | { | 183 | { |
187 | int s = 0; | 184 | int s = 0; |
188 | unsigned pages = to_pages(address, size); | 185 | unsigned pages = iommu_num_pages(address, size); |
189 | 186 | ||
190 | address &= PAGE_MASK; | 187 | address &= PAGE_MASK; |
191 | 188 | ||
@@ -557,8 +554,8 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu, | |||
557 | if (iommu->exclusion_start && | 554 | if (iommu->exclusion_start && |
558 | iommu->exclusion_start < dma_dom->aperture_size) { | 555 | iommu->exclusion_start < dma_dom->aperture_size) { |
559 | unsigned long startpage = iommu->exclusion_start >> PAGE_SHIFT; | 556 | unsigned long startpage = iommu->exclusion_start >> PAGE_SHIFT; |
560 | int pages = to_pages(iommu->exclusion_start, | 557 | int pages = iommu_num_pages(iommu->exclusion_start, |
561 | iommu->exclusion_length); | 558 | iommu->exclusion_length); |
562 | dma_ops_reserve_addresses(dma_dom, startpage, pages); | 559 | dma_ops_reserve_addresses(dma_dom, startpage, pages); |
563 | } | 560 | } |
564 | 561 | ||
@@ -767,7 +764,7 @@ static dma_addr_t __map_single(struct device *dev, | |||
767 | unsigned int pages; | 764 | unsigned int pages; |
768 | int i; | 765 | int i; |
769 | 766 | ||
770 | pages = to_pages(paddr, size); | 767 | pages = iommu_num_pages(paddr, size); |
771 | paddr &= PAGE_MASK; | 768 | paddr &= PAGE_MASK; |
772 | 769 | ||
773 | address = dma_ops_alloc_addresses(dev, dma_dom, pages); | 770 | address = dma_ops_alloc_addresses(dev, dma_dom, pages); |
@@ -802,7 +799,7 @@ static void __unmap_single(struct amd_iommu *iommu, | |||
802 | if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size)) | 799 | if ((dma_addr == 0) || (dma_addr + size > dma_dom->aperture_size)) |
803 | return; | 800 | return; |
804 | 801 | ||
805 | pages = to_pages(dma_addr, size); | 802 | pages = iommu_num_pages(dma_addr, size); |
806 | dma_addr &= PAGE_MASK; | 803 | dma_addr &= PAGE_MASK; |
807 | start = dma_addr; | 804 | start = dma_addr; |
808 | 805 | ||
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index ff2fff56f0a8..dd097b835839 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -200,12 +200,10 @@ static void drv_read(struct drv_cmd *cmd) | |||
200 | static void drv_write(struct drv_cmd *cmd) | 200 | static void drv_write(struct drv_cmd *cmd) |
201 | { | 201 | { |
202 | cpumask_t saved_mask = current->cpus_allowed; | 202 | cpumask_t saved_mask = current->cpus_allowed; |
203 | cpumask_of_cpu_ptr_declare(cpu_mask); | ||
204 | unsigned int i; | 203 | unsigned int i; |
205 | 204 | ||
206 | for_each_cpu_mask_nr(i, cmd->mask) { | 205 | for_each_cpu_mask_nr(i, cmd->mask) { |
207 | cpumask_of_cpu_ptr_next(cpu_mask, i); | 206 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); |
208 | set_cpus_allowed_ptr(current, cpu_mask); | ||
209 | do_drv_write(cmd); | 207 | do_drv_write(cmd); |
210 | } | 208 | } |
211 | 209 | ||
@@ -269,12 +267,11 @@ static unsigned int get_measured_perf(unsigned int cpu) | |||
269 | } aperf_cur, mperf_cur; | 267 | } aperf_cur, mperf_cur; |
270 | 268 | ||
271 | cpumask_t saved_mask; | 269 | cpumask_t saved_mask; |
272 | cpumask_of_cpu_ptr(cpu_mask, cpu); | ||
273 | unsigned int perf_percent; | 270 | unsigned int perf_percent; |
274 | unsigned int retval; | 271 | unsigned int retval; |
275 | 272 | ||
276 | saved_mask = current->cpus_allowed; | 273 | saved_mask = current->cpus_allowed; |
277 | set_cpus_allowed_ptr(current, cpu_mask); | 274 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
278 | if (get_cpu() != cpu) { | 275 | if (get_cpu() != cpu) { |
279 | /* We were not able to run on requested processor */ | 276 | /* We were not able to run on requested processor */ |
280 | put_cpu(); | 277 | put_cpu(); |
@@ -340,7 +337,6 @@ static unsigned int get_measured_perf(unsigned int cpu) | |||
340 | 337 | ||
341 | static unsigned int get_cur_freq_on_cpu(unsigned int cpu) | 338 | static unsigned int get_cur_freq_on_cpu(unsigned int cpu) |
342 | { | 339 | { |
343 | cpumask_of_cpu_ptr(cpu_mask, cpu); | ||
344 | struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu); | 340 | struct acpi_cpufreq_data *data = per_cpu(drv_data, cpu); |
345 | unsigned int freq; | 341 | unsigned int freq; |
346 | unsigned int cached_freq; | 342 | unsigned int cached_freq; |
@@ -353,7 +349,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) | |||
353 | } | 349 | } |
354 | 350 | ||
355 | cached_freq = data->freq_table[data->acpi_data->state].frequency; | 351 | cached_freq = data->freq_table[data->acpi_data->state].frequency; |
356 | freq = extract_freq(get_cur_val(cpu_mask), data); | 352 | freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data); |
357 | if (freq != cached_freq) { | 353 | if (freq != cached_freq) { |
358 | /* | 354 | /* |
359 | * The dreaded BIOS frequency change behind our back. | 355 | * The dreaded BIOS frequency change behind our back. |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 53c7b6936973..c45ca6d4dce1 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -479,12 +479,11 @@ static int core_voltage_post_transition(struct powernow_k8_data *data, u32 reqvi | |||
479 | static int check_supported_cpu(unsigned int cpu) | 479 | static int check_supported_cpu(unsigned int cpu) |
480 | { | 480 | { |
481 | cpumask_t oldmask; | 481 | cpumask_t oldmask; |
482 | cpumask_of_cpu_ptr(cpu_mask, cpu); | ||
483 | u32 eax, ebx, ecx, edx; | 482 | u32 eax, ebx, ecx, edx; |
484 | unsigned int rc = 0; | 483 | unsigned int rc = 0; |
485 | 484 | ||
486 | oldmask = current->cpus_allowed; | 485 | oldmask = current->cpus_allowed; |
487 | set_cpus_allowed_ptr(current, cpu_mask); | 486 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
488 | 487 | ||
489 | if (smp_processor_id() != cpu) { | 488 | if (smp_processor_id() != cpu) { |
490 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu); | 489 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", cpu); |
@@ -1017,7 +1016,6 @@ static int transition_frequency_pstate(struct powernow_k8_data *data, unsigned i | |||
1017 | static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) | 1016 | static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsigned relation) |
1018 | { | 1017 | { |
1019 | cpumask_t oldmask; | 1018 | cpumask_t oldmask; |
1020 | cpumask_of_cpu_ptr(cpu_mask, pol->cpu); | ||
1021 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); | 1019 | struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu); |
1022 | u32 checkfid; | 1020 | u32 checkfid; |
1023 | u32 checkvid; | 1021 | u32 checkvid; |
@@ -1032,7 +1030,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi | |||
1032 | 1030 | ||
1033 | /* only run on specific CPU from here on */ | 1031 | /* only run on specific CPU from here on */ |
1034 | oldmask = current->cpus_allowed; | 1032 | oldmask = current->cpus_allowed; |
1035 | set_cpus_allowed_ptr(current, cpu_mask); | 1033 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu)); |
1036 | 1034 | ||
1037 | if (smp_processor_id() != pol->cpu) { | 1035 | if (smp_processor_id() != pol->cpu) { |
1038 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); | 1036 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); |
@@ -1107,7 +1105,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1107 | { | 1105 | { |
1108 | struct powernow_k8_data *data; | 1106 | struct powernow_k8_data *data; |
1109 | cpumask_t oldmask; | 1107 | cpumask_t oldmask; |
1110 | cpumask_of_cpu_ptr_declare(newmask); | ||
1111 | int rc; | 1108 | int rc; |
1112 | 1109 | ||
1113 | if (!cpu_online(pol->cpu)) | 1110 | if (!cpu_online(pol->cpu)) |
@@ -1159,8 +1156,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1159 | 1156 | ||
1160 | /* only run on specific CPU from here on */ | 1157 | /* only run on specific CPU from here on */ |
1161 | oldmask = current->cpus_allowed; | 1158 | oldmask = current->cpus_allowed; |
1162 | cpumask_of_cpu_ptr_next(newmask, pol->cpu); | 1159 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(pol->cpu)); |
1163 | set_cpus_allowed_ptr(current, newmask); | ||
1164 | 1160 | ||
1165 | if (smp_processor_id() != pol->cpu) { | 1161 | if (smp_processor_id() != pol->cpu) { |
1166 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); | 1162 | printk(KERN_ERR PFX "limiting to cpu %u failed\n", pol->cpu); |
@@ -1182,7 +1178,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1182 | set_cpus_allowed_ptr(current, &oldmask); | 1178 | set_cpus_allowed_ptr(current, &oldmask); |
1183 | 1179 | ||
1184 | if (cpu_family == CPU_HW_PSTATE) | 1180 | if (cpu_family == CPU_HW_PSTATE) |
1185 | pol->cpus = *newmask; | 1181 | pol->cpus = cpumask_of_cpu(pol->cpu); |
1186 | else | 1182 | else |
1187 | pol->cpus = per_cpu(cpu_core_map, pol->cpu); | 1183 | pol->cpus = per_cpu(cpu_core_map, pol->cpu); |
1188 | data->available_cores = &(pol->cpus); | 1184 | data->available_cores = &(pol->cpus); |
@@ -1248,7 +1244,6 @@ static unsigned int powernowk8_get (unsigned int cpu) | |||
1248 | { | 1244 | { |
1249 | struct powernow_k8_data *data; | 1245 | struct powernow_k8_data *data; |
1250 | cpumask_t oldmask = current->cpus_allowed; | 1246 | cpumask_t oldmask = current->cpus_allowed; |
1251 | cpumask_of_cpu_ptr(newmask, cpu); | ||
1252 | unsigned int khz = 0; | 1247 | unsigned int khz = 0; |
1253 | unsigned int first; | 1248 | unsigned int first; |
1254 | 1249 | ||
@@ -1258,7 +1253,7 @@ static unsigned int powernowk8_get (unsigned int cpu) | |||
1258 | if (!data) | 1253 | if (!data) |
1259 | return -EINVAL; | 1254 | return -EINVAL; |
1260 | 1255 | ||
1261 | set_cpus_allowed_ptr(current, newmask); | 1256 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
1262 | if (smp_processor_id() != cpu) { | 1257 | if (smp_processor_id() != cpu) { |
1263 | printk(KERN_ERR PFX | 1258 | printk(KERN_ERR PFX |
1264 | "limiting to CPU %d failed in powernowk8_get\n", cpu); | 1259 | "limiting to CPU %d failed in powernowk8_get\n", cpu); |
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c index ca2ac13b7af2..15e13c01cc36 100644 --- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c | |||
@@ -324,10 +324,9 @@ static unsigned int get_cur_freq(unsigned int cpu) | |||
324 | unsigned l, h; | 324 | unsigned l, h; |
325 | unsigned clock_freq; | 325 | unsigned clock_freq; |
326 | cpumask_t saved_mask; | 326 | cpumask_t saved_mask; |
327 | cpumask_of_cpu_ptr(new_mask, cpu); | ||
328 | 327 | ||
329 | saved_mask = current->cpus_allowed; | 328 | saved_mask = current->cpus_allowed; |
330 | set_cpus_allowed_ptr(current, new_mask); | 329 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
331 | if (smp_processor_id() != cpu) | 330 | if (smp_processor_id() != cpu) |
332 | return 0; | 331 | return 0; |
333 | 332 | ||
@@ -585,15 +584,12 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
585 | * Best effort undo.. | 584 | * Best effort undo.. |
586 | */ | 585 | */ |
587 | 586 | ||
588 | if (!cpus_empty(*covered_cpus)) { | 587 | if (!cpus_empty(*covered_cpus)) |
589 | cpumask_of_cpu_ptr_declare(new_mask); | ||
590 | |||
591 | for_each_cpu_mask_nr(j, *covered_cpus) { | 588 | for_each_cpu_mask_nr(j, *covered_cpus) { |
592 | cpumask_of_cpu_ptr_next(new_mask, j); | 589 | set_cpus_allowed_ptr(current, |
593 | set_cpus_allowed_ptr(current, new_mask); | 590 | &cpumask_of_cpu(j)); |
594 | wrmsr(MSR_IA32_PERF_CTL, oldmsr, h); | 591 | wrmsr(MSR_IA32_PERF_CTL, oldmsr, h); |
595 | } | 592 | } |
596 | } | ||
597 | 593 | ||
598 | tmp = freqs.new; | 594 | tmp = freqs.new; |
599 | freqs.new = freqs.old; | 595 | freqs.new = freqs.old; |
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c index 2f3728dc24f6..191f7263c61d 100644 --- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c | |||
@@ -244,8 +244,7 @@ static unsigned int _speedstep_get(const cpumask_t *cpus) | |||
244 | 244 | ||
245 | static unsigned int speedstep_get(unsigned int cpu) | 245 | static unsigned int speedstep_get(unsigned int cpu) |
246 | { | 246 | { |
247 | cpumask_of_cpu_ptr(newmask, cpu); | 247 | return _speedstep_get(&cpumask_of_cpu(cpu)); |
248 | return _speedstep_get(newmask); | ||
249 | } | 248 | } |
250 | 249 | ||
251 | /** | 250 | /** |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index 650d40f7912b..6b0a10b002f1 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -516,7 +516,6 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
516 | unsigned long j; | 516 | unsigned long j; |
517 | int retval; | 517 | int retval; |
518 | cpumask_t oldmask; | 518 | cpumask_t oldmask; |
519 | cpumask_of_cpu_ptr(newmask, cpu); | ||
520 | 519 | ||
521 | if (num_cache_leaves == 0) | 520 | if (num_cache_leaves == 0) |
522 | return -ENOENT; | 521 | return -ENOENT; |
@@ -527,7 +526,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
527 | return -ENOMEM; | 526 | return -ENOMEM; |
528 | 527 | ||
529 | oldmask = current->cpus_allowed; | 528 | oldmask = current->cpus_allowed; |
530 | retval = set_cpus_allowed_ptr(current, newmask); | 529 | retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
531 | if (retval) | 530 | if (retval) |
532 | goto out; | 531 | goto out; |
533 | 532 | ||
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 1fa8be5bd217..eaff0bbb1444 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c | |||
@@ -99,3 +99,4 @@ int is_uv_system(void) | |||
99 | { | 99 | { |
100 | return uv_system_type != UV_NONE; | 100 | return uv_system_type != UV_NONE; |
101 | } | 101 | } |
102 | EXPORT_SYMBOL_GPL(is_uv_system); | ||
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 3fee2aa50f3f..b68e21f06f4f 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c | |||
@@ -62,12 +62,10 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload) | |||
62 | 62 | ||
63 | if (reload) { | 63 | if (reload) { |
64 | #ifdef CONFIG_SMP | 64 | #ifdef CONFIG_SMP |
65 | cpumask_of_cpu_ptr_declare(mask); | ||
66 | |||
67 | preempt_disable(); | 65 | preempt_disable(); |
68 | load_LDT(pc); | 66 | load_LDT(pc); |
69 | cpumask_of_cpu_ptr_next(mask, smp_processor_id()); | 67 | if (!cpus_equal(current->mm->cpu_vm_mask, |
70 | if (!cpus_equal(current->mm->cpu_vm_mask, *mask)) | 68 | cpumask_of_cpu(smp_processor_id()))) |
71 | smp_call_function(flush_ldt, current->mm, 1); | 69 | smp_call_function(flush_ldt, current->mm, 1); |
72 | preempt_enable(); | 70 | preempt_enable(); |
73 | #else | 71 | #else |
diff --git a/arch/x86/kernel/microcode.c b/arch/x86/kernel/microcode.c index 6994c751590e..652fa5c38ebe 100644 --- a/arch/x86/kernel/microcode.c +++ b/arch/x86/kernel/microcode.c | |||
@@ -388,7 +388,6 @@ static int do_microcode_update (void) | |||
388 | void *new_mc = NULL; | 388 | void *new_mc = NULL; |
389 | int cpu; | 389 | int cpu; |
390 | cpumask_t old; | 390 | cpumask_t old; |
391 | cpumask_of_cpu_ptr_declare(newmask); | ||
392 | 391 | ||
393 | old = current->cpus_allowed; | 392 | old = current->cpus_allowed; |
394 | 393 | ||
@@ -405,8 +404,7 @@ static int do_microcode_update (void) | |||
405 | 404 | ||
406 | if (!uci->valid) | 405 | if (!uci->valid) |
407 | continue; | 406 | continue; |
408 | cpumask_of_cpu_ptr_next(newmask, cpu); | 407 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
409 | set_cpus_allowed_ptr(current, newmask); | ||
410 | error = get_maching_microcode(new_mc, cpu); | 408 | error = get_maching_microcode(new_mc, cpu); |
411 | if (error < 0) | 409 | if (error < 0) |
412 | goto out; | 410 | goto out; |
@@ -576,7 +574,6 @@ static int apply_microcode_check_cpu(int cpu) | |||
576 | struct cpuinfo_x86 *c = &cpu_data(cpu); | 574 | struct cpuinfo_x86 *c = &cpu_data(cpu); |
577 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 575 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
578 | cpumask_t old; | 576 | cpumask_t old; |
579 | cpumask_of_cpu_ptr(newmask, cpu); | ||
580 | unsigned int val[2]; | 577 | unsigned int val[2]; |
581 | int err = 0; | 578 | int err = 0; |
582 | 579 | ||
@@ -585,7 +582,7 @@ static int apply_microcode_check_cpu(int cpu) | |||
585 | return 0; | 582 | return 0; |
586 | 583 | ||
587 | old = current->cpus_allowed; | 584 | old = current->cpus_allowed; |
588 | set_cpus_allowed_ptr(current, newmask); | 585 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
589 | 586 | ||
590 | /* Check if the microcode we have in memory matches the CPU */ | 587 | /* Check if the microcode we have in memory matches the CPU */ |
591 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | 588 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || |
@@ -623,12 +620,11 @@ static int apply_microcode_check_cpu(int cpu) | |||
623 | static void microcode_init_cpu(int cpu, int resume) | 620 | static void microcode_init_cpu(int cpu, int resume) |
624 | { | 621 | { |
625 | cpumask_t old; | 622 | cpumask_t old; |
626 | cpumask_of_cpu_ptr(newmask, cpu); | ||
627 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 623 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
628 | 624 | ||
629 | old = current->cpus_allowed; | 625 | old = current->cpus_allowed; |
630 | 626 | ||
631 | set_cpus_allowed_ptr(current, newmask); | 627 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
632 | mutex_lock(µcode_mutex); | 628 | mutex_lock(µcode_mutex); |
633 | collect_cpu_info(cpu); | 629 | collect_cpu_info(cpu); |
634 | if (uci->valid && system_state == SYSTEM_RUNNING && !resume) | 630 | if (uci->valid && system_state == SYSTEM_RUNNING && !resume) |
@@ -661,13 +657,10 @@ static ssize_t reload_store(struct sys_device *dev, | |||
661 | if (end == buf) | 657 | if (end == buf) |
662 | return -EINVAL; | 658 | return -EINVAL; |
663 | if (val == 1) { | 659 | if (val == 1) { |
664 | cpumask_t old; | 660 | cpumask_t old = current->cpus_allowed; |
665 | cpumask_of_cpu_ptr(newmask, cpu); | ||
666 | |||
667 | old = current->cpus_allowed; | ||
668 | 661 | ||
669 | get_online_cpus(); | 662 | get_online_cpus(); |
670 | set_cpus_allowed_ptr(current, newmask); | 663 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
671 | 664 | ||
672 | mutex_lock(µcode_mutex); | 665 | mutex_lock(µcode_mutex); |
673 | if (uci->valid) | 666 | if (uci->valid) |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 37544123896d..87d4d6964ec2 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -123,6 +123,14 @@ void __init pci_iommu_alloc(void) | |||
123 | 123 | ||
124 | pci_swiotlb_init(); | 124 | pci_swiotlb_init(); |
125 | } | 125 | } |
126 | |||
127 | unsigned long iommu_num_pages(unsigned long addr, unsigned long len) | ||
128 | { | ||
129 | unsigned long size = roundup((addr & ~PAGE_MASK) + len, PAGE_SIZE); | ||
130 | |||
131 | return size >> PAGE_SHIFT; | ||
132 | } | ||
133 | EXPORT_SYMBOL(iommu_num_pages); | ||
126 | #endif | 134 | #endif |
127 | 135 | ||
128 | /* | 136 | /* |
@@ -192,124 +200,6 @@ static __init int iommu_setup(char *p) | |||
192 | } | 200 | } |
193 | early_param("iommu", iommu_setup); | 201 | early_param("iommu", iommu_setup); |
194 | 202 | ||
195 | #ifdef CONFIG_X86_32 | ||
196 | int dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | ||
197 | dma_addr_t device_addr, size_t size, int flags) | ||
198 | { | ||
199 | void __iomem *mem_base = NULL; | ||
200 | int pages = size >> PAGE_SHIFT; | ||
201 | int bitmap_size = BITS_TO_LONGS(pages) * sizeof(long); | ||
202 | |||
203 | if ((flags & (DMA_MEMORY_MAP | DMA_MEMORY_IO)) == 0) | ||
204 | goto out; | ||
205 | if (!size) | ||
206 | goto out; | ||
207 | if (dev->dma_mem) | ||
208 | goto out; | ||
209 | |||
210 | /* FIXME: this routine just ignores DMA_MEMORY_INCLUDES_CHILDREN */ | ||
211 | |||
212 | mem_base = ioremap(bus_addr, size); | ||
213 | if (!mem_base) | ||
214 | goto out; | ||
215 | |||
216 | dev->dma_mem = kzalloc(sizeof(struct dma_coherent_mem), GFP_KERNEL); | ||
217 | if (!dev->dma_mem) | ||
218 | goto out; | ||
219 | dev->dma_mem->bitmap = kzalloc(bitmap_size, GFP_KERNEL); | ||
220 | if (!dev->dma_mem->bitmap) | ||
221 | goto free1_out; | ||
222 | |||
223 | dev->dma_mem->virt_base = mem_base; | ||
224 | dev->dma_mem->device_base = device_addr; | ||
225 | dev->dma_mem->size = pages; | ||
226 | dev->dma_mem->flags = flags; | ||
227 | |||
228 | if (flags & DMA_MEMORY_MAP) | ||
229 | return DMA_MEMORY_MAP; | ||
230 | |||
231 | return DMA_MEMORY_IO; | ||
232 | |||
233 | free1_out: | ||
234 | kfree(dev->dma_mem); | ||
235 | out: | ||
236 | if (mem_base) | ||
237 | iounmap(mem_base); | ||
238 | return 0; | ||
239 | } | ||
240 | EXPORT_SYMBOL(dma_declare_coherent_memory); | ||
241 | |||
242 | void dma_release_declared_memory(struct device *dev) | ||
243 | { | ||
244 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
245 | |||
246 | if (!mem) | ||
247 | return; | ||
248 | dev->dma_mem = NULL; | ||
249 | iounmap(mem->virt_base); | ||
250 | kfree(mem->bitmap); | ||
251 | kfree(mem); | ||
252 | } | ||
253 | EXPORT_SYMBOL(dma_release_declared_memory); | ||
254 | |||
255 | void *dma_mark_declared_memory_occupied(struct device *dev, | ||
256 | dma_addr_t device_addr, size_t size) | ||
257 | { | ||
258 | struct dma_coherent_mem *mem = dev->dma_mem; | ||
259 | int pos, err; | ||
260 | int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1); | ||
261 | |||
262 | pages >>= PAGE_SHIFT; | ||
263 | |||
264 | if (!mem) | ||
265 | return ERR_PTR(-EINVAL); | ||
266 | |||
267 | pos = (device_addr - mem->device_base) >> PAGE_SHIFT; | ||
268 | err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); | ||
269 | if (err != 0) | ||
270 | return ERR_PTR(err); | ||
271 | return mem->virt_base + (pos << PAGE_SHIFT); | ||
272 | } | ||
273 | EXPORT_SYMBOL(dma_mark_declared_memory_occupied); | ||
274 | |||
275 | static int dma_alloc_from_coherent_mem(struct device *dev, ssize_t size, | ||
276 | dma_addr_t *dma_handle, void **ret) | ||
277 | { | ||
278 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | ||
279 | int order = get_order(size); | ||
280 | |||
281 | if (mem) { | ||
282 | int page = bitmap_find_free_region(mem->bitmap, mem->size, | ||
283 | order); | ||
284 | if (page >= 0) { | ||
285 | *dma_handle = mem->device_base + (page << PAGE_SHIFT); | ||
286 | *ret = mem->virt_base + (page << PAGE_SHIFT); | ||
287 | memset(*ret, 0, size); | ||
288 | } | ||
289 | if (mem->flags & DMA_MEMORY_EXCLUSIVE) | ||
290 | *ret = NULL; | ||
291 | } | ||
292 | return (mem != NULL); | ||
293 | } | ||
294 | |||
295 | static int dma_release_coherent(struct device *dev, int order, void *vaddr) | ||
296 | { | ||
297 | struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL; | ||
298 | |||
299 | if (mem && vaddr >= mem->virt_base && vaddr < | ||
300 | (mem->virt_base + (mem->size << PAGE_SHIFT))) { | ||
301 | int page = (vaddr - mem->virt_base) >> PAGE_SHIFT; | ||
302 | |||
303 | bitmap_release_region(mem->bitmap, page, order); | ||
304 | return 1; | ||
305 | } | ||
306 | return 0; | ||
307 | } | ||
308 | #else | ||
309 | #define dma_alloc_from_coherent_mem(dev, size, handle, ret) (0) | ||
310 | #define dma_release_coherent(dev, order, vaddr) (0) | ||
311 | #endif /* CONFIG_X86_32 */ | ||
312 | |||
313 | int dma_supported(struct device *dev, u64 mask) | 203 | int dma_supported(struct device *dev, u64 mask) |
314 | { | 204 | { |
315 | struct dma_mapping_ops *ops = get_dma_ops(dev); | 205 | struct dma_mapping_ops *ops = get_dma_ops(dev); |
@@ -379,7 +269,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
379 | /* ignore region specifiers */ | 269 | /* ignore region specifiers */ |
380 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); | 270 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); |
381 | 271 | ||
382 | if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory)) | 272 | if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) |
383 | return memory; | 273 | return memory; |
384 | 274 | ||
385 | if (!dev) { | 275 | if (!dev) { |
@@ -484,7 +374,7 @@ void dma_free_coherent(struct device *dev, size_t size, | |||
484 | 374 | ||
485 | int order = get_order(size); | 375 | int order = get_order(size); |
486 | WARN_ON(irqs_disabled()); /* for portability */ | 376 | WARN_ON(irqs_disabled()); /* for portability */ |
487 | if (dma_release_coherent(dev, order, vaddr)) | 377 | if (dma_release_from_coherent(dev, order, vaddr)) |
488 | return; | 378 | return; |
489 | if (ops->unmap_single) | 379 | if (ops->unmap_single) |
490 | ops->unmap_single(dev, bus, size, 0); | 380 | ops->unmap_single(dev, bus, size, 0); |
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 744126e64950..49285f8fd4d5 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -67,9 +67,6 @@ static u32 gart_unmapped_entry; | |||
67 | (((x) & 0xfffff000) | (((x) >> 32) << 4) | GPTE_VALID | GPTE_COHERENT) | 67 | (((x) & 0xfffff000) | (((x) >> 32) << 4) | GPTE_VALID | GPTE_COHERENT) |
68 | #define GPTE_DECODE(x) (((x) & 0xfffff000) | (((u64)(x) & 0xff0) << 28)) | 68 | #define GPTE_DECODE(x) (((x) & 0xfffff000) | (((u64)(x) & 0xff0) << 28)) |
69 | 69 | ||
70 | #define to_pages(addr, size) \ | ||
71 | (round_up(((addr) & ~PAGE_MASK) + (size), PAGE_SIZE) >> PAGE_SHIFT) | ||
72 | |||
73 | #define EMERGENCY_PAGES 32 /* = 128KB */ | 70 | #define EMERGENCY_PAGES 32 /* = 128KB */ |
74 | 71 | ||
75 | #ifdef CONFIG_AGP | 72 | #ifdef CONFIG_AGP |
@@ -241,7 +238,7 @@ nonforced_iommu(struct device *dev, unsigned long addr, size_t size) | |||
241 | static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem, | 238 | static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem, |
242 | size_t size, int dir) | 239 | size_t size, int dir) |
243 | { | 240 | { |
244 | unsigned long npages = to_pages(phys_mem, size); | 241 | unsigned long npages = iommu_num_pages(phys_mem, size); |
245 | unsigned long iommu_page = alloc_iommu(dev, npages); | 242 | unsigned long iommu_page = alloc_iommu(dev, npages); |
246 | int i; | 243 | int i; |
247 | 244 | ||
@@ -304,7 +301,7 @@ static void gart_unmap_single(struct device *dev, dma_addr_t dma_addr, | |||
304 | return; | 301 | return; |
305 | 302 | ||
306 | iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT; | 303 | iommu_page = (dma_addr - iommu_bus_base)>>PAGE_SHIFT; |
307 | npages = to_pages(dma_addr, size); | 304 | npages = iommu_num_pages(dma_addr, size); |
308 | for (i = 0; i < npages; i++) { | 305 | for (i = 0; i < npages; i++) { |
309 | iommu_gatt_base[iommu_page + i] = gart_unmapped_entry; | 306 | iommu_gatt_base[iommu_page + i] = gart_unmapped_entry; |
310 | CLEAR_LEAK(iommu_page + i); | 307 | CLEAR_LEAK(iommu_page + i); |
@@ -387,7 +384,7 @@ static int __dma_map_cont(struct device *dev, struct scatterlist *start, | |||
387 | } | 384 | } |
388 | 385 | ||
389 | addr = phys_addr; | 386 | addr = phys_addr; |
390 | pages = to_pages(s->offset, s->length); | 387 | pages = iommu_num_pages(s->offset, s->length); |
391 | while (pages--) { | 388 | while (pages--) { |
392 | iommu_gatt_base[iommu_page] = GPTE_ENCODE(addr); | 389 | iommu_gatt_base[iommu_page] = GPTE_ENCODE(addr); |
393 | SET_LEAK(iommu_page); | 390 | SET_LEAK(iommu_page); |
@@ -470,7 +467,7 @@ gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) | |||
470 | 467 | ||
471 | seg_size += s->length; | 468 | seg_size += s->length; |
472 | need = nextneed; | 469 | need = nextneed; |
473 | pages += to_pages(s->offset, s->length); | 470 | pages += iommu_num_pages(s->offset, s->length); |
474 | ps = s; | 471 | ps = s; |
475 | } | 472 | } |
476 | if (dma_map_cont(dev, start_sg, i - start, sgmap, pages, need) < 0) | 473 | if (dma_map_cont(dev, start_sg, i - start, sgmap, pages, need) < 0) |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 06a9f643817e..724adfc63cb9 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -414,25 +414,20 @@ void native_machine_shutdown(void) | |||
414 | 414 | ||
415 | /* The boot cpu is always logical cpu 0 */ | 415 | /* The boot cpu is always logical cpu 0 */ |
416 | int reboot_cpu_id = 0; | 416 | int reboot_cpu_id = 0; |
417 | cpumask_of_cpu_ptr(newmask, reboot_cpu_id); | ||
418 | 417 | ||
419 | #ifdef CONFIG_X86_32 | 418 | #ifdef CONFIG_X86_32 |
420 | /* See if there has been given a command line override */ | 419 | /* See if there has been given a command line override */ |
421 | if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) && | 420 | if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) && |
422 | cpu_online(reboot_cpu)) { | 421 | cpu_online(reboot_cpu)) |
423 | reboot_cpu_id = reboot_cpu; | 422 | reboot_cpu_id = reboot_cpu; |
424 | cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id); | ||
425 | } | ||
426 | #endif | 423 | #endif |
427 | 424 | ||
428 | /* Make certain the cpu I'm about to reboot on is online */ | 425 | /* Make certain the cpu I'm about to reboot on is online */ |
429 | if (!cpu_online(reboot_cpu_id)) { | 426 | if (!cpu_online(reboot_cpu_id)) |
430 | reboot_cpu_id = smp_processor_id(); | 427 | reboot_cpu_id = smp_processor_id(); |
431 | cpumask_of_cpu_ptr_next(newmask, reboot_cpu_id); | ||
432 | } | ||
433 | 428 | ||
434 | /* Make certain I only run on the appropriate processor */ | 429 | /* Make certain I only run on the appropriate processor */ |
435 | set_cpus_allowed_ptr(current, newmask); | 430 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id)); |
436 | 431 | ||
437 | /* O.K Now that I'm on the appropriate processor, | 432 | /* O.K Now that I'm on the appropriate processor, |
438 | * stop all of the others. | 433 | * stop all of the others. |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index b520dae02bf4..2d888586385d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -788,10 +788,6 @@ void __init setup_arch(char **cmdline_p) | |||
788 | 788 | ||
789 | initmem_init(0, max_pfn); | 789 | initmem_init(0, max_pfn); |
790 | 790 | ||
791 | #ifdef CONFIG_X86_64 | ||
792 | dma32_reserve_bootmem(); | ||
793 | #endif | ||
794 | |||
795 | #ifdef CONFIG_ACPI_SLEEP | 791 | #ifdef CONFIG_ACPI_SLEEP |
796 | /* | 792 | /* |
797 | * Reserve low memory region for sleep support. | 793 | * Reserve low memory region for sleep support. |
@@ -806,6 +802,15 @@ void __init setup_arch(char **cmdline_p) | |||
806 | #endif | 802 | #endif |
807 | reserve_crashkernel(); | 803 | reserve_crashkernel(); |
808 | 804 | ||
805 | #ifdef CONFIG_X86_64 | ||
806 | /* | ||
807 | * dma32_reserve_bootmem() allocates bootmem which may conflict | ||
808 | * with the crashkernel command line, so do that after | ||
809 | * reserve_crashkernel() | ||
810 | */ | ||
811 | dma32_reserve_bootmem(); | ||
812 | #endif | ||
813 | |||
809 | reserve_ibft_region(); | 814 | reserve_ibft_region(); |
810 | 815 | ||
811 | #ifdef CONFIG_KVM_CLOCK | 816 | #ifdef CONFIG_KVM_CLOCK |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index f7745f94c006..76e305e064f9 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
@@ -80,24 +80,6 @@ static void __init setup_per_cpu_maps(void) | |||
80 | #endif | 80 | #endif |
81 | } | 81 | } |
82 | 82 | ||
83 | #ifdef CONFIG_HAVE_CPUMASK_OF_CPU_MAP | ||
84 | cpumask_t *cpumask_of_cpu_map __read_mostly; | ||
85 | EXPORT_SYMBOL(cpumask_of_cpu_map); | ||
86 | |||
87 | /* requires nr_cpu_ids to be initialized */ | ||
88 | static void __init setup_cpumask_of_cpu(void) | ||
89 | { | ||
90 | int i; | ||
91 | |||
92 | /* alloc_bootmem zeroes memory */ | ||
93 | cpumask_of_cpu_map = alloc_bootmem_low(sizeof(cpumask_t) * nr_cpu_ids); | ||
94 | for (i = 0; i < nr_cpu_ids; i++) | ||
95 | cpu_set(i, cpumask_of_cpu_map[i]); | ||
96 | } | ||
97 | #else | ||
98 | static inline void setup_cpumask_of_cpu(void) { } | ||
99 | #endif | ||
100 | |||
101 | #ifdef CONFIG_X86_32 | 83 | #ifdef CONFIG_X86_32 |
102 | /* | 84 | /* |
103 | * Great future not-so-futuristic plan: make i386 and x86_64 do it | 85 | * Great future not-so-futuristic plan: make i386 and x86_64 do it |
@@ -197,9 +179,6 @@ void __init setup_per_cpu_areas(void) | |||
197 | 179 | ||
198 | /* Setup node to cpumask map */ | 180 | /* Setup node to cpumask map */ |
199 | setup_node_to_cpumask_map(); | 181 | setup_node_to_cpumask_map(); |
200 | |||
201 | /* Setup cpumask_of_cpu map */ | ||
202 | setup_cpumask_of_cpu(); | ||
203 | } | 182 | } |
204 | 183 | ||
205 | #endif | 184 | #endif |
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 8d45fabc5f3b..ce3251ce5504 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -21,6 +21,7 @@ config KVM | |||
21 | tristate "Kernel-based Virtual Machine (KVM) support" | 21 | tristate "Kernel-based Virtual Machine (KVM) support" |
22 | depends on HAVE_KVM | 22 | depends on HAVE_KVM |
23 | select PREEMPT_NOTIFIERS | 23 | select PREEMPT_NOTIFIERS |
24 | select MMU_NOTIFIER | ||
24 | select ANON_INODES | 25 | select ANON_INODES |
25 | ---help--- | 26 | ---help--- |
26 | Support hosting fully virtualized guest machines using hardware | 27 | Support hosting fully virtualized guest machines using hardware |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 0313a5eec412..d9249a882aa5 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -1014,6 +1014,9 @@ __init void lguest_init(void) | |||
1014 | init_pg_tables_start = __pa(pg0); | 1014 | init_pg_tables_start = __pa(pg0); |
1015 | init_pg_tables_end = __pa(pg0); | 1015 | init_pg_tables_end = __pa(pg0); |
1016 | 1016 | ||
1017 | /* As described in head_32.S, we map the first 128M of memory. */ | ||
1018 | max_pfn_mapped = (128*1024*1024) >> PAGE_SHIFT; | ||
1019 | |||
1017 | /* Load the %fs segment register (the per-cpu segment register) with | 1020 | /* Load the %fs segment register (the per-cpu segment register) with |
1018 | * the normal data segment to get through booting. */ | 1021 | * the normal data segment to get through booting. */ |
1019 | asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory"); | 1022 | asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory"); |
diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S index dfdf428975c0..f118c110af32 100644 --- a/arch/x86/lib/copy_user_64.S +++ b/arch/x86/lib/copy_user_64.S | |||
@@ -52,7 +52,7 @@ | |||
52 | jnz 100b | 52 | jnz 100b |
53 | 102: | 53 | 102: |
54 | .section .fixup,"ax" | 54 | .section .fixup,"ax" |
55 | 103: addl %r8d,%edx /* ecx is zerorest also */ | 55 | 103: addl %ecx,%edx /* ecx is zerorest also */ |
56 | jmp copy_user_handle_tail | 56 | jmp copy_user_handle_tail |
57 | .previous | 57 | .previous |
58 | 58 | ||
diff --git a/arch/x86/lib/copy_user_nocache_64.S b/arch/x86/lib/copy_user_nocache_64.S index 40e0e309d27e..cb0c112386fb 100644 --- a/arch/x86/lib/copy_user_nocache_64.S +++ b/arch/x86/lib/copy_user_nocache_64.S | |||
@@ -32,7 +32,7 @@ | |||
32 | jnz 100b | 32 | jnz 100b |
33 | 102: | 33 | 102: |
34 | .section .fixup,"ax" | 34 | .section .fixup,"ax" |
35 | 103: addl %r8d,%edx /* ecx is zerorest also */ | 35 | 103: addl %ecx,%edx /* ecx is zerorest also */ |
36 | jmp copy_user_handle_tail | 36 | jmp copy_user_handle_tail |
37 | .previous | 37 | .previous |
38 | 38 | ||
@@ -108,7 +108,6 @@ ENTRY(__copy_user_nocache) | |||
108 | jmp 60f | 108 | jmp 60f |
109 | 50: movl %ecx,%edx | 109 | 50: movl %ecx,%edx |
110 | 60: sfence | 110 | 60: sfence |
111 | movl %r8d,%ecx | ||
112 | jmp copy_user_handle_tail | 111 | jmp copy_user_handle_tail |
113 | .previous | 112 | .previous |
114 | 113 | ||
diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 3085f25b4355..007bb06c7504 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c | |||
@@ -223,14 +223,17 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
223 | struct page **pages) | 223 | struct page **pages) |
224 | { | 224 | { |
225 | struct mm_struct *mm = current->mm; | 225 | struct mm_struct *mm = current->mm; |
226 | unsigned long end = start + (nr_pages << PAGE_SHIFT); | 226 | unsigned long addr, len, end; |
227 | unsigned long addr = start; | ||
228 | unsigned long next; | 227 | unsigned long next; |
229 | pgd_t *pgdp; | 228 | pgd_t *pgdp; |
230 | int nr = 0; | 229 | int nr = 0; |
231 | 230 | ||
231 | start &= PAGE_MASK; | ||
232 | addr = start; | ||
233 | len = (unsigned long) nr_pages << PAGE_SHIFT; | ||
234 | end = start + len; | ||
232 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 235 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, |
233 | start, nr_pages*PAGE_SIZE))) | 236 | start, len))) |
234 | goto slow_irqon; | 237 | goto slow_irqon; |
235 | 238 | ||
236 | /* | 239 | /* |
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index ff3a6a336342..4bdaa590375d 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -23,7 +23,8 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
23 | pci_read_config_byte(d, reg++, &busno); | 23 | pci_read_config_byte(d, reg++, &busno); |
24 | pci_read_config_byte(d, reg++, &suba); | 24 | pci_read_config_byte(d, reg++, &suba); |
25 | pci_read_config_byte(d, reg++, &subb); | 25 | pci_read_config_byte(d, reg++, &subb); |
26 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 26 | dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, |
27 | suba, subb); | ||
27 | if (busno) | 28 | if (busno) |
28 | pci_scan_bus_with_sysdata(busno); /* Bus A */ | 29 | pci_scan_bus_with_sysdata(busno); /* Bus A */ |
29 | if (suba < subb) | 30 | if (suba < subb) |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index a09505806b82..5807d1bc73f7 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -128,10 +128,8 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
128 | pr = pci_find_parent_resource(dev, r); | 128 | pr = pci_find_parent_resource(dev, r); |
129 | if (!r->start || !pr || | 129 | if (!r->start || !pr || |
130 | request_resource(pr, r) < 0) { | 130 | request_resource(pr, r) < 0) { |
131 | printk(KERN_ERR "PCI: Cannot allocate " | 131 | dev_err(&dev->dev, "BAR %d: can't " |
132 | "resource region %d " | 132 | "allocate resource\n", idx); |
133 | "of bridge %s\n", | ||
134 | idx, pci_name(dev)); | ||
135 | /* | 133 | /* |
136 | * Something is wrong with the region. | 134 | * Something is wrong with the region. |
137 | * Invalidate the resource to prevent | 135 | * Invalidate the resource to prevent |
@@ -166,15 +164,15 @@ static void __init pcibios_allocate_resources(int pass) | |||
166 | else | 164 | else |
167 | disabled = !(command & PCI_COMMAND_MEMORY); | 165 | disabled = !(command & PCI_COMMAND_MEMORY); |
168 | if (pass == disabled) { | 166 | if (pass == disabled) { |
169 | DBG("PCI: Resource %08lx-%08lx " | 167 | dev_dbg(&dev->dev, "resource %#08llx-%#08llx " |
170 | "(f=%lx, d=%d, p=%d)\n", | 168 | "(f=%lx, d=%d, p=%d)\n", |
171 | r->start, r->end, r->flags, disabled, pass); | 169 | (unsigned long long) r->start, |
170 | (unsigned long long) r->end, | ||
171 | r->flags, disabled, pass); | ||
172 | pr = pci_find_parent_resource(dev, r); | 172 | pr = pci_find_parent_resource(dev, r); |
173 | if (!pr || request_resource(pr, r) < 0) { | 173 | if (!pr || request_resource(pr, r) < 0) { |
174 | printk(KERN_ERR "PCI: Cannot allocate " | 174 | dev_err(&dev->dev, "BAR %d: can't " |
175 | "resource region %d " | 175 | "allocate resource\n", idx); |
176 | "of device %s\n", | ||
177 | idx, pci_name(dev)); | ||
178 | /* We'll assign a new address later */ | 176 | /* We'll assign a new address later */ |
179 | r->end -= r->start; | 177 | r->end -= r->start; |
180 | r->start = 0; | 178 | r->start = 0; |
@@ -187,8 +185,7 @@ static void __init pcibios_allocate_resources(int pass) | |||
187 | /* Turn the ROM off, leave the resource region, | 185 | /* Turn the ROM off, leave the resource region, |
188 | * but keep it unregistered. */ | 186 | * but keep it unregistered. */ |
189 | u32 reg; | 187 | u32 reg; |
190 | DBG("PCI: Switching off ROM of %s\n", | 188 | dev_dbg(&dev->dev, "disabling ROM\n"); |
191 | pci_name(dev)); | ||
192 | r->flags &= ~IORESOURCE_ROM_ENABLE; | 189 | r->flags &= ~IORESOURCE_ROM_ENABLE; |
193 | pci_read_config_dword(dev, | 190 | pci_read_config_dword(dev, |
194 | dev->rom_base_reg, ®); | 191 | dev->rom_base_reg, ®); |
@@ -257,8 +254,7 @@ void pcibios_set_master(struct pci_dev *dev) | |||
257 | lat = pcibios_max_latency; | 254 | lat = pcibios_max_latency; |
258 | else | 255 | else |
259 | return; | 256 | return; |
260 | printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", | 257 | dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat); |
261 | pci_name(dev), lat); | ||
262 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | 258 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
263 | } | 259 | } |
264 | 260 | ||
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 6a06a2eb0597..fec0123b33a9 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -436,7 +436,7 @@ static int pirq_vlsi_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | |||
436 | { | 436 | { |
437 | WARN_ON_ONCE(pirq >= 9); | 437 | WARN_ON_ONCE(pirq >= 9); |
438 | if (pirq > 8) { | 438 | if (pirq > 8) { |
439 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 439 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | return read_config_nybble(router, 0x74, pirq-1); | 442 | return read_config_nybble(router, 0x74, pirq-1); |
@@ -446,7 +446,7 @@ static int pirq_vlsi_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
446 | { | 446 | { |
447 | WARN_ON_ONCE(pirq >= 9); | 447 | WARN_ON_ONCE(pirq >= 9); |
448 | if (pirq > 8) { | 448 | if (pirq > 8) { |
449 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 449 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | write_config_nybble(router, 0x74, pirq-1, irq); | 452 | write_config_nybble(router, 0x74, pirq-1, irq); |
@@ -492,15 +492,17 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
492 | irq = 0; | 492 | irq = 0; |
493 | if (pirq <= 4) | 493 | if (pirq <= 4) |
494 | irq = read_config_nybble(router, 0x56, pirq - 1); | 494 | irq = read_config_nybble(router, 0x56, pirq - 1); |
495 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", | 495 | dev_info(&dev->dev, |
496 | dev->vendor, dev->device, pirq, irq); | 496 | "AMD756: dev [%04x/%04x], router PIRQ %d get IRQ %d\n", |
497 | dev->vendor, dev->device, pirq, irq); | ||
497 | return irq; | 498 | return irq; |
498 | } | 499 | } |
499 | 500 | ||
500 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 501 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
501 | { | 502 | { |
502 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", | 503 | dev_info(&dev->dev, |
503 | dev->vendor, dev->device, pirq, irq); | 504 | "AMD756: dev [%04x/%04x], router PIRQ %d set IRQ %d\n", |
505 | dev->vendor, dev->device, pirq, irq); | ||
504 | if (pirq <= 4) | 506 | if (pirq <= 4) |
505 | write_config_nybble(router, 0x56, pirq - 1, irq); | 507 | write_config_nybble(router, 0x56, pirq - 1, irq); |
506 | return 1; | 508 | return 1; |
@@ -730,7 +732,6 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
730 | switch (device) { | 732 | switch (device) { |
731 | case PCI_DEVICE_ID_AL_M1533: | 733 | case PCI_DEVICE_ID_AL_M1533: |
732 | case PCI_DEVICE_ID_AL_M1563: | 734 | case PCI_DEVICE_ID_AL_M1563: |
733 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); | ||
734 | r->name = "ALI"; | 735 | r->name = "ALI"; |
735 | r->get = pirq_ali_get; | 736 | r->get = pirq_ali_get; |
736 | r->set = pirq_ali_set; | 737 | r->set = pirq_ali_set; |
@@ -840,11 +841,9 @@ static void __init pirq_find_router(struct irq_router *r) | |||
840 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) | 841 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) |
841 | break; | 842 | break; |
842 | } | 843 | } |
843 | printk(KERN_INFO "PCI: Using IRQ router %s [%04x/%04x] at %s\n", | 844 | dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x/%04x]\n", |
844 | pirq_router.name, | 845 | pirq_router.name, |
845 | pirq_router_dev->vendor, | 846 | pirq_router_dev->vendor, pirq_router_dev->device); |
846 | pirq_router_dev->device, | ||
847 | pci_name(pirq_router_dev)); | ||
848 | 847 | ||
849 | /* The device remains referenced for the kernel lifetime */ | 848 | /* The device remains referenced for the kernel lifetime */ |
850 | } | 849 | } |
@@ -877,7 +876,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
877 | /* Find IRQ pin */ | 876 | /* Find IRQ pin */ |
878 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 877 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
879 | if (!pin) { | 878 | if (!pin) { |
880 | DBG(KERN_DEBUG " -> no interrupt pin\n"); | 879 | dev_dbg(&dev->dev, "no interrupt pin\n"); |
881 | return 0; | 880 | return 0; |
882 | } | 881 | } |
883 | pin = pin - 1; | 882 | pin = pin - 1; |
@@ -887,20 +886,20 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
887 | if (!pirq_table) | 886 | if (!pirq_table) |
888 | return 0; | 887 | return 0; |
889 | 888 | ||
890 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); | ||
891 | info = pirq_get_info(dev); | 889 | info = pirq_get_info(dev); |
892 | if (!info) { | 890 | if (!info) { |
893 | DBG(" -> not found in routing table\n" KERN_DEBUG); | 891 | dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n", |
892 | 'A' + pin); | ||
894 | return 0; | 893 | return 0; |
895 | } | 894 | } |
896 | pirq = info->irq[pin].link; | 895 | pirq = info->irq[pin].link; |
897 | mask = info->irq[pin].bitmap; | 896 | mask = info->irq[pin].bitmap; |
898 | if (!pirq) { | 897 | if (!pirq) { |
899 | DBG(" -> not routed\n" KERN_DEBUG); | 898 | dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin); |
900 | return 0; | 899 | return 0; |
901 | } | 900 | } |
902 | DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, | 901 | dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x", |
903 | pirq_table->exclusive_irqs); | 902 | 'A' + pin, pirq, mask, pirq_table->exclusive_irqs); |
904 | mask &= pcibios_irq_mask; | 903 | mask &= pcibios_irq_mask; |
905 | 904 | ||
906 | /* Work around broken HP Pavilion Notebooks which assign USB to | 905 | /* Work around broken HP Pavilion Notebooks which assign USB to |
@@ -930,10 +929,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
930 | if (pci_probe & PCI_USE_PIRQ_MASK) | 929 | if (pci_probe & PCI_USE_PIRQ_MASK) |
931 | newirq = 0; | 930 | newirq = 0; |
932 | else | 931 | else |
933 | printk("\n" KERN_WARNING | 932 | dev_warn(&dev->dev, "IRQ %d doesn't match PIRQ mask " |
934 | "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n" | 933 | "%#x; try pci=usepirqmask\n", newirq, mask); |
935 | KERN_DEBUG, newirq, | ||
936 | pci_name(dev)); | ||
937 | } | 934 | } |
938 | if (!newirq && assign) { | 935 | if (!newirq && assign) { |
939 | for (i = 0; i < 16; i++) { | 936 | for (i = 0; i < 16; i++) { |
@@ -944,39 +941,35 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
944 | newirq = i; | 941 | newirq = i; |
945 | } | 942 | } |
946 | } | 943 | } |
947 | DBG(" -> newirq=%d", newirq); | 944 | dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin, newirq); |
948 | 945 | ||
949 | /* Check if it is hardcoded */ | 946 | /* Check if it is hardcoded */ |
950 | if ((pirq & 0xf0) == 0xf0) { | 947 | if ((pirq & 0xf0) == 0xf0) { |
951 | irq = pirq & 0xf; | 948 | irq = pirq & 0xf; |
952 | DBG(" -> hardcoded IRQ %d\n", irq); | 949 | msg = "hardcoded"; |
953 | msg = "Hardcoded"; | ||
954 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ | 950 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ |
955 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { | 951 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { |
956 | DBG(" -> got IRQ %d\n", irq); | 952 | msg = "found"; |
957 | msg = "Found"; | ||
958 | eisa_set_level_irq(irq); | 953 | eisa_set_level_irq(irq); |
959 | } else if (newirq && r->set && | 954 | } else if (newirq && r->set && |
960 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { | 955 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { |
961 | DBG(" -> assigning IRQ %d", newirq); | ||
962 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { | 956 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { |
963 | eisa_set_level_irq(newirq); | 957 | eisa_set_level_irq(newirq); |
964 | DBG(" ... OK\n"); | 958 | msg = "assigned"; |
965 | msg = "Assigned"; | ||
966 | irq = newirq; | 959 | irq = newirq; |
967 | } | 960 | } |
968 | } | 961 | } |
969 | 962 | ||
970 | if (!irq) { | 963 | if (!irq) { |
971 | DBG(" ... failed\n"); | ||
972 | if (newirq && mask == (1 << newirq)) { | 964 | if (newirq && mask == (1 << newirq)) { |
973 | msg = "Guessed"; | 965 | msg = "guessed"; |
974 | irq = newirq; | 966 | irq = newirq; |
975 | } else | 967 | } else { |
968 | dev_dbg(&dev->dev, "can't route interrupt\n"); | ||
976 | return 0; | 969 | return 0; |
970 | } | ||
977 | } | 971 | } |
978 | printk(KERN_INFO "PCI: %s IRQ %d for device %s\n", msg, irq, | 972 | dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin, irq); |
979 | pci_name(dev)); | ||
980 | 973 | ||
981 | /* Update IRQ for all devices with the same pirq value */ | 974 | /* Update IRQ for all devices with the same pirq value */ |
982 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { | 975 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { |
@@ -996,17 +989,17 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
996 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ | 989 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ |
997 | ((1 << dev2->irq) & mask))) { | 990 | ((1 << dev2->irq) & mask))) { |
998 | #ifndef CONFIG_PCI_MSI | 991 | #ifndef CONFIG_PCI_MSI |
999 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", | 992 | dev_info(&dev2->dev, "IRQ routing conflict: " |
1000 | pci_name(dev2), dev2->irq, irq); | 993 | "have IRQ %d, want IRQ %d\n", |
994 | dev2->irq, irq); | ||
1001 | #endif | 995 | #endif |
1002 | continue; | 996 | continue; |
1003 | } | 997 | } |
1004 | dev2->irq = irq; | 998 | dev2->irq = irq; |
1005 | pirq_penalty[irq]++; | 999 | pirq_penalty[irq]++; |
1006 | if (dev != dev2) | 1000 | if (dev != dev2) |
1007 | printk(KERN_INFO | 1001 | dev_info(&dev->dev, "sharing IRQ %d with %s\n", |
1008 | "PCI: Sharing IRQ %d with %s\n", | 1002 | irq, pci_name(dev2)); |
1009 | irq, pci_name(dev2)); | ||
1010 | } | 1003 | } |
1011 | } | 1004 | } |
1012 | return 1; | 1005 | return 1; |
@@ -1025,8 +1018,7 @@ static void __init pcibios_fixup_irqs(void) | |||
1025 | * already in use. | 1018 | * already in use. |
1026 | */ | 1019 | */ |
1027 | if (dev->irq >= 16) { | 1020 | if (dev->irq >= 16) { |
1028 | DBG(KERN_DEBUG "%s: ignoring bogus IRQ %d\n", | 1021 | dev_dbg(&dev->dev, "ignoring bogus IRQ %d\n", dev->irq); |
1029 | pci_name(dev), dev->irq); | ||
1030 | dev->irq = 0; | 1022 | dev->irq = 0; |
1031 | } | 1023 | } |
1032 | /* | 1024 | /* |
@@ -1070,12 +1062,12 @@ static void __init pcibios_fixup_irqs(void) | |||
1070 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1062 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1071 | PCI_SLOT(bridge->devfn), pin); | 1063 | PCI_SLOT(bridge->devfn), pin); |
1072 | if (irq >= 0) | 1064 | if (irq >= 0) |
1073 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1065 | dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n", |
1074 | pci_name(bridge), 'A' + pin, irq); | 1066 | pci_name(bridge), |
1067 | 'A' + pin, irq); | ||
1075 | } | 1068 | } |
1076 | if (irq >= 0) { | 1069 | if (irq >= 0) { |
1077 | printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1070 | dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq); |
1078 | pci_name(dev), 'A' + pin, irq); | ||
1079 | dev->irq = irq; | 1071 | dev->irq = irq; |
1080 | } | 1072 | } |
1081 | } | 1073 | } |
@@ -1231,25 +1223,24 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1231 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1223 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1232 | PCI_SLOT(bridge->devfn), pin); | 1224 | PCI_SLOT(bridge->devfn), pin); |
1233 | if (irq >= 0) | 1225 | if (irq >= 0) |
1234 | printk(KERN_WARNING | 1226 | dev_warn(&dev->dev, "using bridge %s " |
1235 | "PCI: using PPB %s[%c] to get irq %d\n", | 1227 | "INT %c to get IRQ %d\n", |
1236 | pci_name(bridge), | 1228 | pci_name(bridge), 'A' + pin, |
1237 | 'A' + pin, irq); | 1229 | irq); |
1238 | dev = bridge; | 1230 | dev = bridge; |
1239 | } | 1231 | } |
1240 | dev = temp_dev; | 1232 | dev = temp_dev; |
1241 | if (irq >= 0) { | 1233 | if (irq >= 0) { |
1242 | printk(KERN_INFO | 1234 | dev_info(&dev->dev, "PCI->APIC IRQ transform: " |
1243 | "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1235 | "INT %c -> IRQ %d\n", 'A' + pin, irq); |
1244 | pci_name(dev), 'A' + pin, irq); | ||
1245 | dev->irq = irq; | 1236 | dev->irq = irq; |
1246 | return 0; | 1237 | return 0; |
1247 | } else | 1238 | } else |
1248 | msg = " Probably buggy MP table."; | 1239 | msg = "; probably buggy MP table"; |
1249 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) | 1240 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) |
1250 | msg = ""; | 1241 | msg = ""; |
1251 | else | 1242 | else |
1252 | msg = " Please try using pci=biosirq."; | 1243 | msg = "; please try using pci=biosirq"; |
1253 | 1244 | ||
1254 | /* | 1245 | /* |
1255 | * With IDE legacy devices the IRQ lookup failure is not | 1246 | * With IDE legacy devices the IRQ lookup failure is not |
@@ -1259,9 +1250,8 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1259 | !(dev->class & 0x5)) | 1250 | !(dev->class & 0x5)) |
1260 | return 0; | 1251 | return 0; |
1261 | 1252 | ||
1262 | printk(KERN_WARNING | 1253 | dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n", |
1263 | "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", | 1254 | 'A' + pin, msg); |
1264 | 'A' + pin, pci_name(dev), msg); | ||
1265 | } | 1255 | } |
1266 | return 0; | 1256 | return 0; |
1267 | } | 1257 | } |
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c index f4b16dc11dad..1177845d3186 100644 --- a/arch/x86/pci/numaq_32.c +++ b/arch/x86/pci/numaq_32.c | |||
@@ -131,13 +131,14 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
131 | u8 busno, suba, subb; | 131 | u8 busno, suba, subb; |
132 | int quad = BUS2QUAD(d->bus->number); | 132 | int quad = BUS2QUAD(d->bus->number); |
133 | 133 | ||
134 | printk("PCI: Searching for i450NX host bridges on %s\n", pci_name(d)); | 134 | dev_info(&d->dev, "searching for i450NX host bridges\n"); |
135 | reg = 0xd0; | 135 | reg = 0xd0; |
136 | for(pxb=0; pxb<2; pxb++) { | 136 | for(pxb=0; pxb<2; pxb++) { |
137 | pci_read_config_byte(d, reg++, &busno); | 137 | pci_read_config_byte(d, reg++, &busno); |
138 | pci_read_config_byte(d, reg++, &suba); | 138 | pci_read_config_byte(d, reg++, &suba); |
139 | pci_read_config_byte(d, reg++, &subb); | 139 | pci_read_config_byte(d, reg++, &subb); |
140 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 140 | dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", |
141 | pxb, busno, suba, subb); | ||
141 | if (busno) { | 142 | if (busno) { |
142 | /* Bus A */ | 143 | /* Bus A */ |
143 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno)); | 144 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno)); |