硬件平台:tiny4412
系统:linux-4.4
文件系统:busybox-1.25
编译器: arm-none-linux-gnueabi-gcc (gcc version 4.8.3 20140320)
uboot:友善自带uboot,见上节
实验参考摩斯电码的博客:
http://www.cnblogs.com/pengdonglin137/p/5137941.html
http://www.cnblogs.com/pengdonglin137/p/5143516.html
一、u-boot修改
1、更新交叉工具链
到:http://www.veryarm.com/arm-none-linux-gnueabi-gcc
下载:arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar –xjf arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
修改环境变量:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/work/gcc/arm-2014.05/bin"
arm-none-linux-gnueabi-gcc -v:
gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)
2、关闭uboot开启的MMU
(1)修改include/configs/tiny4412.h
将
#define CONFIG_ENABLE_MMU
修改为
#undef CONFIG_ENABLE_MMU
(2) 只关闭MMU还不够,还需要修改u-boot的链接地址
修改文件board/samsung/tiny4412/config.mk
将
CONFIG_SYS_TEXT_BASE = 0xc3e00000
修改为
CONFIG_SYS_TEXT_BASE = 0x43e00000
因为板子是1G内存,从4000 0000 开始
4000 0000 - 5000 0000 256M
......
7000 0000 - 8000 0000 1G
3、使uboot可以引导uImage
修改uboot源码下:common/cmd_bootm.c
(1)
int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong iflag;
ulong load_end = 0;
int ret;
boot_os_fn *boot_fn;
int iszImage = 0;
(2)
images.legacy_hdr_valid = 1;
iszImage = 1;
goto after_header_check;.
(3)
images.os.os = hdr->;ih_os;
images.ep = image_get_ep (&;images.legacy_hdr_os_copy);
改为
if (iszImage) {
images.os.os = hdr->ih_os;
images.ep = image_get_ep (&images.legacy_hdr_os_copy);
}
4、修改uboot支持设备树
修改include/configs/tiny4412.h
增加如下两个宏
#define CONFIG_OF_LIBFDT
#define CONFIG_SYS_BOOTMAPSZ (20 << 20)
5、编译uboot
(1)修改makefile,增加:
ifeq ($(ARCH),arm)
CROSS_COMPILE ?=/work/gcc/arm-2014.05/bin/arm-none-linux-gnueabi-
endif
(2)make distclean
(3)make tiny4412_config
(4)make
(5)烧写到SD卡
cd sd_fuse/tiny4412
./sd_fusing.sh /dev/sdc (fdisk -l查看)
(6)启动uboot
U-Boot 2010.12 (Jul 02 2017 - 11:26:09) for TINY4412
CPU: S5PC220 [Samsung SOC on SMP Platform Base on ARM CortexA9]
APLL = 1400MHz, MPLL = 800MHz
Board: TINY4412
DRAM: 1023 MiB
vdd_arm: 1.2
vdd_int: 1.0
vdd_mif: 1.1
BL1 version: N/A (TrustZone Enabled BSP)
Checking Boot Mode ... SDMMC
REVISION: 1.1
fwbl1: 0
iram block: 16
u-boot: 48
TrustZone S/W: 704
env: 1024
knl: 1057
rfs: 13345
bl2: 16
MMC Device 0: 14756 MB
lizuobin read idff
lizuobin read idff
lizuobin read idff
lizuobin read idff
fwbl1: 0
iram block: 16
u-boot: 48
TrustZone S/W: 704
env: 1024
knl: 1057
rfs: 13345
bl2: 16
MMC Device 1: 3728 MB
MMC Device 2: N/A
Net: No ethernet found.
Hit any key to stop autoboot: 0
二、内核及文件系统系统制作
1、内核移植(支持设备树)
(1)下载源码:https://www.kernel.org/pub/linux/kernel/v4.x/ 下载 linux-4.4.tar.gz
(2)解压:tar –xzf linux-4.4.tar.gz
(3)cd linux-4.4
(4)修改makefile,增加
+ARCH ?= arm
+CROSS_COMPILE ?= /work/gcc/arm-2014.05/bin/arm-none-linux-gnueabi-
(5)配置:linux-4.4 已经很好的支持了tiny4412,所以移植的工作并不多。
make exynos_defconfig
(6) 修改arch/arm/boot/dts/exynos4412-tiny4412.dts
chosen {
stdout-path = &;serial_0;
bootargs = "root=/dev/ram0 rw rootfstype=ext4 console=ttySAC0,115200 init=/linuxrc earlyprintk"; };
pinctrl-names = "default";
#status = "okay";
status = "disabled";
}&serial_0
(7)配置内核,支持ramdisk
make menuconfig
File systems --->;
<*> Second extended fs support
Device Drivers
SCSI device support --->;
<*> SCSI disk support
Block devices --->;
<*>RAM block device support
(16)Default number of RAM disks
(8192) Default RAM disk size (kbytes) (修改为8M)
General setup --->;
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
(8) 配置内核,使其支持tmpfs
$ make menuconfig
File systems --->;
Pseudo filesystems --->
[*] Virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
exynos的默认配置也已经支持了。
(9)编译产生uImage
make uImage LOADADDR=0x40008000 -j2
生成的uImage在arch/arm/boot下。
(10)编译设备树
make dtbs
arch/arm/boot/dts/会生成tiny4412上用的设备树镜像文件exynos4412-tiny4412.dtb。
(11)文件系统制作
下载busybox的代码,制作ramdisk镜像。
三、下载测试
下载内核、文件系统、设备树文件
#u-boot:dnw 0x40600000
dnw arch/arm/boot/uImage
#u-boot:dnw 0x41000000
dnw ramdisk.img
#u-boot:dnw 0x42000000
dnw arch/arm/boot/dts/exynos4412-tiny4412.dtb
启动内核 使用bootm启动内核:
bootm 0x40600000 0x41000000 0x42000000
启动日志:
TINY4412 # bootm 0x40600000 0x41000000 0x42000000
## Booting kernel from Legacy Image at 40600000 ...
Image Name: Linux-4.4.0
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 4193128 Bytes = 4094 KiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 41000000 ...
Image Name: ramdisk
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2585838 Bytes = 2525 KiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 42000000
Booting using the fdt blob at 0x42000000
Loading Kernel Image ... OK
OK
## Loading init Ramdisk from Legacy Image at 41000000 ...
Image Name: ramdisk
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2585838 Bytes = 2525 KiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk to 43a84000, end 43cfb4ee ... OK
Loading Device Tree to 413f2000, end 413ff555 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0xa00
[ 0.000000] Linux version 4.4.0 (root@book-virtual-machine) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #1 SMP PREEMPT Sun Jul 2 11:55:00 CST 2017
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: FriendlyARM TINY4412 board based on Exynos4412
[ 0.000000] cma: Reserved 64 MiB at 0x7bc00000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] Samsung CPU ID: 0xe4412011
[ 0.000000] PERCPU: Embedded 12 pages/cpu @ef79c000 s18816 r8192 d22144 u49152
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260352
[ 0.000000] Kernel command line: root=/dev/mmcblk0p1 rootfstype=ext4 console=ttySAC0,115200 init=/linuxrc ctp=2 skipcali=y loglevel=7
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 961316K/1047552K available (5715K kernel code, 239K rwdata, 2020K rodata, 432K init, 315K bss, 20700K reserved, 65536K cma-reserved, 195584K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0795eac (7736 kB)
[ 0.000000] .init : 0xc0796000 - 0xc0802000 ( 432 kB)
[ 0.000000] .data : 0xc0802000 - 0xc083de00 ( 240 kB)
[ 0.000000] .bss : 0xc0840000 - 0xc088ec28 ( 316 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=4
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] GIC physical location is 0x10490000
[ 0.000000] L2C: platform modifies aux control register: 0x02070000 -> 0x3e470001
[ 0.000000] L2C: platform provided aux values permit register corruption.
[ 0.000000] L2C: DT/platform modifies aux control register: 0x02070000 -> 0x3e470001
上一篇:tiny4412学习(四)之移植linux-设备树(1)设备树基础知识及GPIO中断
下一篇:tiny4412学习(一)之从零搭建linux系统(烧写uboot、内核进emmc+uboot启动内核)
推荐阅读最新更新时间:2024-11-08 14:12
- 热门资源推荐
- 热门放大器推荐
设计资源 培训 开发板 精华推荐
- LT3957IUHE、4V 至 6V 输入、180V 输出反激式转换器的典型应用电路
- 使用 ROHM Semiconductor 的 BD48K23G-TL 的参考设计
- 使用 Analog Devices 的 LT3470AEDDB 的参考设计
- DC2168A,基于 LTC6433-15 低频至 1.4GHz、50Ω 增益模块中频放大器的演示板
- 多路稳压电源模块
- 使用 Analog Devices 的 LT1317BIS8 的参考设计
- NCV896530GEVB:固定频率双路可调输出 1.6A,3.3V,评估板
- T12 Project
- TCR5SB21、200mA、2.1V 输出电压 CMOS 低压降稳压器的典型应用
- DVK-SFUS-1-GEVK:用于 RCZ2 的 Sigfox™ AT 开发套件