Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163186
b: refs/heads/master
c: 25acf55
h: refs/heads/master
v: v3
  • Loading branch information
Chaithrika U S authored and Kevin Hilman committed Aug 26, 2009
1 parent 0e6d303 commit 1bd7a7c
Show file tree
Hide file tree
Showing 11 changed files with 239 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a36071e7954836ba437987e5ca4ced174462b28
refs/heads/master: 25acf553aeed86f93f2cf39227b59fc6eb3e8c78
7 changes: 7 additions & 0 deletions trunk/arch/arm/mach-davinci/board-dm355-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ static struct davinci_i2c_platform_data i2c_pdata = {
.bus_delay = 0 /* usec */,
};

static struct snd_platform_data dm355_evm_snd_data = {
.clk_name = "asp1",
};

static int dm355evm_mmc_gpios = -EINVAL;

static void dm355evm_mmcsd_gpios(unsigned gpio)
Expand Down Expand Up @@ -279,6 +283,9 @@ static __init void dm355_evm_init(void)

dm355_init_spi0(BIT(0), dm355_evm_spi_info,
ARRAY_SIZE(dm355_evm_spi_info));

/* DM335 EVM uses ASP1; line-out is a stereo mini-jack */
dm355_init_asp1(ASP1_TX_EVT_EN | ASP1_RX_EVT_EN, &dm355_evm_snd_data);
}

static __init void dm355_evm_irq_init(void)
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/mach-davinci/board-dm644x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ static struct platform_device ide_dev = {
},
};

static struct snd_platform_data dm644x_evm_snd_data = {
.clk_name = "asp0",
};

/*----------------------------------------------------------------------*/

/*
Expand Down Expand Up @@ -666,6 +670,7 @@ static __init void davinci_evm_init(void)
davinci_setup_mmc(0, &dm6446evm_mmc_config);

davinci_serial_init(&uart_config);
dm644x_init_asp(&dm644x_evm_snd_data);

soc_info->emac_pdata->phy_mask = DM644X_EVM_PHY_MASK;
soc_info->emac_pdata->mdio_max_freq = DM644X_EVM_MDIO_FREQUENCY;
Expand Down
33 changes: 33 additions & 0 deletions trunk/arch/arm/mach-davinci/board-dm646x-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,37 @@ static struct at24_platform_data eeprom_info = {
.context = (void *)0x7f00,
};

static u8 dm646x_iis_serializer_direction[] = {
TX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE,
};

static u8 dm646x_dit_serializer_direction[] = {
TX_MODE,
};

static struct snd_platform_data dm646x_evm_snd_data[] = {
{
.clk_name = "mcasp0",
.tx_dma_offset = 0x400,
.rx_dma_offset = 0x400,
.op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(dm646x_iis_serializer_direction),
.tdm_slots = 2,
.serial_dir = dm646x_iis_serializer_direction,
.eventq_no = EVENTQ_0,
},
{
.clk_name = "mcasp1",
.tx_dma_offset = 0x400,
.rx_dma_offset = 0,
.op_mode = DAVINCI_MCASP_DIT_MODE,
.num_serializer = ARRAY_SIZE(dm646x_dit_serializer_direction),
.tdm_slots = 32,
.serial_dir = dm646x_dit_serializer_direction,
.eventq_no = EVENTQ_0,
},
};

static struct i2c_board_info __initdata i2c_info[] = {
{
I2C_BOARD_INFO("24c256", 0x50),
Expand Down Expand Up @@ -239,6 +270,8 @@ static __init void evm_init(void)

evm_init_i2c();
davinci_serial_init(&uart_config);
dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);

soc_info->emac_pdata->phy_mask = DM646X_EVM_PHY_MASK;
soc_info->emac_pdata->mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY;
Expand Down
43 changes: 41 additions & 2 deletions trunk/arch/arm/mach-davinci/dm355.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <mach/time.h>
#include <mach/serial.h>
#include <mach/common.h>
#include <mach/asp.h>

#include "clock.h"
#include "mux.h"
Expand Down Expand Up @@ -360,8 +361,8 @@ static struct davinci_clk dm355_clks[] = {
CLK(NULL, "uart1", &uart1_clk),
CLK(NULL, "uart2", &uart2_clk),
CLK("i2c_davinci.1", NULL, &i2c_clk),
CLK("soc-audio.0", NULL, &asp0_clk),
CLK("soc-audio.1", NULL, &asp1_clk),
CLK(NULL, "asp0", &asp0_clk),
CLK(NULL, "asp1", &asp1_clk),
CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
CLK(NULL, "spi0", &spi0_clk),
Expand Down Expand Up @@ -627,6 +628,31 @@ static struct platform_device dm355_edma_device = {
.resource = edma_resources,
};

static struct resource dm355_asp1_resources[] = {
{
.start = DAVINCI_ASP1_BASE,
.end = DAVINCI_ASP1_BASE + SZ_8K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = DAVINCI_DMA_ASP1_TX,
.end = DAVINCI_DMA_ASP1_TX,
.flags = IORESOURCE_DMA,
},
{
.start = DAVINCI_DMA_ASP1_RX,
.end = DAVINCI_DMA_ASP1_RX,
.flags = IORESOURCE_DMA,
},
};

static struct platform_device dm355_asp1_device = {
.name = "davinci-asp",
.id = -1,
.num_resources = ARRAY_SIZE(dm355_asp1_resources),
.resource = dm355_asp1_resources,
};

/*----------------------------------------------------------------------*/

static struct map_desc dm355_io_desc[] = {
Expand Down Expand Up @@ -735,6 +761,19 @@ static struct davinci_soc_info davinci_soc_info_dm355 = {
.sram_len = SZ_32K,
};

void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
{
/* we don't use ASP1 IRQs, or we'd need to mux them ... */
if (evt_enable & ASP1_TX_EVT_EN)
davinci_cfg_reg(DM355_EVT8_ASP1_TX);

if (evt_enable & ASP1_RX_EVT_EN)
davinci_cfg_reg(DM355_EVT9_ASP1_RX);

dm355_asp1_device.dev.platform_data = pdata;
platform_device_register(&dm355_asp1_device);
}

void __init dm355_init(void)
{
davinci_common_init(&davinci_soc_info_dm355);
Expand Down
36 changes: 35 additions & 1 deletion trunk/arch/arm/mach-davinci/dm644x.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mach/time.h>
#include <mach/serial.h>
#include <mach/common.h>
#include <mach/asp.h>

#include "clock.h"
#include "mux.h"
Expand Down Expand Up @@ -303,7 +304,7 @@ struct davinci_clk dm644x_clks[] = {
CLK("davinci_emac.1", NULL, &emac_clk),
CLK("i2c_davinci.1", NULL, &i2c_clk),
CLK("palm_bk3710", NULL, &ide_clk),
CLK("soc-audio.0", NULL, &asp_clk),
CLK(NULL, "asp0", &asp_clk),
CLK("davinci_mmc.0", NULL, &mmcsd_clk),
CLK(NULL, "spi", &spi_clk),
CLK(NULL, "gpio", &gpio_clk),
Expand Down Expand Up @@ -553,6 +554,32 @@ static struct platform_device dm644x_edma_device = {
.resource = edma_resources,
};

/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */
static struct resource dm644x_asp_resources[] = {
{
.start = DAVINCI_ASP0_BASE,
.end = DAVINCI_ASP0_BASE + SZ_8K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = DAVINCI_DMA_ASP0_TX,
.end = DAVINCI_DMA_ASP0_TX,
.flags = IORESOURCE_DMA,
},
{
.start = DAVINCI_DMA_ASP0_RX,
.end = DAVINCI_DMA_ASP0_RX,
.flags = IORESOURCE_DMA,
},
};

static struct platform_device dm644x_asp_device = {
.name = "davinci-asp",
.id = -1,
.num_resources = ARRAY_SIZE(dm644x_asp_resources),
.resource = dm644x_asp_resources,
};

/*----------------------------------------------------------------------*/

static struct map_desc dm644x_io_desc[] = {
Expand Down Expand Up @@ -669,6 +696,13 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
.sram_len = SZ_16K,
};

void __init dm644x_init_asp(struct snd_platform_data *pdata)
{
davinci_cfg_reg(DM644X_MCBSP);
dm644x_asp_device.dev.platform_data = pdata;
platform_device_register(&dm644x_asp_device);
}

void __init dm644x_init(void)
{
davinci_common_init(&davinci_soc_info_dm644x);
Expand Down
74 changes: 74 additions & 0 deletions trunk/arch/arm/mach-davinci/dm646x.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <mach/time.h>
#include <mach/serial.h>
#include <mach/common.h>
#include <mach/asp.h>

#include "clock.h"
#include "mux.h"
Expand Down Expand Up @@ -591,6 +592,66 @@ static struct platform_device dm646x_edma_device = {
.resource = edma_resources,
};

static struct resource dm646x_mcasp0_resources[] = {
{
.name = "mcasp0",
.start = DAVINCI_DM646X_MCASP0_REG_BASE,
.end = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1,
.flags = IORESOURCE_MEM,
},
/* first TX, then RX */
{
.start = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
.end = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
.flags = IORESOURCE_DMA,
},
{
.start = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
.end = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
.flags = IORESOURCE_DMA,
},
};

static struct resource dm646x_mcasp1_resources[] = {
{
.name = "mcasp1",
.start = DAVINCI_DM646X_MCASP1_REG_BASE,
.end = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1,
.flags = IORESOURCE_MEM,
},
/* DIT mode, only TX event */
{
.start = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
.end = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
.flags = IORESOURCE_DMA,
},
/* DIT mode, dummy entry */
{
.start = -1,
.end = -1,
.flags = IORESOURCE_DMA,
},
};

static struct platform_device dm646x_mcasp0_device = {
.name = "davinci-mcasp",
.id = 0,
.num_resources = ARRAY_SIZE(dm646x_mcasp0_resources),
.resource = dm646x_mcasp0_resources,
};

static struct platform_device dm646x_mcasp1_device = {
.name = "davinci-mcasp",
.id = 1,
.num_resources = ARRAY_SIZE(dm646x_mcasp1_resources),
.resource = dm646x_mcasp1_resources,
};

static struct platform_device dm646x_dit_device = {
.name = "spdif-dit",
.id = -1,
};

/*----------------------------------------------------------------------*/

static struct map_desc dm646x_io_desc[] = {
Expand Down Expand Up @@ -700,6 +761,19 @@ static struct davinci_soc_info davinci_soc_info_dm646x = {
.sram_len = SZ_32K,
};

void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
{
dm646x_mcasp0_device.dev.platform_data = pdata;
platform_device_register(&dm646x_mcasp0_device);
}

void __init dm646x_init_mcasp1(struct snd_platform_data *pdata)
{
dm646x_mcasp1_device.dev.platform_data = pdata;
platform_device_register(&dm646x_mcasp1_device);
platform_device_register(&dm646x_dit_device);
}

void __init dm646x_init(void)
{
davinci_common_init(&davinci_soc_info_dm646x);
Expand Down
35 changes: 33 additions & 2 deletions trunk/arch/arm/mach-davinci/include/mach/asp.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,52 @@
#define __ASM_ARCH_DAVINCI_ASP_H

#include <mach/irqs.h>
#include <mach/edma.h>

/* Bases of register banks */
/* Bases of dm644x and dm355 register banks */
#define DAVINCI_ASP0_BASE 0x01E02000
#define DAVINCI_ASP1_BASE 0x01E04000

/* EDMA channels */
/* Bases of dm646x register banks */
#define DAVINCI_DM646X_MCASP0_REG_BASE 0x01D01000
#define DAVINCI_DM646X_MCASP1_REG_BASE 0x01D01800

/* EDMA channels of dm644x and dm355 */
#define DAVINCI_DMA_ASP0_TX 2
#define DAVINCI_DMA_ASP0_RX 3
#define DAVINCI_DMA_ASP1_TX 8
#define DAVINCI_DMA_ASP1_RX 9

/* EDMA channels of dm646x */
#define DAVINCI_DM646X_DMA_MCASP0_AXEVT0 6
#define DAVINCI_DM646X_DMA_MCASP0_AREVT0 9
#define DAVINCI_DM646X_DMA_MCASP1_AXEVT1 12

/* Interrupts */
#define DAVINCI_ASP0_RX_INT IRQ_MBRINT
#define DAVINCI_ASP0_TX_INT IRQ_MBXINT
#define DAVINCI_ASP1_RX_INT IRQ_MBRINT
#define DAVINCI_ASP1_TX_INT IRQ_MBXINT

struct snd_platform_data {
char *clk_name;
u32 tx_dma_offset;
u32 rx_dma_offset;
enum dma_event_q eventq_no; /* event queue number */
unsigned int codec_fmt;

/* McASP specific fields */
int tdm_slots;
u8 op_mode;
u8 num_serializer;
u8 *serial_dir;
};

#define INACTIVE_MODE 0
#define TX_MODE 1
#define RX_MODE 2

#define DAVINCI_MCASP_IIS_MODE 0
#define DAVINCI_MCASP_DIT_MODE 1

#endif /* __ASM_ARCH_DAVINCI_ASP_H */
5 changes: 5 additions & 0 deletions trunk/arch/arm/mach-davinci/include/mach/dm355.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
#define __ASM_ARCH_DM355_H

#include <mach/hardware.h>
#include <mach/asp.h>

#define ASP1_TX_EVT_EN 1
#define ASP1_RX_EVT_EN 2

struct spi_board_info;

void __init dm355_init(void);
void dm355_init_spi0(unsigned chipselect_mask,
struct spi_board_info *info, unsigned len);
void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);

#endif /* __ASM_ARCH_DM355_H */
Loading

0 comments on commit 1bd7a7c

Please sign in to comment.