From cf432910a46f0a31f56235758c16aa1d1d2bbf5b Mon Sep 17 00:00:00 2001 From: Daniel Fullmer Date: Tue, 24 Nov 2020 15:33:56 -0800 Subject: [PATCH] Enable SPI-NOR module in Linux --- README.md | 5 ++++- configuration.nix | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index be1a097..56b5fc3 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,12 @@ $ cat /sys/class/gpio/gpio199/value ``` ## SPI NOR -In Linux, dmesg error: `spi-nor spi0.0: unrecognized JEDEC id bytes: 0b 40 18 0b 40 18` The published schematic says it's a `GD5F4GQ4UCYIG`, however the label on the pinecube I have is for an `XT25F128B`. And this matches the JEDEC bytes reported in Linux. +```shell +$ sudo modprobe spi-nor +``` +The device is accessible at `/dev/mtd0`. ### SPI Boot Run `nix-build -A firmware-installer`. Then, diff --git a/configuration.nix b/configuration.nix index 10a4bca..6487ddb 100644 --- a/configuration.nix +++ b/configuration.nix @@ -47,6 +47,7 @@ in } ]; + boot.kernelModules = [ "spi-nor" ]; # Not sure why this doesn't autoload. Provides SPI NOR at /dev/mtd0 boot.extraModulePackages = [ config.boot.kernelPackages.rtl8189es ]; zramSwap.enable = true; # 128MB is not much to work with