工厂废品小爱同学mini的重生(3)——— Uboot和硬改SD卡

硬改SD卡

由提取出的设备树结合硬件可以得到,蓝牙使用的为UART1,调试口占用UART0,在A面的调试点分别是JTAG和UART0,还有S-UART(设备树里没有使用),查看全志R16的用户手册得知,MMC0与JTAG和UART0复用,只要接上一个sd卡的卡槽就可以完成硬件的改装,加上全志soc先检查sd卡可启动性的传统艺能,基本上使得启动主线Uboot成为可能。
按照下图的定义接线,再使用主线uboot现成的a33-q8-tablet设备树,就可以启动到uboot的spl阶段了,但是要填的坑还是有点多。。。

在这里插入图片描述
焊工有点丑了。。。

在这里插入图片描述

U-Boot填坑

解决SPL找不到SD卡的问题

直接使用q8-tablet设备的defconfig,报如下的错误在这里插入图片描述
这是因为q8的mmc是有cd脚来检测sd卡是否被插入,然而相机卡没有这个脚,要在uboot的设备树的mmc0节点non-removable;注明使得uboot不会去检测cd脚。

&mmc0 {
	pinctrl-names = "default";
	pinctrl-0 = <&mmc0_pins>;
	vmmc-supply = <&reg_dcdc1>;
	bus-width = <4>;
	+ non-removable;
	status = "okay";
};

解决加载内核和设备树时报内存已被保留的错误

串口输出如下

U-Boot 2020.07-dirty (Aug 20 2020 - 00:42:14 -0700) Allwinner Technology

CPU:   Allwinner A33 (SUN8I 1667)
Model: A33 Q8 Tablet
DRAM:  128 MiB
MMC:   mmc@1c0f000: 0, mmc@1c11000: 1
Loading Environment from FAT... Card did not respond to voltage select!
Setting up a 800x480 lcd console (overscan 0x0)
In:    serial
Out:   vga
Err:   vga
Allwinner mUSB OTG (Peripheral)
Net:
Warning: usb_ether using MAC address from ROM
eth0: usb_ether
starting USB...
Bus usb@1c1a000: USB EHCI 1.00
Bus usb@1c1a400: USB OHCI 1.0
scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
355 bytes read in 3 ms (115.2 KiB/s)
## Executing script at 41900000
** Reading file would overwrite reserved memory **
There is no valid bmp file at the given address
** Reading file would overwrite reserved memory **
** Reading file would overwrite reserved memory **
SCRIPT FAILED: continuing...

这是一个困扰了我比较久的问题,加载内核和设备树时总是写不进内存,是和uboot的内存分配有关,毕竟sun8i主线uboot除了v3s也没这么小内存(128mb)的设备,参照只有64mb的v3s,修改如下。
./include/configs/sunxi-common.h
第一处

- #if  (!defined CONFIG_MACH_SUN8I_V3S) 
- /* 64MB of malloc() pool */
- #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (64 << 20))
- #else
/* 2MB of malloc() pool */
#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (2 << 20))
- #endif

第二处

#else
/*
 * 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc.
 * 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
 * 1M script, 1M pxe and the ramdisk at the end.
 */
- #if (!defined CONFIG_MACH_SUN8I_V3S) 
- #define BOOTM_SIZE     __stringify(0xa000000)
- #define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(2000000))
- #define FDT_ADDR_R     __stringify(SDRAM_OFFSET(3000000))
- #define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(3100000))
- #define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))
- #define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000))
- #else
/*
 * 64M RAM minus 2MB heap + 16MB for u-boot, stack, fb, etc.
 * 16M uncompressed kernel, 8M compressed kernel, 1M fdt,
 * 1M script, 1M pxe and the ramdisk at the end.
 */
#define BOOTM_SIZE     __stringify(0x2e00000)
#define KERNEL_ADDR_R  __stringify(SDRAM_OFFSET(1000000))
#define FDT_ADDR_R     __stringify(SDRAM_OFFSET(1800000))
#define SCRIPT_ADDR_R  __stringify(SDRAM_OFFSET(1900000))
#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(1A00000))
#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(1B00000))
- #endif
#endif

之后就可以进入linux的世界了~~ 打算以apt系的armbian作为rootfs便于内核模块的调试~~
放个成功运行的图预告一下~~
配好codec和wifi跑个gmediarender基本上内存就上80m了可能openwrt这种发行版会更好一些。。
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值