nicamd: Introduce new programmer driver for AMD NICs

On a PCnet32 FAST card with a nice PLCC32 socket, only 18 of the 20 ad-
dress lines were connected. It's not easy to detect this, but we'll do
our best: Check the ROM contents for repeating patterns, and allow the
user to override the guessed size. We use the ROM BAR here, though not
for the actual flash reading / writing. According to the datasheet the
ROM BAR interface always reads four bytes, and doesn't seem to support
writes.

Otherwise tested successfully with the first 256KiB of an SST39VF040.

Datasheet used:
https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/datasheets/20550.pdf

Change-Id: I3bddfcd1e242d28790a0916197ebd8b8bba5a70a
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/530
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/meson.build b/meson.build
index d7865d4..b94d951 100644
--- a/meson.build
+++ b/meson.build
@@ -347,6 +347,14 @@
     'srcs'    : files('nic3com.c', 'pcidev.c'),
     'flags'   : [ '-DCONFIG_NIC3COM=1' ],
   },
+  'nicamd' : {
+    'systems' : systems_hwaccess,
+    'cpu_families' : [ cpus_port_io ],
+    'deps'    : [ libpci ],
+    'groups'  : [ group_pci, group_internal ],
+    'srcs'    : files('nicamd.c', 'pcidev.c'),
+    'flags'   : [ '-DCONFIG_NICAMD=1' ],
+  },
   'nicintel' : {
     'systems' : systems_hwaccess,
     'cpu_families' : [ cpus_raw_mem ],