ARM9: How to port linux2.6.38 kernel to TQ2440

Publisher:古泉痴迷者Latest update time:2018-11-26 Source: eefocusKeywords:ARM9  linux2  6  TQ2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  The following are the specific steps for porting the Linux 2.6.38 kernel to TQ2440:


  1. Modify the Makefile in the root directory ARCH=arm, CROSS-COMPILE=arm-linux-


  2. In arch/arm/mach-s3c2440/mach-smdk2440.c, change s3c24xx_init_clocks(16934400) in line 163 to s3c24xx_init_clocks(12000000).


  3. Change 362 in line 379 of arch/arm/tools/mach-types to 168, because the machine code defined in uboot is 168.


  4. Modify the Makefile file in arch/arm/boot/ and add @cp -f arch/arm/boot/zImage zImage.bin in line 58 to copy the generated zImage file to the kernel source code root directory.


  5. Add rm -f zImage.bin to line 1164 of Makefile in the root directory so that when make distclean is executed, the zImage in the kernel root directory will also be cleared while clearing the generated files.


  6. Modify the nandflash partition of static struct mtd_partition smdk_default_nand_part[] in line 111 of arch/arm/plat-s3c24xx/common-smdk.c to:


  [0] = {


  .name = "Andy_uboot",


  .offset = 0x00000000,


  .size = 0x00040000,


  },


  [1] = {


  .name = "Andy_kernel",


  .offset = 0x00200000,


  .size = 0x00200000,


  },


  [2] = {


  .name = "Andy_yaffs2",


  .offset = 0x00400000,


  .size = 0x0FB80000,


  }


  7. Modify line 839 in drivers/mtd/nand/s3c2410.c to chip->ecc.mode=NAND_ECC_NONE;


  8. Modify line 100 in arch/arm/mach-s3c2440/mach-smdk2440.c to .ulcon = 0x03.


  9. Add in line 51 of drivers/serial/samsung.c


  #include


  #include


  Add at line 433:


  if (port->line == 2) {


  s3c2410_gpio_cfgpin(S3C2410_GPH(6), S3C2410_GPH6_TXD2);


  s3c2410_gpio_pullup(S3C2410_GPH(6), 1);


  s3c2410_gpio_cfgpin(S3C2410_GPH(7), S3C2410_GPH7_RXD2);


  s3c2410_gpio_pullup(S3C2410_GPH(7), 1);


  }


  10. Use the git tool to download the latest yaffs2 source code.


  Specifically, enter git clone git://www.aleph1.co.uk/yaffs2 in the terminal to download the latest yaffs2.


  After the download is complete, patch the kernel, enter the yaffs directory, and execute


  ./patch-kernel.sh cm opt/Andy/linux-2.6.38 (based on your own kernel directory), where c stands for copy and m stands for composite type.


  11. Use make menuconfig to configure the Linux kernel.


  12. Execute make zImage and download the generated zImage.bin to TQ2440.


  13. Create a file system.


  Unzip busybox-1.18.4.tar.bz2, modify the Makefile in busybox-1.18.4, and modify lines 164 and 190 to CROSS-COMPILE=arm-linux- and ARCH=arm respectively. Execute make, and then execute make install. Copy the generated _install to the root directory, add the file system file, use the mkyaffs2image provided by Tianqian to generate the executable file root.bin, and download it to the development board.


  14. Start the development board and print the following information:


  Start Linux ...


  Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00200000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......


  Uncompressing Linux... done, booting the kernel.


  Linux version 2.6.38-Andy (root@Andy) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-176) ) #15 Fri Apr 8 20:21:42 CST 2011


  CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177


  CPU: VIVT data cache, VIVT instruction cache


  Machine: Andy's TQ2440 development board!


  ATAG_INITRD is deprecated; please update your bootloader.


  Memory policy: ECC disabled, Data cache writeback


  CPU S3C2440A (id 0x32440001)


  S3C24XX Clocks, Copyright 2004 Simtec Electronics


  S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz


  CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on


  Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256


  Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0


  PID hash table entries: 256 (order: -2, 1024 bytes)


  Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)


  Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)


  Memory: 64MB = 64MB total


  Memory: 60896k/60896k available, 4640k reserved, 0K highmem


  Virtual kernel memory layout:


  vector : 0xffff0000 - 0xffff1000 ( 4 kB)


  fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)


  DMA : 0xffc00000 - 0xffe00000 ( 2 MB)


  vmalloc : 0xc4800000 - 0xf6000000 ( 792 MB)


  lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)


  modules : 0xbf000000 - 0xc0000000 ( 16 MB)


  .init : 0xc0008000 - 0xc0025000 ( 116 kB)


  .text : 0xc0025000 - 0xc0399000 (3536 kB)


  .data : 0xc039a000 - 0xc03bac40 ( 132 kB)


  SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1


  NR_IRQS:85


  irq: clearing pending ext status 00080000


  irq: clearing subpending status 00000003


  irq: clearing subpending status 00000002


  Console: colour dummy device 80x30


  console [ttySAC0] enabled


  Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)


  pid_max: default: 32768 minimum: 301


  Mount-cache hash table entries: 512


  CPU: Testing write buffer coherency: ok


  gpiochip_add: gpios 288..303 (GPIOK) failed to register


  gpiochip_add: gpios 320..334 (GPIOL) failed to register


  gpiochip_add: gpios 352..353 (GPIOM) failed to register


  NET: Registered protocol family 16


  S3C2440: Initialising architecture


  S3C2440: IRQ Support


  S3C24XX DMA Driver, Copyright 2003-2006 Simtec Electronics


  DMA channel 0 at c4808000, irq 33


  DMA channel 1 at c4808040, irq 34


  DMA channel 2 at c4808080, irq 35


  DMA channel 3 at c48080c0, irq 36


  S3C244X: Clock Support, DVS off


  bio: create slab at 0


  SCSI subsystem initialized


  usbcore: registered new interface driver usbfs


  usbcore: registered new interface driver hub


  usbcore: registered new device driver usb


  s3c-i2c s3c2440-i2c: slave address 0x10


  s3c-i2c s3c2440-i2c: bus frequency set to 97 KHz


  s3c-i2c s3c2440-i2c: i2c-0: S3C I2C adapter


  Advanced Linux Sound Architecture Driver Version 1.0.23.


  cfg80211: Calling CRDA to update world regulatory domain


  NET: Registered protocol family 2


  IP route cache hash table entries: 1024 (order: 0, 4096 bytes)


  TCP established hash table entries: 2048 (order: 2, 16384 bytes)


  TCP bind hash table entries: 2048 (order: 1, 8192 bytes)


  TCP: Hash tables configured (established 2048 bind 2048)


  TCP reno registered


  UDP hash table entries: 256 (order: 0, 4096 bytes)


  UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)


  NET: Registered protocol family 1


  RPC: Registered udp transport module.


  RPC: Registered tcp transport module.


  RPC: Registered tcp NFSv4.1 backchannel transport module.


  msgmni has been set to 118


  io scheduler noop registered (default)


  s3c2440-uart.0: ttySAC0 at MMIO 0x50000000 (irq = 70) is a S3C2440


  s3c2440-uart.1: ttySAC1 at MMIO 0x50004000 (irq = 73) is a S3C2440


  s3c2440-uart.2: ttySAC2 at MMIO 0x50008000 (irq = 76) is a S3C2440


  loop: module loaded


  S3C24XX NAND Driver, (c) 2004 Simtec Electronics


  s3c24xx-nand s3c2440-nand: Tacls=2, 20ns Twrph0=6 60ns, Twrph1=2 20ns


  s3c24xx-nand s3c2440-nand: NAND ECC disabled


  NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)


  NAND_ECC_NONE selected by board driver. This is not recommended !!


  Scanning device for bad blocks


  Bad eraseblock 62 at 0x0000007c0000


  Bad eraseblock 1435 at 0x00000b360000


  cmdlinepart partition parsing not available


  Creating 3 MTD partitions on "NAND":


  0x000000000000-0x0000000040000 : "Andy_uboot"


  0x000000200000-0x000000400000 : "Andy_kernel"


  0x000000400000-0x00000ff80000 : "Andy_yaffs2"


  dm9000 Ethernet Driver, V1.31


  Now use the default MAC address: 10:23:45:67:89:ab


  eth0: dm9000e at c4810000,c4814004 IRQ 51 MAC: 10:23:45:67:89:ab (EmbedSky)


  ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver


  s3c2410-ohci s3c2410-ohci: S3C24XX OHCI


  s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1


  s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000


  usb usb1: New USB device found, idVendor=1d6b, idProduct=0001


  usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1


  usb usb1: Product: S3C24XX OHCI


  usb usb1: Manufacturer: Linux 2.6.38-Andy ohci_hcd


  usb usb1: SerialNumber: s3c24xx


  hub 1-0:1.0: USB hub found


  hub 1-0:1.0: 2 ports detected


  Initializing USB Mass Storage driver...


  usbcore: registered new interface driver usb-storage


  USB Mass Storage support registered.


  usbcore: registered new interface driver usbserial


  usbserial: USB Serial Driver core


  USB Serial support registered for pl2303


  usbcore: registered new interface driver pl2303



  pl2303: Prolific PL2303 USB to serial adaptor driver


  s3c2410_udc: debugfs dir creation failed -19


  mousedev: PS/2 mouse device common for all mice


  S3C24XX RTC, (c) 2004,2006 Simtec Electronics


  s3c-rtc s3c2410-rtc: rtc disabled, re-enabling


  s3c-rtc s3c2410-rtc: rtc core: registered s3c as rtc0


  i2c /dev entries driver


  S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics


  s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled


  usbcore: registered new interface driver usbhid


  usbhid: USB HID core driver


  ALSA device list:


  No soundcards found.


  TCP cubic registered


  lib80211: common routines for IEEE802.11 drivers


  s3c-rtc s3c2410-rtc: setting system clock to 2000-01-02 00:47:19 UTC (946774039)


  yaffs: dev is 32505858 name is "mtdblock2" rw


  yaffs: passed flags ""


  VFS: Mounted root (yaffs filesystem) on device 31:2.


  Freeing init memory: 116K


  Please press Enter to activate this console.


  The problems that arise during the migration and their solutions are described in the next section. There are still some drivers that have not been migrated. Keep up the good work!


Keywords:ARM9  linux2  6  TQ2440 Reference address:ARM9: How to port linux2.6.38 kernel to TQ2440

Previous article:TQ2440 naked program: PC key test program for serial UART
Next article:TQ2416 development board TIMER interrupt application control device

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

USTC achieves major breakthrough in 6G filter research and development
Recently, the University of Science and Technology of China (USTC) website announced that USTC has made important progress in the field of 6G filters. The research results were designed and implemented by the research team of Professor Zuo Chengjie from the School of Microelectronics on lithium niobate (LiNbO3) piezoe
[Mobile phone portable]
USTC achieves major breakthrough in 6G filter research and development
Apple Watch Series 6 won't include blood pressure monitoring
As more Apple Watch iterations come out, the devices are expected to tout more health features, according tomedia reports. According to a whistleblower, this long list of features is expected to be supplemented, and Apple is rumored to be testing a blood pressure detection feature on the new Apple Watch. Unfortunately
[Mobile phone portable]
Apple Watch Series 6 won't include blood pressure monitoring
Design of multi-output switching power supply based on UC3842
The multi-output switching power supply of UC3842 is designed by a 30kW switched reluctance motor controller. The main circuit of the motor power converter is an asymmetric half-bridge circuit. The flyback converter structure has the advantages of simple structure and low loss, but the output voltage ripple is large
[Power Management]
Design of multi-output switching power supply based on UC3842
How to achieve low power consumption under FreeRTOS - MSP430F5438 platform
0. Introduction     The essence of achieving low power consumption in MCU is to stop the MCU from working and reawaken the MCU through interrupts. These interrupts can include external IO interrupts, UART receive interrupts, timer interrupts, etc. If combined with an embedded operating system, you can enter low power
[Microcontroller]
How to achieve low power consumption under FreeRTOS - MSP430F5438 platform
Google Pixel 6 Pro's 5G modem is inferior to Qualcomm's Snapdragon X60, test shows
     Google is one of the few companies that has decided to distance itself from Qualcomm, including its 5G modems. As a result, the Pixel 6/Pro flagship phones use a custom Tensor chip and a 5G modem provided by Samsung.   However, in the latest tests, the Pixel 6 Pro equipped with Samsung's Exynos 5G modem didn't
[Mobile phone portable]
Google Pixel 6 Pro's 5G modem is inferior to Qualcomm's Snapdragon X60, test shows
TSMC President Wei Zhejia transfers 1,000 shares (1 million shares) to his wife, worth nearly 600 million yuan
According to Jiwei.com, Wei Zhejia, president of TSMC, the leading foundry company, declared on October 6 that he would transfer 1,000 shares (1 million shares) to his wife Niu Qingrong. If calculated based on TSMC's closing price of NT$599 per share on October 27, the market value is nearly NT$600 million (about RMB
[Mobile phone portable]
The best partner for Xiaomi 11, supporting WiFi 6 enhanced router, new product may be unveiled at the same stage
Jiwei.com reported on December 24 that the official Weibo account of Xiaomi Router announced that the new high-end Xiaomi Router will be officially released at 7:30 pm on December 28, and will appear on the same stage as Xiaomi 11. The high-end new router is designed to match the "WiFi 6 Enhanced Edition" feature fi
[Mobile phone portable]
Encoding system based on STM32F103RET6
Introduction Manchester encoding is widely used in Ethernet, vehicle bus, and industrial bus because of its characteristics of no DC component during transmission and convenient clock extraction. The commonly used Manchester encoding chips in engineering are HD-6408 and HD-6409, but this chip has some shortcom
[Analog Electronics]
Encoding system based on STM32F103RET6
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号