On behalf of:3298

Merge remote-tracking branch 'datajerk/master'
This commit is contained in:
claudiol 2018-05-07 17:26:44 -04:00
commit 066af08ae5
6 changed files with 135 additions and 115 deletions

View file

@ -170,10 +170,10 @@ endif
ifdef QEMU_OLD ifdef QEMU_OLD
$(TARGET): $(OBJS) $(VVFATOBJS) $(QEMU)/arm-softmmu/libqemu.a $(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 else
$(TARGET): $(OBJS) $(VVFATOBJS) $(QEMU_OBJS) $(TARGET): $(OBJS) $(VVFATOBJS) $(QEMU_OBJS)
$(CC) -Wl,--no-as-needed $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS) $(CC) $(LDFLAGS) -o $@ $(OBJS) $(VVFATOBJS) $(LDLIBS)
endif endif
flash-49g+: $(BOOT49GP) flash-noboot flash-49g+: $(BOOT49GP) flash-noboot

View file

@ -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 Quick Start Guide
04/25/2010 03/27/2017
Egan Ford <egan@sense.net> Egan Ford <egan@sense.net>
NOTE: READ ALL INSTRUCTIONS NOTE: READ ALL INSTRUCTIONS
Prereqs: 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: * Install Macports (macports.org), then:
``` ```
sudo port install gtk2 sudo port install gtk2 pkgconfig gcc6
sudo port install pkgconfig 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 git libgtk2.0-dev
sudo apt-get install subversion
``` ```
* 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: 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: Known Limitations:
* HPGCC SD Card I/O * HPGCC SD Card I/O
. libfsystem unavailable. - `libfsystem` unavailable.
. f* calls unstable (HPGCC2) - `f*` calls unstable (HPGCC2)
. f* calls stable (HPGCC3) - `f*` calls stable (HPGCC3)
------------------------------------------------------------------------
Change Log:
Additional note: August 22, 2013
Updated this so that it'll compile on Ubuntu 12.04.
--Nicholas Kirchner

View file

@ -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_spi_init(x49gp_t *x49gp);
extern int x49gp_s3c2410_sdi_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 s3c2410_io_port_f_set_bit(x49gp_t *x49gp, int n, uint32_t set);
extern void x49gp_schedule_lcd_update(x49gp_t *x49gp); extern void x49gp_schedule_lcd_update(x49gp_t *x49gp);

View file

@ -7,11 +7,11 @@ then
fi fi
B=${PWD##$HOME/} B=${PWD##$HOME/}
perl -pi -e "s!^(basename=).*!\1$B!" <config.tmpl >config perl -p -e "s!^(basename=).*!\1$B!" <config.tmpl >config
if [ "$(uname -s)" = "Linux" ] if [ "$(uname -s)" = "Linux" ]
then then
perl -pi -e "s!^(filename=sdcard).dmg!\1!" config perl -p -e "s!^(filename=sdcard).dmg!\1!" config
fi fi
echo "New config created" echo "New config created"

View file

@ -356,111 +356,124 @@ static uint32_t lcd_data = 0;
} }
void 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; s3c2410_io_port_t *io = x49gp->s3c2410_io_port;
uint32_t value, change; uint32_t oldvalue, change;
int pending; int n;
#ifdef DEBUG_S3C2410_IO_PORT
int level = 0;
#endif
if (n > 7)
return;
// g_mutex_lock(x49gp->memlock);
oldvalue=io->gpgdat;
io->gpgdat = s3c2410_scan_keys(x49gp, io->gpgcon, io->gpgdat); io->gpgdat = s3c2410_scan_keys(x49gp, io->gpgcon, io->gpgdat);
#ifdef DEBUG_S3C2410_IO_PORT change=io->gpgdat^oldvalue;
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
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 for(n=0;n<15;++n) {
printf("IO_PORT: GPG bit %u value: %u\n", n, value);
#endif
change = 0;
switch ((io->gpgcon >> (2 * n)) & 3) { switch ((io->gpgcon >> (2 * n)) & 3) {
case 0: /* Input */
io->gpgdat &= ~(1 << n);
io->gpgdat |= (value << n);
goto out;
case 2: /* Interrupt */ case 2: /* Interrupt */
change = io->gpgdat ^ (value << n); {
io->gpgdat &= ~(1 << n); if(n+8<=15) {
io->gpgdat |= (value << n); // 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; 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 */ 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; 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; return;
} }

6
ui.c
View file

@ -1499,9 +1499,10 @@ x49gp_ui_button_press(GtkWidget *widget, GdkEventButton *event,
#endif #endif
if (key->rowbit) { if (key->rowbit) {
s3c2410_io_port_g_set_bit(x49gp, key->eint, 1);
x49gp->keybycol[key->column] |= key->rowbit; x49gp->keybycol[key->column] |= key->rowbit;
x49gp->keybyrow[key->row] |= key->columnbit; x49gp->keybyrow[key->row] |= key->columnbit;
s3c2410_io_port_g_update(x49gp);
} else { } else {
s3c2410_io_port_f_set_bit(x49gp, key->eint, 1); 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; key = button->key;
if (key->rowbit) { if (key->rowbit) {
s3c2410_io_port_g_set_bit(x49gp, key->eint, 0);
x49gp->keybycol[key->column] &= ~(key->rowbit); x49gp->keybycol[key->column] &= ~(key->rowbit);
x49gp->keybyrow[key->row] &= ~(key->columnbit); x49gp->keybyrow[key->row] &= ~(key->columnbit);
s3c2410_io_port_g_update(x49gp);
} else { } else {
s3c2410_io_port_f_set_bit(x49gp, key->eint, 0); s3c2410_io_port_f_set_bit(x49gp, key->eint, 0);
} }