forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/arch/sh/boards/mach-se/7724/setup.c
....@@ -32,6 +32,7 @@
3232 #include <linux/smc91x.h>
3333 #include <linux/usb/r8a66597.h>
3434 #include <linux/videodev2.h>
35
+#include <linux/dma-map-ops.h>
3536
3637 #include <mach-se/mach/se7724.h>
3738 #include <media/drv-intf/renesas-ceu.h>
....@@ -937,21 +938,17 @@
937938
938939 /* Initialize CEU platform devices separately to map memory first */
939940 device_initialize(&ms7724se_ceu_devices[0]->dev);
940
- arch_setup_pdev_archdata(ms7724se_ceu_devices[0]);
941941 dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev,
942942 ceu0_dma_membase, ceu0_dma_membase,
943943 ceu0_dma_membase +
944
- CEU_BUFFER_MEMORY_SIZE - 1,
945
- DMA_MEMORY_EXCLUSIVE);
944
+ CEU_BUFFER_MEMORY_SIZE - 1);
946945 platform_device_add(ms7724se_ceu_devices[0]);
947946
948947 device_initialize(&ms7724se_ceu_devices[1]->dev);
949
- arch_setup_pdev_archdata(ms7724se_ceu_devices[1]);
950948 dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev,
951949 ceu1_dma_membase, ceu1_dma_membase,
952950 ceu1_dma_membase +
953
- CEU_BUFFER_MEMORY_SIZE - 1,
954
- DMA_MEMORY_EXCLUSIVE);
951
+ CEU_BUFFER_MEMORY_SIZE - 1);
955952 platform_device_add(ms7724se_ceu_devices[1]);
956953
957954 return platform_add_devices(ms7724se_devices,
....@@ -965,12 +962,18 @@
965962 phys_addr_t phys;
966963 phys_addr_t size = CEU_BUFFER_MEMORY_SIZE;
967964
968
- phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
965
+ phys = memblock_phys_alloc(size, PAGE_SIZE);
966
+ if (!phys)
967
+ panic("Failed to allocate CEU0 memory\n");
968
+
969969 memblock_free(phys, size);
970970 memblock_remove(phys, size);
971971 ceu0_dma_membase = phys;
972972
973
- phys = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_ALLOC_ANYWHERE);
973
+ phys = memblock_phys_alloc(size, PAGE_SIZE);
974
+ if (!phys)
975
+ panic("Failed to allocate CEU1 memory\n");
976
+
974977 memblock_free(phys, size);
975978 memblock_remove(phys, size);
976979 ceu1_dma_membase = phys;