12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001 |
- // SPDX-License-Identifier: GPL-2.0-only
- /*
- * Hardware definitions for the Toshiba eseries PDAs
- *
- * Copyright (c) 2003 Ian Molton <[email protected]>
- */
- #include <linux/clkdev.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
- #include <linux/clk-provider.h>
- #include <linux/gpio/machine.h>
- #include <linux/gpio.h>
- #include <linux/delay.h>
- #include <linux/platform_device.h>
- #include <linux/mfd/tc6387xb.h>
- #include <linux/mfd/tc6393xb.h>
- #include <linux/mfd/t7l66xb.h>
- #include <linux/mtd/rawnand.h>
- #include <linux/mtd/partitions.h>
- #include <linux/memblock.h>
- #include <linux/gpio/machine.h>
- #include <video/w100fb.h>
- #include <asm/setup.h>
- #include <asm/mach/arch.h>
- #include <asm/mach-types.h>
- #include "pxa25x.h"
- #include "eseries-gpio.h"
- #include "eseries-irq.h"
- #include <linux/platform_data/asoc-pxa.h>
- #include <linux/platform_data/video-pxafb.h>
- #include "udc.h"
- #include <linux/platform_data/irda-pxaficp.h>
- #include "devices.h"
- #include "generic.h"
- /* Only e800 has 128MB RAM */
- void __init eseries_fixup(struct tag *tags, char **cmdline)
- {
- if (machine_is_e800())
- memblock_add(0xa0000000, SZ_128M);
- else
- memblock_add(0xa0000000, SZ_64M);
- }
- static struct gpiod_lookup_table e7xx_gpio_vbus_gpiod_table __maybe_unused = {
- .dev_id = "gpio-vbus",
- .table = {
- GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_DISC,
- "vbus", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_PULLUP,
- "pullup", GPIO_ACTIVE_LOW),
- { },
- },
- };
- static struct platform_device e7xx_gpio_vbus __maybe_unused = {
- .name = "gpio-vbus",
- .id = -1,
- };
- struct pxaficp_platform_data e7xx_ficp_platform_data = {
- .gpio_pwdown = GPIO_E7XX_IR_OFF,
- .transceiver_cap = IR_SIRMODE | IR_OFF,
- };
- int eseries_tmio_enable(struct platform_device *dev)
- {
- /* Reset - bring SUSPEND high before PCLR */
- gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
- gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
- msleep(1);
- gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
- msleep(1);
- gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1);
- msleep(1);
- return 0;
- }
- void eseries_tmio_disable(struct platform_device *dev)
- {
- gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
- gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0);
- }
- int eseries_tmio_suspend(struct platform_device *dev)
- {
- gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0);
- return 0;
- }
- int eseries_tmio_resume(struct platform_device *dev)
- {
- gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1);
- msleep(1);
- return 0;
- }
- void eseries_get_tmio_gpios(void)
- {
- gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL);
- gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL);
- gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0);
- gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0);
- }
- /* TMIO controller uses the same resources on all e-series machines. */
- struct resource eseries_tmio_resources[] = {
- [0] = {
- .start = PXA_CS4_PHYS,
- .end = PXA_CS4_PHYS + 0x1fffff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
- .end = PXA_GPIO_TO_IRQ(GPIO_ESERIES_TMIO_IRQ),
- .flags = IORESOURCE_IRQ,
- },
- };
- /* Some e-series hardware cannot control the 32K clock */
- static void __init __maybe_unused eseries_register_clks(void)
- {
- clk_register_fixed_rate(NULL, "CLK_CK32K", NULL, 0, 32768);
- }
- #ifdef CONFIG_MACH_E330
- /* -------------------- e330 tc6387xb parameters -------------------- */
- static struct tc6387xb_platform_data e330_tc6387xb_info = {
- .enable = &eseries_tmio_enable,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- };
- static struct platform_device e330_tc6387xb_device = {
- .name = "tc6387xb",
- .id = -1,
- .dev = {
- .platform_data = &e330_tc6387xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- /* --------------------------------------------------------------- */
- static struct platform_device *e330_devices[] __initdata = {
- &e330_tc6387xb_device,
- &e7xx_gpio_vbus,
- };
- static void __init e330_init(void)
- {
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- eseries_register_clks();
- eseries_get_tmio_gpios();
- gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
- platform_add_devices(ARRAY_AND_SIZE(e330_devices));
- }
- MACHINE_START(E330, "Toshiba e330")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e330_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
- #ifdef CONFIG_MACH_E350
- /* -------------------- e350 t7l66xb parameters -------------------- */
- static struct t7l66xb_platform_data e350_t7l66xb_info = {
- .irq_base = IRQ_BOARD_START,
- .enable = &eseries_tmio_enable,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- };
- static struct platform_device e350_t7l66xb_device = {
- .name = "t7l66xb",
- .id = -1,
- .dev = {
- .platform_data = &e350_t7l66xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- /* ---------------------------------------------------------- */
- static struct platform_device *e350_devices[] __initdata = {
- &e350_t7l66xb_device,
- &e7xx_gpio_vbus,
- };
- static void __init e350_init(void)
- {
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- eseries_register_clks();
- eseries_get_tmio_gpios();
- gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
- platform_add_devices(ARRAY_AND_SIZE(e350_devices));
- }
- MACHINE_START(E350, "Toshiba e350")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e350_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
- #ifdef CONFIG_MACH_E400
- /* ------------------------ E400 LCD definitions ------------------------ */
- static struct pxafb_mode_info e400_pxafb_mode_info = {
- .pixclock = 140703,
- .xres = 240,
- .yres = 320,
- .bpp = 16,
- .hsync_len = 4,
- .left_margin = 28,
- .right_margin = 8,
- .vsync_len = 3,
- .upper_margin = 5,
- .lower_margin = 6,
- .sync = 0,
- };
- static struct pxafb_mach_info e400_pxafb_mach_info = {
- .modes = &e400_pxafb_mode_info,
- .num_modes = 1,
- .lcd_conn = LCD_COLOR_TFT_16BPP,
- .lccr3 = 0,
- .pxafb_backlight_power = NULL,
- };
- /* ------------------------ E400 MFP config ----------------------------- */
- static unsigned long e400_pin_config[] __initdata = {
- /* Chip selects */
- GPIO15_nCS_1, /* CS1 - Flash */
- GPIO80_nCS_4, /* CS4 - TMIO */
- /* Clocks */
- GPIO12_32KHz,
- /* BTUART */
- GPIO42_BTUART_RXD,
- GPIO43_BTUART_TXD,
- GPIO44_BTUART_CTS,
- /* TMIO controller */
- GPIO19_GPIO, /* t7l66xb #PCLR */
- GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
- /* wakeup */
- GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
- };
- /* ---------------------------------------------------------------------- */
- static struct mtd_partition partition_a = {
- .name = "Internal NAND flash",
- .offset = 0,
- .size = MTDPART_SIZ_FULL,
- };
- static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
- static struct nand_bbt_descr e400_t7l66xb_nand_bbt = {
- .options = 0,
- .offs = 4,
- .len = 2,
- .pattern = scan_ff_pattern
- };
- static struct tmio_nand_data e400_t7l66xb_nand_config = {
- .num_partitions = 1,
- .partition = &partition_a,
- .badblock_pattern = &e400_t7l66xb_nand_bbt,
- };
- static struct t7l66xb_platform_data e400_t7l66xb_info = {
- .irq_base = IRQ_BOARD_START,
- .enable = &eseries_tmio_enable,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- .nand_data = &e400_t7l66xb_nand_config,
- };
- static struct platform_device e400_t7l66xb_device = {
- .name = "t7l66xb",
- .id = -1,
- .dev = {
- .platform_data = &e400_t7l66xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- /* ---------------------------------------------------------- */
- static struct platform_device *e400_devices[] __initdata = {
- &e400_t7l66xb_device,
- &e7xx_gpio_vbus,
- };
- static void __init e400_init(void)
- {
- pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config));
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- /* Fixme - e400 may have a switched clock */
- eseries_register_clks();
- eseries_get_tmio_gpios();
- pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
- gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
- platform_add_devices(ARRAY_AND_SIZE(e400_devices));
- }
- MACHINE_START(E400, "Toshiba e400")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e400_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
- #ifdef CONFIG_MACH_E740
- /* ------------------------ e740 video support --------------------------- */
- static struct w100_gen_regs e740_lcd_regs = {
- .lcd_format = 0x00008023,
- .lcdd_cntl1 = 0x0f000000,
- .lcdd_cntl2 = 0x0003ffff,
- .genlcd_cntl1 = 0x00ffff03,
- .genlcd_cntl2 = 0x003c0f03,
- .genlcd_cntl3 = 0x000143aa,
- };
- static struct w100_mode e740_lcd_mode = {
- .xres = 240,
- .yres = 320,
- .left_margin = 20,
- .right_margin = 28,
- .upper_margin = 9,
- .lower_margin = 8,
- .crtc_ss = 0x80140013,
- .crtc_ls = 0x81150110,
- .crtc_gs = 0x80050005,
- .crtc_vpos_gs = 0x000a0009,
- .crtc_rev = 0x0040010a,
- .crtc_dclk = 0xa906000a,
- .crtc_gclk = 0x80050108,
- .crtc_goe = 0x80050108,
- .pll_freq = 57,
- .pixclk_divider = 4,
- .pixclk_divider_rotated = 4,
- .pixclk_src = CLK_SRC_XTAL,
- .sysclk_divider = 1,
- .sysclk_src = CLK_SRC_PLL,
- .crtc_ps1_active = 0x41060010,
- };
- static struct w100_gpio_regs e740_w100_gpio_info = {
- .init_data1 = 0x21002103,
- .gpio_dir1 = 0xffffdeff,
- .gpio_oe1 = 0x03c00643,
- .init_data2 = 0x003f003f,
- .gpio_dir2 = 0xffffffff,
- .gpio_oe2 = 0x000000ff,
- };
- static struct w100fb_mach_info e740_fb_info = {
- .modelist = &e740_lcd_mode,
- .num_modes = 1,
- .regs = &e740_lcd_regs,
- .gpio = &e740_w100_gpio_info,
- .xtal_freq = 14318000,
- .xtal_dbl = 1,
- };
- static struct resource e740_fb_resources[] = {
- [0] = {
- .start = 0x0c000000,
- .end = 0x0cffffff,
- .flags = IORESOURCE_MEM,
- },
- };
- static struct platform_device e740_fb_device = {
- .name = "w100fb",
- .id = -1,
- .dev = {
- .platform_data = &e740_fb_info,
- },
- .num_resources = ARRAY_SIZE(e740_fb_resources),
- .resource = e740_fb_resources,
- };
- /* --------------------------- MFP Pin config -------------------------- */
- static unsigned long e740_pin_config[] __initdata = {
- /* Chip selects */
- GPIO15_nCS_1, /* CS1 - Flash */
- GPIO79_nCS_3, /* CS3 - IMAGEON */
- GPIO80_nCS_4, /* CS4 - TMIO */
- /* Clocks */
- GPIO12_32KHz,
- /* BTUART */
- GPIO42_BTUART_RXD,
- GPIO43_BTUART_TXD,
- GPIO44_BTUART_CTS,
- /* TMIO controller */
- GPIO19_GPIO, /* t7l66xb #PCLR */
- GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
- /* UDC */
- GPIO13_GPIO,
- GPIO3_GPIO,
- /* IrDA */
- GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
- /* AC97 */
- GPIO28_AC97_BITCLK,
- GPIO29_AC97_SDATA_IN_0,
- GPIO30_AC97_SDATA_OUT,
- GPIO31_AC97_SYNC,
- /* Audio power control */
- GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
- GPIO40_GPIO, /* Mic amp power */
- GPIO41_GPIO, /* Headphone amp power */
- /* PC Card */
- GPIO8_GPIO, /* CD0 */
- GPIO44_GPIO, /* CD1 */
- GPIO11_GPIO, /* IRQ0 */
- GPIO6_GPIO, /* IRQ1 */
- GPIO27_GPIO, /* RST0 */
- GPIO24_GPIO, /* RST1 */
- GPIO20_GPIO, /* PWR0 */
- GPIO23_GPIO, /* PWR1 */
- GPIO48_nPOE,
- GPIO49_nPWE,
- GPIO50_nPIOR,
- GPIO51_nPIOW,
- GPIO52_nPCE_1,
- GPIO53_nPCE_2,
- GPIO54_nPSKTSEL,
- GPIO55_nPREG,
- GPIO56_nPWAIT,
- GPIO57_nIOIS16,
- /* wakeup */
- GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
- };
- /* -------------------- e740 t7l66xb parameters -------------------- */
- static struct t7l66xb_platform_data e740_t7l66xb_info = {
- .irq_base = IRQ_BOARD_START,
- .enable = &eseries_tmio_enable,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- };
- static struct platform_device e740_t7l66xb_device = {
- .name = "t7l66xb",
- .id = -1,
- .dev = {
- .platform_data = &e740_t7l66xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- static struct platform_device e740_audio_device = {
- .name = "e740-audio",
- .id = -1,
- };
- static struct gpiod_lookup_table e740_audio_gpio_table = {
- .dev_id = "e740-audio",
- .table = {
- GPIO_LOOKUP("gpio-pxa", GPIO_E740_WM9705_nAVDD2, "Audio power", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("gpio-pxa", GPIO_E740_AMP_ON, "Output amp", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("gpio-pxa", GPIO_E740_MIC_ON, "Mic amp", GPIO_ACTIVE_HIGH),
- { },
- },
- };
- /* ----------------------------------------------------------------------- */
- static struct platform_device *e740_devices[] __initdata = {
- &e740_fb_device,
- &e740_t7l66xb_device,
- &e7xx_gpio_vbus,
- &e740_audio_device,
- };
- static void __init e740_init(void)
- {
- pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config));
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- eseries_register_clks();
- clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
- "UDCCLK", &pxa25x_device_udc.dev),
- eseries_get_tmio_gpios();
- gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
- gpiod_add_lookup_table(&e740_audio_gpio_table);
- platform_add_devices(ARRAY_AND_SIZE(e740_devices));
- pxa_set_ac97_info(NULL);
- pxa_set_ficp_info(&e7xx_ficp_platform_data);
- }
- MACHINE_START(E740, "Toshiba e740")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e740_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
- #ifdef CONFIG_MACH_E750
- /* ---------------------- E750 LCD definitions -------------------- */
- static struct w100_gen_regs e750_lcd_regs = {
- .lcd_format = 0x00008003,
- .lcdd_cntl1 = 0x00000000,
- .lcdd_cntl2 = 0x0003ffff,
- .genlcd_cntl1 = 0x00fff003,
- .genlcd_cntl2 = 0x003c0f03,
- .genlcd_cntl3 = 0x000143aa,
- };
- static struct w100_mode e750_lcd_mode = {
- .xres = 240,
- .yres = 320,
- .left_margin = 21,
- .right_margin = 22,
- .upper_margin = 5,
- .lower_margin = 4,
- .crtc_ss = 0x80150014,
- .crtc_ls = 0x8014000d,
- .crtc_gs = 0xc1000005,
- .crtc_vpos_gs = 0x00020147,
- .crtc_rev = 0x0040010a,
- .crtc_dclk = 0xa1700030,
- .crtc_gclk = 0x80cc0015,
- .crtc_goe = 0x80cc0015,
- .crtc_ps1_active = 0x61060017,
- .pll_freq = 57,
- .pixclk_divider = 4,
- .pixclk_divider_rotated = 4,
- .pixclk_src = CLK_SRC_XTAL,
- .sysclk_divider = 1,
- .sysclk_src = CLK_SRC_PLL,
- };
- static struct w100_gpio_regs e750_w100_gpio_info = {
- .init_data1 = 0x01192f1b,
- .gpio_dir1 = 0xd5ffdeff,
- .gpio_oe1 = 0x000020bf,
- .init_data2 = 0x010f010f,
- .gpio_dir2 = 0xffffffff,
- .gpio_oe2 = 0x000001cf,
- };
- static struct w100fb_mach_info e750_fb_info = {
- .modelist = &e750_lcd_mode,
- .num_modes = 1,
- .regs = &e750_lcd_regs,
- .gpio = &e750_w100_gpio_info,
- .xtal_freq = 14318000,
- .xtal_dbl = 1,
- };
- static struct resource e750_fb_resources[] = {
- [0] = {
- .start = 0x0c000000,
- .end = 0x0cffffff,
- .flags = IORESOURCE_MEM,
- },
- };
- static struct platform_device e750_fb_device = {
- .name = "w100fb",
- .id = -1,
- .dev = {
- .platform_data = &e750_fb_info,
- },
- .num_resources = ARRAY_SIZE(e750_fb_resources),
- .resource = e750_fb_resources,
- };
- /* -------------------- e750 MFP parameters -------------------- */
- static unsigned long e750_pin_config[] __initdata = {
- /* Chip selects */
- GPIO15_nCS_1, /* CS1 - Flash */
- GPIO79_nCS_3, /* CS3 - IMAGEON */
- GPIO80_nCS_4, /* CS4 - TMIO */
- /* Clocks */
- GPIO11_3_6MHz,
- /* BTUART */
- GPIO42_BTUART_RXD,
- GPIO43_BTUART_TXD,
- GPIO44_BTUART_CTS,
- /* TMIO controller */
- GPIO19_GPIO, /* t7l66xb #PCLR */
- GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
- /* UDC */
- GPIO13_GPIO,
- GPIO3_GPIO,
- /* IrDA */
- GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
- /* AC97 */
- GPIO28_AC97_BITCLK,
- GPIO29_AC97_SDATA_IN_0,
- GPIO30_AC97_SDATA_OUT,
- GPIO31_AC97_SYNC,
- /* Audio power control */
- GPIO4_GPIO, /* Headphone amp power */
- GPIO7_GPIO, /* Speaker amp power */
- GPIO37_GPIO, /* Headphone detect */
- /* PC Card */
- GPIO8_GPIO, /* CD0 */
- GPIO44_GPIO, /* CD1 */
- /* GPIO11_GPIO, IRQ0 */
- GPIO6_GPIO, /* IRQ1 */
- GPIO27_GPIO, /* RST0 */
- GPIO24_GPIO, /* RST1 */
- GPIO20_GPIO, /* PWR0 */
- GPIO23_GPIO, /* PWR1 */
- GPIO48_nPOE,
- GPIO49_nPWE,
- GPIO50_nPIOR,
- GPIO51_nPIOW,
- GPIO52_nPCE_1,
- GPIO53_nPCE_2,
- GPIO54_nPSKTSEL,
- GPIO55_nPREG,
- GPIO56_nPWAIT,
- GPIO57_nIOIS16,
- /* wakeup */
- GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
- };
- /* ----------------- e750 tc6393xb parameters ------------------ */
- static struct tc6393xb_platform_data e750_tc6393xb_info = {
- .irq_base = IRQ_BOARD_START,
- .scr_pll2cr = 0x0cc1,
- .scr_gper = 0,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- .enable = &eseries_tmio_enable,
- .disable = &eseries_tmio_disable,
- };
- static struct platform_device e750_tc6393xb_device = {
- .name = "tc6393xb",
- .id = -1,
- .dev = {
- .platform_data = &e750_tc6393xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- static struct gpiod_lookup_table e750_audio_gpio_table = {
- .dev_id = "e750-audio",
- .table = {
- GPIO_LOOKUP("gpio-pxa", GPIO_E750_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
- GPIO_LOOKUP("gpio-pxa", GPIO_E750_SPK_AMP_OFF, "Mic amp", GPIO_ACTIVE_LOW),
- { },
- },
- };
- static struct platform_device e750_audio_device = {
- .name = "e750-audio",
- .id = -1,
- };
- /* ------------------------------------------------------------- */
- static struct platform_device *e750_devices[] __initdata = {
- &e750_fb_device,
- &e750_tc6393xb_device,
- &e7xx_gpio_vbus,
- &e750_audio_device,
- };
- static void __init e750_init(void)
- {
- pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
- "GPIO11_CLK", NULL),
- eseries_get_tmio_gpios();
- gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
- gpiod_add_lookup_table(&e750_audio_gpio_table);
- platform_add_devices(ARRAY_AND_SIZE(e750_devices));
- pxa_set_ac97_info(NULL);
- pxa_set_ficp_info(&e7xx_ficp_platform_data);
- }
- MACHINE_START(E750, "Toshiba e750")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e750_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
- #ifdef CONFIG_MACH_E800
- /* ------------------------ e800 LCD definitions ------------------------- */
- static unsigned long e800_pin_config[] __initdata = {
- /* AC97 */
- GPIO28_AC97_BITCLK,
- GPIO29_AC97_SDATA_IN_0,
- GPIO30_AC97_SDATA_OUT,
- GPIO31_AC97_SYNC,
- /* tc6393xb */
- GPIO11_3_6MHz,
- };
- static struct w100_gen_regs e800_lcd_regs = {
- .lcd_format = 0x00008003,
- .lcdd_cntl1 = 0x02a00000,
- .lcdd_cntl2 = 0x0003ffff,
- .genlcd_cntl1 = 0x000ff2a3,
- .genlcd_cntl2 = 0x000002a3,
- .genlcd_cntl3 = 0x000102aa,
- };
- static struct w100_mode e800_lcd_mode[2] = {
- [0] = {
- .xres = 480,
- .yres = 640,
- .left_margin = 52,
- .right_margin = 148,
- .upper_margin = 2,
- .lower_margin = 6,
- .crtc_ss = 0x80350034,
- .crtc_ls = 0x802b0026,
- .crtc_gs = 0x80160016,
- .crtc_vpos_gs = 0x00020003,
- .crtc_rev = 0x0040001d,
- .crtc_dclk = 0xe0000000,
- .crtc_gclk = 0x82a50049,
- .crtc_goe = 0x80ee001c,
- .crtc_ps1_active = 0x00000000,
- .pll_freq = 128,
- .pixclk_divider = 4,
- .pixclk_divider_rotated = 6,
- .pixclk_src = CLK_SRC_PLL,
- .sysclk_divider = 0,
- .sysclk_src = CLK_SRC_PLL,
- },
- [1] = {
- .xres = 240,
- .yres = 320,
- .left_margin = 15,
- .right_margin = 88,
- .upper_margin = 0,
- .lower_margin = 7,
- .crtc_ss = 0xd010000f,
- .crtc_ls = 0x80070003,
- .crtc_gs = 0x80000000,
- .crtc_vpos_gs = 0x01460147,
- .crtc_rev = 0x00400003,
- .crtc_dclk = 0xa1700030,
- .crtc_gclk = 0x814b0008,
- .crtc_goe = 0x80cc0015,
- .crtc_ps1_active = 0x00000000,
- .pll_freq = 100,
- .pixclk_divider = 6, /* Wince uses 14 which gives a */
- .pixclk_divider_rotated = 6, /* 7MHz Pclk. We use a 14MHz one */
- .pixclk_src = CLK_SRC_PLL,
- .sysclk_divider = 0,
- .sysclk_src = CLK_SRC_PLL,
- }
- };
- static struct w100_gpio_regs e800_w100_gpio_info = {
- .init_data1 = 0xc13fc019,
- .gpio_dir1 = 0x3e40df7f,
- .gpio_oe1 = 0x003c3000,
- .init_data2 = 0x00000000,
- .gpio_dir2 = 0x00000000,
- .gpio_oe2 = 0x00000000,
- };
- static struct w100_mem_info e800_w100_mem_info = {
- .ext_cntl = 0x09640011,
- .sdram_mode_reg = 0x00600021,
- .ext_timing_cntl = 0x10001545,
- .io_cntl = 0x7ddd7333,
- .size = 0x1fffff,
- };
- static void e800_tg_change(struct w100fb_par *par)
- {
- unsigned long tmp;
- tmp = w100fb_gpio_read(W100_GPIO_PORT_A);
- if (par->mode->xres == 480)
- tmp |= 0x100;
- else
- tmp &= ~0x100;
- w100fb_gpio_write(W100_GPIO_PORT_A, tmp);
- }
- static struct w100_tg_info e800_tg_info = {
- .change = e800_tg_change,
- };
- static struct w100fb_mach_info e800_fb_info = {
- .modelist = e800_lcd_mode,
- .num_modes = 2,
- .regs = &e800_lcd_regs,
- .gpio = &e800_w100_gpio_info,
- .mem = &e800_w100_mem_info,
- .tg = &e800_tg_info,
- .xtal_freq = 16000000,
- };
- static struct resource e800_fb_resources[] = {
- [0] = {
- .start = 0x0c000000,
- .end = 0x0cffffff,
- .flags = IORESOURCE_MEM,
- },
- };
- static struct platform_device e800_fb_device = {
- .name = "w100fb",
- .id = -1,
- .dev = {
- .platform_data = &e800_fb_info,
- },
- .num_resources = ARRAY_SIZE(e800_fb_resources),
- .resource = e800_fb_resources,
- };
- /* --------------------------- UDC definitions --------------------------- */
- static struct gpiod_lookup_table e800_gpio_vbus_gpiod_table = {
- .dev_id = "gpio-vbus",
- .table = {
- GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_DISC,
- "vbus", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_PULLUP,
- "pullup", GPIO_ACTIVE_LOW),
- { },
- },
- };
- static struct platform_device e800_gpio_vbus = {
- .name = "gpio-vbus",
- .id = -1,
- };
- /* ----------------- e800 tc6393xb parameters ------------------ */
- static struct tc6393xb_platform_data e800_tc6393xb_info = {
- .irq_base = IRQ_BOARD_START,
- .scr_pll2cr = 0x0cc1,
- .scr_gper = 0,
- .suspend = &eseries_tmio_suspend,
- .resume = &eseries_tmio_resume,
- .enable = &eseries_tmio_enable,
- .disable = &eseries_tmio_disable,
- };
- static struct platform_device e800_tc6393xb_device = {
- .name = "tc6393xb",
- .id = -1,
- .dev = {
- .platform_data = &e800_tc6393xb_info,
- },
- .num_resources = 2,
- .resource = eseries_tmio_resources,
- };
- static struct gpiod_lookup_table e800_audio_gpio_table = {
- .dev_id = "e800-audio",
- .table = {
- GPIO_LOOKUP("gpio-pxa", GPIO_E800_HP_AMP_OFF, "Output amp", GPIO_ACTIVE_LOW),
- GPIO_LOOKUP("gpio-pxa", GPIO_E800_SPK_AMP_ON, "Mic amp", GPIO_ACTIVE_HIGH),
- { },
- },
- };
- static struct platform_device e800_audio_device = {
- .name = "e800-audio",
- .id = -1,
- };
- /* ----------------------------------------------------------------------- */
- static struct platform_device *e800_devices[] __initdata = {
- &e800_fb_device,
- &e800_tc6393xb_device,
- &e800_gpio_vbus,
- &e800_audio_device,
- };
- static void __init e800_init(void)
- {
- pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
- pxa_set_ffuart_info(NULL);
- pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
- clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
- "GPIO11_CLK", NULL),
- eseries_get_tmio_gpios();
- gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table);
- gpiod_add_lookup_table(&e800_audio_gpio_table);
- platform_add_devices(ARRAY_AND_SIZE(e800_devices));
- pxa_set_ac97_info(NULL);
- }
- MACHINE_START(E800, "Toshiba e800")
- /* Maintainer: Ian Molton ([email protected]) */
- .atag_offset = 0x100,
- .map_io = pxa25x_map_io,
- .nr_irqs = ESERIES_NR_IRQS,
- .init_irq = pxa25x_init_irq,
- .handle_irq = pxa25x_handle_irq,
- .fixup = eseries_fixup,
- .init_machine = e800_init,
- .init_time = pxa_timer_init,
- .restart = pxa_restart,
- MACHINE_END
- #endif
|