u-boot-2011.06 transplant

Publisher:MeshulunLatest update time:2024-07-10 Source: elecfansKeywords:u-boot Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Although u-boot-2011.06 supports some common development boards, if u-boot-2011.06 does not support the development board we have, we need to find a development board that is closest to our development board and transplant it based on this development board. The smdk2410 development board supported by u-boot-2011.06 is the closest to my development board, so I modified and transplanted it based on this.

Before porting, we also need to install and configure eldk for compiling u-boot. Below we will introduce the installation and configuration of eldk:

1. Download eldk

Select any version of eldk at ftp://ftp.denx.de/pub/eldk/ and download it. I chose the arm-2008-11-24.iso file of eldk4.2. Download the file to the /home/zhaocj/download/ directory.

2. Install eldk with root privileges

Create a mount point:

mkdir /mnt/dvdrom

Mount the optical drive:

mount –o loop /home/zhaocj/download/arm-2008-11-24.iso/mnt/dvdrom

Install eldk:

cd /mnt/dvdrom

./install –d /opt/eldk4.2/

In this way, eldk is installed in the /opt/eldk4.2 directory.

3. Set environment variables

cd ~

gedit .bashrc

Add the following at the end:

export CROSS_COMPILE=arm-linux-

export PATH=/opt/eldk4.2/bin: /opt/eldk4.2/usr/bin:$PATH

Save and exit, then execute:

source .bashrc

Restart the computer to complete the installation of eldk.

The following is an introduction to the transplantation of u-boot-2011.06. Here I name my development board gq2440:

1. Download u-boot

Download the latest u-boot version (u-boot-2011.06.tar.bz2) from ftp://ftp.denx.de/pub/u-boot/ to my user home directory.

2. Unzip u-boot

cd ~

Unzip u-boot-2011.06 to the current directory

tar –xvjf u-boot-2011.06.tar.bz2

cd u-boot-2011.06

3. Add my development board information in u-boot

emacs boards.cfg

Open the boards.cfg file and add a line below line 70 (smdk2410 arm arm920t – samsung s3c24x0) with the following content:

gq2440 arm arm920t – samsung s3c24x0

Save and exit.

4. Add my development board header file by copying

cp include/configs/smdk2410.h include/configs/gq2440.h

5. Add my development board folder by copying

cp –r board/samsung/smdk2410 board/samsung/gq2440

Change the file name

mv board/samsung/gq2440/smdk2410.c board/samsung/gq2440/gq2440.c

Modify the Makefile

emacs board/samsung/gq2440/Makefile

Open the Makefile file and in line 28, change COBJS := smdk2410.o to:

COBJS:=gq2440.o

Save and exit.

6. Compile

make distclean

make gq2440_config

make

If the above process goes well, a new u-boot.bin file will appear in the u-boot directory.

2 NorFlash boot migration method

.Modify macro definition

Open include/configs/gq2440.h file

Change line 38 "#define CONFIG_S3C2410" to:

38: #define CONFIG_S3C2440

The purpose is to tell the system that this development board uses the S3C2440 processor.

Change line 131 "#define CONFIG_SYS_PROMPT "SMDK2410 # " to:

131: #define CONFIG_SYS_PROMPT "gq2440# "

The goal is to make the command line prompt display as "gq2440#".

Line 185 "#define CONFIG_FLASH_CFI_LEGACY" is changed to:

185: #define CONFIG_SYS_CFI_FLASH_CONFIG_REGS {0xFFFF}

Because in u-boot-2011.06, the NorFlash interface of CFI is used, there is no need to define CONFIG_FLASH_CFI_LEGACY, but CONFIG_SYS_CFI_FLASH_CONFIG_REGS.

Change line 191 "#define CONFIG_SYS_MAX_FLASH_SECT (19)" to:

191: #define CONFIG_SYS_MAX_FLASH_SECT (35)

Because the NorFlash used in this development board is EN29LV160AB, it has 35 sectors.

Change line 212 "#define CONFIG_NAND_S3C2410" to:

212: #define CONFIG_NAND_S3C2440

Change line 213 "#define CONFIG_SYS_S3C2410_NAND_HWECC" to:

213: #define CONFIG_SYS_S3C2440_NAND_HWECC

2. Modify the system clock frequency

Open the arch/arm/cpu/arm920t/start.s file

Change line 164 "# if defined(CONFIG_S3C2410)" to:

164: # if defined(CONFIG_S3C2440)

Line 165 "ldr r1, =0x3ff" is changed to:

165: ldr r1, =0x7fff

The purpose is to mask all sub-interrupts.

Change line 173 "mov r1, #3" to:

173: mov r1, #5

The purpose is to make FCLK:HCLK:PCLK = 1:4:8.

Open the board/samsung/gq2440/gq2440.c file

Change lines 42 to 44 to:

42: #define M_MDIV 92

43: #define M_PDIV 1

44: #define M_SDIV 1

The input crystal frequency of this development board is 12MHz. With the above modification, the MPLL frequency is 400MHz.

Change lines 54 to 56 to:

54: #define U_M_MDIV 56

55: #define U_M_PDIV 2

56: #define U_M_SDIV 2

With the above modification, the UPLL frequency is 48MHz.

3. Modify the memory SDRAM timing

Open the board/samsung/gq2440/lowlevel_init.s file

Change lines 54 to 126 to:

54: #define B1_BWSCON (DW16)

55: #define B2_BWSCON (DW16)

56: #define B3_BWSCON (DW16)

57: #define B4_BWSCON (DW32)

58: #define B5_BWSCON (DW16)

59: #define B6_BWSCON (DW32)

60: #define B7_BWSCON (DW32)

61:

62:

63: #define B0_Tacs 0x3

64: #define B0_Tcos 0x3

65: #define B0_Tacc 0x7

66: #define B0_Tcoh 0x3

67: #define B0_Tah 0x3

68: #define B0_Tacp 0x1

69: #define B0_PMC 0x0

70:

71:

72: #define B1_Tacs 0x1

73: #define B1_Tcos 0x1

74: #define B1_Tacc 0x6

75: #define B1_Tcoh 0x1

76: #define B1_Tah 0x1

77: #define B1_Tacp 0x0

78: #define B1_PMC 0x0

79:

80: #define B2_Tacs 0x1

81: #define B2_Tcos 0x1

82: #define B2_Tacc 0x6

83: #define B2_Tcoh 0x1

84: #define B2_Tah 0x1

85: #define B2_Tacp 0x0

86: #define B2_PMC 0x0

87:

88: #define B3_Tacs 0x1

89: #define B3_Tcos 0x1

90: #define B3_Tacc 0x6

91: #define B3_Tcoh 0x1

92: #define B3_Tah 0x1

93: #define B3_Tacp 0x0

94: #define B3_PMC 0x0

95:

96: #define B4_Tacs 0x1

97: #define B4_Tcos 0x1

98: #define B4_Tacc 0x6

99: #define B4_Tcoh 0x1

100: #define B4_Tah 0x1

101: #define B4_Tacp 0x0

102: #define B4_PMC 0x0

103:

104: #define B5_Tacs 0x1

105: #define B5_Tcos 0x1

106: #define B5_Tacc 0x6

107: #define B5_Tcoh 0x1

108: #define B5_Tah 0x1

109: #define B5_Tacp 0x0

110: #define B5_PMC 0x0

111:

112: #define B6_MT 0x3

113: #define B6_Trcd 0x1

114: #define B6_SCAN 0x1

115:

116: #define B7_MT 0x3

117: #define B7_Trcd 0x1

118: #define B7_SCAN 0x1

119:

120:

121: #define REFEN 0x1

122: #define TREFMD 0x0

123: #defineTrp 0x1

124: #defineTrc 0x1

125: #define Tchr 0x2

126: #define REFCNT 1268

4. Modify NandFlash related content.

Although NandFlash is not involved in this transplantation, the following content related to NandFlash must be modified in order to compile successfully.

Enter the u-boot-2011.06 directory and execute the following commands:

cp drivers/mtd/nand/s3c2410_nand.c drivers/mtd/nand/s3c2440_nand.c

Open the drivers/mtd/nand/s3c2440_nand.c file and change all references to "2410" to "2440".

Then open the drivers/mtd/nand/Makefile file

Change line 48 "COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o" to

48: COBJS-$(CONFIG_NAND_S3C2440) += s3c2440_nand.o

Compile u-boot and burn the new u-boot.bin generated by the compilation into NorFlash. After the development board is powered on, the result displayed in the hyperterminal (or similar software) is:

U-Boot 2011.06 (Jul 30 2011 - 23:40:44)

DRAM: 64 MiB

Flash: 2 MiB

NAND: raise: Signal # 8 caught

raise: Signal # 8 caught

raise: Signal # 8 caught

raise: Signal # 8 caught

raise: Signal # 8 caught

raise: Signal # 8 caught

No NAND device found!!!

0 MiB

*** Warning - bad CRC, using defaultenvironment

In: serial

Out: serial

Err: serial

Net: CS8900-0

gq2440#

From the above displayed content, we can see some basic information of this development board, such as DRAM is 64M, NorFlash is 2M. Since I did not set NandFlash, the system did not detect NandFlash, and the command prompt has been changed to "gq2440 #".

Enter flinfo at the prompt to display more detailed information about NorFlash:

Bank # 1: CFI conformant flash (16 x16) Size: 2 MB in 35 Sectors

AMDStandard command set, Manufacturer ID: 0x1C, Device ID: 0x2249

Erase timeout: 16384 ms, write timeout: 1 ms

Sector Start Addresses:

00000000 RO 00004000 RO 00006000 RO 00008000 RO 00010000 RO

00020000 RO 00030000 RO 00040000 RO 00050000 RO 00060000 RO

00070000 RO 00080000 00090000 000A0000 000B0000

000C0000 000D0000 000E0000 000F0000 00100000

00110000 00120000 00130000 00140000 00150000

00160000 00170000 00180000 00190000 001A0000

001B0000 001C0000 001D0000 001E0000 001F0000

3. Support NandFlash reading and writing

We copy the drivers/mtd/nand/s3c2410_nand.c file to s3c2440_nand.c file, and change all the places related to "2410" in the file to "2440". This modification only allows the system to compile successfully, but does not really realize the reading and writing of NandFlash. Here, we will introduce how to make u-boot support the reading and writing of NandFlash.

Since the NandFlash controllers of s3c2410 and s3c2440 are different, the s3c2440_nand.c file cannot be directly applied and needs to be modified appropriately. The main modification is the related registers of s3c2440.

First, redefine the registers to be used, remove the macro definitions between lines 27 to 37 in the original text, and change them to the following form:

#define S3C2440_NFCONT_SECCL (1<<6)

#define S3C2440_NFCONT_MECCL (1<<5)

#define S3C2440_NFCONT_INITECC (1<<4)

#define S3C2440_NFCONT_nCE (1<<1)

#define S3C2440_NFCONT_MODE (1<<0)

#define S3C2440_NFCONF_TACLS(x) ((x)<<12)

#define S3C2440_NFCONF_TWRPH0(x) ((x)<<8)

[1] [2] [3]
Keywords:u-boot Reference address:u-boot-2011.06 transplant

Previous article:ALSA sound card 10_Data transmission from scratch_Study notes
Next article:Camera driver learning

Recommended ReadingLatest update time:2024-11-14 15:45

Chapter 20, Tiny4412 U-BOOT transplant 20 Add cleanlcd command
1. Command format description There is a lot of information on how to use the command on the Internet. I will just briefly explain it here: Each command of U-Boot is defined by the U_Boot_CMD macro. This macro is defined in the include/command.h header file. As shown below: #ifdef CFG_LONGHELP #define U_BOOT_CMD(name,
[Microcontroller]
Chapter 20, Tiny4412 U-BOOT transplant 20 Add cleanlcd command
U-Boot transplantation (8) u-boot process
u-boot startup process:   From the file level, the main processes are in two files: cpu/arm920t/start.s, lib_arm/board.c,    1)start.s     The boot code executed in flash, which is stage1 in bootloader, is responsible for initializing the hardware environment, loading u-boot from flash into RAM, and then jumping to st
[Microcontroller]
u-boot-2011.03 porting on mini2440/micro2440 supports yaffs download
6.1 include/conskfigs/micro2440.h Add #define CONFIG_CMD_NAND_YAFFS 【illustrate】 When I was reading cmd_nand.c, I found that u-boot-2011.03 already supports yaffs writing. I only need to add the above definition, but the actual writing error occurred. After reading the source code again, I fou
[Microcontroller]
U-Boot-2011.03 transplant nandflash to mini2440
u-boot2011.03 supports s3c2440, and the registers are defined in s3c24x0_cpu.h in the arch/arm/includer/asm/ directory. The code contains the s3c2410 read and write nandflash functions, so it is modified based on s3c2410 U-Boot source code download address http://www.linuxidc.com/Linux/2011-07/38897.htm
[Microcontroller]
u-boot make_config execution process analysis
After downloading the uboot source code from the Internet, you need to modify the source code accordingly to support your own development board. After changing the source code, you need to configure uboot (make board_name _config). Here, we take the development board jz2440 of Baiwen.com as an example, and the confi
[Microcontroller]
OK6410A development board (three) 27 u-boot-2021.01 boot analysis U-boot image running part console
The console has nothing to do with input, only with output Model Both the serial port and LCD can be used as output, so it can be used as a console Output without console mechanism: Serial port Just use serial_puts to print information to the serial port Output without console mechanism: lcd Just use lcd_puts to
[Microcontroller]
[Linux bottom layer] u-boot EMMC driver
In the era of copycat phones, many young people may not be familiar with the fact that a SD card is installed on the phone for storage expansion. The current smartphones will have an EMMC chip soldered on the PCB board for large-capacity data storage, which is much more secure. If the phone is lost, there is no need t
[Microcontroller]
[Linux bottom layer] u-boot EMMC driver
1_5.1.2_U-boot analysis and use_u-boot analysis Makefile structure analysis_P
When we analyze a file, the best way is to look at its makefile. When we experienced compiling uboot before, our first step was to configure uboot and the second step was to compile. Analyze and configure uboot instructions The command used to configure uboot is make 100ask24x0_config. First find the Makefile, o
[Microcontroller]
1_5.1.2_U-boot analysis and use_u-boot analysis Makefile structure analysis_P
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号