Boot uClinux with U-boot

Source: Internet
Author: User
Tags network function
Some time ago, I was prepared to allow U-boot to support NAND flash, but it was ultimately fruitless. So I decided to put it first, let uClinux run first, and give myself some confidence. After reading some articles on the internet, I finally saw a cute prompt! Current configuration: CPU is bf561, software is uClinux-dist-2007R1.1-RC3, U-boot has been written to nor flash and can be started properly. 1. Unzip the uClinux-dist-2007R1.1-RC3 and use the default configuration of make menuconfig to generate an available image. Finally, the uimage. ext2 generated in the images directory has 3 MB. This is an image with a file header, which is also equivalent to the uimage mentioned in U-boot readme. 2. Because my board does not have the network function, I can only download it from the serial port using loadb, but it takes more than 20 minutes (57600) to download it at a time. This is a test of patience. Fortunately, the simulator directly writes the image to the position 0x0300 0000 (memory-> Fill) in the vdsp ). 3. Turn off the vdsp and start U-boot after reset. Use iminfo 0x0300 0000 to see the following information: gtw> iminfo 3000000 # Checking image at 03000000... image name: uClinux kernel and ext2 image type: Blackfin Linux kernel image (gzip compressed) data size: 3000041 bytes = 2.9 MB load address: 00001000 entry point: 00001000 verifying checksum... ok4. Use MD 0x0300 0000 to view the following information: gtw> MD 300000003000000: 56190527 e820c44f fa81f846 e9c62d00 '.. vo .. f.... -.. 03000010: 00100000 00100000 a9fdeb65 01021005 ........ E ....... 03000020: 696c4375 2078756e 6e000054b 61206c65 uClinux kernel a03000030: 6520646e 00327478 00000000 00000000 nd ext2 ......... this is the file header of the image. The 64 bytes correspond to the following data structure: # define ih_magic 0x27051956/* Image Magic Number */# define ih_nmlen 32/* image name length * // ** all data in network byte order (aka natural aka bigendian) */typedef struc T image_header {uint32_t ih_magic;/* image header magic number */uint32_t ih_hcrc;/* image header CRC checksum */uint32_t ih_time;/* image creation timestamp */uint32_t ih_size; /* image data size */uint32_t ih_load;/* data load address */uint32_t ih_ep;/* entry point address */uint32_t ih_dcrc; /* image data CRC checksum */uint8_t ih_ OS;/* Operating System */uint8_t ih_arch;/* CPU Architecture */uint8_t ih_type;/* image type */uint8_t ih_comp;/* compression type */uint8_t ih_name [ih_nmlen];/* image name */} image_header_t; use iminfo to display the content of this struct. 5. The following prompt is displayed during bootm 3000000 boot: gtw> bootm 3000000 # booting image at 03000000... image name: uClinux kernel and ext2 image type: Blackfin Linux kernel image (gzip compressed) data size: 3000041 bytes = 2.9 MB load address: 00001000 entry point: 00001000 verifying checksum... OK Uncompressing kernel image... okstarting kernel at = 1000 Linux version 2.6.19.3-ADI-2007R1.1-svn (wmz@localhost.localdomain) (GCC route 000000004.1.1 (ADI 07r1) #2 Tue Sep 25 11:24:43 CST 2007 warning: Limiting memory to 53 MB due to hardware anomaly 05000263 Blackfin support (c) 2004-2007 Analog Devices, Inc. compiled for ADSP-BF561 rev 0.3 Blackfin Linux support by http://blackfin.uclinux.org/Processor speed: 600 MHz core clock and 60 MHz system clockboard memory: 64 mbkernel managed memory: 64 mbmemory map: text = 0x00001000-0x000b 0db0 init = export data = export stack = 0x000c0000-0x000c2000 BSS = export available = export rootfs = export DMA zone = export cache enableddata cache enabled (write-through) Hardware trace enabledbuilt 1 zonelists. total pages: 13462 kernel command line: Root =/dev/mtdblock0 RW console = ttybf0, 57600 Init =/sbin/init refreshing ing Blackfin priority driven interruptspid hash table entries: 256 (Order: 8, 1024 bytes) dentry cache hash table entries: 8192 (Order: 3, 32768 bytes) inode-Cache hash table entries: 4096 (Order: 2, 16384 bytes) Physical pages: 3500 memory available: 52668 K/64771 k ram, (48 k init code, 703 K kernel code, 47 K data, 1024 k dma) Blackfin scratchpad data SRAM: 4 kbblackfin data_a SRA M: 16 kbblackfin data_ B SRAM: 16 kbblackfin instruction SRAM: 16 kbsecurity framework v1.0.0 initializedcapability LSM initializedmount-Cache hash table entries: 512 Blackfin gpio controllerblackfin DMA controllerezkit_init (): registering device resourcesbf561 core B driver v0.1 initialized. io scheduler Noop registeredio scheduler anticipatory registered (default) Io scheduler CFQ registeredserial: Blackfin serial driverbfin-uart.1: ttybf0 at mmio 0xffc00400 (IRQ = 35) is a BFIN-UARTRAMDISK driver initialized: 16 RAM disks of 4096 K size 1024 blocksizeuclinux [MTD]: ram probe address = 0x3500000 size = 0xa00000creating 1 MTD partitions on "Ram": 0x00000000-0x00a00000: "romfs" uClinux [MTD]: Set romfs: ext2 to be root filesystemvfs: mounted root (ext2 filesystem ). freeing unused kernel memory: 48 k free D (0xb1000-0xbc000) dma_alloc_init: dma_page @ 0x000b8000-256 pages at 0x03f00000no usable address families found. socket: function not implementedunable to create socketunable to create socket welcome: ____ _/__| | _ ____ _/| | // | _ | |__ | _ |/| ___/____ | _ | /____ |/_/| _ | for further INF Ormation see: http://www.uclinux.org/http://blackfin.uclinux.org/ busybox v1.4.1 (11:26:44 Cst) built-in Shell (MSH) Enter 'help' for a list of built-in commands. Root: ~> Unable to create socketunable to create socket... 6. Turn off the network-related options! 7. Last step: Write the uClinux image to norflash and set the environment variable setenv ramboot bootm 20030000 for U-boot to automatically boot to the uClinux prompt.

 

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.