| .. | .. |
|---|
| 32 | 32 | #include <linux/smc91x.h> |
|---|
| 33 | 33 | #include <linux/usb/r8a66597.h> |
|---|
| 34 | 34 | #include <linux/videodev2.h> |
|---|
| 35 | +#include <linux/dma-map-ops.h> |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | #include <mach-se/mach/se7724.h> |
|---|
| 37 | 38 | #include <media/drv-intf/renesas-ceu.h> |
|---|
| .. | .. |
|---|
| 937 | 938 | |
|---|
| 938 | 939 | /* Initialize CEU platform devices separately to map memory first */ |
|---|
| 939 | 940 | device_initialize(&ms7724se_ceu_devices[0]->dev); |
|---|
| 940 | | - arch_setup_pdev_archdata(ms7724se_ceu_devices[0]); |
|---|
| 941 | 941 | dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev, |
|---|
| 942 | 942 | ceu0_dma_membase, ceu0_dma_membase, |
|---|
| 943 | 943 | ceu0_dma_membase + |
|---|
| 944 | | - CEU_BUFFER_MEMORY_SIZE - 1, |
|---|
| 945 | | - DMA_MEMORY_EXCLUSIVE); |
|---|
| 944 | + CEU_BUFFER_MEMORY_SIZE - 1); |
|---|
| 946 | 945 | platform_device_add(ms7724se_ceu_devices[0]); |
|---|
| 947 | 946 | |
|---|
| 948 | 947 | device_initialize(&ms7724se_ceu_devices[1]->dev); |
|---|
| 949 | | - arch_setup_pdev_archdata(ms7724se_ceu_devices[1]); |
|---|
| 950 | 948 | dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev, |
|---|
| 951 | 949 | ceu1_dma_membase, ceu1_dma_membase, |
|---|
| 952 | 950 | ceu1_dma_membase + |
|---|
| 953 | | - CEU_BUFFER_MEMORY_SIZE - 1, |
|---|
| 954 | | - DMA_MEMORY_EXCLUSIVE); |
|---|
| 951 | + CEU_BUFFER_MEMORY_SIZE - 1); |
|---|
| 955 | 952 | platform_device_add(ms7724se_ceu_devices[1]); |
|---|
| 956 | 953 | |
|---|
| 957 | 954 | return platform_add_devices(ms7724se_devices, |
|---|
| .. | .. |
|---|
| 965 | 962 | phys_addr_t phys; |
|---|
| 966 | 963 | phys_addr_t size = CEU_BUFFER_MEMORY_SIZE; |
|---|
| 967 | 964 | |
|---|
| 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 | + |
|---|
| 969 | 969 | memblock_free(phys, size); |
|---|
| 970 | 970 | memblock_remove(phys, size); |
|---|
| 971 | 971 | ceu0_dma_membase = phys; |
|---|
| 972 | 972 | |
|---|
| 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 | + |
|---|
| 974 | 977 | memblock_free(phys, size); |
|---|
| 975 | 978 | memblock_remove(phys, size); |
|---|
| 976 | 979 | ceu1_dma_membase = phys; |
|---|