This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EVMK2H: new NAND partition in DTS file is not appear in u-boot

Part Number: EVMK2H

hello

i'm new to 66AK series and about few days ago i start my work with evmk2hx board. in process of messing with evmk2hx i start to create another partition on NAND flash so we code put our custom dsp code on it and in later step load it on 66x cores of TCI6636K2h. (we have done this on our custom board of 6678, in which we boot other cores same way, but in 6678 we wrote our IBL ourselves so we had full control over it.)

here in evmk2hx we are bound to use u-boot, but we can't even create another partition on NAND, actually we stuck in first step. here is what i have done till now.

1. i download and install ti-processor-sdk-linux-k2hk-evm-05.00.00.15-Linux-x86-Install.bin on ubuntu 14.04 LTS 64 bit

2. i changed "&aemif"  part of "keystone-k2hk-evm.dts" file in folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830/arch/arm/dts/ " as below: (green part = changed part)

&aemif {
	cs0 {
		#address-cells = <2>;
		#size-cells = <1>;
		clock-ranges;
		ranges;

		ti,cs-chipselect = <0>;
		/* all timings in nanoseconds */
		ti,cs-min-turnaround-ns = <12>;
		ti,cs-read-hold-ns = <6>;
		ti,cs-read-strobe-ns = <23>;
		ti,cs-read-setup-ns = <9>;
		ti,cs-write-hold-ns = <8>;
		ti,cs-write-strobe-ns = <23>;
		ti,cs-write-setup-ns = <8>;

		nand@0,0 {
			compatible = "ti,keystone-nand","ti,davinci-nand";
			#address-cells = <1>;
			#size-cells = <1>;
			reg = <0 0 0x4000000
			       1 0 0x0000100>;

			ti,davinci-chipselect = <0>;
			ti,davinci-mask-ale = <0x2000>;
			ti,davinci-mask-cle = <0x4000>;
			ti,davinci-mask-chipsel = <0>;
			nand-ecc-mode = "hw";
			ti,davinci-ecc-bits = <4>;
			nand-on-flash-bbt;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x100000>;
				read-only;
			};

			partition@100000 {
				label = "params";
				reg = <0x100000 0x80000>;
				read-only;
			};

			partition@180000 {
				label = "dspcode";
				reg = <0x180000 0x200000>;
				read-only;
			};

			partition@380000 {
				label = "ubifs";
				reg = <0x380000 0x1fc80000>;
			};
		};
	};
};

3. i moved to folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830" and add value "<install_dir>//linux-devkit/sysroots/x86_64-arago-linux/usr/bin" to PATH variable (according to this)
4. i run below command (according to this)
       make CROSS_COMPILE=arm-linux-gnueabihf- O=custom_2kh k2hk_evm_defconfig
       make CROSS_COMPILE=arm-linux-gnueabihf- O=custom_2kh
5. a folder with name of "custom_2kh" generate inside of folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830" which have a "u-boot.bin" in it.
6. next i configured evmk2hx for "ARM no boot" and used CCS 6.0 and connected to arm_0 of TCI6636k2h
7. then i load custom generated u-boot.bin file in previous step on address 0xC000000 and changed PC to 0xC000000 and press run button to start execution of custom u-boot.bin
8. in serial screen i halt autoload and enter u-boot command-line and enter command "mtdparts"

what i expected was to see 4 partitions containing {"bootloader","params","dspcode","ubifs"} but i see 3 DEFAULT partitions ({"bootloader","params","ubifs"}). simply "dspcode" is not there.
am i done something wrong? or changing that dts file was not supposed to result in my desired changes to begin with?
is there any clean way to change nand partition in U-boot?
and also is it possible for that change to affect linux too?
thanks in advance


  • Hi,

    I am looking into this. I will provide my feedback by EOB tomorrow.

    Best Regards,
    Yordan
  • thank
    i resend my step here again cause it seems i messed up formatting:

    1. i download and install ti-processor-sdk-linux-k2hk-evm-05.00.00.15-Linux-x86-Install.bin on ubuntu 14.04 LTS 64 bit

    2. i changed "&aemif" part of "keystone-k2hk-evm.dts" file in folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830/arch/arm/dts/ " as below:
    &aemif {
    cs0 {
    #address-cells = <2>;
    #size-cells = <1>;
    clock-ranges;
    ranges;

    ti,cs-chipselect = <0>;
    /* all timings in nanoseconds */
    ti,cs-min-turnaround-ns = <12>;
    ti,cs-read-hold-ns = <6>;
    ti,cs-read-strobe-ns = <23>;
    ti,cs-read-setup-ns = <9>;
    ti,cs-write-hold-ns = <8>;
    ti,cs-write-strobe-ns = <23>;
    ti,cs-write-setup-ns = <8>;

    nand@0,0 {
    compatible = "ti,keystone-nand","ti,davinci-nand";
    #address-cells = <1>;
    #size-cells = <1>;
    reg = <0 0 0x4000000
    1 0 0x0000100>;

    ti,davinci-chipselect = <0>;
    ti,davinci-mask-ale = <0x2000>;
    ti,davinci-mask-cle = <0x4000>;
    ti,davinci-mask-chipsel = <0>;
    nand-ecc-mode = "hw";
    ti,davinci-ecc-bits = <4>;
    nand-on-flash-bbt;

    partition@0 {
    label = "u-boot";
    reg = <0x0 0x100000>;
    read-only;
    };

    partition@100000 {
    label = "params";
    reg = <0x100000 0x80000>;
    read-only;
    };

    partition@180000 {
    label = "dspcode";
    reg = <0x180000 0x200000>;
    read-only;
    };

    partition@380000 {
    label = "ubifs";
    reg = <0x380000 0x1fc80000>;
    };
    };
    };
    };

    3. i moved to folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830" and add value "<install_dir>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin" to PATH variable (according to this)

    4. i run below command (according to this)
    make CROSS_COMPILE=arm-linux-gnueabihf- O=custom_2kh k2hk_evm_defconfig
    make CROSS_COMPILE=arm-linux-gnueabihf- O=custom_2kh

    5. a folder with name of "custom_2kh" generate inside of folder "<install_dir>/board-support/u-boot-2018.01+gitAUTOINC+131dc82830-g131dc82830" which have a "u-boot.bin" in it.

    6. next i configured evmk2hx for "ARM no boot" and used CCS 6.0 and connected to arm_0 of TCI6636k2h

    7. then i load custom generated u-boot.bin file in previous step on address 0xC000000 and changed PC to 0xC000000 and press run button to start execution of custom u-boot.bin

    8. in serial screen i halt autoload and enter u-boot command-line and enter command "mtdparts"

    what i expected was to see 4 partitions containing {"bootloader","params","dspcode","ubifs"} but i see 3 DEFAULT partitions ({"bootloader","params","ubifs"}). simply "dspcode" is not there.
    am i done something wrong? or changing that dts file was not supposed to result in my desired changes to begin with?
    is there any clean way to change nand partition in U-boot?
    and also is it possible for that change to affect linux too?
    thanks in advance
  • Hi,

    There is additional configuration file for the first stage of u-boot (MLO, or in the case of KS2 devices the SPI GPH file). Try to add your partition in include/configs/ti_armv7_keystone.h:
    "mtdparts=mtdparts=davinci_nand.0:" \
    "1024k(bootloader)ro,512k(params)ro,-(ubifs), (dspcode)\0"

    And run make u-boot from the top level Makefile (located in ~/ti-processor-sdk-linux-k2hk-evm-05.00.00.15). Have a look at ~/ti-processor-sdk-linux-k2hk-evm-05.00.00.15/Rules.make and ~/ti-processor-sdk-linux-k2hk-evm-05.00.00.15/Makefile:
    UBOOT_MACHINE=k2hk_evm_config

    You should build your u-boot with make k2hk_evm_config, not k2hk_evm_defconfig.

    Best Regards,
    Yordan

  • hello yordan

    as you said I should change "include/configs/ti_armv7_keystone.h" but this wasn't sufficient alone. the problem was u-boot environment variables. after changing according line in "include/configs/ti_armv7_keystone.h" to

    "mtdparts=mtdparts=davinci_nand.0:" \

    "1024k(bootloader)ro,512k(params)ro,2048k(dspcode)ro,-(ubifs)\0"

    I didn't see any change in output of "mtdparts" command. then I run "env default -f -a" and after this command I run "mtdparts" again. this time I see my changes. it seems the default partition was always loaded from nand param, that's why I couldn't see my changes.

    but there is two other question:

    1. it seems content of "device tree"  has no effect on u-boot partitions. I made partition settings of "device tree" and "config file" different.  interestingly always it was "config file" settings that defined partition format, not "device tree" settings. is "device tree" has any effect on behaviour of u-boot, at all?

    2. for some reason I forced to reprogram filesystem. I reprogram prebuild u-boot and pre-build filesystem image( "arago-base-tisdk-image-k2hk-evm.ubi" ). I expect for board to behave like it was before . but I gets tons of errors. it seems factory filesystem was different from SDK prebuild filesystem. (i attach log for you to see)

    and by the way, isn't 133 MB too much for filesystem? do TI have a smaller filesystem? or is there anyway to make it smaller?

    thanks

    pp (copy).txt