Skip to content

Commit

Permalink
Merge branch 'next/driver' of git://git.linaro.org/people/arnd/arm-soc
Browse files Browse the repository at this point in the history
* 'next/driver' of git://git.linaro.org/people/arnd/arm-soc:
  hw_random: add driver for atmel true hardware random number generator
  ARM: at91: at91sam9g45: add trng clock and platform device
  MX53 Enable the AHCI SATA on MX53 SMD board
  MX53 Enable the AHCI SATA on MX53 LOCO board
  MX53 Enable the AHCI SATA on MX53 ARD board
  AHCI Add the AHCI SATA feature on the MX53 platforms
  Fix pata imx resource
  ARM: imx: Define functions for registering PATA
  ARM: imx: Add PATA clock support
  ARM: imx: Add PATA resources for other i.MX processors
  imx: efika: Enable pata.
  imx51: add pata clock
  imx51: add pata device

Fix up trivial conflict (new selects next to each other from separate
branches for EFIKA_COMMON) in arch/arm/mach-mx5/Kconfig
  • Loading branch information
torvalds committed Nov 2, 2011
2 parents 9524145 + 995a060 commit 25498e5
Show file tree
Hide file tree
Showing 25 changed files with 524 additions and 7 deletions.
7 changes: 7 additions & 0 deletions arch/arm/mach-at91/at91sam9g45.c
Expand Up @@ -54,6 +54,11 @@ static struct clk pioDE_clk = {
.pmc_mask = 1 << AT91SAM9G45_ID_PIODE,
.type = CLK_TYPE_PERIPHERAL,
};
static struct clk trng_clk = {
.name = "trng_clk",
.pmc_mask = 1 << AT91SAM9G45_ID_TRNG,
.type = CLK_TYPE_PERIPHERAL,
};
static struct clk usart0_clk = {
.name = "usart0_clk",
.pmc_mask = 1 << AT91SAM9G45_ID_US0,
Expand Down Expand Up @@ -177,6 +182,7 @@ static struct clk *periph_clocks[] __initdata = {
&pioB_clk,
&pioC_clk,
&pioDE_clk,
&trng_clk,
&usart0_clk,
&usart1_clk,
&usart2_clk,
Expand Down Expand Up @@ -216,6 +222,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
};

static struct clk_lookup usart_clocks_lookups[] = {
Expand Down
29 changes: 29 additions & 0 deletions arch/arm/mach-at91/at91sam9g45_devices.c
Expand Up @@ -1094,6 +1094,34 @@ static void __init at91_add_device_rtt(void)
}


/* --------------------------------------------------------------------
* TRNG
* -------------------------------------------------------------------- */

#if defined(CONFIG_HW_RANDOM_ATMEL) || defined(CONFIG_HW_RANDOM_ATMEL_MODULE)
static struct resource trng_resources[] = {
{
.start = AT91SAM9G45_BASE_TRNG,
.end = AT91SAM9G45_BASE_TRNG + SZ_16K - 1,
.flags = IORESOURCE_MEM,
},
};

static struct platform_device at91sam9g45_trng_device = {
.name = "atmel-trng",
.id = -1,
.resource = trng_resources,
.num_resources = ARRAY_SIZE(trng_resources),
};

static void __init at91_add_device_trng(void)
{
platform_device_register(&at91sam9g45_trng_device);
}
#else
static void __init at91_add_device_trng(void) {}
#endif

/* --------------------------------------------------------------------
* Watchdog
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -1583,6 +1611,7 @@ static int __init at91_add_standard_devices(void)
at91_add_device_hdmac();
at91_add_device_rtc();
at91_add_device_rtt();
at91_add_device_trng();
at91_add_device_watchdog();
at91_add_device_tc();
return 0;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-imx/clock-imx27.c
Expand Up @@ -583,7 +583,7 @@ DEFINE_CLOCK(emi_clk, 0, PCCR1, 19, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(dma_clk1, 0, PCCR1, 20, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(csi_clk1, 0, PCCR1, 21, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(brom_clk, 0, PCCR1, 22, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(ata_clk, 0, PCCR1, 23, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(pata_clk, 0, PCCR1, 23, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(wdog_clk, 0, PCCR1, 24, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(usb_clk, 0, PCCR1, 25, get_rate_usb, &usb_clk1, &spll_clk);
DEFINE_CLOCK(uart6_clk1, 0, PCCR1, 26, NULL, NULL, &ipg_clk);
Expand Down Expand Up @@ -666,7 +666,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk)
_REGISTER_CLOCK(NULL, "emi", emi_clk)
_REGISTER_CLOCK(NULL, "sahara2", sahara2_clk)
_REGISTER_CLOCK(NULL, "ata", ata_clk)
_REGISTER_CLOCK("pata_imx", NULL, pata_clk)
_REGISTER_CLOCK(NULL, "mstick", mstick_clk)
_REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk)
_REGISTER_CLOCK(NULL, "gpio", gpio_clk)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-imx/clock-imx31.c
Expand Up @@ -476,7 +476,7 @@ DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CGR0, 4, NULL, NULL, &perclk_clk);
DEFINE_CLOCK(epit1_clk, 0, MXC_CCM_CGR0, 6, NULL, NULL, &perclk_clk);
DEFINE_CLOCK(epit2_clk, 1, MXC_CCM_CGR0, 8, NULL, NULL, &perclk_clk);
DEFINE_CLOCK(iim_clk, 0, MXC_CCM_CGR0, 10, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(ata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(pata_clk, 0, MXC_CCM_CGR0, 12, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(sdma_clk1, 0, MXC_CCM_CGR0, 14, NULL, NULL, &ahb_clk);
DEFINE_CLOCK(cspi3_clk, 2, MXC_CCM_CGR0, 16, NULL, NULL, &ipg_clk);
DEFINE_CLOCK(rng_clk, 0, MXC_CCM_CGR0, 18, NULL, NULL, &ipg_clk);
Expand Down Expand Up @@ -562,7 +562,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
_REGISTER_CLOCK(NULL, "firi", firi_clk)
_REGISTER_CLOCK(NULL, "ata", ata_clk)
_REGISTER_CLOCK("pata_imx", NULL, pata_clk)
_REGISTER_CLOCK(NULL, "rtic", rtic_clk)
_REGISTER_CLOCK(NULL, "rng", rng_clk)
_REGISTER_CLOCK("imx31-sdma", NULL, sdma_clk1)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-imx/clock-imx35.c
Expand Up @@ -354,7 +354,7 @@ static void clk_cgr_disable(struct clk *clk)
}

DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL);
DEFINE_CLOCK(ata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL);
DEFINE_CLOCK(pata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL);
/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); */
DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL);
DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL);
Expand Down Expand Up @@ -447,7 +447,7 @@ static struct clk nfc_clk = {

static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "asrc", asrc_clk)
_REGISTER_CLOCK(NULL, "ata", ata_clk)
_REGISTER_CLOCK("pata_imx", NULL, pata_clk)
_REGISTER_CLOCK("flexcan.0", NULL, can1_clk)
_REGISTER_CLOCK("flexcan.1", NULL, can2_clk)
_REGISTER_CLOCK("imx35-cspi.0", NULL, cspi1_clk)
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-imx/devices-imx27.h
Expand Up @@ -76,3 +76,7 @@ extern const struct imx_spi_imx_data imx27_cspi_data[];
#define imx27_add_spi_imx0(pdata) imx27_add_cspi(0, pdata)
#define imx27_add_spi_imx1(pdata) imx27_add_cspi(1, pdata)
#define imx27_add_spi_imx2(pdata) imx27_add_cspi(2, pdata)

extern const struct imx_pata_imx_data imx27_pata_imx_data;
#define imx27_add_pata_imx() \
imx_add_pata_imx(&imx27_pata_imx_data)
4 changes: 4 additions & 0 deletions arch/arm/mach-imx/devices-imx31.h
Expand Up @@ -78,3 +78,7 @@ extern const struct imx_spi_imx_data imx31_cspi_data[];
#define imx31_add_spi_imx0(pdata) imx31_add_cspi(0, pdata)
#define imx31_add_spi_imx1(pdata) imx31_add_cspi(1, pdata)
#define imx31_add_spi_imx2(pdata) imx31_add_cspi(2, pdata)

extern const struct imx_pata_imx_data imx31_pata_imx_data;
#define imx31_add_pata_imx() \
imx_add_pata_imx(&imx31_pata_imx_data)
4 changes: 4 additions & 0 deletions arch/arm/mach-imx/devices-imx35.h
Expand Up @@ -81,3 +81,7 @@ extern const struct imx_spi_imx_data imx35_cspi_data[];
imx_add_spi_imx(&imx35_cspi_data[id], pdata)
#define imx35_add_spi_imx0(pdata) imx35_add_cspi(0, pdata)
#define imx35_add_spi_imx1(pdata) imx35_add_cspi(1, pdata)

extern const struct imx_pata_imx_data imx35_pata_imx_data;
#define imx35_add_pata_imx() \
imx_add_pata_imx(&imx35_pata_imx_data)
1 change: 1 addition & 0 deletions arch/arm/mach-mx5/Kconfig
Expand Up @@ -153,6 +153,7 @@ config MX51_EFIKA_COMMON
select SOC_IMX51
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_MXC_EHCI
select IMX_HAVE_PLATFORM_PATA_IMX
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
select IMX_HAVE_PLATFORM_SPI_IMX
select MXC_ULPI if USB_ULPI
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx5/board-mx53_ard.c
Expand Up @@ -234,6 +234,7 @@ static void __init mx53_ard_board_init(void)
imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
imx_add_gpio_keys(&ard_button_data);
imx53_add_ahci_imx();
}

static void __init mx53_ard_timer_init(void)
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-mx5/board-mx53_loco.c
Expand Up @@ -273,6 +273,7 @@ static void __init mx53_loco_board_init(void)
imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
imx_add_gpio_keys(&loco_button_data);
gpio_led_register_device(-1, &mx53loco_leds_data);
imx53_add_ahci_imx();
}

static void __init mx53_loco_timer_init(void)
Expand Down
16 changes: 16 additions & 0 deletions arch/arm/mach-mx5/board-mx53_smd.c
Expand Up @@ -35,6 +35,7 @@
#include "devices-imx53.h"

#define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6)
#define MX53_SMD_SATA_PWR_EN IMX_GPIO_NR(3, 3)

static iomux_v3_cfg_t mx53_smd_pads[] = {
MX53_PAD_CSI0_DAT10__UART1_TXD_MUX,
Expand Down Expand Up @@ -111,6 +112,19 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
.bitrate = 100000,
};

static inline void mx53_smd_ahci_pwr_on(void)
{
int ret;

/* Enable SATA PWR */
ret = gpio_request_one(MX53_SMD_SATA_PWR_EN,
GPIOF_DIR_OUT | GPIOF_INIT_HIGH, "ahci-sata-pwr");
if (ret) {
pr_err("failed to enable SATA_PWR_EN: %d\n", ret);
return;
}
}

static void __init mx53_smd_board_init(void)
{
imx53_soc_init();
Expand All @@ -125,6 +139,8 @@ static void __init mx53_smd_board_init(void)
imx53_add_sdhci_esdhc_imx(0, NULL);
imx53_add_sdhci_esdhc_imx(1, NULL);
imx53_add_sdhci_esdhc_imx(2, NULL);
mx53_smd_ahci_pwr_on();
imx53_add_ahci_imx();
}

static void __init mx53_smd_timer_init(void)
Expand Down
25 changes: 25 additions & 0 deletions arch/arm/mach-mx5/clock-mx51-mx53.c
Expand Up @@ -1401,6 +1401,22 @@ static struct clk esdhc4_mx53_clk = {
.secondary = &esdhc4_ipg_clk,
};

static struct clk sata_clk = {
.parent = &ipg_clk,
.enable = _clk_max_enable,
.enable_reg = MXC_CCM_CCGR4,
.enable_shift = MXC_CCM_CCGRx_CG1_OFFSET,
.disable = _clk_max_disable,
};

static struct clk ahci_phy_clk = {
.parent = &usb_phy1_clk,
};

static struct clk ahci_dma_clk = {
.parent = &ahb_clk,
};

DEFINE_CLOCK(mipi_esc_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG5_OFFSET, NULL, NULL, NULL, &pll2_sw_clk);
DEFINE_CLOCK(mipi_hsc2_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG4_OFFSET, NULL, NULL, &mipi_esc_clk, &pll2_sw_clk);
DEFINE_CLOCK(mipi_hsc1_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG3_OFFSET, NULL, NULL, &mipi_hsc2_clk, &pll2_sw_clk);
Expand All @@ -1418,6 +1434,10 @@ DEFINE_CLOCK(ipu_di0_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG5_OFFSET,
DEFINE_CLOCK(ipu_di1_clk, 0, MXC_CCM_CCGR6, MXC_CCM_CCGRx_CG6_OFFSET,
NULL, NULL, &pll3_sw_clk, NULL);

/* PATA */
DEFINE_CLOCK(pata_clk, 0, MXC_CCM_CCGR4, MXC_CCM_CCGRx_CG0_OFFSET,
NULL, NULL, &ipg_clk, &spba_clk);

#define _REGISTER_CLOCK(d, n, c) \
{ \
.dev_id = d, \
Expand Down Expand Up @@ -1474,6 +1494,7 @@ static struct clk_lookup mx51_lookups[] = {
_REGISTER_CLOCK("imx-ipuv3", "di0", ipu_di0_clk)
_REGISTER_CLOCK("imx-ipuv3", "di1", ipu_di1_clk)
_REGISTER_CLOCK(NULL, "gpc_dvfs", gpc_dvfs_clk)
_REGISTER_CLOCK("pata_imx", NULL, pata_clk)
};

static struct clk_lookup mx53_lookups[] = {
Expand Down Expand Up @@ -1507,6 +1528,10 @@ static struct clk_lookup mx53_lookups[] = {
_REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
_REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
_REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
_REGISTER_CLOCK("pata_imx", NULL, pata_clk)
_REGISTER_CLOCK("imx53-ahci.0", "ahci", sata_clk)
_REGISTER_CLOCK("imx53-ahci.0", "ahci_phy", ahci_phy_clk)
_REGISTER_CLOCK("imx53-ahci.0", "ahci_dma", ahci_dma_clk)
};

static void clk_tree_init(void)
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-mx5/devices-imx51.h
Expand Up @@ -65,3 +65,7 @@ extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[];
extern const struct imx_imx_keypad_data imx51_imx_keypad_data;
#define imx51_add_imx_keypad(pdata) \
imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)

extern const struct imx_pata_imx_data imx51_pata_imx_data;
#define imx51_add_pata_imx() \
imx_add_pata_imx(&imx51_pata_imx_data)
5 changes: 5 additions & 0 deletions arch/arm/mach-mx5/devices-imx53.h
Expand Up @@ -40,3 +40,8 @@ extern const struct imx_imx_ssi_data imx53_imx_ssi_data[];
extern const struct imx_imx_keypad_data imx53_imx_keypad_data;
#define imx53_add_imx_keypad(pdata) \
imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)

extern const struct imx_pata_imx_data imx53_pata_imx_data;
#define imx53_add_pata_imx() \
imx_add_pata_imx(&imx53_pata_imx_data)
extern struct platform_device *__init imx53_add_ahci_imx(void);
2 changes: 2 additions & 0 deletions arch/arm/mach-mx5/mx51_efika.c
Expand Up @@ -625,6 +625,8 @@ void __init efika_board_common_init(void)
ARRAY_SIZE(mx51_efika_spi_board_info));
imx51_add_ecspi(0, &mx51_efika_spi_pdata);

imx51_add_pata_imx();

#if defined(CONFIG_CPU_FREQ_IMX)
get_cpu_op = mx51_get_cpu_op;
#endif
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/plat-mxc/devices/Kconfig
Expand Up @@ -31,6 +31,9 @@ config IMX_HAVE_PLATFORM_IMX_I2C
config IMX_HAVE_PLATFORM_IMX_KEYPAD
bool

config IMX_HAVE_PLATFORM_PATA_IMX
bool

config IMX_HAVE_PLATFORM_IMX_SSI
bool

Expand Down Expand Up @@ -76,3 +79,7 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX

config IMX_HAVE_PLATFORM_SPI_IMX
bool

config IMX_HAVE_PLATFORM_AHCI
bool
default y if ARCH_MX53
2 changes: 2 additions & 0 deletions arch/arm/plat-mxc/devices/Makefile
Expand Up @@ -10,6 +10,7 @@ obj-y += platform-imx-dma.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_FB) += platform-imx-fb.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_KEYPAD) += platform-imx-keypad.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_PATA_IMX) += platform-pata_imx.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o
Expand All @@ -25,3 +26,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o

0 comments on commit 25498e5

Please sign in to comment.