diff options
Diffstat (limited to 'include')
45 files changed, 735 insertions, 145 deletions
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h index 8d67907fd4f0..d710204ac747 100644 --- a/include/asm-arm/arch-aaec2000/io.h +++ b/include/asm-arm/arch-aaec2000/io.h | |||
@@ -16,6 +16,5 @@ | |||
16 | */ | 16 | */ |
17 | #define __io(a) ((void __iomem *)(a)) | 17 | #define __io(a) ((void __iomem *)(a)) |
18 | #define __mem_pci(a) (a) | 18 | #define __mem_pci(a) (a) |
19 | #define __mem_isa(a) (a) | ||
20 | 19 | ||
21 | #endif | 20 | #endif |
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h index 62613b0e2d96..53d790202c19 100644 --- a/include/asm-arm/arch-clps711x/io.h +++ b/include/asm-arm/arch-clps711x/io.h | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
28 | #define __mem_pci(a) (a) | 28 | #define __mem_pci(a) (a) |
29 | #define __mem_isa(a) (a) | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * We don't support ins[lb]/outs[lb]. Make them fault. | 31 | * We don't support ins[lb]/outs[lb]. Make them fault. |
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index 776f9d377057..f9c729141860 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h | |||
@@ -24,7 +24,6 @@ | |||
24 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 24 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) |
25 | #if 1 | 25 | #if 1 |
26 | #define __mem_pci(a) (a) | 26 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) ((a) + PCIMEM_BASE) | ||
28 | #else | 27 | #else |
29 | 28 | ||
30 | static inline void __iomem *___mem_pci(void __iomem *p) | 29 | static inline void __iomem *___mem_pci(void __iomem *p) |
@@ -34,14 +33,7 @@ static inline void __iomem *___mem_pci(void __iomem *p) | |||
34 | return p; | 33 | return p; |
35 | } | 34 | } |
36 | 35 | ||
37 | static inline void __iomem *___mem_isa(void __iomem *p) | ||
38 | { | ||
39 | unsigned long a = (unsigned long)p; | ||
40 | BUG_ON(a >= 16*1048576); | ||
41 | return p + PCIMEM_BASE; | ||
42 | } | ||
43 | #define __mem_pci(a) ___mem_pci(a) | 36 | #define __mem_pci(a) ___mem_pci(a) |
44 | #define __mem_isa(a) ___mem_isa(a) | ||
45 | #endif | 37 | #endif |
46 | 38 | ||
47 | #endif | 39 | #endif |
diff --git a/include/asm-arm/arch-ep93xx/ep93xx-regs.h b/include/asm-arm/arch-ep93xx/ep93xx-regs.h index 71cea0b5841b..8c322975f96e 100644 --- a/include/asm-arm/arch-ep93xx/ep93xx-regs.h +++ b/include/asm-arm/arch-ep93xx/ep93xx-regs.h | |||
@@ -115,6 +115,8 @@ | |||
115 | #define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000 | 115 | #define EP93XX_SYSCON_CLOCK_USH_EN 0x10000000 |
116 | #define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) | 116 | #define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) |
117 | #define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) | 117 | #define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) |
118 | #define EP93XX_SYSCON_CLOCK_SET1 EP93XX_SYSCON_REG(0x20) | ||
119 | #define EP93XX_SYSCON_CLOCK_SET2 EP93XX_SYSCON_REG(0x24) | ||
118 | #define EP93XX_SYSCON_DEVICE_CONFIG EP93XX_SYSCON_REG(0x80) | 120 | #define EP93XX_SYSCON_DEVICE_CONFIG EP93XX_SYSCON_REG(0x80) |
119 | #define EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE 0x00800000 | 121 | #define EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE 0x00800000 |
120 | #define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) | 122 | #define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) |
diff --git a/include/asm-arm/arch-ep93xx/platform.h b/include/asm-arm/arch-ep93xx/platform.h index df9cbb6ef660..d7a34ce20293 100644 --- a/include/asm-arm/arch-ep93xx/platform.h +++ b/include/asm-arm/arch-ep93xx/platform.h | |||
@@ -8,6 +8,7 @@ void ep93xx_map_io(void); | |||
8 | void ep93xx_init_irq(void); | 8 | void ep93xx_init_irq(void); |
9 | void ep93xx_init_time(unsigned long); | 9 | void ep93xx_init_time(unsigned long); |
10 | void ep93xx_init_devices(void); | 10 | void ep93xx_init_devices(void); |
11 | void ep93xx_clock_init(void); | ||
11 | extern struct sys_timer ep93xx_timer; | 12 | extern struct sys_timer ep93xx_timer; |
12 | 13 | ||
13 | 14 | ||
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h index 31f2deab51b0..c8f2175948bd 100644 --- a/include/asm-arm/arch-integrator/io.h +++ b/include/asm-arm/arch-integrator/io.h | |||
@@ -32,6 +32,5 @@ | |||
32 | 32 | ||
33 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) | 33 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) |
34 | #define __mem_pci(a) (a) | 34 | #define __mem_pci(a) (a) |
35 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) | ||
36 | 35 | ||
37 | #endif | 36 | #endif |
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h index f39046a6ab14..36adbdf5055a 100644 --- a/include/asm-arm/arch-iop3xx/io.h +++ b/include/asm-arm/arch-iop3xx/io.h | |||
@@ -17,6 +17,5 @@ | |||
17 | 17 | ||
18 | #define __io(p) ((void __iomem *)(p)) | 18 | #define __io(p) ((void __iomem *)(p)) |
19 | #define __mem_pci(a) (a) | 19 | #define __mem_pci(a) (a) |
20 | #define __mem_isa(a) (a) | ||
21 | 20 | ||
22 | #endif | 21 | #endif |
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index cab8ad0adf09..cd080d8384d9 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -19,7 +19,6 @@ | |||
19 | */ | 19 | */ |
20 | #define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a))) | 20 | #define __io_pci(a) ((void __iomem *)(PCIO_BASE + (a))) |
21 | #define __mem_pci(a) (a) | 21 | #define __mem_pci(a) (a) |
22 | #define __mem_isa(a) (a) | ||
23 | 22 | ||
24 | #define __ioaddr(p) __io_pci(p) | 23 | #define __ioaddr(p) __io_pci(p) |
25 | 24 | ||
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h index bbcd4335f441..17bc94097481 100644 --- a/include/asm-arm/arch-lh7a40x/io.h +++ b/include/asm-arm/arch-lh7a40x/io.h | |||
@@ -18,6 +18,5 @@ | |||
18 | /* No ISA or PCI bus on this machine. */ | 18 | /* No ISA or PCI bus on this machine. */ |
19 | #define __io(a) ((void __iomem *)(a)) | 19 | #define __io(a) ((void __iomem *)(a)) |
20 | #define __mem_pci(a) (a) | 20 | #define __mem_pci(a) (a) |
21 | #define __mem_isa(a) (a) | ||
22 | 21 | ||
23 | #endif /* __ASM_ARCH_IO_H */ | 22 | #endif /* __ASM_ARCH_IO_H */ |
diff --git a/include/asm-arm/arch-netx/io.h b/include/asm-arm/arch-netx/io.h index 81b7bc47747e..a7a53f80165d 100644 --- a/include/asm-arm/arch-netx/io.h +++ b/include/asm-arm/arch-netx/io.h | |||
@@ -24,6 +24,5 @@ | |||
24 | 24 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 25 | #define __io(a) ((void __iomem *)(a)) |
26 | #define __mem_pci(a) (a) | 26 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) (a) | ||
28 | 27 | ||
29 | #endif | 28 | #endif |
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index b726acfcab14..78f68e6a4f0c 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h | |||
@@ -44,7 +44,6 @@ | |||
44 | */ | 44 | */ |
45 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 45 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) |
46 | #define __mem_pci(a) (a) | 46 | #define __mem_pci(a) (a) |
47 | #define __mem_isa(a) (a) | ||
48 | 47 | ||
49 | /* | 48 | /* |
50 | * ---------------------------------------------------------------------------- | 49 | * ---------------------------------------------------------------------------- |
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h index eb2dd58d397f..7f8d817b446f 100644 --- a/include/asm-arm/arch-pxa/io.h +++ b/include/asm-arm/arch-pxa/io.h | |||
@@ -16,6 +16,5 @@ | |||
16 | */ | 16 | */ |
17 | #define __io(a) ((void __iomem *)(a)) | 17 | #define __io(a) ((void __iomem *)(a)) |
18 | #define __mem_pci(a) (a) | 18 | #define __mem_pci(a) (a) |
19 | #define __mem_isa(a) (a) | ||
20 | 19 | ||
21 | #endif | 20 | #endif |
diff --git a/include/asm-arm/arch-realview/io.h b/include/asm-arm/arch-realview/io.h index d444a68ac330..c70f1dfbe135 100644 --- a/include/asm-arm/arch-realview/io.h +++ b/include/asm-arm/arch-realview/io.h | |||
@@ -29,6 +29,5 @@ static inline void __iomem *__io(unsigned long addr) | |||
29 | 29 | ||
30 | #define __io(a) __io(a) | 30 | #define __io(a) __io(a) |
31 | #define __mem_pci(a) (a) | 31 | #define __mem_pci(a) (a) |
32 | #define __mem_isa(a) (a) | ||
33 | 32 | ||
34 | #endif | 33 | #endif |
diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S index 5f8223e700d3..b7d15d125458 100644 --- a/include/asm-arm/arch-s3c2410/debug-macro.S +++ b/include/asm-arm/arch-s3c2410/debug-macro.S | |||
@@ -33,7 +33,7 @@ | |||
33 | .endm | 33 | .endm |
34 | 34 | ||
35 | .macro senduart,rd,rx | 35 | .macro senduart,rd,rx |
36 | str \rd, [\rx, # S3C2410_UTXH ] | 36 | strb \rd, [\rx, # S3C2410_UTXH ] |
37 | .endm | 37 | .endm |
38 | 38 | ||
39 | .macro busyuart, rd, rx | 39 | .macro busyuart, rd, rx |
@@ -42,6 +42,12 @@ | |||
42 | beq 1001f @ | 42 | beq 1001f @ |
43 | @ FIFO enabled... | 43 | @ FIFO enabled... |
44 | 1003: | 44 | 1003: |
45 | @ check for arm920 vs arm926. currently assume all arm926 | ||
46 | @ devices have an 64 byte FIFO identical to the s3c2440 | ||
47 | mrc p15, 0, \rd, c0, c0 | ||
48 | and \rd, \rd, #0xff0 | ||
49 | teq \rd, #0x260 | ||
50 | beq 1004f | ||
45 | mrc p15, 0, \rd, c1, c0 | 51 | mrc p15, 0, \rd, c1, c0 |
46 | tst \rd, #1 | 52 | tst \rd, #1 |
47 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) | 53 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) |
@@ -50,7 +56,7 @@ | |||
50 | ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] | 56 | ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] |
51 | and \rd, \rd, #0x00ff0000 | 57 | and \rd, \rd, #0x00ff0000 |
52 | teq \rd, #0x00440000 @ is it 2440? | 58 | teq \rd, #0x00440000 @ is it 2440? |
53 | 59 | 1004: | |
54 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] | 60 | ldr \rd, [ \rx, # S3C2410_UFSTAT ] |
55 | moveq \rd, \rd, lsr #SHIFT_2440TXF | 61 | moveq \rd, \rd, lsr #SHIFT_2440TXF |
56 | tst \rd, #S3C2410_UFSTAT_TXFULL | 62 | tst \rd, #S3C2410_UFSTAT_TXFULL |
diff --git a/include/asm-arm/arch-s3c2410/entry-macro.S b/include/asm-arm/arch-s3c2410/entry-macro.S index 894c35cf3b1e..e09a6b8ec153 100644 --- a/include/asm-arm/arch-s3c2410/entry-macro.S +++ b/include/asm-arm/arch-s3c2410/entry-macro.S | |||
@@ -18,8 +18,6 @@ | |||
18 | 18 | ||
19 | #define INTPND (0x10) | 19 | #define INTPND (0x10) |
20 | #define INTOFFSET (0x14) | 20 | #define INTOFFSET (0x14) |
21 | #define EXTINTPEND (0xa8) | ||
22 | #define EXTINTMASK (0xa4) | ||
23 | 21 | ||
24 | #include <asm/hardware.h> | 22 | #include <asm/hardware.h> |
25 | #include <asm/arch/irqs.h> | 23 | #include <asm/arch/irqs.h> |
@@ -28,37 +26,23 @@ | |||
28 | 26 | ||
29 | mov \base, #S3C24XX_VA_IRQ | 27 | mov \base, #S3C24XX_VA_IRQ |
30 | 28 | ||
31 | ldr \irqstat, [ \base, #INTPND] | ||
32 | bics \irqnr, \irqstat, #3<<4 @@ only an GPIO IRQ | ||
33 | beq 2000f | ||
34 | |||
35 | @@ try the interrupt offset register, since it is there | 29 | @@ try the interrupt offset register, since it is there |
36 | 30 | ||
31 | ldr \irqstat, [ \base, #INTPND ] | ||
32 | teq \irqstat, #0 | ||
33 | beq 1002f | ||
37 | ldr \irqnr, [ \base, #INTOFFSET ] | 34 | ldr \irqnr, [ \base, #INTOFFSET ] |
38 | mov \tmp, #1 | 35 | mov \tmp, #1 |
39 | tst \irqstat, \tmp, lsl \irqnr | 36 | tst \irqstat, \tmp, lsl \irqnr |
40 | addne \irqnr, \irqnr, #IRQ_EINT0 | ||
41 | bne 1001f | 37 | bne 1001f |
42 | 38 | ||
43 | @@ the number specified is not a valid irq, so try | 39 | @@ the number specified is not a valid irq, so try |
44 | @@ and work it out for ourselves | 40 | @@ and work it out for ourselves |
45 | 41 | ||
46 | mov \irqnr, #IRQ_EINT0 @@ start here | 42 | mov \irqnr, #0 @@ start here |
47 | b 3000f | ||
48 | |||
49 | 2000: | ||
50 | @@ load the GPIO interrupt register, and check it | ||
51 | |||
52 | add \tmp, \base, #S3C24XX_VA_GPIO - S3C24XX_VA_IRQ | ||
53 | ldr \irqstat, [ \tmp, # EXTINTPEND ] | ||
54 | ldr \irqnr, [ \tmp, # EXTINTMASK ] | ||
55 | bics \irqstat, \irqstat, \irqnr | ||
56 | beq 1001f | ||
57 | |||
58 | mov \irqnr, #(IRQ_EINT4 - 4) | ||
59 | 43 | ||
60 | @@ work out which irq (if any) we got | 44 | @@ work out which irq (if any) we got |
61 | 3000: | 45 | |
62 | movs \tmp, \irqstat, lsl#16 | 46 | movs \tmp, \irqstat, lsl#16 |
63 | addeq \irqnr, \irqnr, #16 | 47 | addeq \irqnr, \irqnr, #16 |
64 | moveq \irqstat, \irqstat, lsr#16 | 48 | moveq \irqstat, \irqstat, lsr#16 |
@@ -75,9 +59,9 @@ | |||
75 | addeq \irqnr, \irqnr, #1 | 59 | addeq \irqnr, \irqnr, #1 |
76 | 60 | ||
77 | @@ we have the value | 61 | @@ we have the value |
78 | movs \irqnr, \irqnr | ||
79 | |||
80 | 1001: | 62 | 1001: |
63 | adds \irqnr, \irqnr, #IRQ_EINT0 | ||
64 | 1002: | ||
81 | @@ exit here, Z flag unset if IRQ | 65 | @@ exit here, Z flag unset if IRQ |
82 | 66 | ||
83 | .endm | 67 | .endm |
diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h index 5e4c8c37bc66..fae2766ff32b 100644 --- a/include/asm-arm/arch-s3c2410/map.h +++ b/include/asm-arm/arch-s3c2410/map.h | |||
@@ -236,4 +236,20 @@ | |||
236 | #define S3C24XX_PA_SPI S3C2410_PA_SPI | 236 | #define S3C24XX_PA_SPI S3C2410_PA_SPI |
237 | #endif | 237 | #endif |
238 | 238 | ||
239 | /* deal with the registers that move under the 2412/2413 */ | ||
240 | |||
241 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
242 | #ifndef __ASSEMBLY__ | ||
243 | extern void __iomem *s3c24xx_va_gpio2; | ||
244 | #endif | ||
245 | #ifdef CONFIG_CPU_S3C2412_ONLY | ||
246 | #define S3C24XX_VA_GPIO2 (S3C24XX_VA_GPIO + 0x10) | ||
247 | #else | ||
248 | #define S3C24XX_VA_GPIO2 s3c24xx_va_gpio2 | ||
249 | #endif | ||
250 | #else | ||
251 | #define s3c24xx_va_gpio2 S3C24XX_VA_GPIO | ||
252 | #define S3C24XX_VA_GPIO2 S3C24XX_VA_GPIO | ||
253 | #endif | ||
254 | |||
239 | #endif /* __ASM_ARCH_MAP_H */ | 255 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index 6c92faffe985..a7c61feb8433 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/include/asm/arch-s3c2410/regs-clock.h | 1 | /* linux/include/asm/arch-s3c2410/regs-clock.h |
2 | * | 2 | * |
3 | * Copyright (c) 2003,2004,2005 Simtec Electronics <linux@simtec.co.uk> | 3 | * Copyright (c) 2003,2004,2005,2006 Simtec Electronics <linux@simtec.co.uk> |
4 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
@@ -140,5 +140,66 @@ s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) | |||
140 | 140 | ||
141 | #endif /* CONFIG_CPU_S3C2440 or CONFIG_CPU_S3C2442 */ | 141 | #endif /* CONFIG_CPU_S3C2440 or CONFIG_CPU_S3C2442 */ |
142 | 142 | ||
143 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
144 | |||
145 | #define S3C2412_OSCSET S3C2410_CLKREG(0x18) | ||
146 | #define S3C2412_CLKSRC S3C2410_CLKREG(0x1C) | ||
147 | |||
148 | #define S3C2412_PLLCON_OFF (1<<20) | ||
149 | |||
150 | #define S3C2412_CLKDIVN_PDIVN (1<<2) | ||
151 | #define S3C2412_CLKDIVN_HDIVN_MASK (3<<0) | ||
152 | #define S3C2421_CLKDIVN_ARMDIVN (1<<3) | ||
153 | #define S3C2412_CLKDIVN_USB48DIV (1<<6) | ||
154 | #define S3C2412_CLKDIVN_UARTDIV_MASK (15<<8) | ||
155 | #define S3C2412_CLKDIVN_UARTDIV_SHIFT (8) | ||
156 | #define S3C2412_CLKDIVN_I2SDIV_MASK (15<<12) | ||
157 | #define S3C2412_CLKDIVN_I2SDIV_SHIFT (12) | ||
158 | #define S3C2412_CLKDIVN_CAMDIV_MASK (15<<16) | ||
159 | #define S3C2412_CLKDIVN_CAMDIV_SHIFT (16) | ||
160 | |||
161 | #define S3C2412_CLKCON_WDT (1<<28) | ||
162 | #define S3C2412_CLKCON_SPI (1<<27) | ||
163 | #define S3C2412_CLKCON_IIS (1<<26) | ||
164 | #define S3C2412_CLKCON_IIC (1<<25) | ||
165 | #define S3C2412_CLKCON_ADC (1<<24) | ||
166 | #define S3C2412_CLKCON_RTC (1<<23) | ||
167 | #define S3C2412_CLKCON_GPIO (1<<22) | ||
168 | #define S3C2412_CLKCON_UART2 (1<<21) | ||
169 | #define S3C2412_CLKCON_UART1 (1<<20) | ||
170 | #define S3C2412_CLKCON_UART0 (1<<19) | ||
171 | #define S3C2412_CLKCON_SDI (1<<18) | ||
172 | #define S3C2412_CLKCON_PWMT (1<<17) | ||
173 | #define S3C2412_CLKCON_USBD (1<<16) | ||
174 | #define S3C2412_CLKCON_CAMCLK (1<<15) | ||
175 | #define S3C2412_CLKCON_UARTCLK (1<<14) | ||
176 | /* missing 13 */ | ||
177 | #define S3C2412_CLKCON_USB_HOST48 (1<<12) | ||
178 | #define S3C2412_CLKCON_USB_DEV48 (1<<11) | ||
179 | #define S3C2412_CLKCON_HCLKdiv2 (1<<10) | ||
180 | #define S3C2412_CLKCON_HCLKx2 (1<<9) | ||
181 | #define S3C2412_CLKCON_SDRAM (1<<8) | ||
182 | /* missing 7 */ | ||
183 | #define S3C2412_CLKCON_USBH S3C2410_CLKCON_USBH | ||
184 | #define S3C2412_CLKCON_LCDC S3C2410_CLKCON_LCDC | ||
185 | #define S3C2412_CLKCON_NAND S3C2410_CLKCON_NAND | ||
186 | #define S3C2412_CLKCON_DMA3 (1<<3) | ||
187 | #define S3C2412_CLKCON_DMA2 (1<<2) | ||
188 | #define S3C2412_CLKCON_DMA1 (1<<1) | ||
189 | #define S3C2412_CLKCON_DMA0 (1<<0) | ||
190 | |||
191 | /* clock sourec controls */ | ||
192 | |||
193 | #define S3C2412_CLKSRC_EXTCLKDIV_MASK (7 << 0) | ||
194 | #define S3C2412_CLKSRC_EXTCLKDIV_SHIFT (0) | ||
195 | #define S3C2412_CLKSRC_MDIVCLK_EXTCLKDIV (1<<3) | ||
196 | #define S3C2412_CLKSRC_MSYSCLK_MPLL (1<<4) | ||
197 | #define S3C2412_CLKSRC_USYSCLK_UPLL (1<<5) | ||
198 | #define S3C2412_CLKSRC_UARTCLK_MPLL (1<<8) | ||
199 | #define S3C2412_CLKSRC_I2SCLK_MPLL (1<<9) | ||
200 | #define S3C2412_CLKSRC_USBCLK_HCLK (1<<10) | ||
201 | #define S3C2412_CLKSRC_CAMCLK_HCLK (1<<11) | ||
202 | |||
203 | #endif /* CONFIG_CPU_S3C2412 | CONFIG_CPU_S3C2413 */ | ||
143 | 204 | ||
144 | #endif /* __ASM_ARM_REGS_CLOCK */ | 205 | #endif /* __ASM_ARM_REGS_CLOCK */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-dsc.h b/include/asm-arm/arch-s3c2410/regs-dsc.h index ba13a2c9e547..84aca61cbaa3 100644 --- a/include/asm-arm/arch-s3c2410/regs-dsc.h +++ b/include/asm-arm/arch-s3c2410/regs-dsc.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) | 23 | #define S3C2440_DSC0 S3C2410_GPIOREG(0xc4) |
24 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) | 24 | #define S3C2440_DSC1 S3C2410_GPIOREG(0xc8) |
25 | 25 | ||
26 | #define S3C2412_DSC0 S3C2410_GPIOREG(0xdc) | ||
27 | #define S3C2412_DSC1 S3C2410_GPIOREG(0xe0) | ||
28 | |||
26 | #define S3C2440_SELECT_DSC0 (0) | 29 | #define S3C2440_SELECT_DSC0 (0) |
27 | #define S3C2440_SELECT_DSC1 (1<<31) | 30 | #define S3C2440_SELECT_DSC1 (1<<31) |
28 | 31 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index 5f10334f06bf..6dd17f0f84e0 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -45,7 +45,7 @@ | |||
45 | #define S3C24XX_MISCCR S3C2400_MISCCR | 45 | #define S3C24XX_MISCCR S3C2400_MISCCR |
46 | #else | 46 | #else |
47 | #define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x) | 47 | #define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x) |
48 | #define S3C24XX_MISCCR S3C2410_MISCCR | 48 | #define S3C24XX_MISCCR S3C24XX_GPIOREG2(0x80) |
49 | #endif /* CONFIG_CPU_S3C2400 */ | 49 | #endif /* CONFIG_CPU_S3C2400 */ |
50 | 50 | ||
51 | 51 | ||
@@ -73,9 +73,15 @@ | |||
73 | #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ | 73 | #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ |
74 | #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ | 74 | #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ |
75 | 75 | ||
76 | /* configure GPIO ports A..G */ | 76 | /* register address for the GPIO registers. |
77 | * S3C24XX_GPIOREG2 is for the second set of registers in the | ||
78 | * GPIO which move between s3c2410 and s3c2412 type systems */ | ||
77 | 79 | ||
78 | #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) | 80 | #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) |
81 | #define S3C24XX_GPIOREG2(x) ((x) + S3C24XX_VA_GPIO2) | ||
82 | |||
83 | |||
84 | /* configure GPIO ports A..G */ | ||
79 | 85 | ||
80 | /* port A - S3C2410: 22bits, zero in bit X makes pin X output | 86 | /* port A - S3C2410: 22bits, zero in bit X makes pin X output |
81 | * S3C2400: 18bits, zero in bit X makes pin X output | 87 | * S3C2400: 18bits, zero in bit X makes pin X output |
@@ -953,11 +959,18 @@ | |||
953 | #define S3C2410_GPH10_OUTP (0x01 << 20) | 959 | #define S3C2410_GPH10_OUTP (0x01 << 20) |
954 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) | 960 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) |
955 | 961 | ||
962 | /* The S3C2412 and S3C2413 move the GPJ register set to after | ||
963 | * GPH, which means all registers after 0x80 are now offset by 0x10 | ||
964 | * for the 2412/2413 from the 2410/2440/2442 | ||
965 | */ | ||
966 | |||
956 | /* miscellaneous control */ | 967 | /* miscellaneous control */ |
957 | #define S3C2400_MISCCR S3C2410_GPIOREG(0x54) | 968 | #define S3C2400_MISCCR S3C2410_GPIOREG(0x54) |
958 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) | 969 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) |
959 | #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) | 970 | #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) |
960 | 971 | ||
972 | #define S3C24XX_DCLKCON S3C24XX_GPIOREG2(0x84) | ||
973 | |||
961 | /* see clock.h for dclk definitions */ | 974 | /* see clock.h for dclk definitions */ |
962 | 975 | ||
963 | /* pullup control on databus */ | 976 | /* pullup control on databus */ |
@@ -985,6 +998,8 @@ | |||
985 | #define S3C2410_MISCCR_CLK0_DCLK0 (5<<4) | 998 | #define S3C2410_MISCCR_CLK0_DCLK0 (5<<4) |
986 | #define S3C2410_MISCCR_CLK0_MASK (7<<4) | 999 | #define S3C2410_MISCCR_CLK0_MASK (7<<4) |
987 | 1000 | ||
1001 | #define S3C2412_MISCCR_CLK0_RTC (2<<4) | ||
1002 | |||
988 | #define S3C2410_MISCCR_CLK1_MPLL (0<<8) | 1003 | #define S3C2410_MISCCR_CLK1_MPLL (0<<8) |
989 | #define S3C2410_MISCCR_CLK1_UPLL (1<<8) | 1004 | #define S3C2410_MISCCR_CLK1_UPLL (1<<8) |
990 | #define S3C2410_MISCCR_CLK1_FCLK (2<<8) | 1005 | #define S3C2410_MISCCR_CLK1_FCLK (2<<8) |
@@ -993,6 +1008,8 @@ | |||
993 | #define S3C2410_MISCCR_CLK1_DCLK1 (5<<8) | 1008 | #define S3C2410_MISCCR_CLK1_DCLK1 (5<<8) |
994 | #define S3C2410_MISCCR_CLK1_MASK (7<<8) | 1009 | #define S3C2410_MISCCR_CLK1_MASK (7<<8) |
995 | 1010 | ||
1011 | #define S3C2412_MISCCR_CLK1_CLKsrc (0<<8) | ||
1012 | |||
996 | #define S3C2410_MISCCR_USBSUSPND0 (1<<12) | 1013 | #define S3C2410_MISCCR_USBSUSPND0 (1<<12) |
997 | #define S3C2410_MISCCR_USBSUSPND1 (1<<13) | 1014 | #define S3C2410_MISCCR_USBSUSPND1 (1<<13) |
998 | 1015 | ||
@@ -1000,7 +1017,7 @@ | |||
1000 | 1017 | ||
1001 | #define S3C2410_MISCCR_nEN_SCLK0 (1<<17) | 1018 | #define S3C2410_MISCCR_nEN_SCLK0 (1<<17) |
1002 | #define S3C2410_MISCCR_nEN_SCLK1 (1<<18) | 1019 | #define S3C2410_MISCCR_nEN_SCLK1 (1<<18) |
1003 | #define S3C2410_MISCCR_nEN_SCLKE (1<<19) | 1020 | #define S3C2410_MISCCR_nEN_SCLKE (1<<19) /* not 2412 */ |
1004 | #define S3C2410_MISCCR_SDSLEEP (7<<17) | 1021 | #define S3C2410_MISCCR_SDSLEEP (7<<17) |
1005 | 1022 | ||
1006 | /* external interrupt control... */ | 1023 | /* external interrupt control... */ |
@@ -1017,6 +1034,10 @@ | |||
1017 | #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) | 1034 | #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) |
1018 | #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) | 1035 | #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) |
1019 | 1036 | ||
1037 | #define S3C24XX_EXTINT0 S3C24XX_GPIOREG2(0x88) | ||
1038 | #define S3C24XX_EXTINT1 S3C24XX_GPIOREG2(0x8C) | ||
1039 | #define S3C24XX_EXTINT2 S3C24XX_GPIOREG2(0x90) | ||
1040 | |||
1020 | /* values for S3C2410_EXTINT0/1/2 */ | 1041 | /* values for S3C2410_EXTINT0/1/2 */ |
1021 | #define S3C2410_EXTINT_LOWLEV (0x00) | 1042 | #define S3C2410_EXTINT_LOWLEV (0x00) |
1022 | #define S3C2410_EXTINT_HILEV (0x01) | 1043 | #define S3C2410_EXTINT_HILEV (0x01) |
@@ -1030,6 +1051,11 @@ | |||
1030 | #define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C) | 1051 | #define S3C2410_EINFLT2 S3C2410_GPIOREG(0x9C) |
1031 | #define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0) | 1052 | #define S3C2410_EINFLT3 S3C2410_GPIOREG(0xA0) |
1032 | 1053 | ||
1054 | #define S3C24XX_EINFLT0 S3C24XX_GPIOREG2(0x94) | ||
1055 | #define S3C24XX_EINFLT1 S3C24XX_GPIOREG2(0x98) | ||
1056 | #define S3C24XX_EINFLT2 S3C24XX_GPIOREG2(0x9C) | ||
1057 | #define S3C24XX_EINFLT3 S3C24XX_GPIOREG2(0xA0) | ||
1058 | |||
1033 | /* values for interrupt filtering */ | 1059 | /* values for interrupt filtering */ |
1034 | #define S3C2410_EINTFLT_PCLK (0x00) | 1060 | #define S3C2410_EINTFLT_PCLK (0x00) |
1035 | #define S3C2410_EINTFLT_EXTCLK (1<<7) | 1061 | #define S3C2410_EINTFLT_EXTCLK (1<<7) |
@@ -1039,6 +1065,7 @@ | |||
1039 | 1065 | ||
1040 | /* GSTATUS have miscellaneous information in them | 1066 | /* GSTATUS have miscellaneous information in them |
1041 | * | 1067 | * |
1068 | * These move between s3c2410 and s3c2412 style systems. | ||
1042 | */ | 1069 | */ |
1043 | 1070 | ||
1044 | #define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC) | 1071 | #define S3C2410_GSTATUS0 S3C2410_GPIOREG(0x0AC) |
@@ -1047,6 +1074,18 @@ | |||
1047 | #define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8) | 1074 | #define S3C2410_GSTATUS3 S3C2410_GPIOREG(0x0B8) |
1048 | #define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC) | 1075 | #define S3C2410_GSTATUS4 S3C2410_GPIOREG(0x0BC) |
1049 | 1076 | ||
1077 | #define S3C2412_GSTATUS0 S3C2410_GPIOREG(0x0BC) | ||
1078 | #define S3C2412_GSTATUS1 S3C2410_GPIOREG(0x0C0) | ||
1079 | #define S3C2412_GSTATUS2 S3C2410_GPIOREG(0x0C4) | ||
1080 | #define S3C2412_GSTATUS3 S3C2410_GPIOREG(0x0C8) | ||
1081 | #define S3C2412_GSTATUS4 S3C2410_GPIOREG(0x0CC) | ||
1082 | |||
1083 | #define S3C24XX_GSTATUS0 S3C24XX_GPIOREG2(0x0AC) | ||
1084 | #define S3C24XX_GSTATUS1 S3C24XX_GPIOREG2(0x0B0) | ||
1085 | #define S3C24XX_GSTATUS2 S3C24XX_GPIOREG2(0x0B4) | ||
1086 | #define S3C24XX_GSTATUS3 S3C24XX_GPIOREG2(0x0B8) | ||
1087 | #define S3C24XX_GSTATUS4 S3C24XX_GPIOREG2(0x0BC) | ||
1088 | |||
1050 | #define S3C2410_GSTATUS0_nWAIT (1<<3) | 1089 | #define S3C2410_GSTATUS0_nWAIT (1<<3) |
1051 | #define S3C2410_GSTATUS0_NCON (1<<2) | 1090 | #define S3C2410_GSTATUS0_NCON (1<<2) |
1052 | #define S3C2410_GSTATUS0_RnB (1<<1) | 1091 | #define S3C2410_GSTATUS0_RnB (1<<1) |
@@ -1054,6 +1093,7 @@ | |||
1054 | 1093 | ||
1055 | #define S3C2410_GSTATUS1_IDMASK (0xffff0000) | 1094 | #define S3C2410_GSTATUS1_IDMASK (0xffff0000) |
1056 | #define S3C2410_GSTATUS1_2410 (0x32410000) | 1095 | #define S3C2410_GSTATUS1_2410 (0x32410000) |
1096 | #define S3C2410_GSTATUS1_2412 (0x32412001) | ||
1057 | #define S3C2410_GSTATUS1_2440 (0x32440000) | 1097 | #define S3C2410_GSTATUS1_2440 (0x32440000) |
1058 | #define S3C2410_GSTATUS1_2442 (0x32440aaa) | 1098 | #define S3C2410_GSTATUS1_2442 (0x32440aaa) |
1059 | 1099 | ||
@@ -1077,5 +1117,22 @@ | |||
1077 | #define S3C2400_OPENCR_OPC_MOSIDIS (0<<5) | 1117 | #define S3C2400_OPENCR_OPC_MOSIDIS (0<<5) |
1078 | #define S3C2400_OPENCR_OPC_MOSIEN (1<<5) | 1118 | #define S3C2400_OPENCR_OPC_MOSIEN (1<<5) |
1079 | 1119 | ||
1120 | /* 2412/2413 sleep configuration registers */ | ||
1121 | |||
1122 | #define S3C2412_GPBSLPCON S3C2410_GPIOREG(0x1C) | ||
1123 | #define S3C2412_GPCSLPCON S3C2410_GPIOREG(0x2C) | ||
1124 | #define S3C2412_GPDSLPCON S3C2410_GPIOREG(0x3C) | ||
1125 | #define S3C2412_GPESLPCON S3C2410_GPIOREG(0x4C) | ||
1126 | #define S3C2412_GPFSLPCON S3C2410_GPIOREG(0x5C) | ||
1127 | #define S3C2412_GPGSLPCON S3C2410_GPIOREG(0x6C) | ||
1128 | #define S3C2412_GPHSLPCON S3C2410_GPIOREG(0x7C) | ||
1129 | |||
1130 | /* definitions for each pin bit */ | ||
1131 | #define S3C2412_SLPCON_LOW(x) ( 0x00 << ((x) * 2)) | ||
1132 | #define S3C2412_SLPCON_HI(x) ( 0x01 << ((x) * 2)) | ||
1133 | #define S3C2412_SLPCON_IN(x) ( 0x02 << ((x) * 2)) | ||
1134 | #define S3C2412_SLPCON_PDWN(x) ( 0x03 << ((x) * 2)) | ||
1135 | #define S3C2412_SLPCON_MASK(x) ( 0x03 << ((x) * 2)) | ||
1136 | |||
1080 | #endif /* __ASM_ARCH_REGS_GPIO_H */ | 1137 | #endif /* __ASM_ARCH_REGS_GPIO_H */ |
1081 | 1138 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-gpioj.h b/include/asm-arm/arch-s3c2410/regs-gpioj.h index 3ad2324acc39..18edae50d0b8 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpioj.h +++ b/include/asm-arm/arch-s3c2410/regs-gpioj.h | |||
@@ -32,6 +32,11 @@ | |||
32 | #define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4) | 32 | #define S3C2440_GPJDAT S3C2410_GPIOREG(0xd4) |
33 | #define S3C2440_GPJUP S3C2410_GPIOREG(0xd8) | 33 | #define S3C2440_GPJUP S3C2410_GPIOREG(0xd8) |
34 | 34 | ||
35 | #define S3C2413_GPJCON S3C2410_GPIOREG(0x80) | ||
36 | #define S3C2413_GPJDAT S3C2410_GPIOREG(0x84) | ||
37 | #define S3C2413_GPJUP S3C2410_GPIOREG(0x88) | ||
38 | #define S3C2413_GPJSLPCON S3C2410_GPIOREG(0x8C) | ||
39 | |||
35 | #define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0) | 40 | #define S3C2440_GPJ0 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 0) |
36 | #define S3C2440_GPJ0_INP (0x00 << 0) | 41 | #define S3C2440_GPJ0_INP (0x00 << 0) |
37 | #define S3C2440_GPJ0_OUTP (0x01 << 0) | 42 | #define S3C2440_GPJ0_OUTP (0x01 << 0) |
diff --git a/include/asm-arm/arch-s3c2410/regs-irq.h b/include/asm-arm/arch-s3c2410/regs-irq.h index 24b7292df79e..572fca5d9acf 100644 --- a/include/asm-arm/arch-s3c2410/regs-irq.h +++ b/include/asm-arm/arch-s3c2410/regs-irq.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #define S3C2410_IRQREG(x) ((x) + S3C24XX_VA_IRQ) | 24 | #define S3C2410_IRQREG(x) ((x) + S3C24XX_VA_IRQ) |
25 | #define S3C2410_EINTREG(x) ((x) + S3C24XX_VA_GPIO) | 25 | #define S3C2410_EINTREG(x) ((x) + S3C24XX_VA_GPIO) |
26 | #define S3C24XX_EINTREG(x) ((x) + S3C24XX_VA_GPIO2) | ||
26 | 27 | ||
27 | #define S3C2410_SRCPND S3C2410_IRQREG(0x000) | 28 | #define S3C2410_SRCPND S3C2410_IRQREG(0x000) |
28 | #define S3C2410_INTMOD S3C2410_IRQREG(0x004) | 29 | #define S3C2410_INTMOD S3C2410_IRQREG(0x004) |
@@ -40,5 +41,10 @@ | |||
40 | 41 | ||
41 | #define S3C2410_EINTMASK S3C2410_EINTREG(0x0A4) | 42 | #define S3C2410_EINTMASK S3C2410_EINTREG(0x0A4) |
42 | #define S3C2410_EINTPEND S3C2410_EINTREG(0X0A8) | 43 | #define S3C2410_EINTPEND S3C2410_EINTREG(0X0A8) |
44 | #define S3C2412_EINTMASK S3C2410_EINTREG(0x0B4) | ||
45 | #define S3C2412_EINTPEND S3C2410_EINTREG(0X0B8) | ||
46 | |||
47 | #define S3C24XX_EINTMASK S3C24XX_EINTREG(0x0A4) | ||
48 | #define S3C24XX_EINTPEND S3C24XX_EINTREG(0X0A8) | ||
43 | 49 | ||
44 | #endif /* ___ASM_ARCH_REGS_IRQ_H */ | 50 | #endif /* ___ASM_ARCH_REGS_IRQ_H */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h index 83b01254c4ac..93f651ae2967 100644 --- a/include/asm-arm/arch-s3c2410/regs-serial.h +++ b/include/asm-arm/arch-s3c2410/regs-serial.h | |||
@@ -82,6 +82,12 @@ | |||
82 | #define S3C2440_UCON2_DIVMASK (7 << 12) | 82 | #define S3C2440_UCON2_DIVMASK (7 << 12) |
83 | #define S3C2440_UCON_DIVSHIFT (12) | 83 | #define S3C2440_UCON_DIVSHIFT (12) |
84 | 84 | ||
85 | #define S3C2412_UCON_CLKMASK (3<<10) | ||
86 | #define S3C2412_UCON_UCLK (1<<10) | ||
87 | #define S3C2412_UCON_USYSCLK (3<<10) | ||
88 | #define S3C2412_UCON_PCLK (0<<10) | ||
89 | #define S3C2412_UCON_PCLK2 (2<<10) | ||
90 | |||
85 | #define S3C2410_UCON_UCLK (1<<10) | 91 | #define S3C2410_UCON_UCLK (1<<10) |
86 | #define S3C2410_UCON_SBREAK (1<<4) | 92 | #define S3C2410_UCON_SBREAK (1<<4) |
87 | 93 | ||
@@ -124,6 +130,15 @@ | |||
124 | #define S3C2410_UMCOM_AFC (1<<4) | 130 | #define S3C2410_UMCOM_AFC (1<<4) |
125 | #define S3C2410_UMCOM_RTS_LOW (1<<0) | 131 | #define S3C2410_UMCOM_RTS_LOW (1<<0) |
126 | 132 | ||
133 | #define S3C2412_UMCON_AFC_63 (0<<5) | ||
134 | #define S3C2412_UMCON_AFC_56 (1<<5) | ||
135 | #define S3C2412_UMCON_AFC_48 (2<<5) | ||
136 | #define S3C2412_UMCON_AFC_40 (3<<5) | ||
137 | #define S3C2412_UMCON_AFC_32 (4<<5) | ||
138 | #define S3C2412_UMCON_AFC_24 (5<<5) | ||
139 | #define S3C2412_UMCON_AFC_16 (6<<5) | ||
140 | #define S3C2412_UMCON_AFC_8 (7<<5) | ||
141 | |||
127 | #define S3C2410_UFSTAT_TXFULL (1<<9) | 142 | #define S3C2410_UFSTAT_TXFULL (1<<9) |
128 | #define S3C2410_UFSTAT_RXFULL (1<<8) | 143 | #define S3C2410_UFSTAT_RXFULL (1<<8) |
129 | #define S3C2410_UFSTAT_TXMASK (15<<4) | 144 | #define S3C2410_UFSTAT_TXMASK (15<<4) |
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h index 040ccde7a11e..0756269404b1 100644 --- a/include/asm-arm/arch-sa1100/io.h +++ b/include/asm-arm/arch-sa1100/io.h | |||
@@ -22,6 +22,5 @@ static inline void __iomem *__io(unsigned long addr) | |||
22 | } | 22 | } |
23 | #define __io(a) __io(a) | 23 | #define __io(a) __io(a) |
24 | #define __mem_pci(a) (a) | 24 | #define __mem_pci(a) (a) |
25 | #define __mem_isa(a) (a) | ||
26 | 25 | ||
27 | #endif | 26 | #endif |
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h index 47e904cf25c7..c4d01948e00b 100644 --- a/include/asm-arm/arch-versatile/io.h +++ b/include/asm-arm/arch-versatile/io.h | |||
@@ -28,6 +28,5 @@ static inline void __iomem *__io(unsigned long addr) | |||
28 | } | 28 | } |
29 | #define __io(a) __io(a) | 29 | #define __io(a) __io(a) |
30 | #define __mem_pci(a) (a) | 30 | #define __mem_pci(a) (a) |
31 | #define __mem_isa(a) (a) | ||
32 | 31 | ||
33 | #endif | 32 | #endif |
diff --git a/include/asm-arm/ucontext.h b/include/asm-arm/ucontext.h index f853130137cc..9e6f7ca9f5ae 100644 --- a/include/asm-arm/ucontext.h +++ b/include/asm-arm/ucontext.h | |||
@@ -1,12 +1,89 @@ | |||
1 | #ifndef _ASMARM_UCONTEXT_H | 1 | #ifndef _ASMARM_UCONTEXT_H |
2 | #define _ASMARM_UCONTEXT_H | 2 | #define _ASMARM_UCONTEXT_H |
3 | 3 | ||
4 | #include <asm/fpstate.h> | ||
5 | |||
6 | /* | ||
7 | * struct sigcontext only has room for the basic registers, but struct | ||
8 | * ucontext now has room for all registers which need to be saved and | ||
9 | * restored. Coprocessor registers are stored in uc_regspace. Each | ||
10 | * coprocessor's saved state should start with a documented 32-bit magic | ||
11 | * number, followed by a 32-bit word giving the coproccesor's saved size. | ||
12 | * uc_regspace may be expanded if necessary, although this takes some | ||
13 | * coordination with glibc. | ||
14 | */ | ||
15 | |||
4 | struct ucontext { | 16 | struct ucontext { |
5 | unsigned long uc_flags; | 17 | unsigned long uc_flags; |
6 | struct ucontext *uc_link; | 18 | struct ucontext *uc_link; |
7 | stack_t uc_stack; | 19 | stack_t uc_stack; |
8 | struct sigcontext uc_mcontext; | 20 | struct sigcontext uc_mcontext; |
9 | sigset_t uc_sigmask; /* mask last for extensibility */ | 21 | sigset_t uc_sigmask; |
22 | /* Allow for uc_sigmask growth. Glibc uses a 1024-bit sigset_t. */ | ||
23 | int __unused[32 - (sizeof (sigset_t) / sizeof (int))]; | ||
24 | /* Last for extensibility. Eight byte aligned because some | ||
25 | coprocessors require eight byte alignment. */ | ||
26 | unsigned long uc_regspace[128] __attribute__((__aligned__(8))); | ||
10 | }; | 27 | }; |
11 | 28 | ||
29 | #ifdef __KERNEL__ | ||
30 | |||
31 | /* | ||
32 | * Coprocessor save state. The magic values and specific | ||
33 | * coprocessor's layouts are part of the userspace ABI. Each one of | ||
34 | * these should be a multiple of eight bytes and aligned to eight | ||
35 | * bytes, to prevent unpredictable padding in the signal frame. | ||
36 | */ | ||
37 | |||
38 | #ifdef CONFIG_IWMMXT | ||
39 | /* iwmmxt_area is 0x98 bytes long, preceeded by 8 bytes of signature */ | ||
40 | #define IWMMXT_MAGIC 0x12ef842a | ||
41 | #define IWMMXT_STORAGE_SIZE (IWMMXT_SIZE + 8) | ||
42 | |||
43 | struct iwmmxt_sigframe { | ||
44 | unsigned long magic; | ||
45 | unsigned long size; | ||
46 | struct iwmmxt_struct storage; | ||
47 | } __attribute__((__aligned__(8))); | ||
48 | #endif /* CONFIG_IWMMXT */ | ||
49 | |||
50 | #ifdef CONFIG_VFP | ||
51 | #if __LINUX_ARM_ARCH__ < 6 | ||
52 | /* For ARM pre-v6, we use fstmiax and fldmiax. This adds one extra | ||
53 | * word after the registers, and a word of padding at the end for | ||
54 | * alignment. */ | ||
55 | #define VFP_MAGIC 0x56465001 | ||
56 | #define VFP_STORAGE_SIZE 152 | ||
57 | #else | ||
58 | #define VFP_MAGIC 0x56465002 | ||
59 | #define VFP_STORAGE_SIZE 144 | ||
60 | #endif | ||
61 | |||
62 | struct vfp_sigframe | ||
63 | { | ||
64 | unsigned long magic; | ||
65 | unsigned long size; | ||
66 | union vfp_state storage; | ||
67 | }; | ||
68 | #endif /* CONFIG_VFP */ | ||
69 | |||
70 | /* | ||
71 | * Auxiliary signal frame. This saves stuff like FP state. | ||
72 | * The layout of this structure is not part of the user ABI, | ||
73 | * because the config options aren't. uc_regspace is really | ||
74 | * one of these. | ||
75 | */ | ||
76 | struct aux_sigframe { | ||
77 | #ifdef CONFIG_IWMMXT | ||
78 | struct iwmmxt_sigframe iwmmxt; | ||
79 | #endif | ||
80 | #if 0 && defined CONFIG_VFP /* Not yet saved. */ | ||
81 | struct vfp_sigframe vfp; | ||
82 | #endif | ||
83 | /* Something that isn't a valid magic number for any coprocessor. */ | ||
84 | unsigned long end_magic; | ||
85 | } __attribute__((__aligned__(8))); | ||
86 | |||
87 | #endif | ||
88 | |||
12 | #endif /* !_ASMARM_UCONTEXT_H */ | 89 | #endif /* !_ASMARM_UCONTEXT_H */ |
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index cef08db34ada..4087037a4225 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h | |||
@@ -114,6 +114,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) | |||
114 | /* Set the current date and time in the real time clock. */ | 114 | /* Set the current date and time in the real time clock. */ |
115 | static inline int set_rtc_time(struct rtc_time *time) | 115 | static inline int set_rtc_time(struct rtc_time *time) |
116 | { | 116 | { |
117 | unsigned long flags; | ||
117 | unsigned char mon, day, hrs, min, sec; | 118 | unsigned char mon, day, hrs, min, sec; |
118 | unsigned char save_control, save_freq_select; | 119 | unsigned char save_control, save_freq_select; |
119 | unsigned int yrs; | 120 | unsigned int yrs; |
@@ -131,7 +132,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
131 | if (yrs > 255) /* They are unsigned */ | 132 | if (yrs > 255) /* They are unsigned */ |
132 | return -EINVAL; | 133 | return -EINVAL; |
133 | 134 | ||
134 | spin_lock_irq(&rtc_lock); | 135 | spin_lock_irqsave(&rtc_lock, flags); |
135 | #ifdef CONFIG_MACH_DECSTATION | 136 | #ifdef CONFIG_MACH_DECSTATION |
136 | real_yrs = yrs; | 137 | real_yrs = yrs; |
137 | leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || | 138 | leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || |
@@ -152,7 +153,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
152 | * whether the chip is in binary mode or not. | 153 | * whether the chip is in binary mode or not. |
153 | */ | 154 | */ |
154 | if (yrs > 169) { | 155 | if (yrs > 169) { |
155 | spin_unlock_irq(&rtc_lock); | 156 | spin_unlock_irqrestore(&rtc_lock, flags); |
156 | return -EINVAL; | 157 | return -EINVAL; |
157 | } | 158 | } |
158 | 159 | ||
@@ -187,7 +188,7 @@ static inline int set_rtc_time(struct rtc_time *time) | |||
187 | CMOS_WRITE(save_control, RTC_CONTROL); | 188 | CMOS_WRITE(save_control, RTC_CONTROL); |
188 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); | 189 | CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); |
189 | 190 | ||
190 | spin_unlock_irq(&rtc_lock); | 191 | spin_unlock_irqrestore(&rtc_lock, flags); |
191 | 192 | ||
192 | return 0; | 193 | return 0; |
193 | } | 194 | } |
diff --git a/include/asm-sparc/ebus.h b/include/asm-sparc/ebus.h index 2d6a997c5b0c..54652887c127 100644 --- a/include/asm-sparc/ebus.h +++ b/include/asm-sparc/ebus.h | |||
@@ -13,13 +13,14 @@ | |||
13 | #include <linux/ioport.h> | 13 | #include <linux/ioport.h> |
14 | #endif | 14 | #endif |
15 | #include <asm/oplib.h> | 15 | #include <asm/oplib.h> |
16 | #include <asm/prom.h> | ||
17 | #include <asm/of_device.h> | ||
16 | 18 | ||
17 | struct linux_ebus_child { | 19 | struct linux_ebus_child { |
18 | struct linux_ebus_child *next; | 20 | struct linux_ebus_child *next; |
19 | struct linux_ebus_device *parent; | 21 | struct linux_ebus_device *parent; |
20 | struct linux_ebus *bus; | 22 | struct linux_ebus *bus; |
21 | int prom_node; | 23 | struct device_node *prom_node; |
22 | char prom_name[64]; | ||
23 | struct resource resource[PROMREG_MAX]; | 24 | struct resource resource[PROMREG_MAX]; |
24 | int num_addrs; | 25 | int num_addrs; |
25 | unsigned int irqs[PROMINTR_MAX]; | 26 | unsigned int irqs[PROMINTR_MAX]; |
@@ -27,27 +28,27 @@ struct linux_ebus_child { | |||
27 | }; | 28 | }; |
28 | 29 | ||
29 | struct linux_ebus_device { | 30 | struct linux_ebus_device { |
31 | struct of_device ofdev; | ||
30 | struct linux_ebus_device *next; | 32 | struct linux_ebus_device *next; |
31 | struct linux_ebus_child *children; | 33 | struct linux_ebus_child *children; |
32 | struct linux_ebus *bus; | 34 | struct linux_ebus *bus; |
33 | int prom_node; | 35 | struct device_node *prom_node; |
34 | char prom_name[64]; | ||
35 | struct resource resource[PROMREG_MAX]; | 36 | struct resource resource[PROMREG_MAX]; |
36 | int num_addrs; | 37 | int num_addrs; |
37 | unsigned int irqs[PROMINTR_MAX]; | 38 | unsigned int irqs[PROMINTR_MAX]; |
38 | int num_irqs; | 39 | int num_irqs; |
39 | }; | 40 | }; |
41 | #define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev) | ||
40 | 42 | ||
41 | struct linux_ebus { | 43 | struct linux_ebus { |
44 | struct of_device ofdev; | ||
42 | struct linux_ebus *next; | 45 | struct linux_ebus *next; |
43 | struct linux_ebus_device *devices; | 46 | struct linux_ebus_device *devices; |
44 | struct linux_pbm_info *parent; | 47 | struct linux_pbm_info *parent; |
45 | struct pci_dev *self; | 48 | struct pci_dev *self; |
46 | int prom_node; | 49 | struct device_node *prom_node; |
47 | char prom_name[64]; | ||
48 | struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX]; | ||
49 | int num_ebus_ranges; | ||
50 | }; | 50 | }; |
51 | #define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev) | ||
51 | 52 | ||
52 | struct linux_ebus_dma { | 53 | struct linux_ebus_dma { |
53 | unsigned int dcsr; | 54 | unsigned int dcsr; |
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h new file mode 100644 index 000000000000..4816d102f918 --- /dev/null +++ b/include/asm-sparc/of_device.h | |||
@@ -0,0 +1,63 @@ | |||
1 | #ifndef _ASM_SPARC_OF_DEVICE_H | ||
2 | #define _ASM_SPARC_OF_DEVICE_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/device.h> | ||
6 | #include <linux/mod_devicetable.h> | ||
7 | #include <asm/prom.h> | ||
8 | |||
9 | extern struct bus_type ebus_bus_type; | ||
10 | extern struct bus_type sbus_bus_type; | ||
11 | |||
12 | /* | ||
13 | * The of_device is a kind of "base class" that is a superset of | ||
14 | * struct device for use by devices attached to an OF node and | ||
15 | * probed using OF properties. | ||
16 | */ | ||
17 | struct of_device | ||
18 | { | ||
19 | struct device_node *node; /* OF device node */ | ||
20 | struct device dev; /* Generic device interface */ | ||
21 | }; | ||
22 | #define to_of_device(d) container_of(d, struct of_device, dev) | ||
23 | |||
24 | extern const struct of_device_id *of_match_device( | ||
25 | const struct of_device_id *matches, const struct of_device *dev); | ||
26 | |||
27 | extern struct of_device *of_dev_get(struct of_device *dev); | ||
28 | extern void of_dev_put(struct of_device *dev); | ||
29 | |||
30 | /* | ||
31 | * An of_platform_driver driver is attached to a basic of_device on | ||
32 | * the ISA, EBUS, and SBUS busses on sparc64. | ||
33 | */ | ||
34 | struct of_platform_driver | ||
35 | { | ||
36 | char *name; | ||
37 | struct of_device_id *match_table; | ||
38 | struct module *owner; | ||
39 | |||
40 | int (*probe)(struct of_device* dev, const struct of_device_id *match); | ||
41 | int (*remove)(struct of_device* dev); | ||
42 | |||
43 | int (*suspend)(struct of_device* dev, pm_message_t state); | ||
44 | int (*resume)(struct of_device* dev); | ||
45 | int (*shutdown)(struct of_device* dev); | ||
46 | |||
47 | struct device_driver driver; | ||
48 | }; | ||
49 | #define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) | ||
50 | |||
51 | extern int of_register_driver(struct of_platform_driver *drv, | ||
52 | struct bus_type *bus); | ||
53 | extern void of_unregister_driver(struct of_platform_driver *drv); | ||
54 | extern int of_device_register(struct of_device *ofdev); | ||
55 | extern void of_device_unregister(struct of_device *ofdev); | ||
56 | extern struct of_device *of_platform_device_create(struct device_node *np, | ||
57 | const char *bus_id, | ||
58 | struct device *parent, | ||
59 | struct bus_type *bus); | ||
60 | extern void of_release_dev(struct device *dev); | ||
61 | |||
62 | #endif /* __KERNEL__ */ | ||
63 | #endif /* _ASM_SPARC_OF_DEVICE_H */ | ||
diff --git a/include/asm-sparc/pbm.h b/include/asm-sparc/pbm.h index 0aba3a82c2eb..fedd9c6e875c 100644 --- a/include/asm-sparc/pbm.h +++ b/include/asm-sparc/pbm.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #include <asm/oplib.h> | 24 | #include <asm/oplib.h> |
25 | #include <asm/prom.h> | ||
25 | 26 | ||
26 | struct linux_pbm_info { | 27 | struct linux_pbm_info { |
27 | int prom_node; | 28 | int prom_node; |
@@ -40,7 +41,7 @@ struct linux_pbm_info { | |||
40 | */ | 41 | */ |
41 | struct pcidev_cookie { | 42 | struct pcidev_cookie { |
42 | struct linux_pbm_info *pbm; | 43 | struct linux_pbm_info *pbm; |
43 | int prom_node; | 44 | struct device_node *prom_node; |
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif /* !(__SPARC_PBM_H) */ | 47 | #endif /* !(__SPARC_PBM_H) */ |
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h new file mode 100644 index 000000000000..c5e3d26eabd3 --- /dev/null +++ b/include/asm-sparc/prom.h | |||
@@ -0,0 +1,98 @@ | |||
1 | #ifndef _SPARC_PROM_H | ||
2 | #define _SPARC_PROM_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | |||
6 | /* | ||
7 | * Definitions for talking to the Open Firmware PROM on | ||
8 | * Power Macintosh computers. | ||
9 | * | ||
10 | * Copyright (C) 1996-2005 Paul Mackerras. | ||
11 | * | ||
12 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | ||
13 | * Updates for SPARC32 by David S. Miller | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version | ||
18 | * 2 of the License, or (at your option) any later version. | ||
19 | */ | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/proc_fs.h> | ||
23 | #include <asm/atomic.h> | ||
24 | |||
25 | typedef u32 phandle; | ||
26 | typedef u32 ihandle; | ||
27 | |||
28 | struct interrupt_info { | ||
29 | int line; | ||
30 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
31 | }; | ||
32 | |||
33 | struct property { | ||
34 | char *name; | ||
35 | int length; | ||
36 | void *value; | ||
37 | struct property *next; | ||
38 | }; | ||
39 | |||
40 | struct device_node { | ||
41 | char *name; | ||
42 | char *type; | ||
43 | phandle node; | ||
44 | phandle linux_phandle; | ||
45 | int n_intrs; | ||
46 | struct interrupt_info *intrs; | ||
47 | char *path_component_name; | ||
48 | char *full_name; | ||
49 | |||
50 | struct property *properties; | ||
51 | struct property *deadprops; /* removed properties */ | ||
52 | struct device_node *parent; | ||
53 | struct device_node *child; | ||
54 | struct device_node *sibling; | ||
55 | struct device_node *next; /* next device of same type */ | ||
56 | struct device_node *allnext; /* next in list of all nodes */ | ||
57 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
58 | struct kref kref; | ||
59 | unsigned long _flags; | ||
60 | void *data; | ||
61 | }; | ||
62 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
64 | { | ||
65 | dn->pde = de; | ||
66 | } | ||
67 | |||
68 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
69 | const char *name); | ||
70 | #define for_each_node_by_name(dn, name) \ | ||
71 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
72 | dn = of_find_node_by_name(dn, name)) | ||
73 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
74 | const char *type); | ||
75 | #define for_each_node_by_type(dn, type) \ | ||
76 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
77 | dn = of_find_node_by_type(dn, type)) | ||
78 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
79 | const char *type, const char *compat); | ||
80 | extern struct device_node *of_find_node_by_path(const char *path); | ||
81 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
82 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
83 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
84 | struct device_node *prev); | ||
85 | extern struct property *of_find_property(struct device_node *np, | ||
86 | const char *name, | ||
87 | int *lenp); | ||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | ||
89 | extern void *of_get_property(struct device_node *node, const char *name, | ||
90 | int *lenp); | ||
91 | extern int of_getintprop_default(struct device_node *np, | ||
92 | const char *name, | ||
93 | int def); | ||
94 | |||
95 | extern void prom_build_devicetree(void); | ||
96 | |||
97 | #endif /* __KERNEL__ */ | ||
98 | #endif /* _SPARC_PROM_H */ | ||
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h index a13cddcecec5..d036e4419d79 100644 --- a/include/asm-sparc/sbus.h +++ b/include/asm-sparc/sbus.h | |||
@@ -11,7 +11,8 @@ | |||
11 | #include <linux/ioport.h> | 11 | #include <linux/ioport.h> |
12 | 12 | ||
13 | #include <asm/oplib.h> | 13 | #include <asm/oplib.h> |
14 | /* #include <asm/iommu.h> */ /* Unused since we use opaque iommu (|io-unit) */ | 14 | #include <asm/prom.h> |
15 | #include <asm/of_device.h> | ||
15 | #include <asm/scatterlist.h> | 16 | #include <asm/scatterlist.h> |
16 | 17 | ||
17 | /* We scan which devices are on the SBus using the PROM node device | 18 | /* We scan which devices are on the SBus using the PROM node device |
@@ -42,18 +43,19 @@ struct sbus_bus; | |||
42 | 43 | ||
43 | /* Linux SBUS device tables */ | 44 | /* Linux SBUS device tables */ |
44 | struct sbus_dev { | 45 | struct sbus_dev { |
45 | struct sbus_bus *bus; /* Back ptr to sbus */ | 46 | struct of_device ofdev; |
46 | struct sbus_dev *next; /* next device on this SBus or null */ | 47 | struct sbus_bus *bus; |
47 | struct sbus_dev *child; /* For ledma and espdma on sun4m */ | 48 | struct sbus_dev *next; |
48 | struct sbus_dev *parent; /* Parent device if not toplevel */ | 49 | struct sbus_dev *child; |
49 | int prom_node; /* PROM device tree node for this device */ | 50 | struct sbus_dev *parent; |
50 | char prom_name[64]; /* PROM device name */ | 51 | int prom_node; |
52 | char prom_name[64]; | ||
51 | int slot; | 53 | int slot; |
52 | 54 | ||
53 | struct resource resource[PROMREG_MAX]; | 55 | struct resource resource[PROMREG_MAX]; |
54 | 56 | ||
55 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; | 57 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; |
56 | int num_registers, ranges_applied; | 58 | int num_registers; |
57 | 59 | ||
58 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; | 60 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; |
59 | int num_device_ranges; | 61 | int num_device_ranges; |
@@ -61,9 +63,11 @@ struct sbus_dev { | |||
61 | unsigned int irqs[4]; | 63 | unsigned int irqs[4]; |
62 | int num_irqs; | 64 | int num_irqs; |
63 | }; | 65 | }; |
66 | #define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev) | ||
64 | 67 | ||
65 | /* This struct describes the SBus(s) found on this machine. */ | 68 | /* This struct describes the SBus(s) found on this machine. */ |
66 | struct sbus_bus { | 69 | struct sbus_bus { |
70 | struct of_device ofdev; | ||
67 | void *iommu; /* Opaque IOMMU cookie */ | 71 | void *iommu; /* Opaque IOMMU cookie */ |
68 | struct sbus_dev *devices; /* Link to devices on this SBus */ | 72 | struct sbus_dev *devices; /* Link to devices on this SBus */ |
69 | struct sbus_bus *next; /* next SBus, if more than one SBus */ | 73 | struct sbus_bus *next; /* next SBus, if more than one SBus */ |
@@ -77,6 +81,7 @@ struct sbus_bus { | |||
77 | int devid; | 81 | int devid; |
78 | int board; | 82 | int board; |
79 | }; | 83 | }; |
84 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) | ||
80 | 85 | ||
81 | extern struct sbus_bus *sbus_root; | 86 | extern struct sbus_bus *sbus_root; |
82 | 87 | ||
@@ -102,6 +107,7 @@ sbus_is_slave(struct sbus_dev *dev) | |||
102 | #define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ | 107 | #define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ |
103 | #define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */ | 108 | #define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */ |
104 | extern void sbus_set_sbus64(struct sbus_dev *, int); | 109 | extern void sbus_set_sbus64(struct sbus_dev *, int); |
110 | extern void sbus_fill_device_irq(struct sbus_dev *); | ||
105 | 111 | ||
106 | /* These yield IOMMU mappings in consistent mode. */ | 112 | /* These yield IOMMU mappings in consistent mode. */ |
107 | extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp); | 113 | extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp); |
@@ -139,4 +145,10 @@ extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, | |||
139 | BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) | 145 | BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) |
140 | #define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) | 146 | #define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) |
141 | 147 | ||
148 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); | ||
149 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); | ||
150 | extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); | ||
151 | extern int sbus_arch_preinit(void); | ||
152 | extern void sbus_arch_postinit(void); | ||
153 | |||
142 | #endif /* !(_SPARC_SBUS_H) */ | 154 | #endif /* !(_SPARC_SBUS_H) */ |
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h index 7a408a030f52..a4afe9d5703a 100644 --- a/include/asm-sparc64/ebus.h +++ b/include/asm-sparc64/ebus.h | |||
@@ -10,13 +10,14 @@ | |||
10 | 10 | ||
11 | #include <asm/pbm.h> | 11 | #include <asm/pbm.h> |
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/prom.h> | ||
14 | #include <asm/of_device.h> | ||
13 | 15 | ||
14 | struct linux_ebus_child { | 16 | struct linux_ebus_child { |
15 | struct linux_ebus_child *next; | 17 | struct linux_ebus_child *next; |
16 | struct linux_ebus_device *parent; | 18 | struct linux_ebus_device *parent; |
17 | struct linux_ebus *bus; | 19 | struct linux_ebus *bus; |
18 | int prom_node; | 20 | struct device_node *prom_node; |
19 | char prom_name[64]; | ||
20 | struct resource resource[PROMREG_MAX]; | 21 | struct resource resource[PROMREG_MAX]; |
21 | int num_addrs; | 22 | int num_addrs; |
22 | unsigned int irqs[PROMINTR_MAX]; | 23 | unsigned int irqs[PROMINTR_MAX]; |
@@ -24,32 +25,29 @@ struct linux_ebus_child { | |||
24 | }; | 25 | }; |
25 | 26 | ||
26 | struct linux_ebus_device { | 27 | struct linux_ebus_device { |
28 | struct of_device ofdev; | ||
27 | struct linux_ebus_device *next; | 29 | struct linux_ebus_device *next; |
28 | struct linux_ebus_child *children; | 30 | struct linux_ebus_child *children; |
29 | struct linux_ebus *bus; | 31 | struct linux_ebus *bus; |
30 | int prom_node; | 32 | struct device_node *prom_node; |
31 | char prom_name[64]; | ||
32 | struct resource resource[PROMREG_MAX]; | 33 | struct resource resource[PROMREG_MAX]; |
33 | int num_addrs; | 34 | int num_addrs; |
34 | unsigned int irqs[PROMINTR_MAX]; | 35 | unsigned int irqs[PROMINTR_MAX]; |
35 | int num_irqs; | 36 | int num_irqs; |
36 | }; | 37 | }; |
38 | #define to_ebus_device(d) container_of(d, struct linux_ebus_device, ofdev.dev) | ||
37 | 39 | ||
38 | struct linux_ebus { | 40 | struct linux_ebus { |
41 | struct of_device ofdev; | ||
39 | struct linux_ebus *next; | 42 | struct linux_ebus *next; |
40 | struct linux_ebus_device *devices; | 43 | struct linux_ebus_device *devices; |
41 | struct pci_pbm_info *parent; | 44 | struct pci_pbm_info *parent; |
42 | struct pci_dev *self; | 45 | struct pci_dev *self; |
43 | int index; | 46 | int index; |
44 | int is_rio; | 47 | int is_rio; |
45 | int prom_node; | 48 | struct device_node *prom_node; |
46 | char prom_name[64]; | ||
47 | struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX]; | ||
48 | int num_ebus_ranges; | ||
49 | struct linux_prom_ebus_intmap ebus_intmap[PROMREG_MAX]; | ||
50 | int num_ebus_intmap; | ||
51 | struct linux_prom_ebus_intmask ebus_intmask; | ||
52 | }; | 49 | }; |
50 | #define to_ebus(d) container_of(d, struct linux_ebus, ofdev.dev) | ||
53 | 51 | ||
54 | struct ebus_dma_info { | 52 | struct ebus_dma_info { |
55 | spinlock_t lock; | 53 | spinlock_t lock; |
diff --git a/include/asm-sparc64/fhc.h b/include/asm-sparc64/fhc.h index f29eaa254055..9e7f1b0d78b9 100644 --- a/include/asm-sparc64/fhc.h +++ b/include/asm-sparc64/fhc.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
11 | 11 | ||
12 | #include <asm/oplib.h> | 12 | #include <asm/oplib.h> |
13 | #include <asm/prom.h> | ||
13 | #include <asm/upa.h> | 14 | #include <asm/upa.h> |
14 | 15 | ||
15 | struct linux_fhc; | 16 | struct linux_fhc; |
@@ -34,8 +35,7 @@ struct linux_central { | |||
34 | unsigned long clkregs; | 35 | unsigned long clkregs; |
35 | unsigned long clkver; | 36 | unsigned long clkver; |
36 | int slots; | 37 | int slots; |
37 | int prom_node; | 38 | struct device_node *prom_node; |
38 | char prom_name[64]; | ||
39 | 39 | ||
40 | struct linux_prom_ranges central_ranges[PROMREG_MAX]; | 40 | struct linux_prom_ranges central_ranges[PROMREG_MAX]; |
41 | int num_central_ranges; | 41 | int num_central_ranges; |
@@ -112,8 +112,7 @@ struct linux_fhc { | |||
112 | struct fhc_regs fhc_regs; | 112 | struct fhc_regs fhc_regs; |
113 | int board; | 113 | int board; |
114 | int jtag_master; | 114 | int jtag_master; |
115 | int prom_node; | 115 | struct device_node *prom_node; |
116 | char prom_name[64]; | ||
117 | 116 | ||
118 | struct linux_prom_ranges fhc_ranges[PROMREG_MAX]; | 117 | struct linux_prom_ranges fhc_ranges[PROMREG_MAX]; |
119 | int num_fhc_ranges; | 118 | int num_fhc_ranges; |
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index 07ccd6f04b52..f8d57bb5570c 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -498,15 +498,14 @@ static int sun_pci_fd_test_drive(unsigned long port, int drive) | |||
498 | #ifdef CONFIG_PCI | 498 | #ifdef CONFIG_PCI |
499 | static int __init ebus_fdthree_p(struct linux_ebus_device *edev) | 499 | static int __init ebus_fdthree_p(struct linux_ebus_device *edev) |
500 | { | 500 | { |
501 | if (!strcmp(edev->prom_name, "fdthree")) | 501 | if (!strcmp(edev->prom_node->name, "fdthree")) |
502 | return 1; | 502 | return 1; |
503 | if (!strcmp(edev->prom_name, "floppy")) { | 503 | if (!strcmp(edev->prom_node->name, "floppy")) { |
504 | char compat[16]; | 504 | char *compat; |
505 | prom_getstring(edev->prom_node, | 505 | |
506 | "compatible", | 506 | compat = of_get_property(edev->prom_node, |
507 | compat, sizeof(compat)); | 507 | "compatible", NULL); |
508 | compat[15] = '\0'; | 508 | if (compat && !strcmp(compat, "fdthree")) |
509 | if (!strcmp(compat, "fdthree")) | ||
510 | return 1; | 509 | return 1; |
511 | } | 510 | } |
512 | return 0; | 511 | return 0; |
@@ -524,12 +523,12 @@ static unsigned long __init isa_floppy_init(void) | |||
524 | 523 | ||
525 | for_each_isa(isa_br) { | 524 | for_each_isa(isa_br) { |
526 | for_each_isadev(isa_dev, isa_br) { | 525 | for_each_isadev(isa_dev, isa_br) { |
527 | if (!strcmp(isa_dev->prom_name, "dma")) { | 526 | if (!strcmp(isa_dev->prom_node->name, "dma")) { |
528 | struct sparc_isa_device *child = | 527 | struct sparc_isa_device *child = |
529 | isa_dev->child; | 528 | isa_dev->child; |
530 | 529 | ||
531 | while (child) { | 530 | while (child) { |
532 | if (!strcmp(child->prom_name, | 531 | if (!strcmp(child->prom_node->name, |
533 | "floppy")) { | 532 | "floppy")) { |
534 | isa_dev = child; | 533 | isa_dev = child; |
535 | goto isa_done; | 534 | goto isa_done; |
@@ -614,6 +613,7 @@ static unsigned long __init sun_floppy_init(void) | |||
614 | struct linux_ebus_device *edev = NULL; | 613 | struct linux_ebus_device *edev = NULL; |
615 | unsigned long config = 0; | 614 | unsigned long config = 0; |
616 | void __iomem *auxio_reg; | 615 | void __iomem *auxio_reg; |
616 | char *state_prop; | ||
617 | 617 | ||
618 | for_each_ebus(ebus) { | 618 | for_each_ebus(ebus) { |
619 | for_each_ebusdev(edev, ebus) { | 619 | for_each_ebusdev(edev, ebus) { |
@@ -630,9 +630,8 @@ static unsigned long __init sun_floppy_init(void) | |||
630 | #endif | 630 | #endif |
631 | } | 631 | } |
632 | 632 | ||
633 | prom_getproperty(edev->prom_node, "status", | 633 | state_prop = of_get_property(edev->prom_node, "status", NULL); |
634 | state, sizeof(state)); | 634 | if (state_prop && !strncmp(state_prop, "disabled", 8)) |
635 | if (!strncmp(state, "disabled", 8)) | ||
636 | return 0; | 635 | return 0; |
637 | 636 | ||
638 | FLOPPY_IRQ = edev->irqs[0]; | 637 | FLOPPY_IRQ = edev->irqs[0]; |
@@ -703,7 +702,7 @@ static unsigned long __init sun_floppy_init(void) | |||
703 | */ | 702 | */ |
704 | for_each_ebus(ebus) { | 703 | for_each_ebus(ebus) { |
705 | for_each_ebusdev(edev, ebus) { | 704 | for_each_ebusdev(edev, ebus) { |
706 | if (!strcmp(edev->prom_name, "ecpp")) { | 705 | if (!strcmp(edev->prom_node->name, "ecpp")) { |
707 | config = edev->resource[1].start; | 706 | config = edev->resource[1].start; |
708 | goto config_done; | 707 | goto config_done; |
709 | } | 708 | } |
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h index 4601bbfc3e7b..d9728b9031fc 100644 --- a/include/asm-sparc64/isa.h +++ b/include/asm-sparc64/isa.h | |||
@@ -9,37 +9,32 @@ | |||
9 | 9 | ||
10 | #include <asm/pbm.h> | 10 | #include <asm/pbm.h> |
11 | #include <asm/oplib.h> | 11 | #include <asm/oplib.h> |
12 | #include <asm/prom.h> | ||
13 | #include <asm/of_device.h> | ||
12 | 14 | ||
13 | struct sparc_isa_bridge; | 15 | struct sparc_isa_bridge; |
14 | 16 | ||
15 | struct sparc_isa_device { | 17 | struct sparc_isa_device { |
18 | struct of_device ofdev; | ||
16 | struct sparc_isa_device *next; | 19 | struct sparc_isa_device *next; |
17 | struct sparc_isa_device *child; | 20 | struct sparc_isa_device *child; |
18 | struct sparc_isa_bridge *bus; | 21 | struct sparc_isa_bridge *bus; |
19 | int prom_node; | 22 | struct device_node *prom_node; |
20 | char prom_name[64]; | ||
21 | char compatible[64]; | ||
22 | struct resource resource; | 23 | struct resource resource; |
23 | unsigned int irq; | 24 | unsigned int irq; |
24 | }; | 25 | }; |
26 | #define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev) | ||
25 | 27 | ||
26 | struct sparc_isa_bridge { | 28 | struct sparc_isa_bridge { |
29 | struct of_device ofdev; | ||
27 | struct sparc_isa_bridge *next; | 30 | struct sparc_isa_bridge *next; |
28 | struct sparc_isa_device *devices; | 31 | struct sparc_isa_device *devices; |
29 | struct pci_pbm_info *parent; | 32 | struct pci_pbm_info *parent; |
30 | struct pci_dev *self; | 33 | struct pci_dev *self; |
31 | int index; | 34 | int index; |
32 | int prom_node; | 35 | struct device_node *prom_node; |
33 | char prom_name[64]; | ||
34 | #define linux_prom_isa_ranges linux_prom_ebus_ranges | ||
35 | struct linux_prom_isa_ranges isa_ranges[PROMREG_MAX]; | ||
36 | int num_isa_ranges; | ||
37 | #define linux_prom_isa_intmap linux_prom_ebus_intmap | ||
38 | struct linux_prom_isa_intmap isa_intmap[PROMREG_MAX]; | ||
39 | int num_isa_intmap; | ||
40 | #define linux_prom_isa_intmask linux_prom_ebus_intmask | ||
41 | struct linux_prom_isa_intmap isa_intmask; | ||
42 | }; | 36 | }; |
37 | #define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev) | ||
43 | 38 | ||
44 | extern struct sparc_isa_bridge *isa_chain; | 39 | extern struct sparc_isa_bridge *isa_chain; |
45 | 40 | ||
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h new file mode 100644 index 000000000000..024088ef9d27 --- /dev/null +++ b/include/asm-sparc64/of_device.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef _ASM_SPARC64_OF_DEVICE_H | ||
2 | #define _ASM_SPARC64_OF_DEVICE_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #include <linux/device.h> | ||
6 | #include <linux/mod_devicetable.h> | ||
7 | #include <asm/prom.h> | ||
8 | |||
9 | extern struct bus_type isa_bus_type; | ||
10 | extern struct bus_type ebus_bus_type; | ||
11 | extern struct bus_type sbus_bus_type; | ||
12 | |||
13 | /* | ||
14 | * The of_device is a kind of "base class" that is a superset of | ||
15 | * struct device for use by devices attached to an OF node and | ||
16 | * probed using OF properties. | ||
17 | */ | ||
18 | struct of_device | ||
19 | { | ||
20 | struct device_node *node; /* OF device node */ | ||
21 | struct device dev; /* Generic device interface */ | ||
22 | }; | ||
23 | #define to_of_device(d) container_of(d, struct of_device, dev) | ||
24 | |||
25 | extern const struct of_device_id *of_match_device( | ||
26 | const struct of_device_id *matches, const struct of_device *dev); | ||
27 | |||
28 | extern struct of_device *of_dev_get(struct of_device *dev); | ||
29 | extern void of_dev_put(struct of_device *dev); | ||
30 | |||
31 | /* | ||
32 | * An of_platform_driver driver is attached to a basic of_device on | ||
33 | * the ISA, EBUS, and SBUS busses on sparc64. | ||
34 | */ | ||
35 | struct of_platform_driver | ||
36 | { | ||
37 | char *name; | ||
38 | struct of_device_id *match_table; | ||
39 | struct module *owner; | ||
40 | |||
41 | int (*probe)(struct of_device* dev, const struct of_device_id *match); | ||
42 | int (*remove)(struct of_device* dev); | ||
43 | |||
44 | int (*suspend)(struct of_device* dev, pm_message_t state); | ||
45 | int (*resume)(struct of_device* dev); | ||
46 | int (*shutdown)(struct of_device* dev); | ||
47 | |||
48 | struct device_driver driver; | ||
49 | }; | ||
50 | #define to_of_platform_driver(drv) container_of(drv,struct of_platform_driver, driver) | ||
51 | |||
52 | extern int of_register_driver(struct of_platform_driver *drv, | ||
53 | struct bus_type *bus); | ||
54 | extern void of_unregister_driver(struct of_platform_driver *drv); | ||
55 | extern int of_device_register(struct of_device *ofdev); | ||
56 | extern void of_device_unregister(struct of_device *ofdev); | ||
57 | extern struct of_device *of_platform_device_create(struct device_node *np, | ||
58 | const char *bus_id, | ||
59 | struct device *parent, | ||
60 | struct bus_type *bus); | ||
61 | extern void of_release_dev(struct device *dev); | ||
62 | |||
63 | #endif /* __KERNEL__ */ | ||
64 | #endif /* _ASM_SPARC64_OF_DEVICE_H */ | ||
diff --git a/include/asm-sparc64/oplib.h b/include/asm-sparc64/oplib.h index dea3e73f0955..a68b0bb05958 100644 --- a/include/asm-sparc64/oplib.h +++ b/include/asm-sparc64/oplib.h | |||
@@ -323,8 +323,9 @@ extern int prom_pathtoinode(const char *path); | |||
323 | extern int prom_inst2pkg(int); | 323 | extern int prom_inst2pkg(int); |
324 | 324 | ||
325 | /* CPU probing helpers. */ | 325 | /* CPU probing helpers. */ |
326 | int cpu_find_by_instance(int instance, int *prom_node, int *mid); | 326 | struct device_node; |
327 | int cpu_find_by_mid(int mid, int *prom_node); | 327 | int cpu_find_by_instance(int instance, struct device_node **dev_node, int *mid); |
328 | int cpu_find_by_mid(int mid, struct device_node **prom_node); | ||
328 | 329 | ||
329 | /* Client interface level routines. */ | 330 | /* Client interface level routines. */ |
330 | extern void prom_set_trap_table(unsigned long tba); | 331 | extern void prom_set_trap_table(unsigned long tba); |
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h index 56b5197d7898..d3895873e4c7 100644 --- a/include/asm-sparc64/parport.h +++ b/include/asm-sparc64/parport.h | |||
@@ -67,18 +67,17 @@ static __inline__ unsigned int get_dma_residue(unsigned int dmanr) | |||
67 | 67 | ||
68 | static int ebus_ecpp_p(struct linux_ebus_device *edev) | 68 | static int ebus_ecpp_p(struct linux_ebus_device *edev) |
69 | { | 69 | { |
70 | if (!strcmp(edev->prom_name, "ecpp")) | 70 | if (!strcmp(edev->prom_node->name, "ecpp")) |
71 | return 1; | 71 | return 1; |
72 | if (!strcmp(edev->prom_name, "parallel")) { | 72 | if (!strcmp(edev->prom_node->name, "parallel")) { |
73 | char compat[19]; | 73 | char *compat; |
74 | prom_getstring(edev->prom_node, | 74 | |
75 | "compatible", | 75 | compat = of_get_property(edev->prom_node, |
76 | compat, sizeof(compat)); | 76 | "compatible", NULL); |
77 | compat[18] = '\0'; | 77 | if (compat && |
78 | if (!strcmp(compat, "ecpp")) | 78 | (!strcmp(compat, "ecpp") || |
79 | return 1; | 79 | !strcmp(compat, "ns87317-ecpp") || |
80 | if (!strcmp(compat, "ns87317-ecpp") && | 80 | !strcmp(compat + 13, "ecpp"))) |
81 | !strcmp(compat + 13, "ecpp")) | ||
82 | return 1; | 81 | return 1; |
83 | } | 82 | } |
84 | return 0; | 83 | return 0; |
@@ -94,12 +93,12 @@ static int parport_isa_probe(int count) | |||
94 | struct sparc_isa_device *child; | 93 | struct sparc_isa_device *child; |
95 | unsigned long base; | 94 | unsigned long base; |
96 | 95 | ||
97 | if (strcmp(isa_dev->prom_name, "dma")) | 96 | if (strcmp(isa_dev->prom_node->name, "dma")) |
98 | continue; | 97 | continue; |
99 | 98 | ||
100 | child = isa_dev->child; | 99 | child = isa_dev->child; |
101 | while (child) { | 100 | while (child) { |
102 | if (!strcmp(child->prom_name, "parallel")) | 101 | if (!strcmp(child->prom_node->name, "parallel")) |
103 | break; | 102 | break; |
104 | child = child->next; | 103 | child = child->next; |
105 | } | 104 | } |
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 1396f110939a..cebe80b1da6c 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/prom.h> | ||
18 | #include <asm/iommu.h> | 19 | #include <asm/iommu.h> |
19 | 20 | ||
20 | /* The abstraction used here is that there are PCI controllers, | 21 | /* The abstraction used here is that there are PCI controllers, |
@@ -153,16 +154,15 @@ struct pci_pbm_info { | |||
153 | int chip_revision; | 154 | int chip_revision; |
154 | 155 | ||
155 | /* Name used for top-level resources. */ | 156 | /* Name used for top-level resources. */ |
156 | char name[64]; | 157 | char *name; |
157 | 158 | ||
158 | /* OBP specific information. */ | 159 | /* OBP specific information. */ |
159 | int prom_node; | 160 | struct device_node *prom_node; |
160 | char prom_name[64]; | 161 | struct linux_prom_pci_ranges *pbm_ranges; |
161 | struct linux_prom_pci_ranges pbm_ranges[PROM_PCIRNG_MAX]; | ||
162 | int num_pbm_ranges; | 162 | int num_pbm_ranges; |
163 | struct linux_prom_pci_intmap pbm_intmap[PROM_PCIIMAP_MAX]; | 163 | struct linux_prom_pci_intmap *pbm_intmap; |
164 | int num_pbm_intmap; | 164 | int num_pbm_intmap; |
165 | struct linux_prom_pci_intmask pbm_intmask; | 165 | struct linux_prom_pci_intmask *pbm_intmask; |
166 | u64 ino_bitmap; | 166 | u64 ino_bitmap; |
167 | 167 | ||
168 | /* PBM I/O and Memory space resources. */ | 168 | /* PBM I/O and Memory space resources. */ |
@@ -227,8 +227,7 @@ struct pci_controller_info { | |||
227 | */ | 227 | */ |
228 | struct pcidev_cookie { | 228 | struct pcidev_cookie { |
229 | struct pci_pbm_info *pbm; | 229 | struct pci_pbm_info *pbm; |
230 | char prom_name[64]; | 230 | struct device_node *prom_node; |
231 | int prom_node; | ||
232 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; | 231 | struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; |
233 | int num_prom_regs; | 232 | int num_prom_regs; |
234 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; | 233 | struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; |
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 4e218814bb3c..03f5bc9b6bec 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h | |||
@@ -756,6 +756,8 @@ extern unsigned long *sparc64_valid_addr_bitmap; | |||
756 | #define kern_addr_valid(addr) \ | 756 | #define kern_addr_valid(addr) \ |
757 | (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) | 757 | (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) |
758 | 758 | ||
759 | extern int page_in_phys_avail(unsigned long paddr); | ||
760 | |||
759 | extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, | 761 | extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, |
760 | unsigned long pfn, | 762 | unsigned long pfn, |
761 | unsigned long size, pgprot_t prot); | 763 | unsigned long size, pgprot_t prot); |
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h new file mode 100644 index 000000000000..6d1556c0c263 --- /dev/null +++ b/include/asm-sparc64/prom.h | |||
@@ -0,0 +1,98 @@ | |||
1 | #ifndef _SPARC64_PROM_H | ||
2 | #define _SPARC64_PROM_H | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | |||
6 | /* | ||
7 | * Definitions for talking to the Open Firmware PROM on | ||
8 | * Power Macintosh computers. | ||
9 | * | ||
10 | * Copyright (C) 1996-2005 Paul Mackerras. | ||
11 | * | ||
12 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | ||
13 | * Updates for SPARC64 by David S. Miller | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or | ||
16 | * modify it under the terms of the GNU General Public License | ||
17 | * as published by the Free Software Foundation; either version | ||
18 | * 2 of the License, or (at your option) any later version. | ||
19 | */ | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/proc_fs.h> | ||
23 | #include <asm/atomic.h> | ||
24 | |||
25 | typedef u32 phandle; | ||
26 | typedef u32 ihandle; | ||
27 | |||
28 | struct interrupt_info { | ||
29 | int line; | ||
30 | int sense; /* +ve/-ve logic, edge or level, etc. */ | ||
31 | }; | ||
32 | |||
33 | struct property { | ||
34 | char *name; | ||
35 | int length; | ||
36 | void *value; | ||
37 | struct property *next; | ||
38 | }; | ||
39 | |||
40 | struct device_node { | ||
41 | char *name; | ||
42 | char *type; | ||
43 | phandle node; | ||
44 | phandle linux_phandle; | ||
45 | int n_intrs; | ||
46 | struct interrupt_info *intrs; | ||
47 | char *path_component_name; | ||
48 | char *full_name; | ||
49 | |||
50 | struct property *properties; | ||
51 | struct property *deadprops; /* removed properties */ | ||
52 | struct device_node *parent; | ||
53 | struct device_node *child; | ||
54 | struct device_node *sibling; | ||
55 | struct device_node *next; /* next device of same type */ | ||
56 | struct device_node *allnext; /* next in list of all nodes */ | ||
57 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
58 | struct kref kref; | ||
59 | unsigned long _flags; | ||
60 | void *data; | ||
61 | }; | ||
62 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
64 | { | ||
65 | dn->pde = de; | ||
66 | } | ||
67 | |||
68 | extern struct device_node *of_find_node_by_name(struct device_node *from, | ||
69 | const char *name); | ||
70 | #define for_each_node_by_name(dn, name) \ | ||
71 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
72 | dn = of_find_node_by_name(dn, name)) | ||
73 | extern struct device_node *of_find_node_by_type(struct device_node *from, | ||
74 | const char *type); | ||
75 | #define for_each_node_by_type(dn, type) \ | ||
76 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
77 | dn = of_find_node_by_type(dn, type)) | ||
78 | extern struct device_node *of_find_compatible_node(struct device_node *from, | ||
79 | const char *type, const char *compat); | ||
80 | extern struct device_node *of_find_node_by_path(const char *path); | ||
81 | extern struct device_node *of_find_node_by_phandle(phandle handle); | ||
82 | extern struct device_node *of_get_parent(const struct device_node *node); | ||
83 | extern struct device_node *of_get_next_child(const struct device_node *node, | ||
84 | struct device_node *prev); | ||
85 | extern struct property *of_find_property(struct device_node *np, | ||
86 | const char *name, | ||
87 | int *lenp); | ||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | ||
89 | extern void *of_get_property(struct device_node *node, const char *name, | ||
90 | int *lenp); | ||
91 | extern int of_getintprop_default(struct device_node *np, | ||
92 | const char *name, | ||
93 | int def); | ||
94 | |||
95 | extern void prom_build_devicetree(void); | ||
96 | |||
97 | #endif /* __KERNEL__ */ | ||
98 | #endif /* _SPARC64_PROM_H */ | ||
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h index 48279e10f385..56ee985e4605 100644 --- a/include/asm-sparc64/sbus.h +++ b/include/asm-sparc64/sbus.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/ioport.h> | 11 | #include <linux/ioport.h> |
12 | 12 | ||
13 | #include <asm/oplib.h> | 13 | #include <asm/oplib.h> |
14 | #include <asm/prom.h> | ||
15 | #include <asm/of_device.h> | ||
14 | #include <asm/iommu.h> | 16 | #include <asm/iommu.h> |
15 | #include <asm/scatterlist.h> | 17 | #include <asm/scatterlist.h> |
16 | 18 | ||
@@ -42,18 +44,19 @@ struct sbus_bus; | |||
42 | 44 | ||
43 | /* Linux SBUS device tables */ | 45 | /* Linux SBUS device tables */ |
44 | struct sbus_dev { | 46 | struct sbus_dev { |
45 | struct sbus_bus *bus; /* Our toplevel parent SBUS */ | 47 | struct of_device ofdev; |
46 | struct sbus_dev *next; /* Chain of siblings */ | 48 | struct sbus_bus *bus; |
47 | struct sbus_dev *child; /* Chain of children */ | 49 | struct sbus_dev *next; |
48 | struct sbus_dev *parent;/* Parent device if not toplevel*/ | 50 | struct sbus_dev *child; |
49 | int prom_node; /* OBP node of this device */ | 51 | struct sbus_dev *parent; |
50 | char prom_name[64]; /* OBP device name property */ | 52 | int prom_node; |
51 | int slot; /* SBUS slot number */ | 53 | char prom_name[64]; |
54 | int slot; | ||
52 | 55 | ||
53 | struct resource resource[PROMREG_MAX]; | 56 | struct resource resource[PROMREG_MAX]; |
54 | 57 | ||
55 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; | 58 | struct linux_prom_registers reg_addrs[PROMREG_MAX]; |
56 | int num_registers, ranges_applied; | 59 | int num_registers; |
57 | 60 | ||
58 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; | 61 | struct linux_prom_ranges device_ranges[PROMREG_MAX]; |
59 | int num_device_ranges; | 62 | int num_device_ranges; |
@@ -61,9 +64,11 @@ struct sbus_dev { | |||
61 | unsigned int irqs[4]; | 64 | unsigned int irqs[4]; |
62 | int num_irqs; | 65 | int num_irqs; |
63 | }; | 66 | }; |
67 | #define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev) | ||
64 | 68 | ||
65 | /* This struct describes the SBus(s) found on this machine. */ | 69 | /* This struct describes the SBus(s) found on this machine. */ |
66 | struct sbus_bus { | 70 | struct sbus_bus { |
71 | struct of_device ofdev; | ||
67 | void *iommu; /* Opaque IOMMU cookie */ | 72 | void *iommu; /* Opaque IOMMU cookie */ |
68 | struct sbus_dev *devices; /* Tree of SBUS devices */ | 73 | struct sbus_dev *devices; /* Tree of SBUS devices */ |
69 | struct sbus_bus *next; /* Next SBUS in system */ | 74 | struct sbus_bus *next; /* Next SBUS in system */ |
@@ -77,6 +82,7 @@ struct sbus_bus { | |||
77 | int portid; | 82 | int portid; |
78 | void *starfire_cookie; | 83 | void *starfire_cookie; |
79 | }; | 84 | }; |
85 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) | ||
80 | 86 | ||
81 | extern struct sbus_bus *sbus_root; | 87 | extern struct sbus_bus *sbus_root; |
82 | 88 | ||
@@ -95,6 +101,7 @@ extern struct sbus_bus *sbus_root; | |||
95 | #define sbus_can_dma_64bit(sdev) (1) | 101 | #define sbus_can_dma_64bit(sdev) (1) |
96 | #define sbus_can_burst64(sdev) (1) | 102 | #define sbus_can_burst64(sdev) (1) |
97 | extern void sbus_set_sbus64(struct sbus_dev *, int); | 103 | extern void sbus_set_sbus64(struct sbus_dev *, int); |
104 | extern void sbus_fill_device_irq(struct sbus_dev *); | ||
98 | 105 | ||
99 | /* These yield IOMMU mappings in consistent mode. */ | 106 | /* These yield IOMMU mappings in consistent mode. */ |
100 | extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); | 107 | extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); |
@@ -119,4 +126,10 @@ extern void sbus_dma_sync_sg_for_cpu(struct sbus_dev *, struct scatterlist *, in | |||
119 | #define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu | 126 | #define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu |
120 | extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); | 127 | extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); |
121 | 128 | ||
129 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); | ||
130 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); | ||
131 | extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); | ||
132 | extern int sbus_arch_preinit(void); | ||
133 | extern void sbus_arch_postinit(void); | ||
134 | |||
122 | #endif /* !(_SPARC64_SBUS_H) */ | 135 | #endif /* !(_SPARC64_SBUS_H) */ |
diff --git a/include/asm-sparc64/vdev.h b/include/asm-sparc64/vdev.h index 996e6be7b976..25637c57675d 100644 --- a/include/asm-sparc64/vdev.h +++ b/include/asm-sparc64/vdev.h | |||
@@ -7,10 +7,11 @@ | |||
7 | #define _SPARC64_VDEV_H | 7 | #define _SPARC64_VDEV_H |
8 | 8 | ||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <asm/prom.h> | ||
10 | 11 | ||
11 | extern u32 sun4v_vdev_devhandle; | 12 | extern u32 sun4v_vdev_devhandle; |
12 | extern int sun4v_vdev_root; | 13 | extern struct device_node *sun4v_vdev_root; |
13 | 14 | ||
14 | extern unsigned int sun4v_vdev_device_interrupt(unsigned int); | 15 | extern unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node); |
15 | 16 | ||
16 | #endif /* !(_SPARC64_VDEV_H) */ | 17 | #endif /* !(_SPARC64_VDEV_H) */ |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h new file mode 100644 index 000000000000..a376bd4ade39 --- /dev/null +++ b/include/linux/resume-trace.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef RESUME_TRACE_H | ||
2 | #define RESUME_TRACE_H | ||
3 | |||
4 | #ifdef CONFIG_PM_TRACE | ||
5 | |||
6 | struct device; | ||
7 | extern void set_trace_device(struct device *); | ||
8 | extern void generate_resume_trace(void *tracedata, unsigned int user); | ||
9 | |||
10 | #define TRACE_DEVICE(dev) set_trace_device(dev) | ||
11 | #define TRACE_RESUME(user) do { \ | ||
12 | void *tracedata; \ | ||
13 | asm volatile("movl $1f,%0\n" \ | ||
14 | ".section .tracedata,\"a\"\n" \ | ||
15 | "1:\t.word %c1\n" \ | ||
16 | "\t.long %c2\n" \ | ||
17 | ".previous" \ | ||
18 | :"=r" (tracedata) \ | ||
19 | : "i" (__LINE__), "i" (__FILE__)); \ | ||
20 | generate_resume_trace(tracedata, user); \ | ||
21 | } while (0) | ||
22 | |||
23 | #else | ||
24 | |||
25 | #define TRACE_DEVICE(dev) do { } while (0) | ||
26 | #define TRACE_RESUME(dev) do { } while (0) | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 0ef50baa7da6..951c4e858274 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -130,6 +130,9 @@ | |||
130 | /* SUN4V Hypervisor Console */ | 130 | /* SUN4V Hypervisor Console */ |
131 | #define PORT_SUNHV 72 | 131 | #define PORT_SUNHV 72 |
132 | 132 | ||
133 | #define PORT_S3C2412 73 | ||
134 | |||
135 | |||
133 | #ifdef __KERNEL__ | 136 | #ifdef __KERNEL__ |
134 | 137 | ||
135 | #include <linux/compiler.h> | 138 | #include <linux/compiler.h> |