The embedded linux Development uboot transplant ( 7、 ... and )—— Samsung official uboot Transplantation

     Friendly arm Smart210 The development board is based on Samsung SMDKV210 Evaluation board cutting 、 From adjustment . So Samsung's official announcement is based on SMDKV210 Evaluation Board uboot It 's transplantation uboot To Smart210 Development board is the most suitable uboot edition . This article will SMDKV210 Of uboot Migration to Smart210 Development board .Smart210 The configuration of the development board is as follows :

    SoC:Samsung S5PV210


        FLASH Storage :2G MLC NAND Flash

One 、uboot Tailoring of project catalogue

     because SMDKV210 Of uboot Is aimed at SPV210 Chip , also uboot There are a lot of problems in the project CPU The architecture and SoC The catalog of , Therefore, it is necessary to combine S5PV210 Irrelevant directory pruning delete . Deleted directory 、 Documents including :

1、uboot Project root directory and Smart210 Development board independent Directory

Delete the following directory onenand_ipl、onenand_bl1、lib_avr32、lib_blackfin、lib_i386、lib_m68k、lib_mips、lib_microblaze、lib_nios、lib_nios2、lib_ppc、lib_sh、lib_sparc.

2、board Directory and Smart210 Delete irrelevant Directory

   Delete board Division under directory samsung All directories except

3、cpu Directory and Smart210 Delete irrelevant Directory

Delete cpu Division under directory s5pc11x All the directories out of the directory

4、include Directory and Smart210 Delete irrelevant Directory

Delete include In the catalog asm-avr32、asm-blackfin、asm-i386、asm-m68k、asm-sh、asm-microblaze、asm-mips、asm-nios、asm-nios2、asm-ppc、asm-sparc Catalog

Delete include/aasm-arm In the catalog arch-arm720t、arch-arm925t、arch-arm926ejs、arch-at91rm9200、arch-at91sam9、arch-davinci、arch-imx、arch-ixp、arch-ks8695、arch-lpc2292、arch-mx31、arch-omap、arch-omap24xx、arch-pxa、arch-s3c24x0、arch-s3c24xx、arch-s3c44b0、arch-s3c64xx、arch-s5p64xx、arch-s5p644x、arch-s5pc1xx、arch-sa1100 Catalog

5、uboot Of Makefile File modification

find Makefile in arm Cross compiler related parts

ifeq ($(ARCH),arm)

#CROSS_COMPILE = arm-linux-

#CROSS_COMPILE = /usr/local/arm/4.4.1-eabi-cortex-a8/usr/bin/arm-linux-

#CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

CROSS_COMPILE = /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-


Modify the cross compiler :

ifeq ($(ARCH),arm)

CROSS_COMPILE = arm-linux-

#CROSS_COMPILE = /usr/local/arm/4.4.1-eabi-cortex-a8/usr/bin/arm-linux-

#CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

#CROSS_COMPILE = /usr/local/arm/arm-2009q3/bin/arm-none-linux-gnueabi-


6、 lookup Makefile China and Smart210 Related configuration

smdkv210single_config :unconfig

@$(MKCONFIG) $(@:_config=) arm s5pc11x smdkc110 samsung s5pc110

@echo "TEXT_BASE = 0xc3e00000" > $(obj)board/samsung/smdkc110/

Two 、uboot Transplantation of engineering projects

Through to uboot Project catalog tailoring ,Makefile The revision of the document is known ,uboot The command to compile the project is as follows :

make distclean;

make smdkv210single_config;

make -j4;

1、 After compiling the clipped Directory uboot engineering

In the face of uboot Edit and compile the project directory uboot:

make distclean;

make smdkv210single_config;

make -j4;

During the experiment, it was found that uboot Compile successfully , But the serial port doesn't output information , There is no alarm sound on the development board , The power light is normal , Indicates that the power supply latch is normal .

2、PMIC Module modification

Since the power supply latch of the development board is normal , Get into uboot In the project start.S Document access lowlevel_init Check the code after the power supply is locked , Find out Smart210 nothing PMIC modular , Annotate .

/* init PMIC chip */

//bl PMIC_InitIp

After compiling, I found that , There is still no serial port information output . Use to light up led The way the lights work is right uboot stay lowlevel_init Phase of the serial port initialization printing ’O’ and ’K’ The front and back are respectively added to light up led Lamp assembly code , Found four... Used as debugging Led All the lights are on . It shows that there is no problem with the initialization output of the serial port , However, it is not output to the current serial port connected to the development board .

3、 Modify the serial output

     Modify the header file of the development board configuration include/configs/smdkv210single.h

     Find the definition of serial port :

    #define CONFIG_SERIAL3          1/* we use UART1 on SMDKC110 */

     Find out SMDKV210 The development board uses serial port by default COM3 Output , and Smart210 Use COM0 Output , Need to change to :

    #define CONFIG_SERIAL1          1/* we use UART1 on Smart210 */

     Burn after compiling the project u-boot.bin To SD The card is up and running , Find out uboot It has been printed out normally uboot Start serial port information . however DRAM The size of the display is wrong .


U-Boot 1.3.4 (Jun 25 2016 - 03:29:22) for SMDKV210

CPU:  [email protected](OK)

        APLL = 1000MHz, HclkMsys = 200MHz, PclkMsys = 100MHz

        MPLL = 667MHz, EPLL = 80MHz

                       HclkDsys = 166MHz, PclkDsys = 83MHz

                       HclkPsys = 133MHz, PclkPsys = 66MHz

                       SCLKA2M  = 200MHz

Serial = CLKUART

Board:   SMDKV210

DRAM:     0 kB

Flash:   8 MB

SD/MMC:  7580MB

NAND:    512 MB

The input address don't need a virtual-to-physical translation : 23e9d2a0

*** Warning - using default environment


In:      serial

Out:     serial

Err:     serial

checking mode for fastboot ...

4、 Modify memory configuration information

Look up Smart210 The circuit diagram of the core board , find DDR The relevant part ,S5PV210 There are two memory ports , Respectively DRAM0 and DRAM1, The corresponding address range is as follows :





    Smart210 There are four development boards 128MB The memory chip of , Each chip has 14 Root address line Xm1ADDR[13:0],8 Data line Xm1DATA[7:0], The rest are control buses .



After four memory chips are connected in parallel, they are only one memory chip in logic , The size is 512MB, The data line is Xm1DATA[31:0], The address line doesn't change Xm1ADDR[13:0]. according to DRAM The chip selection pin of the schematic diagram nCS、CKE、nWE Choose to know ,smart210 Four memory chips of the development board are connected to DMC0.


Modify the development board header file include/configs/smdkv210single.h Configuration information :

#define MEMORY_BASE_ADDRESS      0x20000000

#define DMC0_MEMCONTROL         0x00202400

#define DMC0_MEMCONFIG_0         0x20E00323

#define DMC0_MEMCONFIG_1         0x40F00323

#define DMC1_MEMCONTROL          0x00202400

#define DMC1_MEMCONFIG_0         0x40F00313

#define DMC1_MEMCONFIG_1         0x00F00313

#define SDRAM_BANK_SIZE          0x20000000  /* 512 MB */

#define CONFIG_NR_DRAM_BANKS    1        /* we have 1 bank of DRAM */

#if 0




modify cpu/s5pc11x/s5pc110/cpu_init.S file :

ldr  r1, =0x00212400 //122 That's ok

   Change it to be in smdkv210single.h The contents defined in the header file :



5、 The porting of NIC driver

     according to Smart210 Develop the circuit diagram of the board DM9000 The circuit diagram of the network card shows that ,DM9000 The selection line of the film CS# Got it S5PV210 Of CSn1, namely SROMC_BANK1, The base address is 0x88000000.DM9000 Of CMD Got the address line ADDR2, visit DM9000 The address of the data 0x88000000+0b100(0x8,ADDR2 High level 1).DM9000 Data line and address line multiplexing , according to CMD The level signal of the pin determines whether data or address is transmitted ,CMD For high level, for transmission data ,CMD Transmit address for low level .

The schematic diagram of network card circuit is as follows :


modify uboot Development board configuration header file include/configs/smdkv210single.h

#define CONFIG_DM9000_BASE(0xA8000000)

#define DM9000_DATA(CONFIG_DM9000_BASE+2)

   It is amended as follows :

#define CONFIG_DM9000_BASE(0x88000000)

#define DM9000_DATA(CONFIG_DM9000_BASE+8)

Yes DM9000 Network card initialization :

     According to Samsung's official documents S5PV210_UM_REV1.1 Medium SROM Controller modification board/samsung/smdkc110/smdkc110.c In file dm9000_pre_init function

static void dm9000_pre_init(void)


unsigned int tmp;

#if defined(DM9000_16BIT_DATA)

//SROM_BW_REG &= ~(0xf << 20);

SROM_BW_REG &= ~(0xf << 4);

SROM_BW_REG |= (0x1 << 4);

//SROM_BW_REG |= (0<<23) | (0<<22) | (0<<21) | (1<<20);


SROM_BW_REG &= ~(0xf << 20);

SROM_BW_REG |= (0<<19) | (0<<18) | (0<<16);


//SROM_BC5_REG = ((0<<28)|(1<<24)|(5<<16)|(1<<12)|(4<<8)|(6<<4)|(0<<0));

SROM_BC1_REG = ((0<<28)|(0<<24)|(5<<16)|(0<<12)|(0<<8)|(0<<4)|(0<<0));

tmp = MP01CON_REG;

//tmp &=~(0xf<<20);

tmp &=~(0xf<<4);

//tmp |=(2<<20);

tmp |=(2<<4);

MP01CON_REG = tmp;




S5PV210 The address allocation table of :


This article mainly elaborated will Samsung SMDKV210 Development board version uboot Migration to Smart210 The process of developing boards , But relatively crude , If you need more sophisticated transplantation, you need to do more in-depth research .