Hi, Grant,

On Fri, Jan 28, 2011 at 3:57 PM, Jason Hui <jason....@linaro.org> wrote:
> Hi, Grant and Nico,
>
> On Fri, Jan 28, 2011 at 2:51 AM, Nicolas Pitre <nicolas.pi...@linaro.org> 
> wrote:
>> On Thu, 27 Jan 2011, Grant Likely wrote:
>>
>>> 2011/1/26 Grant Likely <grant.lik...@secretlab.ca>:
>>> > On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre <nicolas.pi...@linaro.org> 
>>> > wrote:
>>> >> On Wed, 26 Jan 2011, Grant Likely wrote:
>>> >>
>>> >>> If I were able to get all the supported Linaro platforms modified and
>>> >>> tested to support dt booting, would you be okay with picking up the
>>> >>> current dt support series and having CONFIG_OF turned on by default
>>> >>> for the next Linaro release?  There are also some details to nail down
>>> >>> with respect to packaging the .dtb files, but I'm working out those
>>> >>> details with Loďc.
>>> >>
>>> >> May I ask you to create a linaro-2.6.37 branch in your repo based on
>>> >> git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT
>>> >> branch in it?  If the result look sane to you then I should be able to
>>> >> merge it in the current Linaro kernel for people to play with.
>>> >
>>> > Done.  My branch is based on 2.6.38-rc1, so I cherry picked rather
>>> > than rebased.  The first two commits are in Linus' tree, the remainder
>>> > are from devicetree/arm. You can find the result here:
>>>
>>> Oops, I've run into a bug.  Hold off on this for the moment until I
>>> dig it out and squash it.
>>
>> No problem.  I hadn't pushed it out yet.
>
> I have run into one problem when play with DT support on MX51, here is
> what I'm doing,
>
> - Enable  CONFIG_OF_LIBFDT  in u-boot and build for mx51evk,
>
> +#define CONFIG_OF_LIBFDT
> +#define CONFIG_SYS_BOOTMAPSZ            0x800000
>
> - Add mx51-dt.c in kernel to add mx51 dt probe and support,
>
> - Build the kernel and uboot, no problem,
>
> - run uboot with DT support, log as the followings,
>
> ## Booting kernel from Legacy Image at 90800000 ...
>   Image Name:   Linux-2.6.37-rc7+
>   Image Type:   ARM Linux Kernel Image (uncompressed)
>   Data Size:    1866572 Bytes = 1.8 MiB
>   Load Address: 90008000
>   Entry Point:  90008000
>   Verifying Checksum ... OK
> ## Flattened Device Tree blob at 90000000
>   Booting using the fdt blob at 0x90000000
>   Loading Kernel Image ... OK
> OK
>   Loading Device Tree to 907fc000, end 907ff6f1 ... OK
>
> Starting kernel ...
>
> Uncompressing Linux... done, booting the kernel.
>
> No message output, but if print log_buf, here is the log information,
>
>> dump /W 0xC03B550C..0xC03B650C
>                   +0x0        +0x4            +0x8        +0xC
>               ------------------------------------------------
>  S:0xC03B5500                                         4C3E353C             
> <5>L
>  S:0xC03B5510 78756E69    72657620        6E6F6973    362E3220 inux version 
> 2.6
>  S:0xC03B5520 2D37332E    2B376372        36722820    33343334 .37-rc7+ 
> (r64343
>  S:0xC03B5530 34367240    2D333433        6B736564    29706F74 
> @r64343-desktop)
>  S:0xC03B5540 63672820    65762063        6F697372    2E34206E  (gcc version 
> 4.
>  S:0xC03B5550 20332E33    756F5328        72656372    2B472079 3.3 (Sourcery 
> G+
>  S:0xC03B5560 694C202B    32206574        71393030    30322D31 + Lite 
> 2009q1-20
>  S:0xC03B5570 29202933    20342320        20697246    206E614A 3) ) #4 Fri Jan
>  S:0xC03B5580 31203832    30313A35        2031303A    20545343 28 15:10:01 CST
>  S:0xC03B5590 31313032    3E343C0A        3A555043    4D524120 2011.<4>CPU: 
> ARM
>  S:0xC03B55A0 50203776    65636F72        726F7373    31345B20 v7 Processor 
> [41
>  S:0xC03B55B0 30636632    205D3538        69766572    6E6F6973 2fc085] 
> revision
>  S:0xC03B55C0 28203520    764D5241        202C2937    313D7263  5 (ARMv7), 
> cr=1
>  S:0xC03B55D0 33356330    0A663763        433E343C    203A5550 0c53c7f.<4>CPU:
>  S:0xC03B55E0 54504956    6E6F6E20        61696C61    676E6973 VIPT 
> nonaliasing
>  S:0xC03B55F0 74616420    61632061        2C656863    50495620  data cache, 
> VIP
>  S:0xC03B5600 6C612054    69736169        6920676E    7274736E T aliasing 
> instr
>  S:0xC03B5610 69746375    63206E6F        65686361    0000000A uction 
> cache....
>
> After narrow down the issue I found the error happen in the function,
>
> struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
> {
>        struct boot_param_header *devtree;
>        struct machine_desc *mdesc, *mdesc_best = NULL;
>        unsigned int score, mdesc_score = ~1;
>        unsigned long dt_root;
>
>        devtree = phys_to_virt(dt_phys);
>
> .....
>
> here the dt_phys is 0,

I did the following modification, which make the basic DT support boot
up on MX51 board,

- Let uboot pass MACH_TYPE_DT to kernel via r1,
- Add the following patch to make sure DT blob is mapped by MMU

+#ifdef CONFIG_OF_FLATTREE*/
+       /* Make sure DT blob is mapped */
+       mov     r0, r2
+       mov     r0, r0, lsr #20
+       mov     r0, r0, lsl #20
+       sub     r3, r0, #PHYS_OFFSET
+       add     r3, r3, #PAGE_OFFSET
+       add     r3, r4, r3, lsr #18
+       orr     r6, r7, r0
+       str     r6, [r3]
+       add     r6, r6, #0x100000
+       str     r6, [r3, #4]
 #ifdef CONFIG_DEBUG_LL
 #ifndef CONFIG_DEBUG_ICEDCC

BR,
Jason Liu

>
>
>>
>>
>> Nicolas
>> _______________________________________________
>> linaro-dev mailing list
>> linaro-dev@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/linaro-dev
>>
>>
>

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to