惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Enabling SPI on Arch Linux ARM (Raspberry Pi 4, aarch64)
l5y · 2026-06-02 · via DEV Community

l5y

You add dtparam=spi=on to /boot/config.txt, reboot, and... there's no /dev/spidev*. On the AArch64 Arch Linux ARM image this is expected, and the fix isn't more config.txt tweaking. Here's the clean way.

TL;DR

The AArch64 ALARM image boots the mainline kernel via U-Boot, which ignores config.txt. Switch to the Foundation kernel (linux-rpi) and SPI + overlays work natively. One board-specific trap to watch: the shipped cmdline.txt has the wrong root=.

ℹ️ Tested on: Raspberry Pi 4B, Arch Linux ARM aarch64, /boot on a separate FAT partition.

Why dtparam=spi=on does nothing

The GPU firmware reads config.txt and patches its own device tree, but U-Boot then loads a different mainline DTB from /boot/dtbs and boots that, throwing the firmware's edit away. Forcing the firmware DTB doesn't help either: the mainline spidev driver won't bind to its compatible = "spidev" nodes.

The Foundation kernel sidesteps all of it: the firmware boots it directly and applies config.txt + overlays the way every Pi guide assumes.

⚠️ This swaps your kernel and removes U-Boot. Keep a serial/HDMI console or SD-card access handy in case of a bad boot.

0. Prep

# Note your real root partition, you'll need this exact value in step 2.
cat /proc/cmdline                       # grab the root=PARTUUID=... part
lsblk -o NAME,PARTUUID,MOUNTPOINT

# Back up /boot and cache the current packages for rollback.
sudo tar czf /root/boot-backup.tar.gz -C /boot .
sudo pacman -Sw linux-aarch64 uboot-raspberrypi

1. Install the Foundation kernel

sudo pacman -S linux-rpi

It conflicts with uboot-raspberrypi and linux-aarch64 and removes both, that's expected. It drops in the Foundation kernel as /boot/kernel8.img, ~360 overlays, and fresh config.txt / cmdline.txt.

2. Fix cmdline.txt, the one guaranteed gotcha

The shipped /boot/cmdline.txt hardcodes root=/dev/mmcblk0p2. If your card enumerates differently (mine is mmcblk1), that's an instant no-boot. Replace the root= with your value from step 0:

# /boot/cmdline.txt  (single line)
root=PARTUUID=xxxxxxxx-02 rw rootwait fsck.repair=yes console=serial0,115200 console=tty1

Use blkid to determine UUID.

3. Re-enable SPI in config.txt

The new config.txt ships with SPI commented out. Add:

# /boot/config.txt
enable_uart=1
dtparam=spi=on

4. Sanity-check before rebooting

Can't hurt to run mkinitcpio -p linux-rpi again.

ls -l /boot/kernel8.img            # multi-MB = Foundation kernel (U-Boot was ~700 KB)
grep root= /boot/cmdline.txt       # YOUR PARTUUID, not mmcblk0p2
grep -E 'spi|initramfs' /boot/config.txt
ls -l /boot/initramfs-linux.img    # freshly rebuilt
ls /lib/modules/                   # e.g. 6.x-rpi

5. Reboot & verify

sudo reboot
# once it's back:
uname -r                           # ...-rpi
ls -l /dev/spidev*                 # spidev0.0  spidev0.1

6. Optional: use SPI without root

# /etc/udev/rules.d/99-spi.rules
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"

sudo groupadd -f spi && sudo usermod -aG spi "$USER"   # re-login to apply

Quick loopback test: jumper pin 19 ↔ pin 21 (MOSI↔MISO) and run spidev_test, TX should equal RX.

SPI0 pinout (40-pin header)

Signal BCM Pin
MOSI GPIO10 19
MISO GPIO9 21
SCLK GPIO11 23
CE0 GPIO8 24 → spidev0.0
CE1 GPIO7 26 → spidev0.1

Rollback

If it won't boot: pull the SD card, restore /boot from boot-backup.tar.gz, and reinstall linux-aarch64 + uboot-raspberrypi from the pacman cache.

Bonus: now that the firmware honors config.txt, other peripherals are one line away too, dtparam=i2c_arm=on for I2C, or any overlay in /boot/overlays via dtoverlay=.... No device-tree surgery required.