]> git.sur5r.net Git - u-boot/blobdiff - drivers/dma/fsl_dma.c
spi: mxc_spi: Fix chipselect on DM_SPI driver uclass
[u-boot] / drivers / dma / fsl_dma.c
index df33e7a3eec7a41a19f8186c5083d643e136ef40..b7eddf0f04c5d377fe47d2d42b92fe396be76144 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2004,2007,2008 Freescale Semiconductor, Inc.
  * (C) Copyright 2002, 2003 Motorola Inc.
@@ -5,24 +6,6 @@
  *
  * (C) Copyright 2000
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
 #include <config.h>
@@ -112,10 +95,16 @@ int dmacpy(phys_addr_t dest, phys_addr_t src, phys_size_t count) {
        uint xfer_size;
 
        while (count) {
-               xfer_size = MIN(FSL_DMA_MAX_SIZE, count);
+               xfer_size = min(FSL_DMA_MAX_SIZE, count);
 
-               out_dma32(&dma->dar, (uint) dest);
-               out_dma32(&dma->sar, (uint) src);
+               out_dma32(&dma->dar, (u32) (dest & 0xFFFFFFFF));
+               out_dma32(&dma->sar, (u32) (src & 0xFFFFFFFF));
+#if !defined(CONFIG_MPC83xx)
+               out_dma32(&dma->satr,
+                       in_dma32(&dma->satr) | (u32)((u64)src >> 32));
+               out_dma32(&dma->datr,
+                       in_dma32(&dma->datr) | (u32)((u64)dest >> 32));
+#endif
                out_dma32(&dma->bcr, xfer_size);
                dma_sync();