U-boot for lpc3250

Source: Internet
Author: User
After Linux 2.6.27.8 is installed with a new U-boot, the default parameters are few. You need to set and change the parameters according to your actual environment. Including IP addresses, Server IP addresses, gateways, file names, and even bootcmd. The following is the configured parameter: U-boot 1.3.3 (Feb 3 2009-10:03:29) DRAM: 64 mbnand: 32 mibin: serialout: serialerr: serialhit any key to stop autoboot: 0 uboot> bandwidth = 3 baudrate = 115200 ethaddr = de: ad: Be: EF: 00: 01 netmask = bandwidth = 192.168.1.1bootfile = uimageipaddr = 192.168.7.236serverip = bandwidth = 192.168.7.254bootcmd = tftpboot; bootmstdin = serialstdout = serialstderr = serial It is necessary to modify U-boot and add necessary default parameters to make it easier to use. Compile U-boot separately to download U-boot and patch to gppto download u-boot-1.3.tar.bz2 and u-boot-1.3.3-lpc32xx.patch. Assume that ~ /Home/U-boot directory. Patch to uncompress u-boot-1.3.tar.bz2, get the u-boot-1.3.3 directory, and then use the patch command to patch: [chenxibing @ localhost U-boot] $ cat u-boot-1.3.3-lpc32xx.patch | patch-P1-D u-boot-1.3.3 compile phy3250 U-boot for later compilation convenience, write a script for compiling U-boot, file Name: Build-uboot. The content is as follows :#! /Bin/sh Make arch = arm cross_compile =/opt/NXP/gcc-4.3.2-glibc-2.7/bin/ARM-VFP-Linux-GNU-phy3250_config Make arch = arm cross_compile =/opt/NXP/gcc-4.3.2-glibc-2.7 /bin/ARM-VFP-Linux-GNU-after adding executable permissions to build-uboot, run. $./Build-uboot added smartarm3250 Support added compilation items to modify makefile of the top-level directory, added the compilation item of smartarm3250, can refer to phy3250, add at NXP ARM926EJ-S systems.

2360 ####################################### ##################################

2361 # NXP ARM926EJ-S Systems

2362 ####################################### ##################################

2363

2364 phy3250_config: unconfig

2365 @ $ (mkconfig) $ (@: _ Config =) arm arm926ejs phy3250 null lpc3250

2366

2367 smartarm3250_config: unconfig

2368 @ $ (mkconfig) $ (@: _ Config =) arm arm926ejs smartarm3250 Zhiyuan lpc3250

In the preceding settings, you must create the Zhiyuan directory under the board directory, create the smartarm3250 directory, and store the on-board support files. Add the board-level directory, modify the Zhiyuan directory created under the board directory, and copy the reference directory board/phy3250 to Zhiyuan/smartarm3250. Modify phy3250 files to smartarm3250, and modify related files, such as makefile. Add the smartarm3250 configuration file to the include/configs/directory, which can be copied from phy3250.h and then modified. Compile and modify the compilation file and compile U-boot. If any problem occurs, modify the file. Some files may not have been modified, such as net. c In the smartarm3250 directory. The LED drive led2 is driven by gpo_06. Example of gpio operation for the lpc3250 in U-boot: 146 gpio-> p3_outp_clr = outp_state_gpio (5); 147 ssp_write (Out, bytes); 148 while (rbytes <bytes) 149 {150 rbytes + = ssp_read (& in [rbytes], 1); 151} 152 153 gpio-> p3_outp_set = outp_state_gpio (5 ); the gpio structure is defined in include/lpc3250.h: 1786/* macro pointing to gpio REGISTERS */1787 # define gpio (gpio_regs_t *) (gpio_base )) other definitions, such as slcnand and Mac, are available in lpc3250.h. The use of GPI, GPO, and gpio of the lpc3250 instance is complex and needs to be carefully performed in accordance with the user manual. For function reuse, you must first set the MUX register to select the function. However, the relationship between the pins and registers is messy and needs to be carefully compared. The following code controls led2 through gpo_06. First, set bit6 of the p3_mux_clr register to gpo_06, and then set p3_outp_set or p3_outp_clr register. For more information about port P3, see the gpio and MUX sections in the user manual. 156 gpio-> p3_mux_clr = 1 <6; // configure as gpo_06157 // gpio-> p3_outp_set = 1 <6; // output high level 158 gpio-> p3_outp_clr = 1 <6; // output low level NAND Flash Driver write protection gpio14 is write protection pin, low efficiency. Gpo_14 is a single function pin, only GPO function. NAND Flash and environment variables this version of U-boot stores the U-boot environment variable env in U-boot. Note: The storage address of environment variables must be in the unit of sectors (slice and block alignment); otherwise, the environment variables cannot be saved. File: Include/configs/Development Board. h: This is a parameter of phy3250. phy3250 adopts a 32 mb nand Flash with a sector size of 16 KB: 189/* phy3250's NAND Flash, 32 MB, and 16 K size (Block, sector) */190 // # define 1__env_size 0X4000/* 1 block, 16 K */191 // # define 1__env_offset 0x168000/* block 90 */The following is the smartarm3250 NAND Flash, k9f2g08, 256 MB, and the slice size is 128 K: 193/* smartarm3250's NAND Flash, k9f2g08, 256 MB, 128 K size (Block, Sector) */194 # define 1__env_size 0x40000 /* 2 block, 256 K */195 # define 1__env_offset 0x180000/* Block 12 */NAND Flash plan: partition address range: Sector range: Large or small use path bootloader 0x0000 0000 ~ 0x0018 0000 0 ~ 11 12 sectors, 1.50 m s1l and U-boot Param 0x0018 0000 ~ 0x001c 0000 12 ~ 13 2 sectors, 256 k u-boot parameter reserved 0x001c 0000 ~ 0x0020 0000 14 ~ 15 Linux kernel 0x0020 0000 ~ 0x0060 0000 16 ~ 47 32 sectors, 4.00 m Linux kernel safefs 0x0060 0000 ~ 0x0016 0000 48 ~ 176 128 sectors, 16 m Linux Security File System (cramfs) rootfs 0x0160 0000 ~ 0x1000 0000 176 ~ 2047-250 sectors,-16 m Linux File System

Rootfs 2047
176
-Sectors in total
Safefs 175
48
128 sectors
Kernel 47
16
32 sectors in total
Retained 15
14
2 sectors in total
Param 13 12 2 sectors in total
Bootlloader 11
0
12 sectors in total

Implementation Code in linux-2.6.27.8/ARCH/ARM/mach-lpc32xx/board-smartarm3250.c: 153 # define blk_size (0x20000) // 128kb154 static struct mtd_partition _ initdata smartarm3250_nand_partition [] = {155 {156. name = "smartarm3250-boot", 157. offsets = 0,158. size = (blk_size * 12) 159}, 160 {161. name = "smartarm3250-ubt-prms", 162. offset = (blk_size * 12), 163. size = (blk_size * 2) 164}, 165 {166. name = "smartarm3250-kernel", 167. offset = (blk_size * 16), 168. size = (blk_size * 32) 169}, 170 {171. name = "smartarm3250-rootfs", 172. offset = (blk_size * 48), 173. size = mtdpart_siz_full174}, 175}; after NXP, a patch is sent, modifying the value of cfg_load_addr of U-boot: 18/* 19 * default load address for programs 20 */21-# define loading _load_addr 0x80010000/* default load address */22 + # define loading _load_addr 0x80100000/* default Load address */parameter settings Note: The U-boot setting parameters of this version cannot be enclosed by quotation marks, otherwise, the parameter kernel cannot be started: setenv bootargs root =/dev/nfsroot console = tty0 console = ttys0, 115200n8 nfsroot = 192.168.7.231: /home/chenxibing/lpc3250/ltib/rootfs IP = 192.168.7.236: 192.168.7.1: 192.168.7.1: 255.255.255.0: NXP. z: eth0: Off

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.