aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Hecht <hechtb@googlemail.com>2012-03-01 04:48:41 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:43:23 -0400
commit2aab52e8fe9bffb451508f37a7affa5370bfcc9e (patch)
tree9e1a8198325d9aa79656fd02286e581bbfd27359
parent3f2e924b26989bbe1ad600a83fdc72a3056104d1 (diff)
ARM: mach-shmobile: mackerel: Add the flash controller flctl
Add board and clock setup code for the SH Mobile flctl controller. Signed-off-by: Bastian Hecht <hechtb@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c71
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c4
2 files changed, 74 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index a2813247b455..8758f9453fdd 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -39,6 +39,7 @@
39#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
40#include <linux/mtd/partitions.h> 40#include <linux/mtd/partitions.h>
41#include <linux/mtd/physmap.h> 41#include <linux/mtd/physmap.h>
42#include <linux/mtd/sh_flctl.h>
42#include <linux/pm_clock.h> 43#include <linux/pm_clock.h>
43#include <linux/smsc911x.h> 44#include <linux/smsc911x.h>
44#include <linux/sh_intc.h> 45#include <linux/sh_intc.h>
@@ -965,6 +966,50 @@ static struct platform_device fsi_ak4643_device = {
965 }, 966 },
966}; 967};
967 968
969/* FLCTL */
970static struct mtd_partition nand_partition_info[] = {
971 {
972 .name = "system",
973 .offset = 0,
974 .size = 128 * 1024 * 1024,
975 },
976 {
977 .name = "userdata",
978 .offset = MTDPART_OFS_APPEND,
979 .size = 256 * 1024 * 1024,
980 },
981 {
982 .name = "cache",
983 .offset = MTDPART_OFS_APPEND,
984 .size = 128 * 1024 * 1024,
985 },
986};
987
988static struct resource nand_flash_resources[] = {
989 [0] = {
990 .start = 0xe6a30000,
991 .end = 0xe6a3009b,
992 .flags = IORESOURCE_MEM,
993 }
994};
995
996static struct sh_flctl_platform_data nand_flash_data = {
997 .parts = nand_partition_info,
998 .nr_parts = ARRAY_SIZE(nand_partition_info),
999 .flcmncr_val = CLK_16B_12L_4H | TYPESEL_SET
1000 | SHBUSSEL | SEL_16BIT | SNAND_E,
1001 .use_holden = 1,
1002};
1003
1004static struct platform_device nand_flash_device = {
1005 .name = "sh_flctl",
1006 .resource = nand_flash_resources,
1007 .num_resources = ARRAY_SIZE(nand_flash_resources),
1008 .dev = {
1009 .platform_data = &nand_flash_data,
1010 },
1011};
1012
968/* 1013/*
969 * The card detect pin of the top SD/MMC slot (CN7) is active low and is 1014 * The card detect pin of the top SD/MMC slot (CN7) is active low and is
970 * connected to GPIO A22 of SH7372 (GPIO_PORT41). 1015 * connected to GPIO A22 of SH7372 (GPIO_PORT41).
@@ -1268,6 +1313,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
1268 &fsi_device, 1313 &fsi_device,
1269 &fsi_ak4643_device, 1314 &fsi_ak4643_device,
1270 &fsi_hdmi_device, 1315 &fsi_hdmi_device,
1316 &nand_flash_device,
1271 &sdhi0_device, 1317 &sdhi0_device,
1272#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1318#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1273 &sdhi1_device, 1319 &sdhi1_device,
@@ -1515,6 +1561,30 @@ static void __init mackerel_init(void)
1515 gpio_request(GPIO_FN_MMCCMD0, NULL); 1561 gpio_request(GPIO_FN_MMCCMD0, NULL);
1516 gpio_request(GPIO_FN_MMCCLK0, NULL); 1562 gpio_request(GPIO_FN_MMCCLK0, NULL);
1517 1563
1564 /* FLCTL */
1565 gpio_request(GPIO_FN_D0_NAF0, NULL);
1566 gpio_request(GPIO_FN_D1_NAF1, NULL);
1567 gpio_request(GPIO_FN_D2_NAF2, NULL);
1568 gpio_request(GPIO_FN_D3_NAF3, NULL);
1569 gpio_request(GPIO_FN_D4_NAF4, NULL);
1570 gpio_request(GPIO_FN_D5_NAF5, NULL);
1571 gpio_request(GPIO_FN_D6_NAF6, NULL);
1572 gpio_request(GPIO_FN_D7_NAF7, NULL);
1573 gpio_request(GPIO_FN_D8_NAF8, NULL);
1574 gpio_request(GPIO_FN_D9_NAF9, NULL);
1575 gpio_request(GPIO_FN_D10_NAF10, NULL);
1576 gpio_request(GPIO_FN_D11_NAF11, NULL);
1577 gpio_request(GPIO_FN_D12_NAF12, NULL);
1578 gpio_request(GPIO_FN_D13_NAF13, NULL);
1579 gpio_request(GPIO_FN_D14_NAF14, NULL);
1580 gpio_request(GPIO_FN_D15_NAF15, NULL);
1581 gpio_request(GPIO_FN_FCE0, NULL);
1582 gpio_request(GPIO_FN_WE0_FWE, NULL);
1583 gpio_request(GPIO_FN_FRB, NULL);
1584 gpio_request(GPIO_FN_A4_FOE, NULL);
1585 gpio_request(GPIO_FN_A5_FCDE, NULL);
1586 gpio_request(GPIO_FN_RD_FSC, NULL);
1587
1518 /* enable GPS module (GT-720F) */ 1588 /* enable GPS module (GT-720F) */
1519 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL); 1589 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
1520 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL); 1590 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
@@ -1559,6 +1629,7 @@ static void __init mackerel_init(void)
1559 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device); 1629 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
1560 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device); 1630 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device);
1561 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device); 1631 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device);
1632 sh7372_add_device_to_domain(&sh7372_a3sp, &nand_flash_device);
1562 sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device); 1633 sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
1563 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device); 1634 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
1564#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 1635#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 293456d8dcfd..b692ad3d13a5 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -511,7 +511,7 @@ enum { MSTP001, MSTP000,
511 MSTP223, 511 MSTP223,
512 MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207, 512 MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207,
513 MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 513 MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
514 MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, 514 MSTP328, MSTP323, MSTP322, MSTP315, MSTP314, MSTP313, MSTP312,
515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406, 515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406,
516 MSTP405, MSTP404, MSTP403, MSTP400, 516 MSTP405, MSTP404, MSTP403, MSTP400,
517 MSTP_NR }; 517 MSTP_NR };
@@ -553,6 +553,7 @@ static struct clk mstp_clks[MSTP_NR] = {
553 [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */ 553 [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */
554 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ 554 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
555 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */ 555 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
556 [MSTP315] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 15, 0), /* FLCTL*/
556 [MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ 557 [MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
557 [MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ 558 [MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
558 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ 559 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */
@@ -653,6 +654,7 @@ static struct clk_lookup lookups[] = {
653 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ 654 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
654 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */ 655 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */
655 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */ 656 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP322]), /* USB0 */
657 CLKDEV_DEV_ID("sh_flctl.0", &mstp_clks[MSTP315]), /* FLCTL */
656 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */ 658 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
657 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */ 659 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
658 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */ 660 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */