which files need to be changed in kernel for shift ddr3 to LPDDR2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

which files need to be changed in kernel for shift ddr3 to LPDDR2

2,880 Views
srinivasaporam
Contributor II

Hi,

We have got IMX6D custom designed board which is based on IMX6Q reference design (Wandboard). Following are the main differences between reference and custom boards:

1. Memory shift from DDR3 (2GB) to LPDDR2 (512MB)

2. Reference board is IMX6Q /DL where as custom board is IMx6D (Dual)

We have modified U-boot, such atht both reference board and custom board are passing the U-boot level. Coming to the Kernel (3.10.53) reference board is able load kernel completely and booted.  where as custom board, it is locking up at "Starting Kernel..."

Did i miss some changes to be made in  kernel.

Labels (3)
0 Kudos
Reply
18 Replies

2,128 Views
srinivasaporam
Contributor II

Hi,

I have put some printk statements in kernel and found out that  my ccm (fsl,imx6q-ccm) is not getting initialized properly.

and further debugging, kernel is stucking at this point  (clk-imx6q.c)

writel_relaxed(1 << CCM_CCGR_OFFSET(0), base + 0x7c);

writel_relaxed(0, base + 0x80);

what could be possible error????

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Hello,

You may create new request regarding details how to configure memory frequency

of 400MHz.

1)Please open www.nxp.com
2)On the top level menu, select Support > Sales and Support (http://www.nxp.com/support/sales-and-support:SUPPORTHOME).
3)On the bottom of the page, select Hardware & Software.
4)Register with your business email to access the technical NXP online support.
5)A verification email will be sent to your account. Click the embedded link to verify your access.
6)On the NXP online support page, select Contact Support from the top menu and click “submit a new case” to start the process.

Regards,

Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

One more thing i forgot to mention is my LPDDR2 (512MB) is 400MHZ where as Reference board is DDR3(2GB) is 528 MHz. When checked in arch/arm/mach-imx there is file named "ddr3_freq_imx6.S" where in one place it is mentioned that

ldr    r1, =528000000

DDR3 or LPDDR2 clock frequency will be passed by U-boot or it will be taken from kernel files. Can i edit this ldr r1=400000000 such that it will be changed to my LPDDR2 setting.

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Hi,

  As for frequency 400 MHz setting, please refer to i.MX6DL LPDDR2 Support for L3.0.35_4.0.0

Regards,

Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

board is IMX6D but not IMX6DL. How this patch will work???

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

Iam narrow downing my problem to dts files. I want check the dts files generated were exactly same as that of our custom board. But, There are some loop hole like:

dts for reference board has ldb

&ldb {

    clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>, <&clks IMX6QDL_CLK_LDB_DI1_SEL>,

         <&clks IMX6QDL_CLK_IPU1_DI0_SEL>, <&clks IMX6QDL_CLK_IPU1_DI1_SEL>,

         <&clks IMX6QDL_CLK_IPU2_DI0_SEL>, <&clks IMX6QDL_CLK_IPU2_DI1_SEL>,

         <&clks IMX6QDL_CLK_LDB_DI0>, <&clks IMX6QDL_CLK_LDB_DI1>;

    clock-names = "di0_pll", "di1_pll",

              "di0_sel", "di1_sel", "di2_sel", "di3_sel",

              "di0", "di1";

    lvds-channel@0 {

        port@2 {

            reg = <2>;

            lvds0_mux_2: endpoint {

                remote-endpoint = <&ipu2_di0_lvds0>;

            };

        };

        port@3 {

            reg = <3>;

            lvds0_mux_3: endpoint {

                remote-endpoint = <&ipu2_di1_lvds0>;

            };

        };

    };

    lvds-channel@1 {

        port@2 {

            reg = <2>;

            lvds1_mux_2: endpoint {

                remote-endpoint = <&ipu2_di0_lvds1>;

            };

        };

        port@3 {

            reg = <3>;

            lvds1_mux_3: endpoint {

                remote-endpoint = <&ipu2_di1_lvds1>;

            };

        };

    };

};

But we are not using any ldb or lvds modules. Our board has only HDMI. Will there be any harm if this ldb is define as above in our custom board.

Also we don't know some of the devices/modules like  dcic1,dcic2, caam-sm@00100000,gpt,anatop,tempmon,snvs,epit1,epit2, src,gpc,gpr,romcp,weim, octop,tzosc,vdoa, mlb etc... whether they are required.... what if we keep them dts files.

How to generate exact device tree source files for our custom boards.

we have used pmic for power generation, then how to include that in device tree. what are minimum modules which are reuired for kernel to boot. How will we come to know, which are really important and which are not????

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Please refer to "i.MX_BSP_Porting_Guide.pdf" in BSP documentation.

~Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

We tried it and it has passed the stress test. Now Why reference board is able to boot the kernel 3.10.53 and why not the custom board.

The custom board u-boot has been modified for LPDDR2 (400 MHz) 512 MB

static void ccgr_init(void)

{

    struct mxc_ccm_reg *ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;

    writel(0xFFFFFFFF, &ccm->CCGR0);

    writel(0xFFFFFFFF, &ccm->CCGR1);

    writel(0xFFFFFFFF, &ccm->CCGR2);

    writel(0xFFFFFFFF, &ccm->CCGR3);

    writel(0xFFFFFFFF, &ccm->CCGR4);

    writel(0xFFFFFFFF, &ccm->CCGR5);

    writel(0xFFFFFFFF, &ccm->CCGR6);

     writel(0x00060324, &ccm->cbcmr); // this denotes that DDR clock is 400 MHz.

}

Uboot is modified for LPDDR2 and it is coming till starting kernel.

Now,

for reference board and custom board kernelo is the same (as per freescale kernel files need not be changed).

can any body tell, what is making reference board to boot and custom board is hanging/stucking.

Please suggest us...

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Hi,

The following may be helpful :

i.MX6DL LPDDR2 Support for L3.0.35_4.0.0

Regards,
Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Environment variables (printenv) lists out :

baudrate=115200                                                           

board_name=C1                                                             
board_rev=MX6Q                                                            
boot_fdt=try                                                              
bootargs_base=setenv bootargs console =ttymxc0,115200                     

bootcmd=run findfdt; setenv mmcdev 0;setenv mmckernel 0;run mmcboot;setenv mmcd;

bootdelay=3                                                               
bootscript=echo Running bootscript from mmc ...; source                   
console=ttymxc0,115200                                                    
ethact=FEC                                                                
ethprime=FEC                                                              
fdt_addr=0x18000000                                                       
fdt_high=0xffffffff                                                       
fdtfile=undefined                                                         

findfdt=if test $board_name = C1 && test $board_rev = MX6Q ; then setenv fdtfil

image=zImage                                                              
initrd_high=0xffffffff                                                    
ip_dyn=yes                                                                
loadaddr=0x12000000                                                       
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};    

loadfdt=echo loading ${fdtdir}/${fdtfile} ...;  load mmc ${bootpart} ${fdt_addr}

loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}         

loadrd=load mmc ${bootpart} ${rdaddr} ${bootdir}/${rdfile}; setenv rdsize ${fil}

mmcargs=setenv bootargs root=/dev/mmcblk2p1 rw rootwait earlyprintk       

mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mm;

mmcboot_old=echo Booting from mmc ...; mmcboot=echo Booting from mmc ...; run m;

mmcdev=0                                                                  
mmcpart=1                                                                 
mmcroot=/dev/mmcblk0p2 ro                                                 
mmcrootfstype=ext4 rootwait                                               

netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then s;

rdaddr=0x12A00000                                                         
script=boot.scr                                                           
splashpos=m,m                                                             

uname_boot=setenv bootdir /boot; setenv bootfile vmlinuz-${uname_r}; if test -e;

update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setei

update_sd_firmware_filename=u-boot.imx                                    

videoargs=setenv nextcon 0; if hdmidet; then setenv bootargs ${bootargs} video=}

                                                                          

Environment size: 5961/8188 bytes

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Have You tried to test memory ?

i.MX6/7 DDR Stress Test Tool V2.40

~Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

I have downloaded the kernel source from "wandboard-org/linux · GitHub " . may be it is having issues with custom board.

If i would like to  try linux from IMX6 from where should i try ??? I don't want to go for Yocto. I would like to try ubuntu

Please guide me...

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Hi,

FSL \ NXP Linux BSPs may be found at
i.MX6Q|i.MX 6Quad Processors|Quad Core|NXP

section "Board Support Packages"

Also the following may be useful :

Ubuntu image for MX6UL

Regards,

Yuri.

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

=> md.l 80d60780 28  resulting in

80d60780: 083449c2 18b50101 ffa54079 8b534daa.I4.....y@...MS.         
80d60790: 75e4d101 277a1534 abc14318 36ec7563...u4.z'.C..cu.6         
80d607a0: cc060a4a 402002c0 72805382 47f4822bJ..... @.S.r+..G         
80d607b0: e4e5e22c 231955cb 09414486 204c2200,....U.#.DA.."L          
80d607c0: 16478014 486ab054 250dd902 01418044..G.T.jH...%D.A.         
80d607d0: 84a9c151 02a79a44 59fe3a5b ac57c0d3Q...D...[:.Y..W.         
80d607e0: b54f7060 4806c429 12800a88 d060005a`pO.)..H....Z.`.         
80d607f0: a3c2c941 ca890144 81827145 d5745707A...D...Eq...Wt.         
80d60800: 1aea30cd 8360405e d08e1810 100dc164.0..^@`.....d...         
80d60810: 28f74344 ca785204 e2ae510a 0047510fDC.(.Rx..Q...QG.
0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

$readelf -s vmlinux | grep __log_buf is resulting in

39342: 80d60780 0x40000 OBJECT  LOCAL  DEFAULT   28 __log_buf

this i have checked from vmlinux in the folder (/linux/) in my host, which has been generated by cross compilation.

Now can i use this in u-boot of target board

0 Kudos
Reply

2,128 Views
srinivasaporam
Contributor II

Hi,

where should i run readelf utility...

this board hasn't booted once also. it is stopping at "starting Kernel ..." from beginning after the board is assembled with this kernel.

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Readelf - on the host ; vmlinux - kernel ELF file.

~Yuri.

0 Kudos
Reply

2,128 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Basically it is enough to modify U-boot, as described in Chapter 1 (Porting U-Boot
from an i.MX 6/7 Reference Board to an i.MX 6/7 Custom Board) of “i.MX_BSP_Porting_Guide.pdf”
in FSL / NXP  Linux documentation.

  If a board boots u-boot but stops at “Starting kernel ...”, it may be possible to read the kernel
log_buffer. to view memory dump (say in ASCII) at the needed address, assuming memory still contains
log information from the previous boot.  

To find the __log_buf address, please use readelf utility :

$ readelf -s vmlinux | grep __log_buf

Then, don’t power off the board, just reset it, and read the

(__log_buf) address on JTAG or u-boot. As an example :

U-Boot > md.l 10af37b8 50


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply