背景:
更新代码到最新。
移植st7735后,发现开机时lcd会亮,但是一旦执行到
[ 3.718097] sh (119): drop_caches: 3
之后就会屏幕黑掉,后续log是usb加载。
不清楚是不是usb加载后拉掉了spi的电。
spi配置
&spi2 {
status = "okay";
/delete-node/ spidev@0;
st7789v: st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <48000000>;
spi-cpol;
spi-cpha;
rotate = <90>;
fps = <30>;
rgb;
buswidth = <8>;
//dc-gpios = <&port 21 GPIO_ACTIVE_HIGH>; //DC
dc-gpios = <&porta 23 GPIO_ACTIVE_HIGH>; //DC
reset-gpios = <&porta 24 GPIO_ACTIVE_HIGH>; //RES
led-gpios = <&porta 14 GPIO_ACTIVE_HIGH>; //BL
debug = <0x0>;
};
};
log如下:
[ 0.000000] Linux version 5.10.4-tag- (youkai@ubuntu) (riscv64-unknown-linux-musl-gcc (Xuantie-900 linux-5.10.4 musl gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 PREEMPT Mon Nov 6 22:54:56 +08 2023
[ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[ 0.000000] printk: bootconsole [sbi0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Ion: Ion memory setup at 0x0000000082473000 size 26 MiB
[ 0.000000] OF: reserved mem: initialized node ion, compatible id ion-region
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080000000-0x0000000083f3ffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080000000-0x0000000083f3ffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x0000000083f3ffff]
[ 0.000000] On node 0 totalpages: 16192
[ 0.000000] DMA32 zone: 222 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 16192 pages, LIFO batch:3
[ 0.000000] SBI specification v0.3 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x9
[ 0.000000] SBI v0.2 TIME extension detected
[ 0.000000] SBI v0.2 IPI extension detected
[ 0.000000] SBI v0.2 RFENCE extension detected
[ 0.000000] riscv: ISA extensions acdfimsuv
[ 0.000000] riscv: ELF capabilities acdfimv
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15970
[ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rootwait rw console=tty0 console=ttyS0,115200 earlycon=sbi loglevel=9 riscv.fwsz=0x80000
[ 0.000000] Dentry cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 28932K/64768K available (3946K kernel code, 498K rwdata, 1721K rodata, 152K init, 218K bss, 35836K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Preemptible hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] Trampoline variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] riscv-intc: 64 local interrupts mapped
[ 0.000000] plic: interrupt-controller@70000000: mapped 101 interrupts with 1 handlers for 2 contexts.
[ 0.000000] random: get_random_bytes called from start_kernel+0x2e0/0x41c with crng_init=0
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns
[ 0.000010] sched_clock: 64 bits at 25MHz, resolution 40ns, wraps every 4398046511100ns
[ 0.008481] Console: colour dummy device 80x25
[ 0.014665] printk: console [tty0] enabled
[ 0.018916] Calibrating delay loop (skipped), value calculated using timer frequency.. 50.00 BogoMIPS (lpj=100000)
[ 0.029676] pid_max: default: 4096 minimum: 301
[ 0.034539] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.042044] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.051671] ASID allocator initialised with 65536 entries
[ 0.057447] rcu: Hierarchical SRCU implementation.
[ 0.062874] EFI services will not be available.
[ 0.068011] devtmpfs: initialized
[ 0.077542] early_time_log: do_initcalls: 4664551us
[ 0.083308] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.093449] futex hash table entries: 16 (order: -4, 384 bytes, linear)
[ 0.100407] pinctrl core: initialized pinctrl subsystem
[ 0.106367] NET: Registered protocol family 16
[ 0.111512] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[ 0.118900] DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[ 0.127940] thermal_sys: Registered thermal governor 'step_wise'
[ 0.144109] OF: /gpio@03020000/gpio-controller@0: could not find phandle
[ 0.157383] OF: /gpio@03021000/gpio-controller@1: could not find phandle
[ 0.164374] OF: /gpio@03022000/gpio-controller@2: could not find phandle
[ 0.171363] OF: /gpio@03023000/gpio-controller@3: could not find phandle
[ 0.178347] OF: /gpio@05021000/gpio-controller@4: could not find phandle
[ 0.187357] clk reset: nr_reset=64 resource_size=8
[ 0.192996] get audio clk=24576000
[ 0.196588] cvitek-i2s-subsys 4108000.i2s_subsys: Set clk_sdma_aud0~3 to 24576000
[ 0.218308] dw_dmac 4330000.dma: CVITEK DMA Controller, 8 channels, probe done!
[ 0.226943] SCSI subsystem initialized
[ 0.231299] usbcore: registered new interface driver usbfs
[ 0.237139] usbcore: registered new interface driver hub
[ 0.242783] usbcore: registered new device driver usb
[ 0.251581] Ion: ion_parse_dt_heap_common: id 0 type 2 name carveout align 1000
[ 0.259698] Ion: rmem_ion_device_init: heap carveout base 0x0000000082473000 size 0x0000000001acd000 dev (____ptrval____)
[ 0.271069] ion_carveout_heap_create, size=0x1acd000
[ 0.276342] cvi_get_rtos_ion_size, rtos ion_size get:0x0
[ 0.411908] platform carveout: [ion] add heap id 0, type 2, base 0x82473000, size 0x1acd000
[ 0.421009] Advanced Linux Sound Architecture Driver Initialized.
[ 0.428759] clocksource: Switched to clocksource riscv_clocksource
[ 0.448561] NET: Registered protocol family 2
[ 0.454220] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.463017] TCP established hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.470895] TCP bind hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.478129] TCP: Hash tables configured (established 512 bind 512)
[ 0.484731] UDP hash table entries: 128 (order: 0, 4096 bytes, linear)
[ 0.491549] UDP-Lite hash table entries: 128 (order: 0, 4096 bytes, linear)
[ 0.499011] NET: Registered protocol family 1
[ 0.504236] RPC: Registered named UNIX socket transport module.
[ 0.510427] RPC: Registered udp transport module.
[ 0.515282] RPC: Registered tcp transport module.
[ 0.520201] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.529610] Initialise system trusted keyrings
[ 0.534544] workingset: timestamp_bits=62 max_order=13 bucket_order=0
[ 0.548891] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.556077] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.563340] Key type asymmetric registered
[ 0.567604] Asymmetric key parser 'x509' registered
[ 0.579088] Serial: 8250/16550 driver, 5 ports, IRQ sharing disabled
[ 0.587890] printk: console [ttyS0] disabled
[ 0.592472] 4140000.serial: ttyS0 at MMIO 0x4140000 (irq = 15, base_baud = 1562500) is a 16550A
[ 0.601597] printk: console [ttyS0] enabled
[ 0.610239] printk: bootconsole [sbi0] disabled
[ 0.623176] cvi-spif 10000000.cvi-spif: unrecognized JEDEC id bytes: 00 00 00 00 00 00
[ 0.631497] cvi-spif 10000000.cvi-spif: device scan failed
[ 0.637244] cvi-spif 10000000.cvi-spif: unable to setup flash chip
[ 0.650222] libphy: Fixed MDIO Bus: probed
[ 0.655945] dwc2 4340000.usb: axi clk installed
[ 0.660769] dwc2 4340000.usb: apb clk installed
[ 0.665533] dwc2 4340000.usb: 125m clk installed
[ 0.670387] dwc2 4340000.usb: 33k clk installed
[ 0.675149] dwc2 4340000.usb: 12m clk installed
[ 0.680005] dwc2 4340000.usb: EPs: 8, dedicated fifos, 3072 entries in SPRAM
[ 0.688009] dwc2 4340000.usb: DWC OTG Controller
[ 0.692936] dwc2 4340000.usb: new USB bus registered, assigned bus number 1
[ 0.700274] dwc2 4340000.usb: irq 36, io mem 0x04340000
[ 0.706746] hub 1-0:1.0: USB hub found
[ 0.710824] hub 1-0:1.0: 1 port detected
[ 0.716702] usbcore: registered new interface driver usb-storage
[ 0.723455] i2c /dev entries driver
[ 0.729403] sdhci: Secure Digital Host Controller Interface driver
[ 0.735897] sdhci: Copyright(c) Pierre Ossman
[ 0.740471] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.746653] cvi:sdhci_cvi_probe
[ 0.796779] mmc0: SDHCI controller on 4310000.cv-sd [4310000.cv-sd] using ADMA 64-bit
[ 0.805034] cvi_proc_init cvi_host 0x(____ptrval____)
[ 0.811068] usbcore: registered new interface driver usbhid
[ 0.820788] usbhid: USB HID core driver
[ 0.825713] fb_st7789v spi0.0: fbtft_property_value: buswidth = 8
[ 0.832199] fb_st7789v spi0.0: fbtft_property_value: debug = 0
[ 0.838386] fb_st7789v spi0.0: fbtft_property_value: rotate = 0
[ 0.844649] fb_st7789v spi0.0: fbtft_property_value: fps = 30
[ 0.930629] mmc0: new high speed SDHC card at address aaaa
[ 0.937335] mmcblk0: mmc0:aaaa SU08G 7.40 GiB
[ 0.946527] mmcblk0: p1 p2 p3
[ 1.356494] random: fast init done
[ 1.373156] Console: switching to colour frame buffer device 16x10
[ 1.380940] graphics fb0: fb_st7789v frame buffer, 128x160, 40 KiB video memory, 4 KiB buffer memory, fps=31, spi0.0 at 48 MHz
[ 1.397126] cvitek-i2s 4100000.i2s: cvi_i2s_probe
[ 1.403882] cvitek-i2s 4110000.i2s: cvi_i2s_probe
[ 1.414475] cvitek-i2s 4120000.i2s: cvi_i2s_probe
[ 1.427565] cvitek-i2s 4130000.i2s: cvi_i2s_probe
[ 1.437222] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[ 1.445878] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[ 1.461330] cvitekaadc 300a100.adc: cvitekaadc_probe
[ 1.473553] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[ 1.485123] cvitekadac 300a000.dac: cvitekadac_probe
[ 1.491848] cvitekadac_probe gpio_is_valid mute_pin_l
[ 1.502790] cv1835-max98357a sound: snd card name = cv1835_max98357a
[ 1.526922] NET: Registered protocol family 10
[ 1.534259] Segment Routing with IPv6
[ 1.545607] NET: Registered protocol family 17
[ 1.551737] random: crng init done
[ 1.558855] Loading compiled-in X.509 certificates
[ 1.603273] cviteka-adc sound_adc: cviteka_adc_probe, dev name=sound_adc
[ 1.611808] cviteka-adc sound_adc: cviteka_adc_probe start devm_snd_soc_register_card
[ 1.627825] cviteka-dac sound_dac: cviteka_dac_probe, dev name=sound_dac
[ 1.642673] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.668252] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.677043] cfg80211: failed to load regulatory.db
[ 1.683520] ALSA device list:
[ 1.687740] dw-apb-uart 4140000.serial: forbid DMA for kernel console
[ 1.715690] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.726136] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.737466] devtmpfs: mounted
[ 1.741510] Freeing unused kernel memory: 152K
[ 1.747355] Kernel memory protection not selected by kernel config.
[ 1.759179] Run /sbin/init as init process
[ 1.769483] with arguments:
[ 1.777022] /sbin/init
[ 1.780446] with environment:
[ 1.784627] HOME=/
[ 1.787724] TERM=linux
[ 1.791158] early_time_log: run_init_process: 6378169us
[ 1.878890] EXT4-fs (mmcblk0p2): re-mounted. Opts: errors=remount-ro
[ 2.557255] cv180x_sys: bad vermagic: kernel tainted.
[ 2.563788] Disabling lock debugging due to kernel taint
[ 2.570885] cv180x_sys: loading out-of-tree module taints kernel.
[ 2.600614] res-reg: start: 0xa0c8000, end: 0xa0c801f, virt-addr(ffffffd0040c1000).
[ 2.619673] CVITEK CHIP ID = 22
[ 2.638827] cvi_rtos_cmdqu_probe start ---
[ 2.649226] name=1900000.rtos_cmdqu
[ 2.657030] res-reg: start: 0x1900000, end: 0x1900fff, virt-addr(ffffffd0040c5000).
[ 2.666851] cvi_rtos_cmdqu_probe DONE
[ 2.672188] [cvi_spinlock_init] success
[ 2.896807] RTOS_CMDQU_SEND_WAIT timeout
[ 2.901892] SYS_CMD_INFO_LINUX_INIT_DONE fail
[ 2.907782] communicate with rtos fail
[ 2.926365] cif a0c2000.cif: cam0 clk installed
[ 2.932457] cif a0c2000.cif: cam1 clk installed
[ 2.942807] cif a0c2000.cif: vip_sys_2 clk installed
[ 2.955838] cif a0c2000.cif: clk_mipimpll clk installed 00000000833de2c3
[ 2.967266] cif a0c2000.cif: clk_disppll clk installed 00000000d25175b7
[ 2.976056] cif a0c2000.cif: clk_fpll clk installed 00000000805f969e
[ 2.989682] cif a0c2000.cif: (0) res-reg: start: 0xa0c2000, end: 0xa0c3fff.
[ 3.006362] cif a0c2000.cif: virt-addr(000000009c846059)
[ 3.013568] cif a0c2000.cif: (1) res-reg: start: 0xa0d0000, end: 0xa0d0fff.
[ 3.022592] cif a0c2000.cif: virt-addr(00000000ccabe0bb)
[ 3.033643] cif a0c2000.cif: (2) res-reg: start: 0xa0c4000, end: 0xa0c5fff.
[ 3.051410] cif a0c2000.cif: virt-addr(000000005eb7584c)
[ 3.058559] cif a0c2000.cif: (3) res-reg: start: 0x3001c30, end: 0x3001c5f.
[ 3.067584] cif a0c2000.cif: virt-addr(00000000e6740473)
[ 3.078725] cif a0c2000.cif: no pad_ctrl for cif
[ 3.091406] cif a0c2000.cif: request irq-26 as cif-irq0
[ 3.101042] cif a0c2000.cif: request irq-27 as cif-irq1
[ 3.108101] cif a0c2000.cif: rst_pin = 424, pol = 1
[ 3.129320] snsr_i2c snsr_i2c: i2c:-------hook 0
[ 3.138214] snsr_i2c snsr_i2c: i2c:-------hook 1
[ 3.145220] snsr_i2c snsr_i2c: i2c:-------hook 2
[ 3.151855] snsr_i2c snsr_i2c: i2c:-------hook 3
[ 3.158391] snsr_i2c snsr_i2c: i2c:-------hook 4
[ 3.222381] vi_core_probe:203(): res-reg: start: 0xa000000, end: 0xa07ffff, virt-addr(ffffffd004480000).
[ 3.234335] vi_core_probe:216(): irq(28) for isp get from platform driver.
[ 3.247718] vi_tuning_buf_setup:253(): tuning fe_addr[0]=0x8171f490, be_addr[0]=0x81717290, post_addr[0]=0x81700000
[ 3.270064] vi_tuning_buf_setup:253(): tuning fe_addr[1]=0x816df490, be_addr[1]=0x816d7290, post_addr[1]=0x816c0000
[ 3.289968] vi_tuning_buf_setup:253(): tuning fe_addr[2]=0x816ff490, be_addr[2]=0x816f7290, post_addr[2]=0x816e0000
[ 3.309777] sync_task_init:177(): sync_task_init vi_pipe 0
[ 3.317037] sync_task_init:177(): sync_task_init vi_pipe 1
[ 3.324287] sync_task_init:177(): sync_task_init vi_pipe 2
[ 3.340935] vi_core_probe:252(): isp registered as cvi-vi
[ 3.411286] cvi_dwa_probe:487(): done with rc(0).
[ 3.449977] cv180x-cooling cv180x_cooling: elems of dev-freqs=6
[ 3.466628] cv180x-cooling cv180x_cooling: dev_freqs[0]: 850000000 500000000
[ 3.475920] cv180x-cooling cv180x_cooling: dev_freqs[1]: 425000000 375000000
[ 3.489002] cv180x-cooling cv180x_cooling: dev_freqs[2]: 425000000 300000000
[ 3.507107] cv180x-cooling cv180x_cooling: Cooling device registered: cv180x_cooling
[ 3.557705] jpu ctrl reg pa = 0xb030000, va = 000000002553fa1c, size = 256
[ 3.566939] end jpu_init result = 0x0
[ 3.700227] cvi_vc_drv_init result = 0x0
[ 3.718097] sh (119): drop_caches: 3
[ 3.919406] dwc2 4340000.usb: new device is high-speed
[ 3.942269] using random self ethernet address
[ 3.942290] using random host ethernet address
[ 3.994692] usb0: HOST MAC da:6e:e0:d2:0c:45
[ 3.995030] usb0: MAC ce:9d:f5:ec:9e:27
[ 3.995107] dwc2 4340000.usb: bound driver configfs-gadget
[ 4.135360] dwc2 4340000.usb: new device is high-speed
[ 4.172829] dwc2 4340000.usb: new address 11
[ 4.351213] dwc2 4340000.usb: new device is high-speed
[ 4.388549] dwc2 4340000.usb: new address 11
[ 5.016822] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready