2 * KZM-A9-GT board support
4 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <linux/delay.h>
21 #include <linux/gpio.h>
22 #include <linux/gpio_keys.h>
24 #include <linux/irq.h>
25 #include <linux/i2c.h>
26 #include <linux/i2c/pcf857x.h>
27 #include <linux/input.h>
28 #include <linux/irqchip/arm-gic.h>
29 #include <linux/mmc/host.h>
30 #include <linux/mmc/sh_mmcif.h>
31 #include <linux/mmc/sh_mobile_sdhi.h>
32 #include <linux/mfd/as3711.h>
33 #include <linux/mfd/tmio.h>
34 #include <linux/pinctrl/machine.h>
35 #include <linux/pinctrl/pinconf-generic.h>
36 #include <linux/platform_device.h>
37 #include <linux/reboot.h>
38 #include <linux/regulator/fixed.h>
39 #include <linux/regulator/machine.h>
40 #include <linux/smsc911x.h>
41 #include <linux/usb/r8a66597.h>
42 #include <linux/usb/renesas_usbhs.h>
43 #include <linux/videodev2.h>
45 #include <sound/sh_fsi.h>
46 #include <sound/simple_card.h>
47 #include <asm/hardware/cache-l2x0.h>
48 #include <asm/mach-types.h>
49 #include <asm/mach/arch.h>
50 #include <video/sh_mobile_lcdc.h>
59 #define GPIO_PCF8575_BASE (310)
60 #define GPIO_PCF8575_PORT10 (GPIO_PCF8575_BASE + 8)
61 #define GPIO_PCF8575_PORT11 (GPIO_PCF8575_BASE + 9)
62 #define GPIO_PCF8575_PORT12 (GPIO_PCF8575_BASE + 10)
63 #define GPIO_PCF8575_PORT13 (GPIO_PCF8575_BASE + 11)
64 #define GPIO_PCF8575_PORT14 (GPIO_PCF8575_BASE + 12)
65 #define GPIO_PCF8575_PORT15 (GPIO_PCF8575_BASE + 13)
66 #define GPIO_PCF8575_PORT16 (GPIO_PCF8575_BASE + 14)
68 /* Dummy supplies, where voltage doesn't matter */
69 static struct regulator_consumer_supply dummy_supplies[] = {
70 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
71 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
77 * this command is required when playback.
79 * # amixer set "LINEOUT Mixer DACL" on
83 static struct resource smsc9221_resources[] = {
85 .start = 0x10000000, /* CS4 */
87 .flags = IORESOURCE_MEM,
90 .start = irq_pin(3), /* IRQ3 */
91 .flags = IORESOURCE_IRQ,
95 static struct smsc911x_platform_config smsc9221_platdata = {
96 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
97 .phy_interface = PHY_INTERFACE_MODE_MII,
98 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
99 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
102 static struct platform_device smsc_device = {
105 .platform_data = &smsc9221_platdata,
107 .resource = smsc9221_resources,
108 .num_resources = ARRAY_SIZE(smsc9221_resources),
111 /* USB external chip */
112 static struct r8a66597_platdata usb_host_data = {
114 .xtal = R8A66597_PLATDATA_XTAL_48MHZ,
117 static struct resource usb_resources[] = {
120 .end = 0x1001ffff - 1,
121 .flags = IORESOURCE_MEM,
124 .start = irq_pin(1), /* IRQ1 */
125 .flags = IORESOURCE_IRQ,
129 static struct platform_device usb_host_device = {
130 .name = "r8a66597_hcd",
132 .platform_data = &usb_host_data,
134 .coherent_dma_mask = 0xffffffff,
136 .num_resources = ARRAY_SIZE(usb_resources),
137 .resource = usb_resources,
141 struct usbhs_private {
144 struct renesas_usbhs_platform_info info;
147 #define IRQ15 irq_pin(15)
148 #define USB_PHY_MODE (1 << 4)
149 #define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
150 #define USB_PHY_ON (1 << 1)
151 #define USB_PHY_OFF (1 << 0)
152 #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF)
154 #define usbhs_get_priv(pdev) \
155 container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
157 static int usbhs_get_vbus(struct platform_device *pdev)
159 struct usbhs_private *priv = usbhs_get_priv(pdev);
161 return !((1 << 7) & __raw_readw(priv->cr2));
164 static int usbhs_phy_reset(struct platform_device *pdev)
166 struct usbhs_private *priv = usbhs_get_priv(pdev);
169 __raw_writew(0x8a0a, priv->cr2);
174 static int usbhs_get_id(struct platform_device *pdev)
179 static irqreturn_t usbhs_interrupt(int irq, void *data)
181 struct platform_device *pdev = data;
182 struct usbhs_private *priv = usbhs_get_priv(pdev);
184 renesas_usbhs_call_notify_hotplug(pdev);
187 __raw_writew(__raw_readw(priv->phy) | USB_PHY_INT_CLR, priv->phy);
192 static int usbhs_hardware_init(struct platform_device *pdev)
194 struct usbhs_private *priv = usbhs_get_priv(pdev);
197 /* clear interrupt status */
198 __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy);
200 ret = request_irq(IRQ15, usbhs_interrupt, IRQF_TRIGGER_HIGH,
201 dev_name(&pdev->dev), pdev);
203 dev_err(&pdev->dev, "request_irq err\n");
207 /* enable USB phy interrupt */
208 __raw_writew(USB_PHY_MODE | USB_PHY_INT_EN, priv->phy);
213 static int usbhs_hardware_exit(struct platform_device *pdev)
215 struct usbhs_private *priv = usbhs_get_priv(pdev);
217 /* clear interrupt status */
218 __raw_writew(USB_PHY_MODE | USB_PHY_INT_CLR, priv->phy);
220 free_irq(IRQ15, pdev);
225 static u32 usbhs_pipe_cfg[] = {
226 USB_ENDPOINT_XFER_CONTROL,
227 USB_ENDPOINT_XFER_ISOC,
228 USB_ENDPOINT_XFER_ISOC,
229 USB_ENDPOINT_XFER_BULK,
230 USB_ENDPOINT_XFER_BULK,
231 USB_ENDPOINT_XFER_BULK,
232 USB_ENDPOINT_XFER_INT,
233 USB_ENDPOINT_XFER_INT,
234 USB_ENDPOINT_XFER_INT,
235 USB_ENDPOINT_XFER_BULK,
236 USB_ENDPOINT_XFER_BULK,
237 USB_ENDPOINT_XFER_BULK,
238 USB_ENDPOINT_XFER_BULK,
239 USB_ENDPOINT_XFER_BULK,
240 USB_ENDPOINT_XFER_BULK,
241 USB_ENDPOINT_XFER_BULK,
244 static struct usbhs_private usbhs_private = {
245 .phy = IOMEM(0xe60781e0), /* USBPHYINT */
246 .cr2 = IOMEM(0xe605810c), /* USBCR2 */
248 .platform_callback = {
249 .hardware_init = usbhs_hardware_init,
250 .hardware_exit = usbhs_hardware_exit,
251 .get_id = usbhs_get_id,
252 .phy_reset = usbhs_phy_reset,
253 .get_vbus = usbhs_get_vbus,
258 .pipe_type = usbhs_pipe_cfg,
259 .pipe_size = ARRAY_SIZE(usbhs_pipe_cfg),
264 static struct resource usbhs_resources[] = {
267 .end = 0xE68900e6 - 1,
268 .flags = IORESOURCE_MEM,
271 .start = gic_spi(62),
273 .flags = IORESOURCE_IRQ,
277 static struct platform_device usbhs_device = {
278 .name = "renesas_usbhs",
282 .coherent_dma_mask = 0xffffffff,
283 .platform_data = &usbhs_private.info,
285 .num_resources = ARRAY_SIZE(usbhs_resources),
286 .resource = usbhs_resources,
290 static struct fb_videomode kzm_lcdc_mode = {
291 .name = "WVGA Panel",
303 static struct sh_mobile_lcdc_info lcdc_info = {
304 .clock_source = LCDC_CLK_BUS,
306 .chan = LCDC_CHAN_MAINLCD,
307 .fourcc = V4L2_PIX_FMT_RGB565,
308 .interface_type = RGB24,
309 .lcd_modes = &kzm_lcdc_mode,
320 static struct resource lcdc_resources[] = {
325 .flags = IORESOURCE_MEM,
328 .start = intcs_evt2irq(0x580),
329 .flags = IORESOURCE_IRQ,
333 static struct platform_device lcdc_device = {
334 .name = "sh_mobile_lcdc_fb",
335 .num_resources = ARRAY_SIZE(lcdc_resources),
336 .resource = lcdc_resources,
338 .platform_data = &lcdc_info,
339 .coherent_dma_mask = DMA_BIT_MASK(32),
343 /* Fixed 1.8V regulator to be used by MMCIF */
344 static struct regulator_consumer_supply fixed1v8_power_consumers[] =
346 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
347 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
351 static struct resource sh_mmcif_resources[] = {
356 .flags = IORESOURCE_MEM,
359 .start = gic_spi(140),
360 .flags = IORESOURCE_IRQ,
363 .start = gic_spi(141),
364 .flags = IORESOURCE_IRQ,
368 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
369 .ocr = MMC_VDD_165_195,
370 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
371 .ccs_unsupported = true,
372 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
373 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
376 static struct platform_device mmc_device = {
380 .coherent_dma_mask = 0xffffffff,
381 .platform_data = &sh_mmcif_platdata,
383 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
384 .resource = sh_mmcif_resources,
387 /* Fixed 3.3V regulators to be used by SDHI0 */
388 static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
390 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
393 static struct regulator_init_data vcc_sdhi0_init_data = {
395 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
397 .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers),
398 .consumer_supplies = vcc_sdhi0_consumers,
401 static struct fixed_voltage_config vcc_sdhi0_info = {
402 .supply_name = "SDHI0 Vcc",
403 .microvolts = 3300000,
406 .init_data = &vcc_sdhi0_init_data,
409 static struct platform_device vcc_sdhi0 = {
410 .name = "reg-fixed-voltage",
413 .platform_data = &vcc_sdhi0_info,
417 /* Fixed 3.3V regulators to be used by SDHI2 */
418 static struct regulator_consumer_supply vcc_sdhi2_consumers[] =
420 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"),
423 static struct regulator_init_data vcc_sdhi2_init_data = {
425 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
427 .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi2_consumers),
428 .consumer_supplies = vcc_sdhi2_consumers,
431 static struct fixed_voltage_config vcc_sdhi2_info = {
432 .supply_name = "SDHI2 Vcc",
433 .microvolts = 3300000,
436 .init_data = &vcc_sdhi2_init_data,
439 static struct platform_device vcc_sdhi2 = {
440 .name = "reg-fixed-voltage",
443 .platform_data = &vcc_sdhi2_info,
448 static struct sh_mobile_sdhi_info sdhi0_info = {
449 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
450 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
451 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
452 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
453 MMC_CAP_POWER_OFF_CARD,
456 static struct resource sdhi0_resources[] = {
461 .flags = IORESOURCE_MEM,
464 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
465 .start = gic_spi(83),
466 .flags = IORESOURCE_IRQ,
469 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
470 .start = gic_spi(84),
471 .flags = IORESOURCE_IRQ,
474 .name = SH_MOBILE_SDHI_IRQ_SDIO,
475 .start = gic_spi(85),
476 .flags = IORESOURCE_IRQ,
480 static struct platform_device sdhi0_device = {
481 .name = "sh_mobile_sdhi",
482 .num_resources = ARRAY_SIZE(sdhi0_resources),
483 .resource = sdhi0_resources,
485 .platform_data = &sdhi0_info,
490 static struct sh_mobile_sdhi_info sdhi2_info = {
491 .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
492 .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
493 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
494 TMIO_MMC_USE_GPIO_CD |
495 TMIO_MMC_WRPROTECT_DISABLE,
496 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_POWER_OFF_CARD,
500 static struct resource sdhi2_resources[] = {
505 .flags = IORESOURCE_MEM,
508 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
509 .start = gic_spi(103),
510 .flags = IORESOURCE_IRQ,
513 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
514 .start = gic_spi(104),
515 .flags = IORESOURCE_IRQ,
518 .name = SH_MOBILE_SDHI_IRQ_SDIO,
519 .start = gic_spi(105),
520 .flags = IORESOURCE_IRQ,
524 static struct platform_device sdhi2_device = {
525 .name = "sh_mobile_sdhi",
527 .num_resources = ARRAY_SIZE(sdhi2_resources),
528 .resource = sdhi2_resources,
530 .platform_data = &sdhi2_info,
535 #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
537 static struct gpio_keys_button gpio_buttons[] = {
538 GPIO_KEY(KEY_BACK, GPIO_PCF8575_PORT10, "SW3"),
539 GPIO_KEY(KEY_RIGHT, GPIO_PCF8575_PORT11, "SW2-R"),
540 GPIO_KEY(KEY_LEFT, GPIO_PCF8575_PORT12, "SW2-L"),
541 GPIO_KEY(KEY_ENTER, GPIO_PCF8575_PORT13, "SW2-P"),
542 GPIO_KEY(KEY_UP, GPIO_PCF8575_PORT14, "SW2-U"),
543 GPIO_KEY(KEY_DOWN, GPIO_PCF8575_PORT15, "SW2-D"),
544 GPIO_KEY(KEY_HOME, GPIO_PCF8575_PORT16, "SW1"),
547 static struct gpio_keys_platform_data gpio_key_info = {
548 .buttons = gpio_buttons,
549 .nbuttons = ARRAY_SIZE(gpio_buttons),
552 static struct platform_device gpio_keys_device = {
555 .platform_data = &gpio_key_info,
560 static struct sh_fsi_platform_info fsi_info = {
562 .tx_id = SHDMA_SLAVE_FSI2A_TX,
566 static struct resource fsi_resources[] = {
570 .end = 0xEC230400 - 1,
571 .flags = IORESOURCE_MEM,
574 .start = gic_spi(146),
575 .flags = IORESOURCE_IRQ,
579 static struct platform_device fsi_device = {
582 .num_resources = ARRAY_SIZE(fsi_resources),
583 .resource = fsi_resources,
585 .platform_data = &fsi_info,
589 static struct asoc_simple_card_info fsi2_ak4648_info = {
591 .card = "FSI2A-AK4648",
592 .codec = "ak4642-codec.0-0012",
593 .platform = "sh_fsi2",
594 .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
599 .name = "ak4642-hifi",
604 static struct platform_device fsi_ak4648_device = {
605 .name = "asoc-simple-card",
607 .platform_data = &fsi2_ak4648_info,
608 .coherent_dma_mask = DMA_BIT_MASK(32),
609 .dma_mask = &fsi_ak4648_device.dev.coherent_dma_mask,
615 /* StepDown1 is used to supply 1.315V to the CPU */
616 static struct regulator_init_data as3711_sd1 = {
618 .name = "1.315V CPU",
626 /* StepDown2 is used to supply 1.8V to the CPU and to the board */
627 static struct regulator_init_data as3711_sd2 = {
638 * StepDown3 is switched in parallel with StepDown2, seems to be off,
639 * according to read-back pre-set register values
642 /* StepDown4 is used to supply 1.215V to the CPU and to the board */
643 static struct regulator_init_data as3711_sd4 = {
653 /* LDO1 is unused and unconnected */
655 /* LDO2 is used to supply 2.8V to the CPU */
656 static struct regulator_init_data as3711_ldo2 = {
666 /* LDO3 is used to supply 3.0V to the CPU */
667 static struct regulator_init_data as3711_ldo3 = {
677 /* LDO4 is used to supply 2.8V to the board */
678 static struct regulator_init_data as3711_ldo4 = {
688 /* LDO5 is switched parallel to LDO4, also set to 2.8V */
689 static struct regulator_init_data as3711_ldo5 = {
699 /* LDO6 is unused and unconnected */
701 /* LDO7 is used to supply 1.15V to the CPU */
702 static struct regulator_init_data as3711_ldo7 = {
712 /* LDO8 is switched parallel to LDO7, also set to 1.15V */
713 static struct regulator_init_data as3711_ldo8 = {
715 .name = "1.15V CPU #2",
723 static struct as3711_platform_data as3711_pdata = {
726 [AS3711_REGULATOR_SD_1] = &as3711_sd1,
727 [AS3711_REGULATOR_SD_2] = &as3711_sd2,
728 [AS3711_REGULATOR_SD_4] = &as3711_sd4,
729 [AS3711_REGULATOR_LDO_2] = &as3711_ldo2,
730 [AS3711_REGULATOR_LDO_3] = &as3711_ldo3,
731 [AS3711_REGULATOR_LDO_4] = &as3711_ldo4,
732 [AS3711_REGULATOR_LDO_5] = &as3711_ldo5,
733 [AS3711_REGULATOR_LDO_7] = &as3711_ldo7,
734 [AS3711_REGULATOR_LDO_8] = &as3711_ldo8,
738 .su2_fb = "sh_mobile_lcdc_fb.0",
740 .su2_feedback = AS3711_SU2_CURR_AUTO,
741 .su2_fbprot = AS3711_SU2_GPIO4,
742 .su2_auto_curr1 = true,
743 .su2_auto_curr2 = true,
744 .su2_auto_curr3 = true,
748 static struct pcf857x_platform_data pcf8575_pdata = {
749 .gpio_base = GPIO_PCF8575_BASE,
752 static struct i2c_board_info i2c0_devices[] = {
754 I2C_BOARD_INFO("ak4648", 0x12),
757 I2C_BOARD_INFO("r2025sd", 0x32),
760 I2C_BOARD_INFO("ak8975", 0x0c),
761 .irq = irq_pin(28), /* IRQ28 */
764 I2C_BOARD_INFO("adxl34x", 0x1d),
765 .irq = irq_pin(26), /* IRQ26 */
768 I2C_BOARD_INFO("as3711", 0x40),
769 .irq = intcs_evt2irq(0x3300), /* IRQ24 */
770 .platform_data = &as3711_pdata,
774 static struct i2c_board_info i2c1_devices[] = {
776 I2C_BOARD_INFO("st1232-ts", 0x55),
777 .irq = irq_pin(8), /* IRQ8 */
781 static struct i2c_board_info i2c3_devices[] = {
783 I2C_BOARD_INFO("pcf8575", 0x20),
784 .irq = irq_pin(19), /* IRQ19 */
785 .platform_data = &pcf8575_pdata,
789 static struct platform_device *kzm_devices[] __initdata = {
804 static unsigned long pin_pullup_conf[] = {
805 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
808 static const struct pinctrl_map kzm_pinctrl_map[] = {
810 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0",
811 "fsia_mclk_in", "fsia"),
812 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0",
813 "fsia_sclk_in", "fsia"),
814 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0",
815 "fsia_data_in", "fsia"),
816 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2", "pfc-sh73a0",
817 "fsia_data_out", "fsia"),
819 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
822 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0",
823 "lcd_data24", "lcd"),
824 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0",
827 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
828 "mmc0_data8_0", "mmc0"),
829 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
830 "mmc0_ctrl_0", "mmc0"),
831 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
832 "PORT279", pin_pullup_conf),
833 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
834 "mmc0_data8_0", pin_pullup_conf),
836 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
837 "scifa4_data", "scifa4"),
838 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
839 "scifa4_ctrl", "scifa4"),
841 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
842 "sdhi0_data4", "sdhi0"),
843 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
844 "sdhi0_ctrl", "sdhi0"),
845 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
846 "sdhi0_cd", "sdhi0"),
847 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
848 "sdhi0_wp", "sdhi0"),
850 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
851 "sdhi2_data4", "sdhi2"),
852 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
853 "sdhi2_ctrl", "sdhi2"),
855 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
858 PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-sh73a0",
862 static void __init kzm_init(void)
864 regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers,
865 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
866 regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
868 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
870 sh73a0_pinmux_init();
873 gpio_request_one(224, GPIOF_IN, NULL); /* IRQ3 */
876 gpio_request_one(222, GPIOF_OUT_INIT_HIGH, NULL); /* LCDCDON */
877 gpio_request_one(226, GPIOF_OUT_INIT_HIGH, NULL); /* SC */
880 gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */
882 #ifdef CONFIG_CACHE_L2X0
883 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
884 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
887 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
888 i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
889 i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));
891 sh73a0_add_standard_devices();
892 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
897 static void kzm9g_restart(enum reboot_mode mode, const char *cmd)
899 #define RESCNT2 IOMEM(0xe6188020)
900 /* Do soft power on reset */
901 writel((1 << 31), RESCNT2);
904 static const char *kzm9g_boards_compat_dt[] __initdata = {
909 DT_MACHINE_START(KZM9G_DT, "kzm9g")
910 .smp = smp_ops(sh73a0_smp_ops),
911 .map_io = sh73a0_map_io,
912 .init_early = sh73a0_add_early_devices,
913 .nr_irqs = NR_IRQS_LEGACY,
914 .init_irq = sh73a0_init_irq,
915 .init_machine = kzm_init,
916 .init_late = shmobile_init_late,
917 .init_time = sh73a0_earlytimer_init,
918 .restart = kzm9g_restart,
919 .dt_compat = kzm9g_boards_compat_dt,