From 100a4099bdca0bf8e916015f34286daba525066e Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 18:41:23 -0300 Subject: [PATCH 1/4] Add Slot 1/Socket 370 category for the Tyan Trinity --- src/include/86box/machine.h | 1 + src/machine/machine_table.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 797d6fbd7..161db2ec3 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -113,6 +113,7 @@ enum { MACHINE_TYPE_SOCKET8, MACHINE_TYPE_SLOT1, MACHINE_TYPE_SLOT1_2, + MACHINE_TYPE_SLOT1_370, MACHINE_TYPE_SLOT2, MACHINE_TYPE_SOCKET370, MACHINE_TYPE_MISC, diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 46d5a4513..4e54bec7c 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -54,6 +54,7 @@ const machine_type_t machine_types[] = { { "Socket 8", MACHINE_TYPE_SOCKET8 }, { "Slot 1", MACHINE_TYPE_SLOT1 }, { "Slot 1/2", MACHINE_TYPE_SLOT1_2 }, + { "Slot 1/Socket 370", MACHINE_TYPE_SLOT1_370 }, { "Slot 2", MACHINE_TYPE_SLOT2 }, { "Socket 370", MACHINE_TYPE_SOCKET370 }, { "Miscellaneous", MACHINE_TYPE_MISC } @@ -858,6 +859,12 @@ const machine_t machines[] = { with most likely AMIKey-2 KBC firmware. */ { "[i440GX] Freeway FW-6400GX", "fw6400gx", MACHINE_TYPE_SLOT1_2, CPU_PKG_SLOT1 | CPU_PKG_SLOT2, 0, 100000000, 150000000, 1800, 3500, 3.0, 8.0, (MACHINE_AGP & ~MACHINE_AT) | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 16384,2080768,16384, 511, machine_at_fw6400gx_init, NULL }, + /* Slot 1/Socket 370 machines */ + /* 440BX */ + /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC + firmware. */ + { "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_s1857_init, at_s1857_get_device }, + /* Slot 2 machines */ /* 440GX */ /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC @@ -883,9 +890,6 @@ const machine_t machines[] = { /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC firmware. */ { "[i440BX] AmazePC AM-BX133", "ambx133", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, /* limits assumed */ MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_ambx133_init, NULL }, - /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC - firmware. */ - { "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SOCKET370, CPU_PKG_SOCKET370, 0, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_AGP | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, machine_at_s1857_init, at_s1857_get_device }, /* 440ZX */ /* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC From 17d93758be67d6dcf7ff019347780bd665bd960b Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 20:24:06 -0300 Subject: [PATCH 2/4] Jenkins: Switch strategy for polled commit detection --- .ci/Jenkinsfile | 83 ++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index a53c461c7..53504ef50 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -81,24 +81,29 @@ def presetFlags = [ def anyFailure = false def gitClone(repository, branch) { - /* Read git tag from environment or set the default one. */ - if (env.GIT_COMMIT == null) - env.GIT_COMMIT = "*/$branch" - println "[-] Using git tag [${env.GIT_COMMIT}]" - /* Clean workspace. */ cleanWs() /* Use stashes to avoid performing multiple clones. */ if (env.GIT_STASHED != 'true') { /* Perform clone/checkout. */ - def scmVars = checkout poll: false, + def scmVars = checkout poll: true, changelog: true, scm: [$class: 'GitSCM', - branches: [[name: env.GIT_COMMIT]], - extensions: [[$class: 'LocalBranch', localBranch: branch]], + branches: [[name: branch]], userRemoteConfigs: [[url: repository]]] - env.GIT_COMMIT = scmVars.GIT_COMMIT + + if (env.GIT_COMMIT == null) { + /* Save the current HEAD commit. */ + env.GIT_COMMIT = scmVars.GIT_COMMIT + } else { + /* Checkout the commit read from the polling log. */ + if (isUnix()) + sh "git checkout ${env.GIT_COMMIT} || exit 0" + else + bat "git checkout ${env.GIT_COMMIT} || exit /b 0" + } + println "[-] Using git commit [${env.GIT_COMMIT}]" /* Stash data and mark it as stashed. */ stash name: 'git' @@ -147,46 +152,32 @@ pipeline { steps { script { - /* Hack to extract the current HEAD commit from this build's git polling - log. This avoids a race condition where HEAD changes in the time period - between Jenkins polling the git repository and the first build node - performing the first git clone once ready. (See issue JENKINS-20518) */ - if (env.GIT_COMMIT == null) { - /* This must run on the master node to read the polling log. */ - node('master') { - /* Ignore exceptions as this is not really critical. */ - try { - /* Switch to this build's directory. */ - dir("${env.JENKINS_HOME}/jobs/${env.JOB_NAME}/builds/${env.BUILD_NUMBER}") { - /* Parse polling log. */ - def pollingLog = readFile file: 'polling.log' - def match = pollingLog =~ /Latest remote head revision on [^ ]+ is: ([a-zA-Z0-9]+)/ - if (match && match[0]) { - env.GIT_COMMIT = match[0][1] - println "[-] Read git tag [${env.GIT_COMMIT}] from polling log" - } + /* Extract the polled commit from the polling log, so that git checkout can be used + to avoid JENKINS-20518 race conditions caused by two pushes too close together. */ + node('master') { /* must run on master node to read polling log */ + /* Ignore exceptions as this is not really critical. */ + try { + /* Switch to this build's directory. */ + dir("${env.JENKINS_HOME}/jobs/${env.JOB_NAME}/builds/${env.BUILD_NUMBER}") { + /* Parse polling log. */ + def pollingLog = readFile file: 'polling.log' + def match = pollingLog =~ /Latest remote head revision on [^ ]+ is: ([a-zA-Z0-9]+)/ + if (match && match[0]) { + env.GIT_COMMIT = match[0][1] + println "[-] Read git commit [${env.GIT_COMMIT}] from polling log" } - } catch (e) {} - } + } + } catch (e) {} + } - /* Perform a git clone on any node to save polling data and, - if polling log parsing failed, get the current HEAD commit. */ - node { - /* Clean workspace. */ - cleanWs() + /* Adding to the above, run a git clone as soon as possible on any node + to further avoid race conditions caused by busy node executor delays. */ + node { + /* Run git clone. */ + gitClone(repository, branch) - /* Perform clone/checkout. */ - def scmVars = checkout poll: true, - changelog: false, - scm: [$class: 'GitSCM', - branches: [[name: branch]], - userRemoteConfigs: [[url: repository]]] - if (env.GIT_COMMIT == null) - env.GIT_COMMIT = scmVars.GIT_COMMIT - - /* Clean workspace again. */ - cleanWs() - } + /* Clean workspace, in case this is running in a non-build node. */ + cleanWs() } /* Create source tarball. */ From aefb90ee8bb20cbae2089837065553a53c5dff31 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 20:33:42 -0300 Subject: [PATCH 3/4] Add AK4540 codec for ES1371 --- src/include/86box/snd_ac97.h | 4 +++- src/sound/snd_ac97_codec.c | 18 ++++++++++++++++++ src/sound/snd_audiopci.c | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/include/86box/snd_ac97.h b/src/include/86box/snd_ac97.h index cd1aaf143..0690cb52b 100644 --- a/src/include/86box/snd_ac97.h +++ b/src/include/86box/snd_ac97.h @@ -101,7 +101,8 @@ enum { AC97_CODEC_CS4297A, AC97_CODEC_WM9701A, AC97_CODEC_STAC9708, - AC97_CODEC_STAC9721 + AC97_CODEC_STAC9721, + AC97_CODEC_AK4540 }; @@ -141,6 +142,7 @@ extern int ac97_codec_count, ac97_modem_codec_count, #ifdef EMU_DEVICE_H extern const device_t ad1881_device; +extern const device_t ak4540_device; extern const device_t alc100_device; extern const device_t cs4297_device; extern const device_t cs4297a_device; diff --git a/src/sound/snd_ac97_codec.c b/src/sound/snd_ac97_codec.c index 64794ce4a..a868b2acd 100644 --- a/src/sound/snd_ac97_codec.c +++ b/src/sound/snd_ac97_codec.c @@ -44,6 +44,12 @@ static const struct { .vendor_regs = (const ac97_vendor_reg_t[]) {{0x74, 0x0000, 0xff07}, {0x76, 0x0404, 0xdde5}, {0x78, 48000, 0x0000}, {0x7a, 48000, 0x0000}, {0}}, .device = &ad1881_device }, + [AC97_CODEC_AK4540] = { + .vendor_id = AC97_VENDOR_ID('A', 'K', 'M', 0x00), + .misc_flags = AC97_MONOOUT | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK, + .powerdown_mask = 0x01f, + .device = &ak4540_device + }, [AC97_CODEC_ALC100] = { .vendor_id = AC97_VENDOR_ID('A', 'L', 'C', 0x20), .misc_flags = AC97_AUXOUT | AC97_MONOOUT | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_POP | AC97_MS | AC97_LPBK, @@ -649,6 +655,18 @@ const device_t ad1881_device = NULL }; +const device_t ak4540_device = +{ + "Asahi Kasei AK4540", + DEVICE_AC97, + AC97_CODEC_AK4540, + ac97_codec_init, ac97_codec_close, ac97_codec_reset, + { NULL }, + NULL, + NULL, + NULL +}; + const device_t alc100_device = { "Avance Logic ALC100", diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index 998d683da..480362e3a 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -1896,6 +1896,9 @@ static const device_config_t es1371_config[] = .type = CONFIG_SELECTION, .selection = { { + .description = "Asahi Kasei AK4540", + .value = AC97_CODEC_AK4540 + }, { .description = "Crystal CS4297", .value = AC97_CODEC_CS4297 }, { From 982e1f808d81e26bbbc1f89500ea95b29da2f715 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 20:41:08 -0300 Subject: [PATCH 4/4] Jenkins git commit presentation fixes --- .ci/Jenkinsfile | 2 +- .ci/build.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 53504ef50..492f19875 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -96,7 +96,7 @@ def gitClone(repository, branch) { if (env.GIT_COMMIT == null) { /* Save the current HEAD commit. */ env.GIT_COMMIT = scmVars.GIT_COMMIT - } else { + } else if (env.GIT_COMMIT != scmVars.GIT_COMMIT) { /* Checkout the commit read from the polling log. */ if (isUnix()) sh "git checkout ${env.GIT_COMMIT} || exit 0" diff --git a/.ci/build.sh b/.ci/build.sh index 690565a56..1fde37f68 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -297,6 +297,7 @@ esac # Add git hash and copyright year. git_hash=$(git rev-parse --short HEAD 2> /dev/null) +[ -z "$git_hash" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8) [ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\"" cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$(date +%Y)\""