Hi all,

i received the ds1338-3.3V chip, set up the board.c as Viet suggested below, 
but still mcf-i2c / rtc-ds1307 drivers don't work.
I added some printk in the probe functions, and seeing that both mcfi2c_probe / 
ds1307_probe are not called in the registration, only the module_init calls are 
executed for both drivers.

Actually, i am not sure if there must be a sequence to register devices.

This is the actual dmesg:


Linux version 2.6.36.2 (angelo@angel7) (gcc version 4.2.4) #3 Wed Aug 31 
15:42:51 CEST 2011


uClinux/COLDFIRE(m5307)
COLDFIRE port done by Greg Ungerer, g...@snapgear.com
Modified for M5307 by Dave Miller, dmil...@intellistor.com
Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne
On node 0 totalpages: 4096
free_area_init_node: node 0, pgdat 00197e44, node_mem_map 00234000
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: root=/dev/mtdblock3 rootfstype=romfs console=ttyS0,115200 
init=/bin/init 
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory available: 13988k/16384k RAM, (1446k kernel code, 174k data)
SLUB: Genslabs=12, HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:256
Calibrating delay loop... 59.18 BogoMIPS (lpj=295936)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
i2c-core: driver [dummy] registered
bio: create slab <bio-0> at 0
Switching to clocksource tmr
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 27
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
ColdFire internal UART serial driver
ttyS0 at MMIO 0x100001c0 (irq = 73) is a ColdFire UART
console [ttyS0] enabled
ttyS1 at MMIO 0x10000200 (irq = 74) is a ColdFire UART
brd: module loaded
nbd: registered device at major 43
physmap platform flash device: 00400000 at ffc00000
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 
0x0000bf Chip ID 0x00235d
number of CFI chips: 1
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash":
0x000000000000-0x000000020000 : "U-Boot (128K)"
0x000000020000-0x000000300000 : "Kernel+ROMfs (2994K)"
0x000000300000-0x000000400000 : "JFFS2 (1024K)"
uclinux[mtd]: RAM probe address=0x1b5748 size=0x7b000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x00000007b000 : "ROMfs"
Generic platform RAM MTD, (c) 2004 Simtec Electronics
dm9000 Ethernet Driver, V1.31
Invalid ethernet MAC address. Please set MAC using ifconfig
eth0: dm9000e at 30000000,30000004 IRQ 25 MAC: 00:00:00:00:00:00 (chip)
ds1307 module init
i2c-core: driver [rtc-ds1307] registered
i2c /dev entries driver
i2c-core: driver [dev_driver] registered
mcfi2c_init
TCP cubic registered
NET: Registered protocol family 17
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Mounted root (romfs filesystem) readonly on device 31:3.
Freeing unused kernel memory: 52k freed (0x19c000 - 0x1a8000)
eth0: link down
eth0: link up, 10Mbps, half-duplex, lpa 0x0021


hope for some help

many thanks
angelo


On 25/08/2011 18:37, Viet Nguyen wrote:
> On Wed, Aug 24, 2011 at 11:24 PM, angelo <angel...@gmail.com
> <mailto:angel...@gmail.com>> wrote:
> 
> 
>     1- The device rtc0 must be created from genromfs ? I see some boards
>     that have CONFIG_RTC_HCTOSYS_DEVICE="rtc0" but create a "rtc"
>     instade, with any number.
> 
>     2 - Do i hae to add some static structure in my board.c to enable
>     rtc ds1307 driver ? Do you have a sample ?
> 
> 
> 1. rtc0 device node should be created in order to use hwclock, you don't
> need to create i2c device note by the way.
> 2. You must register your platform devices:
> 
> static struct platform_device rtc_dev_ = {
>     .name = "rtc-ds1307",
>     .id  = -1,
> };
> 
> static struct resource i2c_res_[] = {
>     {
>         .start      = MCFI2C_IOBASE,
>         .end        = MCFI2C_IOBASE + MCFI2C_IOSIZE - 1,
>         .flags      = IORESOURCE_MEM,
>     },
>     {
>         .start      = MCFINT_VECBASE + MCFINT_I2C,
>         .end        = MCFINT_VECBASE + MCFINT_I2C,
>         .flags      = IORESOURCE_IRQ,
>     },
> };
> 
> static struct platform_device i2c_dev_ = {
>    .name  = "mcfi2c",
>    .id = 0,
>    .num_resources = ARRAY_SIZE(i2c_res_),
>    .resource = i2c_res_,
> };
> 
> static struct i2c_board_info __initdata i2c_info_[] = {
>     {
>         I2C_BOARD_INFO("ds1338", 0x68),
>     },
> };
> 
> static struct platform_device *devices_[] __initdata = {
>     &rtc_dev_,
>     &i2c_dev_,
> };
> 
> ...
> in your arch_init:
>   i2c_register_board_info(0, i2c_info_, ARRAY_SIZE(i2c_info_));
>   platform_add_devices(devices_, ARRAY_SIZE(devices_));
> 
> PS: I used i2c driver of Steven King
> 
> Regrads,
> -- 
> Nguyen Quoc Viet

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to