cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
guangye.tian
Visitor
Visitor
10,753 Views
Registered: ‎01-29-2009

"Finalizing device tree... flat tree at 0x5a4300" ---- Linux booting problem on custom board. (virtex4fx140)

Jump to solution

Hello,

 


I am trying to boot linux on a powerpc405 based xilinx board. And booting process stops after displaying the "Finalizing device tree.." message. I did some modification on the device tree generated by xilixn edk10.1 and I doubte the problem may be there. I want to ask you advice as to what direction should I go to solve this problem.

 

 

1. Platform

# Created by Base System Builder Wizard for Xilinx EDK 10.1.03 Build EDK_K_SP3.6
# Wed Jun 10 21:23:15 2009
# Target Board:  Custom
# Family:    virtex4
# Device:    xc4vfx140
# Package:   ff1517
# Speed Grade:  -10
# Processor: ppc405_0
# Processor clock frequency: 150.00 MHz
# Bus clock frequency: 75.00 MHz
# On Chip Memory :  16 KB
# Total Off Chip Memory : 256 MB
# - DDR2_SDRAM_W1D32M72R8A_5A = 256 MB

2. Linux kernel

linux-2.6-xlnx.git 2.6.28

3. Device tree

Before we have implemented Linux console on the xil_uartlite ip.

On our platform we don't have a RS232 port, so we use the mdm uart facility instead for Linux console output. The address offset input/output fifo, and status/control registers, and the bit layout of the mdm status/control registers are compatible with those of xil_uartlite interface. So in the dts tree generator, we put the Linux console on the mdm_0, and we use the uartlite driver.

We also made necessary modifications to the Linux kernel to be able to use uartlite driver for mdm. Below are the files we modified:

arch/powerpc/boot/serial.c
    In the function, "int serial_console_init(void)", the "xlnx,mdm-1.00.d" is added in the condition for choosing the uartlite component.
   
drivers/serial/uartlite.c
    Add "xlnx,mdm-1.00.d" in the "ulite_of_match" compatible list.

In the generated .dts file, we added "device_type = "serial";" for the debug node.

Below is the final device tree:

/*
 * Device Tree Generator version: 1.1
 *
 * (C) Copyright 2007-2008 Xilinx, Inc.
 * (C) Copyright 2007-2008 Michal Simek
 *
 * Michal SIMEK <monstr@monstr.eu>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * 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
 *
 * CAUTION: This file is automatically generated by libgen.
 * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
 *
 * XPS project directory: try7_2
 */

/dts-v1/;
/ {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "xlnx,virtex405", "xlnx,virtex";
    model = "testing";
    DDR2_SDRAM_W1D32M72R8A_5A: memory@0 {
        device_type = "memory";
        reg = < 0x0 0x10000000 >;
    } ;
    chosen {
        bootargs = "console=ttyUL0,9600 root=/dev/ram";
        linux,stdout-path = "/plb@0/debug@84400000";
    } ;
    cpus {
        #address-cells = <1>;
        #cpus = <0x1>;
        #size-cells = <0>;
        ppc405_0: cpu@0 {
            clock-frequency = <150000000>;
            compatible = "PowerPC,405", "ibm,ppc405";
            d-cache-line-size = <0x20>;
            d-cache-size = <0x4000>;
            dcr-access-method = "native";
            dcr-controller ;
            device_type = "cpu";
            i-cache-line-size = <0x20>;
            i-cache-size = <0x4000>;
            model = "PowerPC,405";
            reg = <0>;
            timebase-frequency = <150000000>;
            xlnx,apu-control = <0xde00>;
            xlnx,apu-udi-1 = <0xa18983>;
            xlnx,apu-udi-2 = <0xa38983>;
            xlnx,apu-udi-3 = <0xa589c3>;
            xlnx,apu-udi-4 = <0xa789c3>;
            xlnx,apu-udi-5 = <0xa98c03>;
            xlnx,apu-udi-6 = <0xab8c03>;
            xlnx,apu-udi-7 = <0xad8c43>;
            xlnx,apu-udi-8 = <0xaf8c43>;
            xlnx,deterministic-mult = <0x0>;
            xlnx,disable-operand-forwarding = <0x1>;
            xlnx,fastest-plb-clock = "DPLB0";
            xlnx,generate-plb-timespecs = <0x1>;
            xlnx,mmu-enable = <0x1>;
            xlnx,pvr-high = <0x0>;
            xlnx,pvr-low = <0x0>;
        } ;
    } ;
    plb: plb@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
        ranges ;
        lb2plbv46_0: lb2plbv46@81900000 {
            compatible = "xlnx,lb2plbv46-1.00.e";
            reg = < 0x81900000 0x100000 >;
            xlnx,family = "virtex4";
            xlnx,mplb-awidth = <0x20>;
            xlnx,mplb-clk-period-ps = <0x2710>;
            xlnx,mplb-dwidth = <0x40>;
            xlnx,mplb-native-dwidth = <0x40>;
            xlnx,mplb-p2p = <0x0>;
            xlnx,mplb-smallest-slave = <0x20>;
            xlnx,nb-mplb-awidth = <0x20>;
            xlnx,nb-mplb-dwidth = <0x40>;
            xlnx,nb-mplb-native-dwidth = <0x20>;
            xlnx,user-slv-num-reg = <0x40>;
        } ;
        mdm_0: debug@84400000 {
            compatible = "xlnx,mdm-1.00.d";
            device_type = "serial";
            interrupt-parent = <&xps_intc_0>;
            interrupts = < 0 0 >;
            reg = < 0x84400000 0x10000 >;
            xlnx,family = "virtex4";
            xlnx,interconnect = <0x1>;
            xlnx,jtag-chain = <0x2>;
            xlnx,mb-dbg-ports = <0x1>;
            xlnx,uart-width = <0x8>;
            xlnx,use-uart = <0x1>;
            xlnx,write-fsl-ports = <0x0>;
        } ;
        xps_bram_if_cntlr_1: xps-bram-if-cntlr@ffffe000 {
            compatible = "xlnx,xps-bram-if-cntlr-1.00.a";
            reg = < 0xffffe000 0x2000 >;
            xlnx,family = "virtex4";
        } ;
        xps_gpio_0: gpio@81400000 {
            compatible = "xlnx,xps-gpio-1.00.a";
            reg = < 0x81400000 0x10000 >;
            xlnx,all-inputs = <0x0>;
            xlnx,all-inputs-2 = <0x0>;
            xlnx,dout-default = <0x0>;
            xlnx,dout-default-2 = <0x0>;
            xlnx,family = "virtex4";
            xlnx,gpio-width = <0x1>;
            xlnx,interrupt-present = <0x0>;
            xlnx,is-bidir = <0x0>;
            xlnx,is-bidir-2 = <0x1>;
            xlnx,is-dual = <0x0>;
            xlnx,tri-default = <0xffffffff>;
            xlnx,tri-default-2 = <0xffffffff>;
        } ;
        xps_intc_0: interrupt-controller@81800000 {
            #interrupt-cells = <0x2>;
            compatible = "xlnx,xps-intc-1.00.a";
            interrupt-controller ;
            reg = < 0x81800000 0x10000 >;
            xlnx,num-intr-inputs = <0x1>;
        } ;
    } ;
    ppc405_0_dplb1: plb@1 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
        ranges ;
        mpmc@0 {
            #address-cells = <1>;
            #size-cells = <1>;
            compatible = "xlnx,mpmc-4.03.a";
        } ;
    } ;
}  ;

4. Linux booting

We then set up the system and download the linux image in the ddr2 memory via the Xilixn Platform  Cable USB II.

Below is the download message:
*******************************************************************
XMD% dow simpleImage.virtex405-alpha-data.elf
System Reset .... DONE
Downloading Program -- simpleImage.virtex405-alpha-data.elf
        section, .text: 0x00400000-0x00408d2b
        section, .data: 0x00409000-0x0040ac5b
        section, __builtin_cmdline: 0x0040ac5c-0x0040ae5b
        section, .kernel:dtb: 0x0040ae60-0x0040bf84
        section, .kernel:vmlinux.strip: 0x0040c000-0x00596730
        section, .bss: 0x00597000-0x005a3ddb
Setting PC with Program Start Address 0x00400000
*******************************************************************

Then the processor is run, but blocked at "Finalizing device tree..":
******************************************************************
zImage starting: loaded at 0x00400000 (sp: 0x00597eb0)

Allocating 0x36d1ac bytes for kernel ...

gunzipping (0x00000000 <- 0x0040c000:0x00596731)...done 0x349ef0 bytes



Linux/PowerPC load: console=ttyUL0,9600 root=/dev/ram

Finalizing device tree... flat tree at 0x5a4300
*******************************************************************



Then we stopped the processor, and examined the regester values. The strange thing is that the register value change for the first couple of register read command. The pc pointer points to a address "80358080" which is neither the virtual address space ni the physical address.
*******************************************************************
RUNNING> XMD% stop
XMD% Info:User Interrupt, Processor Stopped at 0x0000114c
Info:User Interrupt, Processor Stopped at 0x0000114c


XMD% rrd
    r0: 00000000      r8: fffffffc     r16: 80358084     r24: 80358084
    r1: c0345fd0      r9: 00008c6b     r17: 80358084     r25: 80358084
    r2: c03264b8     r10: 80358084     r18: 80358084     r26: 80358084
    r3: 80358084     r11: 80358084     r19: 80358084     r27: 80358084
    r4: 00000000     r12: 80358084     r20: ffffffff     r28: 80358084
    r5: 000231ac     r13: 80358084     r21: 80358084     r29: 80358084
    r6: 00000000     r14: 80358084     r22: 80358084     r30: 80358084
    r7: 00000010     r15: 80358084     r23: 80358084     r31: 80358084
    pc: 80358080     msr: 80358084


XMD% rrd
    r0: 80358084      r8: 80358084     r16: 80358084     r24: 80358084
    r1: 80358084      r9: 80358084     r17: 80358084     r25: 80358084
    r2: 80358084     r10: 80358084     r18: 80358084     r26: 80358084
    r3: 80358084     r11: 80358084     r19: 80358084     r27: 80358084
    r4: 80358084     r12: 80358084     r20: 80358084     r28: 80358084
    r5: 80358084     r13: 80358084     r21: 80358084     r29: 80358084
    r6: 80358084     r14: 80358084     r22: 80358084     r30: 80358084
    r7: 80358084     r15: 80358084     r23: 80358084     r31: 80358084
    pc: 80358080     msr: 80358084
*******************************************************************

After continuing the processor, the "stop" commnd no longer works but the
"reset" command stops the processor at the virtual address "c000aed8", which
after examining the assember code of the "vmlinux" image, is situate at the
<__delay> section.
 
*******************************************************************
XMD% con
Info:Processor started. Type "stop" to stop processor
Info:Processor started. Type "stop" to stop processor


RUNNING> XMD% stop
 ERROR: Unable to Stop Processor
Unable to STOP PowerPC Processor




XMD% rst
System reset successfully

XMD% rrd
    r0: 00012ad9      r8: 6f646520     r16: ffffffff     r24: 000000a1
    r1: c0345dc0      r9: f15b545e     r17: ffffffff     r25: 0000000b
    r2: c03264b8     r10: 00000001     r18: 77ffaff7     r26: c0345f20
    r3: 000186a0     r11: c0340000     r19: bbff5ffb     r27: c02ba100
    r4: c0345f20     r12: 50000000     r20: ffffffff     r28: c0320000
    r5: 0000000b     r13: ffffffff     r21: fffffff8     r29: 00029030
    r6: c0345e68     r14: ffffffff     r22: ffffffff     r30: 00000001
    r7: 6c782063     r15: ffffffff     r23: ffffffff     r31: 00000001
    pc: c000aed8     msr: 00021030
*******************************************************************
We also examined the boot code "main.c" situated at "arch/powerpc/boot", which executes until the end of code
and get stucked in executing "kentry(ft_addr, 0, NULL);".

Can you give me some hint to this problem? Do I have to examing more the uartlite driver compatiblity problem or do I have to examing the kernel
source? Which part of the kernel source tree should I read?

Thank you very much,

Guangye

0 Kudos
1 Solution

Accepted Solutions
brianhill
Xilinx Employee
Xilinx Employee
12,484 Views
Registered: ‎04-23-2008

Try having a look at XAPP1137 "Linux Operating System Software Debugging Techniques with Xilinx Embedded Development Platforms"

 

http://www.xilinx.com/support/documentation/application_notes/xapp1137.pdf

 

-Brian

View solution in original post

0 Kudos
7 Replies
brianhill
Xilinx Employee
Xilinx Employee
12,485 Views
Registered: ‎04-23-2008

Try having a look at XAPP1137 "Linux Operating System Software Debugging Techniques with Xilinx Embedded Development Platforms"

 

http://www.xilinx.com/support/documentation/application_notes/xapp1137.pdf

 

-Brian

View solution in original post

0 Kudos
guangye.tian
Visitor
Visitor
10,637 Views
Registered: ‎01-29-2009

Hello Brian,

 

Thank you for your response. The  xapp1137.pdf document is really useful and I gained a lot of debug, linux kernel skill in looking it through.

 

Finally I found out that the problem comes from the uart port of the mdm ip. When it is connected to the plb bus, and configured as the console output of the linux kernel, each time the bootloader want to pass to virtual mode, mdm will generate a plb data error, which casues a machine-check exception to the ppc405. And the processor will be stuck in the real->virtual mode, Machine-check exception, real mode interrupt handler, real->vertual mode ..., dead loop.

 

And I read some old version mdm document, mdm v1.00a, in the design parameters section, it explicitely specifies that the uart interface on the opb bus. So I tried to connect the mdm ip on the opb bus and to the plb bus via the plb-opb bridge. It works.

 

But I am still wondering the possible problem about the uart console when connected directly to the plb bus. 

 

Thank you,

 

Guangye

0 Kudos
kramu
Contributor
Contributor
9,245 Views
Registered: ‎02-19-2009

Hello,

 

I have the same problem. My board does not have RS232 port. The board has FX200T FPGA which contains PPC440. Looks like there is no support for opb bus in PPC440. Do you know of any work around for this.

0 Kudos
Anonymous
Not applicable
8,583 Views

I was able to get an mdm connected to a ppc440 by using a plb-to-opb bridge.  In EDK 10.1, this requires setting the option to display "Available" IP cores under preferences to make the bridge show up in the IP list.  Then under the IP settings for the MDM, UART section, set the bus interface to OPB.

 

Unfortunately I'm also stuck with working bootloader output but no kernel output. 

0 Kudos
jpl@xiphos.ca
Adventurer
Adventurer
8,576 Views
Registered: ‎10-28-2007

If you have no console output from the kernel, but you have access to the bootloader, then look at the logbuf data.  Follow the instructions here:

 

http://xilinx.wikidot.com/debugging-kernel-boot-problems#toc2

 

They work wonderfully.

 

Joshua

0 Kudos
hcuongvn
Observer
Observer
6,382 Views
Registered: ‎12-21-2011

hi @guangye.tian

  I have the same problem. My board does not have RS232 port,replace RS232 to mdm. I used board NetFPGA 1G, powerpc 405. I used 2 SRAM adrres contious ( 0x000000 ->0x1fffff, 200000->0x3fffff), I dow kernel on SRAM (0x200000->0x3fffff) ,extract SRAM1 ( 0x000000->0x1fffff) not SDRAM. I used opb so you done. But It's also no run. I think file config linux,have problem .In file config kernel, I don't use config (Advanced sepup-> Prompt for advanced kernel configuration options),I don't know problem in this.???? I hope you , my suggestions for this problem.

 

   Thanks.

0 Kudos
hcuongvn
Observer
Observer
6,348 Views
Registered: ‎12-21-2011

hi guangye.tian

   You can share for me, file .config kernel and file mhs of EDK ??? I did the same to you, but it's not run. I don't know, why???

   Thanks .

0 Kudos