S3C6410 Embedded Application Platform Construction (IV) - Linux-3.14.4 Ported to OK6410 (Preliminary Startup)

Publisher:SereneVoyageLatest update time:2024-09-12 Source: elecfansKeywords:S3C6410  OK6410 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This time, I will port the basic Linux source code to OK6410. At the same time, I will also write down the problems I encountered and their solutions during the porting process. However, some methods are borrowed from the Internet, and some are added by myself, so there will be some minor bugs.

1. Basic Work

1. Download the source code from https://www.kernel.org/ . It is best to download the stable version, otherwise there will be minor bugs. (I am currently debugging the stable version, linux-3.14.4)

2. Copy it to your own folder and unzip it. I downloaded it with the .xz suffix, so the file is smaller, but there is just one more step when unzipping.

$ xz –d linux-3.14.4.tar.xz

$ tar xvf linux-3.14.4.tar

3. After decompression, enter the decompressed directory

2. Source code modification

1. Modify the Makefile in the root directory to modify arch and cross_compile as follows:

ARCH ?= arm
CROSS_COMPILE ?= arm-linux-

2. Add relevant model mach files

At present, the latest kernel has supported several development boards. We start with the most basic 6410 and choose mini6410. We modify the configuration based on mini6410. Therefore, enter the arch/arm/mach-s3c64xx directory, copy mach-mini6410.c, and rename it to mach-ok6410.c. The following file needs to be modified:

2.1 Replace the code with 6410, as follows: mini6410->ok6410; MINI6410->OK6410

2.2 Then modify the nand partition information, modify the static struct mtd_partition ok6410_nand_part[]. This modification needs to be combined with your previous Uboot transplantation and your own defined partition layout. Mine is like this.


2.3 Since we have added a file, according to the rules of adding files in Linux, we also modify the Makefile and Kconfig in the corresponding directory

Modify kconfig, refer to the configuration of MINI6410, and add OK6410 as follows:


Modify Makefile and add ok6410


3. Modify the arch/arm/tools/mach-types file and add the OK6410 mach-type. This must be consistent with the MACH-TYPE in U-BOOT. Here, select smdk6410 mach-type: 1626


4. Menuconfig configuration

Back to the main directory, we choose the default configuration for 6400 and configure it based on it. Copy s3c6400_defconfig under config to the main directory and rename it to .config file

$ cp arch/arm/configs/s3c6400_defconfig ./.config
$ make menuconfig

After entering, make the following configuration: (Here is a note: in this case, to delete your input, you need to press delete+shift, pressing backspace is useless)


4.1 Select General Setup, open Cross_compiler tool perfix, and enter arm-linux-

image
4.4 Select System Type, cancel other 6410 and select only OK6410

image

4.3 Select Kernel Features and select the following two options:

image

4.4 For debugging convenience, we also turn on the debug of nand flash and select hardware ECC.

Device Drivers—>Memory Technology Device(MTD) support—>NAND Device Support—>

image

After completing the above configuration, save and exit!

Execute in the main directory, make uImage (the premise is that you have copied the mkimage tool under Uboot tools/ to the /bin directory)

Finally, after the compilation is completed, the output information is as follows:

image

Download it to the board via tftp, and the interface after running is as follows:

image

From the above we can see that the kernel loading address and the entry address are the same: 50008000, which is unreasonable. The entry address should be 50008000. Because it is uImage, a file header needs to be added at the entry.

Therefore we make the following changes:

Modify the makefile.lib file under scripts/: Change UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) to:

IMAGE_ENTRYADDR ?= $(shell echo $(UIMAGE_LOADADDR) | sed -e "s/..$$/40/")


# U-Boot mkimage

#------------------------------------------------ --------------------------


MKIMAGE := $(srctree)/scripts/mkuboot.sh


# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces

# the number of overrides in arch makefiles

UIMAGE_ARCH ?= $(SRCARCH)

UIMAGE_COMPRESSION ?= $(if $(2),$(2),none)

UIMAGE_OPTS-y ?=

UIMAGE_TYPE ?= kernel

UIMAGE_LOADADDR ?= arch_must_set_this

#UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR)

UIMAGE_ENTRYADDR ?= $(shell echo $(UIMAGE_LOADADDR) | sed -e "s/..$$/40/")

UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)'

UIMAGE_IN ?= $<

UIMAGE_OUT ?= $@

After modification, make uImage again, the output information after compilation is as follows:

image

From the above we can see that the entry address has changed to 50008040,


After downloading to the board, the kernel can be booted.


From the log, we can see that our nand flash is not recognized because the error is here:


[06/08-11:25:41:371]s3c24xx-nand s3c6400-nand: failed to get clock


[06/08-11:25:41:371]s3c24xx-nand: probe of s3c6400-nand failed with error –2


For the convenience of reading, I will write it in the next article. This problem needs to be solved at present.


The complete startup log is as follows:


[06/08-11:25:33:478]U-Boot 2010.03-svn3 (May 06 2014 - 22:13:20) for SMDK6410

[06/08-11:25:33:478]

[06/08-11:25:33:478]**************************************** ******************

[06/08-11:25:33:492] Welcome to Embedded System

[06/08-11:25:33:494] Base On S3C6410 Devopment

[06/08-11:25:33:494] Date: 2014/4/15 22:00 PM

[06/08-11:25:33:503]****************************************** ******************

[06/08-11:25:33:503]

[06/08-11:25:33:504]CPU: S3C6410@533MHz

[06/08-11:25:33:531] Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)

[06/08-11:25:33:531]Board: SMDK6410

[06/08-11:25:33:533]DRAM: 256 MB

[06/08-11:25:33:549]Flash: 0 kB

[06/08-11:25:33:549]NAND Flash: 2048 MB

[06/08-11:25:34:671]**************************************** *********************

[06/08-11:25:34:671]Initial LCD controller

[06/08-11:25:34:684] clk_freq:9 MHz, div_freq:13,rea_freq:9 MHz

[06/08-11:25:34:684]

[06/08-11:25:34:685] HBP = 2 HFP = 2 HSW = 41,Hpixs:480

[06/08-11:25:34:685] VBP = 2 VFP = 2 VSW = 10,Vpixs:272

[06/08-11:25:34:703]FrameBuff:57e7a000

[06/08-11:25:34:703] LCD initialization Finished.

[06/08-11:25:34:704]**************************************** *********************

[06/08-11:25:34:724]In: serial

[06/08-11:25:34:724]

[06/08-11:25:34:724]Out: lcd

[06/08-11:25:34:726]

[06/08-11:25:34:726]Err: lcd

[06/08-11:25:34:728]

[06/08-11:25:35:082]Net: DM9000

[06/08-11:25:36:099]Hit any key to stop autoboot: 0

[06/08-11:25:36:099]

[06/08-11:25:36:099]NAND read:

[06/08-11:25:36:100]device 0 offset 0x100000, size 0x500000

[06/08-11:25:36:101]

[06/08-11:25:39:365] 5242880 bytes read: OK

[06/08-11:25:39:365]

[06/08-11:25:39:365]## Booting kernel from Legacy Image at 50008000 ...

[06/08-11:25:39:365]

[06/08-11:25:39:367] Image Name: Linux-3.14.4

[06/08-11:25:39:383]

[06/08-11:25:39:385] Image Type: ARM Linux Kernel Image (uncompressed)

[06/08-11:25:39:402]

[06/08-11:25:39:403] Data Size: 1638488 Bytes = 1.6 MB

[06/08-11:25:39:418]

[06/08-11:25:39:419] Load Address: 50008000

[06/08-11:25:39:443]

[06/08-11:25:39:443] Entry Point: 50008040

[06/08-11:25:39:456]

[06/08-11:25:39:780] Verifying Checksum ... OK

[06/08-11:25:39:798]

[06/08-11:25:39:799] XIP Kernel Image ... OK

[06/08-11:25:39:811]

[06/08-11:25:39:812]OK

[06/08-11:25:39:829]

[06/08-11:25:39:830]

[06/08-11:25:39:830]Starting kernel...

[06/08-11:25:39:830]

[06/08-11:25:39:842]

[06/08-11:25:39:860]

[06/08-11:25:39:874]

[06/08-11:25:40:162]Uncompressing Linux... done, booting the kernel.

[06/08-11:25:40:960]Booting Linux on physical CPU 0x0

[06/08-11:25:40:972]Linux version 3.14.4 (simiar@Embedded) (gcc version 4.4.3 (ctng-1.6.1) ) #1 Sun Jun 8 11:10:52 CST 2014

[06/08-11:25:40:976]CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d

[06/08-11:25:40:984]CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

[06/08-11:25:40:984]Machine: OK6410

[06/08-11:25:40:985]Ignoring unrecognized tag 0x54410008

[06/08-11:25:40:995]Memory policy: Data cache writeback

[06/08-11:25:40:995]CPU S3C6410 (id 0x36410101)

[06/08-11:25:40:995]CPU: found DTCM0 8k @ 00000000, not enabled

[06/08-11:25:40:996]CPU: moved DTCM0 8k to fffe8000, enabled

[06/08-11:25:41:006]CPU: found DTCM1 8k @ 00000000, not enabled

[06/08-11:25:41:006]CPU: moved DTCM1 8k to fffea000, enabled

[06/08-11:25:41:006]CPU: found ITCM0 8k @ 00000000, not enabled

[06/08-11:25:41:017]CPU: moved ITCM0 8k to fffe0000, enabled

[06/08-11:25:41:017]CPU: found ITCM1 8k @ 00000000, not enabled

[06/08-11:25:41:018]CPU: moved ITCM1 8k to fffe2000, enabled

[06/08-11:25:41:027]Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024

[06/08-11:25:41:038]Kernel command line: root=/dev/nfs nfsroot=192.168.1.100:/home/simiar/share/myproject/ok6410/filesystem/ok6410_fs ip=192.168.1.50:192.168 .1.100:192.168.1.1:255.255.255.0::eth0:off console=ttySAC0,115200

[06/08-11:25:41:050]PID hash table entries: 1024 (order: 0, 4096 bytes)

[06/08-11:25:41:061]Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

[06/08-11:25:41:061]Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

[06/08-11:25:41:077]Memory: 256464K/262144K available (2173K kernel code, 175K rwdata, 664K rodata, 118K init, 198K bss, 5680K reserved)

[06/08-11:25:41:080]Virtual kernel memory layout:

[06/08-11:25:41:084] vector: 0xffff0000 - 0xffff1000 (4 kB)

[06/08-11:25:41:084] DTCM: 0xfffe8000 - 0xfffec000 (16 kB)

[06/08-11:25:41:085] ITCM: 0xfffe0000 - 0xfffe4000 (16 kB)

[06/08-11:25:41:094] fixmap: 0xfff00000 - 0xfffe0000 (896 kB)

[06/08-11:25:41:095] vmalloc: 0xd0800000 - 0xff000000 (744 MB)

[1] [2]
Keywords:S3C6410  OK6410 Reference address:S3C6410 Embedded Application Platform Construction (IV) - Linux-3.14.4 Ported to OK6410 (Preliminary Startup)

Previous article:S3C6410 Embedded Application Platform Construction (V) - Linux-3.14.4 Ported to OK6410-(Nand Partition Problem)
Next article:S3C6410 Embedded Application Platform Construction (Part 3)

Recommended ReadingLatest update time:2024-11-23 08:31

JLink+GDBServer debugs the initialization code of S3C6410 bare board For OK6410 development board
There are two initialization methods for debugging bare boards. One is to use the burned uboot for initialization, and the other is to use JLink+GDBServer for initialization. The code refers to the information on the Internet and is modified according to the OK6410 development board at hand. The overall code is as f
[Microcontroller]
Honor Magic4 Pro uses NXP's SN110 eSIM solution
Recently, NXP said that the company's SN110 series eSIM helps Honor smartphone applications in Europe and other overseas markets, and can perform multiple mobile services at the same time. GSMA-compliant and certified eSIM solutions make it fundamentally easier for device manufacturers to provide consumers with cellul
[Mobile phone portable]
ADIADuM42235KVrms isolated 4A output half-bridge driver solution
Switching power supplies, isolated IGBT/MOSFET gate drivers, and industrial inverters. This article describes the ADuM3223/ADuM4223 key features, functional block diagram, evaluation board EVAL-ADuM4223AEBZ key features, circuit diagram, bill of materials, and PCB layout. The ADuM3223/ADuM4223 provides 3000 V rms isol
[Power Management]
ADIADuM42235KVrms isolated 4A output half-bridge driver solution
Intel processor identification tool admits that the 14th generation of Intel Core is just a fake
Intel will release the next generation of Core later this year and introduce the new Core Ultra brand for the first time, while retaining Core i and Core, which is quite confusing. The product level is also a mess, with new and old mixed together, including the new Meteor Lake and the upgraded version of Raptor Lake
[Embedded]
Intel processor identification tool admits that the 14th generation of Intel Core is just a fake
PB3, PB4, PA13, PA14, PA15 are used as special configurations of common IO ports
Recently, a blogger made a temperature measurement and control module using STM32F103C8T6, using PB3, PB4, PA15 and other pins to control peripherals. It was found that no matter how to configure, these three pins cannot be set to zero. Later, it was discovered that PB3, PB4, PA13, PA14, and PA15, including these thre
[Microcontroller]
stm32f4 DMA arbitrary length buffer non-pause transmission
Recently, I was free and played with an f407 development board I built before, doing some pattern recognition at VGA resolution. My board has 2 megabytes of SRAM. I used QVGA as the image source before, and the algorithm could run at 15 frames, which was pretty good. My method was to DMA the dcmi data to the external
[Microcontroller]
STM32F4 LAN8720 and LWIP porting and debugging records (2)
background After the hardware engineer completed the PCB and schematic design, the routine was modified according to the tutorial of Zhengdian Atom to verify the correctness of the hardware.  STM32F407 and LAN8720 debugging records .  Zhengdian Atom network communication experiment The next step is to implement the
[Microcontroller]
Transplant madplay on ok6410
The cross-compilation process is the same as the previous one, but some modifications need to be made during configuration. 1. Install zlib Compile zlib with the cross-compilation tool and generate the library into the library directory of the cross-compilation environment ./configure --prefix=/usr/lo
[Microcontroller]
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号