blob: a0fe832fb2471dc37d6ee447bdc2b98776640156 [file] [log] [blame]
Stefan Roese13b4f632012-08-14 15:04:19 +02001------------------------------------------------------------------------
2A3M071 board support
3------------------------------------------------------------------------
4
5
6SPL NOR flash support:
7----------------------
8To boot fast into the OS (Linux), this board port integrates the SPL
9framework. This means, that a special, stripped-down version of
10U-Boot runs in the beginning. In the case of the A3M071 board, this
11SPL U-Boot version is less than 16 KiB big. This SPL U-Boot can either
12boot the OS (Linux) or a "real", full-blown U-Boot. This detection
13on whether to boot Linux or U-Boot is done by using the "boot_os"
14environment variable. If "boot_os" is set to "yes", Linux will be
15loaded and booted from the SPL U-Boot version. Otherwise, the
16full-blown U-Boot version will be loaded and run.
17
18Enabling Linux booting:
19-----------------------
20From U-Boot:
21=> setenv boot_os yes
22=> saveenv
23
24From Linux:
25$ fw_setenv boot_os yes
26
27Enabling U-Boot booting:
28------------------------
29From U-Boot:
30=> setenv boot_os no
31=> saveenv
32
33From Linux:
34$ fw_setenv boot_os no
35
36
37Preparing Linux image(s) for booting from SPL U-Boot:
38-----------------------------------------------------
39To boot the Linux kernel from the SPL, the DT blob (fdt) needs to get
40prepard/patched first. U-Boot usually inserts some dynamic values into
41the DT binary (blob), e.g. autodetected memory size, MAC addresses,
42clocks speeds etc. To generate this patched DT blob, you can use
43the following command:
44
451. Load fdt blob to SDRAM:
46=> tftp 1800000 a3m071/a3m071.dtb
47
482. Set bootargs as desired for Linux booting (e.g. flash_mtd):
49=> run mtdargs addip2 addtty
50
513. Use "fdt" commands to patch the DT blob:
52=> fdt addr 1800000
53=> fdt boardsetup
54=> fdt chosen
55
564. Display patched DT blob (optional):
57=> fdt print
58
595. Save fdt to NOR flash:
60=> erase fc060000 fc07ffff
61=> cp.b 1800000 fc060000 10000
62
63All this can be integrated into an environment command:
64=> setenv upd_fdt 'tftp 1800000 a3m071/a3m071.dtb;run mtdargs addip2 addtty; \
Stefan Roesed4451d32013-02-07 02:10:11 +000065 fdt addr 1800000;fdt boardsetup;fdt chosen;erase fc060000 fc07ffff; \
Stefan Roese13b4f632012-08-14 15:04:19 +020066 cp.b 1800000 fc060000 10000'
67=> saveenv
68
69After this, only "run upd_fdt" needs to get called to load, patch
70and save the DT blob into NOR flash.
71
72Additionally, the Linux kernel image has to be saved uncompressed in
73its uImage file (and not gzip compressed). This can be done with this
74command:
75
76$ mkimage -A ppc -O linux -T kernel -C none -a 0 -e 0 \
77 -n "Linux Kernel Image" -d vmlinux.bin uImage.uncompressed
78
79------------------------------------------------------------------------
80Stefan Roese, 2012-08-23