Linux 3.2.8 system porting Based on tiny6410 (2) BSP writing and driver porting

Source: Internet
Author: User

Ii. Linux 3.2.8 kernel Section


Lab 5:BSP writing Step 1
In this experiment, the bsp of the jason6410 board is added, and the kernel support of the NAND Flash Driver, MTD and ubifs is added. The following is the source code of the mach-jason6410.c:
/* linux/arch/arm/mach-s3c64xx/mach-jason6410.c * * Copyright 2012 Jason Lu <gfvvz@yahoo.com.cn> *     http://jason2012.blog.chinaunix.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. **/#include <linux/init.h>#include <linux/interrupt.h>#include <linux/fb.h>#include <linux/gpio.h>#include <linux/kernel.h>#include <linux/list.h>#include <linux/dm9000.h>#include <linux/mtd/mtd.h>#include <linux/mtd/partitions.h>#include <linux/serial_core.h>#include <linux/types.h>#include <asm/mach-types.h>#include <asm/mach/arch.h>#include <asm/mach/map.h>#include <mach/map.h>#include <mach/regs-gpio.h>#include <mach/regs-modem.h>#include <mach/regs-srom.h>#include <plat/s3c6410.h>#include <plat/adc.h>#include <plat/cpu.h>#include <plat/devs.h>#include <plat/fb.h>#include <plat/nand.h>#include <plat/regs-serial.h>#include <plat/ts.h>#include <plat/regs-fb-v4.h>#include <video/platform_lcd.h>#define UCON S3C2410_UCON_DEFAULT#define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB)#define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE)static struct s3c2410_uartcfg jason6410_uartcfgs[] __initdata = {    [0] = {        .hwport    = 0,        .flags    = 0,        .ucon    = UCON,        .ulcon    = ULCON,        .ufcon    = UFCON,    },    [1] = {        .hwport    = 1,        .flags    = 0,        .ucon    = UCON,        .ulcon    = ULCON,        .ufcon    = UFCON,    },    [2] = {        .hwport    = 2,        .flags    = 0,        .ucon    = UCON,        .ulcon    = ULCON,        .ufcon    = UFCON,    },    [3] = {        .hwport    = 3,        .flags    = 0,        .ucon    = UCON,        .ulcon    = ULCON,        .ufcon    = UFCON,    },};/* Nand flash */static struct mtd_partition jason6410_nand_part[] = {    {        .name        = "u-boot-2011.06",        .offset        = 0,        .size        = (4 * 128 *SZ_1K),        .mask_flags    = MTD_CAP_NANDFLASH,    },    {        .name        = "Linux Kernel 3.2.8",        .offset        = MTDPART_OFS_APPEND,        .size        = (5*SZ_1M) ,        .mask_flags    = MTD_CAP_NANDFLASH,    },    {        .name        = "UBI File System",        .offset        = MTDPART_OFS_APPEND,        .size        = MTDPART_SIZ_FULL,    }};static struct s3c2410_nand_set jason6410_nand_sets[] = {    [0] = {        .name        = "nand",        .nr_chips    = 1,        .nr_partitions    = ARRAY_SIZE(jason6410_nand_part),        .partitions    = jason6410_nand_part,    },};static struct s3c2410_platform_nand jason6410_nand_info = {    .tacls        = 25,    .twrph0        = 55,    .twrph1        = 40,    .nr_sets    = ARRAY_SIZE(jason6410_nand_sets),    .sets        = jason6410_nand_sets,};static struct platform_device *jason6410_devices[] __initdata = {    &s3c_device_nand,};static void __init jason6410_map_io(void){    s3c64xx_init_io(NULL, 0);    s3c24xx_init_clocks(12000000);    s3c24xx_init_uarts(jason6410_uartcfgs, ARRAY_SIZE(jason6410_uartcfgs));}static void __init jason6410_machine_init(void){    s3c_device_nand.name = "s3c6410-nand";    s3c_nand_set_platdata(&jason6410_nand_info);    platform_add_devices(jason6410_devices, ARRAY_SIZE(jason6410_devices));}MACHINE_START(JASON6410, "JASON6410")    /* Maintainer: Darius Augulis <augulis.darius@gmail.com> */    .atag_offset    = 0x100,    .init_irq    = s3c6410_init_irq,    .map_io        = jason6410_map_io,    .init_machine    = jason6410_machine_init,    .timer        = &s3c24xx_timer,MACHINE_END

The process of adding BSP support is as follows:

1. ARCH/ARM/mach-s3c6410/kconfigline 93, add: config mach_jason6410 bool "jason6410" select cpu_initi6410 select initi_dev_fb select statements help machine support for the jasom64102. ARCH/ARM/mach-s3c6410/makefileline 47, add: OBJ-$ (config_mach_jason6410) + = mach-jason6410.o3. add mach-jason6410.c to directory: ARCH/ARM/mach-s3c6410/


In addition, the machine ID is also changed as a portable Board (of course, The Machine ID in U-boot should also be modified accordingly ).

@arch/arm/tools/mach-typeslast line, add:jason6410 MACH_JASON6410 JASON6410 8888

Here, we only write this main modification. For the remaining modification processes, see "Linux 3.2.8 system migration based on tiny6410 (1)" to mount the file system normally. The next step is Improve BSP and port the driver.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.