`
suoyihen
  • 浏览: 1359477 次
文章分类
社区版块
存档分类
最新评论

ARM-Linux驱动移植--RTC(实时时钟)移植

 
阅读更多

硬件平台:FL2440

内核版本:2.6.28

主机平台:Ubuntu 11.04

内核版本:2.6.39

原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/6584285

首先修改内核源码/arch/arm/mach-s3c2410/mach-smdk2410.c

添加红色字体部分

make zImage重新编译内核,然后烧写内核(编译内核前,make menuconfig时选择rtc相关的驱动,如下图)

烧写完成后启动开发板,启动信息如下:

+------------------------------------------------------------+
| FL2440 Bootloader VER-5.1 Modified By Yan Ming! |
|------------------------------------------------------------|
|------------------------------------------------------------|
|CPU ID is 0x32440001 |
|FCLK=400MHz,HCLK=100MHz,PCLK=50MHz, CPU is running at 400MHz|
|UPLL=96MHz, UCLK=48MHz |
|Serial port 0, Baud rate is 115200. |
|OS image stored in NAND Flash. |
|Autoboot delay is 2 seconds. |
+------------------------------------------------------------+
Set boot params = root=/dev/mtdblock3 init=/linuxrc load_ramdisk=0 console=ttyS
Load Kernel...
Uncompressing Linux.............................................................
Linux version 2.6.28.7 (yan@yan-laptop) (gcc version 3.4.1) #343 Sun Jul 3 19:11
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: SMDK2410
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
MM: CPU does not support supersection mapping for 0x55000000000 at 0xf0d00000
S3C244X: core 400.000 MHz, memory 100.000 MHz, peripheral 50.000 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: root=/dev/mtdblock3 init=/linuxrc load_ramdisk=0 console=t
irq: clearing pending ext status 00080000
irq: clearing subpending status 00000092
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00500d00, tcnt a2c1, tcfg 0000020f,00000030, usec 00001eb8
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61120KB available (3288K code, 312K data, 144K init)
Calibrating delay loop... 199.47 BogoMIPS (lpj=498688)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 288 bytes
NET: Registered protocol family 16
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4808000, irq 33
DMA channel 1 at c4808040, irq 34
DMA channel 2 at c4808080, irq 35
DMA channel 3 at c48080c0, irq 36
S3C244X: Clock Support, DVS off
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) (SUMMARY) 2001-2006 Red Hat, Inc.
yaffs Jul 3 2011 19:14:41 Installing.
msgmni has been set to 119
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 40x30
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.31
eth0: dm9000a at c487a300,c487e304 IRQ 51 MAC: 00:12:34:56:80:49 (chip)
Uniform Multi-Platform E-IDE driver
ide-gd driver 1.18
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2440-nand s3c2440-nand: Tacls=3, 30ns Twrph0=7 70ns, Twrph1=3 30ns
NAND device: Manufacturer ID: 0xad, Chip ID: 0xda (Hynix NAND 256MiB 3,3V 8-bit)
NAND_ECC_NONE selected by board driver. This is not recommended !!
Scanning device for bad blocks
Bad eraseblock 1771 at 0x0dd60000
Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x00000000-0x00100000 : "Boot"
0x00140000-0x00500000 : "MyApp"
0x00500000-0x00800000 : "Kernel"
0x00800000-0x0f800000 : "fs_yaffs"
usbmon: debugfs is not available
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2410-rtc s3c2410-rtc: rtc disabled, re-enabling
s3c2410-rtc s3c2410-rtc: rtc core: registered s3c as rtc0

s3c2440-sdi s3c2440-sdi: host detect has no irq available
mapped channel 0 to 0
s3c2440-sdi s3c2440-sdi: powered down.
s3c2440-sdi s3c2440-sdi: initialisation done.
s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
s3c2440-sdi s3c2440-sdi: running at 196kHz (requested: 195kHz).
s3c2440-sdi s3c2440-sdi: powered down.
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
mapped channel 10 to 2
mapped channel 9 to 1
UDA1341 audio driver initialized
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
s3c2410-rtc s3c2410-rtc: setting system clock to 2011-07-04 20:15:05 UTC (13098)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: auto selecting yaffs2
yaffs: restored from checkpoint
yaffs_read_super: isCheckpointed 1
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 144K
usb 1-1: new full speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
Mounting /proc,/sys,/dev......
Starting mdev......
init started: BusyBox v1.9.2 (2011-06-13 18:52:29 CST)
starting pid 900, tty ': '/etc/init.d/rcS'
dm9000 dm9000.0: WARNING: no IRQ resource flags set.
eth0: link down

Please press Enter to activate this console. eth0: link up, 100Mbps, full-duple1

后色部分显示RTC工作正常。

使用命令

date 命令修改系统时间后,执行hwclock -w,保存到硬件的实时时钟

每次开机执行hkclock -s,这样每次开机后,系统从硬件读取时间信息,保存到系统。

分享到:
评论

相关推荐

    基于ARM Cortex-A8和Android 4.x的联动报警系统 (Android 、A8、Linux、驱动、NDK)

    第三部分内容,先教大家如何搭建裸机开发环境,然后带领大家一起阅读三星的芯片手册,并编写了LED、蜂鸣器、按键、中断、串口UART、实时时钟RTC、定时器PWM、模数转换ADC等裸机驱动;第四部分,讲解了Linux设备驱动...

    ARM-s3c2410处理器开发必备资料

    1 产品综述.pdf 2 处理器工作模式.pdf 3 ARM INSTRUCTION SET.pdf ...S3C2410 下 LCD 驱动程序移植及 GUI 程序编写.pdf s3c2410 中断异常处理.doc S3C2410A 中文数据手册(全).pdf 触摸屏在S3C2410上的应用实例.mht

    ARM Cortex-A8和Android 4.x联动报警系统

    第三部分内容,先教大家如何搭建裸机开发环境,然后带领大家一起阅读三星的芯片手册,并编写了LED、蜂鸣器、按键、中断、串口UART、实时时钟RTC、定时器PWM、模数转换ADC等裸机驱动;第四部分,讲解了Linux设备驱动...

    ARM Cortex-A8和Android 4.x的联动报警

    第三部分内容,先教大家如何搭建裸机开发环境,然后带领大家一起阅读三星的芯片手册,并编写了LED、蜂鸣器、按键、中断、串口UART、实时时钟RTC、定时器PWM、模数转换ADC等裸机驱动;第四部分,讲解了Linux设备驱动...

    嵌入式Linux之我行系列

    ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之RTC时钟驱动 ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之DM9000E网卡驱动 ·嵌入式Linux之我行——Linux-2.6.30.4在2440上的移植之USB驱动 ·...

    郭天祥ARM9视频教程(第13和20讲均可观看).docx

    第六部分 嵌入式系统移植之linux内核 第十五讲 Linux内核分析和配置 1. 内核源码目录结构分析 2. Makefile,Kconfig文件分析 3. Linux启动过程分析 4. 配置、编译内核 第十六讲 向内核中加入驱动 1. 支持NAND和yaffs...

    STM32F103RCT6的实时时钟显示源代码,包含掉电后时间保存、外接按键支持修改日期、时间,OLED显示,使用cubeMX

    在cubeMX界面设置RTC实时时钟,在工程中调用时间;修改了HAL库的时间设置和获取函数,使得能够在系统掉电后能继续走和保存时间。外接了9按键键盘,点击确认键进入日期时间修改模式,按上箭头按键,时期时间增加,按...

    ARM μCOS-II基础实验

    这个是周立功教材的参考程序。基本实验有GPIO实验,时钟实验,PWM实验,RTC实验,信号量使用。对于学习ARM的参考不错

    uboott移植实验手册及技术文档

    4、交叉编译器 arm-softfloat-linux-gnu-gcc-3.4.5 【实验步骤】 一、建立自己的平台类型 (1)解压文件 #tar jxvf u-boot-1.3.1.tar.bz2 (2)进入 U-Boot源码目录 #cd u-boot-1.3.1 (3)创建自己的开发板...

    嵌入式系统/ARM技术中的基于ARM内核目标系统中的代码运行时间测试

    根本原因在于: 这类函数是基于系统实时时钟(RTC)的,而RTC通常采用标准化钟表晶振,频率只有32.768 kHz而已。  然而很多应用涉及μs级的时间计量,这是标准化了的RTC以及基于它的时间函数所无能为力的。笔者在...

    参赛-基于WiFi的网络授时时钟设计-电路方案

    这里采用时钟电路是希望模块在断网后还能获取一个比较精准的时间,并且电路设计上增加了储能电容可以在断电一个月后保持时间数据不丢失,当然这里也可以用STM32里面的RTC时钟;OLED显示屏采用的是裸屏设计,使整体...

    嵌入式系统/ARM技术中的瑞萨电子推出全新RL78族MCU

    瑞萨电子(中国)宣布在大中国区推出超低功耗的新型RL78族微控制器(MCU)。RL78族融合了R8C和78K(78K0,78K0R)两族产品的优势特性,...A,内置实时时钟(RTC)和低电压检测功能(LVD)。新产品基于130纳米(nm)工

Global site tag (gtag.js) - Google Analytics