diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-01-03 04:50:23 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-01-03 04:50:23 +0000 |
commit | 0b3987dd12f104a720a8526ceb635e1e72cf71a0 (patch) | |
tree | 85203e3cf83f8fae1dbfab3d12758f33ec4c99c6 /sys/arch | |
parent | 4036ebf8068ea00e7e6f4253dae205f03e0afdf8 (diff) |
Close to working display, just rotated 90 degrees.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_lcd.c | 52 | ||||
-rw-r--r-- | sys/arch/zaurus/zaurus/zaurus_lcd.c | 27 |
2 files changed, 63 insertions, 16 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.c b/sys/arch/arm/xscale/pxa2x0_lcd.c index 08eaa7aba2f..11db683155a 100644 --- a/sys/arch/arm/xscale/pxa2x0_lcd.c +++ b/sys/arch/arm/xscale/pxa2x0_lcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_lcd.c,v 1.2 2005/01/02 19:52:36 drahn Exp $ */ +/* $OpenBSD: pxa2x0_lcd.c,v 1.3 2005/01/03 04:50:22 drahn Exp $ */ /* $NetBSD: pxa2x0_lcd.c,v 1.8 2003/10/03 07:24:05 bsh Exp $ */ /* @@ -91,6 +91,12 @@ pxa2x0_lcd_geometry(struct pxa2x0_lcd_softc *sc, ccr0 |= LCCR0_SDS; /* dual panel */ if (info->panel_info & LCDPANEL_MONOCHROME) ccr0 |= LCCR0_CMS; + /* XXX - Zaurus C3000 */ + ccr0 |= LCCR0_LDDALT | + LCCR0_OUC | + LCCR0_CMDIM | + LCCR0_RDSTM; + bus_space_write_4(iot, ioh, LCDC_LCCR0, ccr0); bus_space_write_4(iot, ioh, LCDC_LCCR1, @@ -128,6 +134,7 @@ pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *sc, bus_space_tag_t iot = pxa->pxa_iot; bus_space_handle_t ioh; int error, nldd; + u_int32_t lccr0, lscr; sc->n_screens = 0; LIST_INIT(&sc->screens); @@ -144,12 +151,41 @@ pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *sc, sc->ioh = ioh; sc->dma_tag = &pxa2x0_bus_dma_tag; - sc->ih = pxa2x0_intr_establish(17, IPL_BIO, lcdintr, sc); + sc->ih = pxa2x0_intr_establish(17, IPL_BIO, lcdintr, sc, + sc->dev.dv_xname); if (sc->ih == NULL) printf("%s: unable to establish interrupt at irq %d", sc->dev.dv_xname, 17); /* Initialize LCD controller */ + { + printf("\nbefore\n"); + u_int32_t tmp; + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR0); + printf("LCCR0 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR1); + printf("LCCR1 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR2); + printf("LCCR2 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR3); + printf("LCCR3 %08x\n", tmp); + } + + /* Check if LCD is enabled before programming, it should not + * be enabled while it is being reprogrammed, therefore disable + * it first. + */ + lccr0 = bus_space_read_4(iot, ioh, LCDC_LCCR0); + if (lccr0 & LCCR0_ENB) { + lccr0 |= LCCR0_LDM; + bus_space_write_4(iot, ioh, LCDC_LCCR0, lccr0); + lccr0 = bus_space_read_4(iot, ioh, LCDC_LCCR0); /* paranoia */ + lccr0 |= LCCR0_DIS; + bus_space_write_4(iot, ioh, LCDC_LCCR0, lccr0); + do { + lscr = bus_space_read_4(iot, ioh, LCDC_LCSR); + } while (!(lscr & LCSR_LDD)); + } /* enable clock */ pxa2x0_clkman_config(CKEN_LCD, 1); @@ -184,6 +220,18 @@ pxa2x0_lcd_attach_sub(struct pxa2x0_lcd_softc *sc, pxa2x0_gpio_set_function(58 + nldd, GPIO_ALT_FN_2_OUT); pxa2x0_lcd_geometry(sc, geom); + { + printf("\nafter\n"); + u_int32_t tmp; + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR0); + printf("LCCR0 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR1); + printf("LCCR1 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR2); + printf("LCCR2 %08x\n", tmp); + tmp = bus_space_read_4(iot, ioh, LCDC_LCCR3); + printf("LCCR3 %08x\n", tmp); + } } diff --git a/sys/arch/zaurus/zaurus/zaurus_lcd.c b/sys/arch/zaurus/zaurus/zaurus_lcd.c index a0f6319cb85..53285c00f8c 100644 --- a/sys/arch/zaurus/zaurus/zaurus_lcd.c +++ b/sys/arch/zaurus/zaurus/zaurus_lcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_lcd.c,v 1.2 2005/01/02 19:43:07 drahn Exp $ */ +/* $OpenBSD: zaurus_lcd.c,v 1.3 2005/01/03 04:50:22 drahn Exp $ */ /* $NetBSD: lubbock_lcd.c,v 1.1 2003/08/09 19:38:53 bsh Exp $ */ /* @@ -166,26 +166,25 @@ lcd_match( struct device *parent, void *cf, void *aux ) /* #define CURRENT_DISPLAY opus */ -#define CURRENT_DISPLAY sharp_LM8V31 +#define CURRENT_DISPLAY sharp_zaurus_C3000 -static const struct lcd_panel_geometry sharp_LM8V31 = +static const struct lcd_panel_geometry sharp_zaurus_C3000 = { - 640, /* Width */ - 480, /* Height */ + 480, /* Width */ + 640, /* Height */ 0, /* No extra lines */ - LCDPANEL_PASSIVE|LCDPANEL_PCP, - 10, /* clock divider */ - 0xff, /* AC bias pin freq */ + LCDPANEL_ACTIVE|LCDPANEL_VSP|LCDPANEL_HSP, + 1, /* clock divider */ + 0, /* AC bias pin freq */ - 2, /* horizontal sync pulse width */ - 3, /* BLW */ - 3, /* ELW */ + 0x27, /* horizontal sync pulse width */ + 0x2e, /* BLW */ + 0x7d, /* ELW */ - 1, /* vertical sync pulse width */ - 0, /* BFW */ + 2, /* vertical sync pulse width */ + 1, /* BFW */ 0, /* EFW */ - }; static const struct lcd_panel_geometry opus = |