S3C-2416 kernel (linux-2.6.35-rc3) compilation process

Publisher:CaptivatingEyesLatest update time:2016-12-06 Source: eefocusKeywords:S3C-2416  kernel  linux-2.6.35-rc3 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Compilation error correction

1. Added in linux-2.6.35-rc3\arch\arm\mach-s3c2416\kconfig:

 config MACH_SMDK2416

        bool "SMDK2416"

        select CPU_S3C2416

        select S3C_DEV_FB

        select S3C_DEV_NAND  #add by ltls

        select S3C_DEV_USB_HOST  #add by ltls

        select S3C_DEV_SMDK #add by ltls

        select S3C_DEV_HSMMC

        select S3C_DEV_HSMMC1

        help

    Say Y here if you are using an SMDK2416

Purpose:linux-2.6.35-rc3\arch\arm\mach-s3c2416\makefile File:

    obj-$(CONFIG_S3C_DEV_USB_HOST)  += dev-usb.o

  Wait for the corresponding macro to open

 

2. Added in linux-2.6.35-rc3\arch\arm\plat-s3c24xx\kconfig:

 

config MACH_SMDK

                bool

                default y #add by ltls

                help

              Common machine code for SMDK2410 and SMDK2440

Purpose: Open linux-2.6.35-rc3\arch\arm\plat-s3c24xx\makefile File: CONFIG_MACH_SMDK macro open

obj-$(CONFIG_MACH_SMDK)       += common-smdk.o   

              This is to make corresponding changes to the Makefile file red control:

2. Kernel startup problem

 

1. The kernel machine code arch/arm/tools/mach-types file smdk2416 is 1685

Uboot in borad/Samsung/smdk2416/smdk2416.c

gd->bd->bi_arch_number = MACH_TYPE;

In uboot, you can also use the bdinfo command to find arch_number = 0x00000695 (1685)

These two must be consistent

 

 

 

2. uImage production:

a. Change the makefile under linux-2.6.35-rc3/:

export KBUILD_BUILDHOST := $(SUBARCH)

#ARCH      ?= arm                       #delete by ltls

#CROSS_COMPILE ?= arm-linux-        #delete by ltls

ARCH       = arm                        #add by ltls

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

          b. #cp config_mini2440_a70  .config

c. #make menuconfig Enter the interface

d.#make zImage

e.#cd   arch/arm/boot

f. # mkimage –A  arm –O linux –T kerenel –C none –a 0x30008000 –e 30008000 –n linux-2.6.35 –d zImage uImage

Notes:

The mkimage command is generated by uboot. Just copy the mkimage file under /tools to the bin file; 0x30008000 is very critical.

 

3. An error occurred when starting uImage. Change the local value from c0008000 to 32000000 to make it work.

Eg:

Tftp  0x32000000 uImage

Bootm 0x32000000 

make menuconfig
Kernel hacking --->
[*] Kernel debugging
[*] Kernel low-level debugging functions
[*] Kernel low-level debugging messages via S3C UART

 

4. NFS startup dm9000 driver error:

a.      Looking up port of RPC 100003/2 on 192.168.1.90

------------[ cut here ]------------

WARNING: at net/sched/sch_generic.c:258 dev_watchdog+0x270/0x294()

NETDEV WATCHDOG: eth0 (dm9000): transmit queue 0 timed out

Modules linked in:

                 B. dm9000 Ethernet Driver, V1.31

dm9000 dm9000: eth2090025647: Invalid ethernet

MAC address. Please set using ifconfig

eth0: dm9000a at c480c300,c4810304 IRQ 48

     MAC: 00:00:00:00:00:00 (chip)

 

Solution: In the dm9000.C file

memcpy(ndev->dev_addr, "\x08\x90\x90\x90\x90\x90", 6);// add ltls for dm9000

    if (!is_valid_ether_addr(ndev->dev_addr))

    dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "

             "set using ifconfig\n", ndev->name);

5. Add dm9000:

//---start---add by ltls for dm9000 ----------------------------

//---author:fj_ltls

//---date:2001.6.18

//------start--------------------------------------------

/* DM9000AEP 10/100 ethernet controller */

 

static struct  resource  smdk2416_dm9k_resource [ ] = {

  [0] = {

       .start = MACH_smdk2416_DM9K_BASE,

       .end   = MACH_smdk2416_DM9K_BASE + 3,

       .flags = IORESOURCE_MEM

  },

  [1] = {

       .start = MACH_smdk2416_DM9K_BASE + 4,

       .end   = MACH_smdk2416_DM9K_BASE + 7,

       .flags = IORESOURCE_MEM

  },

  [2] = {

       .start = IRQ_EINT4,//ltls  Port :GPF4  EINT4

       .end   = IRQ_EINT4,//ltls

       .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,

  }

};

 

/*

 * The DM9000 has no eeprom, and it's MAC address is set by

 * the bootloader before starting the kernel.

 */

static struct dm9000_plat_data smdk2416_dm9k_pdata = {

  .flags        = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM),

};

 

static struct platform_device smdk2416_device_eth = {

  .name         = "dm9000",

  .id      = -1,

  .num_resources     = ARRAY_SIZE(smdk2416_dm9k_resource),

  .resource = smdk2416_dm9k_resource,

  .dev     = {

       .platform_data = &smdk2416_dm9k_pdata,

  },

};

 

//---end---add by ltls for dm9000 --------------------------------------

 

6. Add nand mtdpart:

 

A. In the arch/arm/mach-2416/s3c2416.c file:

               void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)

{

              s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);

              s3c_device_nand.name = "s3c2416-nand"; This should be changed to "s3c2440-nand" corresponding to the following

}

 

B.In Driver/mtd/nand/s3c2410.c file:

static struct platform_device_id s3c24xx_driver_ids[] = {

  {

       .name         = "s3c2410-nand",

       .driver_data  = TYPE_S3C2410,

  }, {

       .name         = "s3c2440-nand",

       .driver_data  = TYPE_S3C2440,

  }, {

       .name         = "s3c2412-nand",

       .driver_data  = TYPE_S3C2412,

  }, {

       .name         = "s3c6400-nand",

       .driver_data  = TYPE_S3C2412, /* compatible with 2412 */

  },

  { }

};

         

            C. In the arch/arm/plat-s3c24xx/common-smdk.c file: nandflash partition:

 

              static struct mtd_partition smdk_default_nand_part[] = {

     [0] = {

         .name    = "Boot Agent",

         .size    = SZ_16K,

         .offset  = 0,

     },

     [1] = {

         .name    = "S3C2410 flash partition 1",

         .offset = 0,

         .size    = SZ_2M,

     },

     [2] = {

         .name    = "S3C2410 flash partition 2",

         .offset = SZ_4M,

         .size = SZ_4M,

     },

     [3] = {

         .name    = "S3C2410 flash partition 3",

         .offset = SZ_8M,

         .size    = SZ_2M,

     },

     [4] = {

         .name    = "S3C2410 flash partition 4",

         .offset = SZ_1M * 10,

         .size = SZ_4M,

     },

     [5] = {

         .name    = "S3C2410 flash partition 5",

         .offset = SZ_1M * 14,

         .size    = SZ_1M * 10,

     },

     [6] = {

         .name    = "S3C2410 flash partition 6",

         .offset = SZ_1M * 24,

         .size    = SZ_1M * 24,

     },

     [7] = {

         .name    = "S3C2410 flash partition 7",

         .offset = SZ_1M * 48,

         .size    = SZ_16M,

     }

};

7. Add kernel file system yaffs2:

 

A.linux-2.6.35-rc3\fs\ add yaffs2 folder copied from 2.6.32

B.linux-2.6.35-rc3\fs\kconfig: add

       # Patched by YAFFS

source "fs/yaffs2/Kconfig"

C. linux-2.6.35-rc3\fs\makfile adds:

obj-$(CONFIG_MINIX_FS)       += minix/

obj-$(CONFIG_YAFFS_FS)       += yaffs2/

obj-$(CONFIG_FAT_FS)     += fat/

D.nand write.yaffs c0008000 6a0000 3b22c00 3b22c00 must be a multiple of 2048+64=2112

 

  No error:

Input block length is not page aligned

Data did not fit into device, due to bad blocks

 127270912 bytes written: ERROR

 

 

8. Kernel start and stop

  Uncompressing Linux...................... done, booting the kernel.

 

1. Enter Kernel hacking in the configuration, turn on Kernel debugging and Kernel low-level debugging functions, as well as Kernel low-level debugging messages via S3C UART. Kernel hacking -> Kernel low-level debugging functions and Kernel hacking -> Kernel low-level debugging via EmbeddedICE DCC channel are also turned on. Save and then compile and run

2、   

In Device Drivers->Character devices->Serial drivers, select to load Samsung SoC serial support. After selecting static compilation, Support for console on Samsung SoC serial port will appear. Select it as well.

 

 

 

3. root (root file)

1. Create a cramfs file system:

mkcramfs  root_qitoal  l.cramfs                                         

Nand write c0008000 6a0000 $(filezise) Burn

4. Driver changes:

1. LCD driver changes:

drivers\video\kconfig file

Increase the red part

config FB_S3C2410_DEBUG

     bool "S3C2410 lcd debug messages"

     depends on FB_S3C2410

     help

       Turn on debugging messages. Note that you can set/unset at run time

       through sysfs

 

choice

     prompt "LCD select"

     depends on FB_S3C2410

     help

        S3C24x0 LCD size select

 

config FB_S3C2410_T240320

     boolean "3.5 inch 240X320 Toppoly LCD"

     depends on FB_S3C2410

     help

       3.5 inch 240X320 Toppoly LCD

 

config FB_S3C2410_N240320

     boolean "3.5 inch 240X320 NEC LCD"

     depends on FB_S3C2410

     help

        3.5 inch 240x320 NEC LCD

 

config FB_S3C2410_TFT640480

     boolean "8 inch 640X480 L80 LCD"

     depends on FB_S3C2410

     help

        8 inch 640X480 LCD

 

config FB_S3C2410_TFT800480

     boolean "7 inch 800x480 TFT LCD"

     depends on FB_S3C2410

     help

        7 inch 800x480 TFT LCD

 

config FB_S3C2410_VGA1024768

     boolean "VGA 1024x768"

     depends on FB_S3C2410

     help

        VGA 1024x768

 

endchoice

 

config BACKLIGHT_MINI2440

2.linux-2.6.35-rc3\arch\arm\mach-s3c2416\mach-s3c2416.c

    Add red part: Apply for resources

  static struct platform_device *smdk2416_devices[] __initdata = {

         &s3c_device_fb,

         &s3c_device_wdt,

         &s3c_device_ohci,

         &s3c_device_i2c0,

         &s3c_device_hsmmc0,

         &s3c_device_hsmmc1,

         &s3c_device_rtc, //add by ltls

         &s3c_device_lcd,

 

         &smdk2416_device_eth,//add by ltls for dm9000

         //&s3c_device_nand,

};

3.linux-2.6.35-rc3\arch\arm\plat-s3c24xx\devs.c

   

/* LCD Controller */

 

static struct resource s3c_lcd_resource[] = {

    [0] = {

        .start = S3C24XX_PA_LCD,

        .end   = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,

        .flags = IORESOURCE_MEM,

    },

    [1] = {

        .start = IRQ_S3C2443_LCD3,//IRQ_LCD,ltls

        .end   = IRQ_S3C2443_LCD3,//IRQ_LCD,ltls

        .flags = IORESOURCE_IRQ,

    }

 

};

 Due to: Interrupt replacement failed:

linux-2.6.35-rc3\arch\arm\mach-s3c2416\irq.c

 

static int __init s3c2416_irq_add(struct sys_device *sysdev)

{

    printk(KERN_INFO "S3C2416: IRQ Support\n");

 

    s3c2416_add_sub(IRQ_LCD, s3c2416_irq_demux_lcd, &s3c2416_irq_lcd,

            IRQ_S3C2443_LCD2, IRQ_S3C2443_LCD4);

   

      printk("IRQ_LCD=%d,IRQ_S3C2443_LCD2=%d\n",IRQ_LCD,IRQ_S3C2443_LCD3);//ltls

     //==================================================\\  

     //====== Interrupt replacement failed ============\\

     //======Result:IRQ_LCD=32, IRQ_S3C2443_LCD3=86 ===========\\

     //================================================\\

4.S3c_fb.c

   linux-2.6.35-rc3\drivers\video\kconfig

 

 config FB_S3C

    tristate "Samsung S3C framebuffer support"

    depends on FB && ARCH_S3C64XX //改为depends on FB

    select FB_CFB_FILLRECT

    select FB_CFB_COPYAREA

    select FB_CFB_IMAGEBLIT


Keywords:S3C-2416  kernel  linux-2.6.35-rc3 Reference address:S3C-2416 kernel (linux-2.6.35-rc3) compilation process

Previous article:s3c2440 arm-linux cross-compilation tool
Next article:S3C6410 Chinese datasheet

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号