Path: blob/master/arch/sh/boards/mach-se/7724/setup.c
15162 views
/*1* linux/arch/sh/boards/se/7724/setup.c2*3* Copyright (C) 2009 Renesas Solutions Corp.4*5* Kuninori Morimoto <[email protected]>6*7* This file is subject to the terms and conditions of the GNU General Public8* License. See the file "COPYING" in the main directory of this archive9* for more details.10*/1112#include <linux/init.h>13#include <linux/device.h>14#include <linux/interrupt.h>15#include <linux/platform_device.h>16#include <linux/mmc/host.h>17#include <linux/mmc/sh_mobile_sdhi.h>18#include <linux/mtd/physmap.h>19#include <linux/delay.h>20#include <linux/smc91x.h>21#include <linux/gpio.h>22#include <linux/input.h>23#include <linux/input/sh_keysc.h>24#include <linux/usb/r8a66597.h>25#include <video/sh_mobile_lcdc.h>26#include <media/sh_mobile_ceu.h>27#include <sound/sh_fsi.h>28#include <asm/io.h>29#include <asm/heartbeat.h>30#include <asm/sh_eth.h>31#include <asm/clock.h>32#include <asm/suspend.h>33#include <cpu/sh7724.h>34#include <mach-se/mach/se7724.h>3536/*37* SWx 1234 567838* ------------------------------------39* SW31 : 1001 1100 : default40* SW32 : 0111 1111 : use on board flash41*42* SW41 : abxx xxxx -> a = 0 : Analog monitor43* 1 : Digital monitor44* b = 0 : VGA45* 1 : 720p46*/4748/*49* about 720p50*51* When you use 1280 x 720 lcdc output,52* you should change OSC6 lcdc clock from 25.175MHz to 74.25MHz,53* and change SW41 to use 720p54*/5556/*57* about sound58*59* This setup.c supports FSI slave mode.60* Please change J20, J21, J22 pin to 1-2 connection.61*/6263/* Heartbeat */64static struct resource heartbeat_resource = {65.start = PA_LED,66.end = PA_LED,67.flags = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,68};6970static struct platform_device heartbeat_device = {71.name = "heartbeat",72.id = -1,73.num_resources = 1,74.resource = &heartbeat_resource,75};7677/* LAN91C111 */78static struct smc91x_platdata smc91x_info = {79.flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,80};8182static struct resource smc91x_eth_resources[] = {83[0] = {84.name = "SMC91C111" ,85.start = 0x1a300300,86.end = 0x1a30030f,87.flags = IORESOURCE_MEM,88},89[1] = {90.start = IRQ0_SMC,91.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,92},93};9495static struct platform_device smc91x_eth_device = {96.name = "smc91x",97.num_resources = ARRAY_SIZE(smc91x_eth_resources),98.resource = smc91x_eth_resources,99.dev = {100.platform_data = &smc91x_info,101},102};103104/* MTD */105static struct mtd_partition nor_flash_partitions[] = {106{107.name = "uboot",108.offset = 0,109.size = (1 * 1024 * 1024),110.mask_flags = MTD_WRITEABLE, /* Read-only */111}, {112.name = "kernel",113.offset = MTDPART_OFS_APPEND,114.size = (2 * 1024 * 1024),115}, {116.name = "free-area",117.offset = MTDPART_OFS_APPEND,118.size = MTDPART_SIZ_FULL,119},120};121122static struct physmap_flash_data nor_flash_data = {123.width = 2,124.parts = nor_flash_partitions,125.nr_parts = ARRAY_SIZE(nor_flash_partitions),126};127128static struct resource nor_flash_resources[] = {129[0] = {130.name = "NOR Flash",131.start = 0x00000000,132.end = 0x01ffffff,133.flags = IORESOURCE_MEM,134}135};136137static struct platform_device nor_flash_device = {138.name = "physmap-flash",139.resource = nor_flash_resources,140.num_resources = ARRAY_SIZE(nor_flash_resources),141.dev = {142.platform_data = &nor_flash_data,143},144};145146/* LCDC */147const static struct fb_videomode lcdc_720p_modes[] = {148{149.name = "LB070WV1",150.sync = 0, /* hsync and vsync are active low */151.xres = 1280,152.yres = 720,153.left_margin = 220,154.right_margin = 110,155.hsync_len = 40,156.upper_margin = 20,157.lower_margin = 5,158.vsync_len = 5,159},160};161162const static struct fb_videomode lcdc_vga_modes[] = {163{164.name = "LB070WV1",165.sync = 0, /* hsync and vsync are active low */166.xres = 640,167.yres = 480,168.left_margin = 105,169.right_margin = 50,170.hsync_len = 96,171.upper_margin = 33,172.lower_margin = 10,173.vsync_len = 2,174},175};176177static struct sh_mobile_lcdc_info lcdc_info = {178.clock_source = LCDC_CLK_EXTERNAL,179.ch[0] = {180.chan = LCDC_CHAN_MAINLCD,181.bpp = 16,182.clock_divider = 1,183.lcd_size_cfg = { /* 7.0 inch */184.width = 152,185.height = 91,186},187.board_cfg = {188},189}190};191192static struct resource lcdc_resources[] = {193[0] = {194.name = "LCDC",195.start = 0xfe940000,196.end = 0xfe942fff,197.flags = IORESOURCE_MEM,198},199[1] = {200.start = 106,201.flags = IORESOURCE_IRQ,202},203};204205static struct platform_device lcdc_device = {206.name = "sh_mobile_lcdc_fb",207.num_resources = ARRAY_SIZE(lcdc_resources),208.resource = lcdc_resources,209.dev = {210.platform_data = &lcdc_info,211},212.archdata = {213.hwblk_id = HWBLK_LCDC,214},215};216217/* CEU0 */218static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {219.flags = SH_CEU_FLAG_USE_8BIT_BUS,220};221222static struct resource ceu0_resources[] = {223[0] = {224.name = "CEU0",225.start = 0xfe910000,226.end = 0xfe91009f,227.flags = IORESOURCE_MEM,228},229[1] = {230.start = 52,231.flags = IORESOURCE_IRQ,232},233[2] = {234/* place holder for contiguous memory */235},236};237238static struct platform_device ceu0_device = {239.name = "sh_mobile_ceu",240.id = 0, /* "ceu0" clock */241.num_resources = ARRAY_SIZE(ceu0_resources),242.resource = ceu0_resources,243.dev = {244.platform_data = &sh_mobile_ceu0_info,245},246.archdata = {247.hwblk_id = HWBLK_CEU0,248},249};250251/* CEU1 */252static struct sh_mobile_ceu_info sh_mobile_ceu1_info = {253.flags = SH_CEU_FLAG_USE_8BIT_BUS,254};255256static struct resource ceu1_resources[] = {257[0] = {258.name = "CEU1",259.start = 0xfe914000,260.end = 0xfe91409f,261.flags = IORESOURCE_MEM,262},263[1] = {264.start = 63,265.flags = IORESOURCE_IRQ,266},267[2] = {268/* place holder for contiguous memory */269},270};271272static struct platform_device ceu1_device = {273.name = "sh_mobile_ceu",274.id = 1, /* "ceu1" clock */275.num_resources = ARRAY_SIZE(ceu1_resources),276.resource = ceu1_resources,277.dev = {278.platform_data = &sh_mobile_ceu1_info,279},280.archdata = {281.hwblk_id = HWBLK_CEU1,282},283};284285/* FSI */286/* change J20, J21, J22 pin to 1-2 connection to use slave mode */287static struct sh_fsi_platform_info fsi_info = {288.porta_flags = SH_FSI_BRS_INV,289};290291static struct resource fsi_resources[] = {292[0] = {293.name = "FSI",294.start = 0xFE3C0000,295.end = 0xFE3C021d,296.flags = IORESOURCE_MEM,297},298[1] = {299.start = 108,300.flags = IORESOURCE_IRQ,301},302};303304static struct platform_device fsi_device = {305.name = "sh_fsi",306.id = 0,307.num_resources = ARRAY_SIZE(fsi_resources),308.resource = fsi_resources,309.dev = {310.platform_data = &fsi_info,311},312.archdata = {313.hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */314},315};316317static struct platform_device fsi_ak4642_device = {318.name = "sh_fsi_a_ak4642",319};320321/* KEYSC in SoC (Needs SW33-2 set to ON) */322static struct sh_keysc_info keysc_info = {323.mode = SH_KEYSC_MODE_1,324.scan_timing = 3,325.delay = 50,326.keycodes = {327KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,328KEY_6, KEY_7, KEY_8, KEY_9, KEY_A,329KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,330KEY_G, KEY_H, KEY_I, KEY_K, KEY_L,331KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q,332KEY_R, KEY_S, KEY_T, KEY_U, KEY_V,333},334};335336static struct resource keysc_resources[] = {337[0] = {338.name = "KEYSC",339.start = 0x044b0000,340.end = 0x044b000f,341.flags = IORESOURCE_MEM,342},343[1] = {344.start = 79,345.flags = IORESOURCE_IRQ,346},347};348349static struct platform_device keysc_device = {350.name = "sh_keysc",351.id = 0, /* "keysc0" clock */352.num_resources = ARRAY_SIZE(keysc_resources),353.resource = keysc_resources,354.dev = {355.platform_data = &keysc_info,356},357.archdata = {358.hwblk_id = HWBLK_KEYSC,359},360};361362/* SH Eth */363static struct resource sh_eth_resources[] = {364[0] = {365.start = SH_ETH_ADDR,366.end = SH_ETH_ADDR + 0x1FC,367.flags = IORESOURCE_MEM,368},369[1] = {370.start = 91,371.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,372},373};374375static struct sh_eth_plat_data sh_eth_plat = {376.phy = 0x1f, /* SMSC LAN8187 */377.edmac_endian = EDMAC_LITTLE_ENDIAN,378};379380static struct platform_device sh_eth_device = {381.name = "sh-eth",382.id = 0,383.dev = {384.platform_data = &sh_eth_plat,385},386.num_resources = ARRAY_SIZE(sh_eth_resources),387.resource = sh_eth_resources,388.archdata = {389.hwblk_id = HWBLK_ETHER,390},391};392393static struct r8a66597_platdata sh7724_usb0_host_data = {394.on_chip = 1,395};396397static struct resource sh7724_usb0_host_resources[] = {398[0] = {399.start = 0xa4d80000,400.end = 0xa4d80124 - 1,401.flags = IORESOURCE_MEM,402},403[1] = {404.start = 65,405.end = 65,406.flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,407},408};409410static struct platform_device sh7724_usb0_host_device = {411.name = "r8a66597_hcd",412.id = 0,413.dev = {414.dma_mask = NULL, /* not use dma */415.coherent_dma_mask = 0xffffffff,416.platform_data = &sh7724_usb0_host_data,417},418.num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),419.resource = sh7724_usb0_host_resources,420.archdata = {421.hwblk_id = HWBLK_USB0,422},423};424425static struct r8a66597_platdata sh7724_usb1_gadget_data = {426.on_chip = 1,427};428429static struct resource sh7724_usb1_gadget_resources[] = {430[0] = {431.start = 0xa4d90000,432.end = 0xa4d90123,433.flags = IORESOURCE_MEM,434},435[1] = {436.start = 66,437.end = 66,438.flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,439},440};441442static struct platform_device sh7724_usb1_gadget_device = {443.name = "r8a66597_udc",444.id = 1, /* USB1 */445.dev = {446.dma_mask = NULL, /* not use dma */447.coherent_dma_mask = 0xffffffff,448.platform_data = &sh7724_usb1_gadget_data,449},450.num_resources = ARRAY_SIZE(sh7724_usb1_gadget_resources),451.resource = sh7724_usb1_gadget_resources,452};453454static struct resource sdhi0_cn7_resources[] = {455[0] = {456.name = "SDHI0",457.start = 0x04ce0000,458.end = 0x04ce00ff,459.flags = IORESOURCE_MEM,460},461[1] = {462.start = 100,463.flags = IORESOURCE_IRQ,464},465};466467static struct sh_mobile_sdhi_info sh7724_sdhi0_data = {468.dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,469.dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,470.tmio_caps = MMC_CAP_SDIO_IRQ,471};472473static struct platform_device sdhi0_cn7_device = {474.name = "sh_mobile_sdhi",475.id = 0,476.num_resources = ARRAY_SIZE(sdhi0_cn7_resources),477.resource = sdhi0_cn7_resources,478.dev = {479.platform_data = &sh7724_sdhi0_data,480},481.archdata = {482.hwblk_id = HWBLK_SDHI0,483},484};485486static struct resource sdhi1_cn8_resources[] = {487[0] = {488.name = "SDHI1",489.start = 0x04cf0000,490.end = 0x04cf00ff,491.flags = IORESOURCE_MEM,492},493[1] = {494.start = 23,495.flags = IORESOURCE_IRQ,496},497};498499static struct sh_mobile_sdhi_info sh7724_sdhi1_data = {500.dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,501.dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,502.tmio_caps = MMC_CAP_SDIO_IRQ,503};504505static struct platform_device sdhi1_cn8_device = {506.name = "sh_mobile_sdhi",507.id = 1,508.num_resources = ARRAY_SIZE(sdhi1_cn8_resources),509.resource = sdhi1_cn8_resources,510.dev = {511.platform_data = &sh7724_sdhi1_data,512},513.archdata = {514.hwblk_id = HWBLK_SDHI1,515},516};517518/* IrDA */519static struct resource irda_resources[] = {520[0] = {521.name = "IrDA",522.start = 0xA45D0000,523.end = 0xA45D0049,524.flags = IORESOURCE_MEM,525},526[1] = {527.start = 20,528.flags = IORESOURCE_IRQ,529},530};531532static struct platform_device irda_device = {533.name = "sh_sir",534.num_resources = ARRAY_SIZE(irda_resources),535.resource = irda_resources,536};537538#include <media/ak881x.h>539#include <media/sh_vou.h>540541static struct ak881x_pdata ak881x_pdata = {542.flags = AK881X_IF_MODE_SLAVE,543};544545static struct i2c_board_info ak8813 = {546/* With open J18 jumper address is 0x21 */547I2C_BOARD_INFO("ak8813", 0x20),548.platform_data = &ak881x_pdata,549};550551static struct sh_vou_pdata sh_vou_pdata = {552.bus_fmt = SH_VOU_BUS_8BIT,553.flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,554.board_info = &ak8813,555.i2c_adap = 0,556};557558static struct resource sh_vou_resources[] = {559[0] = {560.start = 0xfe960000,561.end = 0xfe962043,562.flags = IORESOURCE_MEM,563},564[1] = {565.start = 55,566.flags = IORESOURCE_IRQ,567},568};569570static struct platform_device vou_device = {571.name = "sh-vou",572.id = -1,573.num_resources = ARRAY_SIZE(sh_vou_resources),574.resource = sh_vou_resources,575.dev = {576.platform_data = &sh_vou_pdata,577},578.archdata = {579.hwblk_id = HWBLK_VOU,580},581};582583static struct platform_device *ms7724se_devices[] __initdata = {584&heartbeat_device,585&smc91x_eth_device,586&lcdc_device,587&nor_flash_device,588&ceu0_device,589&ceu1_device,590&keysc_device,591&sh_eth_device,592&sh7724_usb0_host_device,593&sh7724_usb1_gadget_device,594&fsi_device,595&fsi_ak4642_device,596&sdhi0_cn7_device,597&sdhi1_cn8_device,598&irda_device,599&vou_device,600};601602/* I2C device */603static struct i2c_board_info i2c0_devices[] = {604{605I2C_BOARD_INFO("ak4642", 0x12),606},607};608609#define EEPROM_OP 0xBA206000610#define EEPROM_ADR 0xBA206004611#define EEPROM_DATA 0xBA20600C612#define EEPROM_STAT 0xBA206010613#define EEPROM_STRT 0xBA206014614static int __init sh_eth_is_eeprom_ready(void)615{616int t = 10000;617618while (t--) {619if (!__raw_readw(EEPROM_STAT))620return 1;621udelay(1);622}623624printk(KERN_ERR "ms7724se can not access to eeprom\n");625return 0;626}627628static void __init sh_eth_init(void)629{630int i;631u16 mac;632633/* check EEPROM status */634if (!sh_eth_is_eeprom_ready())635return;636637/* read MAC addr from EEPROM */638for (i = 0 ; i < 3 ; i++) {639__raw_writew(0x0, EEPROM_OP); /* read */640__raw_writew(i*2, EEPROM_ADR);641__raw_writew(0x1, EEPROM_STRT);642if (!sh_eth_is_eeprom_ready())643return;644645mac = __raw_readw(EEPROM_DATA);646sh_eth_plat.mac_addr[i << 1] = mac & 0xff;647sh_eth_plat.mac_addr[(i << 1) + 1] = mac >> 8;648}649}650651#define SW4140 0xBA201000652#define FPGA_OUT 0xBA200400653#define PORT_HIZA 0xA4050158654#define PORT_MSELCRB 0xA4050182655656#define SW41_A 0x0100657#define SW41_B 0x0200658#define SW41_C 0x0400659#define SW41_D 0x0800660#define SW41_E 0x1000661#define SW41_F 0x2000662#define SW41_G 0x4000663#define SW41_H 0x8000664665extern char ms7724se_sdram_enter_start;666extern char ms7724se_sdram_enter_end;667extern char ms7724se_sdram_leave_start;668extern char ms7724se_sdram_leave_end;669670671static int __init arch_setup(void)672{673/* enable I2C device */674i2c_register_board_info(0, i2c0_devices,675ARRAY_SIZE(i2c0_devices));676return 0;677}678arch_initcall(arch_setup);679680static int __init devices_setup(void)681{682u16 sw = __raw_readw(SW4140); /* select camera, monitor */683struct clk *clk;684u16 fpga_out;685686/* register board specific self-refresh code */687sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |688SUSP_SH_RSTANDBY,689&ms7724se_sdram_enter_start,690&ms7724se_sdram_enter_end,691&ms7724se_sdram_leave_start,692&ms7724se_sdram_leave_end);693/* Reset Release */694fpga_out = __raw_readw(FPGA_OUT);695/* bit4: NTSC_PDN, bit5: NTSC_RESET */696fpga_out &= ~((1 << 1) | /* LAN */697(1 << 4) | /* AK8813 PDN */698(1 << 5) | /* AK8813 RESET */699(1 << 6) | /* VIDEO DAC */700(1 << 7) | /* AK4643 */701(1 << 8) | /* IrDA */702(1 << 12) | /* USB0 */703(1 << 14)); /* RMII */704__raw_writew(fpga_out | (1 << 4), FPGA_OUT);705706udelay(10);707708/* AK8813 RESET */709__raw_writew(fpga_out | (1 << 5), FPGA_OUT);710711udelay(10);712713__raw_writew(fpga_out, FPGA_OUT);714715/* turn on USB clocks, use external clock */716__raw_writew((__raw_readw(PORT_MSELCRB) & ~0xc000) | 0x8000, PORT_MSELCRB);717718/* Let LED9 show STATUS2 */719gpio_request(GPIO_FN_STATUS2, NULL);720721/* Lit LED10 show STATUS0 */722gpio_request(GPIO_FN_STATUS0, NULL);723724/* Lit LED11 show PDSTATUS */725gpio_request(GPIO_FN_PDSTATUS, NULL);726727/* enable USB0 port */728__raw_writew(0x0600, 0xa40501d4);729730/* enable USB1 port */731__raw_writew(0x0600, 0xa4050192);732733/* enable IRQ 0,1,2 */734gpio_request(GPIO_FN_INTC_IRQ0, NULL);735gpio_request(GPIO_FN_INTC_IRQ1, NULL);736gpio_request(GPIO_FN_INTC_IRQ2, NULL);737738/* enable SCIFA3 */739gpio_request(GPIO_FN_SCIF3_I_SCK, NULL);740gpio_request(GPIO_FN_SCIF3_I_RXD, NULL);741gpio_request(GPIO_FN_SCIF3_I_TXD, NULL);742gpio_request(GPIO_FN_SCIF3_I_CTS, NULL);743gpio_request(GPIO_FN_SCIF3_I_RTS, NULL);744745/* enable LCDC */746gpio_request(GPIO_FN_LCDD23, NULL);747gpio_request(GPIO_FN_LCDD22, NULL);748gpio_request(GPIO_FN_LCDD21, NULL);749gpio_request(GPIO_FN_LCDD20, NULL);750gpio_request(GPIO_FN_LCDD19, NULL);751gpio_request(GPIO_FN_LCDD18, NULL);752gpio_request(GPIO_FN_LCDD17, NULL);753gpio_request(GPIO_FN_LCDD16, NULL);754gpio_request(GPIO_FN_LCDD15, NULL);755gpio_request(GPIO_FN_LCDD14, NULL);756gpio_request(GPIO_FN_LCDD13, NULL);757gpio_request(GPIO_FN_LCDD12, NULL);758gpio_request(GPIO_FN_LCDD11, NULL);759gpio_request(GPIO_FN_LCDD10, NULL);760gpio_request(GPIO_FN_LCDD9, NULL);761gpio_request(GPIO_FN_LCDD8, NULL);762gpio_request(GPIO_FN_LCDD7, NULL);763gpio_request(GPIO_FN_LCDD6, NULL);764gpio_request(GPIO_FN_LCDD5, NULL);765gpio_request(GPIO_FN_LCDD4, NULL);766gpio_request(GPIO_FN_LCDD3, NULL);767gpio_request(GPIO_FN_LCDD2, NULL);768gpio_request(GPIO_FN_LCDD1, NULL);769gpio_request(GPIO_FN_LCDD0, NULL);770gpio_request(GPIO_FN_LCDDISP, NULL);771gpio_request(GPIO_FN_LCDHSYN, NULL);772gpio_request(GPIO_FN_LCDDCK, NULL);773gpio_request(GPIO_FN_LCDVSYN, NULL);774gpio_request(GPIO_FN_LCDDON, NULL);775gpio_request(GPIO_FN_LCDVEPWC, NULL);776gpio_request(GPIO_FN_LCDVCPWC, NULL);777gpio_request(GPIO_FN_LCDRD, NULL);778gpio_request(GPIO_FN_LCDLCLK, NULL);779__raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA);780781/* enable CEU0 */782gpio_request(GPIO_FN_VIO0_D15, NULL);783gpio_request(GPIO_FN_VIO0_D14, NULL);784gpio_request(GPIO_FN_VIO0_D13, NULL);785gpio_request(GPIO_FN_VIO0_D12, NULL);786gpio_request(GPIO_FN_VIO0_D11, NULL);787gpio_request(GPIO_FN_VIO0_D10, NULL);788gpio_request(GPIO_FN_VIO0_D9, NULL);789gpio_request(GPIO_FN_VIO0_D8, NULL);790gpio_request(GPIO_FN_VIO0_D7, NULL);791gpio_request(GPIO_FN_VIO0_D6, NULL);792gpio_request(GPIO_FN_VIO0_D5, NULL);793gpio_request(GPIO_FN_VIO0_D4, NULL);794gpio_request(GPIO_FN_VIO0_D3, NULL);795gpio_request(GPIO_FN_VIO0_D2, NULL);796gpio_request(GPIO_FN_VIO0_D1, NULL);797gpio_request(GPIO_FN_VIO0_D0, NULL);798gpio_request(GPIO_FN_VIO0_VD, NULL);799gpio_request(GPIO_FN_VIO0_CLK, NULL);800gpio_request(GPIO_FN_VIO0_FLD, NULL);801gpio_request(GPIO_FN_VIO0_HD, NULL);802platform_resource_setup_memory(&ceu0_device, "ceu0", 4 << 20);803804/* enable CEU1 */805gpio_request(GPIO_FN_VIO1_D7, NULL);806gpio_request(GPIO_FN_VIO1_D6, NULL);807gpio_request(GPIO_FN_VIO1_D5, NULL);808gpio_request(GPIO_FN_VIO1_D4, NULL);809gpio_request(GPIO_FN_VIO1_D3, NULL);810gpio_request(GPIO_FN_VIO1_D2, NULL);811gpio_request(GPIO_FN_VIO1_D1, NULL);812gpio_request(GPIO_FN_VIO1_D0, NULL);813gpio_request(GPIO_FN_VIO1_FLD, NULL);814gpio_request(GPIO_FN_VIO1_HD, NULL);815gpio_request(GPIO_FN_VIO1_VD, NULL);816gpio_request(GPIO_FN_VIO1_CLK, NULL);817platform_resource_setup_memory(&ceu1_device, "ceu1", 4 << 20);818819/* KEYSC */820gpio_request(GPIO_FN_KEYOUT5_IN5, NULL);821gpio_request(GPIO_FN_KEYOUT4_IN6, NULL);822gpio_request(GPIO_FN_KEYIN4, NULL);823gpio_request(GPIO_FN_KEYIN3, NULL);824gpio_request(GPIO_FN_KEYIN2, NULL);825gpio_request(GPIO_FN_KEYIN1, NULL);826gpio_request(GPIO_FN_KEYIN0, NULL);827gpio_request(GPIO_FN_KEYOUT3, NULL);828gpio_request(GPIO_FN_KEYOUT2, NULL);829gpio_request(GPIO_FN_KEYOUT1, NULL);830gpio_request(GPIO_FN_KEYOUT0, NULL);831832/* enable FSI */833gpio_request(GPIO_FN_FSIMCKA, NULL);834gpio_request(GPIO_FN_FSIIASD, NULL);835gpio_request(GPIO_FN_FSIOASD, NULL);836gpio_request(GPIO_FN_FSIIABCK, NULL);837gpio_request(GPIO_FN_FSIIALRCK, NULL);838gpio_request(GPIO_FN_FSIOABCK, NULL);839gpio_request(GPIO_FN_FSIOALRCK, NULL);840gpio_request(GPIO_FN_CLKAUDIOAO, NULL);841842/* set SPU2 clock to 83.4 MHz */843clk = clk_get(NULL, "spu_clk");844if (!IS_ERR(clk)) {845clk_set_rate(clk, clk_round_rate(clk, 83333333));846clk_put(clk);847}848849/* change parent of FSI A */850clk = clk_get(NULL, "fsia_clk");851if (!IS_ERR(clk)) {852/* 48kHz dummy clock was used to make sure 1/1 divide */853clk_set_rate(&sh7724_fsimcka_clk, 48000);854clk_set_parent(clk, &sh7724_fsimcka_clk);855clk_set_rate(clk, 48000);856clk_put(clk);857}858859/* SDHI0 connected to cn7 */860gpio_request(GPIO_FN_SDHI0CD, NULL);861gpio_request(GPIO_FN_SDHI0WP, NULL);862gpio_request(GPIO_FN_SDHI0D3, NULL);863gpio_request(GPIO_FN_SDHI0D2, NULL);864gpio_request(GPIO_FN_SDHI0D1, NULL);865gpio_request(GPIO_FN_SDHI0D0, NULL);866gpio_request(GPIO_FN_SDHI0CMD, NULL);867gpio_request(GPIO_FN_SDHI0CLK, NULL);868869/* SDHI1 connected to cn8 */870gpio_request(GPIO_FN_SDHI1CD, NULL);871gpio_request(GPIO_FN_SDHI1WP, NULL);872gpio_request(GPIO_FN_SDHI1D3, NULL);873gpio_request(GPIO_FN_SDHI1D2, NULL);874gpio_request(GPIO_FN_SDHI1D1, NULL);875gpio_request(GPIO_FN_SDHI1D0, NULL);876gpio_request(GPIO_FN_SDHI1CMD, NULL);877gpio_request(GPIO_FN_SDHI1CLK, NULL);878879/* enable IrDA */880gpio_request(GPIO_FN_IRDA_OUT, NULL);881gpio_request(GPIO_FN_IRDA_IN, NULL);882883/*884* enable SH-Eth885*886* please remove J33 pin from your board !!887*888* ms7724 board should not use GPIO_FN_LNKSTA pin889* So, This time PTX5 is set to input pin890*/891gpio_request(GPIO_FN_RMII_RXD0, NULL);892gpio_request(GPIO_FN_RMII_RXD1, NULL);893gpio_request(GPIO_FN_RMII_TXD0, NULL);894gpio_request(GPIO_FN_RMII_TXD1, NULL);895gpio_request(GPIO_FN_RMII_REF_CLK, NULL);896gpio_request(GPIO_FN_RMII_TX_EN, NULL);897gpio_request(GPIO_FN_RMII_RX_ER, NULL);898gpio_request(GPIO_FN_RMII_CRS_DV, NULL);899gpio_request(GPIO_FN_MDIO, NULL);900gpio_request(GPIO_FN_MDC, NULL);901gpio_request(GPIO_PTX5, NULL);902gpio_direction_input(GPIO_PTX5);903sh_eth_init();904905if (sw & SW41_B) {906/* 720p */907lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes;908lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes);909} else {910/* VGA */911lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes;912lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes);913}914915if (sw & SW41_A) {916/* Digital monitor */917lcdc_info.ch[0].interface_type = RGB18;918lcdc_info.ch[0].flags = 0;919} else {920/* Analog monitor */921lcdc_info.ch[0].interface_type = RGB24;922lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;923}924925/* VOU */926gpio_request(GPIO_FN_DV_D15, NULL);927gpio_request(GPIO_FN_DV_D14, NULL);928gpio_request(GPIO_FN_DV_D13, NULL);929gpio_request(GPIO_FN_DV_D12, NULL);930gpio_request(GPIO_FN_DV_D11, NULL);931gpio_request(GPIO_FN_DV_D10, NULL);932gpio_request(GPIO_FN_DV_D9, NULL);933gpio_request(GPIO_FN_DV_D8, NULL);934gpio_request(GPIO_FN_DV_CLKI, NULL);935gpio_request(GPIO_FN_DV_CLK, NULL);936gpio_request(GPIO_FN_DV_VSYNC, NULL);937gpio_request(GPIO_FN_DV_HSYNC, NULL);938939return platform_add_devices(ms7724se_devices,940ARRAY_SIZE(ms7724se_devices));941}942device_initcall(devices_setup);943944static struct sh_machine_vector mv_ms7724se __initmv = {945.mv_name = "ms7724se",946.mv_init_irq = init_se7724_IRQ,947.mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR,948};949950951