xref: /OK3568_Linux_fs/u-boot/doc/README.kwbimage (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun---------------------------------------------
2*4882a593SmuzhiyunKirkwood Boot Image generation using mkimage
3*4882a593Smuzhiyun---------------------------------------------
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunThis document describes the U-Boot feature as it
6*4882a593Smuzhiyunis implemented for the Kirkwood family of SoCs.
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunThe Kirkwood SoC's can boot directly from NAND FLASH,
9*4882a593SmuzhiyunSPI FLASH, SATA etc. using its internal bootRom support.
10*4882a593Smuzhiyun
11*4882a593Smuzhiyunfor more details refer section 24.2 of Kirkwood functional specifications.
12*4882a593Smuzhiyunref: www.marvell.com/products/embedded.../kirkwood/index.jsp
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunCommand syntax:
15*4882a593Smuzhiyun--------------
16*4882a593Smuzhiyun./tools/mkimage -l <kwboot_file>
17*4882a593Smuzhiyun		to list the kwb image file details
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun./tools/mkimage -n <board specific configuration file> \
20*4882a593Smuzhiyun		-T kwbimage -a <start address> -e <execution address> \
21*4882a593Smuzhiyun		-d <input_raw_binary> <output_kwboot_file>
22*4882a593Smuzhiyun
23*4882a593Smuzhiyunfor ex.
24*4882a593Smuzhiyun./tools/mkimage -n ./board/Marvell/openrd_base/kwbimage.cfg \
25*4882a593Smuzhiyun		-T kwbimage -a 0x00600000 -e 0x00600000 \
26*4882a593Smuzhiyun		-d u-boot.bin u-boot.kwb
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun
29*4882a593Smuzhiyunkwbimage support available with mkimage utility will generate kirkwood boot
30*4882a593Smuzhiyunimage that can be flashed on the board NAND/SPI flash.  The make target
31*4882a593Smuzhiyunwhich uses mkimage to produce such an image is "u-boot.kwb".  For example:
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun  export KBUILD_OUTPUT=/tmp/build
34*4882a593Smuzhiyun  make distclean
35*4882a593Smuzhiyun  make yourboard_config
36*4882a593Smuzhiyun  make u-boot.kwb
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunBoard specific configuration file specifications:
40*4882a593Smuzhiyun------------------------------------------------
41*4882a593Smuzhiyun1. This file must present in the $(BOARDDIR).  The default name is
42*4882a593Smuzhiyun	kwbimage.cfg.  The name can be set as part of the full path
43*4882a593Smuzhiyun	to the file using CONFIG_SYS_KWD_CONFIG (probably in
44*4882a593Smuzhiyun	include/configs/<yourboard>.h).   The path should look like:
45*4882a593Smuzhiyun	$(CONFIG_BOARDDIR)/<yourkwbimagename>.cfg
46*4882a593Smuzhiyun2. This file can have empty lines and lines starting with "#" as first
47*4882a593Smuzhiyun	character to put comments
48*4882a593Smuzhiyun3. This file can have configuration command lines as mentioned below,
49*4882a593Smuzhiyun	any other information in this file is treated as invalid.
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunConfiguration command line syntax:
52*4882a593Smuzhiyun---------------------------------
53*4882a593Smuzhiyun1. Each command line is must have two strings, first one command or address
54*4882a593Smuzhiyun	and second one data string
55*4882a593Smuzhiyun2. Following are the valid command strings and associated data strings:-
56*4882a593Smuzhiyun	Command string		data string
57*4882a593Smuzhiyun	--------------		-----------
58*4882a593Smuzhiyun	BOOT_FROM		nand/spi/sata
59*4882a593Smuzhiyun	NAND_ECC_MODE		default/rs/hamming/disabled
60*4882a593Smuzhiyun	NAND_PAGE_SIZE		any uint16_t hex value
61*4882a593Smuzhiyun	SATA_PIO_MODE		any uint32_t hex value
62*4882a593Smuzhiyun	DDR_INIT_DELAY		any uint32_t hex value
63*4882a593Smuzhiyun	DATA			regaddr and regdara hex value
64*4882a593Smuzhiyun	you can have maximum 55 such register programming commands
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun3. All commands are optional to program
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunTypical example of kwimage.cfg file:
69*4882a593Smuzhiyun-----------------------------------
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun# Boot Media configurations
72*4882a593SmuzhiyunBOOT_FROM	nand
73*4882a593SmuzhiyunNAND_ECC_MODE	default
74*4882a593SmuzhiyunNAND_PAGE_SIZE	0x0800
75*4882a593Smuzhiyun
76*4882a593Smuzhiyun# Configure RGMII-0 interface pad voltage to 1.8V
77*4882a593SmuzhiyunDATA 0xFFD100e0 0x1b1b1b9b
78*4882a593Smuzhiyun# DRAM Configuration
79*4882a593SmuzhiyunDATA 0xFFD01400 0x43000c30
80*4882a593SmuzhiyunDATA 0xFFD01404 0x37543000
81*4882a593SmuzhiyunDATA 0xFFD01408 0x22125451
82*4882a593SmuzhiyunDATA 0xFFD0140C 0x00000a33
83*4882a593SmuzhiyunDATA 0xFFD01410 0x000000cc
84*4882a593SmuzhiyunDATA 0xFFD01414 0x00000000
85*4882a593SmuzhiyunDATA 0xFFD01418 0x00000000
86*4882a593SmuzhiyunDATA 0xFFD0141C 0x00000C52
87*4882a593SmuzhiyunDATA 0xFFD01420 0x00000040
88*4882a593SmuzhiyunDATA 0xFFD01424 0x0000F17F
89*4882a593SmuzhiyunDATA 0xFFD01428 0x00085520
90*4882a593SmuzhiyunDATA 0xFFD0147C 0x00008552
91*4882a593SmuzhiyunDATA 0xFFD01504 0x0FFFFFF1
92*4882a593SmuzhiyunDATA 0xFFD01508 0x10000000
93*4882a593SmuzhiyunDATA 0xFFD0150C 0x0FFFFFF5
94*4882a593SmuzhiyunDATA 0xFFD01514 0x00000000
95*4882a593SmuzhiyunDATA 0xFFD0151C 0x00000000
96*4882a593SmuzhiyunDATA 0xFFD01494 0x00030000
97*4882a593SmuzhiyunDATA 0xFFD01498 0x00000000
98*4882a593SmuzhiyunDATA 0xFFD0149C 0x0000E803
99*4882a593SmuzhiyunDATA 0xFFD01480 0x00000001
100*4882a593Smuzhiyun# End of Header extension
101*4882a593SmuzhiyunDATA 0x0 0x0
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun------------------------------------------------
104*4882a593SmuzhiyunAuthor: Prafulla Wadaskar <prafulla@marvell.com>
105