2005-04-16 16:20:36 -06:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-pxa/idp.c
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2001 Cliff Brake, Accelent Systems Inc.
|
|
|
|
*
|
|
|
|
* 2001-09-13: Cliff Brake <cbrake@accelent.com>
|
|
|
|
* Initial code
|
|
|
|
*
|
|
|
|
* 2005-02-15: Cliff Brake <cliff.brake@gmail.com>
|
|
|
|
* <http://www.vibren.com> <http://bec-systems.com>
|
|
|
|
* Updated for 2.6 kernel
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
2006-07-01 15:32:20 -06:00
|
|
|
#include <linux/irq.h>
|
2005-10-29 12:07:23 -06:00
|
|
|
#include <linux/platform_device.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
#include <linux/fb.h>
|
|
|
|
|
|
|
|
#include <asm/setup.h>
|
|
|
|
#include <asm/memory.h>
|
|
|
|
#include <asm/mach-types.h>
|
2008-08-05 09:14:15 -06:00
|
|
|
#include <mach/hardware.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
#include <asm/irq.h>
|
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
|
|
|
#include <asm/mach/map.h>
|
|
|
|
|
2009-01-02 08:17:22 -07:00
|
|
|
#include <mach/pxa25x.h>
|
2008-08-05 09:14:15 -06:00
|
|
|
#include <mach/idp.h>
|
|
|
|
#include <mach/pxafb.h>
|
|
|
|
#include <mach/bitfield.h>
|
|
|
|
#include <mach/mmc.h>
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
#include "generic.h"
|
2007-05-15 08:39:36 -06:00
|
|
|
#include "devices.h"
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
/* TODO:
|
|
|
|
* - add pxa2xx_audio_ops_t device structure
|
|
|
|
* - Ethernet interrupt
|
|
|
|
*/
|
|
|
|
|
2008-08-07 23:33:31 -06:00
|
|
|
static unsigned long idp_pin_config[] __initdata = {
|
2008-08-08 00:17:57 -06:00
|
|
|
/* LCD */
|
|
|
|
GPIO58_LCD_LDD_0,
|
|
|
|
GPIO59_LCD_LDD_1,
|
|
|
|
GPIO60_LCD_LDD_2,
|
|
|
|
GPIO61_LCD_LDD_3,
|
|
|
|
GPIO62_LCD_LDD_4,
|
|
|
|
GPIO63_LCD_LDD_5,
|
|
|
|
GPIO64_LCD_LDD_6,
|
|
|
|
GPIO65_LCD_LDD_7,
|
|
|
|
GPIO66_LCD_LDD_8,
|
|
|
|
GPIO67_LCD_LDD_9,
|
|
|
|
GPIO68_LCD_LDD_10,
|
|
|
|
GPIO69_LCD_LDD_11,
|
|
|
|
GPIO70_LCD_LDD_12,
|
|
|
|
GPIO71_LCD_LDD_13,
|
|
|
|
GPIO72_LCD_LDD_14,
|
|
|
|
GPIO73_LCD_LDD_15,
|
|
|
|
GPIO74_LCD_FCLK,
|
|
|
|
GPIO75_LCD_LCLK,
|
|
|
|
GPIO76_LCD_PCLK,
|
|
|
|
|
2008-08-07 23:33:31 -06:00
|
|
|
/* BTUART */
|
|
|
|
GPIO42_BTUART_RXD,
|
|
|
|
GPIO43_BTUART_TXD,
|
|
|
|
GPIO44_BTUART_CTS,
|
|
|
|
GPIO45_BTUART_RTS,
|
|
|
|
|
|
|
|
/* STUART */
|
|
|
|
GPIO46_STUART_RXD,
|
|
|
|
GPIO47_STUART_TXD,
|
|
|
|
|
|
|
|
/* MMC */
|
|
|
|
GPIO6_MMC_CLK,
|
|
|
|
GPIO8_MMC_CS0,
|
|
|
|
|
|
|
|
/* Ethernet */
|
|
|
|
GPIO33_nCS_5, /* Ethernet CS */
|
|
|
|
GPIO4_GPIO, /* Ethernet IRQ */
|
|
|
|
};
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
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),
|
2008-01-14 15:30:10 -07:00
|
|
|
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-20 15:54:21 -06:00
|
|
|
static void idp_lcd_power(int on, struct fb_var_screeninfo *var)
|
2005-04-16 16:20:36 -06:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2006-09-20 15:54:21 -06:00
|
|
|
static struct pxafb_mode_info sharp_lm8v31_mode = {
|
2005-04-16 16:20:36 -06:00
|
|
|
.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,
|
2006-09-20 15:54:21 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct pxafb_mach_info sharp_lm8v31 = {
|
|
|
|
.modes = &sharp_lm8v31_mode,
|
|
|
|
.num_modes = 1,
|
2005-04-16 16:20:36 -06:00
|
|
|
.cmap_inverse = 0,
|
|
|
|
.cmap_static = 0,
|
2008-08-08 00:17:57 -06:00
|
|
|
.lcd_conn = LCD_COLOR_DSTN_16BPP | LCD_PCLK_EDGE_FALL |
|
|
|
|
LCD_AC_BIAS_FREQ(255),
|
2005-04-16 16:20:36 -06:00
|
|
|
.pxafb_backlight_power = &idp_backlight_power,
|
|
|
|
.pxafb_lcd_power = &idp_lcd_power
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct pxamci_platform_data idp_mci_platform_data = {
|
|
|
|
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void __init idp_init(void)
|
|
|
|
{
|
|
|
|
printk("idp_init()\n");
|
|
|
|
|
2008-08-07 23:33:31 -06:00
|
|
|
pxa2xx_mfp_config(ARRAY_AND_SIZE(idp_pin_config));
|
|
|
|
|
2005-04-16 16:20:36 -06:00
|
|
|
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 struct map_desc idp_io_desc[] __initdata = {
|
2005-10-28 08:19:01 -06:00
|
|
|
{
|
|
|
|
.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
|
|
|
|
}
|
2005-04-16 16:20:36 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static void __init idp_map_io(void)
|
|
|
|
{
|
|
|
|
pxa_map_io();
|
|
|
|
iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
|
2005-07-03 10:38:58 -06:00
|
|
|
/* Maintainer: Vibren Technologies */
|
|
|
|
.phys_io = 0x40000000,
|
2005-07-04 03:44:34 -06:00
|
|
|
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
2005-07-03 10:38:58 -06:00
|
|
|
.map_io = idp_map_io,
|
2008-08-08 00:33:29 -06:00
|
|
|
.init_irq = pxa25x_init_irq,
|
2005-04-16 16:20:36 -06:00
|
|
|
.timer = &pxa_timer,
|
2005-07-03 10:38:58 -06:00
|
|
|
.init_machine = idp_init,
|
2005-04-16 16:20:36 -06:00
|
|
|
MACHINE_END
|