跳至主要内容

【转】s3c2440的IO静态映射的分析

来源: ChinaUnix博客  日期: 2008.12.23 11:02 (共有0条评论) 我要评论
 

s3c2440的IO静态映射的分析
s3c2440的IO静态映射的分析
作者:creator
     
sz111@126.com
    昨天移植uda1341声卡到2440,出现io错误,最后发现IIS没有做内存映射,但是当时奇怪为何GPIO也没有做内存映射怎么就可以了呢?今天上午仔细分析了内核,发现内存的静态映射分几个部分在做,GPIO部分已经做了。下面就是内存映射的部分的分析。
    内存映射分3个层次,1.开发板的层次(如:声卡,网卡和开发板相关的部分)。2.其他系统的层次(不影响开机的部分,如:usb,lcd,adc),3.最小系统的层次(系统必需的几个,如GPIO,IRQ,MEMCTRL,UART).
    1.开发板的mapio的初始化。
    smdk2440_map_io函数中会调用:
    s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
    而开发板相关的内存映射在smdk2440_iodesc,有ISA,声卡,网卡等。
    定义如下:
    static struct map_desc smdk2440_iodesc[] __initdata = {
    /* ISA IO Space map (memory space selected by A24) */
    { (u32)S3C24XX_VA_ISA_WORD, S3C2410_CS2, SZ_16M, MT_DEVICE },
    { (u32)S3C24XX_VA_ISA_BYTE, S3C2410_CS2, SZ_16M, MT_DEVICE },
};
   2.s3c24xx_init_io函数会调用:iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
     而s3c_iodesc定义如下:
     /* minimal IO mapping */
static struct map_desc s3c_iodesc[] __initdata = {
    IODESC_ENT(GPIO),
    IODESC_ENT(IRQ),
    IODESC_ENT(MEMCTRL),
    IODESC_ENT(UART)
};
     这个部分是系统启动必须的映射。
    后续会调用(cpu->map_io)(mach_desc, size);来完成其他映射。
    这个函数会调用iotable_init(s3c2440_iodesc, ARRAY_SIZE(s3c2440_iodesc));
    定义如下:
    static struct map_desc s3c2440_iodesc[] __initdata = {
    IODESC_ENT(USBHOST),
    IODESC_ENT(USBDEV),
    IODESC_ENT(CLKPWR),
    IODESC_ENT(LCD),
    IODESC_ENT(TIMER),
    IODESC_ENT(ADC),
    IODESC_ENT(WATCHDOG),
};
    综合上述发现,如果一个新加驱动,首先要看是否完成了IO映射,如果没有的话,就在开发板部分加入。
     


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/78225/showart_1736164.html

评论

此博客中的热门博文

【转】smb协议栈使用示例

/*  * * uncdownload.c  * *  * * Utility for downloading files from SMB shares using libsmbclient  * *  * * Copyright(C) 2006 Sophos Plc, Oxford, England.  * *  * * 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.  * *  * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  * * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  * * See the GNU General Public License for more details.  * *  * * You should have received a copy of the GNU General Public License along with this program; if not,  * * write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  * *  * */ # include < sys / types . h > # include < sys / time . h > # include ...

【转】Ether Types

Ether Types (last updated 2008-09-09) NOTE: Please see [RFC5342] for current information and registration procedures. This registry will be revised soon and will be replaced with up-to-date information. Many of the networks of all classes are Ethernets (10Mb) or Experimental Ethernets (3Mb). These systems use a message "type" field in much the same way the ARPANET uses the "link" field. If you need an Ether Type, contact: IEEE Registration Authority IEEE Standards Department 445 Hoes Lane Piscataway, NJ 08854 Phone +1 732 562 3813 Fax: +1 732 562 1571 Email: <ieee-registration-authority& ieee.org > http://standards.ieee.org/regauth/index.html The following list of EtherTypes is contributed unverified information from various sources. Another list of EtherTypes is maintained by Michael A. Patton and is accessible at: <URL: http://www.cavebear.com/CaveBear/Ethernet/ > <URL: ftp://ftp.cavebear.com/pub/Ethernet-codes > Assign...

【转】tcphdr结构详解

位于:/usr/src/linux/include/linux/tcp.h struct tcphdr { __be16 source; __be16 dest; __be32 seq; __be32 ack_seq; #if defined(__LITTLE_ENDIAN_BITFIELD) __u16   res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1; #elif defined(__BIG_ENDIAN_BITFIELD) __u16   doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1; #else #error "Adjust your <asm/byteorder.h> defines"