diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/boot/dts/mpc8610_hpcd.dts | 12 | ||||
-rw-r--r-- | arch/powerpc/mm/mem.c | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 190 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_pciex.c | 18 | ||||
-rw-r--r-- | arch/powerpc/sysdev/axonram.c | 5 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 41 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.h | 23 |
7 files changed, 269 insertions, 29 deletions
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts index 16c947b8a721..1f2f1e0a5571 100644 --- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts +++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts | |||
@@ -45,6 +45,11 @@ | |||
45 | reg = <0x00000000 0x20000000>; // 512M at 0x0 | 45 | reg = <0x00000000 0x20000000>; // 512M at 0x0 |
46 | }; | 46 | }; |
47 | 47 | ||
48 | board-control@e8000000 { | ||
49 | compatible = "fsl,fpga-pixis"; | ||
50 | reg = <0xe8000000 32>; // pixis at 0xe8000000 | ||
51 | }; | ||
52 | |||
48 | soc@e0000000 { | 53 | soc@e0000000 { |
49 | #address-cells = <1>; | 54 | #address-cells = <1>; |
50 | #size-cells = <1>; | 55 | #size-cells = <1>; |
@@ -104,6 +109,13 @@ | |||
104 | interrupt-parent = <&mpic>; | 109 | interrupt-parent = <&mpic>; |
105 | }; | 110 | }; |
106 | 111 | ||
112 | display@2c000 { | ||
113 | compatible = "fsl,diu"; | ||
114 | reg = <0x2c000 100>; | ||
115 | interrupts = <72 2>; | ||
116 | interrupt-parent = <&mpic>; | ||
117 | }; | ||
118 | |||
107 | mpic: interrupt-controller@40000 { | 119 | mpic: interrupt-controller@40000 { |
108 | clock-frequency = <0>; | 120 | clock-frequency = <0>; |
109 | interrupt-controller; | 121 | interrupt-controller; |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 5ccb579b81e4..d9e37f365b54 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -110,15 +110,6 @@ EXPORT_SYMBOL(phys_mem_access_prot); | |||
110 | 110 | ||
111 | #ifdef CONFIG_MEMORY_HOTPLUG | 111 | #ifdef CONFIG_MEMORY_HOTPLUG |
112 | 112 | ||
113 | void online_page(struct page *page) | ||
114 | { | ||
115 | ClearPageReserved(page); | ||
116 | init_page_count(page); | ||
117 | __free_page(page); | ||
118 | totalram_pages++; | ||
119 | num_physpages++; | ||
120 | } | ||
121 | |||
122 | #ifdef CONFIG_NUMA | 113 | #ifdef CONFIG_NUMA |
123 | int memory_add_physaddr_to_nid(u64 start) | 114 | int memory_add_physaddr_to_nid(u64 start) |
124 | { | 115 | { |
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index 18b8ebe930d5..5e1e8cf14e75 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c | |||
@@ -3,11 +3,12 @@ | |||
3 | * | 3 | * |
4 | * Initial author: Xianghua Xiao <x.xiao@freescale.com> | 4 | * Initial author: Xianghua Xiao <x.xiao@freescale.com> |
5 | * Recode: Jason Jin <jason.jin@freescale.com> | 5 | * Recode: Jason Jin <jason.jin@freescale.com> |
6 | * York Sun <yorksun@freescale.com> | ||
6 | * | 7 | * |
7 | * Rewrite the interrupt routing. remove the 8259PIC support, | 8 | * Rewrite the interrupt routing. remove the 8259PIC support, |
8 | * All the integrated device in ULI use sideband interrupt. | 9 | * All the integrated device in ULI use sideband interrupt. |
9 | * | 10 | * |
10 | * Copyright 2007 Freescale Semiconductor Inc. | 11 | * Copyright 2008 Freescale Semiconductor Inc. |
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 13 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 14 | * under the terms of the GNU General Public License as published by the |
@@ -38,6 +39,8 @@ | |||
38 | #include <sysdev/fsl_pci.h> | 39 | #include <sysdev/fsl_pci.h> |
39 | #include <sysdev/fsl_soc.h> | 40 | #include <sysdev/fsl_soc.h> |
40 | 41 | ||
42 | static unsigned char *pixis_bdcfg0, *pixis_arch; | ||
43 | |||
41 | static struct of_device_id __initdata mpc8610_ids[] = { | 44 | static struct of_device_id __initdata mpc8610_ids[] = { |
42 | { .compatible = "fsl,mpc8610-immr", }, | 45 | { .compatible = "fsl,mpc8610-immr", }, |
43 | {} | 46 | {} |
@@ -52,8 +55,7 @@ static int __init mpc8610_declare_of_platform_devices(void) | |||
52 | } | 55 | } |
53 | machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices); | 56 | machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices); |
54 | 57 | ||
55 | static void __init | 58 | static void __init mpc86xx_hpcd_init_irq(void) |
56 | mpc86xx_hpcd_init_irq(void) | ||
57 | { | 59 | { |
58 | struct mpic *mpic1; | 60 | struct mpic *mpic1; |
59 | struct device_node *np; | 61 | struct device_node *np; |
@@ -161,12 +163,159 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); | |||
161 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, final_uli5288); | 163 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, final_uli5288); |
162 | #endif /* CONFIG_PCI */ | 164 | #endif /* CONFIG_PCI */ |
163 | 165 | ||
164 | static void __init | 166 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) |
165 | mpc86xx_hpcd_setup_arch(void) | 167 | |
168 | static u32 get_busfreq(void) | ||
166 | { | 169 | { |
167 | #ifdef CONFIG_PCI | 170 | struct device_node *node; |
168 | struct device_node *np; | 171 | |
172 | u32 fs_busfreq = 0; | ||
173 | node = of_find_node_by_type(NULL, "cpu"); | ||
174 | if (node) { | ||
175 | unsigned int size; | ||
176 | const unsigned int *prop = | ||
177 | of_get_property(node, "bus-frequency", &size); | ||
178 | if (prop) | ||
179 | fs_busfreq = *prop; | ||
180 | of_node_put(node); | ||
181 | }; | ||
182 | return fs_busfreq; | ||
183 | } | ||
184 | |||
185 | unsigned int mpc8610hpcd_get_pixel_format(unsigned int bits_per_pixel, | ||
186 | int monitor_port) | ||
187 | { | ||
188 | static const unsigned long pixelformat[][3] = { | ||
189 | {0x88882317, 0x88083218, 0x65052119}, | ||
190 | {0x88883316, 0x88082219, 0x65053118}, | ||
191 | }; | ||
192 | unsigned int pix_fmt, arch_monitor; | ||
193 | |||
194 | arch_monitor = ((*pixis_arch == 0x01) && (monitor_port == 0))? 0 : 1; | ||
195 | /* DVI port for board version 0x01 */ | ||
196 | |||
197 | if (bits_per_pixel == 32) | ||
198 | pix_fmt = pixelformat[arch_monitor][0]; | ||
199 | else if (bits_per_pixel == 24) | ||
200 | pix_fmt = pixelformat[arch_monitor][1]; | ||
201 | else if (bits_per_pixel == 16) | ||
202 | pix_fmt = pixelformat[arch_monitor][2]; | ||
203 | else | ||
204 | pix_fmt = pixelformat[1][0]; | ||
205 | |||
206 | return pix_fmt; | ||
207 | } | ||
208 | |||
209 | void mpc8610hpcd_set_gamma_table(int monitor_port, char *gamma_table_base) | ||
210 | { | ||
211 | int i; | ||
212 | if (monitor_port == 2) { /* dual link LVDS */ | ||
213 | for (i = 0; i < 256*3; i++) | ||
214 | gamma_table_base[i] = (gamma_table_base[i] << 2) | | ||
215 | ((gamma_table_base[i] >> 6) & 0x03); | ||
216 | } | ||
217 | } | ||
218 | |||
219 | void mpc8610hpcd_set_monitor_port(int monitor_port) | ||
220 | { | ||
221 | static const u8 bdcfg[] = {0xBD, 0xB5, 0xA5}; | ||
222 | if (monitor_port < 3) | ||
223 | *pixis_bdcfg0 = bdcfg[monitor_port]; | ||
224 | } | ||
225 | |||
226 | void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) | ||
227 | { | ||
228 | u32 __iomem *clkdvdr; | ||
229 | u32 temp; | ||
230 | /* variables for pixel clock calcs */ | ||
231 | ulong bestval, bestfreq, speed_ccb, minpixclock, maxpixclock; | ||
232 | ulong pixval; | ||
233 | long err; | ||
234 | int i; | ||
235 | |||
236 | clkdvdr = ioremap(get_immrbase() + 0xe0800, sizeof(u32)); | ||
237 | if (!clkdvdr) { | ||
238 | printk(KERN_ERR "Err: can't map clock divider register!\n"); | ||
239 | return; | ||
240 | } | ||
241 | |||
242 | /* Pixel Clock configuration */ | ||
243 | pr_debug("DIU: Bus Frequency = %d\n", get_busfreq()); | ||
244 | speed_ccb = get_busfreq(); | ||
245 | |||
246 | /* Calculate the pixel clock with the smallest error */ | ||
247 | /* calculate the following in steps to avoid overflow */ | ||
248 | pr_debug("DIU pixclock in ps - %d\n", pixclock); | ||
249 | temp = 1000000000/pixclock; | ||
250 | temp *= 1000; | ||
251 | pixclock = temp; | ||
252 | pr_debug("DIU pixclock freq - %u\n", pixclock); | ||
253 | |||
254 | temp = pixclock * 5 / 100; | ||
255 | pr_debug("deviation = %d\n", temp); | ||
256 | minpixclock = pixclock - temp; | ||
257 | maxpixclock = pixclock + temp; | ||
258 | pr_debug("DIU minpixclock - %lu\n", minpixclock); | ||
259 | pr_debug("DIU maxpixclock - %lu\n", maxpixclock); | ||
260 | pixval = speed_ccb/pixclock; | ||
261 | pr_debug("DIU pixval = %lu\n", pixval); | ||
262 | |||
263 | err = 100000000; | ||
264 | bestval = pixval; | ||
265 | pr_debug("DIU bestval = %lu\n", bestval); | ||
266 | |||
267 | bestfreq = 0; | ||
268 | for (i = -1; i <= 1; i++) { | ||
269 | temp = speed_ccb / ((pixval+i) + 1); | ||
270 | pr_debug("DIU test pixval i= %d, pixval=%lu, temp freq. = %u\n", | ||
271 | i, pixval, temp); | ||
272 | if ((temp < minpixclock) || (temp > maxpixclock)) | ||
273 | pr_debug("DIU exceeds monitor range (%lu to %lu)\n", | ||
274 | minpixclock, maxpixclock); | ||
275 | else if (abs(temp - pixclock) < err) { | ||
276 | pr_debug("Entered the else if block %d\n", i); | ||
277 | err = abs(temp - pixclock); | ||
278 | bestval = pixval+i; | ||
279 | bestfreq = temp; | ||
280 | } | ||
281 | } | ||
282 | |||
283 | pr_debug("DIU chose = %lx\n", bestval); | ||
284 | pr_debug("DIU error = %ld\n NomPixClk ", err); | ||
285 | pr_debug("DIU: Best Freq = %lx\n", bestfreq); | ||
286 | /* Modify PXCLK in GUTS CLKDVDR */ | ||
287 | pr_debug("DIU: Current value of CLKDVDR = 0x%08x\n", (*clkdvdr)); | ||
288 | temp = (*clkdvdr) & 0x2000FFFF; | ||
289 | *clkdvdr = temp; /* turn off clock */ | ||
290 | *clkdvdr = temp | 0x80000000 | (((bestval) & 0x1F) << 16); | ||
291 | pr_debug("DIU: Modified value of CLKDVDR = 0x%08x\n", (*clkdvdr)); | ||
292 | iounmap(clkdvdr); | ||
293 | } | ||
294 | |||
295 | ssize_t mpc8610hpcd_show_monitor_port(int monitor_port, char *buf) | ||
296 | { | ||
297 | return snprintf(buf, PAGE_SIZE, | ||
298 | "%c0 - DVI\n" | ||
299 | "%c1 - Single link LVDS\n" | ||
300 | "%c2 - Dual link LVDS\n", | ||
301 | monitor_port == 0 ? '*' : ' ', | ||
302 | monitor_port == 1 ? '*' : ' ', | ||
303 | monitor_port == 2 ? '*' : ' '); | ||
304 | } | ||
305 | |||
306 | int mpc8610hpcd_set_sysfs_monitor_port(int val) | ||
307 | { | ||
308 | return val < 3 ? val : 0; | ||
309 | } | ||
310 | |||
169 | #endif | 311 | #endif |
312 | |||
313 | static void __init mpc86xx_hpcd_setup_arch(void) | ||
314 | { | ||
315 | struct resource r; | ||
316 | struct device_node *np; | ||
317 | unsigned char *pixis; | ||
318 | |||
170 | if (ppc_md.progress) | 319 | if (ppc_md.progress) |
171 | ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0); | 320 | ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0); |
172 | 321 | ||
@@ -183,6 +332,30 @@ mpc86xx_hpcd_setup_arch(void) | |||
183 | } | 332 | } |
184 | } | 333 | } |
185 | #endif | 334 | #endif |
335 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
336 | preallocate_diu_videomemory(); | ||
337 | diu_ops.get_pixel_format = mpc8610hpcd_get_pixel_format; | ||
338 | diu_ops.set_gamma_table = mpc8610hpcd_set_gamma_table; | ||
339 | diu_ops.set_monitor_port = mpc8610hpcd_set_monitor_port; | ||
340 | diu_ops.set_pixel_clock = mpc8610hpcd_set_pixel_clock; | ||
341 | diu_ops.show_monitor_port = mpc8610hpcd_show_monitor_port; | ||
342 | diu_ops.set_sysfs_monitor_port = mpc8610hpcd_set_sysfs_monitor_port; | ||
343 | #endif | ||
344 | |||
345 | np = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis"); | ||
346 | if (np) { | ||
347 | of_address_to_resource(np, 0, &r); | ||
348 | of_node_put(np); | ||
349 | pixis = ioremap(r.start, 32); | ||
350 | if (!pixis) { | ||
351 | printk(KERN_ERR "Err: can't map FPGA cfg register!\n"); | ||
352 | return; | ||
353 | } | ||
354 | pixis_bdcfg0 = pixis + 8; | ||
355 | pixis_arch = pixis + 1; | ||
356 | } else | ||
357 | printk(KERN_ERR "Err: " | ||
358 | "can't find device node 'fsl,fpga-pixis'\n"); | ||
186 | 359 | ||
187 | printk("MPC86xx HPCD board from Freescale Semiconductor\n"); | 360 | printk("MPC86xx HPCD board from Freescale Semiconductor\n"); |
188 | } | 361 | } |
@@ -200,8 +373,7 @@ static int __init mpc86xx_hpcd_probe(void) | |||
200 | return 0; | 373 | return 0; |
201 | } | 374 | } |
202 | 375 | ||
203 | static long __init | 376 | static long __init mpc86xx_time_init(void) |
204 | mpc86xx_time_init(void) | ||
205 | { | 377 | { |
206 | unsigned int temp; | 378 | unsigned int temp; |
207 | 379 | ||
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index ab24d94baab6..31da84c458d2 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #include "celleb_scc.h" | 36 | #include "celleb_scc.h" |
37 | #include "celleb_pci.h" | 37 | #include "celleb_pci.h" |
38 | 38 | ||
39 | #define PEX_IN(base, off) in_be32((void *)(base) + (off)) | 39 | #define PEX_IN(base, off) in_be32((void __iomem *)(base) + (off)) |
40 | #define PEX_OUT(base, off, data) out_be32((void *)(base) + (off), (data)) | 40 | #define PEX_OUT(base, off, data) out_be32((void __iomem *)(base) + (off), (data)) |
41 | 41 | ||
42 | static void scc_pciex_io_flush(struct iowa_bus *bus) | 42 | static void scc_pciex_io_flush(struct iowa_bus *bus) |
43 | { | 43 | { |
@@ -304,7 +304,7 @@ static int __init scc_pciex_iowa_init(struct iowa_bus *bus, void *data) | |||
304 | ((((0x1 << (size))-1) << ((addr) & 0x3)) << PEXDCMND_BYTE_EN_SHIFT) | 304 | ((((0x1 << (size))-1) << ((addr) & 0x3)) << PEXDCMND_BYTE_EN_SHIFT) |
305 | #define MK_PEXDCMND(cmd, addr, size) ((cmd) | MK_PEXDCMND_BYTE_EN(addr, size)) | 305 | #define MK_PEXDCMND(cmd, addr, size) ((cmd) | MK_PEXDCMND_BYTE_EN(addr, size)) |
306 | 306 | ||
307 | static uint32_t config_read_pciex_dev(unsigned int *base, | 307 | static uint32_t config_read_pciex_dev(unsigned int __iomem *base, |
308 | uint64_t bus_no, uint64_t dev_no, uint64_t func_no, | 308 | uint64_t bus_no, uint64_t dev_no, uint64_t func_no, |
309 | uint64_t off, uint64_t size) | 309 | uint64_t off, uint64_t size) |
310 | { | 310 | { |
@@ -320,7 +320,7 @@ static uint32_t config_read_pciex_dev(unsigned int *base, | |||
320 | return ret; | 320 | return ret; |
321 | } | 321 | } |
322 | 322 | ||
323 | static void config_write_pciex_dev(unsigned int *base, uint64_t bus_no, | 323 | static void config_write_pciex_dev(unsigned int __iomem *base, uint64_t bus_no, |
324 | uint64_t dev_no, uint64_t func_no, uint64_t off, uint64_t size, | 324 | uint64_t dev_no, uint64_t func_no, uint64_t off, uint64_t size, |
325 | uint32_t data) | 325 | uint32_t data) |
326 | { | 326 | { |
@@ -338,7 +338,7 @@ static void config_write_pciex_dev(unsigned int *base, uint64_t bus_no, | |||
338 | ((((0x1 << (len)) - 1) << ((off) & 0x3)) << PEXCADRS_BYTE_EN_SHIFT) | 338 | ((((0x1 << (len)) - 1) << ((off) & 0x3)) << PEXCADRS_BYTE_EN_SHIFT) |
339 | #define MK_PEXCADRS(cmd, addr, size) \ | 339 | #define MK_PEXCADRS(cmd, addr, size) \ |
340 | ((cmd) | MK_PEXCADRS_BYTE_EN(addr, size) | ((addr) & ~0x3)) | 340 | ((cmd) | MK_PEXCADRS_BYTE_EN(addr, size) | ((addr) & ~0x3)) |
341 | static uint32_t config_read_pciex_rc(unsigned int *base, | 341 | static uint32_t config_read_pciex_rc(unsigned int __iomem *base, |
342 | uint32_t where, uint32_t size) | 342 | uint32_t where, uint32_t size) |
343 | { | 343 | { |
344 | PEX_OUT(base, PEXCADRS, MK_PEXCADRS(PEXCADRS_CMD_READ, where, size)); | 344 | PEX_OUT(base, PEXCADRS, MK_PEXCADRS(PEXCADRS_CMD_READ, where, size)); |
@@ -346,7 +346,7 @@ static uint32_t config_read_pciex_rc(unsigned int *base, | |||
346 | >> ((where & (4 - size)) * 8)) & ((0x1 << (size * 8)) - 1); | 346 | >> ((where & (4 - size)) * 8)) & ((0x1 << (size * 8)) - 1); |
347 | } | 347 | } |
348 | 348 | ||
349 | static void config_write_pciex_rc(unsigned int *base, uint32_t where, | 349 | static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where, |
350 | uint32_t size, uint32_t val) | 350 | uint32_t size, uint32_t val) |
351 | { | 351 | { |
352 | uint32_t data; | 352 | uint32_t data; |
@@ -410,7 +410,7 @@ static struct pci_ops scc_pciex_pci_ops = { | |||
410 | scc_pciex_write_config, | 410 | scc_pciex_write_config, |
411 | }; | 411 | }; |
412 | 412 | ||
413 | static void pciex_clear_intr_all(unsigned int *base) | 413 | static void pciex_clear_intr_all(unsigned int __iomem *base) |
414 | { | 414 | { |
415 | PEX_OUT(base, PEXAERRSTS, 0xffffffff); | 415 | PEX_OUT(base, PEXAERRSTS, 0xffffffff); |
416 | PEX_OUT(base, PEXPRERRSTS, 0xffffffff); | 416 | PEX_OUT(base, PEXPRERRSTS, 0xffffffff); |
@@ -427,7 +427,7 @@ static void pciex_disable_intr_all(unsigned int *base) | |||
427 | } | 427 | } |
428 | #endif | 428 | #endif |
429 | 429 | ||
430 | static void pciex_enable_intr_all(unsigned int *base) | 430 | static void pciex_enable_intr_all(unsigned int __iomem *base) |
431 | { | 431 | { |
432 | PEX_OUT(base, PEXINTMASK, 0x0000e7f1); | 432 | PEX_OUT(base, PEXINTMASK, 0x0000e7f1); |
433 | PEX_OUT(base, PEXAERRMASK, 0x03ff01ff); | 433 | PEX_OUT(base, PEXAERRMASK, 0x03ff01ff); |
@@ -435,7 +435,7 @@ static void pciex_enable_intr_all(unsigned int *base) | |||
435 | PEX_OUT(base, PEXVDMASK, 0x00000001); | 435 | PEX_OUT(base, PEXVDMASK, 0x00000001); |
436 | } | 436 | } |
437 | 437 | ||
438 | static void pciex_check_status(unsigned int *base) | 438 | static void pciex_check_status(unsigned int __iomem *base) |
439 | { | 439 | { |
440 | uint32_t err = 0; | 440 | uint32_t err = 0; |
441 | uint32_t intsts, aerr, prerr, rcvcp, lenerr; | 441 | uint32_t intsts, aerr, prerr, rcvcp, lenerr; |
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index d359d6e92975..7f59188cd9a1 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c | |||
@@ -143,7 +143,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio) | |||
143 | */ | 143 | */ |
144 | static int | 144 | static int |
145 | axon_ram_direct_access(struct block_device *device, sector_t sector, | 145 | axon_ram_direct_access(struct block_device *device, sector_t sector, |
146 | unsigned long *data) | 146 | void **kaddr, unsigned long *pfn) |
147 | { | 147 | { |
148 | struct axon_ram_bank *bank = device->bd_disk->private_data; | 148 | struct axon_ram_bank *bank = device->bd_disk->private_data; |
149 | loff_t offset; | 149 | loff_t offset; |
@@ -154,7 +154,8 @@ axon_ram_direct_access(struct block_device *device, sector_t sector, | |||
154 | return -ERANGE; | 154 | return -ERANGE; |
155 | } | 155 | } |
156 | 156 | ||
157 | *data = bank->ph_addr + offset; | 157 | *kaddr = (void *)(bank->ph_addr + offset); |
158 | *pfn = virt_to_phys(kaddr) >> PAGE_SHIFT; | ||
158 | 159 | ||
159 | return 0; | 160 | return 0; |
160 | } | 161 | } |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 5c1b246aaccc..7b45670c7af3 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -892,3 +892,44 @@ void fsl_rstcr_restart(char *cmd) | |||
892 | while (1) ; | 892 | while (1) ; |
893 | } | 893 | } |
894 | #endif | 894 | #endif |
895 | |||
896 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
897 | struct platform_diu_data_ops diu_ops = { | ||
898 | .diu_size = 1280 * 1024 * 4, /* default one 1280x1024 buffer */ | ||
899 | }; | ||
900 | EXPORT_SYMBOL(diu_ops); | ||
901 | |||
902 | int __init preallocate_diu_videomemory(void) | ||
903 | { | ||
904 | pr_debug("diu_size=%lu\n", diu_ops.diu_size); | ||
905 | |||
906 | diu_ops.diu_mem = __alloc_bootmem(diu_ops.diu_size, 8, 0); | ||
907 | if (!diu_ops.diu_mem) { | ||
908 | printk(KERN_ERR "fsl-diu: cannot allocate %lu bytes\n", | ||
909 | diu_ops.diu_size); | ||
910 | return -ENOMEM; | ||
911 | } | ||
912 | |||
913 | pr_debug("diu_mem=%p\n", diu_ops.diu_mem); | ||
914 | |||
915 | rh_init(&diu_ops.diu_rh_info, 4096, ARRAY_SIZE(diu_ops.diu_rh_block), | ||
916 | diu_ops.diu_rh_block); | ||
917 | return rh_attach_region(&diu_ops.diu_rh_info, | ||
918 | (unsigned long) diu_ops.diu_mem, | ||
919 | diu_ops.diu_size); | ||
920 | } | ||
921 | |||
922 | static int __init early_parse_diufb(char *p) | ||
923 | { | ||
924 | if (!p) | ||
925 | return 1; | ||
926 | |||
927 | diu_ops.diu_size = _ALIGN_UP(memparse(p, &p), 8); | ||
928 | |||
929 | pr_debug("diu_size=%lu\n", diu_ops.diu_size); | ||
930 | |||
931 | return 0; | ||
932 | } | ||
933 | early_param("diufb", early_parse_diufb); | ||
934 | |||
935 | #endif | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index 74c4a9657b33..52c831fa1886 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h | |||
@@ -17,5 +17,28 @@ extern int fsl_spi_init(struct spi_board_info *board_infos, | |||
17 | void (*deactivate_cs)(u8 cs, u8 polarity)); | 17 | void (*deactivate_cs)(u8 cs, u8 polarity)); |
18 | 18 | ||
19 | extern void fsl_rstcr_restart(char *cmd); | 19 | extern void fsl_rstcr_restart(char *cmd); |
20 | |||
21 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
22 | #include <linux/bootmem.h> | ||
23 | #include <asm/rheap.h> | ||
24 | struct platform_diu_data_ops { | ||
25 | rh_block_t diu_rh_block[16]; | ||
26 | rh_info_t diu_rh_info; | ||
27 | unsigned long diu_size; | ||
28 | void *diu_mem; | ||
29 | |||
30 | unsigned int (*get_pixel_format) (unsigned int bits_per_pixel, | ||
31 | int monitor_port); | ||
32 | void (*set_gamma_table) (int monitor_port, char *gamma_table_base); | ||
33 | void (*set_monitor_port) (int monitor_port); | ||
34 | void (*set_pixel_clock) (unsigned int pixclock); | ||
35 | ssize_t (*show_monitor_port) (int monitor_port, char *buf); | ||
36 | int (*set_sysfs_monitor_port) (int val); | ||
37 | }; | ||
38 | |||
39 | extern struct platform_diu_data_ops diu_ops; | ||
40 | int __init preallocate_diu_videomemory(void); | ||
41 | #endif | ||
42 | |||
20 | #endif | 43 | #endif |
21 | #endif | 44 | #endif |