Skip to content

Commit

Permalink
Merge branch 'renesas-r8a7740' into renesas-soc
Browse files Browse the repository at this point in the history
* renesas-r8a7740:
  ARM: mach-shmobile: r8a7740 generic board support via DT
  ARM: shmobile: r8a7740: add A4LC pm domain support
  ARM: shmobile: r8a7740: add A3SP pm domain support
  ARM: shmobile: r8a7740: add A4S pm domain support
  ARM: shmobile: r8a7740: fixup: MSEL1CR 7bit control
  ARM: shmobile: use common DMAEngine definitions on r8a7740
  ARM: shmobile: r8a7740: add DMAEngine support for USB
  ARM: shmobile: r8a7740: add DMAEngine support for SDHI
  ARM: shmobile: r8a7740: add DMAEngine support for FSI
  • Loading branch information
Rafael J. Wysocki committed Jul 11, 2012
2 parents 992c91e + 755d57b commit b0a1e75
Show file tree
Hide file tree
Showing 7 changed files with 453 additions and 3 deletions.
21 changes: 21 additions & 0 deletions arch/arm/boot/dts/r8a7740.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Device Tree Source for the r8a7740 SoC
*
* Copyright (C) 2012 Renesas Solutions Corp.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/

/include/ "skeleton.dtsi"

/ {
compatible = "renesas,r8a7740";

cpus {
cpu@0 {
compatible = "arm,cortex-a9";
};
};
};
1 change: 1 addition & 0 deletions arch/arm/mach-shmobile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ obj-$(CONFIG_SUSPEND) += suspend.o
obj-$(CONFIG_CPU_IDLE) += cpuidle.o
obj-$(CONFIG_ARCH_SHMOBILE) += pm-rmobile.o
obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o
obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o
obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o

# Board objects
Expand Down
10 changes: 9 additions & 1 deletion arch/arm/mach-shmobile/clock-r8a7740.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ enum {

MSTP230,
MSTP222,
MSTP218, MSTP217, MSTP216, MSTP214,
MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,

MSTP329, MSTP328, MSTP323, MSTP320,
Expand All @@ -485,6 +486,10 @@ static struct clk mstp_clks[MSTP_NR] = {

[MSTP230] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 30, 0), /* SCIFA6 */
[MSTP222] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 22, 0), /* SCIFA7 */
[MSTP218] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */
[MSTP217] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */
[MSTP216] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */
[MSTP214] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */
[MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
[MSTP206] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
[MSTP204] = SH_CLK_MSTP32(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
Expand Down Expand Up @@ -563,7 +568,10 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]),
CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]),
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]),

CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]),
CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]),
CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]),
CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]),
CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]),
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]),

Expand Down
24 changes: 24 additions & 0 deletions arch/arm/mach-shmobile/include/mach/r8a7740.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#ifndef __ASM_R8A7740_H__
#define __ASM_R8A7740_H__

#include <mach/pm-rmobile.h>

/*
* MD_CKx pin
*/
Expand Down Expand Up @@ -588,4 +590,26 @@ enum {
GPIO_FN_TRACEAUD_FROM_MEMC,
};

/* DMA slave IDs */
enum {
SHDMA_SLAVE_INVALID,
SHDMA_SLAVE_SDHI0_RX,
SHDMA_SLAVE_SDHI0_TX,
SHDMA_SLAVE_SDHI1_RX,
SHDMA_SLAVE_SDHI1_TX,
SHDMA_SLAVE_SDHI2_RX,
SHDMA_SLAVE_SDHI2_TX,
SHDMA_SLAVE_FSIA_RX,
SHDMA_SLAVE_FSIA_TX,
SHDMA_SLAVE_FSIB_TX,
SHDMA_SLAVE_USBHS_TX,
SHDMA_SLAVE_USBHS_RX,
};

#ifdef CONFIG_PM
extern struct rmobile_pm_domain r8a7740_pd_a4s;
extern struct rmobile_pm_domain r8a7740_pd_a3sp;
extern struct rmobile_pm_domain r8a7740_pd_a4lc;
#endif /* CONFIG_PM */

#endif /* __ASM_R8A7740_H__ */
4 changes: 2 additions & 2 deletions arch/arm/mach-shmobile/pfc-r8a7740.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ static pinmux_enum_t pinmux_data[] = {
PINMUX_DATA(A21_MARK, PORT120_FN1),
PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT120_FN2),
PINMUX_DATA(MSIOF1_TSYNC_PORT120_MARK, PORT120_FN3, MSEL4CR_10_0),
PINMUX_DATA(IRQ7_PORT120_MARK, PORT120_FN0, MSEL1CR_7_0),
PINMUX_DATA(IRQ7_PORT120_MARK, PORT120_FN0, MSEL1CR_7_1),

/* Port121 */
PINMUX_DATA(A20_MARK, PORT121_FN1),
Expand Down Expand Up @@ -1623,7 +1623,7 @@ static pinmux_enum_t pinmux_data[] = {

/* Port209 */
PINMUX_DATA(VBUS_MARK, PORT209_FN1),
PINMUX_DATA(IRQ7_PORT209_MARK, PORT209_FN0, MSEL1CR_7_1),
PINMUX_DATA(IRQ7_PORT209_MARK, PORT209_FN0, MSEL1CR_7_0),

/* Port210 */
PINMUX_DATA(IRQ9_PORT210_MARK, PORT210_FN0, MSEL1CR_9_1),
Expand Down
54 changes: 54 additions & 0 deletions arch/arm/mach-shmobile/pm-r8a7740.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* r8a7740 power management support
*
* Copyright (C) 2012 Renesas Solutions Corp.
* Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/console.h>
#include <mach/pm-rmobile.h>

#ifdef CONFIG_PM
static int r8a7740_pd_a4s_suspend(void)
{
/*
* The A4S domain contains the CPU core and therefore it should
* only be turned off if the CPU is in use.
*/
return -EBUSY;
}

struct rmobile_pm_domain r8a7740_pd_a4s = {
.genpd.name = "A4S",
.bit_shift = 10,
.gov = &pm_domain_always_on_gov,
.no_debug = true,
.suspend = r8a7740_pd_a4s_suspend,
};

static int r8a7740_pd_a3sp_suspend(void)
{
/*
* Serial consoles make use of SCIF hardware located in A3SP,
* keep such power domain on if "no_console_suspend" is set.
*/
return console_suspend_enabled ? 0 : -EBUSY;
}

struct rmobile_pm_domain r8a7740_pd_a3sp = {
.genpd.name = "A3SP",
.bit_shift = 11,
.gov = &pm_domain_always_on_gov,
.no_debug = true,
.suspend = r8a7740_pd_a3sp_suspend,
};

struct rmobile_pm_domain r8a7740_pd_a4lc = {
.genpd.name = "A4LC",
.bit_shift = 1,
};

#endif /* CONFIG_PM */
Loading

0 comments on commit b0a1e75

Please sign in to comment.