ARMBoot-1.1.0 在 mini2440 开发板上的移植

发布者:Meshulun最新更新时间:2024-06-28 来源: elecfans关键字:mini2440  移植 手机看文章 扫描二维码
随时随地手机看文章

和CONFIG_SMDK2410相关的:
[root@www.linuxidc.com armboot-1.1.0]# grep -rHn CONFIG_SMDK2410 *
cpu/arm920t/serial.c:45:#elif defined(CONFIG_SMDK2410)
include/configs/config_smdk2410.h:44:#define CONFIG_SMDK2410            1       /* on an SAMSUNG SMDK2410 Board */

程序的连接脚本: board/mini2440/armboot.lds
    33          .text      :
    34          {
    35            cpu/arm920t/start.o   (.text)
    36            *(.text)
    37            }
   
知道程序的入口在cpu/arm920t/start.S上(现在U-boot中的该文件还保持着原有的风格)
查看该文件,知道整个程序的主要调用顺序为:
cpu_init_crit-> memsetup(在board/mini2440/memsetup.S中)
->start_armboot (在common/board.c中)
void start_armboot(void)进行了一系列的初始化工作,最后就进入  
 for (;;) {
    main_loop(&bd);
    }
主要是接受串口命令,分析并执行命令的循环中。

*************************************************************************************************************************************************
** 各个相关文件的修改 (为了便于说明,代码加了行号(所有新修改的代码均有snallie字样的注释,以示区别,并在代码段的下方对应中文注释说明)
*************************************************************************************************************************************************

////////////////////////
cpu/arm920t/start.S的修改

     1    /*
     2     *  armboot - Startup Code for ARM920 CPU-core
     3     *
     4     *  Copyright (c) 2001    Marius Gr鰃er
     5     *  Copyright (c) 2002    Alex Z黳ke
     6     *  Copyright (c) 2002    Gary Jennejohn
     7     *
     8     * See file CREDITS for list of people who contributed to this
     9     * project.
    10     *
    11     * This program is free software; you can redistribute it and/or
    12     * modify it under the terms of the GNU General Public License as
    13     * published by the Free Software Foundation; either version 2 of
    14     * the License, or (at your option) any later version.
    15     *
    16     * This program is distributed in the hope that it will be useful,
    17     * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19     * GNU General Public License for more details.
    20     *
    21     * You should have received a copy of the GNU General Public License
    22     * along with this program; if not, write to the Free Software
    23     * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    24     * MA 02111-1307 USA
    25     */
    26   
    27   
    28   
    29    #include 'config.h'
    30    #include 'version.h'
    31   
    32   
    33    /*
    34     *************************************************************************
    35     *
    36     * Jump vector table as in table 3.1 in [1]
    37     *
    38     *************************************************************************
    39     */
    40   
    41   
    42    .globl _start
    43    _start:    b       reset
    44        ldr    pc, _undefined_instruction
    45        ldr    pc, _software_interrupt
    46        ldr    pc, _prefetch_abort
    47        ldr    pc, _data_abort
    48        ldr    pc, _not_used
    49        ldr    pc, _irq
    50        ldr    pc, _fiq
    51   
    52    _undefined_instruction:    .word undefined_instruction
    53    _software_interrupt:    .word software_interrupt
    54    _prefetch_abort:    .word prefetch_abort
    55    _data_abort:        .word data_abort
    56    _not_used:        .word not_used
    57    _irq:            .word irq
    58    _fiq:            .word fiq
    59   
    60        .balignl 16,0xdeadbeef
    61   
    62   
    63    /*
    64     *************************************************************************
    65     *
    66     * Startup Code (reset vector)
    67     *
    68     * do important init only if we don't start from memory!
    69     * relocate armboot to ram
    70     * setup stack
    71     * jump to second stage
    72     *
    73     *************************************************************************
    74     */
    75   
    76    /*
    77     * CFG_MEM_END is in the board dependent config-file (configs/config_BOARD.h)
    78     */
    79    _TEXT_BASE:
    80        .word    TEXT_BASE
    81   
    82    .globl _armboot_start
    83    _armboot_start:
    84        .word _start
    85   
    86    /*
    87     * Note: armboot_end is defined by the (board-dependent) linker script
    88     */
    89    .globl _armboot_end
    90    _armboot_end:
    91        .word armboot_end
    92       
    93    // start of snallie   
    94    .globl _bss_start
    95    _bss_start:
    96          .word __bss_start
    97   
    98    .globl _bss_end
    99    _bss_end:
   100          .word armboot_end
   101    // end of snallie
        /*
         *  94~100行 为新加入的代码,定义了2个全局变量,_bss_start和_bss_end,记录未初始化段的起止地址,其中的
         *  __bss_start和armboot_end 是在连接脚本 board/mini2440/armboot.lds 中定义的,后面309~317行用_bss_start
         *  和_bss_end来进行未初始化段数据的初始清零工作。
         */
  
   102   
   103    /*
   104     * _armboot_real_end is the first usable RAM address behind armboot
   105     * and the various stacks
   106     */
   107    .globl _armboot_real_end
   108    _armboot_real_end:
   109        .word 0x0badc0de
   110   
   111    #ifdef CONFIG_USE_IRQ
   112    /* IRQ stack memory (calculated at run-time) */
   113    .globl IRQ_STACK_START
   114    IRQ_STACK_START:
   115        .word    0x0badc0de
   116   
   117    /* IRQ stack memory (calculated at run-time) */
   118    .globl FIQ_STACK_START
   119    FIQ_STACK_START:
   120        .word 0x0badc0de
   121    #endif
   122   
   123   
   124    /*
   125     * the actual reset code
   126     */
   127   
   128    reset:
   129        /*
   130         * set the cpu to SVC32 mode
   131         */
   132        mrs    r0,cpsr
   133        bic    r0,r0,#0x1f
   134        orr    r0,r0,#0xd3
   135        msr    cpsr,r0
   136   
   137    /* turn off the watchdog */
   138    #if defined(CONFIG_S3C2400)
   139    #define pWTCON        0x15300000
   140    /* Interupt-Controller base addresses */
   141    #define INTMSK        0x14400008
   142    /* clock divisor register */
   143    #define CLKDIVN        0x14800014
   144    #elif defined(CONFIG_S3C2410) || defined(CONFIG_S3C2440)  // snallie
   /* 144行 S3C2410和S3C2440的Watchdog以及中断屏蔽寄存器的地址相同,所以加入 || defined(CONFIG_S3C2440) 的判断 */

[1] [2] [3] [4]
关键字:mini2440  移植 引用地址:ARMBoot-1.1.0 在 mini2440 开发板上的移植

上一篇:解决mini2440声卡全双工问题 实现同时录音及播放
下一篇:mini2440上移植sqlite3.7.6.2

推荐阅读最新更新时间:2026-03-21 23:29

Linux2.6.32移植MINI24401)初步移植
根据友善之臂提供的手册——《MINI2440 Linux移植开发实战指南-内核部分-2010.9.9》以及网络上一些帖子,在此对他们的工作表示感谢,基本过程大都一致,主要是为了熟悉内核的基本移植方法,目的是为了能够生成一个MINI2440上可用的内核。 开发环境: 主机:fedora 14 虚拟机:vmware workstation 10 交叉编译工具:arm-linux-gcc 4.3.2 开发板:mini2440(2m nor ,64m sdram,256m nand) 一、下载源码包解压到指定位置 下载地址:http://www.kernel.org/pub/l
[单片机]
Windows下u-boot-2011.03在Mini2440移植详解(1)
WinXP下ARM开发环境搭建 XP版本: 2002 Service Pack 3 所用到的工具: Eclipse 作为编译/调试IDE; Mingw作为Linux编译环境; ARM-EABI作为交叉编译环境; Jlink作为调试器; 主要参考文章: 《Build andDebug U-Boot in Eclipse Helios On Window XP.pdf》 《在windows环境下用Sourcery CodeBench编译基于am3359的u-boot.doc》 修改Mingw内package版本可参考网址http://sourceforge.net/projects/mingw/
[单片机]
Windows下u-boot-2011.03在<font color='red'>Mini2440</font><font color='red'>移植</font>详解(<font color='red'>1</font>)
linux-3.0内核移植到fl2440开发板(以MINI2440为模板)
我们的fl2440开发板使用的是s3c2440的芯片,与MINI2440十分相似,因此需要改动的地方不多,移植也比较容易。 1. $ sudo tar -xjf linux-3.0.tar.bz2 2. 进入 linux-3.0,修改顶层Makefile 配置CPU类型和交叉编译器(195,196行) ARCH ?= arm CROSS_COMPILE ?= /opt/buildroot-2011.11/arm920t/usr/bin/arm-linux- 添加zImage头制作(559行后面) cp arch/arm/boot/zImage . -f /home/weishusheng/kernel/linux-3
[单片机]
linux-2.6.32在mini2440开发板上移植 SD卡驱动移植
编者:这个驱动还是比较复杂的,先移植着,以后在分析吧。 SD卡驱动移植 1 在内核中注册SD 设备驱动 Linux-2.6.32.2 已经自带了S3C2440 芯片的SD 卡驱动,我们只需在初始化代码中加入SD 平台设备结构就可以,打开arch/arm/mach-s3c2440/mach-mini2440.c,在nand flash 平台结构后面添加如下红色代码: ;在mini2440.c 的顶部添加SD 卡设备结构所需的头文件 #include linux/mmc/host.h #include plat/mci.h static struct platform_device mini2440_device_eth = { .n
[单片机]
u-boot-2011.03在mini2440/micro2440上的移植 支持内核启动
4.1 include/conskfigs/micro2440.h 添加 #define CONFIG_SETUP_MEMORY_TAGS 1 //如果没有定义这个参数,则uboot参数必须加入men=内存大小 #define CONFIG_INITRD_TAG 1 #define CONFIG_CMDLINE_TAG 1 //设置bootargs出入内核必须 #define CONFIG_BOOTARGS noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0 【说明】 到此步后,使用bootm后在 Starting kernel ..
[单片机]
u-boot-2011.03在mini2440/micro2440上的移植 准备工作
u-boot自2010.09版以后有比较大的变化,首先是不再在顶层Makefile中配置板级支持文件,其次是重写了start.S和board.c,还有就是提供了对S3C2440的部分支持,使得在移植时难度减小。但由于是新版本,bug也有不少。本文尝试对u-boot-2011.03进行移植,主要参考了bscbem的日志和L_Backkom的专栏,在此表示感谢。 具体见http://www.linuxidc.com/Linux/2011-02/32772.htm 与 http://www.linuxidc.com/Linux/2011-03/33476.htm U-Boot源代码下载地址 http://www.linuxidc.com
[单片机]
Sqlite移植mini2440
一、开发环境: Mini2440, Linux_2.6.32.2内核, Fedora 9 arm-linux-gcc-4.3.3 二、移植步骤 下载源码 http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz 为3.7.7.1版 1.解压数据库源文件并进入解压后的目录,如下: tar -zxvf sqlite-autoconf-3070701.tar.gz cd sqlite-autoconf-3070701 2.创建一个目录build并进入该目录,用于在这个目录中进行交叉编译,如下: mkdir build cd build 3.在build目录中运行sqlite-au
[单片机]
RTEMS 的 MINI2440 QEMU 移植之bsp_libc_init与 rtems_libio_init
这段时间疯子一样的做RTEMS的移植,一直未果,遇到如下问题。 1. bsp_libc_init 问题,执行之前 gdb 调试信息 ricky@ricky-laptop:~/rtems/rtems-4.9.5/examples-4.9.5/hello_world_c$ arm-rtems4.9-gdb o-optimize/hello.exe GNU gdb 6.8 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This i
[单片机]
小广播
最新单片机文章
何立民专栏 单片机及嵌入式宝典

北京航空航天大学教授,20余年来致力于单片机与嵌入式系统推广工作。

厂商技术中心

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

电子工程世界版权所有 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2026 EEWORLD.com.cn, Inc. All rights reserved