1 /* 2 * KFR2R09 board support code 3 * 4 * Copyright (C) 2009 Magnus Damm 5 * 6 * This file is subject to the terms and conditions of the GNU General Public 7 * License. See the file "COPYING" in the main directory of this archive 8 * for more details. 9 */ 10 #include <linux/init.h> 11 #include <linux/platform_device.h> 12 #include <linux/interrupt.h> 13 #include <linux/mmc/host.h> 14 #include <linux/mmc/sh_mobile_sdhi.h> 15 #include <linux/mfd/tmio.h> 16 #include <linux/mtd/physmap.h> 17 #include <linux/mtd/onenand.h> 18 #include <linux/delay.h> 19 #include <linux/clk.h> 20 #include <linux/gpio.h> 21 #include <linux/input.h> 22 #include <linux/input/sh_keysc.h> 23 #include <linux/i2c.h> 24 #include <linux/regulator/fixed.h> 25 #include <linux/regulator/machine.h> 26 #include <linux/usb/r8a66597.h> 27 #include <linux/videodev2.h> 28 #include <linux/sh_intc.h> 29 #include <media/rj54n1cb0c.h> 30 #include <media/soc_camera.h> 31 #include <media/sh_mobile_ceu.h> 32 #include <video/sh_mobile_lcdc.h> 33 #include <asm/suspend.h> 34 #include <asm/clock.h> 35 #include <asm/machvec.h> 36 #include <asm/io.h> 37 #include <cpu/sh7724.h> 38 #include <mach/kfr2r09.h> 39 40 static struct mtd_partition kfr2r09_nor_flash_partitions[] = 41 { 42 { 43 .name = "boot", 44 .offset = 0, 45 .size = (4 * 1024 * 1024), 46 .mask_flags = MTD_WRITEABLE, /* Read-only */ 47 }, 48 { 49 .name = "other", 50 .offset = MTDPART_OFS_APPEND, 51 .size = MTDPART_SIZ_FULL, 52 }, 53 }; 54 55 static struct physmap_flash_data kfr2r09_nor_flash_data = { 56 .width = 2, 57 .parts = kfr2r09_nor_flash_partitions, 58 .nr_parts = ARRAY_SIZE(kfr2r09_nor_flash_partitions), 59 }; 60 61 static struct resource kfr2r09_nor_flash_resources[] = { 62 [0] = { 63 .name = "NOR Flash", 64 .start = 0x00000000, 65 .end = 0x03ffffff, 66 .flags = IORESOURCE_MEM, 67 } 68 }; 69 70 static struct platform_device kfr2r09_nor_flash_device = { 71 .name = "physmap-flash", 72 .resource = kfr2r09_nor_flash_resources, 73 .num_resources = ARRAY_SIZE(kfr2r09_nor_flash_resources), 74 .dev = { 75 .platform_data = &kfr2r09_nor_flash_data, 76 }, 77 }; 78 79 static struct resource kfr2r09_nand_flash_resources[] = { 80 [0] = { 81 .name = "NAND Flash", 82 .start = 0x10000000, 83 .end = 0x1001ffff, 84 .flags = IORESOURCE_MEM, 85 } 86 }; 87 88 static struct platform_device kfr2r09_nand_flash_device = { 89 .name = "onenand-flash", 90 .resource = kfr2r09_nand_flash_resources, 91 .num_resources = ARRAY_SIZE(kfr2r09_nand_flash_resources), 92 }; 93 94 static struct sh_keysc_info kfr2r09_sh_keysc_info = { 95 .mode = SH_KEYSC_MODE_1, /* KEYOUT0->4, KEYIN0->4 */ 96 .scan_timing = 3, 97 .delay = 10, 98 .keycodes = { 99 KEY_PHONE, KEY_CLEAR, KEY_MAIL, KEY_WWW, KEY_ENTER, 100 KEY_1, KEY_2, KEY_3, 0, KEY_UP, 101 KEY_4, KEY_5, KEY_6, 0, KEY_LEFT, 102 KEY_7, KEY_8, KEY_9, KEY_PROG1, KEY_RIGHT, 103 KEY_S, KEY_0, KEY_P, KEY_PROG2, KEY_DOWN, 104 0, 0, 0, 0, 0 105 }, 106 }; 107 108 static struct resource kfr2r09_sh_keysc_resources[] = { 109 [0] = { 110 .name = "KEYSC", 111 .start = 0x044b0000, 112 .end = 0x044b000f, 113 .flags = IORESOURCE_MEM, 114 }, 115 [1] = { 116 .start = evt2irq(0xbe0), 117 .flags = IORESOURCE_IRQ, 118 }, 119 }; 120 121 static struct platform_device kfr2r09_sh_keysc_device = { 122 .name = "sh_keysc", 123 .id = 0, /* "keysc0" clock */ 124 .num_resources = ARRAY_SIZE(kfr2r09_sh_keysc_resources), 125 .resource = kfr2r09_sh_keysc_resources, 126 .dev = { 127 .platform_data = &kfr2r09_sh_keysc_info, 128 }, 129 }; 130 131 static const struct fb_videomode kfr2r09_lcdc_modes[] = { 132 { 133 .name = "TX07D34VM0AAA", 134 .xres = 240, 135 .yres = 400, 136 .left_margin = 0, 137 .right_margin = 16, 138 .hsync_len = 8, 139 .upper_margin = 0, 140 .lower_margin = 1, 141 .vsync_len = 1, 142 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 143 }, 144 }; 145 146 static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = { 147 .clock_source = LCDC_CLK_BUS, 148 .ch[0] = { 149 .chan = LCDC_CHAN_MAINLCD, 150 .fourcc = V4L2_PIX_FMT_RGB565, 151 .interface_type = SYS18, 152 .clock_divider = 6, 153 .flags = LCDC_FLAGS_DWPOL, 154 .lcd_modes = kfr2r09_lcdc_modes, 155 .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes), 156 .panel_cfg = { 157 .width = 35, 158 .height = 58, 159 .setup_sys = kfr2r09_lcd_setup, 160 .start_transfer = kfr2r09_lcd_start, 161 }, 162 .bl_info = { 163 .name = "sh_mobile_lcdc_bl", 164 .max_brightness = 1, 165 .set_brightness = kfr2r09_lcd_set_brightness, 166 }, 167 .sys_bus_cfg = { 168 .ldmt2r = 0x07010904, 169 .ldmt3r = 0x14012914, 170 /* set 1s delay to encourage fsync() */ 171 .deferred_io_msec = 1000, 172 }, 173 } 174 }; 175 176 static struct resource kfr2r09_sh_lcdc_resources[] = { 177 [0] = { 178 .name = "LCDC", 179 .start = 0xfe940000, /* P4-only space */ 180 .end = 0xfe942fff, 181 .flags = IORESOURCE_MEM, 182 }, 183 [1] = { 184 .start = evt2irq(0xf40), 185 .flags = IORESOURCE_IRQ, 186 }, 187 }; 188 189 static struct platform_device kfr2r09_sh_lcdc_device = { 190 .name = "sh_mobile_lcdc_fb", 191 .num_resources = ARRAY_SIZE(kfr2r09_sh_lcdc_resources), 192 .resource = kfr2r09_sh_lcdc_resources, 193 .dev = { 194 .platform_data = &kfr2r09_sh_lcdc_info, 195 }, 196 }; 197 198 static struct r8a66597_platdata kfr2r09_usb0_gadget_data = { 199 .on_chip = 1, 200 }; 201 202 static struct resource kfr2r09_usb0_gadget_resources[] = { 203 [0] = { 204 .start = 0x04d80000, 205 .end = 0x04d80123, 206 .flags = IORESOURCE_MEM, 207 }, 208 [1] = { 209 .start = evt2irq(0xa20), 210 .end = evt2irq(0xa20), 211 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 212 }, 213 }; 214 215 static struct platform_device kfr2r09_usb0_gadget_device = { 216 .name = "r8a66597_udc", 217 .id = 0, 218 .dev = { 219 .dma_mask = NULL, /* not use dma */ 220 .coherent_dma_mask = 0xffffffff, 221 .platform_data = &kfr2r09_usb0_gadget_data, 222 }, 223 .num_resources = ARRAY_SIZE(kfr2r09_usb0_gadget_resources), 224 .resource = kfr2r09_usb0_gadget_resources, 225 }; 226 227 static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 228 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 229 }; 230 231 static struct resource kfr2r09_ceu_resources[] = { 232 [0] = { 233 .name = "CEU", 234 .start = 0xfe910000, 235 .end = 0xfe91009f, 236 .flags = IORESOURCE_MEM, 237 }, 238 [1] = { 239 .start = evt2irq(0x880), 240 .end = evt2irq(0x880), 241 .flags = IORESOURCE_IRQ, 242 }, 243 [2] = { 244 /* place holder for contiguous memory */ 245 }, 246 }; 247 248 static struct platform_device kfr2r09_ceu_device = { 249 .name = "sh_mobile_ceu", 250 .id = 0, /* "ceu0" clock */ 251 .num_resources = ARRAY_SIZE(kfr2r09_ceu_resources), 252 .resource = kfr2r09_ceu_resources, 253 .dev = { 254 .platform_data = &sh_mobile_ceu_info, 255 }, 256 }; 257 258 static struct i2c_board_info kfr2r09_i2c_camera = { 259 I2C_BOARD_INFO("rj54n1cb0c", 0x50), 260 }; 261 262 static struct clk *camera_clk; 263 264 /* set VIO_CKO clock to 25MHz */ 265 #define CEU_MCLK_FREQ 25000000 266 267 #define DRVCRB 0xA405018C 268 static int camera_power(struct device *dev, int mode) 269 { 270 int ret; 271 272 if (mode) { 273 long rate; 274 275 camera_clk = clk_get(NULL, "video_clk"); 276 if (IS_ERR(camera_clk)) 277 return PTR_ERR(camera_clk); 278 279 rate = clk_round_rate(camera_clk, CEU_MCLK_FREQ); 280 ret = clk_set_rate(camera_clk, rate); 281 if (ret < 0) 282 goto eclkrate; 283 284 /* set DRVCRB 285 * 286 * use 1.8 V for VccQ_VIO 287 * use 2.85V for VccQ_SR 288 */ 289 __raw_writew((__raw_readw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB); 290 291 /* reset clear */ 292 ret = gpio_request(GPIO_PTB4, NULL); 293 if (ret < 0) 294 goto eptb4; 295 ret = gpio_request(GPIO_PTB7, NULL); 296 if (ret < 0) 297 goto eptb7; 298 299 ret = gpio_direction_output(GPIO_PTB4, 1); 300 if (!ret) 301 ret = gpio_direction_output(GPIO_PTB7, 1); 302 if (ret < 0) 303 goto egpioout; 304 msleep(1); 305 306 ret = clk_enable(camera_clk); /* start VIO_CKO */ 307 if (ret < 0) 308 goto eclkon; 309 310 return 0; 311 } 312 313 ret = 0; 314 315 clk_disable(camera_clk); 316 eclkon: 317 gpio_set_value(GPIO_PTB7, 0); 318 egpioout: 319 gpio_set_value(GPIO_PTB4, 0); 320 gpio_free(GPIO_PTB7); 321 eptb7: 322 gpio_free(GPIO_PTB4); 323 eptb4: 324 eclkrate: 325 clk_put(camera_clk); 326 return ret; 327 } 328 329 static struct rj54n1_pdata rj54n1_priv = { 330 .mclk_freq = CEU_MCLK_FREQ, 331 .ioctl_high = false, 332 }; 333 334 static struct soc_camera_link rj54n1_link = { 335 .power = camera_power, 336 .board_info = &kfr2r09_i2c_camera, 337 .i2c_adapter_id = 1, 338 .priv = &rj54n1_priv, 339 }; 340 341 static struct platform_device kfr2r09_camera = { 342 .name = "soc-camera-pdrv", 343 .id = 0, 344 .dev = { 345 .platform_data = &rj54n1_link, 346 }, 347 }; 348 349 /* Fixed 3.3V regulator to be used by SDHI0 */ 350 static struct regulator_consumer_supply fixed3v3_power_consumers[] = 351 { 352 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 353 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 354 }; 355 356 static struct resource kfr2r09_sh_sdhi0_resources[] = { 357 [0] = { 358 .name = "SDHI0", 359 .start = 0x04ce0000, 360 .end = 0x04ce00ff, 361 .flags = IORESOURCE_MEM, 362 }, 363 [1] = { 364 .start = evt2irq(0xe80), 365 .flags = IORESOURCE_IRQ, 366 }, 367 }; 368 369 static struct sh_mobile_sdhi_info sh7724_sdhi0_data = { 370 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 371 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 372 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, 373 .tmio_caps = MMC_CAP_SDIO_IRQ, 374 }; 375 376 static struct platform_device kfr2r09_sh_sdhi0_device = { 377 .name = "sh_mobile_sdhi", 378 .num_resources = ARRAY_SIZE(kfr2r09_sh_sdhi0_resources), 379 .resource = kfr2r09_sh_sdhi0_resources, 380 .dev = { 381 .platform_data = &sh7724_sdhi0_data, 382 }, 383 }; 384 385 static struct platform_device *kfr2r09_devices[] __initdata = { 386 &kfr2r09_nor_flash_device, 387 &kfr2r09_nand_flash_device, 388 &kfr2r09_sh_keysc_device, 389 &kfr2r09_sh_lcdc_device, 390 &kfr2r09_ceu_device, 391 &kfr2r09_camera, 392 &kfr2r09_sh_sdhi0_device, 393 }; 394 395 #define BSC_CS0BCR 0xfec10004 396 #define BSC_CS0WCR 0xfec10024 397 #define BSC_CS4BCR 0xfec10010 398 #define BSC_CS4WCR 0xfec10030 399 #define PORT_MSELCRB 0xa4050182 400 401 #ifdef CONFIG_I2C 402 static int kfr2r09_usb0_gadget_i2c_setup(void) 403 { 404 struct i2c_adapter *a; 405 struct i2c_msg msg; 406 unsigned char buf[2]; 407 int ret; 408 409 a = i2c_get_adapter(0); 410 if (!a) 411 return -ENODEV; 412 413 /* set bit 1 (the second bit) of chip at 0x09, register 0x13 */ 414 buf[0] = 0x13; 415 msg.addr = 0x09; 416 msg.buf = buf; 417 msg.len = 1; 418 msg.flags = 0; 419 ret = i2c_transfer(a, &msg, 1); 420 if (ret != 1) 421 return -ENODEV; 422 423 buf[0] = 0; 424 msg.addr = 0x09; 425 msg.buf = buf; 426 msg.len = 1; 427 msg.flags = I2C_M_RD; 428 ret = i2c_transfer(a, &msg, 1); 429 if (ret != 1) 430 return -ENODEV; 431 432 buf[1] = buf[0] | (1 << 1); 433 buf[0] = 0x13; 434 msg.addr = 0x09; 435 msg.buf = buf; 436 msg.len = 2; 437 msg.flags = 0; 438 ret = i2c_transfer(a, &msg, 1); 439 if (ret != 1) 440 return -ENODEV; 441 442 return 0; 443 } 444 445 static int kfr2r09_serial_i2c_setup(void) 446 { 447 struct i2c_adapter *a; 448 struct i2c_msg msg; 449 unsigned char buf[2]; 450 int ret; 451 452 a = i2c_get_adapter(0); 453 if (!a) 454 return -ENODEV; 455 456 /* set bit 6 (the 7th bit) of chip at 0x09, register 0x13 */ 457 buf[0] = 0x13; 458 msg.addr = 0x09; 459 msg.buf = buf; 460 msg.len = 1; 461 msg.flags = 0; 462 ret = i2c_transfer(a, &msg, 1); 463 if (ret != 1) 464 return -ENODEV; 465 466 buf[0] = 0; 467 msg.addr = 0x09; 468 msg.buf = buf; 469 msg.len = 1; 470 msg.flags = I2C_M_RD; 471 ret = i2c_transfer(a, &msg, 1); 472 if (ret != 1) 473 return -ENODEV; 474 475 buf[1] = buf[0] | (1 << 6); 476 buf[0] = 0x13; 477 msg.addr = 0x09; 478 msg.buf = buf; 479 msg.len = 2; 480 msg.flags = 0; 481 ret = i2c_transfer(a, &msg, 1); 482 if (ret != 1) 483 return -ENODEV; 484 485 return 0; 486 } 487 #else 488 static int kfr2r09_usb0_gadget_i2c_setup(void) 489 { 490 return -ENODEV; 491 } 492 493 static int kfr2r09_serial_i2c_setup(void) 494 { 495 return -ENODEV; 496 } 497 #endif 498 499 static int kfr2r09_usb0_gadget_setup(void) 500 { 501 int plugged_in; 502 503 gpio_request(GPIO_PTN4, NULL); /* USB_DET */ 504 gpio_direction_input(GPIO_PTN4); 505 plugged_in = gpio_get_value(GPIO_PTN4); 506 if (!plugged_in) 507 return -ENODEV; /* no cable plugged in */ 508 509 if (kfr2r09_usb0_gadget_i2c_setup() != 0) 510 return -ENODEV; /* unable to configure using i2c */ 511 512 __raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB); 513 gpio_request(GPIO_FN_PDSTATUS, NULL); /* R-standby disables USB clock */ 514 gpio_request(GPIO_PTV6, NULL); /* USBCLK_ON */ 515 gpio_direction_output(GPIO_PTV6, 1); /* USBCLK_ON = H */ 516 msleep(20); /* wait 20ms to let the clock settle */ 517 clk_enable(clk_get(NULL, "usb0")); 518 __raw_writew(0x0600, 0xa40501d4); 519 520 return 0; 521 } 522 523 extern char kfr2r09_sdram_enter_start; 524 extern char kfr2r09_sdram_enter_end; 525 extern char kfr2r09_sdram_leave_start; 526 extern char kfr2r09_sdram_leave_end; 527 528 static int __init kfr2r09_devices_setup(void) 529 { 530 /* register board specific self-refresh code */ 531 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | 532 SUSP_SH_RSTANDBY, 533 &kfr2r09_sdram_enter_start, 534 &kfr2r09_sdram_enter_end, 535 &kfr2r09_sdram_leave_start, 536 &kfr2r09_sdram_leave_end); 537 538 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, 539 ARRAY_SIZE(fixed3v3_power_consumers), 3300000); 540 541 /* enable SCIF1 serial port for YC401 console support */ 542 gpio_request(GPIO_FN_SCIF1_RXD, NULL); 543 gpio_request(GPIO_FN_SCIF1_TXD, NULL); 544 kfr2r09_serial_i2c_setup(); /* ECONTMSK(bit6=L10ONEN) set 1 */ 545 gpio_request(GPIO_PTG3, NULL); /* HPON_ON */ 546 gpio_direction_output(GPIO_PTG3, 1); /* HPON_ON = H */ 547 548 /* setup NOR flash at CS0 */ 549 __raw_writel(0x36db0400, BSC_CS0BCR); 550 __raw_writel(0x00000500, BSC_CS0WCR); 551 552 /* setup NAND flash at CS4 */ 553 __raw_writel(0x36db0400, BSC_CS4BCR); 554 __raw_writel(0x00000500, BSC_CS4WCR); 555 556 /* setup KEYSC pins */ 557 gpio_request(GPIO_FN_KEYOUT0, NULL); 558 gpio_request(GPIO_FN_KEYOUT1, NULL); 559 gpio_request(GPIO_FN_KEYOUT2, NULL); 560 gpio_request(GPIO_FN_KEYOUT3, NULL); 561 gpio_request(GPIO_FN_KEYOUT4_IN6, NULL); 562 gpio_request(GPIO_FN_KEYIN0, NULL); 563 gpio_request(GPIO_FN_KEYIN1, NULL); 564 gpio_request(GPIO_FN_KEYIN2, NULL); 565 gpio_request(GPIO_FN_KEYIN3, NULL); 566 gpio_request(GPIO_FN_KEYIN4, NULL); 567 gpio_request(GPIO_FN_KEYOUT5_IN5, NULL); 568 569 /* setup LCDC pins for SYS panel */ 570 gpio_request(GPIO_FN_LCDD17, NULL); 571 gpio_request(GPIO_FN_LCDD16, NULL); 572 gpio_request(GPIO_FN_LCDD15, NULL); 573 gpio_request(GPIO_FN_LCDD14, NULL); 574 gpio_request(GPIO_FN_LCDD13, NULL); 575 gpio_request(GPIO_FN_LCDD12, NULL); 576 gpio_request(GPIO_FN_LCDD11, NULL); 577 gpio_request(GPIO_FN_LCDD10, NULL); 578 gpio_request(GPIO_FN_LCDD9, NULL); 579 gpio_request(GPIO_FN_LCDD8, NULL); 580 gpio_request(GPIO_FN_LCDD7, NULL); 581 gpio_request(GPIO_FN_LCDD6, NULL); 582 gpio_request(GPIO_FN_LCDD5, NULL); 583 gpio_request(GPIO_FN_LCDD4, NULL); 584 gpio_request(GPIO_FN_LCDD3, NULL); 585 gpio_request(GPIO_FN_LCDD2, NULL); 586 gpio_request(GPIO_FN_LCDD1, NULL); 587 gpio_request(GPIO_FN_LCDD0, NULL); 588 gpio_request(GPIO_FN_LCDRS, NULL); /* LCD_RS */ 589 gpio_request(GPIO_FN_LCDCS, NULL); /* LCD_CS/ */ 590 gpio_request(GPIO_FN_LCDRD, NULL); /* LCD_RD/ */ 591 gpio_request(GPIO_FN_LCDWR, NULL); /* LCD_WR/ */ 592 gpio_request(GPIO_FN_LCDVSYN, NULL); /* LCD_VSYNC */ 593 gpio_request(GPIO_PTE4, NULL); /* LCD_RST/ */ 594 gpio_direction_output(GPIO_PTE4, 1); 595 gpio_request(GPIO_PTF4, NULL); /* PROTECT/ */ 596 gpio_direction_output(GPIO_PTF4, 1); 597 gpio_request(GPIO_PTU0, NULL); /* LEDSTDBY/ */ 598 gpio_direction_output(GPIO_PTU0, 1); 599 600 /* setup USB function */ 601 if (kfr2r09_usb0_gadget_setup() == 0) 602 platform_device_register(&kfr2r09_usb0_gadget_device); 603 604 /* CEU */ 605 gpio_request(GPIO_FN_VIO_CKO, NULL); 606 gpio_request(GPIO_FN_VIO0_CLK, NULL); 607 gpio_request(GPIO_FN_VIO0_VD, NULL); 608 gpio_request(GPIO_FN_VIO0_HD, NULL); 609 gpio_request(GPIO_FN_VIO0_FLD, NULL); 610 gpio_request(GPIO_FN_VIO0_D7, NULL); 611 gpio_request(GPIO_FN_VIO0_D6, NULL); 612 gpio_request(GPIO_FN_VIO0_D5, NULL); 613 gpio_request(GPIO_FN_VIO0_D4, NULL); 614 gpio_request(GPIO_FN_VIO0_D3, NULL); 615 gpio_request(GPIO_FN_VIO0_D2, NULL); 616 gpio_request(GPIO_FN_VIO0_D1, NULL); 617 gpio_request(GPIO_FN_VIO0_D0, NULL); 618 619 platform_resource_setup_memory(&kfr2r09_ceu_device, "ceu", 4 << 20); 620 621 /* SDHI0 connected to yc304 */ 622 gpio_request(GPIO_FN_SDHI0CD, NULL); 623 gpio_request(GPIO_FN_SDHI0D3, NULL); 624 gpio_request(GPIO_FN_SDHI0D2, NULL); 625 gpio_request(GPIO_FN_SDHI0D1, NULL); 626 gpio_request(GPIO_FN_SDHI0D0, NULL); 627 gpio_request(GPIO_FN_SDHI0CMD, NULL); 628 gpio_request(GPIO_FN_SDHI0CLK, NULL); 629 630 return platform_add_devices(kfr2r09_devices, 631 ARRAY_SIZE(kfr2r09_devices)); 632 } 633 device_initcall(kfr2r09_devices_setup); 634 635 /* Return the board specific boot mode pin configuration */ 636 static int kfr2r09_mode_pins(void) 637 { 638 /* MD0=1, MD1=1, MD2=0: Clock Mode 3 639 * MD3=0: 16-bit Area0 Bus Width 640 * MD5=1: Little Endian 641 * MD8=1: Test Mode Disabled 642 */ 643 return MODE_PIN0 | MODE_PIN1 | MODE_PIN5 | MODE_PIN8; 644 } 645 646 /* 647 * The Machine Vector 648 */ 649 static struct sh_machine_vector mv_kfr2r09 __initmv = { 650 .mv_name = "kfr2r09", 651 .mv_mode_pins = kfr2r09_mode_pins, 652 }; 653