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.

Linux/PROCESSOR-SDK-AM335X: Avoid NAND reconfiguration in linux

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

Our product was designed to work with one of many different NAND part numbers, all of which may have different timing requirements. To circumvent these differences,  we modified u-boot so that it will read the memory's parameter page, extract the device's speed class information, and configure the GPMC peripheral accordingly.

We are currently using Linux 3.2,  which we modified as well so that it will not try to override the configurations made by u-boot, and this is working quite well. We also have a beta version of the 4.9-ltsi kernel adapted to our board, but without this modification that stops the kernel from reconfiguring the GPMC peripheral. The .dts GPMC node is described as such:

&gpmc {
   status = "okay";
   ranges = <0 0 0x01000000 0x10000000>;  /* CS0: 256MB */
   nand@0,0 {
      compatible = "ti,omap2-nand";
      reg = <0 0 8>; /* CS0, offset 0, IO size 4 */
      interrupt-parent = <&gpmc>;
      interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                   <1 IRQ_TYPE_NONE>;  /* termcount */
      rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
      ti,nand-ecc-opt = "bch8";
      ti,elm-id = <&elm>;
      nand-bus-width = <8>;
      gpmc,device-width = <1>;
      gpmc,sync-clk-ps = <0>;
      gpmc,cs-on-ns = <0>;
      gpmc,cs-rd-off-ns = <25>;
      gpmc,cs-wr-off-ns = <25>;
      gpmc,adv-on-ns = <0>;
      gpmc,adv-rd-off-ns = <25>;
      gpmc,adv-wr-off-ns = <25>;
      gpmc,we-on-ns = <0>;
      gpmc,we-off-ns = <10>;
      gpmc,oe-on-ns = <0>;
      gpmc,oe-off-ns = <10>;
      gpmc,access-ns = <20>;
      gpmc,rd-cycle-ns = <25>;
      gpmc,wr-cycle-ns = <25>;
      gpmc,wr-access-ns = <0>;
      gpmc,wr-data-mux-bus-ns = <0>;
      /* MTD partition table */
      /* All SPL-* partitions are sized to minimal length
       * which can be independently programmable. For
       * NAND flash this is equal to size of erase-block */
      #address-cells = <1>;
      #size-cells = <1>;
      partition@0 {
         label = "SPL";
         reg = <0x00000000 0x000020000>;
      };
      partition@1 {
         label = "SPL.backup1";
         reg = <0x00020000 0x00020000>;
      };
      partition@2 {
         label = "SPL.backup2";
         reg = <0x00040000 0x00020000>;
      };
      partition@3 {
         label = "SPL.backup3";
         reg = <0x00060000 0x00020000>;
      };
      partition@4 {
         label = "u-boot";
         reg = <0x00080000 0x00080000>;
      };
      partition@5 {
         label = "u-boot.backup1";
         reg = <0x00100000 0x00080000>;
      };
      partition@6 {
         label = "u-boot.backup2";
         reg = <0x00180000 0x00080000>;
      };
      partition@7 {
         label = "u-boot.backup3";
         reg = <0x00200000 0x00080000>;
      };
      partition@8 {
         label = "kernel";
         reg = <0x00280000 0x00500000>;
      };
      partition@9 {
         label = "fs";
         reg = <0x00780000 0x01400000>;
      };
      partition@10 {
         label = "drivers";
         reg = <0x01b80000 0x004e0000>;
      };
      partition@11 {
         label = "dtb";
         reg = <0x02060000 0x00020000>;
      };
      partition@12 {
         label = "app";
         reg = <0x02080000 0x00a00000>;
      };
      partition@13 {
         label = "upgd";
         reg = <0x02a80000 0x00200000>;
      };
      partition@14 {
         label = "hwinfo";
         reg = <0x02c80000 0x00100000>;
      };
      partition@15 {
         label = "dmin";
         reg = <0x02d80000 0x00a00000>;
      };
      partition@16 {
         label = "dgen";
         reg = <0x03780000 0x0c880000>;
      };
   };
};

What I want is a way to avoid having to describe the GPMC timings, and let the kernel use the previously configured values.

 

Regards,

Guilherme

  • Guilherme,

    If you remove the GPMC timings entries (i.e. sync-clk-ps, cs-on-ns, cs-rd-off-ns, etc) and add "ti,no-reset-on-init" entry to your kernel DTS file, GPMC NAND timing settings should be preserved in GPMC registers. See below doc:

    linux-kernel/Documentation/devicetree/bindings/arm/omap/omap.txt

    If that doesn't work, you can also remove the "SYSC_HAS_SOFTRESET" flag from gpmc_sysc struct in below file:

    linux-kernel/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c

    The main purpose is to NOT reset the GPMC module when switching from u-boot to kernel.

    Regards,
    Pavel
  • If you have no more questions related to the subject of this e2e thread, please close/verify/resolve this thread.

    Regards,
    Pavel