i.MX53 Kernel Build failed

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

i.MX53 Kernel Build failed

1,369 Views
sujathap_m_
Contributor I

Hello,

I'm using i.MX53 QSB with NAND interface.

To support for nand,I have enabled mtd in kernel configuration/Device drivers.

After selecting,I have got many error messages,Kernel not build properly.

The error messages:

+ make LOCALVERSION= ARCH=arm CROSS_COMPILE= 'HOSTCC=ccache /usr/bin/gcc -B/usr/bin/' uImage

scripts/kconfig/conf -s arch/arm/Kconfig

  CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

make[1]: `include/generated/mach-types.h' is up to date.

  CALL    scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  GZIP    kernel/config_data.gz

  IKCFG   kernel/config_data.h

  CC      kernel/configs.o

  LD      kernel/built-in.o

  LD      drivers/mtd/nand/nand.o

  CC      drivers/mtd/nand/imx_nfc.o

drivers/mtd/nand/imx_nfc.c: In function 'nfc_2_0_set_geometry':

drivers/mtd/nand/imx_nfc.c:2645: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'nfc_3_2_init':

drivers/mtd/nand/imx_nfc.c:2789: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'mal_set_logical_geometry':

drivers/mtd/nand/imx_nfc.c:4727: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'mil_select_chip':

drivers/mtd/nand/imx_nfc.c:5810: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:5816: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: At top level:

drivers/mtd/nand/imx_nfc.c:6667: error: invalid type argument of 'unary *' (have 'int')

drivers/mtd/nand/imx_nfc.c:6667: warning: type defaults to 'int' in declaration of 'type name'

drivers/mtd/nand/imx_nfc.c:6671: error: invalid type argument of 'unary *' (have 'int')

drivers/mtd/nand/imx_nfc.c:6671: warning: type defaults to 'int' in declaration of 'type name'

drivers/mtd/nand/imx_nfc.c:6675: error: invalid type argument of 'unary *' (have 'int')

drivers/mtd/nand/imx_nfc.c:6675: warning: type defaults to 'int' in declaration of 'type name'

drivers/mtd/nand/imx_nfc.c:6679: error: invalid type argument of 'unary *' (have 'int')

drivers/mtd/nand/imx_nfc.c:6679: warning: type defaults to 'int' in declaration of 'type name'

drivers/mtd/nand/imx_nfc.c:6683: error: invalid type argument of 'unary *' (have 'int')

drivers/mtd/nand/imx_nfc.c:6683: warning: type defaults to 'int' in declaration of 'type name'

drivers/mtd/nand/imx_nfc.c: In function 'show_device_platform_info':

drivers/mtd/nand/imx_nfc.c:6710: error: 'IMX_NFC_BUFFERS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:6710: error: (Each undeclared identifier is reported only once

drivers/mtd/nand/imx_nfc.c:6710: error: for each function it appears in.)

drivers/mtd/nand/imx_nfc.c:6715: error: 'IMX_NFC_PRIMARY_REGS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:6720: error: 'IMX_NFC_SECONDARY_REGS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:6725: error: 'IMX_NFC_INTERRUPT_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:6741: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6742: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6743: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6744: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6745: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6746: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6758: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6763: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6765: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:6783: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c:6783: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c:6794: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c:6794: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c: In function 'show_device_mtd_nand_info':

drivers/mtd/nand/imx_nfc.c:6986: warning: format '%lu' expects type 'long unsigned int', but argument 5 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c: In function 'show_device_mtd_info':

drivers/mtd/nand/imx_nfc.c:7082: warning: format '%u' expects type 'unsigned int', but argument 6 has type 'uint64_t'

drivers/mtd/nand/imx_nfc.c: In function 'validate_the_platform':

drivers/mtd/nand/imx_nfc.c:7470: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7477: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7477: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7478: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7478: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'set_up_the_nfc_hal':

drivers/mtd/nand/imx_nfc.c:7513: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7514: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7522: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7522: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'acquire_resources':

drivers/mtd/nand/imx_nfc.c:7546: error: 'IMX_NFC_BUFFERS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:7565: error: 'IMX_NFC_PRIMARY_REGS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:7585: error: 'IMX_NFC_SECONDARY_REGS_ADDR_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:7619: error: 'IMX_NFC_INTERRUPT_RES_NAME' undeclared (first use in this function)

drivers/mtd/nand/imx_nfc.c:7630: error: 'struct device' has no member named 'bus_id'

drivers/mtd/nand/imx_nfc.c:7639: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7642: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'register_with_mtd':

drivers/mtd/nand/imx_nfc.c:7760: warning: assignment from incompatible pointer type

drivers/mtd/nand/imx_nfc.c:7761: warning: assignment from incompatible pointer type

drivers/mtd/nand/imx_nfc.c:7905: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7906: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:7907: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'imx_nfc_probe':

drivers/mtd/nand/imx_nfc.c:8055: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8056: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8082: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8092: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8120: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8121: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: In function 'imx_nfc_remove':

drivers/mtd/nand/imx_nfc.c:8154: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c:8155: error: dereferencing pointer to incomplete type

drivers/mtd/nand/imx_nfc.c: At top level:

drivers/mtd/nand/imx_nfc.c:8245: error: 'IMX_NFC_DRIVER_NAME' undeclared here (not in a function)

make[3]: *** [drivers/mtd/nand/imx_nfc.o] Error 1

make[2]: *** [drivers/mtd/nand] Error 2

make[1]: *** [drivers/mtd] Error 2

make: *** [drivers] Error 2

make: *** Waiting for unfinished jobs....

make: *** wait: No child processes.  Stop.

error: Bad exit status from /opt/imx53-ltib/ltib/tmp/rpm-tmp.1884 (%build)

RPM build errors:

    Bad exit status from /opt/imx53-ltib/ltib/tmp/rpm-tmp.1884 (%build)

Build time for kernel-2.6.35: 54 seconds

Failed building kernel-2.6.35

f_buildrpms() returned an error, exiting

traceback:

main:560

These packages failed to build:

kernel-2.6.35

Build Failed

What has to be done to build the kernel suscessfully?

What is the reason for these errors?

Regards,

Sujatha

Labels (2)
0 Kudos
5 Replies

720 Views
fabio_estevam
NXP Employee
NXP Employee

Can you try it on kernel 3.12 instead?

mx53qsb does not contain a NAND flash, but you can refer to the m53evk board from Denx, which supports NAND flash:

arch/arm/boot/dts/imx53-m53evk.dts

Regards,

Fabio Estevam

0 Kudos

720 Views
sujathap_m_
Contributor I

imx53ard supports NAND flash and which is using same kernel (2.6.35)

We are referring  mx53ard to add support for NAND.

I have enabled mtd in the device drivers

       Device Drivers  --->     

         <*> Memory Technology Device (MTD) support  --->

                <*>   NAND Device Support  --->    

                        <*>   i.MX NAND Flash Controller driver

                        <*>   Support for generic platform NAND driver 

After selecting those,I have got lot of errorrs,as I posted.

All the errors related  to imx_nfc.c file.

Is there any patch should be added to fix those errors?

             
0 Kudos

720 Views
BrilliantovKiri
Senior Contributor I

Hello, follow my Linux configuration for NAND:

$ grep NAND .config

CONFIG_MTD_NAND_ECC=y

# CONFIG_MTD_NAND_ECC_SMC is not set

CONFIG_MTD_NAND=y

# CONFIG_MTD_NAND_VERIFY_WRITE is not set

CONFIG_MTD_NAND_MUSEUM_IDS=y

CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xFF108018

# CONFIG_MTD_NAND_GPIO is not set

CONFIG_MTD_NAND_IDS=y

# CONFIG_MTD_NAND_DISKONCHIP is not set

# CONFIG_MTD_NAND_NANDSIM is not set

# CONFIG_MTD_NAND_IMX_NFC is not set

CONFIG_MTD_NAND_MXC_V3=y

# CONFIG_MTD_NAND_MXC_SWECC is not set

CONFIG_MTD_NAND_MXC_FORCE_CE=y

# CONFIG_MXC_NAND_LOW_LEVEL_ERASE is not set

CONFIG_MTD_NAND_PLATFORM=y

# CONFIG_MTD_ONENAND is not set

720 Views
sujathap_m_
Contributor I

I'm able to build the kernel successfuly.

I have changed the profile to mfg firmware profile to deploy the changes which I have made on kernel,I'm able to get initramfs.cpio.gz.uboot file under ltib root directory.

I have replaced this file with the file under Mfgtools-Rel-1.6.2.042\Profiles\MX53 Linux Update\OS Firmware, and I used updated uboot.bin (nand supported uboot) and put it under \OS Firmware\files

Still I'm not able to flash the uboot to our board NAND?

Getting error after Jumping to OS image.

Error: failed to run command: type="find" body="Updater" file="" timeout="180" onError="" text="" ,, Error code:-65530

The NAND data lines are linked to PATA_DATA pins,so I modified accordingly,

#ifdef CONFIG_MXC_NAND

void setup_nfc(void)

{

  u32 i, reg;

  #define M4IF_GENP_WEIM_MM_MASK          0x00000001

  #define WEIM_GCR2_MUX16_BYP_GRANT_MASK  0x00001000

  reg = __raw_readl(M4IF_BASE_ADDR + 0xc);

  reg &= ~M4IF_GENP_WEIM_MM_MASK;

  __raw_writel(reg, M4IF_BASE_ADDR + 0xc);

  for (i = 0x4; i < 0x94; i += 0x18) {

  reg = __raw_readl(WEIM_BASE_ADDR + i);

  reg &= ~WEIM_GCR2_MUX16_BYP_GRANT_MASK;

  __raw_writel(reg, WEIM_BASE_ADDR + i);

  }

  /* To be compatible with some old NAND flash,

  * limit NFC clocks as 34MHZ. The user can modify

  * it according to dedicate NAND flash

  */

  clk_config(0, 34, NFC_CLK);

  mxc_request_iomux(MX53_PIN_NANDF_CS0,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_CS0,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_NANDF_CS1,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_CS1,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_NANDF_RB0,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_RB0,

  PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_PULL |

  PAD_CTL_100K_PU);

  mxc_request_iomux(MX53_PIN_NANDF_CLE,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_CLE,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_NANDF_ALE,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_ALE,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_NANDF_WP_B,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_WP_B,

  PAD_CTL_PKE_ENABLE | PAD_CTL_PUE_PULL |

  PAD_CTL_100K_PU);

  mxc_request_iomux(MX53_PIN_NANDF_RE_B,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_RE_B,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_NANDF_WE_B,

  IOMUX_CONFIG_ALT0);

  mxc_iomux_set_pad(MX53_PIN_NANDF_WE_B,

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA0,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA0,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA1,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA1,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA2,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA2,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA3,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA3,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA4,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA4,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA5,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA5,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA6,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA6,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

  mxc_request_iomux(MX53_PIN_ATA_DATA7,

  IOMUX_CONFIG_ALT3);

  mxc_iomux_set_pad(MX53_PIN_ATA_DATA7,

  PAD_CTL_PKE_ENABLE | PAD_CTL_100K_PU |

  PAD_CTL_DRV_HIGH);

I have added new NAND device information in nand_device_info.c, and its id in nand_ids.c

Is there any problem with iomux pin select code?

The board specific uboot.bin file which is there under \OS Firware has to be modified?if so how to modify?

0 Kudos

720 Views
BrilliantovKiri
Senior Contributor I

Hello!

For writing on NAND I use Linux with included initrd. After starting system I copy u-boot, Linux and rootfs and write it (u-boot via kobs-ng, Linux via nandwrite).

0 Kudos