1:W25Q128FVSG驱动移植到orange pi上
&spi0 {
status = "okay";
nor_flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q128", "jedec,spi-nor";
spi-max-frequency = <50000000>;
reg = <0>; /* Chip select 0 */
};
};
修改sun8i-orangepu-pc-plus.dts,驱动实在4.14上验证的,不是5.1,主要是文件系统的有些问题,待后续处理
2:修改defconfig配置SPI NOR和mtd
OrangePi_H3_next_defconfig增加
CONFIG_MTD_DATAFLASH=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
3:查看启动log和验证功能
root@OrangePi:/# find ./ -name "*spi*"
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-ssm2602-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-cs4271-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-pcm179x-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-es8328-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-pcm512x-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-adau1761-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-wm8804-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-tlv320aic23-spi.ko
./lib/modules/4.14.67/kernel/sound/soc/codecs/snd-soc-pcm3168a-spi.ko
./lib/modules/4.14.67/kernel/drivers/net/can/spi
./lib/modules/4.14.67/kernel/drivers/net/dsa/b53/b53_spi.ko
./lib/modules/4.14.67/kernel/drivers/spi
./lib/modules/4.14.67/kernel/drivers/spi/spidev.ko
./lib/modules/4.14.67/kernel/drivers/mmc/host/of_mmc_spi.ko
./lib/modules/4.14.67/kernel/drivers/mmc/host/mmc_spi.ko
./lib/modules/4.14.67/kernel/drivers/iio/pressure/bmp280-spi.ko
./lib/modules/4.14.67/kernel/drivers/hwspinlock
./lib/modules/4.14.67/kernel/drivers/hwspinlock/hwspinlock_core.ko
./lib/modules/4.14.67/kernel/drivers/input/touchscreen/ad7879-spi.ko
./sys/kernel/debug/clk/bus-spi0
./sys/kernel/debug/clk/bus-spi1
./sys/kernel/debug/clk/bus-spinlock
./sys/kernel/debug/clk/spi0
./sys/kernel/debug/clk/spi1
./sys/kernel/debug/tracing/events/spi
./sys/kernel/debug/tracing/events/spi/spi_controller_idle
./sys/kernel/debug/tracing/events/spi/spi_controller_busy
./sys/kernel/debug/tracing/events/spi/spi_message_submit
./sys/kernel/debug/tracing/events/spi/spi_message_start
./sys/kernel/debug/tracing/events/spi/spi_message_done
./sys/kernel/debug/tracing/events/spi/spi_transfer_start
./sys/kernel/debug/tracing/events/spi/spi_transfer_stop
./sys/devices/platform/soc/1c68000.spi
./sys/devices/platform/soc/1c68000.spi/spi_master
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.0
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.0/statistics/spi_sync
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.0/statistics/spi_async
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.0/statistics/spi_sync_immediate
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/statistics/spi_sync
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/statistics/spi_async
./sys/devices/platform/soc/1c68000.spi/spi_master/spi0/statistics/spi_sync_immediate
./sys/class/spi_master
./sys/class/spi_master/spi0
./sys/class/spi_slave
./sys/firmware/devicetree/base/__symbols__/spi0
./sys/firmware/devicetree/base/__symbols__/spi1_pins
./sys/firmware/devicetree/base/__symbols__/spi0_pins
./sys/firmware/devicetree/base/__symbols__/spi1
./sys/firmware/devicetree/base/soc/pinctrl@01c20800/spi0
./sys/firmware/devicetree/base/soc/pinctrl@01c20800/spi1
./sys/firmware/devicetree/base/soc/spi@01c69000
./sys/firmware/devicetree/base/soc/spi@01c68000
./sys/firmware/devicetree/base/soc/spi@01c68000/nor_flash@0/spi-max-frequency
./sys/bus/platform/devices/1c68000.spi
./sys/bus/platform/drivers/sun6i-spi
./sys/bus/platform/drivers/sun6i-spi/1c68000.spi
./sys/bus/platform/drivers/sun4i-spi
./sys/bus/spi
./sys/bus/spi/devices/spi0.0
./sys/bus/spi/drivers/m25p80/spi0.0
./bin/lesspipe
./proc/irq/41/sun6i-spi
./etc/at-spi2
./etc/xdg/autostart/at-spi-dbus-bus.desktop
./usr/lib/at-spi2-core
./usr/lib/at-spi2-core/at-spi2-registryd
./usr/lib/at-spi2-core/at-spi-bus-launcher
./usr/lib/arm-linux-gnueabihf/libatspi.so.0
./usr/lib/arm-linux-gnueabihf/libatspi.so.0.0.1
./usr/bin/lesspipe
./usr/include/linux/spi
./usr/include/linux/spi/spidev.h
./usr/include/arm-linux-gnueabihf/bits/initspin.h
./usr/share/dbus-1/accessibility-services/org.a11y.atspi.Registry.service
./usr/share/icons/Humanity/animations/32/gnome-spinner.png
./usr/share/icons/Humanity/animations/32/gnome-spinner-rest.svg
./usr/share/icons/Humanity/animations/22/gnome-spinner.png
./usr/share/icons/Humanity/animations/22/gnome-spinner-rest.svg
./usr/share/icons/Humanity/animations/24/gnome-spinner.png
./usr/share/icons/Humanity/animations/24/gnome-spinner-rest.svg
./usr/share/icons/Humanity/animations/16/gnome-spinner.png
./usr/share/icons/Humanity/animations/16/gnome-spinner-rest.svg
./usr/share/upstart/sessions/at-spi2-registryd.conf
./usr/share/upstart/xdg/autostart/at-spi-dbus-bus.desktop
./usr/share/doc/at-spi2-core
./usr/share/doc/libatspi2.0-0
./usr/share/vim/vim74/ftplugin/slpspi.vim
./usr/share/vim/vim74/syntax/spice.vim
./usr/share/vim/vim74/syntax/slpspi.vim
./usr/share/man/man1/lesspipe.1.gz
./usr/share/terminfo/s/spinwriter
./var/lib/dpkg/info/at-spi2-core.conffiles
./var/lib/dpkg/info/at-spi2-core.md5sums
./var/lib/dpkg/info/libatspi2.0-0:armhf.triggers
./var/lib/dpkg/info/at-spi2-core.list
./var/lib/dpkg/info/libatspi2.0-0:armhf.list
./var/lib/dpkg/info/libatspi2.0-0:armhf.shlibs
./var/lib/dpkg/info/libatspi2.0-0:armhf.md5sums
mkfs.vfat /dev/mtdblock0
mount -t vfat /dev/mtdblock0 /mnt/
验证可以参考以下链接
1:http://linux-sunxi.org/Bootable_SPI_flash
2:https://blog.csdn.net/xiaopanpanpanpan/article/details/79869753
3:https://blog.csdn.net/zhuyong006/article/details/89245991