Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

em100: init at unstable-2022-05-02-86631c9 #178213

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,15 @@
githubId = 5149377;
name = "Amine Chikhaoui";
};
amjoseph = {
name = "Adam Megacz Joseph";
email = "adam@westernsemico.com";
github = "amjoseph-nixpkgs";
githubId = 54836058;
keys = [{
fingerprint = "AD25 6548 09B0 F2A5 D246 1AFF E702 47B6 4C13 EEBE";
}];
};
amorsillo = {
email = "andrew.morsillo@gmail.com";
github = "AndrewMorsillo";
Expand Down
68 changes: 68 additions & 0 deletions pkgs/misc/drivers/em100/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{ lib
, stdenv
, curl
, pkg-config
, libusb
, fetchgit
}:
stdenv.mkDerivation rec {
pname = "em100";
version = "unstable-2022-05-02-86631c9"; # upstream does not appear to have formal releases
src = fetchgit {
url = "https://review.coreboot.org/em100";
rev = "7cd8c935239ab63ea7dd583183d8144e38c42186";
hash = "sha256-zKRVhqNHtgVj6JDkTV+6GEjmM1FICqQr286uTXwUvpo=";
};

enableParallelBuilding = true;

nativeBuildInputs = [
pkg-config
];

buildInputs = [
libusb
curl # for optionally downloading firmware images
];

installPhase = ''
This conversation was marked as resolved.
Show resolved Hide resolved
runHook preInstall
mkdir -p $out/bin
install -m 750 em100 $out/bin/em100
mkdir -p $out/lib/udev/rules.d/
install -m 644 60-dediprog-em100pro.rules $out/lib/udev/rules.d/
runHook postInstall
'';

meta = with lib; {
homepage = "https://www.coreboot.org/EM100pro";
description = "Allows operating a Dediprog EM100Pro SPI NOR Flash Emulator";
longDescription = # copied from README
''
This tool supports using the Dediprog EM100-Pro [1] in Linux. It supports both
the original version and the new -G2 variant.

The 'em100' device provides a way to emulate a SPI-flash chip. Various
connectors are available to allow it to take over from the in-circuit SPI chip
so that the SoC sees the em100's internal memory as the contents of the SPI
flash. Images can be loaded into the em100 over USB in a few seconds, thus
providing a much faster development cycle than is possible by reprogramming
the SPI flash each time.

Major features provided by the tool include:

- Set the chip being emulated (the tool supports about 600)
- Adjust the state of the hold pin, which supports overriding the internal SPI
- Use of several em100 devices, distinguished by their serial number
- Terminal mode, allowing the SoC to send messages
- Output a trace of SPI commands issued by the SoC
- Reading / writing em100 firmware (dangerous as it can brick your em100)

[1] https://www.dediprog.com/product/EM100Pro-G2
'';
license = licenses.gpl2Plus;
sourceProvenance = [ lib.sourceTypes.fromSource ];
maintainers = with maintainers; [ amjoseph ];
platforms = platforms.all;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34009,6 +34009,8 @@ with pkgs;

terminal-parrot = callPackage ../applications/misc/terminal-parrot { };

em100 = callPackage ../misc/drivers/em100 { };

epson-alc1100 = callPackage ../misc/drivers/epson-alc1100 { };

epson-escpr = callPackage ../misc/drivers/epson-escpr { };
Expand Down