linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC5200 with PCF8563 RTC
@ 2004-09-23 18:06 Jón Benediktsson
  2004-09-23 20:07 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Jón Benediktsson @ 2004-09-23 18:06 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 6590 bytes --]

Hi

I am working on porting linux to a custom board based on MPC5200, which 
has a PCF8563 real time clock connected via i2c2_io and i2c2_clk pins.
It looks like this same combination is used on the PM520 board.

I am using u-boot and it was a breeze getting this combination to work in 
u-boot.  I just added the right CONFIG_s and the u-boot date command 
worked
without any problems.

I am however having a more difficult time getting the linux kernel 
(linuxppc_2_4_devel from Denx) to work with PCF8563.  I get errors from 
rtc_rd( ), but I
can't understand why.  I have compared the i2c clock signals between 
u-boot and linux and noticed that the clock signal is different with 
linux.   The third clock
pulse is much narrower than the others, whereas with u-boot the clock 
pulses are all even.  But I can't figure out why the i2c clock behaves 
differently with linux.
Attached is the console output.

Any thoughts ?


Thanks,
Jón Benediktsson
Marel hf.


Memory BAT mapping: BAT2=32Mb, BAT3=0Mb, residual: 0Mb
Linux version 2.4.25 (jonb@tux.marel.is) (gcc version 3.2.2 20030217 
(Yellow Dog
 Linux 3.0 3.2.2-2a_1)) #46 Fim Sep 23 17:43:42 UTC 2004
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/nfs rw 
nfsroot=10.100.1.30:/opt/eldk/ppc_82xx ip=
10.100.50.68:10.100.1.30:10.100.254.254:255.255.0.0:ns4:eth0:off panic=1
Calibrating delay loop (skipped)... 0.05 BogoMIPS
Memory: 29992k available (1348k kernel code, 452k data, 76k init, 0k 
highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Journalled Block Device driver loaded
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
i2c-core.o: i2c core module version 2.6.1 (20010830)
i2c-dev.o: i2c /dev entries driver module version 2.6.1 (20010830)
i2c-proc.o version 2.6.1 (20010830)
pty: 256 Unix98 ptys configured
ttyS0 on PSC1
ttyS1 on PSC2
ttyS2 on PSC3
PCF8563 Real-Time Clock Driver $Revision: 1.3 $ wd@denx.de
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 33MHz system bus speed for PIO modes; override with 
idebus=xx
Port Config is: 0x91050404
ipb=66MHz, set clock period to 15
GPIO config: 91050404
ATA invalid: 00800000
ATA hostcnf: 03000000
ATA pio1   : 100a0a00
ATA pio2   : 02040600
XLB Arb cnf: 80002006
mpc5xxx_ide: Setting up IDE interface ide0...
Probing IDE interface ide0...
hda: SAMSUNG CF/ATA, CFA DISK drive
ide0 at 0xf0003a60-0xf0003a67,0xf0003a5c on irq 45
hda: attached ide-disk driver.
hda: 507904 sectors (260 MB) w/1KiB Cache, CHS=992/16/32
Partition check:
 hda: hda1 hda2 hda3 hda4
Icecube Bank 0: Found 1 x16 devices at 0x0 in 8-bit mode
 Amd/Fujitsu Extended Query Table at 0x0040
Icecube Bank 0: CFI does not contain boot bank location. Assuming top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Icecube flash bank 0: Using static image partition definition
Creating 5 MTD partitions on "Icecube Bank 0":
0x00000000-0x00800000 : "Spare"
0x00800000-0x00900000 : "kernel"
0x00900000-0x00c00000 : "initrd"
0x00c00000-0x00f00000 : "jffs"
0x00f00000-0x01000000 : "Firmware"
i2c-core.o: client [PCF8563] registered to adapter [PM520 I2C module #2 
interfac
e](pos. 0).
RTC switching kernel pointers
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
Get RTC year: ff mon/cent: ff mday: ff wday: ff hr: ff min: ff sec: ff
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_rd(): i2c transfer error
Alarms: wday: ff day: ff hour: ff min: ff
PCF8563 RTC Low Voltage - date/time not reliable
get rtc [dec] year=2165 mon=25 day=45 hour=45 min=85 sec=85
Set System Time from RTC Time: 1925913489
RTC installed, minor 135
rtc_rd(): i2c transfer error
PCF8563 RTC Low Voltage - date/time not reliable
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_rd(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
rtc_wr(): i2c transfer error
i2c-algo-5xxx.o: scanning bus PM520 I2C module #2 interface...
(0x00)(0x01)(0x02)(0x03)(0x04)(0x05)(0x06)(0x07)(0x08)(0x09)(0x0a)(0x0b)(0x0c)(0
x0d)(0x0e)(0x0f)(0x10)(0x11)(0x12)(0x13)(0x14)(0x15)(0x16)(0x17)(0x18)(0x19)(0x1
a)(0x1b)(0x1c)(0x1d)(0x1e)(0x1f)(0x20)(0x21)(0x22)(0x23)(0x24)(0x25)(0x26)(0x27)
(0x28)(0x29)(0x2a)(0x2b)(0x2c)(0x2d)(0x2e)(0x2f)(0x30)(0x31)(0x32)(0x33)(0x34)(0
x35)(0x36)(0x37)(0x38)(0x39)(0x3a)(0x3b)(0x3c)(0x3d)(0x3e)(0x3f)(0x40)(0x41)(0x4
2)(0x43)(0x44)(0x45)(0x46)(0x47)(0x48)(0x49)(0x4a)(0x4b)(0x4c)(0x4d)(0x4e)(0x4f)
(0x50)(0x51)(0x52)(0x53)(0x54)(0x55)(0x56)(0x57)(0x58)(0x59)(0x5a)(0x5b)(0x5c)(0
x5d)(0x5e)(0x5f)(0x60)(0x61)(0x62)(0x63)(0x64)(0x65)(0x66)(0x67)(0x68)(0x69)(0x6
a)(0x6b)(0x6c)(0x6d)(0x6e)(0x6f)(0x70)(0x71)(0x72)(0x73)(0x74)(0x75)(0x76)(0x77)
(0x78)(0x79)(0x7a)(0x7b)(0x7c)(0x7d)(0x7e)(0x7f)
i2c-pm520.o: I2C module #2 installed
NET4: Linux TCP/IP 1.0 for NET4.0
eth0: Phy @ 0x0, type DP83847 (0x20005c30)
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
eth0: config: auto-negotiation on, 100FDX, 100HDX, 10FDX, 10HDX.
eth0: Waiting for the link to be up...
eth0: status: link up, 100 Mbps Half Duplex.
IP-Config: Complete:
      device=eth0, addr=10.100.50.68, mask=255.255.0.0, gw=10.100.254.254,
     host=ns4, domain=, nis-domain=(none),
     bootserver=10.100.1.30, rootserver=10.100.1.30, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 10.100.1.30
Looking up port of RPC 100005/1 on 10.100.1.30
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 76k init
INIT: version 2.84 booting

[-- Attachment #2: Type: text/html, Size: 12606 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MPC5200 with PCF8563 RTC
  2004-09-23 18:06 MPC5200 with PCF8563 RTC Jón Benediktsson
@ 2004-09-23 20:07 ` Wolfgang Denk
  2004-09-24 11:42   ` Jón Benediktsson
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2004-09-23 20:07 UTC (permalink / raw)
  To: Jón Benediktsson; +Cc: linuxppc-dev

Dear Jón,

in message <OF4E11986A.DD692D61-ON00256F18.005010DC-00256F18.00637C77@marel.is> you wrote:
> 
> I am working on porting linux to a custom board based on MPC5200, which 
> has a PCF8563 real time clock connected via i2c2_io and i2c2_clk pins.
> It looks like this same combination is used on the PM520 board.

Indeed.

> I am however having a more difficult time getting the linux kernel 
> (linuxppc_2_4_devel from Denx) to work with PCF8563.  I get errors from 
> rtc_rd( ), but I
> can't understand why.  I have compared the i2c clock signals between 

It works fine on the PM520...

...
> Calibrating delay loop (skipped)... 0.05 BogoMIPS

Seems to be misconfigured?

> i2c-core.o: i2c core module version 2.6.1 (20010830)
> i2c-dev.o: i2c /dev entries driver module version 2.6.1 (20010830)
> i2c-proc.o version 2.6.1 (20010830)
^^^^^^^^^^^^^

Compare your configuration against the  PM520;  we  don't  have  this
enabled.

...
> i2c-core.o: client [PCF8563] registered to adapter [PM520 I2C module #2 interface](pos. 0).

I don't see this either.

> RTC switching kernel pointers

Before the i2c-algo-5xxx.o was initialized??

> i2c-algo-5xxx.o: scanning bus PM520 I2C module #2 interface...
> (0x00)(0x01)(0x02)(0x03)(0x04)(0x05)(0x06)(0x07)(0x08)(0x09)(0x0a)(0x0b)(0x0c)(0
> x0d)(0x0e)(0x0f)(0x10)(0x11)(0x12)(0x13)(0x14)(0x15)(0x16)(0x17)(0x18)(0x19)(0x1
> a)(0x1b)(0x1c)(0x1d)(0x1e)(0x1f)(0x20)(0x21)(0x22)(0x23)(0x24)(0x25)(0x26)(0x27)
> (0x28)(0x29)(0x2a)(0x2b)(0x2c)(0x2d)(0x2e)(0x2f)(0x30)(0x31)(0x32)(0x33)(0x34)(0
> x35)(0x36)(0x37)(0x38)(0x39)(0x3a)(0x3b)(0x3c)(0x3d)(0x3e)(0x3f)(0x40)(0x41)(0x4
> 2)(0x43)(0x44)(0x45)(0x46)(0x47)(0x48)(0x49)(0x4a)(0x4b)(0x4c)(0x4d)(0x4e)(0x4f)
> (0x50)(0x51)(0x52)(0x53)(0x54)(0x55)(0x56)(0x57)(0x58)(0x59)(0x5a)(0x5b)(0x5c)(0
> x5d)(0x5e)(0x5f)(0x60)(0x61)(0x62)(0x63)(0x64)(0x65)(0x66)(0x67)(0x68)(0x69)(0x6
> a)(0x6b)(0x6c)(0x6d)(0x6e)(0x6f)(0x70)(0x71)(0x72)(0x73)(0x74)(0x75)(0x76)(0x77)
> (0x78)(0x79)(0x7a)(0x7b)(0x7c)(0x7d)(0x7e)(0x7f)
> i2c-pm520.o: I2C module #2 installed

Ummm... you should see only existing devices here, something like this:

i2c-algo-5xxx.o: scanning bus PM520 I2C module #2 interface...
........................................................................................(0x58)(0x59)(0x5a)(0x5b)(0x5c)(0x5d)(0x5e)(0x5f)...............................(0x7f)
i2c-pm520.o: I2C module #2 installed


> eth0: status: link up, 100 Mbps Half Duplex.
                                  ^^^^^^^^^^^^
Is this correct?

> Content-Type: text/html; charsetÿSO-8859-1"
> Content-Transfer-Encoding: quoted-printable

Please don't post HMTL to mailing lists.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
A Chairman was as necessary to a Board planet  as  the  zero  was  in
mathematics, but being a zero had big disadvantages...
                         - Terry Pratchett, _The Dark Side of the Sun_

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MPC5200 with PCF8563 RTC
  2004-09-23 20:07 ` Wolfgang Denk
@ 2004-09-24 11:42   ` Jón Benediktsson
  0 siblings, 0 replies; 3+ messages in thread
From: Jón Benediktsson @ 2004-09-24 11:42 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-dev

wd@denx.de wrote on 23.09.2004 20:07:57:

>=20
> > I am however having a more difficult time getting the linux kernel=20
> > (linuxppc=5F2=5F4=5Fdevel from Denx) to work with PCF8563.  I get error=
s=20
from=20
> > rtc=5Frd( ), but I
> > can't understand why.  I have compared the i2c clock signals between=20
>=20
> It works fine on the PM520...
>=20

Thanks for your hints.  I tried configuring the kernel for the pm520 board
(make PM520=5Fconfig) and then the RTC stuff works on my board.  Obviously I
had something misconfigured that resulted in the strange behaviour of i2c.

>=20
>=20
> > eth0: status: link up, 100 Mbps Half Duplex.
>                                   ^^^^^^^^^^^^
> Is this correct?

No, it is actually incorrect and this is something that I need to fix.
My board (NS4) has a DP83847 PHY on the FEC.  I modified fec.c to avoid
kernel panic, but I do not have the PHY handling 100% correct yet.
Ethernet communications are working though, at least when connected to=20
a Cisco Catalyst 2950 with autonegotiation it establishes 100 Mbps Full=20
Duplex.
When connected to an old HP 10Mbps hub linux reports as above, 100 MBps=20
Half Duplex,
but the communications do work despite wrong reported speed.

Any suggestions for reference code for DP83847 with MPC5200 ?

Many thanks,
J=F3n Benediktsson
Marel hf.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-09-24 11:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 18:06 MPC5200 with PCF8563 RTC Jón Benediktsson
2004-09-23 20:07 ` Wolfgang Denk
2004-09-24 11:42   ` Jón Benediktsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).