Compare commits

..

No commits in common. "master" and "i2c-ebaz4205" have entirely different histories.

3 changed files with 61 additions and 65 deletions

View File

@ -1,12 +1,28 @@
{ {
"nodes": { "nodes": {
"mozilla-overlay": {
"flake": false,
"locked": {
"lastModified": 1704373101,
"narHash": "sha256-+gi59LRWRQmwROrmE1E2b3mtocwueCQqZ60CwLG+gbg=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "9b11a87c0cc54e308fa83aac5b4ee1816d5418a2",
"type": "github"
},
"original": {
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1731652201, "lastModified": 1727540905,
"narHash": "sha256-XUO0JKP1hlww0d7mm3kpmIr4hhtR4zicg5Wwes9cPMg=", "narHash": "sha256-40J9tW7Y794J7Uw4GwcAKlMxlX2xISBl6IBigo83ih8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c21b77913ea840f8bcf9adf4c41cecc2abffd38d", "rev": "fbca5e745367ae7632731639de5c21f29c8744ed",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -18,29 +34,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "mozilla-overlay": "mozilla-overlay",
"rust-overlay": "rust-overlay" "nixpkgs": "nixpkgs"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1719454714,
"narHash": "sha256-MojqG0lyUINkEk0b3kM2drsU5vyaF8DFZe/FAlZVOGs=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d1c527659cf076ecc4b96a91c702d080b213801e",
"type": "github"
},
"original": {
"owner": "oxalica",
"ref": "snapshot/2024-08-01",
"repo": "rust-overlay",
"type": "github"
} }
} }
}, },

View File

@ -2,28 +2,29 @@
description = "Bare-metal Rust on Zynq-7000"; description = "Bare-metal Rust on Zynq-7000";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-24.05; inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-24.05;
inputs.rust-overlay = { inputs.mozilla-overlay = { url = github:mozilla/nixpkgs-mozilla; flake = false; };
url = "github:oxalica/rust-overlay?ref=snapshot/2024-08-01";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, rust-overlay }: outputs = { self, nixpkgs, mozilla-overlay }:
let let
pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (import rust-overlay) crosspkgs-overlay ]; }; pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ (import mozilla-overlay) crosspkgs-overlay ]; };
rust = pkgs.rust-bin.nightly."2021-01-28".default.override { rustManifest = pkgs.fetchurl {
extensions = [ "rust-src" ]; url = "https://static.rust-lang.org/dist/2021-01-29/channel-rust-nightly.toml";
targets = [ ]; sha256 = "sha256-EZKgw89AH4vxaJpUHmIMzMW/80wAFQlfcxRoBD9nz0c=";
}; };
rustPlatform = pkgs.makeRustPlatform { rustTargets = [];
rustc = rust // { rustChannelOfTargets = _channel: _date: targets:
# https://github.com/oxalica/rust-overlay/commit/c48c2d76b68dd9ede0815fec53479375c61af857 (pkgs.lib.rustLib.fromManifestFile rustManifest {
targetPlatforms = pkgs.lib.platforms.all; inherit (pkgs) stdenv lib fetchurl patchelf;
tier1TargetPlatforms = pkgs.lib.platforms.all; }).rust.override {
badTargetPlatforms = [ ]; inherit targets;
extensions = ["rust-src"];
}; };
rust = rustChannelOfTargets "nightly" null rustTargets;
rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
rustc = rust;
cargo = rust; cargo = rust;
}; });
# https://doc.rust-lang.org/rustc/linker-plugin-lto.html#toolchain-compatibility # https://doc.rust-lang.org/rustc/linker-plugin-lto.html#toolchain-compatibility
llvmPackages_11 = pkgs.recurseIntoAttrs (pkgs.callPackage (import ./llvm/11) ({ llvmPackages_11 = pkgs.recurseIntoAttrs (pkgs.callPackage (import ./llvm/11) ({

View File

@ -55,27 +55,7 @@ impl Status {
pub fn get_link(&self) -> Option<Link> { pub fn get_link(&self) -> Option<Link> {
if ! self.link_status() { if ! self.link_status() {
None None
} else if self.cap_100base_tx_full() { } else if self.cap_10base_t_half() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Full,
})
} else if self.cap_100base_tx_half() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Half,
})
} else if self.cap_100base_t4() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Half,
})
} else if self.cap_10base_t2_full() {
Some(Link {
speed: LinkSpeed::S10,
duplex: LinkDuplex::Full,
})
} else if self.cap_10base_t2_half() {
Some(Link { Some(Link {
speed: LinkSpeed::S10, speed: LinkSpeed::S10,
duplex: LinkDuplex::Half, duplex: LinkDuplex::Half,
@ -85,11 +65,31 @@ impl Status {
speed: LinkSpeed::S10, speed: LinkSpeed::S10,
duplex: LinkDuplex::Full, duplex: LinkDuplex::Full,
}) })
} else if self.cap_10base_t_half() { } else if self.cap_10base_t2_half() {
Some(Link { Some(Link {
speed: LinkSpeed::S10, speed: LinkSpeed::S10,
duplex: LinkDuplex::Half, duplex: LinkDuplex::Half,
}) })
} else if self.cap_10base_t2_full() {
Some(Link {
speed: LinkSpeed::S10,
duplex: LinkDuplex::Full,
})
} else if self.cap_100base_t4() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Half,
})
} else if self.cap_100base_tx_half() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Half,
})
} else if self.cap_100base_tx_full() {
Some(Link {
speed: LinkSpeed::S100,
duplex: LinkDuplex::Full,
})
} else { } else {
None None
} }