10/09/2011
第一步是连接仿真器。
打开ltib默认的MPC8309配置,修改
- DDR大小为128M
- NOR Flash为8bit
OK,连接上仿真器,仿真器居然没有8309的选项,郁闷,下载了8309的补丁包,EPPC_8.8_830X_b101126.exe。安装,可以选择8309了。又在freescale上瞄了一下,CW8.8.5的patch可以支持win7,这是个好消息,因为之前都是在虚拟机用的,贼不方便。安装好patch,在按照说明装好了驱动,又拿8315的板子连了一下,通过。
好的,连上8309,擦写Flash,显示”连接失败”。新建一个8309的工程,点击Debug->connect,显示无法复位CPU或者无法将CPU置于DEBUG模式,看来是CPU没有正常工作。
郁闷了,检查8309配置,复位配置字为1100,没问题;JTAG设计也没问题;复位没问题;晶振也没问题。最后发现PCI_SYNC_IN没有和PCI_SYNC_OUT连接,导致CPU没有时钟。还好PCI_SYNC_IN通过一个下拉电阻引了出来,不然这个板子就废掉了。
将33M时钟飞到PCI_SYNC_IN上,在次连接一下,成功!擦除Flash,成功!校验Flash,不对。到底是没擦除还是校验错呢?还好Flash上Busy信号接了灯,在擦一下,发现灯亮了,所以应该是校验错误。因为8309和8315是一样的,将8309的NOR Flash配置改成与8315一样。校验成功!
接着烧写u-boot,改为NOR Flash启动,串口显示启动信息,但是出现”Error in I2C Direction reg read”,搜索u-boot源码,原来freescale公版会先读一个EEPROM。注释掉。
这次显示了”Not a microcode”,然后就在打印NET:后停掉了。跟踪了代码,发现是在初始化QE的UEC的时候执行初始化TX&RX的时候一直没有等到命令执行完成。会不会和”Not a microcode”有关呢。查看源码发现这个是因为u-boot给QE下载微代码的时候打印的,因为我的u-boot是没有这个微代码的。但是后面程序有设置启动微码指令,注释掉。发现还是这个问题。
10/10/2011
难道是QE输入时钟的问题,我们接的是33M的,6倍频到198M。公版是25M,8倍频到200M。而MII的时钟是25M。
换成25M时钟,修改QE PLL倍频,发现还是一样。
会不会是8309必须需要一个微码呢?google、看QE的手册,没有什么可用的资料。在次检索ltib,突然在tools_8309som下面的nor_flashing目录下面发现一个好东西”iram_mpc8309_r1.bin”。哈哈,找到了。用USB TAP烧写到指定位置。”=>”提示符有了。ping了一下地址。发现没有读到PHY ID。
10/11/2011
测量了MDC的频率,4百多K,难道是太低了。改成1.25M,依然读不到ID。找了一个之前9200接的一个底板,带9161芯片,飞上MDIO/MDC,可以读到PHY ID。我们的mii管理接口接了3个芯片,2片DM9161和一片交换机芯片,交换机芯片的mii管理接口是和I2C接口互用的,需要上拉,虽然我们上拉了。但是难道是交换机芯片引起的。于是我们单独接一片DM9161的mii管理接口。发现仍然不行。看来是DM9161工作不正常。
PHY芯片一般有MII接口,MDIO接口和变压器接口组成。我们只接了MDIO和变压器接口发现可以识别并且芯片,但是芯片ID读错了。后来发现原来是MDIO接口飞线太长导致上拉不可靠,在靠接芯片的地方在接了上拉可以正确的识别芯片,读寄存器发现芯片可以自动协商成功。
全部焊上后依然不正常,看来是MII接口引起的。
10/12/2011
只能放大招了。我们一个管脚、一个管脚的焊上,发现有2个管脚会导致DM9161工作不正常,一个是CRS,另外一个是COL。
研究了一下8309手册,它的UEC接口电路是带有内部上拉电阻的,复位默认为使能上拉。将这2个管脚用一个电阻下拉后,终于可以Probe到PHY ID。
tftp成功,修改内核dts文件有关PHY address的地方,生成内核,dtb文件。烧写,启动,令人神往的启动信息。。。
U-Boot 2010.06-dirty (Oct 13 2011 – 11:04:22) MPC83XX
Reset Status:
CPU: e300c3, MPC8309E, Rev: 1.1 at 400 MHz, CSB: 133.333 MHz, QE: 200 MHz
Board: Freescale MPC8309SOM
I2C: ready
DRAM: 128 MiB
FLASH: 8 MiB
Firmware ‘Microcode version 0.0.0 for MPC8309 r1.0’ for 8309 V1.0
QE: uploading microcode ‘Microcode for MPC8309 r1.0’
NAND: 64 MiB
*** Warning – bad CRC, using default environmentIn: serial
Out: serial
Err: serial
MMC: FSL_ESDHC: 0
Net: FSL UEC0, FSL UEC1, FSL UEC2
Hit any key to stop autoboot: 0
## Booting kernel from Legacy Image at fe100000 …
Image Name: Linux-2.6.34-g4ee8913-dirty
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1791799 Bytes = 1.7 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OK
## Loading init Ramdisk from Legacy Image at fe300000 …
Image Name: uboot ext2 ramdisk rootfs
Image Type: PowerPC Linux RAMDisk Image (gzip compressed)
Data Size: 4903644 Bytes = 4.7 MiB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum … OK
## Flattened Device Tree blob at fe0e0000
Booting using the fdt blob at 0xfe0e0000
Uncompressing Kernel Image … OK
Loading Ramdisk to 07a33000, end 07ee02dc … OK
Loading Device Tree to 007fb000, end 007fff8b … OK
Using MPC8309 SOM machine description
Linux version 2.6.34-g4ee8913-dirty (kaoru@dev) (gcc version 4.1.2) #7 Thu Oct 13 12:00:52 CST 2011
Found initrd at 0xc7a33000:0xc7ee02dc
bootconsole [udbg0] enabledsetup_arch: bootmem
mpc8309_som_setup_arch()
Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
PCI host bridge /pci@e0008500 (primary) ranges:
MEM 0x0000000080000000..0x000000008fffffff -> 0x0000000080000000 Prefetch
MEM 0x0000000090000000..0x000000009fffffff -> 0x0000000090000000
IO 0x00000000d0000000..0x00000000d3ffffff -> 0x00000000d0000000
arch: exit
Zone PFN ranges:
DMA 0x00000000 -> 0x00008000
Normal empty
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00008000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: root=/dev/ram rw panic=15 mem=128m console=ttyS0,115200
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 121348k/131072k available (3500k kernel code, 9724k reserved, 164k data, 92k bss, 164k init)
Kernel virtual memory layout:
* 0xfffdf000..0xfffff000 : fixmap
* 0xfcef7000..0xfe000000 : early ioremap
* 0xc9000000..0xfcef7000 : vmalloc & ioremap
Hierarchical RCU implementation.
NR_IRQS:512 nr_irqs:512
IPIC (128 IRQ sources) at c9000700
clocksource: timebase mult[7800001] shift[22] registered
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs…
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 4788k freed
JFFS2 version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 246
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
serial8250.0: ttyS1 at MMIO 0xe0004600 (irq = 16) is a 16550A
brd: module loaded
loop: module loaded
fe000000.flash: Found 2 x8 devices at 0x0 in 16-bit bank
NOR chip too large to fit in mapping. Attempting to cope…
Support for command set 0001 not present
gen_probe: No supported Vendor Command Set found
of-flash fe000000.flash: do_map_probe() failed
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bit)
RedBoot partition parsing not available
Creating 6 MTD partitions on "fff00000.flash":
0x000000000000-0x000000100000 : "U-Boot-NAND"
0x000000100000-0x000000200000 : "DTB-NAND"
0x000000200000-0x000000600000 : "Ramdisk-NAND"
0x000000600000-0x000000c00000 : "Reserved-NAND"
0x000000c00000-0x000002200000 : "Kernel-NAND"
0x000002200000-0x000003a00000 : "JFFS2-NAND"
eLBC NAND device at 0xfff00000, bank 1
mem->start=0xe0007000, irq=17
mpc8xxx_spi mpc8xxx_spi.0: at 0xc9078000 (irq = 17), CPU mode
Fixed MDIO Bus: probed
ucc_geth: QE UCC Gigabit Ethernet Controller
ucc_geth: UCC1 at 0xe0102000 (irq = 18)
ucc_geth: UCC2 at 0xe0103000 (irq = 19)
ucc_geth: UCC3 at 0xe0102200 (irq = 34)
step3
Freescale PowerQUICC MII Bus: probed
usbmon: debugfs is not available
ehci_hcd: USB 2.0 ‘Enhanced’ Host Controller (EHCI) Driver
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 38, io base 0xe0023000
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 0.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver…
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
i2c /dev entries driver
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
mmc0: SDHCI controller on e002e000.sdhci [e002e000.sdhci] using DMA
TCP cubic registered
NET: Registered protocol family 17
RAMDISK: gzip image found at block 0
RAMDISK: incomplete write (18852 != 32768)
write error
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing unused kernel memory: 164k init
Mounting /proc and /sys
Starting the hotplug events dispatcher udevd
Synthesizing initial hotplug events
Setting the hostname to mpc8306som
Mounting filesystems
mount: mounting usbfs on /proc/bus/usb failed: No such file or directory
Running sysctl
Setting up networking on loopback device:
Setting up networking on eth0:
Setting up networking on eth1:
Starting inetd:Welcome to the LTIB Embedded Linux Environment
!!!!! WARNING !!!!!!!
The default password for the root account is: root
please change this password using the ‘passwd’ command
and then edit this message (/etc/issue) to remove this messagempc8306som login:
进入系统,网卡工作正常。