[4374] Nokia N810 basic system emulation.
Revision: 4374
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4374 Author: balrog Date: 2008-05-07 14:30:38 +0000 (Wed, 07 May 2008)
Log Message:
-----------
Nokia N810 basic system emulation.
Add TSC2005 touchscreen controller.
Add N810 machine definition.
Unify N800 and N810 ATAG list generation. Pass a word length parameter on every SPI transfer.
Modified Paths:
--------------
trunk/Makefile.target
trunk/hw/boards.h
trunk/hw/devices.h
trunk/hw/nseries.c
trunk/hw/omap.h
trunk/hw/omap2.c
trunk/hw/tsc210x.cModified: trunk/Makefile.target
===================================================================
Makefile.target +1 -0
@@ -622,6 +622,7 @@ OBJS+= omap2.o omap_dss.o OBJS+= palm.o tsc210x.o OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o +OBJS+= tsc2005.o OBJS+= mst_fpga.o mainstone.o OBJS+= musicpal.o pflash_cfi02.o CPPFLAGS += -DHAS_AUDIO
Modified: trunk/hw/boards.h
===================================================================
hw/boards.h +1 -0
@@ -86,6 +86,7 @@/* nseries.c */ extern QEMUMachine n800_machine; +extern QEMUMachine n810_machine;/* gumstix.c */ extern QEMUMachine connex_machine;
Modified: trunk/hw/devices.h
===================================================================
hw/devices.h +6 -1
@@ -23,11 +23,16 @@struct uwire_slave_s *tsc2301_init (qemu_irq penirq,qemu_irq kbirq,qemu_irq dav,AudioState *audio);struct i2s_codec_s *tsc210x_codec (struct uwire_slave_s *chip); -uint32_t tsc210x_txrx (void *opaque,uint32_t value); +uint32_t tsc210x_txrx (void *opaque,uint32_t value,int len);void tsc210x_set_transform (struct uwire_slave_s *chip,struct mouse_transform_info_s *info);void tsc210x_key_event (struct uwire_slave_s *chip,int key,int down); +/* tsc2005.c */ +void *tsc2005_init (qemu_irq pintdav); +uint32_t tsc2005_txrx (void *opaque,uint32_t value,int len); +void tsc2005_set_transform (void *opaque,struct mouse_transform_info_s *info); +/* stellaris_input.c */ void stellaris_gamepad_init (int n,qemu_irq *irq,const int *keycode);
Modified: trunk/hw/nseries.c
===================================================================
hw/nseries.c +283 -194
713 lines not on this page · raw message
Modified: trunk/hw/omap.h
===================================================================
hw/omap.h +10 -1
@@ -695,7 +695,7 @@struct omap_mcspi_s *omap_mcspi_init (struct omap_target_agent_s *ta,int chnum,qemu_irq irq,qemu_irq *drq,omap_clk fclk,omap_clk iclk);void omap_mcspi_attach (struct omap_mcspi_s *s, -uint32_t (*txrx)(void *opaque,uint32_t ),void *opaque, +uint32_t (*txrx)(void *opaque,uint32_t ,int ),void *opaque,int chipselect);struct omap_rtc_s ;
@@ -1012,6 +1012,15 @@#define OMAP_TAG_FLASH_PART_STR 0x4f81#define OMAP_TAG_VERSION_STR 0x4f82 +enum { +OMAP_GPIOSW_TYPE_COVER =0 <<4 , +OMAP_GPIOSW_TYPE_CONNECTION =1 <<4 , +OMAP_GPIOSW_TYPE_ACTIVITY =2 <<4 , +}; + +#define OMAP_GPIOSW_INVERTED 0x0001 +#define OMAP_GPIOSW_OUTPUT 0x0002 +# define TCMI_VERBOSE 1//# define MEM_VERBOSE 1
Modified: trunk/hw/omap2.c
===================================================================
hw/omap2.c +9 -4
@@ -1109,7 +1109,7 @@struct omap_mcspi_ch_s {qemu_irq txdrq;qemu_irq rxdrq; -uint32_t (*txrx)(void *opaque,uint32_t ); +uint32_t (*txrx)(void *opaque,uint32_t ,int );void *opaque;uint32_t tx;
@@ -1157,7 +1157,8 @@if (!(s->control &1 ) ||/* SINGLE */ (ch->config & (1 <<20 ))) {/* FORCE */ if (ch->txrx) - ch->rx = ch->txrx (ch->opaque, ch->tx); + ch->rx = ch->txrx (ch->opaque, ch->tx,/* WL */ +1 + (0x1f & (ch->config >>7 ))); } ch->tx =0 ;
@@ -1408,7 +1409,7 @@ }void omap_mcspi_attach (struct omap_mcspi_s *s, -uint32_t (*txrx)(void *opaque,uint32_t ),void *opaque, +uint32_t (*txrx)(void *opaque,uint32_t ,int ),void *opaque,int chipselect) {if (chipselect <0 || chipselect >= s->chnum)
@@ -1476,7 +1477,8 @@case 0x24 :/* STI_ER / STI_DR / XTI_TRACESELECT */ case 0x28 :/* STI_RX_DR / XTI_RXDATA */ -break ; +/* TODO */ +return 0 ;case 0x2c :/* STI_CLK_CTRL / XTI_SCLKCRTL */ return s->clkcontrol;
@@ -1527,6 +1529,9 @@case 0x24 :/* STI_ER / STI_DR / XTI_TRACESELECT */ case 0x28 :/* STI_RX_DR / XTI_RXDATA */ +/* TODO */ +return ; +default :OMAP_BAD_REG (addr);return ;
Modified: trunk/hw/tsc210x.c
===================================================================
hw/tsc210x.c +13 -9
@@ -939,11 +939,15 @@ } } -uint32_t tsc210x_txrx (void *opaque,uint32_t value) +uint32_t tsc210x_txrx (void *opaque,uint32_t value,int len) {struct tsc210x_state_s *s = opaque;uint32_t ret =0 ; +if (len !=16 ) +cpu_abort (cpu_single_env,"%s: FIXME: bad SPI word width %i\n" , + __FUNCTION__, len); +/* TODO: sequential reads etc - how do we make sure the host doesn't * unintentionally read out a conversion result from a register while * transmitting the command word of the next command? */
@@ -1124,12 +1128,12 @@ s->tr[0 ] =0 ; s->tr[1 ] =1 ; - s->tr[2 ] =0 ; - s->tr[3 ] =1 ; + s->tr[2 ] =1 ; + s->tr[3 ] =0 ; s->tr[4 ] =1 ; s->tr[5 ] =0 ; - s->tr[6 ] =0 ; - s->tr[7 ] =1 ; + s->tr[6 ] =1 ; + s->tr[7 ] =0 ; s->chip.opaque = s; s->chip.send = (void *) tsc210x_write;
@@ -1178,12 +1182,12 @@ s->tr[0 ] =0 ; s->tr[1 ] =1 ; - s->tr[2 ] =0 ; - s->tr[3 ] =1 ; + s->tr[2 ] =1 ; + s->tr[3 ] =0 ; s->tr[4 ] =1 ; s->tr[5 ] =0 ; - s->tr[6 ] =0 ; - s->tr[7 ] =1 ; + s->tr[6 ] =1 ; + s->tr[7 ] =0 ; s->chip.opaque = s; s->chip.send = (void *) tsc210x_write;