25 #include <linux/kernel.h>
31 #include <linux/input.h>
33 #include <linux/i2c.h>
60 #include <mach/common.h>
61 #include <mach/irqs.h>
241 .offset = 0x00000000,
254 .size = 8 * 1024 * 1024,
260 .size = 8 * 1024 * 1024,
271 .parts = nor_flash_partitions,
275 static struct resource nor_flash_resources[] = {
278 .end = 0x28000000 - 1,
284 .name =
"physmap-flash",
286 .platform_data = &nor_flash_data,
288 .num_resources =
ARRAY_SIZE(nor_flash_resources),
289 .resource = nor_flash_resources,
293 static struct resource smc911x_resources[] = {
296 .end = 0x16000000 - 1,
313 .num_resources =
ARRAY_SIZE(smc911x_resources),
314 .resource = smc911x_resources,
316 .platform_data = &smsc911x_info,
325 static struct resource meram_resources[] = {
341 .name =
"sh_mobile_meram",
344 .resource = meram_resources,
346 .platform_data = &mackerel_meram_info,
353 .name =
"WVGA Panel",
366 static int mackerel_set_brightness(
int brightness)
373 static int mackerel_get_brightness(
void)
388 .meram_dev = &mackerel_meram_info,
393 .lcd_modes = mackerel_lcdc_modes,
395 .interface_type =
RGB24,
403 .name =
"sh_mobile_lcdc_bl",
405 .set_brightness = mackerel_set_brightness,
406 .get_brightness = mackerel_get_brightness,
408 .meram_cfg = &lcd_meram_cfg,
412 static struct resource lcdc_resources[] = {
426 .name =
"sh_mobile_lcdc_fb",
428 .resource = lcdc_resources,
430 .platform_data = &lcdc_info,
431 .coherent_dma_mask = ~0,
455 .name =
"sh-mobile-hdmi",
457 .resource = hdmi_resources,
460 .platform_data = &hdmi_info,
474 .meram_dev = &mackerel_meram_info,
479 .interface_type =
RGB24,
482 .meram_cfg = &hdmi_meram_cfg,
483 .tx_dev = &hdmi_device,
487 static struct resource hdmi_lcdc_resources[] = {
501 .name =
"sh_mobile_lcdc_fb",
502 .num_resources =
ARRAY_SIZE(hdmi_lcdc_resources),
503 .resource = hdmi_lcdc_resources,
506 .platform_data = &hdmi_lcdc_info,
507 .coherent_dma_mask = ~0,
517 .card =
"FSI2B-HDMI",
518 .cpu_dai =
"fsib-dai",
519 .codec =
"sh-mobile-hdmi",
520 .platform =
"sh_fsi2",
521 .codec_dai =
"sh_mobile_hdmi-hifi",
522 .init = &fsi2_hdmi_init_info,
526 .name =
"asoc-simple-card",
529 .platform_data = &fsi2_hdmi_info,
533 static void __init hdmi_init_pm_clock(
void)
539 if (IS_ERR(hdmi_ick)) {
540 ret = PTR_ERR(hdmi_ick);
541 pr_err(
"Cannot get HDMI ICK: %d\n", ret);
547 pr_err(
"Cannot set PLLC2 parent: %d, %d users\n",
552 pr_debug(
"PLLC2 initial frequency %lu\n",
557 pr_err(
"Cannot get suitable rate: %ld\n", rate);
564 pr_err(
"Cannot set rate %ld: %d\n", rate, ret);
568 pr_debug(
"PLLC2 set frequency %lu\n", rate);
572 pr_err(
"Cannot set HDMI parent: %d\n", ret);
575 if (!IS_ERR(hdmi_ick))
585 #define USBHS0_POLL_INTERVAL (HZ * 5)
595 #define usbhs_get_priv(pdev) \
596 container_of(renesas_usbhs_get_info(pdev), \
597 struct usbhs_private, info)
599 #define usbhs_is_connected(priv) \
600 (!((1 << 7) & __raw_readw(priv->usbcrcaddr)))
647 .usbcrcaddr =
IOMEM(0xe605810c),
649 .platform_callback = {
650 .hardware_init = usbhs0_hardware_init,
651 .hardware_exit = usbhs0_hardware_exit,
652 .phy_reset = usbhs_phy_reset,
653 .get_id = usbhs0_get_id,
654 .get_vbus = usbhs_get_vbus,
664 static struct resource usbhs0_resources[] = {
668 .end = 0xe68900e6 - 1,
678 .name =
"renesas_usbhs",
681 .platform_data = &usbhs0_private.
info,
683 .num_resources =
ARRAY_SIZE(usbhs0_resources),
684 .resource = usbhs0_resources,
702 #define IRQ8 evt2irq(0x0300)
703 #define USB_PHY_MODE (1 << 4)
704 #define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
705 #define USB_PHY_ON (1 << 1)
706 #define USB_PHY_OFF (1 << 0)
707 #define USB_PHY_INT_CLR (USB_PHY_ON | USB_PHY_OFF)
734 dev_name(&pdev->
dev), pdev);
761 static u32 usbhs1_pipe_cfg[] = {
781 .usbphyaddr =
IOMEM(0xe60581e2),
782 .usbcrcaddr =
IOMEM(0xe6058130),
784 .platform_callback = {
785 .hardware_init = usbhs1_hardware_init,
786 .hardware_exit = usbhs1_hardware_exit,
787 .get_id = usbhs1_get_id,
788 .phy_reset = usbhs_phy_reset,
793 .pipe_type = usbhs1_pipe_cfg,
801 static struct resource usbhs1_resources[] = {
805 .end = 0xe68b00e6 - 1,
815 .name =
"renesas_usbhs",
818 .platform_data = &usbhs1_private.
info,
820 .num_resources =
ARRAY_SIZE(usbhs1_resources),
821 .resource = usbhs1_resources,
825 static struct gpio_led mackerel_leds[] = {
849 .leds = mackerel_leds,
857 .platform_data = &mackerel_leds_pdata,
862 #define IRQ_FSI evt2irq(0x1840)
863 static int __fsi_set_round_rate(
struct clk *
clk,
long rate,
int enable)
884 struct clk *fsib_clk;
894 fsib_rate = rate * 256;
898 fsib_rate = 85428000;
899 fdiv_rate = rate * 256;
903 pr_err(
"unsupported rate in FSI2 port B\n");
908 fsib_clk =
clk_get(dev,
"ickb");
909 if (IS_ERR(fsib_clk))
913 ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
915 goto fsi_set_rate_end;
918 ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
922 __fsi_set_round_rate(fsib_clk, fsib_rate, 0);
923 goto fsi_set_rate_end;
944 .set_rate = fsi_b_set_rate,
948 static struct resource fsi_resources[] = {
954 .end = 0xFE1F0400 - 1,
967 .resource = fsi_resources,
969 .platform_data = &fsi_info,
982 .card =
"FSI2A-AK4643",
983 .cpu_dai =
"fsia-dai",
984 .codec =
"ak4642-codec.0-0013",
985 .platform =
"sh_fsi2",
986 .codec_dai =
"ak4642-hifi",
987 .init = &fsi2_ak4643_init_info,
991 .name =
"asoc-simple-card",
993 .platform_data = &fsi2_ak4643_info,
1002 .size = 128 * 1024 * 1024,
1007 .size = 256 * 1024 * 1024,
1012 .size = 128 * 1024 * 1024,
1016 static struct resource nand_flash_resources[] = {
1018 .start = 0xe6a30000,
1025 .parts = nand_partition_info,
1034 .resource = nand_flash_resources,
1035 .num_resources =
ARRAY_SIZE(nand_flash_resources),
1037 .platform_data = &nand_flash_data,
1059 static struct resource sdhi0_resources[] = {
1062 .start = 0xe6850000,
1081 .name =
"sh_mobile_sdhi",
1082 .num_resources =
ARRAY_SIZE(sdhi0_resources),
1083 .resource = sdhi0_resources,
1086 .platform_data = &sdhi0_info,
1090 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1099 .get_cd = slot_cn7_get_cd,
1102 static struct resource sdhi1_resources[] = {
1105 .start = 0xe6860000,
1127 .name =
"sh_mobile_sdhi",
1128 .num_resources =
ARRAY_SIZE(sdhi1_resources),
1129 .resource = sdhi1_resources,
1132 .platform_data = &sdhi1_info,
1153 .get_cd = slot_cn23_get_cd,
1156 static struct resource sdhi2_resources[] = {
1159 .start = 0xe6870000,
1181 .name =
"sh_mobile_sdhi",
1182 .num_resources =
ARRAY_SIZE(sdhi2_resources),
1183 .resource = sdhi2_resources,
1186 .platform_data = &sdhi2_info,
1191 static struct resource sh_mmcif_resources[] = {
1194 .start = 0xE6BD0000,
1216 .get_cd = slot_cn7_get_cd,
1226 .coherent_dma_mask = 0xffffffff,
1227 .platform_data = &sh_mmcif_plat,
1229 .num_resources =
ARRAY_SIZE(sh_mmcif_resources),
1230 .resource = sh_mmcif_resources,
1244 .format_name =
"UYVY",
1257 .set_capture = camera_set_capture,
1262 .add_device = mackerel_camera_add,
1263 .del_device = mackerel_camera_del,
1264 .module_name =
"soc_camera_platform",
1265 .priv = &camera_info,
1270 static void mackerel_camera_release(
struct device *dev)
1272 soc_camera_platform_release(&camera_device);
1277 return soc_camera_platform_add(icd, &camera_device, &camera_link,
1278 mackerel_camera_release, 0);
1283 soc_camera_platform_del(icd, camera_device, &camera_link);
1292 static struct resource ceu_resources[] = {
1295 .start = 0xfe910000,
1309 .name =
"sh_mobile_ceu",
1312 .resource = ceu_resources,
1314 .platform_data = &sh_mobile_ceu_info,
1315 .coherent_dma_mask = 0xffffffff,
1320 .name =
"soc-camera-pdrv",
1323 .platform_data = &camera_link,
1339 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1352 #define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
1356 .active_low = act_low, \
1359 #define KEYPAD_BUTTON_LOW(event_code) KEYPAD_BUTTON(EV_KEY, event_code, 1)
1369 .buttons = mackerel_gpio_keys,
1377 #define IRQ7 evt2irq(0x02e0)
1378 #define IRQ9 evt2irq(0x0320)
1387 .platform_data = &mackerel_tca6416_keys_info,
1397 #define IRQ21 evt2irq(0x32a0)
1407 #define GPIO_PORT9CR IOMEM(0xE6051009)
1408 #define GPIO_PORT10CR IOMEM(0xE605100A)
1409 #define GPIO_PORT167CR IOMEM(0xE60520A7)
1410 #define GPIO_PORT168CR IOMEM(0xE60520A8)
1411 #define SRCR4 IOMEM(0xe61580bc)
1412 #define USCCR1 IOMEM(0xE6058144)
1413 static void __init mackerel_init(
void)
1416 {
"A4LC", &lcdc_device, },
1417 {
"A4LC", &hdmi_lcdc_device, },
1418 {
"A4LC", &meram_device, },
1419 {
"A4MP", &fsi_device, },
1420 {
"A3SP", &usbhs0_device, },
1421 {
"A3SP", &usbhs1_device, },
1422 {
"A3SP", &nand_flash_device, },
1423 {
"A3SP", &sh_mmcif_device, },
1424 {
"A3SP", &sdhi0_device, },
1425 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1426 {
"A3SP", &sdhi1_device, },
1428 {
"A3SP", &sdhi2_device, },
1429 {
"A4R", &ceu_device, },
1435 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
1437 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
1546 #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1645 rmobile_add_devices_to_domains(domain_devices,
1648 hdmi_init_pm_clock();
1650 pm_clk_add(&fsi_device.
dev,
"spu2");
1651 pm_clk_add(&hdmi_lcdc_device.
dev,
"hdmi");
1659 .init_machine = mackerel_init,