页次: 1
修改 arch/arm/boot/compressed/misc.c:
static inline uint32_t read32(uint32_t addr)
{
return( *((volatile uint32_t *)(addr)) );
}
static inline void write32(uint32_t addr, uint32_t value)
{
*((volatile uint32_t *)(addr)) = value;
}
void sys_uart_putc(char c)
{
[ins]unsigned int addr = 0x01c28800;[/ins]
while((read32(addr + 0x7c) & (0x1 << 1)) == 0);
write32(addr + 0x00, c);
}
static void putstr(const char *ptr)
{
char c;
while ((c = *ptr++) != '\0') {
if (c == '\n')
sys_uart_putc('\r');
sys_uart_putc(c);
}
flush();
}
U-Boot 2017.01-rc2 (Jan 20 2019 - 19:52:07 -0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28800
Out: serial@01c28800
Err: serial@01c28800
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 2 1 0
reading zImage
3987592 bytes read in 207 ms (18.4 MiB/s)
reading sun8i-v3s-licheepi-zero-dock.dtb
11986 bytes read in 26 ms (450.2 KiB/s)
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dffed1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
更新下,直接写输出串口2 的地址没有问题,zImage解压正常
https://whycan.cn/t_728.html,然后我试了这个方法,也是卡在Starting kernel ...这个地方
U-Boot 2017.01-rc2 (Jan 20 2019 - 20:58:24 -0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28000
Out: serial@01c28000
Err: serial@01c28000
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 2
[13:38:32.024]ÊÕ¡û¡ô 1
[13:38:33.025]ÊÕ¡û¡ô 0
[13:38:33.097]ÊÕ¡û¡ôreading zImage
3987592 bytes read in 206 ms (18.5 MiB/s)
reading sun8i-v3s-licheepi-zero-dock.dtb
11986 bytes read in 26 ms (450.2 KiB/s)
## Flattened Device Tree blob at 41800000
Booting using the fdt blob at 0x41800000
Loading Device Tree to 42dfa000, end 42dffed1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.13.16-licheepi-zero (ubuntu@ubuntu) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #2 SMP Sun Jan 20 18:46:21 PST 2019
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Lichee Pi Zero with Dock
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 16 pages/cpu @c3de6000 s33868 r8192 d23476 u65536
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 15883
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 53580K/64036K available (6144K kernel code, 217K rwdata, 1456K rodata, 1024K init, 264K bss, 10456K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4000000 - 0xff800000 ( 952 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc3e89000 ( 62 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0700000 (7136 kB)
[ 0.000000] .init : 0xc0900000 - 0xc0a00000 (1024 kB)
[ 0.000000] .data : 0xc0a00000 - 0xc0a367c0 ( 218 kB)
[ 0.000000] .bss : 0xc0a3da78 - 0xc0a7fc2c ( 265 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU event tracing is enabled.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
这是用串口0输出的log,看来改成串口2,内核里面没有改成功。
DTC arch/arm/boot/dts/sun8i-a23-evb.dtb
In file included from arch/arm/boot/dts/sun8i-a23.dtsi:45:0,
from arch/arm/boot/dts/sun8i-a23-evb.dts:46:
arch/arm/boot/dts/sun8i-a23-a33.dtsi:47:54: fatal error: dt-bindings/interrupt-controller/arm-gic.h: No such file or directory
#include <dt-bindings/interrupt-controller/arm-gic.h>
^
compilation terminated.
scripts/Makefile.lib:325: recipe for target 'arch/arm/boot/dts/sun8i-a23-evb.dtb' failed
make[1]: *** [arch/arm/boot/dts/sun8i-a23-evb.dtb] Error 1
arch/arm/Makefile:346: recipe for target 'dtbs' failed
make: *** [dtbs] Error 2
make: *** Waiting for unfinished jobs....
AR drivers/mtd/built-in.o
AR drivers/built-in.o
这个文件是怎么生成的,看源代码里面是没有。
看了下论坛的其他文章,可能的问题是:
1.串口设置不对
2.内核不对
1.串口是这么设置的
/*
* (C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
*
* Configuration settings for the Allwinner A23 (sun8i) CPU
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __CONFIG_H
#define __CONFIG_H
/*
* A23 specific configuration
*/
#ifdef CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_SUNXI
#endif
#ifdef CONFIG_MACH_SUN8I_H3
#define CONFIG_SUNXI_USB_PHYS 4
#elif defined CONFIG_MACH_SUN8I_A83T
#define CONFIG_SUNXI_USB_PHYS 3
#elif defined CONFIG_MACH_SUN8I_V3S
#define CONFIG_SUNXI_USB_PHYS 1
#else
#define CONFIG_SUNXI_USB_PHYS 2
#endif
#define CONFIG_BOOTCOMMAND "setenv bootm_boot_mode sec;" \
"load mmc 0:1 0x41000000 zImage;" \
"load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb;" \
"bootz 0x41000000 - 0x41800000;"
#define CONFIG_BOOTARGS "console=ttyS2,115200 panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,6M(kernel)ro,-(rootfs) root=/dev/mmcblk0p2 earlyprintk rw"
/*
* Include common sunxi configuration where most the settings are
*/
#include <configs/sunxi-common.h>
#endif /* __CONFIG_H */
应该没问题。
2。内核有问题,但是是从你那个连接下载的,看你log输出正常,也应该没问题。
U-Boot 2017.01-rc2-g59058e5-dirty (Jan 18 2019 - 05:23:33 -0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28800
Out: serial@01c28800
Err: serial@01c28800
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 2 1 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0xf0000, size 0x10000
SF: 65536 bytes @ 0xf0000 Read: OK
device 0 offset 0x300000, size 0x800000
SF: 8388608 bytes @ 0x300000 Read: OK
=>
[22:44:34.025]发→◇ls
□
[22:44:41.809]发→◇l
U-Boot SPL 2017.01-rc2-g59058e5-dirty (Jan 18 2019 - 05:23:33)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2017.01-rc2-g59058e5-dirty (Jan 18 2019 - 05:23:33 -0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28800
Out: serial@01c28800
Err: serial@01c28800
U-Boot 2017.01-rc2-g59058e5-dirty (Jan 18 2019 - 05:23:33 -0800) Allwinner Technology
CPU: Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM: 64 MiB
MMC: SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28800
Out: serial@01c28800
Err: serial@01c28800
Net: No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot: 2 0
=> MC: SUNXI SD/MMC: 0
Unknown command 'MC:' - try 'help'
=>
Unknown command 'MC:' - try 'help'
=> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page size 252> MC: SUNXI SD/MMC: >> SF: Detected w25q128bv with page s
[13:56:14.987]ÊÕ¡û¡ô\0
[13:56:15.425]ÊÕ¡û¡ô¡U\0½¼À\0SPL 2017.01-rc2 (Jan 14 2019 - 21:52:58)
DRAM:\0\0MiB
Trying to boot from MMC1
[13:56:15.630]ÊÕ¡û¡ô¡\0U-Boot 2017.01-rc2 (Jan 14 2019 - 21:52:58 -0800) Allwinner Technologù
CPUz Aüüÿéþþåò ^w÷ (WU^xI q~xq)
]ÿäåüz \éçèåå Pé zåòÿ
DRA]z lp\0À\0\0W\0\0 WU^xI WD?]]Gz p
\0\0Detected w25q128bv with page size 256 Bùôå÷< åòá÷å ÷éúå t OéB< ôÿôáü q~ ]éB
\0%%º…À¸€¸œ\0- bad CRC, using default environment
y_Ïã\0õð á xppøtp`\0ØÆÀ\0ÆÞÜæÞØÀ\0\0ÞìÀàæÆÀÜ\0`x0)
[13:56:15.740]ÊÕ¡û¡ô`Œ°¼ŒŒà 33000kHz = 33000kHz: (1 * 3MHú * ~~) ? ~
[13:56:15.786]ÊÕ¡û¡ô\0\0 ÷åòéáü@pqærxp``\0ààp\0\0\0æÀàÀÀØ\0``Æ`p800
Err: serial@01c28800
U-Boot 2017.01-rc2 (Jan 14 2019 - 21:52:58 -0800) Allwinner Technology
CPUz Aüüÿéþþåò ^w÷ (WU^xI q~xq)
]ÿäåüz \éçèåå Pé zåòÿ
DRA]z ~d À\0\0p\0\0\0\00\0\0\0C: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, õ÷éþï äåîáõüô åþþéòÿþýåþô
Wåôôéþï õð á xppøtxp üçä çÿþ÷ÿüå (þìÀâæÆÀÜ\0`ð`\0\0ÀÞàÆØÞÆÆp\0f3000kHz =
[13:56:15.853]ÊÕ¡û¡ô 33000kHz: (1 * 3MHz * 66) / 6
In: serial@01c28800
Out: serial@01c28800
Err: serial@01c2xx0p
Y—\0 No ethernet found.
starting USB>>>
^ÿ çÿþôòÿüüåò÷ îÿõþä
\00\0¸à\0ÆÀð\0ào stop autoboot: 2 0
=> ÀÀB à€€`\0B <INTERRUPT~
}~ àB<pàüÀ€€À€Àظ€À€€€œ€˜€àðÀ€`\0ÀÞ`p€€À€Àظ€À€€€œ€˜€àðÀ\0€`\0ÀÞ`p€€À€Àظ€À€€€œ€˜€àðÀ<R\0UIIUAQù
=> ã8¼`\0€€Àظ€À€€€œ€˜€àðÀ<àÀÀð0¼`<R\0UIIUAQù
=> 8vÜ€À€€€œ€˜€àðÀ<ÀÀà\0<àÀÀðpƒ\0À€€€œ€˜€àðÀ\0ÀÀÀ<R\0UIIUAQù`
}~ |ððÀ€À\0€€€œ€˜€àðÀ\0ÀÀÀ<àÀÀðÀ€ÀÀ€À€€€œ€˜€àðÀ<R\0UIIUAQù
=> î8x8øÀ€ÀÀ€À€€€œ€˜€àðÀ<àÀÀðp€xÀÀ€ÀÀ€À€€€œ€˜€àðÀ<ÀÀ\0€xÀÀÀÀÀ€€€œ€˜€àðÀ<ÀÀ<R\0UIIUAQù`
页次: 1