forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/sh/boards/mach-kfr2r09/setup.c
....@@ -14,7 +14,6 @@
1414
1515 #include <linux/clkdev.h>
1616 #include <linux/delay.h>
17
-#include <linux/dma-mapping.h>
1817 #include <linux/gpio.h>
1918 #include <linux/gpio/machine.h>
2019 #include <linux/i2c.h>
....@@ -33,6 +32,7 @@
3332 #include <linux/sh_intc.h>
3433 #include <linux/usb/r8a66597.h>
3534 #include <linux/videodev2.h>
35
+#include <linux/dma-map-ops.h>
3636
3737 #include <mach/kfr2r09.h>
3838
....@@ -477,7 +477,7 @@
477477
478478 static int __init kfr2r09_devices_setup(void)
479479 {
480
- static struct clk *camera_clk;
480
+ struct clk *camera_clk;
481481
482482 /* register board specific self-refresh code */
483483 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
....@@ -601,11 +601,9 @@
601601
602602 /* Initialize CEU platform device separately to map memory first */
603603 device_initialize(&kfr2r09_ceu_device.dev);
604
- arch_setup_pdev_archdata(&kfr2r09_ceu_device);
605604 dma_declare_coherent_memory(&kfr2r09_ceu_device.dev,
606
- ceu_dma_membase, ceu_dma_membase,
607
- ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1,
608
- DMA_MEMORY_EXCLUSIVE);
605
+ ceu_dma_membase, ceu_dma_membase,
606
+ CEU_BUFFER_MEMORY_SIZE);
609607
610608 platform_device_add(&kfr2r09_ceu_device);
611609
....@@ -631,7 +629,10 @@
631629 phys_addr_t phys;
632630 phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
633631
634
- phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
632
+ phys = memblock_phys_alloc(size, PAGE_SIZE);
633
+ if (!phys)
634
+ panic("Failed to allocate CEU memory\n");
635
+
635636 memblock_free(phys, size);
636637 memblock_remove(phys, size);
637638