History

Merge branch 'renesas/boards2' into next/late

Conflicts: arch/arm/mach-shmobile/setup-r8a7778.c This is a dependency for the Renesas sh-sci updates.

Arnd Bergmann committed 13 years ago

Commit 4022acd2 parents 37c5a9f 2c8332212 files · +490 −77Browse files

Unified · Split

12 files
  1. arch/arm/mach-shmobile/board-ape6evm.c +15 −0
  2. arch/arm/mach-shmobile/board-bockw.c +151 −6
  3. arch/arm/mach-shmobile/board-kzm9d.c +1 −1
  4. arch/arm/mach-shmobile/board-kzm9g.c +140 −53
  5. arch/arm/mach-shmobile/board-lager.c +49 −0
  6. arch/arm/mach-shmobile/board-marzen.c +3 −2
  7. arch/arm/mach-shmobile/clock-r8a73a4.c +17 −5
  8. arch/arm/mach-shmobile/clock-r8a7778.c +22 −1
  9. arch/arm/mach-shmobile/clock-r8a7790.c +24 −7
  10. arch/arm/mach-shmobile/include/mach/r8a7778.h +5 −0
  11. arch/arm/mach-shmobile/setup-r8a7778.c +62 −1
  12. arch/arm/mach-shmobile/setup-r8a7779.c +1 −1
arch/arm/mach-shmobile/board-ape6evm.c+15−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/platform_device.h>
2727 #include <linux/regulator/fixed.h>
2828 #include <linux/regulator/machine.h>
29+#include <linux/sh_clk.h>
2930 #include <linux/smsc911x.h>
3031 #include <mach/common.h>
3132 #include <mach/irqs.h>
@@ -65,7 +66,21 @@ static const struct pinctrl_map ape6evm_pinctrl_map[] = { · 33 unmodified lines
6566
6667 static void __init ape6evm_add_standard_devices(void)
6768 {
69+
70+ struct clk *parent;
71+ struct clk *mp;
72+
6873 r8a73a4_clock_init();
74+
75+ /* MP clock parent = extal2 */
76+ parent = clk_get(NULL, "extal2");
77+ mp = clk_get(NULL, "mp");
78+ BUG_ON(IS_ERR(parent) || IS_ERR(mp));
79+
80+ clk_set_parent(mp, parent);
81+ clk_put(parent);
82+ clk_put(mp);
83+
6984 pinctrl_register_mappings(ape6evm_pinctrl_map,
7085 ARRAY_SIZE(ape6evm_pinctrl_map));
7186 r8a73a4_pinmux_init();
arch/arm/mach-shmobile/board-bockw.c+151−6
@@ -18,14 +18,52 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include <linux/mfd/tmio.h>
22+#include <linux/mmc/host.h>
23+#include <linux/mtd/partitions.h>
2124 #include <linux/pinctrl/machine.h>
2225 #include <linux/platform_device.h>
26+#include <linux/regulator/fixed.h>
27+#include <linux/regulator/machine.h>
2328 #include <linux/smsc911x.h>
29+#include <linux/spi/spi.h>
30+#include <linux/spi/flash.h>
2431 #include <mach/common.h>
2532 #include <mach/irqs.h>
2633 #include <mach/r8a7778.h>
2734 #include <asm/mach/arch.h>
2835
36+/*
37+ * CN9(Upper side) SCIF/RCAN selection
38+ *
39+ * 1,4 3,6
40+ * SW40 SCIF RCAN
41+ * SW41 SCIF RCAN
42+ */
43+
44+/*
45+ * MMC (CN26) pin
46+ *
47+ * SW6 (D2) 3 pin
48+ * SW7 (D5) ON
49+ * SW8 (D3) 3 pin
50+ * SW10 (D4) 1 pin
51+ * SW12 (CLK) 1 pin
52+ * SW13 (D6) 3 pin
53+ * SW14 (CMD) ON
54+ * SW15 (D6) 1 pin
55+ * SW16 (D0) ON
56+ * SW17 (D1) ON
57+ * SW18 (D7) 3 pin
58+ * SW19 (MMC) 1 pin
59+ */
60+
61+/* Dummy supplies, where voltage doesn't matter */
62+static struct regulator_consumer_supply dummy_supplies[] = {
63+ REGULATOR_SUPPLY("vddvario", "smsc911x"),
64+ REGULATOR_SUPPLY("vdd33a", "smsc911x"),
65+};
66+
2967 static struct smsc911x_platform_config smsc911x_data = {
3068 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
3169 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
@@ -38,29 +76,119 @@ static struct resource smsc911x_resources[] = { · 6 unmodified lines
3876 DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */
3977 };
4078
79+/* SDHI */
80+static struct sh_mobile_sdhi_info sdhi0_info = {
81+ .tmio_caps = MMC_CAP_SD_HIGHSPEED,
82+ .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
83+ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
84+};
85+
86+static struct sh_eth_plat_data ether_platform_data __initdata = {
87+ .phy = 0x01,
88+ .edmac_endian = EDMAC_LITTLE_ENDIAN,
89+ .register_type = SH_ETH_REG_FAST_RCAR,
90+ .phy_interface = PHY_INTERFACE_MODE_RMII,
91+ /*
92+ * Although the LINK signal is available on the board, it's connected to
93+ * the link/activity LED output of the PHY, thus the link disappears and
94+ * reappears after each packet. We'd be better off ignoring such signal
95+ * and getting the link state from the PHY indirectly.
96+ */
97+ .no_ether_link = 1,
98+};
99+
100+/* I2C */
101+static struct i2c_board_info i2c0_devices[] = {
102+ {
103+ I2C_BOARD_INFO("rx8581", 0x51),
104+ },
105+};
106+
107+/* HSPI*/
108+static struct mtd_partition m25p80_spi_flash_partitions[] = {
109+ {
110+ .name = "data(spi)",
111+ .size = 0x0100000,
112+ .offset = 0,
113+ },
114+};
115+
116+static struct flash_platform_data spi_flash_data = {
117+ .name = "m25p80",
118+ .type = "s25fl008k",
119+ .parts = m25p80_spi_flash_partitions,
120+ .nr_parts = ARRAY_SIZE(m25p80_spi_flash_partitions),
121+};
122+
123+static struct spi_board_info spi_board_info[] __initdata = {
124+ {
125+ .modalias = "m25p80",
126+ .max_speed_hz = 104000000,
127+ .chip_select = 0,
128+ .bus_num = 0,
129+ .mode = SPI_MODE_0,
130+ .platform_data = &spi_flash_data,
131+ },
132+};
133+
134+/* MMC */
135+static struct sh_mmcif_plat_data sh_mmcif_plat = {
136+ .sup_pclk = 0,
137+ .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
138+ .caps = MMC_CAP_4_BIT_DATA |
139+ MMC_CAP_8_BIT_DATA |
140+ MMC_CAP_NEEDS_POLL,
141+};
142+
41143 static const struct pinctrl_map bockw_pinctrl_map[] = {
144+ /* Ether */
145+ PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
146+ "ether_rmii", "ether"),
147+ /* HSPI0 */
148+ PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7778",
149+ "hspi0_a", "hspi0"),
150+ /* MMC */
151+ PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif", "pfc-r8a7778",
152+ "mmc_data8", "mmc"),
153+ PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif", "pfc-r8a7778",
154+ "mmc_ctrl", "mmc"),
42155 /* SCIF0 */
43156 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
44157 "scif0_data_a", "scif0"),
45158 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778",
46159 "scif0_ctrl", "scif0"),
160+ /* SDHI0 */
161+ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
162+ "sdhi0", "sdhi0"),
47163 };
48164
165+#define FPGA 0x18200000
49166 #define IRQ0MR 0x30
167+#define PFC 0xfffc0000
168+#define PUPR4 0x110
50169 static void __init bockw_init(void)
51170 {
52− void __iomem *fpga;
171+ void __iomem *base;
53172
54173 r8a7778_clock_init();
55174 r8a7778_init_irq_extpin(1);
56175 r8a7778_add_standard_devices();
176+ r8a7778_add_ether_device(&ether_platform_data);
177+ r8a7778_add_i2c_device(0);
178+ r8a7778_add_hspi_device(0);
179+ r8a7778_add_mmc_device(&sh_mmcif_plat);
57180
181+ i2c_register_board_info(0, i2c0_devices,
182+ ARRAY_SIZE(i2c0_devices));
183+ spi_register_board_info(spi_board_info,
184+ ARRAY_SIZE(spi_board_info));
58185 pinctrl_register_mappings(bockw_pinctrl_map,
59186 ARRAY_SIZE(bockw_pinctrl_map));
60187 r8a7778_pinmux_init();
61188
62− fpga = ioremap_nocache(0x18200000, SZ_1M);
63− if (fpga) {
189+ /* for SMSC */
190+ base = ioremap_nocache(FPGA, SZ_1M);
191+ if (base) {
64192 /*
65193 * CAUTION
66194 *
@@ -68,16 +196,33 @@ static void __init bockw_init(void) · 1 unmodified line
68196 * it should be cared in the future
69197 * Now, it is assuming IRQ0 was used only from SMSC.
70198 */
71− u16 val = ioread16(fpga + IRQ0MR);
199+ u16 val = ioread16(base + IRQ0MR);
72200 val &= ~(1 << 4); /* enable SMSC911x */
73− iowrite16(val, fpga + IRQ0MR);
74− iounmap(fpga);
201+ iowrite16(val, base + IRQ0MR);
202+ iounmap(base);
203+
204+ regulator_register_fixed(0, dummy_supplies,
205+ ARRAY_SIZE(dummy_supplies));
75206
76207 platform_device_register_resndata(
77208 &platform_bus, "smsc911x", -1,
78209 smsc911x_resources, ARRAY_SIZE(smsc911x_resources),
79210 &smsc911x_data, sizeof(smsc911x_data));
80211 }
212+
213+ /* for SDHI */
214+ base = ioremap_nocache(PFC, 0x200);
215+ if (base) {
216+ /*
217+ * FIXME
218+ *
219+ * SDHI CD/WP pin needs pull-up
220+ */
221+ iowrite32(ioread32(base + PUPR4) | (3 << 26), base + PUPR4);
222+ iounmap(base);
223+
224+ r8a7778_sdhi_init(0, &sdhi0_info);
225+ }
81226 }
82227
83228 static const char *bockw_boards_compat_dt[] __initdata = {
arch/arm/mach-shmobile/board-kzm9d.c+1−1
@@ -56,7 +56,7 @@ static struct smsc911x_platform_config smsc911x_platdata = { · 55 unmodified lines
5656
5757 static struct platform_device smsc91x_device = {
5858 .name = "smsc911x",
59− .id = 0,
59+ .id = -1,
6060 .dev = {
6161 .platform_data = &smsc911x_platdata,
6262 },
arch/arm/mach-shmobile/board-kzm9g.c+140−53
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/mmc/host.h>
3030 #include <linux/mmc/sh_mmcif.h>
3131 #include <linux/mmc/sh_mobile_sdhi.h>
32+#include <linux/mfd/as3711.h>
3233 #include <linux/mfd/tmio.h>
3334 #include <linux/pinctrl/machine.h>
3435 #include <linux/pinctrl/pinconf-generic.h>
@@ -606,6 +607,140 @@ static struct platform_device fsi_ak4648_device = { · 571 unmodified lines
606607 };
607608
608609 /* I2C */
610+
611+/* StepDown1 is used to supply 1.315V to the CPU */
612+static struct regulator_init_data as3711_sd1 = {
613+ .constraints = {
614+ .name = "1.315V CPU",
615+ .boot_on = 1,
616+ .always_on = 1,
617+ .min_uV = 1315000,
618+ .max_uV = 1335000,
619+ },
620+};
621+
622+/* StepDown2 is used to supply 1.8V to the CPU and to the board */
623+static struct regulator_init_data as3711_sd2 = {
624+ .constraints = {
625+ .name = "1.8V",
626+ .boot_on = 1,
627+ .always_on = 1,
628+ .min_uV = 1800000,
629+ .max_uV = 1800000,
630+ },
631+};
632+
633+/*
634+ * StepDown3 is switched in parallel with StepDown2, seems to be off,
635+ * according to read-back pre-set register values
636+ */
637+
638+/* StepDown4 is used to supply 1.215V to the CPU and to the board */
639+static struct regulator_init_data as3711_sd4 = {
640+ .constraints = {
641+ .name = "1.215V",
642+ .boot_on = 1,
643+ .always_on = 1,
644+ .min_uV = 1215000,
645+ .max_uV = 1235000,
646+ },
647+};
648+
649+/* LDO1 is unused and unconnected */
650+
651+/* LDO2 is used to supply 2.8V to the CPU */
652+static struct regulator_init_data as3711_ldo2 = {
653+ .constraints = {
654+ .name = "2.8V CPU",
655+ .boot_on = 1,
656+ .always_on = 1,
657+ .min_uV = 2800000,
658+ .max_uV = 2800000,
659+ },
660+};
661+
662+/* LDO3 is used to supply 3.0V to the CPU */
663+static struct regulator_init_data as3711_ldo3 = {
664+ .constraints = {
665+ .name = "3.0V CPU",
666+ .boot_on = 1,
667+ .always_on = 1,
668+ .min_uV = 3000000,
669+ .max_uV = 3000000,
670+ },
671+};
672+
673+/* LDO4 is used to supply 2.8V to the board */
674+static struct regulator_init_data as3711_ldo4 = {
675+ .constraints = {
676+ .name = "2.8V",
677+ .boot_on = 1,
678+ .always_on = 1,
679+ .min_uV = 2800000,
680+ .max_uV = 2800000,
681+ },
682+};
683+
684+/* LDO5 is switched parallel to LDO4, also set to 2.8V */
685+static struct regulator_init_data as3711_ldo5 = {
686+ .constraints = {
687+ .name = "2.8V #2",
688+ .boot_on = 1,
689+ .always_on = 1,
690+ .min_uV = 2800000,
691+ .max_uV = 2800000,
692+ },
693+};
694+
695+/* LDO6 is unused and unconnected */
696+
697+/* LDO7 is used to supply 1.15V to the CPU */
698+static struct regulator_init_data as3711_ldo7 = {
699+ .constraints = {
700+ .name = "1.15V CPU",
701+ .boot_on = 1,
702+ .always_on = 1,
703+ .min_uV = 1150000,
704+ .max_uV = 1150000,
705+ },
706+};
707+
708+/* LDO8 is switched parallel to LDO7, also set to 1.15V */
709+static struct regulator_init_data as3711_ldo8 = {
710+ .constraints = {
711+ .name = "1.15V CPU #2",
712+ .boot_on = 1,
713+ .always_on = 1,
714+ .min_uV = 1150000,
715+ .max_uV = 1150000,
716+ },
717+};
718+
719+static struct as3711_platform_data as3711_pdata = {
720+ .regulator = {
721+ .init_data = {
722+ [AS3711_REGULATOR_SD_1] = &as3711_sd1,
723+ [AS3711_REGULATOR_SD_2] = &as3711_sd2,
724+ [AS3711_REGULATOR_SD_4] = &as3711_sd4,
725+ [AS3711_REGULATOR_LDO_2] = &as3711_ldo2,
726+ [AS3711_REGULATOR_LDO_3] = &as3711_ldo3,
727+ [AS3711_REGULATOR_LDO_4] = &as3711_ldo4,
728+ [AS3711_REGULATOR_LDO_5] = &as3711_ldo5,
729+ [AS3711_REGULATOR_LDO_7] = &as3711_ldo7,
730+ [AS3711_REGULATOR_LDO_8] = &as3711_ldo8,
731+ },
732+ },
733+ .backlight = {
734+ .su2_fb = "sh_mobile_lcdc_fb.0",
735+ .su2_max_uA = 36000,
736+ .su2_feedback = AS3711_SU2_CURR_AUTO,
737+ .su2_fbprot = AS3711_SU2_GPIO4,
738+ .su2_auto_curr1 = true,
739+ .su2_auto_curr2 = true,
740+ .su2_auto_curr3 = true,
741+ },
742+};
743+
609744 static struct pcf857x_platform_data pcf8575_pdata = {
610745 .gpio_base = GPIO_PCF8575_BASE,
611746 };
@@ -625,6 +760,11 @@ static struct i2c_board_info i2c0_devices[] = { · 13 unmodified lines
625760 I2C_BOARD_INFO("adxl34x", 0x1d),
626761 .irq = irq_pin(26), /* IRQ26 */
627762 },
763+ {
764+ I2C_BOARD_INFO("as3711", 0x40),
765+ .irq = intcs_evt2irq(0x3300), /* IRQ24 */
766+ .platform_data = &as3711_pdata,
767+ },
628768 };
629769
630770 static struct i2c_board_info i2c1_devices[] = {
@@ -715,59 +855,6 @@ static const struct pinctrl_map kzm_pinctrl_map[] = { · 84 unmodified lines
715855 "usb_vbus", "usb"),
716856 };
717857
718−/*
719− * FIXME
720− *
721− * This is quick hack for enabling LCDC backlight
722− */
723−static int __init as3711_enable_lcdc_backlight(void)
724−{
725− struct i2c_adapter *a = i2c_get_adapter(0);
726− struct i2c_msg msg;
727− int i, ret;
728− __u8 magic[] = {
729− 0x40, 0x2a,
730− 0x43, 0x3c,
731− 0x44, 0x3c,
732− 0x45, 0x3c,
733− 0x54, 0x03,
734− 0x51, 0x00,
735− 0x51, 0x01,
736− 0xff, 0x00, /* wait */
737− 0x43, 0xf0,
738− 0x44, 0xf0,
739− 0x45, 0xf0,
740− };
741−
742− if (!of_machine_is_compatible("renesas,kzm9g"))
743− return 0;
744−
745− if (!a)
746− return 0;
747−
748− msg.addr = 0x40;
749− msg.len = 2;
750− msg.flags = 0;
751−
752− for (i = 0; i < ARRAY_SIZE(magic); i += 2) {
753− msg.buf = magic + i;
754−
755− if (0xff == msg.buf[0]) {
756− udelay(500);
757− continue;
758− }
759−
760− ret = i2c_transfer(a, &msg, 1);
761− if (ret < 0) {
762− pr_err("i2c transfer fail\n");
763− break;
764− }
765− }
766−
767− return 0;
768−}
769−device_initcall(as3711_enable_lcdc_backlight);
770−
771858 static void __init kzm_init(void)
772859 {
773860 regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers,
arch/arm/mach-shmobile/board-lager.c+49−0
@@ -18,16 +18,59 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include <linux/gpio.h>
22+#include <linux/gpio_keys.h>
23+#include <linux/input.h>
2124 #include <linux/interrupt.h>
2225 #include <linux/irqchip.h>
2326 #include <linux/kernel.h>
27+#include <linux/leds.h>
2428 #include <linux/pinctrl/machine.h>
29+#include <linux/platform_data/gpio-rcar.h>
2530 #include <linux/platform_device.h>
2631 #include <mach/common.h>
2732 #include <mach/r8a7790.h>
2833 #include <asm/mach-types.h>
2934 #include <asm/mach/arch.h>
3035
36+/* LEDS */
37+static struct gpio_led lager_leds[] = {
38+ {
39+ .name = "led8",
40+ .gpio = RCAR_GP_PIN(5, 17),
41+ .default_state = LEDS_GPIO_DEFSTATE_ON,
42+ }, {
43+ .name = "led7",
44+ .gpio = RCAR_GP_PIN(4, 23),
45+ .default_state = LEDS_GPIO_DEFSTATE_ON,
46+ }, {
47+ .name = "led6",
48+ .gpio = RCAR_GP_PIN(4, 22),
49+ .default_state = LEDS_GPIO_DEFSTATE_ON,
50+ },
51+};
52+
53+static __initdata struct gpio_led_platform_data lager_leds_pdata = {
54+ .leds = lager_leds,
55+ .num_leds = ARRAY_SIZE(lager_leds),
56+};
57+
58+/* GPIO KEY */
59+#define GPIO_KEY(c, g, d, ...) \
60+ { .code = c, .gpio = g, .desc = d, .active_low = 1 }
61+
62+static __initdata struct gpio_keys_button gpio_buttons[] = {
63+ GPIO_KEY(KEY_4, RCAR_GP_PIN(1, 28), "SW2-pin4"),
64+ GPIO_KEY(KEY_3, RCAR_GP_PIN(1, 26), "SW2-pin3"),
65+ GPIO_KEY(KEY_2, RCAR_GP_PIN(1, 24), "SW2-pin2"),
66+ GPIO_KEY(KEY_1, RCAR_GP_PIN(1, 14), "SW2-pin1"),
67+};
68+
69+static __initdata struct gpio_keys_platform_data lager_keys_pdata = {
70+ .buttons = gpio_buttons,
71+ .nbuttons = ARRAY_SIZE(gpio_buttons),
72+};
73+
3174 static const struct pinctrl_map lager_pinctrl_map[] = {
3275 /* SCIF0 (CN19: DEBUG SERIAL0) */
3376 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -46,6 +89,12 @@ static void __init lager_add_standard_devices(void) · 12 unmodified lines
4689 r8a7790_pinmux_init();
4790
4891 r8a7790_add_standard_devices();
92+ platform_device_register_data(&platform_bus, "leds-gpio", -1,
93+ &lager_leds_pdata,
94+ sizeof(lager_leds_pdata));
95+ platform_device_register_data(&platform_bus, "gpio-keys", -1,
96+ &lager_keys_pdata,
97+ sizeof(lager_keys_pdata));
4998 }
5099
51100 static const char *lager_boards_compat_dt[] __initdata = {
arch/arm/mach-shmobile/board-marzen.c+3−2
@@ -69,7 +69,7 @@ static struct resource smsc911x_resources[] = { · 68 unmodified lines
6969 .flags = IORESOURCE_MEM,
7070 },
7171 [1] = {
72− .start = gic_iid(0x3c), /* IRQ 1 */
72+ .start = irq_pin(1), /* IRQ 1 */
7373 .flags = IORESOURCE_IRQ,
7474 },
7575 };
@@ -350,7 +350,7 @@ static struct platform_device *marzen_late_devices[] __initdata = { · 274 unmodified lines
350350 &ohci1_device,
351351 };
352352
353−void __init marzen_init_late(void)
353+static void __init marzen_init_late(void)
354354 {
355355 /* get usb phy */
356356 phy = usb_get_phy(USB_PHY_TYPE_USB2);
@@ -405,6 +405,7 @@ static void __init marzen_init(void) · 48 unmodified lines
405405 pinctrl_register_mappings(marzen_pinctrl_map,
406406 ARRAY_SIZE(marzen_pinctrl_map));
407407 r8a7779_pinmux_init();
408+ r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
408409
409410 r8a7779_add_standard_devices();
410411 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
arch/arm/mach-shmobile/clock-r8a73a4.c+17−5
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #define CPG_LEN 0x270
3030
3131 #define SMSTPCR2 0xe6150138
32+#define SMSTPCR3 0xe615013c
3233 #define SMSTPCR5 0xe6150144
3334
3435 #define FRQCRA 0xE6150000
@@ -348,6 +349,7 @@ static struct clk div6_clks[DIV6_NR] = { · 313 unmodified lines
348349 /* MSTP */
349350 enum {
350351 MSTP217, MSTP216, MSTP207, MSTP206, MSTP204, MSTP203,
352+ MSTP315, MSTP314, MSTP313, MSTP312, MSTP305,
351353 MSTP522,
352354 MSTP_NR
353355 };
@@ -359,6 +361,11 @@ static struct clk mstp_clks[MSTP_NR] = { · 5 unmodified lines
359361 [MSTP207] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 7, 0), /* SCIFB1 */
360362 [MSTP216] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 16, 0), /* SCIFB2 */
361363 [MSTP217] = SH_CLK_MSTP32(&div6_clks[DIV6_MP], SMSTPCR2, 17, 0), /* SCIFB3 */
364+ [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1],SMSTPCR3, 5, 0), /* MMCIF1 */
365+ [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI2],SMSTPCR3, 12, 0), /* SDHI2 */
366+ [MSTP313] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI1],SMSTPCR3, 13, 0), /* SDHI1 */
367+ [MSTP314] = SH_CLK_MSTP32(&div6_clks[DIV6_SDHI0],SMSTPCR3, 14, 0), /* SDHI0 */
368+ [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0],SMSTPCR3, 15, 0), /* MMCIF0 */
362369 [MSTP522] = SH_CLK_MSTP32(&extal2_clk, SMSTPCR5, 22, 0), /* Thermal */
363370 };
364371
@@ -381,11 +388,6 @@ static struct clk_lookup lookups[] = { · 16 unmodified lines
381388
382389 /* DIV6 */
383390 CLKDEV_CON_ID("zb", &div6_clks[DIV6_ZB]),
384− CLKDEV_CON_ID("sdhi0", &div6_clks[DIV6_SDHI0]),
385− CLKDEV_CON_ID("sdhi1", &div6_clks[DIV6_SDHI1]),
386− CLKDEV_CON_ID("sdhi2", &div6_clks[DIV6_SDHI2]),
387− CLKDEV_CON_ID("mmc0", &div6_clks[DIV6_MMC0]),
388− CLKDEV_CON_ID("mmc1", &div6_clks[DIV6_MMC1]),
389391 CLKDEV_CON_ID("vck1", &div6_clks[DIV6_VCK1]),
390392 CLKDEV_CON_ID("vck2", &div6_clks[DIV6_VCK2]),
391393 CLKDEV_CON_ID("vck3", &div6_clks[DIV6_VCK3]),
@@ -406,6 +408,16 @@ static struct clk_lookup lookups[] = { · 14 unmodified lines
406408 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]),
407409 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP217]),
408410 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
411+ CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
412+ CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
413+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
414+ CLKDEV_DEV_ID("ee140000.sdhi", &mstp_clks[MSTP312]),
415+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
416+ CLKDEV_DEV_ID("ee120000.sdhi", &mstp_clks[MSTP313]),
417+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
418+ CLKDEV_DEV_ID("ee100000.sdhi", &mstp_clks[MSTP314]),
419+ CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
420+ CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
409421
410422 /* for DT */
411423 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
arch/arm/mach-shmobile/clock-r8a7778.c+22−1
@@ -103,17 +103,25 @@ static struct clk *main_clks[] = { · 102 unmodified lines
103103 };
104104
105105 enum {
106+ MSTP331,
106107 MSTP323, MSTP322, MSTP321,
107108 MSTP114,
108− MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
109+ MSTP030,
110+ MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
109111 MSTP016, MSTP015,
112+ MSTP007,
110113 MSTP_NR };
111114
112115 static struct clk mstp_clks[MSTP_NR] = {
116+ [MSTP331] = SH_CLK_MSTP32(&s4_clk, MSTPCR3, 31, 0), /* MMC */
113117 [MSTP323] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 23, 0), /* SDHI0 */
114118 [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */
115119 [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */
116120 [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */
121+ [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */
122+ [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */
123+ [MSTP028] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 28, 0), /* I2C2 */
124+ [MSTP027] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 27, 0), /* I2C3 */
117125 [MSTP026] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 26, 0), /* SCIF0 */
118126 [MSTP025] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 25, 0), /* SCIF1 */
119127 [MSTP024] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 24, 0), /* SCIF2 */
@@ -122,14 +130,24 @@ static struct clk mstp_clks[MSTP_NR] = { · 2 unmodified lines
122130 [MSTP021] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 21, 0), /* SCIF5 */
123131 [MSTP016] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 16, 0), /* TMU0 */
124132 [MSTP015] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 15, 0), /* TMU1 */
133+ [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */
125134 };
126135
127136 static struct clk_lookup lookups[] = {
137+ /* main */
138+ CLKDEV_CON_ID("shyway_clk", &s_clk),
139+ CLKDEV_CON_ID("peripheral_clk", &p_clk),
140+
128141 /* MSTP32 clocks */
142+ CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP331]), /* MMC */
129143 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */
130144 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
131145 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
132146 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP114]), /* Ether */
147+ CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
148+ CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
149+ CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP028]), /* I2C2 */
150+ CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */
133151 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */
134152 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */
135153 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */
@@ -138,6 +156,9 @@ static struct clk_lookup lookups[] = { · 2 unmodified lines
138156 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
139157 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
140158 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
159+ CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
160+ CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
161+ CLKDEV_DEV_ID("sh-hspi.2", &mstp_clks[MSTP007]), /* HSPI2 */
141162 };
142163
143164 void __init r8a7778_clock_init(void)
arch/arm/mach-shmobile/clock-r8a7790.c+24−7
@@ -181,7 +181,8 @@ static struct clk div6_clks[DIV6_NR] = { · 180 unmodified lines
181181 /* MSTP */
182182 enum {
183183 MSTP721, MSTP720,
184− MSTP304,
184+ MSTP717, MSTP716,
185+ MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
185186 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
186187 MSTP_NR
187188 };
@@ -189,6 +190,12 @@ enum { · 1 unmodified line
189190 static struct clk mstp_clks[MSTP_NR] = {
190191 [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
191192 [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
193+ [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* MMC0 */
194+ [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* SDHI0 */
195+ [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_SD1], SMSTPCR3, 13, 0), /* SDHI1 */
196+ [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SD2], SMSTPCR3, 12, 0), /* SDHI2 */
197+ [MSTP311] = SH_CLK_MSTP32(&div6_clks[DIV6_SD3], SMSTPCR3, 11, 0), /* SDHI3 */
198+ [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1], SMSTPCR3, 5, 0), /* MMC1 */
192199 [MSTP304] = SH_CLK_MSTP32(&cp_clk, SMSTPCR3, 4, 0), /* TPU0 */
193200 [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
194201 [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */
@@ -196,6 +203,8 @@ static struct clk mstp_clks[MSTP_NR] = { · 1 unmodified line
196203 [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
197204 [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
198205 [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
206+ [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
207+ [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
199208 };
200209
201210 static struct clk_lookup lookups[] = {
@@ -229,14 +238,8 @@ static struct clk_lookup lookups[] = { · 27 unmodified lines
229238
230239 /* DIV4 */
231240 CLKDEV_CON_ID("sdh", &div4_clks[DIV4_SDH]),
232− CLKDEV_CON_ID("sd0", &div4_clks[DIV4_SD0]),
233− CLKDEV_CON_ID("sd1", &div4_clks[DIV4_SD1]),
234241
235242 /* DIV6 */
236− CLKDEV_CON_ID("sd2", &div6_clks[DIV6_SD2]),
237− CLKDEV_CON_ID("sd3", &div6_clks[DIV6_SD3]),
238− CLKDEV_CON_ID("mmc0", &div6_clks[DIV6_MMC0]),
239− CLKDEV_CON_ID("mmc1", &div6_clks[DIV6_MMC1]),
240243 CLKDEV_CON_ID("ssp", &div6_clks[DIV6_SSP]),
241244 CLKDEV_CON_ID("ssprs", &div6_clks[DIV6_SSPRS]),
242245
@@ -249,6 +252,20 @@ static struct clk_lookup lookups[] = { · 6 unmodified lines
249252 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP202]),
250253 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP721]),
251254 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
255+ CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
256+ CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
257+ CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
258+ CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
259+ CLKDEV_DEV_ID("ee100000.sdhi", &mstp_clks[MSTP314]),
260+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
261+ CLKDEV_DEV_ID("ee120000.sdhi", &mstp_clks[MSTP313]),
262+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
263+ CLKDEV_DEV_ID("ee140000.sdhi", &mstp_clks[MSTP312]),
264+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
265+ CLKDEV_DEV_ID("ee160000.sdhi", &mstp_clks[MSTP311]),
266+ CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]),
267+ CLKDEV_DEV_ID("ee220000.mmcif", &mstp_clks[MSTP305]),
268+ CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
252269 };
253270
254271 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
arch/arm/mach-shmobile/include/mach/r8a7778.h+5−0
@@ -18,12 +18,17 @@ · 17 unmodified lines
1818 #ifndef __ASM_R8A7778_H__
1919 #define __ASM_R8A7778_H__
2020
21+#include <linux/mmc/sh_mmcif.h>
2122 #include <linux/mmc/sh_mobile_sdhi.h>
2223 #include <linux/sh_eth.h>
2324
2425 extern void r8a7778_add_standard_devices(void);
2526 extern void r8a7778_add_standard_devices_dt(void);
2627 extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
28+extern void r8a7778_add_i2c_device(int id);
29+extern void r8a7778_add_hspi_device(int id);
30+extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
31+
2732 extern void r8a7778_init_delay(void);
2833 extern void r8a7778_init_irq(void);
2934 extern void r8a7778_init_irq_dt(void);
arch/arm/mach-shmobile/setup-r8a7778.c+62−1
@@ -97,7 +97,7 @@ static struct resource ether_resources[] = { · 96 unmodified lines
9797
9898 void __init r8a7778_add_ether_device(struct sh_eth_plat_data *pdata)
9999 {
100− platform_device_register_resndata(&platform_bus, "sh_eth", -1,
100+ platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
101101 ether_resources,
102102 ARRAY_SIZE(ether_resources),
103103 pdata, sizeof(*pdata));
@@ -173,6 +173,67 @@ void __init r8a7778_sdhi_init(int id, · 69 unmodified lines
173173 info, sizeof(*info));
174174 }
175175
176+/* I2C */
177+static struct resource i2c_resources[] __initdata = {
178+ /* I2C0 */
179+ DEFINE_RES_MEM(0xffc70000, 0x1000),
180+ DEFINE_RES_IRQ(gic_iid(0x63)),
181+ /* I2C1 */
182+ DEFINE_RES_MEM(0xffc71000, 0x1000),
183+ DEFINE_RES_IRQ(gic_iid(0x6e)),
184+ /* I2C2 */
185+ DEFINE_RES_MEM(0xffc72000, 0x1000),
186+ DEFINE_RES_IRQ(gic_iid(0x6c)),
187+ /* I2C3 */
188+ DEFINE_RES_MEM(0xffc73000, 0x1000),
189+ DEFINE_RES_IRQ(gic_iid(0x6d)),
190+};
191+
192+void __init r8a7778_add_i2c_device(int id)
193+{
194+ BUG_ON(id < 0 || id > 3);
195+
196+ platform_device_register_simple(
197+ "i2c-rcar", id,
198+ i2c_resources + (2 * id), 2);
199+}
200+
201+/* HSPI */
202+static struct resource hspi_resources[] __initdata = {
203+ /* HSPI0 */
204+ DEFINE_RES_MEM(0xfffc7000, 0x18),
205+ DEFINE_RES_IRQ(gic_iid(0x5f)),
206+ /* HSPI1 */
207+ DEFINE_RES_MEM(0xfffc8000, 0x18),
208+ DEFINE_RES_IRQ(gic_iid(0x74)),
209+ /* HSPI2 */
210+ DEFINE_RES_MEM(0xfffc6000, 0x18),
211+ DEFINE_RES_IRQ(gic_iid(0x75)),
212+};
213+
214+void __init r8a7778_add_hspi_device(int id)
215+{
216+ BUG_ON(id < 0 || id > 2);
217+
218+ platform_device_register_simple(
219+ "sh-hspi", id,
220+ hspi_resources + (2 * id), 2);
221+}
222+
223+/* MMC */
224+static struct resource mmc_resources[] __initdata = {
225+ DEFINE_RES_MEM(0xffe4e000, 0x100),
226+ DEFINE_RES_IRQ(gic_iid(0x5d)),
227+};
228+
229+void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
230+{
231+ platform_device_register_resndata(
232+ &platform_bus, "sh_mmcif", -1,
233+ mmc_resources, ARRAY_SIZE(mmc_resources),
234+ info, sizeof(*info));
235+}
236+
176237 void __init r8a7778_add_standard_devices(void)
177238 {
178239 int i;
arch/arm/mach-shmobile/setup-r8a7779.c+1−1
@@ -432,7 +432,7 @@ void __init r8a7779_add_standard_devices(void) · 431 unmodified lines
432432
433433 void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
434434 {
435− platform_device_register_resndata(&platform_bus, "sh_eth", -1,
435+ platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
436436 ether_resources,
437437 ARRAY_SIZE(ether_resources),
438438 pdata, sizeof(*pdata));