diff --git a/Makefile b/Makefile index 1653fda..850b29f 100644 --- a/Makefile +++ b/Makefile @@ -170,10 +170,10 @@ endif ifdef QEMU_OLD $(TARGET): $(OBJS) $(VVFATOBJS) $(QEMU)/arm-softmmu/libqemu.a - $(CC) -Wl,--no-as-needed $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS) else $(TARGET): $(OBJS) $(VVFATOBJS) $(QEMU_OBJS) - $(CC) -Wl,--no-as-needed $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS) endif flash-49g+: $(BOOT49GP) flash-noboot diff --git a/README.md b/README.md index f4f715f..d778396 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,32 @@ -Additional note: August 22, 2013 - -Updated this so that it'll compile on Ubuntu 12.04. - ---Nicholas Kirchner - Quick Start Guide -04/25/2010 +03/27/2017 Egan Ford NOTE: READ ALL INSTRUCTIONS Prereqs: -* OS/X 10.6 64-bit: +* MacOS 10.12 64-bit: - * Install X11, Xcode (from your installation media) in that order. + * Install XQuartz, Xcode (from your installation media) in that order. * Install Macports (macports.org), then: ``` - sudo port install gtk2 - sudo port install pkgconfig + sudo port install gtk2 pkgconfig gcc6 + sudo port select --set gcc mp-gcc6 + export PATH=/opt/local/bin:$PATH ``` -* Ubuntu 9.04 32-bit, 9.04 64-bit, 9.10 32-bit, 9.10 64-bit: +* Ubuntu: ``` - sudo apt-get install libgtk2.0-dev - sudo apt-get install subversion + sudo apt-get install git libgtk2.0-dev ``` -* RedHat/CentOS 5.4 64-bit, Fedora 12 64-bit: +* RedHat/CentOS, Fedora: ``` - sudo yum install subversion gtk2-devel + sudo yum install git gtk2-devel ``` ------------------------------------------------------------------------ @@ -44,7 +38,7 @@ Start up X11 and use xterm Download x49gp source: ``` -svn co http://x49gp.svn.sourceforge.net/svnroot/x49gp x49gp +git clone https://github.com/chwdt/x49gp.git ``` ------------------------------------------------------------------------ @@ -178,6 +172,17 @@ make flash-49g+ flash-50g flash-noboot sram s3c2410-sram Known Limitations: * HPGCC SD Card I/O - . libfsystem unavailable. - . f* calls unstable (HPGCC2) - . f* calls stable (HPGCC3) + - `libfsystem` unavailable. + - `f*` calls unstable (HPGCC2) + - `f*` calls stable (HPGCC3) + +------------------------------------------------------------------------ + +Change Log: + +Additional note: August 22, 2013 + +Updated this so that it'll compile on Ubuntu 12.04. + +--Nicholas Kirchner + diff --git a/include/s3c2410.h b/include/s3c2410.h index 53d1b58..4be61ab 100644 --- a/include/s3c2410.h +++ b/include/s3c2410.h @@ -336,7 +336,7 @@ extern int x49gp_s3c2410_adc_init(x49gp_t *x49gp); extern int x49gp_s3c2410_spi_init(x49gp_t *x49gp); extern int x49gp_s3c2410_sdi_init(x49gp_t *x49gp); -extern void s3c2410_io_port_g_set_bit(x49gp_t *x49gp, int n, uint32_t set); +extern void s3c2410_io_port_g_update(x49gp_t *x49gp); extern void s3c2410_io_port_f_set_bit(x49gp_t *x49gp, int n, uint32_t set); extern void x49gp_schedule_lcd_update(x49gp_t *x49gp); diff --git a/newconfig b/newconfig index 7050357..50a0e01 100755 --- a/newconfig +++ b/newconfig @@ -7,11 +7,11 @@ then fi B=${PWD##$HOME/} -perl -pi -e "s!^(basename=).*!\1$B!" config +perl -p -e "s!^(basename=).*!\1$B!" config if [ "$(uname -s)" = "Linux" ] then - perl -pi -e "s!^(filename=sdcard).dmg!\1!" config + perl -p -e "s!^(filename=sdcard).dmg!\1!" config fi echo "New config created" diff --git a/s3c2410_io_port.c b/s3c2410_io_port.c index 7f2f4a8..c857c99 100644 --- a/s3c2410_io_port.c +++ b/s3c2410_io_port.c @@ -356,111 +356,124 @@ static uint32_t lcd_data = 0; } void -s3c2410_io_port_g_set_bit(x49gp_t *x49gp, int n, uint32_t set) +s3c2410_io_port_g_update(x49gp_t *x49gp) { s3c2410_io_port_t *io = x49gp->s3c2410_io_port; - uint32_t value, change; - int pending; -#ifdef DEBUG_S3C2410_IO_PORT - int level = 0; -#endif - - if (n > 7) - return; - -// g_mutex_lock(x49gp->memlock); + uint32_t oldvalue, change; + int n; + oldvalue=io->gpgdat; io->gpgdat = s3c2410_scan_keys(x49gp, io->gpgcon, io->gpgdat); -#ifdef DEBUG_S3C2410_IO_PORT - printf("IO_PORT: %s GPG bit %u\n", set ? "assert" : "deassert", n); - printf("IO_PORT: GPGCON %08x, GPGDAT %08x\n", io->gpgcon, io->gpgdat); -#endif + change=io->gpgdat^oldvalue; - if (0 == set) { - value = 1; - } else { - if ((((io->gpgcon >> (2 * (n + 8))) & 3) == 1) && - (((io->gpgdat >> (n + 8)) & 1) == 0)) { - value = 0; - } else { - value = 1; - } - } -#ifdef DEBUG_S3C2410_IO_PORT - printf("IO_PORT: GPG bit %u value: %u\n", n, value); -#endif + for(n=0;n<15;++n) { - change = 0; switch ((io->gpgcon >> (2 * n)) & 3) { - case 0: /* Input */ - io->gpgdat &= ~(1 << n); - io->gpgdat |= (value << n); - goto out; case 2: /* Interrupt */ - change = io->gpgdat ^ (value << n); - io->gpgdat &= ~(1 << n); - io->gpgdat |= (value << n); + { + if(n+8<=15) { + // EINT 8-15 + switch ((io->extint1 >> (4 * n)) & 7) { + case 0: /* Low Level */ + if (!(io->gpgdat & (1 << n))) + { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 1: /* High Level */ + if (io->gpgdat & (1 << n)) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 2: /* Falling Edge */ + case 3: + if ((change & (1 << n)) && !(io->gpgdat & (1 << n))) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 4: /* Rising Edge */ + case 5: + if ((change & (1 << n)) && (io->gpgdat & (1 << n))) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 6: /* Any Edge */ + case 7: + if (change & (1 << n)) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } break; + } + } + else { + // EINT 16-23 + switch ((io->extint2 >> (4 * (n-8))) & 7) { + case 0: /* Low Level */ + if (!(io->gpgdat & (1 << n))) + { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 1: /* High Level */ + if (io->gpgdat & (1 << n)) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 2: /* Falling Edge */ + case 3: + if ((change & (1 << n)) && !(io->gpgdat & (1 << n))) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 4: /* Rising Edge */ + case 5: + if ((change & (1 << n)) && (io->gpgdat & (1 << n))) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + case 6: /* Any Edge */ + case 7: + if (change & (1 << n)) { + io->eintpend |= 1 << (n + 8); + if (io->eintpend & ~(io->eintmask)) + s3c2410_intc_assert(x49gp, EINT8_23, 1); + } + break; + } - case 1: /* Output */ + + + } + } + break; + case 0: /* Input */ + case 1: /* Output */ case 3: /* Reserved */ - goto out; - } - -#ifdef DEBUG_S3C2410_IO_PORT - printf("IO_PORT: GPGDAT %08x, change %08x\n", io->gpgdat, change); -#endif - - pending = -1; - - switch ((io->extint1 >> (4 * n)) & 7) { - case 0: /* Low Level */ - if (!(io->gpgdat & (1 << n))) - pending = n; -#ifdef DEBUG_S3C2410_IO_PORT - level = 1; -#endif - break; - case 1: /* High Level */ - if (io->gpgdat & (1 << n)) - pending = n; -#ifdef DEBUG_S3C2410_IO_PORT - level = 1; -#endif - break; - case 2: /* Falling Edge */ - case 3: - if ((change & (1 << n)) && !(io->gpgdat & (1 << n))) - pending = n; - break; - case 4: /* Rising Edge */ - case 5: - if ((change & (1 << n)) && (io->gpgdat & (1 << n))) - pending = n; - break; - case 6: /* Any Edge */ - case 7: - if (change & (1 << n)) - pending = n; break; } -#ifdef DEBUG_S3C2410_IO_PORT - printf("IO_PORT: IRQ: %d, (Level %u)\n", pending, level); -#endif - - if (-1 == pending) - goto out; - - io->eintpend |= 1 << (n + 8); - if (io->eintpend & ~(io->eintmask)) - s3c2410_intc_assert(x49gp, EINT8_23, 1); - -out: -// g_mutex_unlock(x49gp->memlock); + } return; } diff --git a/ui.c b/ui.c index 008b529..36296e5 100644 --- a/ui.c +++ b/ui.c @@ -1499,9 +1499,10 @@ x49gp_ui_button_press(GtkWidget *widget, GdkEventButton *event, #endif if (key->rowbit) { - s3c2410_io_port_g_set_bit(x49gp, key->eint, 1); x49gp->keybycol[key->column] |= key->rowbit; x49gp->keybyrow[key->row] |= key->columnbit; + s3c2410_io_port_g_update(x49gp); + } else { s3c2410_io_port_f_set_bit(x49gp, key->eint, 1); } @@ -1554,9 +1555,10 @@ x49gp_ui_button_release(GtkWidget *widget, GdkEventButton *event, key = button->key; if (key->rowbit) { - s3c2410_io_port_g_set_bit(x49gp, key->eint, 0); x49gp->keybycol[key->column] &= ~(key->rowbit); x49gp->keybyrow[key->row] &= ~(key->columnbit); + s3c2410_io_port_g_update(x49gp); + } else { s3c2410_io_port_f_set_bit(x49gp, key->eint, 0); }