AW: problem with cuImage.mpc834x_mds image

2017-03-24 Thread Giuseppe Lippolis
> On Fri, 2016-05-27 at 23:12 +0200, Giuseppe Lippolis wrote:
> > Dear All,
> > I'm trying with buildroot to build the linux-4.4.3 for an iomega 150d
> > machine mounting the mpc8347E sys.

[...]

> > Finalizing device tree... flat tree at 0x94d120
> >
> >
> > But at this point the process crash and the system is reset.
> > It should be something near the handover between the first kenel boot
> > stage and the vmlinux start, but I do not have a jtag to proceed the
> > investigation.

[..]

> > Any suggestion?
> 
> Check (with serial output) that flow control reaches the very end of the
> bootwrapper before it jumps to Linux.  Use the same code that you use in
> head.S (with loop added in both cases).  Print the entry address, and some
> bytes loaded from that address to confirm the image is there.  Check that the
> BATs are set up correctly, etc.
> 
> -Scott

Hi Scott, thanks for your tips.
I proceed my investigation using now Linux-4.10.4 and I found two issue:

1) the U-Boot 1.1.4 make some mistake when decompress the gzip -9. Therefore, 
as a workaround, I currently modify the wrapper to use the uncompressed image.

Nevertheless the image is crashing during the boot.

I modified the  cpu_setup_6xx.S in this way (in order to print debug char on 
the console) :

.equ cnsladdr, 0xe0004500

_GLOBAL(__setup_cpu_603)
mflrr5
BEGIN_MMU_FTR_SECTION
li  r10,0
mtspr   SPRN_SPRG_603_LRU,r10   /* init SW LRU tracking */
END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)

lis r23, cnsladdr@ha
addir23, r23, cnsladdr@l
li  r25, 'i'
stb r25, 0(r23)

BEGIN_FTR_SECTION
bl  __init_fpu_registers

lis r23, cnsladdr@ha
addir23, r23, cnsladdr@l
li  r25, 'l'
stb r25, 0(r23)

END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE)
bl  setup_common_caches

lis r23, cnsladdr@ha
addir23, r23, cnsladdr@l
li  r25, 'm'
stb r25, 0(r23)

mtlrr5

lis r23, cnsladdr@ha
addir23, r23, cnsladdr@l
li  r25, 'm'
stb r25, 0(r23)
trap

blr

and now I get:

Finalizing device tree... flat tree at 0xbdb960
Il

Therefore the code crash during the call in:
bl  setup_common_caches


I'm using the iomega_150d based on the MPC8347.

Do you have some tips about the setup_common_caches?

Thanks.
Bye.



Problem with cuImage on 83x

2017-03-20 Thread Giuseppe Lippolis
Dear All,
I'm trying, using buildroot, to generate an image for my iomega 150d
(mpc8347 based).
I'm prepared the device tree and configured the platform with:
CONFIG_PPC_83xx=y
CONFIG_MPC834x_MDS=y
CONFIG_MPC834x_ITX=y

The image I'm generating is cuImage.

I generated the image and the system crash after the wrapper call the
kernel.

## Booting image at 0100 ...
   Image Name:   Linux-4.10.4
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:2988301 Bytes =  2.8 MB
   Load Address: 0060
   Entry Point:  006001f4
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Memory <- <0x0 0x2000> (512MB)
ethernet0: local-mac-address <- 00:d0:b8:01:d1:9f
ethernet1: local-mac-address <- 4b:ff:ff:60:72:6f 
CPU clock-frequency <- 0x179a7b00 (396MHz) 
CPU timebase-frequency <- 0x3ef1480 (66MHz) 
CPU bus-frequency <- 0xfbc5200 (264MHz)

zImage starting: loaded at 0x0060 (sp: 0x1ffb2cf8) Decompression error:
'Not a gzip file'
No valid compressed data found, assume uncompressed data Allocating 0x5f9250
bytes for kernel...
0x5bd520 bytes of uncompressed data copied

Linux/PowerPC load: root=/dev/mtdblock1 ro rootfstype=cramfs devfs=mount
console=ttySc 
Finalizing device tree... flat tree at 0xbdb960


After some investigation I realize that the system crash very early on the
early_init call:

c04c:   48 55 f8 71 bl  c055f8bc 

This call is linked in the .init.text section.
According to the readelf readout:

Section Headers:
  [Nr] Name  TypeAddr OffSize   ES Flg Lk
Inf Al
  [15] .init.textPROGBITSc055a000 56a000 025ae0 00  AX  0
0  4

And again according to the objdump/readelf readout:

c055a000 <__init_begin>:
c055a000:   ff ef b1 b0 .long 0xffefb1b0

c055a004 :
c055a004:   94 21 ff e0 stwur1,-32(r1)
c055a008:   7c 08 02 a6 mflrr0
c055a00c:   42 9f 00 05 bcl 20,4*cr7+so,c055a010


[...]

c055f8bc :
c055f8bc:   94 21 ff f0 stwur1,-16(r1)
c055f8c0:   7c 08 02 a6 mflrr0
c055f8c4:   bf c1 00 08 stmwr30,8(r1)

Hex dump of section '.init.text':
  0xc055a000 ffefb1b0 9421ffe0 7c0802a6 429f0005 .!..|...B...
  0xc055a010 bf61000c 7fc802a6 7c7b1b78 90010024 .a..|{.x...$


But If I execute a post-mortem dump on the target memory I get:

0055a000: afafd773 c13b262f 7be3b7ba ff3e75ef...s.;&/{>u.
0055a010: 3e636df5 1d444cb1 9eeafdc9 bdb5eff4>cm..DL.

[..]

0055f8b0: ba7a7df9 9ca516fd 16faf9cd 11664eb4.z}..fN.
0055f8c0: 08addfb6 db7eae53 29ad963e db5a2fef.~.S)..>.Z/.


So It seems that the wrapper is making a mistake during the kernel copy.

I will proceed with the analysis, but before to proceed I would like to ask
if my analysis is correct or I'm wrong somewhere.

Thanks,
Bye.




Problem with cuImage on 83x

2017-03-20 Thread Giuseppe Lippolis
Dear All,
I'm trying, using buildroot, to generate an image for my iomega 150d
(mpc8347 based).
I'm prepared the device tree and configured the platform with:
CONFIG_PPC_83xx=y
CONFIG_MPC834x_MDS=y
CONFIG_MPC834x_ITX=y

The image I'm generating is cuImage.

I generated the image and the system crash after the wrapper call the
kernel.

## Booting image at 0100 ...
   Image Name:   Linux-4.10.4
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:2988301 Bytes =  2.8 MB
   Load Address: 0060
   Entry Point:  006001f4
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Memory <- <0x0 0x2000> (512MB)
ethernet0: local-mac-address <- 00:d0:b8:01:d1:9f
ethernet1: local-mac-address <- 4b:ff:ff:60:72:6f
CPU clock-frequency <- 0x179a7b00 (396MHz)
CPU timebase-frequency <- 0x3ef1480 (66MHz)
CPU bus-frequency <- 0xfbc5200 (264MHz)

zImage starting: loaded at 0x0060 (sp: 0x1ffb2cf8)
Decompression error: 'Not a gzip file'
No valid compressed data found, assume uncompressed data
Allocating 0x5f9250 bytes for kernel...
0x5bd520 bytes of uncompressed data copied

Linux/PowerPC load: root=/dev/mtdblock1 ro rootfstype=cramfs devfs=mount
console=ttySc
Finalizing device tree... flat tree at 0xbdb960


After some investigation I realize that the system crash very early on the
early_init call:

c04c:   48 55 f8 71 bl  c055f8bc 

This call is linked in the .init.text section.
According to the readelf readout:

Section Headers:
  [Nr] Name  TypeAddr OffSize   ES Flg Lk
Inf Al
  [15] .init.textPROGBITSc055a000 56a000 025ae0 00  AX  0
0  4

And again according to the objdump/readelf readout:

c055a000 <__init_begin>:
c055a000:   ff ef b1 b0 .long 0xffefb1b0

c055a004 :
c055a004:   94 21 ff e0 stwur1,-32(r1)
c055a008:   7c 08 02 a6 mflrr0
c055a00c:   42 9f 00 05 bcl 20,4*cr7+so,c055a010


[...]

c055f8bc :
c055f8bc:   94 21 ff f0 stwur1,-16(r1)
c055f8c0:   7c 08 02 a6 mflrr0
c055f8c4:   bf c1 00 08 stmwr30,8(r1)

Hex dump of section '.init.text':
  0xc055a000 ffefb1b0 9421ffe0 7c0802a6 429f0005 .!..|...B...
  0xc055a010 bf61000c 7fc802a6 7c7b1b78 90010024 .a..|{.x...$


But If I execute a post-mortem dump on the target memory I get:

0055a000: afafd773 c13b262f 7be3b7ba ff3e75ef...s.;&/{>u.
0055a010: 3e636df5 1d444cb1 9eeafdc9 bdb5eff4>cm..DL.

[..]

0055f8b0: ba7a7df9 9ca516fd 16faf9cd 11664eb4.z}..fN.
0055f8c0: 08addfb6 db7eae53 29ad963e db5a2fef.~.S)..>.Z/.


So It seems that the wrapper is making a mistake during the kernel copy.

I will proceed with the analysis, but before to proceed I would like to ask
if my analysis is correct or I'm wrong somewhere.

Thanks,
Bye.



problem with cuImage.mpc834x_mds image

2016-05-27 Thread Giuseppe Lippolis
Dear All,

I'm trying with buildroot to build the linux-4.4.3 for an iomega 150d
machine mounting the mpc8347E sys.
Due the old U-Boot version is not possible to use the standard uImage, but
it is needed to set the cuImage target (the one embedding the device tree).
 
I start using the default configuration
arch/powerpc/configs/mpc83xx_defconfig,
and the default device tree mpc834x_mds.
 
In order to enable the console  output during the first linux boot stage I
added the following line at the end of the device tree file:
 
chosen {
linux,stdout-path = "/soc8349/
 serial at 4500";
};
 
The kernel is compiled and I get the cuImage.mpc834x_mds image.
 
Then I load it on the machine and execute:
 
tftp 0x1000 cuImage.mpc834x_mds
Speed: 1000, full duplex
Using Freescale TSEC0 device
TFTP from server 192.168.178.36; our IP address is 192.168.178.10
Filename 'cuImage.mpc834x_mds'.
Load address: 0x1000
Loading: #
 #
 #
 #
 #
 #
 
done
Bytes transferred = 2157489 (20ebb1 hex)
IOMEGA=> bootm 0x1000
## Booting image at 1000 ...
   Image Name:   Linux-4.4.3
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:2157425 Bytes =  2.1 MB
   Load Address: 0050
   Entry Point:  005001f8
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Memory <- <0x0 0x2000> (512MB)
ethernet0: local-mac-address <- 00:d0:b8:01:d1:9f
ethernet1: local-mac-address <- 9b:e3:00:01:72:6f
CPU clock-frequency <- 0x179a7b00 (396MHz)
CPU timebase-frequency <- 0x3ef1480 (66MHz)
CPU bus-frequency <- 0xfbc5200 (264MHz)
 
zImage starting: loaded at 0x0050 (sp: 0x1ffb2ce8)
Allocating 0x439a88 bytes for kernel ...
gunzipping (0x <- 0x0050e000:0x00940fe8)...done 0x422920 bytes
 
Linux/PowerPC load: root=/dev/mtdblock1 ro rootfstype=cramfs devfs=mount
console=ttyS0,115200 init=/linuxrc
Finalizing device tree... flat tree at 0x94d120
 
 
But at this point the process crash and the system is reset.
It should be something near the handover between the first kenel boot stage
and the vmlinux start, but I do not have a jtag to proceed the
investigation.
 
In any case it seems that the execution never entry the vmlinux start
(head_32.S).
 
I try to add this macro at the begin of the file:
 
.equ cnsladdr, 0xe0004500 (console address txreg)
 
.macro dbg_prnt nid
lis r24,  
cnsladdr at ha
addir24, r24,
 cnsladdr at l
li  r25, 'd'
stb r25, 0(r24)
li  r25, 'b'
stb r25, 0(r24)
li  r25, 'g'
stb r25, 0(r24)
li  r25, '0'
addir25, r25, \nid
stb r25, 0(r24)
li  r25, '\n'
stb r25, 0(r24)
.endm
 
 
But I do not see anything in the console.
The problem seems releted to the vmlinux call in arc/powerpc/boot/main.c
 
kentry = (kernel_entry_t) vmlinux.addr;
 
 
Any suggestion?
Bye.

 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

problem with cuImage.mpc834x_mds image

2016-05-27 Thread Giuseppe Lippolis
Dear All,
I'm trying with buildroot to build the linux-4.4.3 for an iomega 150d
machine mounting the mpc8347E sys.
Due the old U-Boot version is not possible to use the standard uImage, but
it is needed to set the cuImage target (the one embedding the device tree).

I start using the default configuration
arch/powerpc/configs/mpc83xx_defconfig,
and the default device tree mpc834x_mds.

In order to enable the console  output during the first linux boot stage I
added the following line at the end of the device tree file:

chosen {
linux,stdout-path = "/soc8349/serial at 4500";
};

The kernel is compiled and I get the cuImage.mpc834x_mds image.

Then I load it on the machine and execute:

tftp 0x1000 cuImage.mpc834x_mds
Speed: 1000, full duplex
Using Freescale TSEC0 device
TFTP from server 192.168.178.36; our IP address is 192.168.178.10
Filename 'cuImage.mpc834x_mds'.
Load address: 0x1000
Loading: #
 #
 #
 #
 #
 #
 
done
Bytes transferred = 2157489 (20ebb1 hex)
IOMEGA=> bootm 0x1000
## Booting image at 1000 ...
   Image Name:   Linux-4.4.3
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:2157425 Bytes =  2.1 MB
   Load Address: 0050
   Entry Point:  005001f8
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Memory <- <0x0 0x2000> (512MB)
ethernet0: local-mac-address <- 00:d0:b8:01:d1:9f
ethernet1: local-mac-address <- 9b:e3:00:01:72:6f
CPU clock-frequency <- 0x179a7b00 (396MHz)
CPU timebase-frequency <- 0x3ef1480 (66MHz)
CPU bus-frequency <- 0xfbc5200 (264MHz)

zImage starting: loaded at 0x0050 (sp: 0x1ffb2ce8)
Allocating 0x439a88 bytes for kernel ...
gunzipping (0x <- 0x0050e000:0x00940fe8)...done 0x422920 bytes

Linux/PowerPC load: root=/dev/mtdblock1 ro rootfstype=cramfs devfs=mount
console=ttyS0,115200 init=/linuxrc
Finalizing device tree... flat tree at 0x94d120


But at this point the process crash and the system is reset.
It should be something near the handover between the first kenel boot stage
and the vmlinux start, but I do not have a jtag to proceed the
investigation.

In any case it seems that the execution never entry the vmlinux start
(head_32.S).

I try to add this macro at the begin of the file:

.equ cnsladdr, 0xe0004500 (console address txreg)

.macro dbg_prnt nid
lis r24, cnsladdr at ha
addir24, r24, cnsladdr at l
li  r25, 'd'
stb r25, 0(r24)
li  r25, 'b'
stb r25, 0(r24)
li  r25, 'g'
stb r25, 0(r24)
li  r25, '0'
addir25, r25, \nid
stb r25, 0(r24)
li  r25, '\n'
stb r25, 0(r24)
.endm


But I do not see anything in the console.
The problem seems releted to the vmlinux call in arc/powerpc/boot/main.c

kentry = (kernel_entry_t) vmlinux.addr;


Any suggestion?
Bye.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev