X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fmach-pxa%2Fidp.c;h=64df44043a654f88826edd7e2e65470d41bdf455;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=5e6468a5af351aadfa4874599002b5f5a505a4be;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 5e6468a5a..64df44043 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -10,13 +10,17 @@ * 2001-09-13: Cliff Brake * Initial code * - * Expected command line: mem=32M initrd=0xa1000000,4M root=/dev/ram ramdisk=8192 + * 2005-02-15: Cliff Brake + * + * Updated for 2.6 kernel + * */ -#include + #include -#include -#include #include +#include +#include +#include #include #include @@ -27,70 +31,144 @@ #include #include -#include "generic.h" +#include +#include +#include +#include +#include -#ifndef PXA_IDP_REV02 -/* shadow registers for write only registers */ -unsigned int idp_cpld_led_control_shadow = 0x1; -unsigned int idp_cpld_periph_pwr_shadow = 0xd; -unsigned int ipd_cpld_cir_shadow = 0; -unsigned int idp_cpld_kb_col_high_shadow = 0; -unsigned int idp_cpld_kb_col_low_shadow = 0; -unsigned int idp_cpld_pccard_en_shadow = 0xC3; -unsigned int idp_cpld_gpioh_dir_shadow = 0; -unsigned int idp_cpld_gpioh_value_shadow = 0; -unsigned int idp_cpld_gpiol_dir_shadow = 0; -unsigned int idp_cpld_gpiol_value_shadow = 0; +#include "generic.h" -/* - * enable all LCD signals -- they should still be on - * write protect flash - * enable all serial port transceivers +/* TODO: + * - add pxa2xx_audio_ops_t device structure + * - Ethernet interrupt */ -unsigned int idp_control_port_shadow = ((0x7 << 21) | /* LCD power */ - (0x1 << 19) | /* disable flash write enable */ - (0x7 << 9)); /* enable serial port transeivers */ +static struct resource smc91x_resources[] = { + [0] = { + .start = (IDP_ETH_PHYS + 0x300), + .end = (IDP_ETH_PHYS + 0xfffff), + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = IRQ_GPIO(4), + .end = IRQ_GPIO(4), + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device smc91x_device = { + .name = "smc91x", + .id = 0, + .num_resources = ARRAY_SIZE(smc91x_resources), + .resource = smc91x_resources, +}; + +static void idp_backlight_power(int on) +{ + if (on) { + IDP_CPLD_LCD |= (1<<1); + } else { + IDP_CPLD_LCD &= ~(1<<1); + } +} + +static void idp_vlcd(int on) +{ + if (on) { + IDP_CPLD_LCD |= (1<<2); + } else { + IDP_CPLD_LCD &= ~(1<<2); + } +} + +static void idp_lcd_power(int on, struct fb_var_screeninfo *var) +{ + if (on) { + IDP_CPLD_LCD |= (1<<0); + } else { + IDP_CPLD_LCD &= ~(1<<0); + } + + /* call idp_vlcd for now as core driver does not support + * both power and vlcd hooks. Note, this is not technically + * the correct sequence, but seems to work. Disclaimer: + * this may eventually damage the display. + */ + + idp_vlcd(on); +} + +static struct pxafb_mode_info sharp_lm8v31_mode = { + .pixclock = 270000, + .xres = 640, + .yres = 480, + .bpp = 16, + .hsync_len = 1, + .left_margin = 3, + .right_margin = 3, + .vsync_len = 1, + .upper_margin = 0, + .lower_margin = 0, + .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, + .cmap_greyscale = 0, +}; -#endif +static struct pxafb_mach_info sharp_lm8v31 = { + .modes = &sharp_lm8v31_mode, + .num_modes = 1, + .cmap_inverse = 0, + .cmap_static = 0, + .lccr0 = LCCR0_SDS, + .lccr3 = LCCR3_PCP | LCCR3_Acb(255), + .pxafb_backlight_power = &idp_backlight_power, + .pxafb_lcd_power = &idp_lcd_power +}; + +static int idp_mci_init(struct device *dev, irq_handler_t idp_detect_int, void *data) +{ + /* setup GPIO for PXA25x MMC controller */ + pxa_gpio_mode(GPIO6_MMCCLK_MD); + pxa_gpio_mode(GPIO8_MMCCS0_MD); + + return 0; +} + +static struct pxamci_platform_data idp_mci_platform_data = { + .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, + .init = idp_mci_init, +}; static void __init idp_init(void) { printk("idp_init()\n"); + + platform_device_register(&smc91x_device); + //platform_device_register(&mst_audio_device); + set_pxa_fb_info(&sharp_lm8v31); + pxa_set_mci_info(&idp_mci_platform_data); } static void __init idp_init_irq(void) { + pxa_init_irq(); + + set_irq_type(TOUCH_PANEL_IRQ, TOUCH_PANEL_IRQ_EDGE); } static struct map_desc idp_io_desc[] __initdata = { - /* virtual physical length type */ - - -#ifndef PXA_IDP_REV02 - { IDP_CTRL_PORT_BASE, - IDP_CTRL_PORT_PHYS, - IDP_CTRL_PORT_SIZE, - MT_DEVICE }, -#endif - - { IDP_IDE_BASE, - IDP_IDE_PHYS, - IDP_IDE_SIZE, - MT_DEVICE }, - { IDP_ETH_BASE, - IDP_ETH_PHYS, - IDP_ETH_SIZE, - MT_DEVICE }, - { IDP_COREVOLT_BASE, - IDP_COREVOLT_PHYS, - IDP_COREVOLT_SIZE, - MT_DEVICE }, - { IDP_CPLD_BASE, - IDP_CPLD_PHYS, - IDP_CPLD_SIZE, - MT_DEVICE } + { + .virtual = IDP_COREVOLT_VIRT, + .pfn = __phys_to_pfn(IDP_COREVOLT_PHYS), + .length = IDP_COREVOLT_SIZE, + .type = MT_DEVICE + }, { + .virtual = IDP_CPLD_VIRT, + .pfn = __phys_to_pfn(IDP_CPLD_PHYS), + .length = IDP_CPLD_SIZE, + .type = MT_DEVICE + } }; static void __init idp_map_io(void) @@ -98,8 +176,6 @@ static void __init idp_map_io(void) pxa_map_io(); iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); - set_irq_type(IRQ_TO_GPIO_2_80(TOUCH_PANEL_IRQ), TOUCH_PANEL_IRQ_EDGE); - // serial ports 2 & 3 pxa_gpio_mode(GPIO42_BTRXD_MD); pxa_gpio_mode(GPIO43_BTTXD_MD); @@ -111,10 +187,12 @@ static void __init idp_map_io(void) } -MACHINE_START(PXA_IDP, "Accelent Xscale IDP") - MAINTAINER("Accelent Systems Inc.") - BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) - MAPIO(idp_map_io) - INITIRQ(idp_init_irq) - INIT_MACHINE(idp_init) +MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") + /* Maintainer: Vibren Technologies */ + .phys_io = 0x40000000, + .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, + .map_io = idp_map_io, + .init_irq = idp_init_irq, + .timer = &pxa_timer, + .init_machine = idp_init, MACHINE_END