页次: 1
不好意思,5楼这个回复不是 leds-gpio 驱动配套的应用程序
https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/leds-gpio.txt
参考这个: https://blog.csdn.net/jklinux/article/details/78645106
晕哥,你好:
按照这个方法,没有看到leds目录,会是那里出问题了呢?
楼主,你好:
正好要做leds驱动,请教一个问题,没有看到有leds目录,是少了那个配置文件呢?
板子log:
# ls /sys/bus/platform/devices
10000.sram 1c20ca0.watchdog regulatory.0
1c00000.sram-controller 1c25000.serial serial8250
1c05000.spi 1e60000.display-backend snd-soc-dummy
1c0c000.lcd-controller alarmtimer snd_aloop.0
1c0f000.mmc display-engine soc
1c13000.usb musb-hdrc.1.auto usb_phy_generic.0.auto
1c13400.phy my-leds2 vcc3v3
1c20800.pinctrl panel
1c20c00.timer reg-dummy
# ls /sys/bus/platform/devices/my-leds2
driver_override of_node subsystem
modalias power uevent
#
设备树:
my-leds2 {
compatible = "gpio-leds"; /* 才能被识别为Led */
pinctrl-names = "default";
pinctrl-0 = <&leds_pins>;
blue_led {
label = "licheepi:blue:usr";
gpios = <&pio 4 4 GPIO_ACTIVE_LOW>; /* PE4 */
};
green_led {
label = "licheepi:green:usr";
gpios = <&pio 4 5 GPIO_ACTIVE_LOW>; /* PE5 */
default-state = "on";
};
red_led {
label = "licheepi:red:usr";
gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PE6 */
};
};
pio: pinctrl@1c20800 {
compatible = "allwinner,suniv-pinctrl";
reg = <0x01c20800 0x400>;
interrupts = <38>, <39>, <40>;
clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
clock-names = "apb", "hosc", "losc";
gpio-controller;
interrupt-controller;
#interrupt-cells = <3>;
#gpio-cells = <3>;
leds_pins: leds-pins {
pins = "PE4","PE5","PE6";
function = "gpio_out";
};
};
编译和安装:
yaoming@yaoming-VirtualBox:~$ cd sunxi-tools
yaoming@yaoming-VirtualBox:~/sunxi-tools$ ls
adb-devprobe.sh nand-common.h
autoversion.sh nand-image-builder.c
bin nand-part-a10.h
boot_head.lds nand-part-a20.h
boot_head.S nand-part.c
bootinfo.c nand-part-main.c
common.h phoenix_info.c
fel.c pio.c
fel-gpio progress.c
fel_lib.c progress.h
fel_lib.h README.md
fel-remotefunc-compiler.rb script_bin.c
fel-remotefunc-spi-data-transfer.c script_bin.h
fel-remotefunc-spi-data-transfer.h script.c
fel-sdboot.lds script_extractor.c
fel-sdboot.S script_fex.c
fel-spiflash.c script_fex.h
fel-spiflash.h script.h
fexc.c script_uboot.c
fexc.h script_uboot.h
find-arm-gcc.sh soc_info.c
include soc_info.h
jtag-loop.c tests
jtag-loop.lds thunk.c
jtag-loop.S thunk.h
LICENSE.md thunks
Makefile uart0-helloworld-sdboot.c
meminfo.c uart0-helloworld-sdboot.lds
yaoming@yaoming-VirtualBox:~/sunxi-tools$ make
Setting version information: v1.4.1-104-g11a9d20
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -o sunxi-bootinfo bootinfo.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ `pkg-config --cflags libusb-1.0` `pkg-config --cflags zlib` -o sunxi-fel \
fel.c thunk.c progress.c soc_info.c fel_lib.c fel-spiflash.c `pkg-config --libs libusb-1.0` `pkg-config --libs zlib`
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-main.o nand-part-main.c
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-a10.o nand-part.c -D A10
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -c -o nand-part-a20.o nand-part.c -D A20
cc -o sunxi-nand-part nand-part-main.o nand-part-a10.o nand-part-a20.o
cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -o sunxi-pio pio.c
ln -nsf sunxi-fexc bin2fex
ln -nsf sunxi-fexc fex2bin
yaoming@yaoming-VirtualBox:~/sunxi-tools$ sudo make install
[sudo] password for yaoming:
install -d /usr/local/bin
+ install -m0755 sunxi-fexc /usr/local/bin/sunxi-fexc
+ install -m0755 sunxi-bootinfo /usr/local/bin/sunxi-bootinfo
+ install -m0755 sunxi-fel /usr/local/bin/sunxi-fel
+ install -m0755 sunxi-nand-part /usr/local/bin/sunxi-nand-part
+ install -m0755 sunxi-pio /usr/local/bin/sunxi-pio
+ ln -nfs sunxi-fexc /usr/local/bin/bin2fex
+ ln -nfs sunxi-fexc /usr/local/bin/fex2bin
git clone https://github.com/Icenowy/sunxi-tools.git -b f1c100s-spiflash
用的这个分支啊,没错的
能看到USB设备
yaoming@yaoming-VirtualBox:~$ lsusb
Bus 001 Device 003: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode
Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
但是提示烧录timed out
yaoming@yaoming-VirtualBox:~/f1c100s$ sudo sunxi-fel spiflash-write 0 f1c100s_spiflash_16M.bin
usb_bulk_send() ERROR -7: Operation timed out
重做了根文件系统,可以跑起来啦!但是在电脑上只见到USB串行设备(COM3),看不到ADB设备?是内核选择不对?
# ls
bin lib32 opt run_adbd1.sh usr
dev linuxrc proc sbin var
etc media root sys
lib mnt run tmp
# ./run_adbd1.sh
[ 33.480045] file system registered
# install_listener('tcp:5037','*smartsocket*')
[ 36.030694] read descriptors
[ 36.033918] read strings
[ 36.133406] using random self ethernet address
[ 36.138008] using random host ethernet address
[ 36.142522] using random self ethernet address
[ 36.147061] using random host ethernet address
[ 36.152770] usb0: HOST MAC fa:7a:56:21:29:54
[ 36.157286] usb0: MAC 5a:cb:da:ba:81:fb
[ 36.162531] g_ffs gadget: g_ffs ready
[ 36.832124] g_ffs gadget: high-speed config #1: FunctionFS + RNDIS
g_ffs.ko编译出来了
可以加载g_ffs驱动了,但是提示line 5: adbd: not found,这个是什么意思呢?
# ls
bin lib32 opt run_adbd1.sh usr
dev linuxrc proc sbin var
etc media root sys
lib mnt run tmp
# ./run_adbd1.sh
[ 29.951996] file system registered
# ./run_adbd1.sh: line 5: adbd: not found
lsmod
Module Size Used by Not tainted
g_ffs 16384 1
usb_f_fs 40960 3 g_ffs
usb_f_rndis 24576 1 g_ffs
u_ether 20480 2 g_ffs,usb_f_rndis
libcomposite 40960 3 g_ffs,usb_f_fs,usb_f_rndis
#
usb gadget相关模块已经打开了
但是启动是提示这样,没有找到模块
# ls
bin lib32 opt run_adbd1.sh usr
dev linuxrc proc sbin var
etc media root sys
lib mnt run tmp
# ./run_adbd1.sh
modprobe: module g_ffs not found in modules.dep
[ 41.655771] ------------[ cut here ]------------
[ 41.660473] WARNING: CPU: 0 PID: 98 at fs/filesystems.c:282 get_fs_type+0xf8/0x110
[ 41.668171] request_module fs-functionfs succeeded, but still no fs?
[ 41.674514] Modules linked in: usb_f_fs libcomposite
[ 41.679565] CPU: 0 PID: 98 Comm: mount Not tainted 4.15.0-rc8-licheepi-nano #8
[ 41.686809] Hardware name: Allwinner suniv Family
[ 41.691591] [<c010e604>] (unwind_backtrace) from [<c010b74c>] (show_stack+0x10/0x14)
[ 41.699411] [<c010b74c>] (show_stack) from [<c01166c8>] (__warn+0xcc/0xf4)
[ 41.706344] [<c01166c8>] (__warn) from [<c0116728>] (warn_slowpath_fmt+0x38/0x48)
[ 41.713842] [<c0116728>] (warn_slowpath_fmt) from [<c01e7878>] (get_fs_type+0xf8/0x110)
[ 41.721905] [<c01e7878>] (get_fs_type) from [<c01eab80>] (do_mount+0x1c0/0xb58)
[ 41.729264] [<c01eab80>] (do_mount) from [<c01eb850>] (SyS_mount+0x54/0xc0)
[ 41.736281] [<c01eb850>] (SyS_mount) from [<c0107d80>] (ret_fast_syscall+0x0/0x50)
[ 41.743837] ---[ end trace 7631d98e80bc747e ]---
mount: mounting adb on /dev/usb-ffs/adb failed: No such device
# ./run_adbd1.sh: line 5: adbd: not found
内核usb gadget模块应该是有编译出来了:
buildroot里面这个fastboot需要打开吗?
晕哥,你好:
以下这样操作之后,再打包zImage就行了吗?这个ADB的modules好像没有看到?
ubuntu@VM-0-16-ubuntu:~/f1c100s/linux-f1c100s-480272lcd-test$ make ARCH=arm CROS S_COMPILE=arm-linux-gnueabi- -j4 modules
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK scripts/mod/devicetable-offsets.h
CHK include/generated/utsrelease.h
CHK include/generated/timeconst.h
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
Building modules, stage 2.
MODPOST 16 modules
ubuntu@VM-0-16-ubuntu:~/f1c100s/linux-f1c100s-480272lcd-test$ make ARCH=arm CROS S_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH="./out"
INSTALL crypto/echainiv.ko
INSTALL drivers/input/touchscreen/goodix.ko
INSTALL drivers/mtd/tests/mtd_nandbiterrs.ko
INSTALL drivers/mtd/tests/mtd_nandecctest.ko
INSTALL drivers/mtd/tests/mtd_oobtest.ko
INSTALL drivers/mtd/tests/mtd_pagetest.ko
INSTALL drivers/mtd/tests/mtd_readtest.ko
INSTALL drivers/mtd/tests/mtd_speedtest.ko
INSTALL drivers/mtd/tests/mtd_stresstest.ko
INSTALL drivers/mtd/tests/mtd_subpagetest.ko
INSTALL drivers/mtd/tests/mtd_torturetest.ko
INSTALL drivers/net/mii.ko
INSTALL drivers/net/usb/rtl8150.ko
INSTALL drivers/staging/rtl8723bs/r8723bs.ko
INSTALL drivers/usb/mon/usbmon.ko
INSTALL drivers/video/backlight/lcd.ko
DEPMOD 4.15.0-rc8-licheepi-nano
ubuntu@VM-0-16-ubuntu:~/f1c100s/linux-f1c100s-480272lcd-test$
漏了,脚本如下:
#! /bin/sh modprobe g_ffs idVendor=0x18d1 idProduct=0x4e42 iSerialNumber="buildroot" mkdir -p /dev/usb-ffs/adb mount -t functionfs adb /dev/usb-ffs/adb -o uid=2000,gid=2000 adbd &
楼主,你好:
使用了这个脚本,但是提示失败了,内核和buildroot都打开了相关配置的,这个会是什么原因呢?
# ls
bin lib32 opt run_adbd1.sh usr
dev linuxrc proc sbin var
etc media root sys
lib mnt run tmp
# ./run_adbd1.sh
modprobe: can't change directory to '/lib/modules': No such file or directory
mount: mounting adb on /dev/usb-ffs/adb failed: No such device
# ./run_adbd1.sh: line 5: adbd: not found
晕哥,你好:
使用arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2这个工具编译程序,还是运行不了?是那里有问题呢?uboot和内核不是用这个工具编译的。
主机log:
ubuntu@VM-0-16-ubuntu:~$ vi hello.c
ubuntu@VM-0-16-ubuntu:~$ arm-none-linux-gnueabi-gcc -o hello hello.c
ubuntu@VM-0-16-ubuntu:~$ ls
f1c100s hello hello.c
ubuntu@VM-0-16-ubuntu:~$
以下是板子lgo:
# ./hello
-sh: ./hello: not found
# ./hello
-sh: ./hello: not found
# ./hello
-sh: ./hello: not found
#
用了 gcc 7.x 还是不行啊,这U-BOOT编译看来只能用gcc-linaro-7.2.1
ubuntu@VM-0-16-ubuntu:~/f1c100s/u-boot$ arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/opt/arm-2014.05/bin/../libexec/gcc/arm-none-linux-gnueabi/4.8.3/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2014 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=29' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2014.05-29' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-isl=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-cloog=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-libatomic --disable-libssp --enable-poison-system-directories --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin SED=sed
Thread model: posix
gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)
ubuntu@VM-0-16-ubuntu:~/f1c100s/u-boot$ gcc --version
gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ubuntu@VM-0-16-ubuntu:~/f1c100s/u-boot$ make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j4
*** Your GCC is older than 6.0 and is not supported
arch/arm/config.mk:69: recipe for target 'checkgcc6' failed
make: *** [checkgcc6] Error 1
ubuntu@VM-0-16-ubuntu:~/f1c100s/u-boot$
工具琏显示是这样的
ubuntu@VM-0-16-ubuntu:~/f1c100s$ arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/opt/arm-2014.05/bin/../libexec/gcc/arm-none-linux-gnueabi/4 .8.3/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/confi gure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux- gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdc xx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --wit h-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind- tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__ =2014 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=29' --enable-languages =c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit - -with-pkgversion='Sourcery CodeBench Lite 2014.05-29' --with-bugurl=https://sour cery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sy sroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratc h/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/l ibc --with-gmp=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none -linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-li nux-gnu/usr --with-mpfr=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29 -arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i 686-pc-linux-gnu/usr --with-mpc=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-20 14.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/hos t-libs-i686-pc-linux-gnu/usr --with-isl=/scratch/maciej/arm-linux-2014.05-rel/ob j/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.ex tras/host-libs-i686-pc-linux-gnu/usr --with-cloog=/scratch/maciej/arm-linux-2014 .05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux- gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libit m --enable-libatomic --disable-libssp --enable-poison-system-directories --with- build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/ arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maciej/arm-linux-201 4.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin SED=sed
Thread model: posix
gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)
ubuntu@VM-0-16-ubuntu:~/f1c100s$
建议用: arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
这个绝对可以的, 经过实战检验的:
whycan@ubuntu:/opt/arm-2014.05/bin$ ./arm-none-linux-gnueabi-gcc -v Using built-in specs. COLLECT_GCC=./arm-none-linux-gnueabi-gcc COLLECT_LTO_WRAPPER=/opt/arm-2014.05/bin/../libexec/gcc/arm-none-linux-gnueabi/4.8.3/lto-wrapper Target: arm-none-linux-gnueabi Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2014 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=29' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2014.05-29' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-isl=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-cloog=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-libatomic --disable-libssp --enable-poison-system-directories --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin SED=sed Thread model: posix gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) whycan@ubuntu:/opt/arm-2014.05/bin$
晕哥,你好:
用了这个工具琏,编译完内核启动不了啊,原来gcc-linaro-7.2.1这个编译是能正常启动的,这个是什么原因呢?
uboot启动时,输入print命令查看打印:
Hit any key to stop autoboot: 0
=>
=>
=>
=>
=> printf
Unknown command 'printf' - try 'help'
=> print
arch=arm
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=fel mmc0 usb0 pxe dhcp
bootcmd=sf probe 0 50000000; sf read 0x80C00000 0x100000 0x4000; sf read 0x80008000 0x110000 0x400000; bootz 0x80008000 - 0x80C00000
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootm_size=0x1700000
console=ttyS0,115200
cpu=arm926ejs
dfu_alt_info_ram=kernel ram 0x80500000 0x1000000;fdt ram 0x80C00000 0x100000;ramdisk ram 0x80D50000 0x4000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdt_addr_r=0x80C00000
fdtcontroladdr=83e6ada8
fdtfile=suniv-f1c100s-licheepi-nano.dtb
fel_booted=1
kernel_addr_r=0x80500000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system};
preboot=usb start
pxefile_addr_r=0x80D00000
ramdisk_addr_r=0x80D50000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x80C50000
soc=sunxi
stderr=serial@1c25000
stdin=serial@1c25000
stdout=serial@1c25000
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
uuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3
Environment size: 4560/32764 bytes
=>
你的 bootargs 是什么? root=???
按照楼主这个来的:
(2)更改配置
回到 uboot 源码一级目录, 进入TUI配置
make ARCH=arm menuconfig
取消勾选 [] Enable a default value for bootcmd
勾选 [v] Enable boot arguments;
在下方一项中填入 bootargs 参数:
console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
这个是要和buildroot的那个参数要对应呢?
新鲜出炉 windows 版本 32M spi nor flash 版本烧录软件: sunxi-tools-win32-support_f1c100s_32M.7z
测试OK!
这个程序能烧32M的,那也可以烧16M的吗?
我试了烧W25Q128,烧进去正常,但是读出来全部为0。
@aaayao https://whycan.cn/t_444.html 下载1楼最底下那个
----------------------------------------------------------------------
以下是 2018-12-19 更新 (16楼):为了不再给大家造成困扰,我把文件重新整理了 V3s 和 F1C100s 两个文件夹,
这个接USB HUB之后可以读写了,但是写入之后读出来,还是全0? 难道要换个W25Q256吗?
检查 "suniv-f1c100s.dtsi" 等包含文件里面有没有关于 spi0 的定义.
谢谢晕哥提醒,原来的这个内核在suniv-f1c100s.dtsi里没有发现SPI0的定义,增加定义后代码如下:
// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
* Copyright 2018 Icenowy Zheng <icenowy@aosc.io>
* Copyright 2018 Mesih Kilinc <mesihkilinc@gmail.com>
*/
#include <dt-bindings/clock/suniv-ccu-f1c100s.h>
#include <dt-bindings/reset/suniv-ccu-f1c100s.h>
/ {
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;
clocks {
osc24M: clk-24M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
clock-output-names = "osc24M";
};
osc32k: clk-32k {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <32768>;
clock-output-names = "osc32k";
};
};
cpus {
cpu {
compatible = "arm,arm926ej-s";
device_type = "cpu";
};
};
de: display-engine {
compatible = "allwinner,suniv-f1c100s-display-engine";
allwinner,pipelines = <&fe0>;
status = "disabled";
};
soc {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
sram-controller@1c00000 {
compatible = "allwinner,suniv-f1c100s-system-control",
"allwinner,sun4i-a10-system-control";
reg = <0x01c00000 0x30>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
sram_d: sram@10000 {
compatible = "mmio-sram";
reg = <0x00010000 0x1000>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x00010000 0x1000>;
otg_sram: sram-section@0 {
compatible = "allwinner,suniv-f1c100s-sram-d",
"allwinner,sun4i-a10-sram-d";
reg = <0x0000 0x1000>;
status = "disabled";
};
};
};
spi0: spi@1c05000 {
compatible = "allwinner,suniv-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c05000 0x1000>;
interrupts = <10>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_BUS_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@1c06000 {
compatible = "allwinner,suniv-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c06000 0x1000>;
interrupts = <11>;
clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_BUS_SPI1>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI1>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
tcon0: lcd-controller@1c0c000 {
compatible = "allwinner,suniv-f1c100s-tcon";
reg = <0x01c0c000 0x1000>;
interrupts = <29>;
clocks = <&ccu CLK_BUS_LCD>,
<&ccu CLK_TCON>;
clock-names = "ahb",
"tcon-ch0";
clock-output-names = "tcon-pixel-clock";
resets = <&ccu RST_BUS_LCD>;
reset-names = "lcd";
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
tcon0_in: port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
tcon0_in_be0: endpoint@0 {
reg = <0>;
remote-endpoint = <&be0_out_tcon0>;
};
};
tcon0_out: port@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
};
};
};
ccu: clock@1c20000 {
compatible = "allwinner,suniv-f1c100s-ccu";
reg = <0x01c20000 0x400>;
clocks = <&osc24M>, <&osc32k>;
clock-names = "hosc", "losc";
#clock-cells = <1>;
#reset-cells = <1>;
};
intc: interrupt-controller@1c20400 {
compatible = "allwinner,suniv-f1c100s-ic";
reg = <0x01c20400 0x400>;
interrupt-controller;
#interrupt-cells = <1>;
};
pio: pinctrl@1c20800 {
compatible = "allwinner,suniv-f1c100s-pinctrl";
reg = <0x01c20800 0x400>;
interrupts = <38>, <39>, <40>;
clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
clock-names = "apb", "hosc", "losc";
gpio-controller;
interrupt-controller;
#interrupt-cells = <3>;
#gpio-cells = <3>;
uart0_pe_pins: uart0-pe-pins {
pins = "PE0", "PE1";
function = "uart0";
};
lcd_rgb666_pins: lcd-rgb666-pins {
pins = "PD0", "PD1", "PD2", "PD3", "PD4",
"PD5", "PD6", "PD7", "PD8", "PD9",
"PD10", "PD11", "PD12", "PD13", "PD14",
"PD15", "PD16", "PD17", "PD18", "PD19",
"PD20", "PD21";
function = "lcd";
};
mmc0_pins: mmc0-pins {
pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5";
function = "mmc0";
};
};
timer@1c20c00 {
compatible = "allwinner,suniv-f1c100s-timer";
reg = <0x01c20c00 0x90>;
interrupts = <13>;
clocks = <&osc24M>;
};
mmc0: mmc@1c0f000 {
compatible = "allwinner,suniv-f1c100s-mmc",
"allwinner,sun7i-a20-mmc";
reg = <0x01c0f000 0x1000>;
clocks = <&ccu CLK_BUS_MMC0>,
<&ccu CLK_MMC0>,
<&ccu CLK_MMC0_OUTPUT>,
<&ccu CLK_MMC0_SAMPLE>;
clock-names = "ahb",
"mmc",
"output",
"sample";
resets = <&ccu RST_BUS_MMC0>;
reset-names = "ahb";
interrupts = <23>;
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
wdt: watchdog@1c20ca0 {
compatible = "allwinner,suniv-f1c100s-wdt",
"allwinner,sun4i-a10-wdt";
reg = <0x01c20ca0 0x20>;
};
uart0: serial@1c25000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c25000 0x400>;
interrupts = <1>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART0>;
resets = <&ccu RST_BUS_UART0>;
status = "disabled";
};
uart1: serial@1c25400 {
compatible = "snps,dw-apb-uart";
reg = <0x01c25400 0x400>;
interrupts = <2>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART1>;
resets = <&ccu RST_BUS_UART1>;
status = "disabled";
};
uart2: serial@1c25800 {
compatible = "snps,dw-apb-uart";
reg = <0x01c25800 0x400>;
interrupts = <3>;
reg-shift = <2>;
reg-io-width = <4>;
clocks = <&ccu CLK_BUS_UART2>;
resets = <&ccu RST_BUS_UART2>;
status = "disabled";
};
usb_otg: usb@1c13000 {
compatible = "allwinner,suniv-musb";
reg = <0x01c13000 0x0400>;
clocks = <&ccu CLK_BUS_OTG>;
resets = <&ccu RST_BUS_OTG>;
interrupts = <26>;
interrupt-names = "mc";
phys = <&usbphy 0>;
phy-names = "usb";
extcon = <&usbphy 0>;
allwinner,sram = <&otg_sram 1>;
status = "disabled";
};
usbphy: phy@1c13400 {
compatible = "allwinner,suniv-usb-phy";
reg = <0x01c13400 0x10>;
reg-names = "phy_ctrl";
clocks = <&ccu CLK_USB_PHY0>;
clock-names = "usb0_phy";
resets = <&ccu RST_USB_PHY0>;
reset-names = "usb0_reset";
#phy-cells = <1>;
status = "disabled";
};
fe0: display-frontend@1e00000 {
compatible = "allwinner,suniv-f1c100s-display-frontend";
reg = <0x01e00000 0x20000>;
interrupts = <30>;
clocks = <&ccu CLK_BUS_DE_FE>, <&ccu CLK_DE_FE>,
<&ccu CLK_DRAM_DE_FE>;
clock-names = "ahb", "mod",
"ram";
resets = <&ccu RST_BUS_DE_FE>;
status = "disabled";
ports {
#address-cells = <1>;
#size-cells = <0>;
fe0_out: port@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
fe0_out_be0: endpoint@0 {
reg = <0>;
remote-endpoint = <&be0_in_fe0>;
};
};
};
};
be0: display-backend@1e60000 {
compatible = "allwinner,suniv-f1c100s-display-backend";
reg = <0x01e60000 0x10000>;
reg-names = "be";
interrupts = <31>;
clocks = <&ccu CLK_BUS_DE_BE>, <&ccu CLK_DE_BE>,
<&ccu CLK_DRAM_DE_BE>;
clock-names = "ahb", "mod",
"ram";
resets = <&ccu RST_BUS_DE_BE>;
reset-names = "be";
assigned-clocks = <&ccu CLK_DE_BE>;
assigned-clock-rates = <300000000>;
ports {
#address-cells = <1>;
#size-cells = <0>;
be0_in: port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
be0_in_fe0: endpoint@0 {
reg = <0>;
remote-endpoint = <&fe0_out_be0>;
};
};
be0_out: port@1 {
#address-cells = <1>;
#size-cells = <0>;
reg = <1>;
be0_out_tcon0: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_in_be0>;
};
};
};
};
};
};
但是编译还是出错:
yaoming@yaoming-VirtualBox:~/f1c100s/linux$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs -j4
DTC arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb
arch/arm/boot/dts/suniv-f1c100s.dtsi:74.21-85.5: ERROR (phandle_references): /soc/spi@1c05000: Reference to non-existent node or label "spi0_pins_a"
also defined at arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dts:92.7-132.3
ERROR: Input tree has errors, aborting (use -f to force output)
make[2]: *** [arch/arm/boot/dts/suniv-f1c100s-licheepi-nano.dtb] 错误 2
make[1]: *** [dtbs] 错误 2
make: *** [sub-make] 错误 2
aaayao 说:加在下面这个位置,但是编译出错了。
https://whycan.cn/files/members/2261/QQ图片20191107223200.png
// SPDX-License-Identifier: (GPL-2.0+ OR X11) /* * Copyright 2018 Icenowy Zheng <icenowy@aosc.io> */ /dts-v1/; #include "suniv-f1c100s.dtsi" #include <dt-bindings/gpio/gpio.h> / { model = "Lichee Pi Nano"; compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s"; aliases { serial0 = &uart0; }; chosen { stdout-path = "serial0:115200n8"; }; panel: panel { compatible = "qiaodian,qd43003c0-40", "simple-panel"; #address-cells = <1>; #size-cells = <0>; enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>; power-supply = <®_vcc3v3>; port@0 { reg = <0>; #address-cells = <1>; #size-cells = <0>; panel_input: endpoint@0 { reg = <0>; remote-endpoint = <&tcon0_out_lcd>; }; }; }; reg_vcc3v3: vcc3v3 { compatible = "regulator-fixed"; regulator-name = "vcc3v3"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; }; }; &be0 { status = "okay"; }; &de { status = "okay"; }; &tcon0 { pinctrl-names = "default"; pinctrl-0 = <&lcd_rgb666_pins>; status = "okay"; }; &tcon0_out { tcon0_out_lcd: endpoint@0 { reg = <0>; remote-endpoint = <&panel_input>; }; }; &mmc0 { vmmc-supply = <®_vcc3v3>; bus-width = <4>; broken-cd; status = "okay"; }; &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pe_pins>; status = "okay"; }; &otg_sram { status = "okay"; }; &usb_otg { dr_mode = "otg"; status = "okay"; }; &spi0 { pinctrl-names = "default"; pinctrl-0 = <&spi0_pins_a>; status = "okay"; spi-max-frequency = <50000000>; flash: w25q128@0 { #address-cells = <1>; #size-cells = <1>; compatible = "winbond,w25q128", "jedec,spi-nor"; reg = <0>; spi-max-frequency = <50000000>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "u-boot"; reg = <0x000000 0x100000>; read-only; }; partition@100000 { label = "dtb"; reg = <0x100000 0x10000>; read-only; }; partition@110000 { label = "kernel"; reg = <0x110000 0x400000>; read-only; }; partition@510000 { label = "rootfs"; reg = <0x510000 0xAF0000>; }; }; }; }; &usbphy { usb0_id_det-gpio = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */ status = "okay"; };
代码比较工具对比了一下,一模一样,我上我这边的源码给你看看把。能力有限,你多折腾几遍,/笑/哈
linux内核源码链接: https://pan.baidu.com/s/1YpbDNFXn_2QdTh8YIcF_jg 提取码:bc35
感谢楼主提供的内核,编译通过了
代码不同的地方是在suniv.dtsi里还有相关的SPI配置代码:
spi0: spi@1c05000 {
compatible = "allwinner,suniv-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c05000 0x1000>;
interrupts = <10>;
clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_BUS_SPI0>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI0>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
spi1: spi@1c06000 {
compatible = "allwinner,suniv-spi",
"allwinner,sun8i-h3-spi";
reg = <0x01c06000 0x1000>;
interrupts = <11>;
clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_BUS_SPI1>;
clock-names = "ahb", "mod";
resets = <&ccu RST_BUS_SPI1>;
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};
加在下面这个位置,但是编译出错了。
// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
* Copyright 2018 Icenowy Zheng <icenowy@aosc.io>
*/
/dts-v1/;
#include "suniv-f1c100s.dtsi"
#include <dt-bindings/gpio/gpio.h>
/ {
model = "Lichee Pi Nano";
compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s";
aliases {
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
panel: panel {
compatible = "qiaodian,qd43003c0-40", "simple-panel";
#address-cells = <1>;
#size-cells = <0>;
enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;
power-supply = <®_vcc3v3>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};
reg_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
};
&be0 {
status = "okay";
};
&de {
status = "okay";
};
&tcon0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins>;
status = "okay";
};
&tcon0_out {
tcon0_out_lcd: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_input>;
};
};
&mmc0 {
vmmc-supply = <®_vcc3v3>;
bus-width = <4>;
broken-cd;
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pe_pins>;
status = "okay";
};
&otg_sram {
status = "okay";
};
&usb_otg {
dr_mode = "otg";
status = "okay";
};
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
status = "okay";
spi-max-frequency = <50000000>;
flash: w25q128@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "winbond,w25q128", "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x100000>;
read-only;
};
partition@100000 {
label = "dtb";
reg = <0x100000 0x10000>;
read-only;
};
partition@110000 {
label = "kernel";
reg = <0x110000 0x400000>;
read-only;
};
partition@510000 {
label = "rootfs";
reg = <0x510000 0xAF0000>;
};
};
};
};
&usbphy {
usb0_id_det-gpio = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */
status = "okay";
};
我这个suniv-f1c100s-licheepi-nano.dts没有找到&spi0{...}段落,应该在那个位置加上去呢?
// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
* Copyright 2018 Icenowy Zheng <icenowy@aosc.io>
*/
/dts-v1/;
#include "suniv-f1c100s.dtsi"
#include <dt-bindings/gpio/gpio.h>
/ {
model = "Lichee Pi Nano";
compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s";
aliases {
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
panel: panel {
compatible = "qiaodian,qd43003c0-40", "simple-panel";
#address-cells = <1>;
#size-cells = <0>;
enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;
power-supply = <®_vcc3v3>;
port@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
panel_input: endpoint@0 {
reg = <0>;
remote-endpoint = <&tcon0_out_lcd>;
};
};
};
reg_vcc3v3: vcc3v3 {
compatible = "regulator-fixed";
regulator-name = "vcc3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
};
&be0 {
status = "okay";
};
&de {
status = "okay";
};
&tcon0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins>;
status = "okay";
};
&tcon0_out {
tcon0_out_lcd: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_input>;
};
};
&mmc0 {
vmmc-supply = <®_vcc3v3>;
bus-width = <4>;
broken-cd;
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pe_pins>;
status = "okay";
};
&otg_sram {
status = "okay";
};
&usb_otg {
dr_mode = "otg";
status = "okay";
};
&usbphy {
usb0_id_det-gpio = <&pio 4 2 GPIO_ACTIVE_HIGH>; /* PE2 */
status = "okay";
};
@aaayao 这个文件下载失败: https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.12.10.tar.xz
你可以手动下载拷贝到 dl/ 目录。
下载了linux-4.12.10.tar.xz,放到dl目录里,现在还一直在编译,不知道还要编译多久?
页次: 1