-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'topic/sh' into for-linus
Conflicts: drivers/dma/sh/Kconfig drivers/dma/sh/shdmac.c Signed-off-by: Vinod Koul <vinod.koul@intel.com>
- Loading branch information
Showing
12 changed files
with
301 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o shdma-of.o | ||
obj-$(CONFIG_SH_DMAE) += shdma.o | ||
shdma-y := shdmac.o | ||
ifeq ($(CONFIG_OF),y) | ||
shdma-$(CONFIG_SHDMA_R8A73A4) += shdma-r8a73a4.o | ||
endif | ||
shdma-objs := $(shdma-y) | ||
obj-$(CONFIG_SUDMAC) += sudmac.o | ||
obj-$(CONFIG_RCAR_HPB_DMAE) += rcar-hpbdma.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Renesas SuperH DMA Engine support | ||
* | ||
* Copyright (C) 2013 Renesas Electronics, Inc. | ||
* | ||
* This is free software; you can redistribute it and/or modify it under the | ||
* terms of version 2 the GNU General Public License as published by the Free | ||
* Software Foundation. | ||
*/ | ||
|
||
#ifndef SHDMA_ARM_H | ||
#define SHDMA_ARM_H | ||
|
||
#include "shdma.h" | ||
|
||
/* Transmit sizes and respective CHCR register values */ | ||
enum { | ||
XMIT_SZ_8BIT = 0, | ||
XMIT_SZ_16BIT = 1, | ||
XMIT_SZ_32BIT = 2, | ||
XMIT_SZ_64BIT = 7, | ||
XMIT_SZ_128BIT = 3, | ||
XMIT_SZ_256BIT = 4, | ||
XMIT_SZ_512BIT = 5, | ||
}; | ||
|
||
/* log2(size / 8) - used to calculate number of transfers */ | ||
#define SH_DMAE_TS_SHIFT { \ | ||
[XMIT_SZ_8BIT] = 0, \ | ||
[XMIT_SZ_16BIT] = 1, \ | ||
[XMIT_SZ_32BIT] = 2, \ | ||
[XMIT_SZ_64BIT] = 3, \ | ||
[XMIT_SZ_128BIT] = 4, \ | ||
[XMIT_SZ_256BIT] = 5, \ | ||
[XMIT_SZ_512BIT] = 6, \ | ||
} | ||
|
||
#define TS_LOW_BIT 0x3 /* --xx */ | ||
#define TS_HI_BIT 0xc /* xx-- */ | ||
|
||
#define TS_LOW_SHIFT (3) | ||
#define TS_HI_SHIFT (20 - 2) /* 2 bits for shifted low TS */ | ||
|
||
#define TS_INDEX2VAL(i) \ | ||
((((i) & TS_LOW_BIT) << TS_LOW_SHIFT) |\ | ||
(((i) & TS_HI_BIT) << TS_HI_SHIFT)) | ||
|
||
#define CHCR_TX(xmit_sz) (DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
#define CHCR_RX(xmit_sz) (DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL((xmit_sz))) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Renesas SuperH DMA Engine support for r8a73a4 (APE6) SoCs | ||
* | ||
* Copyright (C) 2013 Renesas Electronics, Inc. | ||
* | ||
* This is free software; you can redistribute it and/or modify it under the | ||
* terms of version 2 the GNU General Public License as published by the Free | ||
* Software Foundation. | ||
*/ | ||
#include <linux/sh_dma.h> | ||
|
||
#include "shdma-arm.h" | ||
|
||
const unsigned int dma_ts_shift[] = SH_DMAE_TS_SHIFT; | ||
|
||
static const struct sh_dmae_slave_config dma_slaves[] = { | ||
{ | ||
.chcr = CHCR_TX(XMIT_SZ_32BIT), | ||
.mid_rid = 0xd1, /* MMC0 Tx */ | ||
}, { | ||
.chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
.mid_rid = 0xd2, /* MMC0 Rx */ | ||
}, { | ||
.chcr = CHCR_TX(XMIT_SZ_32BIT), | ||
.mid_rid = 0xe1, /* MMC1 Tx */ | ||
}, { | ||
.chcr = CHCR_RX(XMIT_SZ_32BIT), | ||
.mid_rid = 0xe2, /* MMC1 Rx */ | ||
}, | ||
}; | ||
|
||
#define DMAE_CHANNEL(a, b) \ | ||
{ \ | ||
.offset = (a) - 0x20, \ | ||
.dmars = (a) - 0x20 + 0x40, \ | ||
.chclr_bit = (b), \ | ||
.chclr_offset = 0x80 - 0x20, \ | ||
} | ||
|
||
static const struct sh_dmae_channel dma_channels[] = { | ||
DMAE_CHANNEL(0x8000, 0), | ||
DMAE_CHANNEL(0x8080, 1), | ||
DMAE_CHANNEL(0x8100, 2), | ||
DMAE_CHANNEL(0x8180, 3), | ||
DMAE_CHANNEL(0x8200, 4), | ||
DMAE_CHANNEL(0x8280, 5), | ||
DMAE_CHANNEL(0x8300, 6), | ||
DMAE_CHANNEL(0x8380, 7), | ||
DMAE_CHANNEL(0x8400, 8), | ||
DMAE_CHANNEL(0x8480, 9), | ||
DMAE_CHANNEL(0x8500, 10), | ||
DMAE_CHANNEL(0x8580, 11), | ||
DMAE_CHANNEL(0x8600, 12), | ||
DMAE_CHANNEL(0x8680, 13), | ||
DMAE_CHANNEL(0x8700, 14), | ||
DMAE_CHANNEL(0x8780, 15), | ||
DMAE_CHANNEL(0x8800, 16), | ||
DMAE_CHANNEL(0x8880, 17), | ||
DMAE_CHANNEL(0x8900, 18), | ||
DMAE_CHANNEL(0x8980, 19), | ||
}; | ||
|
||
const struct sh_dmae_pdata r8a73a4_dma_pdata = { | ||
.slave = dma_slaves, | ||
.slave_num = ARRAY_SIZE(dma_slaves), | ||
.channel = dma_channels, | ||
.channel_num = ARRAY_SIZE(dma_channels), | ||
.ts_low_shift = TS_LOW_SHIFT, | ||
.ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT, | ||
.ts_high_shift = TS_HI_SHIFT, | ||
.ts_high_mask = TS_HI_BIT << TS_HI_SHIFT, | ||
.ts_shift = dma_ts_shift, | ||
.ts_shift_num = ARRAY_SIZE(dma_ts_shift), | ||
.dmaor_init = DMAOR_DME, | ||
.chclr_present = 1, | ||
.chclr_bitwise = 1, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.