Support for hardware SPI on NEC V25 port#2453
Merged
ghaerr merged 5 commits intoghaerr:masterfrom Nov 13, 2025
Merged
Conversation
added 5 commits
November 12, 2025 10:47
New driver for hardware SPI Mode 3 SD card interface using serial port 0 in synchronous IO mode. Baud rate can be configured in spi-hw-necv25.S default CPU clock/2. which is the fastest clock possible.
Added new option in config.in for CONFIG_HW_SPI if CONFIG_ARCH_NECV25 is selected
and renamed spi-8018x.h to spi.h
Owner
|
Thank you @swausd, fantastic work as always! This is very nice having both software and hardware SPI drivers in ELKS! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ssd-sd block driver now supports hardware SPI on NEC V25 MCU or software SPI (bit-banged) on 8018x and NEC V25. Added new option
Interface SD card with hardware SPIinmake menuconfigifNEC V25system is selected. The bit banged driver should only be used if the serial port 0 is not available.The new hardware driver use SPI Mode 3 (hardware limit of V25) on serial port 0. Despite SD cards usually require SPI mode 0, the hardware driver in mode 3 works with all the different SD cards i have (3 different brands, two noname and sandisk compact extreme).
Clock is configurable by setting prescaler value in the driver code spi-hw-necv25.S. Default CPU
clock / 2which is the max clock usable. For my current system that is 5 MHz. With the bit-banged driver it is about 128KHz.I introduced two new assembler functions for block read/write and changed ssd-sd.c accordingly.
Minix filesystem should be used as this is much faster than FAT16.
For connecting the SD card and port usage see spi-hw-nev25.S and sp-necv25.S.