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/tmio.h>
33 #include <linux/pinctrl/machine.h>
34 #include <linux/pinctrl/pinconf-generic.h>
35 #include <linux/platform_device.h>
36 #include <linux/regulator/fixed.h>
37 #include <linux/regulator/machine.h>
38 #include <linux/smsc911x.h>
39 #include <linux/usb/r8a66597.h>
40 #include <linux/usb/renesas_usbhs.h>
41 #include <linux/videodev2.h>
42 #include <sound/sh_fsi.h>
43 #include <sound/simple_card.h>
44 #include <mach/irqs.h>
45 #include <mach/sh73a0.h>
46 #include <mach/common.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>
55 #define GPIO_PCF8575_BASE (GPIO_NR)
56 #define GPIO_PCF8575_PORT10 (GPIO_NR + 8)
57 #define GPIO_PCF8575_PORT11 (GPIO_NR + 9)
58 #define GPIO_PCF8575_PORT12 (GPIO_NR + 10)
59 #define GPIO_PCF8575_PORT13 (GPIO_NR + 11)
60 #define GPIO_PCF8575_PORT14 (GPIO_NR + 12)
61 #define GPIO_PCF8575_PORT15 (GPIO_NR + 13)
62 #define GPIO_PCF8575_PORT16 (GPIO_NR + 14)
64 /* Dummy supplies, where voltage doesn't matter */
65 static struct regulator_consumer_supply dummy_supplies
[] = {
66 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
67 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
73 * this command is required when playback.
75 * # amixer set "LINEOUT Mixer DACL" on
79 static struct resource smsc9221_resources
[] = {
81 .start
= 0x10000000, /* CS4 */
83 .flags
= IORESOURCE_MEM
,
86 .start
= irq_pin(3), /* IRQ3 */
87 .flags
= IORESOURCE_IRQ
,
91 static struct smsc911x_platform_config smsc9221_platdata
= {
92 .flags
= SMSC911X_USE_32BIT
| SMSC911X_SAVE_MAC_ADDRESS
,
93 .phy_interface
= PHY_INTERFACE_MODE_MII
,
94 .irq_polarity
= SMSC911X_IRQ_POLARITY_ACTIVE_LOW
,
95 .irq_type
= SMSC911X_IRQ_TYPE_PUSH_PULL
,
98 static struct platform_device smsc_device
= {
101 .platform_data
= &smsc9221_platdata
,
103 .resource
= smsc9221_resources
,
104 .num_resources
= ARRAY_SIZE(smsc9221_resources
),
107 /* USB external chip */
108 static struct r8a66597_platdata usb_host_data
= {
110 .xtal
= R8A66597_PLATDATA_XTAL_48MHZ
,
113 static struct resource usb_resources
[] = {
116 .end
= 0x1001ffff - 1,
117 .flags
= IORESOURCE_MEM
,
120 .start
= irq_pin(1), /* IRQ1 */
121 .flags
= IORESOURCE_IRQ
,
125 static struct platform_device usb_host_device
= {
126 .name
= "r8a66597_hcd",
128 .platform_data
= &usb_host_data
,
130 .coherent_dma_mask
= 0xffffffff,
132 .num_resources
= ARRAY_SIZE(usb_resources
),
133 .resource
= usb_resources
,
137 struct usbhs_private
{
140 struct renesas_usbhs_platform_info info
;
143 #define IRQ15 irq_pin(15)
144 #define USB_PHY_MODE (1 << 4)
145 #define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
146 #define USB_PHY_ON (1 << 1)
147 #define USB_PHY_OFF (1 << 0)
148 #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF)
150 #define usbhs_get_priv(pdev) \
151 container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
153 static int usbhs_get_vbus(struct platform_device
*pdev
)
155 struct usbhs_private
*priv
= usbhs_get_priv(pdev
);
157 return !((1 << 7) & __raw_readw(priv
->cr2
));
160 static int usbhs_phy_reset(struct platform_device
*pdev
)
162 struct usbhs_private
*priv
= usbhs_get_priv(pdev
);
165 __raw_writew(0x8a0a, priv
->cr2
);
170 static int usbhs_get_id(struct platform_device
*pdev
)
175 static irqreturn_t
usbhs_interrupt(int irq
, void *data
)
177 struct platform_device
*pdev
= data
;
178 struct usbhs_private
*priv
= usbhs_get_priv(pdev
);
180 renesas_usbhs_call_notify_hotplug(pdev
);
183 __raw_writew(__raw_readw(priv
->phy
) | USB_PHY_INT_CLR
, priv
->phy
);
188 static int usbhs_hardware_init(struct platform_device
*pdev
)
190 struct usbhs_private
*priv
= usbhs_get_priv(pdev
);
193 /* clear interrupt status */
194 __raw_writew(USB_PHY_MODE
| USB_PHY_INT_CLR
, priv
->phy
);
196 ret
= request_irq(IRQ15
, usbhs_interrupt
, IRQF_TRIGGER_HIGH
,
197 dev_name(&pdev
->dev
), pdev
);
199 dev_err(&pdev
->dev
, "request_irq err\n");
203 /* enable USB phy interrupt */
204 __raw_writew(USB_PHY_MODE
| USB_PHY_INT_EN
, priv
->phy
);
209 static int usbhs_hardware_exit(struct platform_device
*pdev
)
211 struct usbhs_private
*priv
= usbhs_get_priv(pdev
);
213 /* clear interrupt status */
214 __raw_writew(USB_PHY_MODE
| USB_PHY_INT_CLR
, priv
->phy
);
216 free_irq(IRQ15
, pdev
);
221 static u32 usbhs_pipe_cfg
[] = {
222 USB_ENDPOINT_XFER_CONTROL
,
223 USB_ENDPOINT_XFER_ISOC
,
224 USB_ENDPOINT_XFER_ISOC
,
225 USB_ENDPOINT_XFER_BULK
,
226 USB_ENDPOINT_XFER_BULK
,
227 USB_ENDPOINT_XFER_BULK
,
228 USB_ENDPOINT_XFER_INT
,
229 USB_ENDPOINT_XFER_INT
,
230 USB_ENDPOINT_XFER_INT
,
231 USB_ENDPOINT_XFER_BULK
,
232 USB_ENDPOINT_XFER_BULK
,
233 USB_ENDPOINT_XFER_BULK
,
234 USB_ENDPOINT_XFER_BULK
,
235 USB_ENDPOINT_XFER_BULK
,
236 USB_ENDPOINT_XFER_BULK
,
237 USB_ENDPOINT_XFER_BULK
,
240 static struct usbhs_private usbhs_private
= {
241 .phy
= IOMEM(0xe60781e0), /* USBPHYINT */
242 .cr2
= IOMEM(0xe605810c), /* USBCR2 */
244 .platform_callback
= {
245 .hardware_init
= usbhs_hardware_init
,
246 .hardware_exit
= usbhs_hardware_exit
,
247 .get_id
= usbhs_get_id
,
248 .phy_reset
= usbhs_phy_reset
,
249 .get_vbus
= usbhs_get_vbus
,
254 .pipe_type
= usbhs_pipe_cfg
,
255 .pipe_size
= ARRAY_SIZE(usbhs_pipe_cfg
),
260 static struct resource usbhs_resources
[] = {
263 .end
= 0xE68900e6 - 1,
264 .flags
= IORESOURCE_MEM
,
267 .start
= gic_spi(62),
269 .flags
= IORESOURCE_IRQ
,
273 static struct platform_device usbhs_device
= {
274 .name
= "renesas_usbhs",
278 .coherent_dma_mask
= 0xffffffff,
279 .platform_data
= &usbhs_private
.info
,
281 .num_resources
= ARRAY_SIZE(usbhs_resources
),
282 .resource
= usbhs_resources
,
286 static struct fb_videomode kzm_lcdc_mode
= {
287 .name
= "WVGA Panel",
299 static struct sh_mobile_lcdc_info lcdc_info
= {
300 .clock_source
= LCDC_CLK_BUS
,
302 .chan
= LCDC_CHAN_MAINLCD
,
303 .fourcc
= V4L2_PIX_FMT_RGB565
,
304 .interface_type
= RGB24
,
305 .lcd_modes
= &kzm_lcdc_mode
,
316 static struct resource lcdc_resources
[] = {
321 .flags
= IORESOURCE_MEM
,
324 .start
= intcs_evt2irq(0x580),
325 .flags
= IORESOURCE_IRQ
,
329 static struct platform_device lcdc_device
= {
330 .name
= "sh_mobile_lcdc_fb",
331 .num_resources
= ARRAY_SIZE(lcdc_resources
),
332 .resource
= lcdc_resources
,
334 .platform_data
= &lcdc_info
,
335 .coherent_dma_mask
= ~0,
339 /* Fixed 1.8V regulator to be used by MMCIF */
340 static struct regulator_consumer_supply fixed1v8_power_consumers
[] =
342 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
343 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
347 static struct resource sh_mmcif_resources
[] = {
352 .flags
= IORESOURCE_MEM
,
355 .start
= gic_spi(140),
356 .flags
= IORESOURCE_IRQ
,
359 .start
= gic_spi(141),
360 .flags
= IORESOURCE_IRQ
,
364 static struct sh_mmcif_plat_data sh_mmcif_platdata
= {
365 .ocr
= MMC_VDD_165_195
,
366 .caps
= MMC_CAP_8_BIT_DATA
| MMC_CAP_NONREMOVABLE
,
367 .slave_id_tx
= SHDMA_SLAVE_MMCIF_TX
,
368 .slave_id_rx
= SHDMA_SLAVE_MMCIF_RX
,
371 static struct platform_device mmc_device
= {
375 .coherent_dma_mask
= 0xffffffff,
376 .platform_data
= &sh_mmcif_platdata
,
378 .num_resources
= ARRAY_SIZE(sh_mmcif_resources
),
379 .resource
= sh_mmcif_resources
,
382 /* Fixed 3.3V regulators to be used by SDHI0 */
383 static struct regulator_consumer_supply vcc_sdhi0_consumers
[] =
385 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
388 static struct regulator_init_data vcc_sdhi0_init_data
= {
390 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
392 .num_consumer_supplies
= ARRAY_SIZE(vcc_sdhi0_consumers
),
393 .consumer_supplies
= vcc_sdhi0_consumers
,
396 static struct fixed_voltage_config vcc_sdhi0_info
= {
397 .supply_name
= "SDHI0 Vcc",
398 .microvolts
= 3300000,
401 .init_data
= &vcc_sdhi0_init_data
,
404 static struct platform_device vcc_sdhi0
= {
405 .name
= "reg-fixed-voltage",
408 .platform_data
= &vcc_sdhi0_info
,
412 /* Fixed 3.3V regulators to be used by SDHI2 */
413 static struct regulator_consumer_supply vcc_sdhi2_consumers
[] =
415 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"),
418 static struct regulator_init_data vcc_sdhi2_init_data
= {
420 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
422 .num_consumer_supplies
= ARRAY_SIZE(vcc_sdhi2_consumers
),
423 .consumer_supplies
= vcc_sdhi2_consumers
,
426 static struct fixed_voltage_config vcc_sdhi2_info
= {
427 .supply_name
= "SDHI2 Vcc",
428 .microvolts
= 3300000,
431 .init_data
= &vcc_sdhi2_init_data
,
434 static struct platform_device vcc_sdhi2
= {
435 .name
= "reg-fixed-voltage",
438 .platform_data
= &vcc_sdhi2_info
,
443 static struct sh_mobile_sdhi_info sdhi0_info
= {
444 .dma_slave_tx
= SHDMA_SLAVE_SDHI0_TX
,
445 .dma_slave_rx
= SHDMA_SLAVE_SDHI0_RX
,
446 .tmio_flags
= TMIO_MMC_HAS_IDLE_WAIT
,
447 .tmio_caps
= MMC_CAP_SD_HIGHSPEED
| MMC_CAP_SDIO_IRQ
|
448 MMC_CAP_POWER_OFF_CARD
,
451 static struct resource sdhi0_resources
[] = {
456 .flags
= IORESOURCE_MEM
,
459 .name
= SH_MOBILE_SDHI_IRQ_CARD_DETECT
,
460 .start
= gic_spi(83),
461 .flags
= IORESOURCE_IRQ
,
464 .name
= SH_MOBILE_SDHI_IRQ_SDCARD
,
465 .start
= gic_spi(84),
466 .flags
= IORESOURCE_IRQ
,
469 .name
= SH_MOBILE_SDHI_IRQ_SDIO
,
470 .start
= gic_spi(85),
471 .flags
= IORESOURCE_IRQ
,
475 static struct platform_device sdhi0_device
= {
476 .name
= "sh_mobile_sdhi",
477 .num_resources
= ARRAY_SIZE(sdhi0_resources
),
478 .resource
= sdhi0_resources
,
480 .platform_data
= &sdhi0_info
,
485 static struct sh_mobile_sdhi_info sdhi2_info
= {
486 .dma_slave_tx
= SHDMA_SLAVE_SDHI2_TX
,
487 .dma_slave_rx
= SHDMA_SLAVE_SDHI2_RX
,
488 .tmio_flags
= TMIO_MMC_HAS_IDLE_WAIT
|
489 TMIO_MMC_USE_GPIO_CD
|
490 TMIO_MMC_WRPROTECT_DISABLE
,
491 .tmio_caps
= MMC_CAP_SD_HIGHSPEED
| MMC_CAP_POWER_OFF_CARD
,
495 static struct resource sdhi2_resources
[] = {
500 .flags
= IORESOURCE_MEM
,
503 .name
= SH_MOBILE_SDHI_IRQ_CARD_DETECT
,
504 .start
= gic_spi(103),
505 .flags
= IORESOURCE_IRQ
,
508 .name
= SH_MOBILE_SDHI_IRQ_SDCARD
,
509 .start
= gic_spi(104),
510 .flags
= IORESOURCE_IRQ
,
513 .name
= SH_MOBILE_SDHI_IRQ_SDIO
,
514 .start
= gic_spi(105),
515 .flags
= IORESOURCE_IRQ
,
519 static struct platform_device sdhi2_device
= {
520 .name
= "sh_mobile_sdhi",
522 .num_resources
= ARRAY_SIZE(sdhi2_resources
),
523 .resource
= sdhi2_resources
,
525 .platform_data
= &sdhi2_info
,
530 #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
532 static struct gpio_keys_button gpio_buttons
[] = {
533 GPIO_KEY(KEY_BACK
, GPIO_PCF8575_PORT10
, "SW3"),
534 GPIO_KEY(KEY_RIGHT
, GPIO_PCF8575_PORT11
, "SW2-R"),
535 GPIO_KEY(KEY_LEFT
, GPIO_PCF8575_PORT12
, "SW2-L"),
536 GPIO_KEY(KEY_ENTER
, GPIO_PCF8575_PORT13
, "SW2-P"),
537 GPIO_KEY(KEY_UP
, GPIO_PCF8575_PORT14
, "SW2-U"),
538 GPIO_KEY(KEY_DOWN
, GPIO_PCF8575_PORT15
, "SW2-D"),
539 GPIO_KEY(KEY_HOME
, GPIO_PCF8575_PORT16
, "SW1"),
542 static struct gpio_keys_platform_data gpio_key_info
= {
543 .buttons
= gpio_buttons
,
544 .nbuttons
= ARRAY_SIZE(gpio_buttons
),
547 static struct platform_device gpio_keys_device
= {
550 .platform_data
= &gpio_key_info
,
555 static struct sh_fsi_platform_info fsi_info
= {
557 .tx_id
= SHDMA_SLAVE_FSI2A_TX
,
561 static struct resource fsi_resources
[] = {
565 .end
= 0xEC230400 - 1,
566 .flags
= IORESOURCE_MEM
,
569 .start
= gic_spi(146),
570 .flags
= IORESOURCE_IRQ
,
574 static struct platform_device fsi_device
= {
577 .num_resources
= ARRAY_SIZE(fsi_resources
),
578 .resource
= fsi_resources
,
580 .platform_data
= &fsi_info
,
584 static struct asoc_simple_card_info fsi2_ak4648_info
= {
586 .card
= "FSI2A-AK4648",
587 .codec
= "ak4642-codec.0-0012",
588 .platform
= "sh_fsi2",
589 .daifmt
= SND_SOC_DAIFMT_LEFT_J
,
592 .fmt
= SND_SOC_DAIFMT_CBS_CFS
,
595 .name
= "ak4642-hifi",
596 .fmt
= SND_SOC_DAIFMT_CBM_CFM
,
601 static struct platform_device fsi_ak4648_device
= {
602 .name
= "asoc-simple-card",
604 .platform_data
= &fsi2_ak4648_info
,
609 static struct pcf857x_platform_data pcf8575_pdata
= {
610 .gpio_base
= GPIO_PCF8575_BASE
,
613 static struct i2c_board_info i2c0_devices
[] = {
615 I2C_BOARD_INFO("ak4648", 0x12),
618 I2C_BOARD_INFO("r2025sd", 0x32),
621 I2C_BOARD_INFO("ak8975", 0x0c),
622 .irq
= irq_pin(28), /* IRQ28 */
625 I2C_BOARD_INFO("adxl34x", 0x1d),
626 .irq
= irq_pin(26), /* IRQ26 */
630 static struct i2c_board_info i2c1_devices
[] = {
632 I2C_BOARD_INFO("st1232-ts", 0x55),
633 .irq
= irq_pin(8), /* IRQ8 */
637 static struct i2c_board_info i2c3_devices
[] = {
639 I2C_BOARD_INFO("pcf8575", 0x20),
640 .irq
= irq_pin(19), /* IRQ19 */
641 .platform_data
= &pcf8575_pdata
,
645 static struct platform_device
*kzm_devices
[] __initdata
= {
660 static unsigned long pin_pullup_conf
[] = {
661 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP
, 0),
664 static const struct pinctrl_map kzm_pinctrl_map
[] = {
666 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
667 "fsia_mclk_in", "fsia"),
668 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
669 "fsia_sclk_in", "fsia"),
670 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
671 "fsia_data_in", "fsia"),
672 PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
673 "fsia_data_out", "fsia"),
675 PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
678 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0",
679 "lcd_data24", "lcd"),
680 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_lcdc_fb.0", "pfc-sh73a0",
683 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
684 "mmc0_data8_0", "mmc0"),
685 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
686 "mmc0_ctrl_0", "mmc0"),
687 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
688 "PORT279", pin_pullup_conf
),
689 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
690 "mmc0_data8_0", pin_pullup_conf
),
692 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
693 "scifa4_data", "scifa4"),
694 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
695 "scifa4_ctrl", "scifa4"),
697 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
698 "sdhi0_data4", "sdhi0"),
699 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
700 "sdhi0_ctrl", "sdhi0"),
701 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
702 "sdhi0_cd", "sdhi0"),
703 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
704 "sdhi0_wp", "sdhi0"),
706 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
707 "sdhi2_data4", "sdhi2"),
708 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-sh73a0",
709 "sdhi2_ctrl", "sdhi2"),
711 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
714 PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-sh73a0",
721 * This is quick hack for enabling LCDC backlight
723 static int __init
as3711_enable_lcdc_backlight(void)
725 struct i2c_adapter
*a
= i2c_get_adapter(0);
736 0xff, 0x00, /* wait */
742 if (!of_machine_is_compatible("renesas,kzm9g"))
752 for (i
= 0; i
< ARRAY_SIZE(magic
); i
+= 2) {
755 if (0xff == msg
.buf
[0]) {
760 ret
= i2c_transfer(a
, &msg
, 1);
762 pr_err("i2c transfer fail\n");
769 device_initcall(as3711_enable_lcdc_backlight
);
771 static void __init
kzm_init(void)
773 regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers
,
774 ARRAY_SIZE(fixed1v8_power_consumers
), 1800000);
775 regulator_register_fixed(3, dummy_supplies
, ARRAY_SIZE(dummy_supplies
));
777 pinctrl_register_mappings(kzm_pinctrl_map
, ARRAY_SIZE(kzm_pinctrl_map
));
779 sh73a0_pinmux_init();
782 gpio_request_one(224, GPIOF_IN
, NULL
); /* IRQ3 */
785 gpio_request_one(222, GPIOF_OUT_INIT_HIGH
, NULL
); /* LCDCDON */
786 gpio_request_one(226, GPIOF_OUT_INIT_HIGH
, NULL
); /* SC */
789 gpio_request_one(223, GPIOF_IN
, NULL
); /* IRQ8 */
792 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON
, NULL
);
794 #ifdef CONFIG_CACHE_L2X0
795 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
796 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
799 i2c_register_board_info(0, i2c0_devices
, ARRAY_SIZE(i2c0_devices
));
800 i2c_register_board_info(1, i2c1_devices
, ARRAY_SIZE(i2c1_devices
));
801 i2c_register_board_info(3, i2c3_devices
, ARRAY_SIZE(i2c3_devices
));
803 sh73a0_add_standard_devices();
804 platform_add_devices(kzm_devices
, ARRAY_SIZE(kzm_devices
));
809 static void kzm9g_restart(char mode
, const char *cmd
)
811 #define RESCNT2 IOMEM(0xe6188020)
812 /* Do soft power on reset */
813 writel((1 << 31), RESCNT2
);
816 static const char *kzm9g_boards_compat_dt
[] __initdata
= {
821 DT_MACHINE_START(KZM9G_DT
, "kzm9g")
822 .smp
= smp_ops(sh73a0_smp_ops
),
823 .map_io
= sh73a0_map_io
,
824 .init_early
= sh73a0_add_early_devices
,
825 .nr_irqs
= NR_IRQS_LEGACY
,
826 .init_irq
= sh73a0_init_irq
,
827 .init_machine
= kzm_init
,
828 .init_late
= shmobile_init_late
,
829 .init_time
= sh73a0_earlytimer_init
,
830 .restart
= kzm9g_restart
,
831 .dt_compat
= kzm9g_boards_compat_dt
,