Device tree jz2440 development environment mirror description


    #Programming step 1. Use EOP to program u-boot.bin to the nor flash or nand flash of JZ2440
    2. Start u-boot, enter the corresponding menu command in the serial port tool, and use dnw_100ask.exe to send the corresponding file

                Menu File to be sent
        [k] Download Linux kernel uImage uImage
        [t] Download device tree file(.dtb) jz2440.dtb
        [y] Download root_yaffs image fs_mini_mdev_new.yaffs2

    3. After programming, you can restart to enter the on-board LINUX system.
    
    
    
1. The choice of compiler:
a complete Linux system consists of three parts: u-boot, kernel, root filesystem.
a. For u-boot:
we still use u-boot 1.1.6, in this version we have achieved a lot Function: USB download, menu operation, network card is always enabled, etc., can't bear to discard it.

b. For the kernel:
I downloaded the latest kernel (4.19) currently (2018.09.19)

c. For root filesystem
named "root file system" in Chinese, it contains some necessary APPs and some dynamic libraries.
Generally speaking, these dynamic libraries are copied from the lib directory in the tool chain.
Of course, you can also compile libraries such as glibc yourself.

When compiling u-boot and kernel, we can use the new tool chain, 
as long as the tool chain supports the ARM9 instruction set (armv4) (this can usually be specified by the compilation parameter to use a specific instruction set). The
tool chain can Download from some websites, you don’t need to make it yourself.
For example, you can visit this website: https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/arm-linux-gnueabi/
Download: gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi. tar.xz

But when making the root file system, we actually compile all kinds of APPs. 
These APPs need some dynamic libraries. For convenience, the libraries in the lib directory in the tool chain are generally used directly.
The lib library of the new version of the tool chain generally supports new chips, such as cortex A7, A8, and A9, but does not support ARM9.
So when making the root file system and compiling the APP, we have to use an older tool chain: arm-linux-gcc-4.3.2.tar.bz2


2. Choose to use a toolchain by setting the PATH environment variable:
2.1 Install the toolchain:
    this is very simple, just unzip it:
    sudo tar xjf arm-linux-gcc-4.3.2.tar.bz2 -C / (unzip to The root directory, /usr/local/arm/4.3.2/bin/ is the tool chain)
    tar xJf gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz (unzip to the current directory, assuming / work/system/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin is the tool chain)
    
    Note: Please replace "/work/system" with your actual directory by yourself
    
2.2 Set environment variables and use a tool Chain:
a. To use arm-linux-gcc 4.3.2, execute the following command:
    export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/ bin:/usr/games:/usr/local/games:/usr/local/arm/4.3.2/bin
   Then you can execute arm-linux-gcc -v to see the version number

b. To use arm-linux-gnueabi-gcc 4.9.4, execute the following command:
    export PATH=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin :/bin:/usr/games:/work/system/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi/bin
   Then you can execute arm-linux-gnueabi-gcc -v to see the version number
   


2. U-boot compilation:
a. First set the environment variables to use arm-linux-gnueabi-gcc 4.3.2
b. 
Put the source file u-boot-1.1.6.tar.bz2, the patch file u-boot- 1.1.6_device_tree_for_jz2440.patch is placed in the same directory,
execute the following command:
tar xjf u-boot-1.1.6.tar.bz2 // Unzip
cd u-boot-1.1.6
patch -p1 <../ u-                   boot- 1.1.6_device_tree_for_jz2440.patch // patch
make 100ask24x0_config // configure
make // compile, you can get u-boot.bin

3. Kernel compilation:
a. First set the environment variables to use arm-linux-gnueabi-gcc 4.3.2
b. 
Put the source file linux-4.19-rc3.tar.gz and the patch file linux-4.19-rc3_device_tree_for_jz2440.patch In the same directory,
execute the following command:
tar xzf linux-4.19-rc3.tar.gz // Unzip
cd linux-4.19-rc3
patch -p1 <../ linux-4.19-                   rc3_device_tree_for_jz2440.patch // Patch
cp config_ok. config // configure
make uImage // compile, you can get arch/arm/boot/uImage
make dtbs // compile, you can get arch/arm/boot/dts/jz2440.dtb

Note: 
a. If it prompts "mkimage not found", first compile u-boot and copy tools/mkimage to the /bin directory
. b. If it prompts "openssl/bio.h: No such file or directory",
   first make sure your ubuntu can    Go online, and execute the following command:
   sudo apt-get update
sudo apt-get install libssl-dev
   
4. Make root filesystem: 
   You can use the image file directly: fs_mini_mdev_new.yaffs 2   
   
   If you want to make it yourself, please refer to the video: 
   from www.100ask. Open the Baidu network disk
   on the net download page and open the following directory:
        All files shared by
            100ask 009_UBOOT transplantation_LINUX transplantation_driver transplantation (free)
                graduating class lesson 3_ transplantation 3.4.2 kernel
                    graduating class lesson 3 section 2_ transplantation 3.4 .2 Modify partition of kernel and make root file system. WMV

 

5.
Burning a. Use EOP to burn u-boot.bin to the nor flash or nand flash of JZ2440
b. Start u-boot, enter the corresponding menu command in the serial port tool, and use dnw_100ask.exe to send the corresponding file
   
       menu to send File
[k] Download Linux kernel uImage uImage
[t] Download device tree file(.dtb) jz2440.dtb
[y] Download root_yaffs image fs_mini_mdev_new.yaffs2

   After programming, you can restart to enter the on-board LINUX system.
   

 


 

Guess you like

Origin blog.csdn.net/sunxiaopengsun/article/details/114205024