Commit 0fed2b5c authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (25 commits)
  sh: fix up sh7785lcr_32bit_defconfig.
  arch/sh/lib/strlen.S: Checkpatch cleanup
  sh: fix up sh7786 dmaengine build.
  sh: guard cookie consistency across termination in the DMA driver
  sh: prevent the DMA driver from unloading, while in use
  sh: fix Oops in the serial SCI driver
  sh: allow platforms to specify SD-card supported voltages
  mmc: let MFD's provide supported Vdd card voltages to tmio_mmc
  sh: disable SD-card write-protection detection on kfr2r09
  mfd: pass platform flags down to the tmio_mmc driver
  tmio: add a platform flag to disable card write-protection detection
  sh: Add SDHI DMA support to migor
  sh: Add SDHI DMA support to kfr2r09
  sh: Add SDHI DMA support to ms7724se
  sh: Add SDHI DMA support to ecovec
  mmc: add DMA support to tmio_mmc driver, when used on SuperH
  sh: prepare the SDHI MFD driver to pass DMA configuration to tmio_mmc.c
  mmc: prepare tmio_mmc for passing of DMA configuration from the MFD cell
  sh: add DMA slave definitions to sh7724
  sh: add DMA slaves for two SDHI controllers to sh7722
  ...
parents 0163916f 41ec7ebe
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mfd/sh_mobile_sdhi.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -442,7 +443,9 @@ static void sdhi0_set_pwr(struct platform_device *pdev, int state) ...@@ -442,7 +443,9 @@ static void sdhi0_set_pwr(struct platform_device *pdev, int state)
} }
static struct sh_mobile_sdhi_info sdhi0_info = { static struct sh_mobile_sdhi_info sdhi0_info = {
.set_pwr = sdhi0_set_pwr, .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
.set_pwr = sdhi0_set_pwr,
}; };
static struct resource sdhi0_resources[] = { static struct resource sdhi0_resources[] = {
...@@ -478,7 +481,9 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state) ...@@ -478,7 +481,9 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state)
} }
static struct sh_mobile_sdhi_info sdhi1_info = { static struct sh_mobile_sdhi_info sdhi1_info = {
.set_pwr = sdhi1_set_pwr, .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
.set_pwr = sdhi1_set_pwr,
}; };
static struct resource sdhi1_resources[] = { static struct resource sdhi1_resources[] = {
...@@ -769,6 +774,51 @@ static struct platform_device irda_device = { ...@@ -769,6 +774,51 @@ static struct platform_device irda_device = {
.resource = irda_resources, .resource = irda_resources,
}; };
#include <media/ak881x.h>
#include <media/sh_vou.h>
struct ak881x_pdata ak881x_pdata = {
.flags = AK881X_IF_MODE_SLAVE,
};
static struct i2c_board_info ak8813 = {
I2C_BOARD_INFO("ak8813", 0x20),
.platform_data = &ak881x_pdata,
};
struct sh_vou_pdata sh_vou_pdata = {
.bus_fmt = SH_VOU_BUS_8BIT,
.flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
.board_info = &ak8813,
.i2c_adap = 0,
.module_name = "ak881x",
};
static struct resource sh_vou_resources[] = {
[0] = {
.start = 0xfe960000,
.end = 0xfe962043,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 55,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device vou_device = {
.name = "sh-vou",
.id = -1,
.num_resources = ARRAY_SIZE(sh_vou_resources),
.resource = sh_vou_resources,
.dev = {
.platform_data = &sh_vou_pdata,
},
.archdata = {
.hwblk_id = HWBLK_VOU,
},
};
static struct platform_device *ecovec_devices[] __initdata = { static struct platform_device *ecovec_devices[] __initdata = {
&heartbeat_device, &heartbeat_device,
&nor_flash_device, &nor_flash_device,
...@@ -790,6 +840,7 @@ static struct platform_device *ecovec_devices[] __initdata = { ...@@ -790,6 +840,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
&camera_devices[2], &camera_devices[2],
&fsi_device, &fsi_device,
&irda_device, &irda_device,
&vou_device,
}; };
#ifdef CONFIG_I2C #ifdef CONFIG_I2C
...@@ -1179,6 +1230,38 @@ static int __init arch_setup(void) ...@@ -1179,6 +1230,38 @@ static int __init arch_setup(void)
i2c_register_board_info(1, i2c1_devices, i2c_register_board_info(1, i2c1_devices,
ARRAY_SIZE(i2c1_devices)); ARRAY_SIZE(i2c1_devices));
/* VOU */
gpio_request(GPIO_FN_DV_D15, NULL);
gpio_request(GPIO_FN_DV_D14, NULL);
gpio_request(GPIO_FN_DV_D13, NULL);
gpio_request(GPIO_FN_DV_D12, NULL);
gpio_request(GPIO_FN_DV_D11, NULL);
gpio_request(GPIO_FN_DV_D10, NULL);
gpio_request(GPIO_FN_DV_D9, NULL);
gpio_request(GPIO_FN_DV_D8, NULL);
gpio_request(GPIO_FN_DV_CLKI, NULL);
gpio_request(GPIO_FN_DV_CLK, NULL);
gpio_request(GPIO_FN_DV_VSYNC, NULL);
gpio_request(GPIO_FN_DV_HSYNC, NULL);
/* AK8813 power / reset sequence */
gpio_request(GPIO_PTG4, NULL);
gpio_request(GPIO_PTU3, NULL);
/* Reset */
gpio_direction_output(GPIO_PTG4, 0);
/* Power down */
gpio_direction_output(GPIO_PTU3, 1);
udelay(10);
/* Power up, reset */
gpio_set_value(GPIO_PTU3, 0);
udelay(10);
/* Remove reset */
gpio_set_value(GPIO_PTG4, 1);
return platform_add_devices(ecovec_devices, return platform_add_devices(ecovec_devices,
ARRAY_SIZE(ecovec_devices)); ARRAY_SIZE(ecovec_devices));
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/mfd/sh_mobile_sdhi.h>
#include <linux/mfd/tmio.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mtd/onenand.h> #include <linux/mtd/onenand.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -356,10 +358,19 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = { ...@@ -356,10 +358,19 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = {
}, },
}; };
static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
.tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
};
static struct platform_device kfr2r09_sh_sdhi0_device = { static struct platform_device kfr2r09_sh_sdhi0_device = {
.name = "sh_mobile_sdhi", .name = "sh_mobile_sdhi",
.num_resources = ARRAY_SIZE(kfr2r09_sh_sdhi0_resources), .num_resources = ARRAY_SIZE(kfr2r09_sh_sdhi0_resources),
.resource = kfr2r09_sh_sdhi0_resources, .resource = kfr2r09_sh_sdhi0_resources,
.dev = {
.platform_data = &sh7724_sdhi0_data,
},
.archdata = { .archdata = {
.hwblk_id = HWBLK_SDHI0, .hwblk_id = HWBLK_SDHI0,
}, },
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/mfd/sh_mobile_sdhi.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/i2c.h> #include <linux/i2c.h>
...@@ -402,10 +403,18 @@ static struct resource sdhi_cn9_resources[] = { ...@@ -402,10 +403,18 @@ static struct resource sdhi_cn9_resources[] = {
}, },
}; };
static struct sh_mobile_sdhi_info sh7724_sdhi_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
};
static struct platform_device sdhi_cn9_device = { static struct platform_device sdhi_cn9_device = {
.name = "sh_mobile_sdhi", .name = "sh_mobile_sdhi",
.num_resources = ARRAY_SIZE(sdhi_cn9_resources), .num_resources = ARRAY_SIZE(sdhi_cn9_resources),
.resource = sdhi_cn9_resources, .resource = sdhi_cn9_resources,
.dev = {
.platform_data = &sh7724_sdhi_data,
},
.archdata = { .archdata = {
.hwblk_id = HWBLK_SDHI, .hwblk_id = HWBLK_SDHI,
}, },
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mfd/sh_mobile_sdhi.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/smc91x.h> #include <linux/smc91x.h>
...@@ -462,11 +463,19 @@ static struct resource sdhi0_cn7_resources[] = { ...@@ -462,11 +463,19 @@ static struct resource sdhi0_cn7_resources[] = {
}, },
}; };
static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
};
static struct platform_device sdhi0_cn7_device = { static struct platform_device sdhi0_cn7_device = {
.name = "sh_mobile_sdhi", .name = "sh_mobile_sdhi",
.id = 0, .id = 0,
.num_resources = ARRAY_SIZE(sdhi0_cn7_resources), .num_resources = ARRAY_SIZE(sdhi0_cn7_resources),
.resource = sdhi0_cn7_resources, .resource = sdhi0_cn7_resources,
.dev = {
.platform_data = &sh7724_sdhi0_data,
},
.archdata = { .archdata = {
.hwblk_id = HWBLK_SDHI0, .hwblk_id = HWBLK_SDHI0,
}, },
...@@ -485,11 +494,19 @@ static struct resource sdhi1_cn8_resources[] = { ...@@ -485,11 +494,19 @@ static struct resource sdhi1_cn8_resources[] = {
}, },
}; };
static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {
.dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
};
static struct platform_device sdhi1_cn8_device = { static struct platform_device sdhi1_cn8_device = {
.name = "sh_mobile_sdhi", .name = "sh_mobile_sdhi",
.id = 1, .id = 1,
.num_resources = ARRAY_SIZE(sdhi1_cn8_resources), .num_resources = ARRAY_SIZE(sdhi1_cn8_resources),
.resource = sdhi1_cn8_resources, .resource = sdhi1_cn8_resources,
.dev = {
.platform_data = &sh7724_sdhi1_data,
},
.archdata = { .archdata = {
.hwblk_id = HWBLK_SDHI1, .hwblk_id = HWBLK_SDHI1,
}, },
...@@ -515,6 +532,52 @@ static struct platform_device irda_device = { ...@@ -515,6 +532,52 @@ static struct platform_device irda_device = {
.resource = irda_resources, .resource = irda_resources,
}; };
#include <media/ak881x.h>
#include <media/sh_vou.h>
struct ak881x_pdata ak881x_pdata = {
.flags = AK881X_IF_MODE_SLAVE,
};
static struct i2c_board_info ak8813 = {
/* With open J18 jumper address is 0x21 */
I2C_BOARD_INFO("ak8813", 0x20),
.platform_data = &ak881x_pdata,
};
struct sh_vou_pdata sh_vou_pdata = {
.bus_fmt = SH_VOU_BUS_8BIT,
.flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
.board_info = &ak8813,
.i2c_adap = 0,
.module_name = "ak881x",
};
static struct resource sh_vou_resources[] = {
[0] = {
.start = 0xfe960000,
.end = 0xfe962043,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = 55,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device vou_device = {
.name = "sh-vou",
.id = -1,
.num_resources = ARRAY_SIZE(sh_vou_resources),
.resource = sh_vou_resources,
.dev = {
.platform_data = &sh_vou_pdata,
},
.archdata = {
.hwblk_id = HWBLK_VOU,
},
};
static struct platform_device *ms7724se_devices[] __initdata = { static struct platform_device *ms7724se_devices[] __initdata = {
&heartbeat_device, &heartbeat_device,
&smc91x_eth_device, &smc91x_eth_device,
...@@ -530,6 +593,7 @@ static struct platform_device *ms7724se_devices[] __initdata = { ...@@ -530,6 +593,7 @@ static struct platform_device *ms7724se_devices[] __initdata = {
&sdhi0_cn7_device, &sdhi0_cn7_device,
&sdhi1_cn8_device, &sdhi1_cn8_device,
&irda_device, &irda_device,
&vou_device,
}; };
/* I2C device */ /* I2C device */
...@@ -614,6 +678,7 @@ static int __init devices_setup(void) ...@@ -614,6 +678,7 @@ static int __init devices_setup(void)
{ {
u16 sw = __raw_readw(SW4140); /* select camera, monitor */ u16 sw = __raw_readw(SW4140); /* select camera, monitor */
struct clk *clk; struct clk *clk;
u16 fpga_out;
/* register board specific self-refresh code */ /* register board specific self-refresh code */
sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
...@@ -623,14 +688,26 @@ static int __init devices_setup(void) ...@@ -623,14 +688,26 @@ static int __init devices_setup(void)
&ms7724se_sdram_leave_start, &ms7724se_sdram_leave_start,
&ms7724se_sdram_leave_end); &ms7724se_sdram_leave_end);
/* Reset Release */ /* Reset Release */
__raw_writew(__raw_readw(FPGA_OUT) & fpga_out = __raw_readw(FPGA_OUT);
~((1 << 1) | /* LAN */ /* bit4: NTSC_PDN, bit5: NTSC_RESET */
(1 << 6) | /* VIDEO DAC */ fpga_out &= ~((1 << 1) | /* LAN */
(1 << 7) | /* AK4643 */ (1 << 4) | /* AK8813 PDN */
(1 << 8) | /* IrDA */ (1 << 5) | /* AK8813 RESET */
(1 << 12) | /* USB0 */ (1 << 6) | /* VIDEO DAC */
(1 << 14)), /* RMII */ (1 << 7) | /* AK4643 */
FPGA_OUT); (1 << 8) | /* IrDA */
(1 << 12) | /* USB0 */
(1 << 14)); /* RMII */
__raw_writew(fpga_out | (1 << 4), FPGA_OUT);
udelay(10);
/* AK8813 RESET */
__raw_writew(fpga_out | (1 << 5), FPGA_OUT);
udelay(10);
__raw_writew(fpga_out, FPGA_OUT);
/* turn on USB clocks, use external clock */ /* turn on USB clocks, use external clock */
__raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);
...@@ -862,6 +939,20 @@ static int __init devices_setup(void) ...@@ -862,6 +939,20 @@ static int __init devices_setup(void)
lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL; lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
} }
/* VOU */
gpio_request(GPIO_FN_DV_D15, NULL);
gpio_request(GPIO_FN_DV_D14, NULL);
gpio_request(GPIO_FN_DV_D13, NULL);
gpio_request(GPIO_FN_DV_D12, NULL);
gpio_request(GPIO_FN_DV_D11, NULL);
gpio_request(GPIO_FN_DV_D10, NULL);
gpio_request(GPIO_FN_DV_D9, NULL);
gpio_request(GPIO_FN_DV_D8, NULL);
gpio_request(GPIO_FN_DV_CLKI, NULL);
gpio_request(GPIO_FN_DV_CLK, NULL);
gpio_request(GPIO_FN_DV_VSYNC, NULL);
gpio_request(GPIO_FN_DV_HSYNC, NULL);
return platform_add_devices(ms7724se_devices, return platform_add_devices(ms7724se_devices,
ARRAY_SIZE(ms7724se_devices)); ARRAY_SIZE(ms7724se_devices));
} }
......
This diff is collapsed.
/*
* Header for the new SH dmaengine driver
*
* Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef ASM_DMAENGINE_H
#define ASM_DMAENGINE_H
#include <linux/sh_dma.h>
enum {
SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX,
SHDMA_SLAVE_SCIF1_RX,
SHDMA_SLAVE_SCIF2_TX,
SHDMA_SLAVE_SCIF2_RX,
SHDMA_SLAVE_SCIF3_TX,
SHDMA_SLAVE_SCIF3_RX,
SHDMA_SLAVE_SCIF4_TX,
SHDMA_SLAVE_SCIF4_RX,
SHDMA_SLAVE_SCIF5_TX,
SHDMA_SLAVE_SCIF5_RX,
SHDMA_SLAVE_SIUA_TX,
SHDMA_SLAVE_SIUA_RX,
SHDMA_SLAVE_SIUB_TX,
SHDMA_SLAVE_SIUB_RX,
};
#endif
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#ifndef ASM_SIU_H #ifndef ASM_SIU_H
#define ASM_SIU_H #define ASM_SIU_H
#include <asm/dmaengine.h>
struct device; struct device;
struct siu_platform { struct siu_platform {
......
...@@ -235,4 +235,19 @@ enum { ...@@ -235,4 +235,19 @@ enum {
HWBLK_NR, HWBLK_NR,
}; };
enum {
SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX,
SHDMA_SLAVE_SCIF1_RX,
SHDMA_SLAVE_SCIF2_TX,
SHDMA_SLAVE_SCIF2_RX,
SHDMA_SLAVE_SIUA_TX,
SHDMA_SLAVE_SIUA_RX,
SHDMA_SLAVE_SIUB_TX,
SHDMA_SLAVE_SIUB_RX,
SHDMA_SLAVE_SDHI0_TX,
SHDMA_SLAVE_SDHI0_RX,
};
#endif /* __ASM_SH7722_H__ */ #endif /* __ASM_SH7722_H__ */
...@@ -283,4 +283,23 @@ enum { ...@@ -283,4 +283,23 @@ enum {
HWBLK_NR, HWBLK_NR,
}; };
enum {
SHDMA_SLAVE_SCIF0_TX,
SHDMA_SLAVE_SCIF0_RX,
SHDMA_SLAVE_SCIF1_TX,
SHDMA_SLAVE_SCIF1_RX,
SHDMA_SLAVE_SCIF2_TX,
SHDMA_SLAVE_SCIF2_RX,
SHDMA_SLAVE_SCIF3_TX,
SHDMA_SLAVE_SCIF3_RX,
SHDMA_SLAVE_SCIF4_TX,
SHDMA_SLAVE_SCIF4_RX,
SHDMA_SLAVE_SCIF5_TX,
SHDMA_SLAVE_SCIF5_RX,
SHDMA_SLAVE_SDHI0_TX,
SHDMA_SLAVE_SDHI0_RX,
SHDMA_SLAVE_SDHI1_TX,
SHDMA_SLAVE_SDHI1_RX,
};
#endif /* __ASM_SH7724_H__ */ #endif /* __ASM_SH7724_H__ */
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/clk.h>
#include <asm/clkdev.h> #include <asm/clkdev.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/freq.h> #include <asm/freq.h>
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/usb/m66592.h> #include <linux/usb/m66592.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/dmaengine.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <asm/siu.h> #include <asm/siu.h>
...@@ -75,6 +74,16 @@ static const struct sh_dmae_slave_config sh7722_dmae_slaves[] = { ...@@ -75,6 +74,16 @@ static const struct sh_dmae_slave_config sh7722_dmae_slaves[] = {
.addr = 0xa454c094, .addr = 0xa454c094,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT), .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
.mid_rid = 0xb6, .mid_rid = 0xb6,
}, {
.slave_id = SHDMA_SLAVE_SDHI0_TX,
.addr = 0x04ce0030,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xc1,
}, {
.slave_id = SHDMA_SLAVE_SDHI0_RX,
.addr = 0x04ce0030,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xc2,
}, },
}; };
......
...@@ -18,19 +18,103 @@ ...@@ -18,19 +18,103 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/dmaengine.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
#include <cpu/sh7724.h> #include <cpu/sh7724.h>
/* DMA */ /* DMA */
static const struct sh_dmae_slave_config sh7724_dmae_slaves[] = {
{
.slave_id = SHDMA_SLAVE_SCIF0_TX,
.addr = 0xffe0000c,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x21,
}, {
.slave_id = SHDMA_SLAVE_SCIF0_RX,
.addr = 0xffe00014,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x22,
}, {
.slave_id = SHDMA_SLAVE_SCIF1_TX,
.addr = 0xffe1000c,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x25,
}, {
.slave_id = SHDMA_SLAVE_SCIF1_RX,
.addr = 0xffe10014,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x26,
}, {
.slave_id = SHDMA_SLAVE_SCIF2_TX,
.addr = 0xffe2000c,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x29,
}, {
.slave_id = SHDMA_SLAVE_SCIF2_RX,
.addr = 0xffe20014,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x2a,
}, {
.slave_id = SHDMA_SLAVE_SCIF3_TX,
.addr = 0xa4e30020,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x2d,
}, {
.slave_id = SHDMA_SLAVE_SCIF3_RX,
.addr = 0xa4e30024,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x2e,
}, {
.slave_id = SHDMA_SLAVE_SCIF4_TX,
.addr = 0xa4e40020,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x31,
}, {
.slave_id = SHDMA_SLAVE_SCIF4_RX,
.addr = 0xa4e40024,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x32,
}, {
.slave_id = SHDMA_SLAVE_SCIF5_TX,
.addr = 0xa4e50020,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x35,
}, {
.slave_id = SHDMA_SLAVE_SCIF5_RX,
.addr = 0xa4e50024,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
.mid_rid = 0x36,
}, {
.slave_id = SHDMA_SLAVE_SDHI0_TX,
.addr = 0x04ce0030,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xc1,
}, {
.slave_id = SHDMA_SLAVE_SDHI0_RX,
.addr = 0x04ce0030,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xc2,
}, {
.slave_id = SHDMA_SLAVE_SDHI1_TX,
.addr = 0x04cf0030,
.chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xc9,
}, {
.slave_id = SHDMA_SLAVE_SDHI1_RX,
.addr = 0x04cf0030,
.chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
.mid_rid = 0xca,
},
};
static const struct sh_dmae_channel sh7724_dmae_channels[] = { static const struct sh_dmae_channel sh7724_dmae_channels[] = {
{ {
.offset = 0, .offset = 0,
...@@ -62,6 +146,8 @@ static const struct sh_dmae_channel sh7724_dmae_channels[] = { ...@@ -62,6 +146,8 @@ static const struct sh_dmae_channel sh7724_dmae_channels[] = {
static const unsigned int ts_shift[] = TS_SHIFT; static const unsigned int ts_shift[] = TS_SHIFT;
static struct sh_dmae_pdata dma_platform_data = { static struct sh_dmae_pdata dma_platform_data = {
.slave = sh7724_dmae_slaves,
.slave_num = ARRAY_SIZE(sh7724_dmae_slaves),
.channel = sh7724_dmae_channels, .channel = sh7724_dmae_channels,
.channel_num = ARRAY_SIZE(sh7724_dmae_channels), .channel_num = ARRAY_SIZE(sh7724_dmae_channels),
.ts_low_shift = CHCR_TS_LOW_SHIFT, .ts_low_shift = CHCR_TS_LOW_SHIFT,
......
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <asm/dmaengine.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
......
...@@ -13,9 +13,9 @@ ...@@ -13,9 +13,9 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <asm/dmaengine.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
......
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <linux/sh_dma.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <cpu/dma-register.h> #include <cpu/dma-register.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <asm/dmaengine.h>
static struct plat_sci_port scif0_platform_data = { static struct plat_sci_port scif0_platform_data = {
.mapbase = 0xffea0000, .mapbase = 0xffea0000,
......
...@@ -845,8 +845,10 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len, ...@@ -845,8 +845,10 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len,
rb_link_node(&cie->node, parent, rb_node); rb_link_node(&cie->node, parent, rb_node);
rb_insert_color(&cie->node, &cie_root); rb_insert_color(&cie->node, &cie_root);
#ifdef CONFIG_MODULES
if (mod != NULL) if (mod != NULL)
list_add_tail(&cie->link, &mod->arch.cie_list); list_add_tail(&cie->link, &mod->arch.cie_list);
#endif
spin_unlock_irqrestore(&dwarf_cie_lock, flags); spin_unlock_irqrestore(&dwarf_cie_lock, flags);
...@@ -935,8 +937,10 @@ static int dwarf_parse_fde(void *entry, u32 entry_type, ...@@ -935,8 +937,10 @@ static int dwarf_parse_fde(void *entry, u32 entry_type,
rb_link_node(&fde->node, parent, rb_node); rb_link_node(&fde->node, parent, rb_node);
rb_insert_color(&fde->node, &fde_root); rb_insert_color(&fde->node, &fde_root);
#ifdef CONFIG_MODULES
if (mod != NULL) if (mod != NULL)
list_add_tail(&fde->link, &mod->arch.fde_list); list_add_tail(&fde->link, &mod->arch.fde_list);
#endif
spin_unlock_irqrestore(&dwarf_fde_lock, flags); spin_unlock_irqrestore(&dwarf_fde_lock, flags);
......
...@@ -35,7 +35,7 @@ ENTRY(strlen) ...@@ -35,7 +35,7 @@ ENTRY(strlen)
mov.b @r4+,r1 mov.b @r4+,r1
tst r1,r1 tst r1,r1
bt 8f bt 8f
add #1,r2 add #1,r2
1: 1:
mov #0,r3 mov #0,r3
......
...@@ -722,6 +722,10 @@ static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all) ...@@ -722,6 +722,10 @@ static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all)
{ {
while (__ld_cleanup(sh_chan, all)) while (__ld_cleanup(sh_chan, all))
; ;
if (all)
/* Terminating - forgive uncompleted cookies */
sh_chan->completed_cookie = sh_chan->common.cookie;
} }
static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan) static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan)
...@@ -1188,6 +1192,7 @@ static struct platform_driver sh_dmae_driver = { ...@@ -1188,6 +1192,7 @@ static struct platform_driver sh_dmae_driver = {
.remove = __exit_p(sh_dmae_remove), .remove = __exit_p(sh_dmae_remove),
.shutdown = sh_dmae_shutdown, .shutdown = sh_dmae_shutdown,
.driver = { .driver = {
.owner = THIS_MODULE,
.name = "sh-dma-engine", .name = "sh-dma-engine",
}, },
}; };
......
...@@ -49,6 +49,7 @@ config MFD_SH_MOBILE_SDHI ...@@ -49,6 +49,7 @@ config MFD_SH_MOBILE_SDHI
bool "Support for SuperH Mobile SDHI" bool "Support for SuperH Mobile SDHI"
depends on SUPERH || ARCH_SHMOBILE depends on SUPERH || ARCH_SHMOBILE
select MFD_CORE select MFD_CORE
select TMIO_MMC_DMA
---help--- ---help---
This driver supports the SDHI hardware block found in many This driver supports the SDHI hardware block found in many
SuperH Mobile SoCs. SuperH Mobile SoCs.
...@@ -162,6 +163,11 @@ config MFD_TMIO ...@@ -162,6 +163,11 @@ config MFD_TMIO
bool bool
default n default n
config TMIO_MMC_DMA
bool
select DMA_ENGINE
select DMADEVICES
config MFD_T7L66XB config MFD_T7L66XB
bool "Support Toshiba T7L66XB" bool "Support Toshiba T7L66XB"
depends on ARM && HAVE_CLK depends on ARM && HAVE_CLK
......
...@@ -26,11 +26,15 @@ ...@@ -26,11 +26,15 @@
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
#include <linux/mfd/tmio.h> #include <linux/mfd/tmio.h>
#include <linux/mfd/sh_mobile_sdhi.h> #include <linux/mfd/sh_mobile_sdhi.h>
#include <linux/sh_dma.h>
struct sh_mobile_sdhi { struct sh_mobile_sdhi {
struct clk *clk; struct clk *clk;
struct tmio_mmc_data mmc_data; struct tmio_mmc_data mmc_data;
struct mfd_cell cell_mmc; struct mfd_cell cell_mmc;
struct sh_dmae_slave param_tx;
struct sh_dmae_slave param_rx;
struct tmio_mmc_dma dma_priv;
}; };
static struct resource sh_mobile_sdhi_resources[] = { static struct resource sh_mobile_sdhi_resources[] = {
...@@ -64,6 +68,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state) ...@@ -64,6 +68,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state)
static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
{ {
struct sh_mobile_sdhi *priv; struct sh_mobile_sdhi *priv;
struct tmio_mmc_data *mmc_data;
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
struct resource *mem; struct resource *mem;
char clk_name[8]; char clk_name[8];
int ret, irq; int ret, irq;
...@@ -85,6 +91,8 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -85,6 +91,8 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
mmc_data = &priv->mmc_data;
snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
priv->clk = clk_get(&pdev->dev, clk_name); priv->clk = clk_get(&pdev->dev, clk_name);
if (IS_ERR(priv->clk)) { if (IS_ERR(priv->clk)) {
...@@ -96,12 +104,24 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -96,12 +104,24 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
clk_enable(priv->clk); clk_enable(priv->clk);
priv->mmc_data.hclk = clk_get_rate(priv->clk); mmc_data->hclk = clk_get_rate(priv->clk);
priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
priv->mmc_data.capabilities = MMC_CAP_MMC_HIGHSPEED; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
if (p) {
mmc_data->flags = p->tmio_flags;
mmc_data->ocr_mask = p->tmio_ocr_mask;
}
if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
priv->param_tx.slave_id = p->dma_slave_tx;
priv->param_rx.slave_id = p->dma_slave_rx;
priv->dma_priv.chan_priv_tx = &priv->param_tx;
priv->dma_priv.chan_priv_rx = &priv->param_rx;
mmc_data->dma = &priv->dma_priv;
}
memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
priv->cell_mmc.driver_data = &priv->mmc_data; priv->cell_mmc.driver_data = mmc_data;
priv->cell_mmc.platform_data = &priv->cell_mmc; priv->cell_mmc.platform_data = &priv->cell_mmc;
priv->cell_mmc.data_size = sizeof(priv->cell_mmc); priv->cell_mmc.data_size = sizeof(priv->cell_mmc);
......
This diff is collapsed.
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
*/ */
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/interrupt.h>
#include <linux/dmaengine.h>
#define CTL_SD_CMD 0x00 #define CTL_SD_CMD 0x00
#define CTL_ARG_REG 0x04 #define CTL_ARG_REG 0x04
...@@ -106,6 +108,17 @@ struct tmio_mmc_host { ...@@ -106,6 +108,17 @@ struct tmio_mmc_host {
unsigned int sg_off; unsigned int sg_off;
struct platform_device *pdev; struct platform_device *pdev;
/* DMA support */
struct dma_chan *chan_rx;
struct dma_chan *chan_tx;
struct tasklet_struct dma_complete;
struct tasklet_struct dma_issue;
#ifdef CONFIG_TMIO_MMC_DMA
struct dma_async_tx_descriptor *desc;
unsigned int dma_sglen;
dma_cookie_t cookie;
#endif
}; };
#include <linux/io.h> #include <linux/io.h>
......
...@@ -1004,8 +1004,9 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio) ...@@ -1004,8 +1004,9 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)
s->chan_rx = NULL; s->chan_rx = NULL;
s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL; s->cookie_rx[0] = s->cookie_rx[1] = -EINVAL;
dma_release_channel(chan); dma_release_channel(chan);
dma_free_coherent(port->dev, s->buf_len_rx * 2, if (sg_dma_address(&s->sg_rx[0]))
sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0])); dma_free_coherent(port->dev, s->buf_len_rx * 2,
sg_virt(&s->sg_rx[0]), sg_dma_address(&s->sg_rx[0]));
if (enable_pio) if (enable_pio)
sci_start_rx(port); sci_start_rx(port);
} }
......
#ifndef __SH_MOBILE_SDHI_H__ #ifndef __SH_MOBILE_SDHI_H__
#define __SH_MOBILE_SDHI_H__ #define __SH_MOBILE_SDHI_H__
#include <linux/types.h>
struct sh_mobile_sdhi_info { struct sh_mobile_sdhi_info {
int dma_slave_tx;
int dma_slave_rx;
unsigned long tmio_flags;
u32 tmio_ocr_mask; /* available MMC voltages */
void (*set_pwr)(struct platform_device *pdev, int state); void (*set_pwr)(struct platform_device *pdev, int state);
}; };
......
...@@ -50,17 +50,28 @@ ...@@ -50,17 +50,28 @@
tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \
} while (0) } while (0)
/* tmio MMC platform flags */
#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
struct tmio_mmc_dma {
void *chan_priv_tx;
void *chan_priv_rx;
};
/* /*
* data for the MMC controller * data for the MMC controller
*/ */
struct tmio_mmc_data { struct tmio_mmc_data {
unsigned int hclk; unsigned int hclk;
unsigned long capabilities; unsigned long capabilities;
unsigned long flags;
u32 ocr_mask; /* available voltages */
struct tmio_mmc_dma *dma;
void (*set_pwr)(struct platform_device *host, int state); void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state);
}; };
......
...@@ -71,8 +71,7 @@ struct siu_firmware { ...@@ -71,8 +71,7 @@ struct siu_firmware {
#include <linux/dmaengine.h> #include <linux/dmaengine.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/sh_dma.h>
#include <asm/dmaengine.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc-dai.h> #include <sound/soc-dai.h>
#include <asm/dmaengine.h>
#include <asm/siu.h> #include <asm/siu.h>
#include "siu.h" #include "siu.h"
...@@ -358,13 +357,13 @@ static int siu_pcm_open(struct snd_pcm_substream *ss) ...@@ -358,13 +357,13 @@ static int siu_pcm_open(struct snd_pcm_substream *ss)
if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) { if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) {
siu_stream = &port_info->playback; siu_stream = &port_info->playback;
param = &siu_stream->param; param = &siu_stream->param;
param->slave_id = port ? SHDMA_SLAVE_SIUB_TX : param->slave_id = port ? pdata->dma_slave_tx_b :
SHDMA_SLAVE_SIUA_TX; pdata->dma_slave_tx_a;
} else { } else {
siu_stream = &port_info->capture; siu_stream = &port_info->capture;
param = &siu_stream->param; param = &siu_stream->param;
param->slave_id = port ? SHDMA_SLAVE_SIUB_RX : param->slave_id = port ? pdata->dma_slave_rx_b :
SHDMA_SLAVE_SIUA_RX; pdata->dma_slave_rx_a;
} }
param->dma_dev = pdata->dma_dev; param->dma_dev = pdata->dma_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment