You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jun N. <nie...@gm...> - 2009-11-03 07:30:31
|
2009/11/3 Jun Nie <nie...@gm...>: > pxa: support frame buffer on pxa910 ttc_dkb platform > > Signed-off-by: Jun Nie <nj...@ma...> > --- > arch/arm/configs/pxa910_defconfig | 39 ++++++++- > arch/arm/mach-mmp/include/mach/pxa910.h | 8 ++ > arch/arm/mach-mmp/pxa910.c | 4 + > arch/arm/mach-mmp/ttc_dkb.c | 141 +++++++++++++++++++++++++++++++ > 4 files changed, 191 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/configs/pxa910_defconfig > b/arch/arm/configs/pxa910_defconfig > index 8c7e299..b9b1a85 100644 > --- a/arch/arm/configs/pxa910_defconfig > +++ b/arch/arm/configs/pxa910_defconfig > @@ -578,7 +578,34 @@ CONFIG_SSB_POSSIBLE=y > # > # CONFIG_VGASTATE is not set > # CONFIG_VIDEO_OUTPUT_CONTROL is not set > -# CONFIG_FB is not set > +CONFIG_FB=y > +# CONFIG_FIRMWARE_EDID is not set > +# CONFIG_FB_DDC is not set > +# CONFIG_FB_BOOT_VESA_SUPPORT is not set > +CONFIG_FB_CFB_FILLRECT=y > +CONFIG_FB_CFB_COPYAREA=y > +CONFIG_FB_CFB_IMAGEBLIT=y > +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set > +# CONFIG_FB_SYS_FILLRECT is not set > +# CONFIG_FB_SYS_COPYAREA is not set > +# CONFIG_FB_SYS_IMAGEBLIT is not set > +# CONFIG_FB_FOREIGN_ENDIAN is not set > +# CONFIG_FB_SYS_FOPS is not set > +# CONFIG_FB_SVGALIB is not set > +# CONFIG_FB_MACMODES is not set > +# CONFIG_FB_BACKLIGHT is not set > +# CONFIG_FB_MODE_HELPERS is not set > +# CONFIG_FB_TILEBLITTING is not set > + > +# > +# Frame buffer hardware drivers > +# > +# CONFIG_FB_S1D13XXX is not set > +CONFIG_FB_PXA168=y > +# CONFIG_FB_VIRTUAL is not set > +# CONFIG_FB_METRONOME is not set > +# CONFIG_FB_MB862XX is not set > +# CONFIG_FB_BROADSHEET is not set > # CONFIG_BACKLIGHT_LCD_SUPPORT is not set > > # > @@ -591,6 +618,16 @@ CONFIG_SSB_POSSIBLE=y > # > # CONFIG_VGA_CONSOLE is not set > CONFIG_DUMMY_CONSOLE=y > +CONFIG_FRAMEBUFFER_CONSOLE=y > +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y > +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set > +# CONFIG_FONTS is not set > +CONFIG_FONT_8x8=y > +CONFIG_FONT_8x16=y > +CONFIG_LOGO=y > +# CONFIG_LOGO_LINUX_MONO is not set > +CONFIG_LOGO_LINUX_VGA16=y > +CONFIG_LOGO_LINUX_CLUT224=y > # CONFIG_SOUND is not set > # CONFIG_HID_SUPPORT is not set > # CONFIG_USB_SUPPORT is not set > diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h > b/arch/arm/mach-mmp/include/mach/pxa910.h > index 6ae1ed7..7698793 100644 > --- a/arch/arm/mach-mmp/include/mach/pxa910.h > +++ b/arch/arm/mach-mmp/include/mach/pxa910.h > @@ -4,6 +4,7 @@ > #include <linux/i2c.h> > #include <mach/devices.h> > #include <plat/i2c.h> > +#include <video/pxa168fb.h> > > extern struct pxa_device_desc pxa910_device_uart1; > extern struct pxa_device_desc pxa910_device_uart2; > @@ -13,6 +14,7 @@ extern struct pxa_device_desc pxa910_device_pwm1; > extern struct pxa_device_desc pxa910_device_pwm2; > extern struct pxa_device_desc pxa910_device_pwm3; > extern struct pxa_device_desc pxa910_device_pwm4; > +extern struct pxa_device_desc pxa910_device_fb; > > static inline int pxa910_add_uart(int id) > { > @@ -64,4 +66,10 @@ static inline int pxa910_add_pwm(int id) > > return pxa_register_device(d, NULL, 0); > } > + > +static inline int pxa910_add_fb(struct pxa168fb_mach_info *mi) > +{ > + return pxa_register_device(&pxa910_device_fb, mi, sizeof(*mi)); > +} > + > #endif /* __ASM_MACH_PXA910_H */ > diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c > index 5882ca6..48162a0 100644 > --- a/arch/arm/mach-mmp/pxa910.c > +++ b/arch/arm/mach-mmp/pxa910.c > @@ -110,6 +110,8 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); > static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); > static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); > > +static APMU_CLK(lcd, LCD, 0x003f, 312000000); > + > /* device and clock bindings */ > static struct clk_lookup pxa910_clkregs[] = { > INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), > @@ -120,6 +122,7 @@ static struct clk_lookup pxa910_clkregs[] = { > INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL), > INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), > INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), > + INIT_CLKREG(&clk_lcd, "pxa910-fb", "LCDCLK"), > }; > > static int __init pxa910_init(void) > @@ -174,3 +177,4 @@ PXA910_DEVICE(pwm1, "pxa910-pwm", 0, NONE, > 0xd401a000, 0x10); > PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10); > PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); > PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); > +PXA910_DEVICE(fb, "pxa910-fb", -1, LCD, 0xd420b000, 0x1c8); > diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c > index dbd8cfd..dc04b0d 100644 > --- a/arch/arm/mach-mmp/ttc_dkb.c > +++ b/arch/arm/mach-mmp/ttc_dkb.c > @@ -14,6 +14,8 @@ > #include <linux/mtd/mtd.h> > #include <linux/mtd/partitions.h> > #include <linux/mtd/onenand.h> > +#include <linux/delay.h> > +#include <video/pxa168fb.h> > > #include <asm/mach-types.h> > #include <asm/mach/arch.h> > @@ -21,6 +23,8 @@ > #include <mach/addr-map.h> > #include <mach/mfp-pxa910.h> > #include <mach/pxa910.h> > +#include <mach/gpio.h> > +#include <mach/pxa168fb.h> > > #include "common.h" > > @@ -54,8 +58,142 @@ static unsigned long ttc_dkb_pin_config[] __initdata = { > DF_WEn_DF_WEn, > DF_REn_DF_REn, > DF_RDY0_DF_RDY0, > + > +#ifdef CONFIG_FB_PXA168 > + /* LCD */ > + GPIO81_LCD_FCLK, > + GPIO82_LCD_LCLK, > + GPIO83_LCD_PCLK, > + GPIO84_LCD_DENA, > + GPIO85_LCD_DD0, > + GPIO86_LCD_DD1, > + GPIO87_LCD_DD2, > + GPIO88_LCD_DD3, > + GPIO89_LCD_DD4, > + GPIO90_LCD_DD5, > + GPIO91_LCD_DD6, > + GPIO92_LCD_DD7, > + GPIO93_LCD_DD8, > + GPIO94_LCD_DD9, > + GPIO95_LCD_DD10, > + GPIO96_LCD_DD11, > + GPIO97_LCD_DD12, > + GPIO98_LCD_DD13, > + GPIO100_LCD_DD14, > + GPIO101_LCD_DD15, > + GPIO102_LCD_DD16, > + GPIO103_LCD_DD17, > + GPIO104_LCD_SPIDOUT, > + GPIO105_LCD_SPIDIN, > + GPIO107_LCD_CS1, > + GPIO108_LCD_DCLK, > + GPIO106_LCD_RESET, > +#endif > +}; > + > +#ifdef CONFIG_FB_PXA168 > +static u16 tpo_spi_cmdon[] = { > + 0x0801, > + 0x0800, > + 0x0200, > + 0x0304, > + 0x040e, > + 0x0903, > + 0x0b18, > + 0x0c53, > + 0x0d01, > + 0x0ee0, > + 0x0f01, > + 0x1058, > + 0x201e, > + 0x210a, > + 0x220a, > + 0x231e, > + 0x2400, > + 0x2532, > + 0x2600, > + 0x27ac, > + 0x2904, > + 0x2aa2, > + 0x2b45, > + 0x2c45, > + 0x2d15, > + 0x2e5a, > + 0x2fff, > + 0x306b, > + 0x310d, > + 0x3248, > + 0x3382, > + 0x34bd, > + 0x35e7, > + 0x3618, > + 0x3794, > + 0x3801, > + 0x395d, > + 0x3aae, > + 0x3bff, > + 0x07c9, //auto power on > +}; > + > +static u16 tpo_spi_cmdoff[] = { > + 0x07d9, //auto power off > +}; > + > +static int tpo_lcd_power(struct pxa168fb_info *fbi, unsigned int > spi_gpio_cs, unsigned int spi_gpio_reset, int on) > +{ > + int err = 0; > + > + if (on) { > + if (spi_gpio_reset != -1) { > + err = gpio_request(spi_gpio_reset, "TPO_LCD_SPI_RESET"); > + if (err) { > + printk("failed to request GPIO for TPO LCD RESET\n"); > + return -1; > + } > + gpio_direction_output(spi_gpio_reset, 0); > + msleep(100); > + gpio_set_value(spi_gpio_reset, 1); > + msleep(100); > + gpio_free(spi_gpio_reset); > + } > + return pxa168fb_spi_send(fbi, tpo_spi_cmdon, > ARRAY_SIZE(tpo_spi_cmdon), spi_gpio_cs, 20); > + } else > + return pxa168fb_spi_send(fbi, tpo_spi_cmdoff, > ARRAY_SIZE(tpo_spi_cmdoff), spi_gpio_cs, 0); > +} > + > +static struct fb_videomode video_modes[] = { > + /* lpj032l001b HVGA mode info */ > + [0] = { > + .pixclock = 100000, > + .refresh = 60, > + .xres = 320, > + .yres = 480, > + .hsync_len = 10, > + .left_margin = 15, > + .right_margin = 10, > + .vsync_len = 2, > + .upper_margin = 4, > + .lower_margin = 2, > + .sync = 0, > + }, > }; > > +static struct pxa168fb_mach_info ttc_dkb_lcd_info __initdata = { > + .id = "Base", > + .modes = video_modes, > + .num_modes = ARRAY_SIZE(video_modes), > + .pix_fmt = PIX_FMT_RGB565, > + .io_pin_allocation_mode = PIN_MODE_DUMB_18_SPI, > + .dumb_mode = DUMB_MODE_RGB666, > + .active = 1, > + .spi_ctrl = CFG_SCLKCNT(16) | CFG_TXBITS(16) | > CFG_SPI_SEL(1) | CFG_SPI_3W4WB(1) | CFG_SPI_ENA(1), > + .spi_gpio_cs = -1, > + .spi_gpio_reset = mfp_to_gpio(MFP_PIN_GPIO106), > + .panel_rbswap = 1, > + .pxa168fb_lcd_power = tpo_lcd_power, > +}; > +#endif > + > #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) > static struct mtd_partition ttc_dkb_onenand_partitions[] = { > { > @@ -123,6 +261,9 @@ static void __init ttc_dkb_init(void) > > /* on-chip devices */ > pxa910_add_uart(1); > +#ifdef CONFIG_FB_PXA168 > + pxa910_add_fb(&ttc_dkb_lcd_info); > +#endif > > /* off-chip devices */ > ttc_dkb_init_onenand(); > -- > 1.5.4.3 > add lin...@vg... |
From: Jun N. <nie...@gm...> - 2009-11-03 07:29:59
|
2009/11/3 Jun Nie <nie...@gm...>: > pxa: fix pxa168 lcd controller vsync/hsync timing error > > Signed-off-by: Jun Nie <nj...@ma...> > --- > drivers/video/pxa168fb.c | 4 ++-- > include/video/pxa168fb.h | 2 -- > 2 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c > index 2ba1444..bdd524c 100644 > --- a/drivers/video/pxa168fb.c > +++ b/drivers/video/pxa168fb.c > @@ -459,8 +459,8 @@ static void set_dumb_panel_control(struct fb_info *info) > x |= mi->invert_composite_blank ? 0x00000040 : 0; > x |= (info->var.sync & FB_SYNC_COMP_HIGH_ACT) ? 0x00000020 : 0; > x |= mi->invert_pix_val_ena ? 0x00000010 : 0; > - x |= (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 0x00000008; > - x |= (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 0x00000004; > + x |= (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 0x00000008 : 0; > + x |= (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 0x00000004 : 0; > x |= mi->invert_pixclock ? 0x00000002 : 0; > > writel(x, fbi->reg_base + LCD_SPU_DUMB_CTRL); > diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h > index f0497ae..7206483 100644 > --- a/include/video/pxa168fb.h > +++ b/include/video/pxa168fb.h > @@ -117,8 +117,6 @@ struct pxa168fb_mach_info { > unsigned invert_composite_blank:1; > unsigned invert_pix_val_ena:1; > unsigned invert_pixclock:1; > - unsigned invert_vsync:1; > - unsigned invert_hsync:1; > unsigned panel_rbswap:1; > unsigned active:1; > unsigned enable_lcd:1; > -- > 1.5.4.3 > add lin...@vg... |
From: Jun N. <nie...@gm...> - 2009-11-03 07:29:27
|
2009/11/3 Jun Nie <nie...@gm...>: > pxa: frame buffer support both pxa168 and pxa910 > > Signed-off-by: Jun Nie <nj...@ma...> > --- > drivers/video/pxa168fb.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c > index 27bdf2b..2ba1444 100644 > --- a/drivers/video/pxa168fb.c > +++ b/drivers/video/pxa168fb.c > @@ -875,12 +875,18 @@ failed: > return ret; > } > > + static const struct platform_device_id mmpfb_id_table[] = { > + {"pxa168-fb", 0}, > + {"pxa910-fb", 1}, > + }; > + > static struct platform_driver pxa168fb_driver = { > .driver = { > .name = "pxa168-fb", > .owner = THIS_MODULE, > }, > .probe = pxa168fb_probe, > + .id_table = mmpfb_id_table, > }; > > static int __devinit pxa168fb_init(void) > -- > 1.5.4.3 > add lin...@vg... |
From: Jun N. <nie...@gm...> - 2009-11-03 07:29:03
|
2009/11/3 Jun Nie <nie...@gm...>: > pxa: support pxa168 LCD controller SPI operation > > Signed-off-by: Jun Nie <nj...@ma...> > --- > arch/arm/mach-mmp/include/mach/pxa168fb.h | 29 +++++++++ > drivers/video/pxa168fb.c | 92 +++++++++++++++++++++++++++++ > drivers/video/pxa168fb.h | 24 +------- > include/video/pxa168fb.h | 18 ++++++ > 4 files changed, 140 insertions(+), 23 deletions(-) > create mode 100644 arch/arm/mach-mmp/include/mach/pxa168fb.h > > diff --git a/arch/arm/mach-mmp/include/mach/pxa168fb.h > b/arch/arm/mach-mmp/include/mach/pxa168fb.h > new file mode 100644 > index 0000000..897cc3e > --- /dev/null > +++ b/arch/arm/mach-mmp/include/mach/pxa168fb.h > @@ -0,0 +1,29 @@ > +#ifndef __PXA168FBSPI_H__ > +#define __PXA168FBSPI_H__ > + > +/* SPI Control Register. */ > +#define LCD_SPU_SPI_CTRL 0x0180 > +#define CFG_SCLKCNT(div) ((div) << 24) /* 0xFF~0x2 */ > +#define CFG_SCLKCNT_MASK 0xFF000000 > +#define CFG_RXBITS(rx) ((rx - 1) << 16) /* 0x1F~0x1, 0x1: > 2bits ... 0x1F: 32bits */ > +#define CFG_RXBITS_MASK 0x00FF0000 > +#define CFG_TXBITS(tx) ((tx - 1) << 8) /* > 0x1F~0x1, 0x1: 2bits ... 0x1F: 32bits */ > +#define CFG_TXBITS_MASK 0x0000FF00 > +#define CFG_CLKINV(clk) ((clk) << 7) > +#define CFG_CLKINV_MASK 0x00000080 > +#define CFG_KEEPXFER(transfer) ((transfer) << 6) > +#define CFG_KEEPXFER_MASK 0x00000040 > +#define CFG_RXBITSTO0(rx) ((rx) << 5) > +#define CFG_RXBITSTO0_MASK 0x00000020 > +#define CFG_TXBITSTO0(tx) ((tx) << 4) > +#define CFG_TXBITSTO0_MASK 0x00000010 > +#define CFG_SPI_ENA(spi) ((spi) << 3) > +#define CFG_SPI_ENA_MASK 0x00000008 > +#define CFG_SPI_SEL(spi) ((spi) << 2) /* 1: port1; 0: port0 */ > +#define CFG_SPI_SEL_MASK 0x00000004 > +#define CFG_SPI_3W4WB(wire) ((wire)<<1) /* 1: > 3-wire; 0: 4-wire */ > +#define CFG_SPI_3W4WB_MASK 0x00000002 > +#define CFG_SPI_START(start) (start) > +#define CFG_SPI_START_MASK 0x00000001 > + > +#endif /* __PXA168FBSPI_H__ */ > diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c > index 84d8327..27bdf2b 100644 > --- a/drivers/video/pxa168fb.c > +++ b/drivers/video/pxa168fb.c > @@ -29,10 +29,91 @@ > #include <linux/uaccess.h> > #include <video/pxa168fb.h> > > +#include <mach/pxa168fb.h> > +#include <mach/gpio.h> > #include "pxa168fb.h" > > #define DEFAULT_REFRESH 60 /* Hz */ > > +static inline void spi_gpio_assert_set(int spi_gpio_cs, int val) > +{ > + if (gpio_is_valid(spi_gpio_cs)) > + gpio_set_value(spi_gpio_cs, val); > +} > + > +int pxa168fb_spi_send(struct pxa168fb_info *fbi, void *value, int count, > + unsigned int spi_gpio_cs, unsigned int interval_us) > +{ > + u32 x, spi_byte_len; > + u8 *cmd = (u8 *)value; > + int i, err, isr, iopad, ret = 0; > + > + if (gpio_is_valid(spi_gpio_cs)) { > + err = gpio_request(spi_gpio_cs, "LCD_SPI_CS"); > + if (err) { > + dev_err(fbi->dev, "failed to request GPIO for LCD CS\n"); > + return -1; > + } > + gpio_direction_output(spi_gpio_cs, 1); > + } > + spi_byte_len = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); > + spi_byte_len = (spi_byte_len >> 8) & 0xff; > + /* Alignment should be (spi_byte_len + 7) >> 3, but > + * spi controller request set one less than bit length */ > + spi_byte_len = (spi_byte_len + 8) >> 3; > + /* spi command provided by platform should be 1, 2, or 4 byte aligned */ > + if(3 == spi_byte_len) > + spi_byte_len = 4; > + > + iopad = readl(fbi->reg_base + SPU_IOPAD_CONTROL); > + if ((iopad & CFG_IOPADMODE_MASK) != PIN_MODE_DUMB_18_SPI) > + writel(PIN_MODE_DUMB_18_SPI, fbi->reg_base + SPU_IOPAD_CONTROL); > + isr = readl(fbi->reg_base + SPU_IRQ_ISR); > + writel((isr & ~SPI_IRQ_ENA_MASK), fbi->reg_base + SPU_IRQ_ISR); > + for (i = 0; i < count; i++) { > + spi_gpio_assert_set(spi_gpio_cs, 0); > + udelay(interval_us); > + switch (spi_byte_len){ > + case 1: > + writel(*cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); > + break; > + case 2: > + writel(*(u16*)cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); > + break; > + case 4: > + writel(*(u32*)cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); > + break; > + default: > + dev_err(fbi->dev, "Wrong spi bit length\n"); > + spi_gpio_assert_set(spi_gpio_cs, 1); > + ret = -1; > + goto spi_exit; > + } > + cmd += spi_byte_len; > + x = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); > + x |= 0x1; > + writel(x, fbi->reg_base + LCD_SPU_SPI_CTRL); > + isr = readl(fbi->reg_base + SPU_IRQ_ISR); > + while(!(isr & SPI_IRQ_ENA_MASK)) { > + udelay(1); > + isr = readl(fbi->reg_base + SPU_IRQ_ISR); > + } > + x = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); > + x &= ~0x1; > + writel(x, fbi->reg_base + LCD_SPU_SPI_CTRL); > + spi_gpio_assert_set(spi_gpio_cs, 1); > + } > + > +spi_exit: > + if (gpio_is_valid(spi_gpio_cs)) > + gpio_free(spi_gpio_cs); > + if ((iopad & CFG_IOPADMODE_MASK) != PIN_MODE_DUMB_18_SPI) > + writel(iopad, fbi->reg_base + SPU_IOPAD_CONTROL); > + > + return ret; > +} > +EXPORT_SYMBOL(pxa168fb_spi_send); > + > static int determine_best_pix_fmt(struct fb_var_screeninfo *var) > { > /* > @@ -687,6 +768,7 @@ static int __init pxa168fb_probe(struct > platform_device *pdev) > } > > info->fix.smem_start = (unsigned long)fbi->fb_start_dma; > + set_graphics_start(info, 0, 0); > > /* > * Set video mode according to platform data. > @@ -728,6 +810,9 @@ static int __init pxa168fb_probe(struct > platform_device *pdev) > writel(0, fbi->reg_base + LCD_SPU_SRAM_PARA0); > writel(CFG_CSB_256x32(0x1)|CFG_CSB_256x24(0x1)|CFG_CSB_256x8(0x1), > fbi->reg_base + LCD_SPU_SRAM_PARA1); > + if ((mi->spi_ctrl != -1) && (mi->spi_ctrl & CFG_SPI_ENA_MASK)) > + writel(mi->spi_ctrl, fbi->reg_base + LCD_SPU_SPI_CTRL); > + > > /* > * Allocate color map. > @@ -764,6 +849,13 @@ static int __init pxa168fb_probe(struct > platform_device *pdev) > } > > platform_set_drvdata(pdev, fbi); > + if (mi->pxa168fb_lcd_power){ > + if(mi->pxa168fb_lcd_power(fbi, mi->spi_gpio_cs, mi->spi_gpio_reset, 1)){ > + dev_err(&pdev->dev, "Failed to power up pxa168-fb\n"); > + goto failed_free_irq; > + } > + } > + dev_info(fbi->dev, "frame buffer detected\n"); > return 0; > > failed_free_irq: > diff --git a/drivers/video/pxa168fb.h b/drivers/video/pxa168fb.h > index eee0927..1e4859e 100644 > --- a/drivers/video/pxa168fb.h > +++ b/drivers/video/pxa168fb.h > @@ -170,29 +170,7 @@ > #define DMA_FRAME_CNT_MASK 0x00000003 /* Video */ > > /* SPI Control Register. */ > -#define LCD_SPU_SPI_CTRL 0x0180 > -#define CFG_SCLKCNT(div) ((div) << 24) /* 0xFF~0x2 */ > -#define CFG_SCLKCNT_MASK 0xFF000000 > -#define CFG_RXBITS(rx) ((rx) << 16) /* 0x1F~0x1 */ > -#define CFG_RXBITS_MASK 0x00FF0000 > -#define CFG_TXBITS(tx) ((tx) << 8) /* 0x1F~0x1 */ > -#define CFG_TXBITS_MASK 0x0000FF00 > -#define CFG_CLKINV(clk) ((clk) << 7) > -#define CFG_CLKINV_MASK 0x00000080 > -#define CFG_KEEPXFER(transfer) ((transfer) << 6) > -#define CFG_KEEPXFER_MASK 0x00000040 > -#define CFG_RXBITSTO0(rx) ((rx) << 5) > -#define CFG_RXBITSTO0_MASK 0x00000020 > -#define CFG_TXBITSTO0(tx) ((tx) << 4) > -#define CFG_TXBITSTO0_MASK 0x00000010 > -#define CFG_SPI_ENA(spi) ((spi) << 3) > -#define CFG_SPI_ENA_MASK 0x00000008 > -#define CFG_SPI_SEL(spi) ((spi) << 2) > -#define CFG_SPI_SEL_MASK 0x00000004 > -#define CFG_SPI_3W4WB(wire) ((wire) << 1) > -#define CFG_SPI_3W4WB_MASK 0x00000002 > -#define CFG_SPI_START(start) (start) > -#define CFG_SPI_START_MASK 0x00000001 > +/* For SPI register, please refer to > arch/arm/mach-mmp/include/mach/pxa168fb.h */ > > /* SPI Tx Data Register */ > #define LCD_SPU_SPI_TXDATA 0x0184 > diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h > index b5cc72f..f0497ae 100644 > --- a/include/video/pxa168fb.h > +++ b/include/video/pxa168fb.h > @@ -122,6 +122,24 @@ struct pxa168fb_mach_info { > unsigned panel_rbswap:1; > unsigned active:1; > unsigned enable_lcd:1; > + /* > + * SPI control > + */ > + unsigned int spi_ctrl; > + unsigned int spi_gpio_cs; > + unsigned int spi_gpio_reset; > + /* > + * power on/off function. > + */ > + int (*pxa168fb_lcd_power)(struct pxa168fb_info *, unsigned int, > unsigned int, int); > }; > > +/* SPI utility for configure panel SPI command. > + * value: command array, element should be 1, 2 or 4 byte aligned. > + * count: command array length > + * spi_gpio_cs: gpio number for spi chip select > + * interval_us: time interval between two commands, us as unit */ > +int pxa168fb_spi_send(struct pxa168fb_info *fbi, void *value, int count, > + unsigned int spi_gpio_cs, unsigned int interval_us); > + > #endif /* __ASM_MACH_PXA168FB_H */ > -- > 1.5.4.3 > add lin...@vg... |
From: Jun N. <nie...@gm...> - 2009-11-03 06:46:02
|
pxa: add frame buffer support on pxa168 aspenite platform Signed-off-by: Jun Nie <nj...@ma...> --- arch/arm/configs/pxa168_defconfig | 86 ++++++++++++++++++++- arch/arm/mach-mmp/aspenite.c | 132 +++++++++++++++++++++++++++++++ arch/arm/mach-mmp/include/mach/pxa168.h | 8 ++ arch/arm/mach-mmp/pxa168.c | 3 + 4 files changed, 227 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/pxa168_defconfig b/arch/arm/configs/pxa168_defconfig index db5faea..b736517 100644 --- a/arch/arm/configs/pxa168_defconfig +++ b/arch/arm/configs/pxa168_defconfig @@ -509,7 +509,49 @@ CONFIG_UNIX98_PTYS=y # CONFIG_R3964 is not set # CONFIG_RAW_DRIVER is not set # CONFIG_TCG_TPM is not set -# CONFIG_I2C is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +# CONFIG_I2C_CHARDEV is not set +CONFIG_I2C_HELPER_AUTO=y +CONFIG_I2C_ALGOBIT=y + +# +# I2C Hardware Bus support +# + +# +# I2C system bus drivers (mostly embedded / system-on-chip) +# +# CONFIG_I2C_DESIGNWARE is not set +CONFIG_I2C_GPIO=y +# CONFIG_I2C_OCORES is not set +CONFIG_I2C_PXA=y +# CONFIG_I2C_PXA_SLAVE is not set +# CONFIG_I2C_SIMTEC is not set + +# +# External I2C/SMBus adapter drivers +# +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_TAOS_EVM is not set + +# +# Other I2C/SMBus bus drivers +# +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_STUB is not set + +# +# Miscellaneous I2C Chip support +# +# CONFIG_DS1682 is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_PCF8575 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set # CONFIG_SPI is not set CONFIG_ARCH_REQUIRE_GPIOLIB=y CONFIG_GPIOLIB=y @@ -523,6 +565,9 @@ CONFIG_GPIOLIB=y # # I2C GPIO expanders: # +# CONFIG_GPIO_MAX732X is not set +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCF857X is not set # # PCI GPIO expanders: @@ -578,7 +623,34 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGASTATE is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +# CONFIG_FB_CFB_FILLRECT is not set +# CONFIG_FB_CFB_COPYAREA is not set +# CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_S1D13XXX is not set +CONFIG_FB_PXA168=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # @@ -591,6 +663,16 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_SOUND is not set # CONFIG_HID_SUPPORT is not set # CONFIG_USB_SUPPORT is not set diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index b422bb5..76a57dc 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c @@ -17,12 +17,14 @@ #include <linux/mtd/partitions.h> #include <linux/mtd/nand.h> #include <linux/i2c/pca953x.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <mach/addr-map.h> #include <mach/mfp-pxa168.h> #include <mach/pxa168.h> +#include <mach/pxa168fb.h> #include <mach/gpio.h> #include <plat/pxa3xx_nand.h> #include <video/pxa168fb.h> @@ -66,6 +68,39 @@ static unsigned long common_pin_config[] __initdata = { /* UART1 */ GPIO107_UART1_RXD, GPIO108_UART1_TXD, + +#ifdef CONFIG_FB_PXA168 + /* LCD */ + GPIO56_LCD_FCLK_RD, + GPIO57_LCD_LCLK_A0, + GPIO58_LCD_PCLK_WR, + GPIO59_LCD_DENA_BIAS, + GPIO60_LCD_DD0, + GPIO61_LCD_DD1, + GPIO62_LCD_DD2, + GPIO63_LCD_DD3, + GPIO64_LCD_DD4, + GPIO65_LCD_DD5, + GPIO66_LCD_DD6, + GPIO67_LCD_DD7, + GPIO68_LCD_DD8, + GPIO69_LCD_DD9, + GPIO70_LCD_DD10, + GPIO71_LCD_DD11, + GPIO72_LCD_DD12, + GPIO73_LCD_DD13, + GPIO74_LCD_DD14, + GPIO75_LCD_DD15, + + GPIO76_LCD_DD16, + GPIO77_LCD_DD17, + GPIO78_LCD_DD18, + GPIO79_LCD_DD19, + GPIO80_LCD_DD20, + GPIO81_LCD_DD21, + GPIO82_LCD_DD22, + GPIO83_LCD_DD23, +#endif }; static struct smc91x_platdata smc91x_info = { @@ -95,6 +130,100 @@ static struct platform_device smc91x_device = { .resource = smc91x_resources, }; +#ifdef CONFIG_FB_PXA168 +static u16 tpo_spi_cmdon[] = { + 0x080F, + 0x0C5F, + 0x1017, + 0x1420, + 0x1808, + 0x1c20, + 0x2020, + 0x2420, + 0x2820, + 0x2c20, + 0x3020, + 0x3420, + 0x3810, + 0x3c10, + 0x4010, + 0x4415, + 0x48aa, + 0x4cff, + 0x5086, + 0x548d, + 0x58d4, + 0x5cfb, + 0x602e, + 0x645a, + 0x6889, + 0x6cfe, + 0x705a, + 0x749b, + 0x78c5, + 0x7cff, + 0x80f0, + 0x84f0, + 0x8808, +}; + +static u16 tpo_spi_cmdoff[] = { + 0x0c5e, //standby +}; + +static int tpo_lcd_power(struct pxa168fb_info *fbi, unsigned int spi_gpio_cs, unsigned int spi_gpio_reset, int on) +{ + int err = 0; + if (on) { + if (spi_gpio_reset != -1) { + err = gpio_request(spi_gpio_reset, "TPO_LCD_SPI_RESET"); + if (err) { + printk("failed to request GPIO for TPO LCD RESET\n"); + return err; + } + gpio_direction_output(spi_gpio_reset, 0); + msleep(100); + gpio_set_value(spi_gpio_reset, 1); + msleep(100); + gpio_free(spi_gpio_reset); + } + return pxa168fb_spi_send(fbi, tpo_spi_cmdon, ARRAY_SIZE(tpo_spi_cmdon), spi_gpio_cs, 1); + } else + return pxa168fb_spi_send(fbi, tpo_spi_cmdoff, ARRAY_SIZE(tpo_spi_cmdoff), spi_gpio_cs, 1); +} + +static struct fb_videomode video_modes_aspen[] = { + [0] = { + .pixclock = 30120, + .refresh = 60, + .xres = 800, + .yres = 480, + .hsync_len = 1, + .left_margin = 215, + .right_margin = 40, + .vsync_len = 1, + .upper_margin = 34, + .lower_margin = 10, + .sync = 0, + }, +}; + +struct pxa168fb_mach_info aspenite_lcd_info __initdata = { + .id = "Base-aspen", + .modes = video_modes_aspen, + .num_modes = ARRAY_SIZE(video_modes_aspen), + .pix_fmt = PIX_FMT_RGB565, + .io_pin_allocation_mode = PIN_MODE_DUMB_24, + .dumb_mode = DUMB_MODE_RGB888, + .active = 1, + .spi_ctrl = CFG_SCLKCNT(2) | CFG_TXBITS(16) | CFG_SPI_SEL(1) | CFG_SPI_3W4WB(1) | CFG_SPI_ENA(1), + .spi_gpio_cs = GPIO_EXT1(14), + .spi_gpio_reset = -1, + .pxa168fb_lcd_power = tpo_lcd_power, +}; + +#endif + #if defined(CONFIG_MTD_NAND) || defined(CONFIG_MTD_NAND_MODULE) static struct mtd_partition apn_nand_partitions[] = { { @@ -184,6 +313,9 @@ static void __init common_init(void) /* on-chip devices */ pxa168_add_uart(1); +#ifdef CONFIG_FB_PXA168 + pxa168_add_fb(&aspenite_lcd_info); +#endif apn_init_nand(); pxa168_add_twsi(0, &pwri2c_info, ARRAY_AND_SIZE(aspenite_i2c_board_info)); diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h index d117ceb..d43fb13 100644 --- a/arch/arm/mach-mmp/include/mach/pxa168.h +++ b/arch/arm/mach-mmp/include/mach/pxa168.h @@ -4,6 +4,7 @@ #include <linux/i2c.h> #include <mach/devices.h> #include <plat/i2c.h> +#include <video/pxa168fb.h> extern struct pxa_device_desc pxa168_device_uart1; extern struct pxa_device_desc pxa168_device_uart2; @@ -14,6 +15,7 @@ extern struct pxa_device_desc pxa168_device_pwm2; extern struct pxa_device_desc pxa168_device_pwm3; extern struct pxa_device_desc pxa168_device_pwm4; extern struct pxa_device_desc pxa168_device_nand; +extern struct pxa_device_desc pxa168_device_fb; static inline int pxa168_add_uart(int id) { @@ -65,4 +67,10 @@ static inline int pxa168_add_pwm(int id) return pxa_register_device(d, NULL, 0); } + +static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi) +{ + return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi)); +} + #endif /* __ASM_MACH_PXA168_H */ diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 59b393e..8be1e46 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c @@ -74,6 +74,7 @@ static APBC_CLK(pwm3, PXA168_PWM3, 1, 13000000); static APBC_CLK(pwm4, PXA168_PWM4, 1, 13000000); static APMU_CLK(nand, NAND, 0x1db, 208000000); +static APMU_CLK(lcd, LCD, 0x003f, 312000000); /* device and clock bindings */ static struct clk_lookup pxa168_clkregs[] = { @@ -86,6 +87,7 @@ static struct clk_lookup pxa168_clkregs[] = { INIT_CLKREG(&clk_pwm2, "pxa168-pwm.1", NULL), INIT_CLKREG(&clk_pwm3, "pxa168-pwm.2", NULL), INIT_CLKREG(&clk_pwm4, "pxa168-pwm.3", NULL), + INIT_CLKREG(&clk_lcd, "pxa168-fb", "LCDCLK"), }; static int __init pxa168_init(void) @@ -132,3 +134,4 @@ PXA168_DEVICE(pwm2, "pxa168-pwm", 1, NONE, 0xd401a400, 0x10); PXA168_DEVICE(pwm3, "pxa168-pwm", 2, NONE, 0xd401a800, 0x10); PXA168_DEVICE(pwm4, "pxa168-pwm", 3, NONE, 0xd401ac00, 0x10); PXA168_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x200, 97, 99); +PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); -- 1.5.4.3 |
From: Jun N. <nie...@gm...> - 2009-11-03 06:45:56
|
pxa: add gpio expander on pxa168 aspenite platform Signed-off-by: Jun Nie <nj...@ma...> --- arch/arm/mach-mmp/aspenite.c | 45 ++++++++++++++++++++++++++++++++++++++++++ drivers/gpio/pca953x.c | 1 + 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index 115f728..b422bb5 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c @@ -16,6 +16,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/mtd/nand.h> +#include <linux/i2c/pca953x.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -24,9 +25,14 @@ #include <mach/pxa168.h> #include <mach/gpio.h> #include <plat/pxa3xx_nand.h> +#include <video/pxa168fb.h> #include "common.h" +/*used by expander max7312, 16 pins gpio expander */ +#define GPIO_EXT0(x) (NR_BUILTIN_GPIO + (x)) +#define GPIO_EXT1(x) (NR_BUILTIN_GPIO + 16 + (x)) + static unsigned long common_pin_config[] __initdata = { /* Data Flash Interface */ GPIO0_DFI_D15, @@ -134,6 +140,44 @@ static void __init apn_init_nand(void) static void __init apn_init_nand(void) {} #endif +static struct i2c_pxa_platform_data pwri2c_info __initdata = { + .use_pio = 1, +}; + +#if defined(CONFIG_GPIO_PCA953X) +/* GPIO expander max7312 could reuse PCA953X */ +static struct pca953x_platform_data max7312_data[] = { + /* two max7312 in system */ + + [0] = { + .gpio_base = GPIO_EXT0(0), + }, + + [1] = { + .gpio_base = GPIO_EXT1(0), + }, +}; +#endif + +static struct i2c_board_info aspenite_i2c_board_info[] = { + +#if defined(CONFIG_GPIO_PCA953X) + { + .type = "max7312", + .addr = 0x10, /* 0x20/0x21 */ + .irq = IRQ_GPIO(122), + .platform_data = &max7312_data[0], + }, + + { + .type = "max7312", + .addr = 0x20, /* 0x40/0x41 */ + .irq = IRQ_GPIO(120), + .platform_data = &max7312_data[1], + }, +#endif +}; + static void __init common_init(void) { mfp_config(ARRAY_AND_SIZE(common_pin_config)); @@ -142,6 +186,7 @@ static void __init common_init(void) pxa168_add_uart(1); apn_init_nand(); + pxa168_add_twsi(0, &pwri2c_info, ARRAY_AND_SIZE(aspenite_i2c_board_info)); /* off-chip devices */ platform_device_register(&smc91x_device); diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 6a2fb3f..7822684 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c @@ -39,6 +39,7 @@ static const struct i2c_device_id pca953x_id[] = { { "pca9557", 8, }, { "max7310", 8, }, + { "max7312", 16, }, { "max7315", 8, }, { "pca6107", 8, }, { "tca6408", 8, }, -- 1.5.4.3 |
From: Jun N. <nie...@gm...> - 2009-11-03 06:45:52
|
pxa: support frame buffer on pxa910 ttc_dkb platform Signed-off-by: Jun Nie <nj...@ma...> --- arch/arm/configs/pxa910_defconfig | 39 ++++++++- arch/arm/mach-mmp/include/mach/pxa910.h | 8 ++ arch/arm/mach-mmp/pxa910.c | 4 + arch/arm/mach-mmp/ttc_dkb.c | 141 +++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 1 deletions(-) diff --git a/arch/arm/configs/pxa910_defconfig b/arch/arm/configs/pxa910_defconfig index 8c7e299..b9b1a85 100644 --- a/arch/arm/configs/pxa910_defconfig +++ b/arch/arm/configs/pxa910_defconfig @@ -578,7 +578,34 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGASTATE is not set # CONFIG_VIDEO_OUTPUT_CONTROL is not set -# CONFIG_FB is not set +CONFIG_FB=y +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +CONFIG_FB_CFB_FILLRECT=y +CONFIG_FB_CFB_COPYAREA=y +CONFIG_FB_CFB_IMAGEBLIT=y +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_S1D13XXX is not set +CONFIG_FB_PXA168=y +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_BROADSHEET is not set # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # @@ -591,6 +618,16 @@ CONFIG_SSB_POSSIBLE=y # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y +# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set +# CONFIG_FONTS is not set +CONFIG_FONT_8x8=y +CONFIG_FONT_8x16=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +CONFIG_LOGO_LINUX_VGA16=y +CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_SOUND is not set # CONFIG_HID_SUPPORT is not set # CONFIG_USB_SUPPORT is not set diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h index 6ae1ed7..7698793 100644 --- a/arch/arm/mach-mmp/include/mach/pxa910.h +++ b/arch/arm/mach-mmp/include/mach/pxa910.h @@ -4,6 +4,7 @@ #include <linux/i2c.h> #include <mach/devices.h> #include <plat/i2c.h> +#include <video/pxa168fb.h> extern struct pxa_device_desc pxa910_device_uart1; extern struct pxa_device_desc pxa910_device_uart2; @@ -13,6 +14,7 @@ extern struct pxa_device_desc pxa910_device_pwm1; extern struct pxa_device_desc pxa910_device_pwm2; extern struct pxa_device_desc pxa910_device_pwm3; extern struct pxa_device_desc pxa910_device_pwm4; +extern struct pxa_device_desc pxa910_device_fb; static inline int pxa910_add_uart(int id) { @@ -64,4 +66,10 @@ static inline int pxa910_add_pwm(int id) return pxa_register_device(d, NULL, 0); } + +static inline int pxa910_add_fb(struct pxa168fb_mach_info *mi) +{ + return pxa_register_device(&pxa910_device_fb, mi, sizeof(*mi)); +} + #endif /* __ASM_MACH_PXA910_H */ diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 5882ca6..48162a0 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c @@ -110,6 +110,8 @@ static APBC_CLK(pwm2, PXA910_PWM2, 1, 13000000); static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); +static APMU_CLK(lcd, LCD, 0x003f, 312000000); + /* device and clock bindings */ static struct clk_lookup pxa910_clkregs[] = { INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), @@ -120,6 +122,7 @@ static struct clk_lookup pxa910_clkregs[] = { INIT_CLKREG(&clk_pwm2, "pxa910-pwm.1", NULL), INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), + INIT_CLKREG(&clk_lcd, "pxa910-fb", "LCDCLK"), }; static int __init pxa910_init(void) @@ -174,3 +177,4 @@ PXA910_DEVICE(pwm1, "pxa910-pwm", 0, NONE, 0xd401a000, 0x10); PXA910_DEVICE(pwm2, "pxa910-pwm", 1, NONE, 0xd401a400, 0x10); PXA910_DEVICE(pwm3, "pxa910-pwm", 2, NONE, 0xd401a800, 0x10); PXA910_DEVICE(pwm4, "pxa910-pwm", 3, NONE, 0xd401ac00, 0x10); +PXA910_DEVICE(fb, "pxa910-fb", -1, LCD, 0xd420b000, 0x1c8); diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index dbd8cfd..dc04b0d 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c @@ -14,6 +14,8 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/mtd/onenand.h> +#include <linux/delay.h> +#include <video/pxa168fb.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -21,6 +23,8 @@ #include <mach/addr-map.h> #include <mach/mfp-pxa910.h> #include <mach/pxa910.h> +#include <mach/gpio.h> +#include <mach/pxa168fb.h> #include "common.h" @@ -54,8 +58,142 @@ static unsigned long ttc_dkb_pin_config[] __initdata = { DF_WEn_DF_WEn, DF_REn_DF_REn, DF_RDY0_DF_RDY0, + +#ifdef CONFIG_FB_PXA168 + /* LCD */ + GPIO81_LCD_FCLK, + GPIO82_LCD_LCLK, + GPIO83_LCD_PCLK, + GPIO84_LCD_DENA, + GPIO85_LCD_DD0, + GPIO86_LCD_DD1, + GPIO87_LCD_DD2, + GPIO88_LCD_DD3, + GPIO89_LCD_DD4, + GPIO90_LCD_DD5, + GPIO91_LCD_DD6, + GPIO92_LCD_DD7, + GPIO93_LCD_DD8, + GPIO94_LCD_DD9, + GPIO95_LCD_DD10, + GPIO96_LCD_DD11, + GPIO97_LCD_DD12, + GPIO98_LCD_DD13, + GPIO100_LCD_DD14, + GPIO101_LCD_DD15, + GPIO102_LCD_DD16, + GPIO103_LCD_DD17, + GPIO104_LCD_SPIDOUT, + GPIO105_LCD_SPIDIN, + GPIO107_LCD_CS1, + GPIO108_LCD_DCLK, + GPIO106_LCD_RESET, +#endif +}; + +#ifdef CONFIG_FB_PXA168 +static u16 tpo_spi_cmdon[] = { + 0x0801, + 0x0800, + 0x0200, + 0x0304, + 0x040e, + 0x0903, + 0x0b18, + 0x0c53, + 0x0d01, + 0x0ee0, + 0x0f01, + 0x1058, + 0x201e, + 0x210a, + 0x220a, + 0x231e, + 0x2400, + 0x2532, + 0x2600, + 0x27ac, + 0x2904, + 0x2aa2, + 0x2b45, + 0x2c45, + 0x2d15, + 0x2e5a, + 0x2fff, + 0x306b, + 0x310d, + 0x3248, + 0x3382, + 0x34bd, + 0x35e7, + 0x3618, + 0x3794, + 0x3801, + 0x395d, + 0x3aae, + 0x3bff, + 0x07c9, //auto power on +}; + +static u16 tpo_spi_cmdoff[] = { + 0x07d9, //auto power off +}; + +static int tpo_lcd_power(struct pxa168fb_info *fbi, unsigned int spi_gpio_cs, unsigned int spi_gpio_reset, int on) +{ + int err = 0; + + if (on) { + if (spi_gpio_reset != -1) { + err = gpio_request(spi_gpio_reset, "TPO_LCD_SPI_RESET"); + if (err) { + printk("failed to request GPIO for TPO LCD RESET\n"); + return -1; + } + gpio_direction_output(spi_gpio_reset, 0); + msleep(100); + gpio_set_value(spi_gpio_reset, 1); + msleep(100); + gpio_free(spi_gpio_reset); + } + return pxa168fb_spi_send(fbi, tpo_spi_cmdon, ARRAY_SIZE(tpo_spi_cmdon), spi_gpio_cs, 20); + } else + return pxa168fb_spi_send(fbi, tpo_spi_cmdoff, ARRAY_SIZE(tpo_spi_cmdoff), spi_gpio_cs, 0); +} + +static struct fb_videomode video_modes[] = { + /* lpj032l001b HVGA mode info */ + [0] = { + .pixclock = 100000, + .refresh = 60, + .xres = 320, + .yres = 480, + .hsync_len = 10, + .left_margin = 15, + .right_margin = 10, + .vsync_len = 2, + .upper_margin = 4, + .lower_margin = 2, + .sync = 0, + }, }; +static struct pxa168fb_mach_info ttc_dkb_lcd_info __initdata = { + .id = "Base", + .modes = video_modes, + .num_modes = ARRAY_SIZE(video_modes), + .pix_fmt = PIX_FMT_RGB565, + .io_pin_allocation_mode = PIN_MODE_DUMB_18_SPI, + .dumb_mode = DUMB_MODE_RGB666, + .active = 1, + .spi_ctrl = CFG_SCLKCNT(16) | CFG_TXBITS(16) | CFG_SPI_SEL(1) | CFG_SPI_3W4WB(1) | CFG_SPI_ENA(1), + .spi_gpio_cs = -1, + .spi_gpio_reset = mfp_to_gpio(MFP_PIN_GPIO106), + .panel_rbswap = 1, + .pxa168fb_lcd_power = tpo_lcd_power, +}; +#endif + #if defined(CONFIG_MTD_ONENAND) || defined(CONFIG_MTD_ONENAND_MODULE) static struct mtd_partition ttc_dkb_onenand_partitions[] = { { @@ -123,6 +261,9 @@ static void __init ttc_dkb_init(void) /* on-chip devices */ pxa910_add_uart(1); +#ifdef CONFIG_FB_PXA168 + pxa910_add_fb(&ttc_dkb_lcd_info); +#endif /* off-chip devices */ ttc_dkb_init_onenand(); -- 1.5.4.3 |
From: Jun N. <nie...@gm...> - 2009-11-03 06:45:40
|
pxa: frame buffer support both pxa168 and pxa910 Signed-off-by: Jun Nie <nj...@ma...> --- drivers/video/pxa168fb.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 27bdf2b..2ba1444 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c @@ -875,12 +875,18 @@ failed: return ret; } + static const struct platform_device_id mmpfb_id_table[] = { + {"pxa168-fb", 0}, + {"pxa910-fb", 1}, + }; + static struct platform_driver pxa168fb_driver = { .driver = { .name = "pxa168-fb", .owner = THIS_MODULE, }, .probe = pxa168fb_probe, + .id_table = mmpfb_id_table, }; static int __devinit pxa168fb_init(void) -- 1.5.4.3 |
From: Jun N. <nie...@gm...> - 2009-11-03 06:45:39
|
pxa: fix pxa168 lcd controller vsync/hsync timing error Signed-off-by: Jun Nie <nj...@ma...> --- drivers/video/pxa168fb.c | 4 ++-- include/video/pxa168fb.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 2ba1444..bdd524c 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c @@ -459,8 +459,8 @@ static void set_dumb_panel_control(struct fb_info *info) x |= mi->invert_composite_blank ? 0x00000040 : 0; x |= (info->var.sync & FB_SYNC_COMP_HIGH_ACT) ? 0x00000020 : 0; x |= mi->invert_pix_val_ena ? 0x00000010 : 0; - x |= (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 0x00000008; - x |= (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 0x00000004; + x |= (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 0x00000008 : 0; + x |= (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 0x00000004 : 0; x |= mi->invert_pixclock ? 0x00000002 : 0; writel(x, fbi->reg_base + LCD_SPU_DUMB_CTRL); diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h index f0497ae..7206483 100644 --- a/include/video/pxa168fb.h +++ b/include/video/pxa168fb.h @@ -117,8 +117,6 @@ struct pxa168fb_mach_info { unsigned invert_composite_blank:1; unsigned invert_pix_val_ena:1; unsigned invert_pixclock:1; - unsigned invert_vsync:1; - unsigned invert_hsync:1; unsigned panel_rbswap:1; unsigned active:1; unsigned enable_lcd:1; -- 1.5.4.3 |
From: Jun N. <nie...@gm...> - 2009-11-03 06:45:32
|
pxa: support pxa168 LCD controller SPI operation Signed-off-by: Jun Nie <nj...@ma...> --- arch/arm/mach-mmp/include/mach/pxa168fb.h | 29 +++++++++ drivers/video/pxa168fb.c | 92 +++++++++++++++++++++++++++++ drivers/video/pxa168fb.h | 24 +------- include/video/pxa168fb.h | 18 ++++++ 4 files changed, 140 insertions(+), 23 deletions(-) create mode 100644 arch/arm/mach-mmp/include/mach/pxa168fb.h diff --git a/arch/arm/mach-mmp/include/mach/pxa168fb.h b/arch/arm/mach-mmp/include/mach/pxa168fb.h new file mode 100644 index 0000000..897cc3e --- /dev/null +++ b/arch/arm/mach-mmp/include/mach/pxa168fb.h @@ -0,0 +1,29 @@ +#ifndef __PXA168FBSPI_H__ +#define __PXA168FBSPI_H__ + +/* SPI Control Register. */ +#define LCD_SPU_SPI_CTRL 0x0180 +#define CFG_SCLKCNT(div) ((div) << 24) /* 0xFF~0x2 */ +#define CFG_SCLKCNT_MASK 0xFF000000 +#define CFG_RXBITS(rx) ((rx - 1) << 16) /* 0x1F~0x1, 0x1: 2bits ... 0x1F: 32bits */ +#define CFG_RXBITS_MASK 0x00FF0000 +#define CFG_TXBITS(tx) ((tx - 1) << 8) /* 0x1F~0x1, 0x1: 2bits ... 0x1F: 32bits */ +#define CFG_TXBITS_MASK 0x0000FF00 +#define CFG_CLKINV(clk) ((clk) << 7) +#define CFG_CLKINV_MASK 0x00000080 +#define CFG_KEEPXFER(transfer) ((transfer) << 6) +#define CFG_KEEPXFER_MASK 0x00000040 +#define CFG_RXBITSTO0(rx) ((rx) << 5) +#define CFG_RXBITSTO0_MASK 0x00000020 +#define CFG_TXBITSTO0(tx) ((tx) << 4) +#define CFG_TXBITSTO0_MASK 0x00000010 +#define CFG_SPI_ENA(spi) ((spi) << 3) +#define CFG_SPI_ENA_MASK 0x00000008 +#define CFG_SPI_SEL(spi) ((spi) << 2) /* 1: port1; 0: port0 */ +#define CFG_SPI_SEL_MASK 0x00000004 +#define CFG_SPI_3W4WB(wire) ((wire)<<1) /* 1: 3-wire; 0: 4-wire */ +#define CFG_SPI_3W4WB_MASK 0x00000002 +#define CFG_SPI_START(start) (start) +#define CFG_SPI_START_MASK 0x00000001 + +#endif /* __PXA168FBSPI_H__ */ diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index 84d8327..27bdf2b 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c @@ -29,10 +29,91 @@ #include <linux/uaccess.h> #include <video/pxa168fb.h> +#include <mach/pxa168fb.h> +#include <mach/gpio.h> #include "pxa168fb.h" #define DEFAULT_REFRESH 60 /* Hz */ +static inline void spi_gpio_assert_set(int spi_gpio_cs, int val) +{ + if (gpio_is_valid(spi_gpio_cs)) + gpio_set_value(spi_gpio_cs, val); +} + +int pxa168fb_spi_send(struct pxa168fb_info *fbi, void *value, int count, + unsigned int spi_gpio_cs, unsigned int interval_us) +{ + u32 x, spi_byte_len; + u8 *cmd = (u8 *)value; + int i, err, isr, iopad, ret = 0; + + if (gpio_is_valid(spi_gpio_cs)) { + err = gpio_request(spi_gpio_cs, "LCD_SPI_CS"); + if (err) { + dev_err(fbi->dev, "failed to request GPIO for LCD CS\n"); + return -1; + } + gpio_direction_output(spi_gpio_cs, 1); + } + spi_byte_len = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); + spi_byte_len = (spi_byte_len >> 8) & 0xff; + /* Alignment should be (spi_byte_len + 7) >> 3, but + * spi controller request set one less than bit length */ + spi_byte_len = (spi_byte_len + 8) >> 3; + /* spi command provided by platform should be 1, 2, or 4 byte aligned */ + if(3 == spi_byte_len) + spi_byte_len = 4; + + iopad = readl(fbi->reg_base + SPU_IOPAD_CONTROL); + if ((iopad & CFG_IOPADMODE_MASK) != PIN_MODE_DUMB_18_SPI) + writel(PIN_MODE_DUMB_18_SPI, fbi->reg_base + SPU_IOPAD_CONTROL); + isr = readl(fbi->reg_base + SPU_IRQ_ISR); + writel((isr & ~SPI_IRQ_ENA_MASK), fbi->reg_base + SPU_IRQ_ISR); + for (i = 0; i < count; i++) { + spi_gpio_assert_set(spi_gpio_cs, 0); + udelay(interval_us); + switch (spi_byte_len){ + case 1: + writel(*cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); + break; + case 2: + writel(*(u16*)cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); + break; + case 4: + writel(*(u32*)cmd, fbi->reg_base + LCD_SPU_SPI_TXDATA); + break; + default: + dev_err(fbi->dev, "Wrong spi bit length\n"); + spi_gpio_assert_set(spi_gpio_cs, 1); + ret = -1; + goto spi_exit; + } + cmd += spi_byte_len; + x = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); + x |= 0x1; + writel(x, fbi->reg_base + LCD_SPU_SPI_CTRL); + isr = readl(fbi->reg_base + SPU_IRQ_ISR); + while(!(isr & SPI_IRQ_ENA_MASK)) { + udelay(1); + isr = readl(fbi->reg_base + SPU_IRQ_ISR); + } + x = readl(fbi->reg_base + LCD_SPU_SPI_CTRL); + x &= ~0x1; + writel(x, fbi->reg_base + LCD_SPU_SPI_CTRL); + spi_gpio_assert_set(spi_gpio_cs, 1); + } + +spi_exit: + if (gpio_is_valid(spi_gpio_cs)) + gpio_free(spi_gpio_cs); + if ((iopad & CFG_IOPADMODE_MASK) != PIN_MODE_DUMB_18_SPI) + writel(iopad, fbi->reg_base + SPU_IOPAD_CONTROL); + + return ret; +} +EXPORT_SYMBOL(pxa168fb_spi_send); + static int determine_best_pix_fmt(struct fb_var_screeninfo *var) { /* @@ -687,6 +768,7 @@ static int __init pxa168fb_probe(struct platform_device *pdev) } info->fix.smem_start = (unsigned long)fbi->fb_start_dma; + set_graphics_start(info, 0, 0); /* * Set video mode according to platform data. @@ -728,6 +810,9 @@ static int __init pxa168fb_probe(struct platform_device *pdev) writel(0, fbi->reg_base + LCD_SPU_SRAM_PARA0); writel(CFG_CSB_256x32(0x1)|CFG_CSB_256x24(0x1)|CFG_CSB_256x8(0x1), fbi->reg_base + LCD_SPU_SRAM_PARA1); + if ((mi->spi_ctrl != -1) && (mi->spi_ctrl & CFG_SPI_ENA_MASK)) + writel(mi->spi_ctrl, fbi->reg_base + LCD_SPU_SPI_CTRL); + /* * Allocate color map. @@ -764,6 +849,13 @@ static int __init pxa168fb_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, fbi); + if (mi->pxa168fb_lcd_power){ + if(mi->pxa168fb_lcd_power(fbi, mi->spi_gpio_cs, mi->spi_gpio_reset, 1)){ + dev_err(&pdev->dev, "Failed to power up pxa168-fb\n"); + goto failed_free_irq; + } + } + dev_info(fbi->dev, "frame buffer detected\n"); return 0; failed_free_irq: diff --git a/drivers/video/pxa168fb.h b/drivers/video/pxa168fb.h index eee0927..1e4859e 100644 --- a/drivers/video/pxa168fb.h +++ b/drivers/video/pxa168fb.h @@ -170,29 +170,7 @@ #define DMA_FRAME_CNT_MASK 0x00000003 /* Video */ /* SPI Control Register. */ -#define LCD_SPU_SPI_CTRL 0x0180 -#define CFG_SCLKCNT(div) ((div) << 24) /* 0xFF~0x2 */ -#define CFG_SCLKCNT_MASK 0xFF000000 -#define CFG_RXBITS(rx) ((rx) << 16) /* 0x1F~0x1 */ -#define CFG_RXBITS_MASK 0x00FF0000 -#define CFG_TXBITS(tx) ((tx) << 8) /* 0x1F~0x1 */ -#define CFG_TXBITS_MASK 0x0000FF00 -#define CFG_CLKINV(clk) ((clk) << 7) -#define CFG_CLKINV_MASK 0x00000080 -#define CFG_KEEPXFER(transfer) ((transfer) << 6) -#define CFG_KEEPXFER_MASK 0x00000040 -#define CFG_RXBITSTO0(rx) ((rx) << 5) -#define CFG_RXBITSTO0_MASK 0x00000020 -#define CFG_TXBITSTO0(tx) ((tx) << 4) -#define CFG_TXBITSTO0_MASK 0x00000010 -#define CFG_SPI_ENA(spi) ((spi) << 3) -#define CFG_SPI_ENA_MASK 0x00000008 -#define CFG_SPI_SEL(spi) ((spi) << 2) -#define CFG_SPI_SEL_MASK 0x00000004 -#define CFG_SPI_3W4WB(wire) ((wire) << 1) -#define CFG_SPI_3W4WB_MASK 0x00000002 -#define CFG_SPI_START(start) (start) -#define CFG_SPI_START_MASK 0x00000001 +/* For SPI register, please refer to arch/arm/mach-mmp/include/mach/pxa168fb.h */ /* SPI Tx Data Register */ #define LCD_SPU_SPI_TXDATA 0x0184 diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h index b5cc72f..f0497ae 100644 --- a/include/video/pxa168fb.h +++ b/include/video/pxa168fb.h @@ -122,6 +122,24 @@ struct pxa168fb_mach_info { unsigned panel_rbswap:1; unsigned active:1; unsigned enable_lcd:1; + /* + * SPI control + */ + unsigned int spi_ctrl; + unsigned int spi_gpio_cs; + unsigned int spi_gpio_reset; + /* + * power on/off function. + */ + int (*pxa168fb_lcd_power)(struct pxa168fb_info *, unsigned int, unsigned int, int); }; +/* SPI utility for configure panel SPI command. + * value: command array, element should be 1, 2 or 4 byte aligned. + * count: command array length + * spi_gpio_cs: gpio number for spi chip select + * interval_us: time interval between two commands, us as unit */ +int pxa168fb_spi_send(struct pxa168fb_info *fbi, void *value, int count, + unsigned int spi_gpio_cs, unsigned int interval_us); + #endif /* __ASM_MACH_PXA168FB_H */ -- 1.5.4.3 |
From: Alexander G. <ag...@su...> - 2009-11-03 06:39:48
|
On 03.11.2009, at 07:34, Avi Kivity wrote: > On 11/03/2009 08:27 AM, Alexander Graf wrote: >> >>> How does it work today? >> >> You boot into a TERM=dumb line based emulation on 3270 (worst thing >> haunting people's nightmares ever), trying to get out of that mode >> as quickly as possible and off into SSH / VNC. > > Despite the coolness factor, IMO a few minutes during install time > do not justify a new hardware model and a new driver. It's more than just coolness factor. There are use cases out there (www.susestudio.com ) that don't want to rely on the guest exporting a VNC server to the outside just to access graphics. You also want to see boot messages, have a console login screen, be able to debug things without switching between virtio-console and vnc, etc. etc. The hardware model isn't exactly new either. It's just the next logical step to a full PV machine using virtio. If the virtio-fb stuff turns out to be really fast and reliable, I could even imagine it being the default target for kvm on ppc as well, as we can't switch resolutions on the fly there atm. >>> Does installation over vnc work? >> >> Yes, but it requires a working network setup. That's a pretty >> requirement on guests IMHO. > > Why? the guest will typically have networking when it's set up, so > it should have network access during install. You can easily use > slirp redirection and the built-in dhcp server to set this up with > relatively few hassles. That's how I use it right now. It's no fun. Alex |
From: Avi K. <av...@re...> - 2009-11-03 06:34:16
|
On 11/03/2009 08:27 AM, Alexander Graf wrote: > >> How does it work today? > > You boot into a TERM=dumb line based emulation on 3270 (worst thing > haunting people's nightmares ever), trying to get out of that mode as > quickly as possible and off into SSH / VNC. Despite the coolness factor, IMO a few minutes during install time do not justify a new hardware model and a new driver. >> Does installation over vnc work? > > Yes, but it requires a working network setup. That's a pretty > requirement on guests IMHO. Why? the guest will typically have networking when it's set up, so it should have network access during install. You can easily use slirp redirection and the built-in dhcp server to set this up with relatively few hassles. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. |
From: Alexander G. <ag...@su...> - 2009-11-03 06:27:19
|
On 03.11.2009, at 07:24, Avi Kivity wrote: > On 11/03/2009 08:22 AM, Alexander Graf wrote: >> >>>> This is especially important on machines that can't do MMIO, as >>>> all current >>>> graphics implementations qemu emulates I'm aware of so far fail >>>> here. >>>> >>> >>> s390 virtual desktops? >> >> Well - have you ever tried installing SLES / RHEL on an S390? If >> not, give it a shot and comment again :-) >> > > I won't be able to until qemu support s390. I'm pretty sure RH has some S390 lying around ... > How does it work today? You boot into a TERM=dumb line based emulation on 3270 (worst thing haunting people's nightmares ever), trying to get out of that mode as quickly as possible and off into SSH / VNC. > Does installation over vnc work? Yes, but it requires a working network setup. That's a pretty requirement on guests IMHO. Alex |
From: Avi K. <av...@re...> - 2009-11-03 06:25:15
|
On 11/03/2009 08:22 AM, Alexander Graf wrote: > >>> This is especially important on machines that can't do MMIO, as all >>> current >>> graphics implementations qemu emulates I'm aware of so far fail here. >>> >> >> s390 virtual desktops? > > Well - have you ever tried installing SLES / RHEL on an S390? If not, > give it a shot and comment again :-) > I won't be able to until qemu support s390. How does it work today? Does installation over vnc work? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. |
From: Alexander G. <ag...@su...> - 2009-11-03 06:24:13
|
On 03.11.2009, at 07:22, Avi Kivity wrote: > On 11/03/2009 12:11 AM, Alexander Graf wrote: >> Since Linux now understands how to talk to us graphics over VirtIO, >> let's >> add support for it in qemu. >> >> The good part about graphics over VirtIO is that you don't need PCI >> to use >> it. So if there's any platform out there trying to use graphics, >> but not >> capable of MMIO, it can use this one! >> > > Which platforms are these? For now S390 comes to mind first ... :-). I'd use and improve the spice stuff, but that hasn't exactly been open-source friendly so far... Alex |
From: Alexander G. <ag...@su...> - 2009-11-03 06:23:10
|
On 03.11.2009, at 07:21, Avi Kivity wrote: > On 11/03/2009 12:09 AM, Alexander Graf wrote: >> When we want to create a full VirtIO based machine, we're still >> missing >> graphics output. Fortunately, Linux provides us with most of the >> frameworks >> to render text and everything, we only need to implement a transport. >> >> So this is a frame buffer backend written for VirtIO. Using this >> and my >> patch to qemu, you can use paravirtualized graphics. >> >> > > What does this do that cirrus and/or vmware-vga don't? Work on non-MMIO machines. >> This is especially important on machines that can't do MMIO, as all >> current >> graphics implementations qemu emulates I'm aware of so far fail here. >> > > s390 virtual desktops? Well - have you ever tried installing SLES / RHEL on an S390? If not, give it a shot and comment again :-) Alex |
From: Avi K. <av...@re...> - 2009-11-03 06:22:34
|
On 11/03/2009 12:11 AM, Alexander Graf wrote: > Since Linux now understands how to talk to us graphics over VirtIO, let's > add support for it in qemu. > > The good part about graphics over VirtIO is that you don't need PCI to use > it. So if there's any platform out there trying to use graphics, but not > capable of MMIO, it can use this one! > Which platforms are these? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. |
From: Avi K. <av...@re...> - 2009-11-03 06:21:50
|
On 11/03/2009 12:09 AM, Alexander Graf wrote: > When we want to create a full VirtIO based machine, we're still missing > graphics output. Fortunately, Linux provides us with most of the frameworks > to render text and everything, we only need to implement a transport. > > So this is a frame buffer backend written for VirtIO. Using this and my > patch to qemu, you can use paravirtualized graphics. > > What does this do that cirrus and/or vmware-vga don't? > This is especially important on machines that can't do MMIO, as all current > graphics implementations qemu emulates I'm aware of so far fail here. > s390 virtual desktops? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. |
From: Andrew M. <ak...@li...> - 2009-11-03 00:33:39
|
On Sat, 17 Oct 2009 00:45:14 +0200 Roel Kluin <roe...@gm...> wrote: > image->d[xy] are unsigned so the check was wrong. > > Signed-off-by: Roel Kluin <roe...@gm...> > --- > diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c > index 99bbd28..9f20641 100644 > --- a/drivers/video/fbmem.c > +++ b/drivers/video/fbmem.c > @@ -403,7 +403,8 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, > image->dx += image->width + 8; > } > } else if (rotate == FB_ROTATE_UD) { > - for (x = 0; x < num && image->dx >= 0; x++) { > + for (x = 0; x < num && image->dx + image->width + 8 >= 0; > + x++) { > info->fbops->fb_imageblit(info, image); > image->dx -= image->width + 8; > } > @@ -415,7 +416,8 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image, > image->dy += image->height + 8; > } > } else if (rotate == FB_ROTATE_CCW) { > - for (x = 0; x < num && image->dy >= 0; x++) { > + for (x = 0; x < num && image->dy + image->height + 8 >= 0; > + x++) { > info->fbops->fb_imageblit(info, image); > image->dy -= image->height + 8; > } Presumably that test isn't needed at all? |
From: Alexander G. <ag...@su...> - 2009-11-03 00:00:09
|
On 03.11.2009, at 00:57, Ondrej Zajicek wrote: > On Tue, Nov 03, 2009 at 12:24:15AM +0100, Alexander Graf wrote: >>> Also, we still need to keep the local frame buffer copy in sync so >>> we >>> can mmap and read from it, right? So it's not really worth it >>> probably... >> >> But then again we could just try to be closer to a real graphics >> card. >> What if we'd set up a memory region on the host that is basically our >> graphics frame buffer? For S390 we could just append the graphics >> memory >> to the guest's memory. >> >> We could use that as backing buffer in the qemu graphics frontend >> and as >> frame buffer in the Linux fbdev layer, similar to what real graphics >> cards set up. > > Using shared memory pages between host and guest seems like a natural > way to implement paravirtualized graphics card. Most things are > straightforward, only a little problematic thing is when fbdev > is mmaped from guest to userspace - you have to detect writes > and notify host that it changed. Yes, currently I use the deferred IO stuff and send over "write" commands with the full contents of the frame buffer. But having a shared frame buffer really sounds better. The major thing I really want to do different from xenfb though is that the _host_ renders. That way "copy" operations still work as designed, enabling vnc to pass them through directly. That might also allow for some sort of DRI interface to pass through 3d data to the host... at least in the future :-). Alex |
From: Ondrej Z. <san...@cr...> - 2009-11-02 23:59:40
|
On Tue, Nov 03, 2009 at 12:53:08AM +0100, Alexander Graf wrote: >> Advantages might be on Qemu side (like ability to run in text-only >> mode without need to change console on virtualized sytem). > > Oh, so we could use the curses frontend. That's a neat idea. > > But that also means we'll lose the penguin, right? Yes :-) -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: san...@cr...) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so." |
From: Ondrej Z. <san...@cr...> - 2009-11-02 23:56:55
|
On Tue, Nov 03, 2009 at 12:24:15AM +0100, Alexander Graf wrote: >> Also, we still need to keep the local frame buffer copy in sync so we >> can mmap and read from it, right? So it's not really worth it >> probably... > > But then again we could just try to be closer to a real graphics card. > What if we'd set up a memory region on the host that is basically our > graphics frame buffer? For S390 we could just append the graphics memory > to the guest's memory. > > We could use that as backing buffer in the qemu graphics frontend and as > frame buffer in the Linux fbdev layer, similar to what real graphics > cards set up. Using shared memory pages between host and guest seems like a natural way to implement paravirtualized graphics card. Most things are straightforward, only a little problematic thing is when fbdev is mmaped from guest to userspace - you have to detect writes and notify host that it changed. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: san...@cr...) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so." |
From: Alexander G. <ag...@su...> - 2009-11-02 23:53:27
|
On 03.11.2009, at 00:51, Ondrej Zajicek wrote: > On Mon, Nov 02, 2009 at 11:42:11PM +0100, Alexander Graf wrote: >> >> Am 02.11.2009 um 23:32 schrieb Ondrej Zajicek >> <san...@cr...>: >> >>> On Mon, Nov 02, 2009 at 11:09:19PM +0100, Alexander Graf wrote: >>>> When we want to create a full VirtIO based machine, we're still >>>> missing >>>> graphics output. Fortunately, Linux provides us with most of the >>>> frameworks >>>> to render text and everything, we only need to implement a >>>> transport. >>>> >>>> So this is a frame buffer backend written for VirtIO. Using this >>>> and >>>> my >>>> patch to qemu, you can use paravirtualized graphics. >>> >>> Just a note: it might be useful to allow paravirtualized graphics to >>> handle text mode. In that case, it can be done in fbdev layer using >>> tileblit operations. >> >> Is there any real driver implementing this already? I'd prefer to >> copy >> from working code instead of writing my own :-). > > Yes, for example s3fb and vt8623fb (struct fb_tile_ops). > >> Also, we still need to keep the local frame buffer copy in sync so we >> can mmap and read from it, right? So it's not really worth it >> probably... > > Advantages might be on Qemu side (like ability to run in text-only > mode without need to change console on virtualized sytem). Oh, so we could use the curses frontend. That's a neat idea. But that also means we'll lose the penguin, right? Alex |
From: Ondrej Z. <san...@cr...> - 2009-11-02 23:50:27
|
On Mon, Nov 02, 2009 at 11:42:11PM +0100, Alexander Graf wrote: > > Am 02.11.2009 um 23:32 schrieb Ondrej Zajicek <san...@cr...>: > >> On Mon, Nov 02, 2009 at 11:09:19PM +0100, Alexander Graf wrote: >>> When we want to create a full VirtIO based machine, we're still >>> missing >>> graphics output. Fortunately, Linux provides us with most of the >>> frameworks >>> to render text and everything, we only need to implement a transport. >>> >>> So this is a frame buffer backend written for VirtIO. Using this and >>> my >>> patch to qemu, you can use paravirtualized graphics. >> >> Just a note: it might be useful to allow paravirtualized graphics to >> handle text mode. In that case, it can be done in fbdev layer using >> tileblit operations. > > Is there any real driver implementing this already? I'd prefer to copy > from working code instead of writing my own :-). Yes, for example s3fb and vt8623fb (struct fb_tile_ops). > Also, we still need to keep the local frame buffer copy in sync so we > can mmap and read from it, right? So it's not really worth it > probably... Advantages might be on Qemu side (like ability to run in text-only mode without need to change console on virtualized sytem). -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: san...@cr...) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so." |
From: Ondrej Z. <san...@cr...> - 2009-11-02 23:33:13
|
On Mon, Nov 02, 2009 at 11:09:19PM +0100, Alexander Graf wrote: > When we want to create a full VirtIO based machine, we're still missing > graphics output. Fortunately, Linux provides us with most of the frameworks > to render text and everything, we only need to implement a transport. > > So this is a frame buffer backend written for VirtIO. Using this and my > patch to qemu, you can use paravirtualized graphics. Just a note: it might be useful to allow paravirtualized graphics to handle text mode. In that case, it can be done in fbdev layer using tileblit operations. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: san...@cr...) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so." |