diff --git a/dediprog.c b/dediprog.c index db4e39ff..cffb24c2 100644 --- a/dediprog.c +++ b/dediprog.c @@ -1380,8 +1380,7 @@ static int dediprog_init(struct flashprog_programmer *const prog) if (dediprog_standalone_mode(dp_data)) goto init_err_cleanup_exit; - if ((dp_data->devicetype == DEV_SF100) || - (dp_data->devicetype == DEV_SF600 && protocol(dp_data) == PROTOCOL_V3)) + if (dp_data->devicetype == DEV_SF100 && protocol(dp_data) == PROTOCOL_V1) spi_master_dediprog.features &= ~SPI_MASTER_NO_4BA_MODES; if (protocol(dp_data) >= PROTOCOL_V2) diff --git a/ichspi.c b/ichspi.c index 18f0d3f5..0fc96bab 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1576,7 +1576,7 @@ static int ich_spi_send_multicommand(const struct flashctx *flash, static bool ich_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode) { - return find_opcode(curopcodes, opcode) >= 0; + return !ichspi_lock || find_opcode(curopcodes, opcode) >= 0; } #define ICH_BMWAG(x) ((x >> 24) & 0xff) diff --git a/meson.build b/meson.build index f1905f88..efe10cd3 100644 --- a/meson.build +++ b/meson.build @@ -111,6 +111,7 @@ systems_hwaccess = [ 'linux', 'openbsd', 'freebsd', 'dragonfly', 'netbsd' ] systems_serial = [ 'linux', 'openbsd', 'freebsd', 'dragonfly', 'netbsd', 'darwin' ] cpus_port_io = [ 'x86', 'x86_64' ] +cpus_raw_mem = [ 'x86', 'x86_64', 'mips', 'mips64', 'ppc', 'ppc64', 'arm', 'aarch64', 'sparc', 'sparc64', 'arc', 'e2k' ] group_ftdi = get_option('programmer').contains('group_ftdi') group_pci = get_option('programmer').contains('group_pci') @@ -157,7 +158,7 @@ linux_headers = \ programmer = { 'atahpt' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('atahpt.c', 'pcidev.c'), @@ -166,7 +167,7 @@ programmer = { }, 'atapromise' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io, cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('atapromise.c', 'pcidev.c'), @@ -224,6 +225,7 @@ programmer = { }, 'drkaiser' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('drkaiser.c', 'pcidev.c'), @@ -241,6 +243,7 @@ programmer = { }, 'gfxnvidia' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('gfxnvidia.c', 'pcidev.c'), @@ -248,7 +251,7 @@ programmer = { }, 'internal' : { 'systems' : systems_hwaccess + ['linux'], - 'cpu_families' : (host_machine.system() == 'linux' ? [host_machine.cpu_family()] : ['x86', 'x86_64']), + 'cpu_families' : (host_machine.system() == 'linux' ? [ cpus_raw_mem ] : [ ['x86', 'x86_64'] ]), 'deps' : [ libpci ], 'groups' : [ group_internal ], 'srcs' : (host_machine.cpu_family() in ['x86', 'x86_64'] ? files( @@ -284,6 +287,7 @@ programmer = { }, 'it8212' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('it8212.c', 'pcidev.c'), @@ -328,7 +332,7 @@ programmer = { }, 'nic3com' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nic3com.c', 'pcidev.c'), @@ -336,6 +340,7 @@ programmer = { }, 'nicintel' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nicintel.c', 'pcidev.c'), @@ -343,6 +348,7 @@ programmer = { }, 'nicintel_eeprom' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nicintel_eeprom.c', 'pcidev.c'), @@ -350,6 +356,7 @@ programmer = { }, 'nicintel_spi' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nicintel_spi.c', 'pcidev.c'), @@ -357,7 +364,7 @@ programmer = { }, 'nicnatsemi' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nicnatsemi.c', 'pcidev.c'), @@ -366,7 +373,7 @@ programmer = { }, 'nicrealtek' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('nicrealtek.c', 'pcidev.c'), @@ -374,6 +381,7 @@ programmer = { }, 'ogp_spi' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('ogp_spi.c', 'pcidev.c'), @@ -393,14 +401,14 @@ programmer = { }, 'rayer_spi' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io ], 'groups' : [ group_internal ], 'srcs' : files('rayer_spi.c'), 'flags' : [ '-DCONFIG_RAYER_SPI=1' ], }, 'satamv' : { 'systems' : systems_hwaccess, - 'cpu_families' : cpus_port_io, + 'cpu_families' : [ cpus_port_io, cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('satamv.c', 'pcidev.c'), @@ -408,6 +416,7 @@ programmer = { }, 'satasii' : { 'systems' : systems_hwaccess, + 'cpu_families' : [ cpus_raw_mem ], 'deps' : [ libpci ], 'groups' : [ group_pci, group_internal ], 'srcs' : files('satasii.c', 'pcidev.c'), @@ -453,8 +462,13 @@ foreach p_name, p_data : programmer selected_soft = p_data.get('groups').contains(true) or \ 'all' in get_option('programmer') or \ 'auto' in get_option('programmer') and p_data.get('default') - available = (p_data.get('systems').contains('all') or p_data.get('systems').contains(host_machine.system())) \ - and (p_data.get('cpu_families').contains('all') or p_data.get('cpu_families').contains(host_machine.cpu_family())) + + available = (p_data.get('systems') == ['all'] or p_data.get('systems').contains(host_machine.system())) + if p_data.get('cpu_families') != ['all'] + foreach families_list : p_data.get('cpu_families') + available = available and families_list.contains(host_machine.cpu_family()) + endforeach + endif foreach dep : p_data.get('deps') if not dep.found() diff --git a/platform/meson.build b/platform/meson.build index fcd32f80..cd8810d5 100644 --- a/platform/meson.build +++ b/platform/meson.build @@ -1,3 +1,5 @@ +fs = import('fs') + srcs += files( ('endian_' + host_machine.endian() + '.c'), 'memaccess.c', @@ -21,15 +23,19 @@ if host_machine.system() == 'openbsd' endif endif -# NetBSD requires libx86 or libx86_64 for I/O port handling if host_machine.system() == 'netbsd' + # NetBSD requires libi386 or libx86_64 for I/O port handling if host_machine.cpu_family() == 'x86' - libx86 = cc.find_library('x86') - deps += libx86 + libi386 = cc.find_library('i386') + deps += libi386 elif host_machine.cpu_family() == 'x86_64' libx86_64 = cc.find_library('x86_64') deps += libx86_64 endif + # and special handling for `pci.h` not being inside `pci/` + if fs.exists('/usr/pkg/include/pciutils/pci.h') + add_project_arguments('-DPCIUTILS_PCI_H', language : 'c') + endif endif diff --git a/versioninfo.inc b/versioninfo.inc new file mode 100644 index 00000000..a24fe0b2 --- /dev/null +++ b/versioninfo.inc @@ -0,0 +1,2 @@ +VERSION = v1.1 +MAN_DATE = 2024-03-27