| 来源: 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 |
/* * * 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 ...
评论
发表评论