32

LTIB image for i.MX6 Sabre Lite and Nitrogen6X

For those of you who have been working with Freescale software releases on i.MX processors, you’ll recognize LTIB, or Linux Target Image Builder as the packaging used by Freescale to distribute embedded Linux software.

We’ve placed a binary image of the L3.0.15-201204 release of Linux software for the Sabre Lite and Nitrogen6X on-line here:

It contains a root filesystem image as a tar-ball. To use it on an SD card, simply create a single partition as either ext2 or ext3 and extract the content to it. If your SD card is mounted as /media/boot, you can use this command-line under Linux:
~/$ sudo tar -C /media/boot -zxvf LTIB_201204.tar.gz
This image contains a number of utilities to show the capabilities of the i.MX6 processor:
  • /unit_tests/. The utility programs in the /unit_tests/ directory allow various hardware and software component tests. If you’ve worked with previous Freescale releases, these should be familiar to you.
  • gplay. To play video using gstreamer acceleration, you can use the gplay utility.
  • /opt/vivante. A number of test programs for the Vivante GPU are installed in /opt/vivante.

Details

This image is preconfigured with the Sabre Lite kernel from Freescale.
root@freescale /unit_tests$ cat /proc/version
Linux version 3.0.15-1359-g1b64ead (r80115@bluemeany) ...Tue May 1 04:07:40 CDT 2012

This release will run on a Nitrogen6X but analog audio won’t function. You can download a kernel that will work on either board from this URL: Extract it on top of the image like this:
~/$ sudo tar -C /media/boot -zxvf kernel-L3.0.15_12.04.01.tar.gz
User name is root. No password.

This image is configured to run on the Freescale LVDS display. To configure it for HDMI, you can do the following in U-Boot:
U-Boot > set bootargs $bootargs video=mxcfb0:dev=hdmi,1280x720M@60,if=RGB24
U-Boot > savee
Saving Environment to SPI Flash...
Erasing SPI flash...Erasing SPI NOR flash 0xc0000 [0x2000 bytes]
..SUCCESS

Writing to SPI flash...Writing SPI NOR flash 0xc0000 [0x2000 bytes] <- ram 0x276009b8
SUCCESS
done
U-Boot > run bootcmd
This image isn’t configured to use DHCP. To access the device over SSH, you’ll need to set the root password and start the DHCP client like this:
root@freescale ~$ passwd
Changing password for root
New password:
Retype password:
Password for root changed by root
root@freescale ~$ udhcpc -f -q -n -i eth0
udhcpc (v1.18.5) started
eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] ...
Sending discover...
PHY: 1:06 - Link is Up - 100/Full
Sending discover...
Sending discover...
Sending select for 29.6.1.8...
Lease of 29.6.1.8 obtained, lease time 86400
Deleting routers
adding dns 29.6.1.1
root@freescale ~$
To test the GPU functions, you can use the gpu.sh script in /unit_tests/.
root@freescale /unit_tests$ ./gpu.sh
/unit_tests /unit_tests
Attempting modprobe galcore.ko
gpu.sh: PASS: modprobe returned success
Checking lsmod for the module galcore
galcore               126009  0
PASS: module appears in lsmod
...
adminLTIB image for i.MX6 Sabre Lite and Nitrogen6X

Comments 32

  1. Clay Montgomery

    I found that the kernel in the original package (LTIB_201204.tar.gz) does not boot on my Nitrogen6x board. However, installing the updated kernel (kernel-L3.0.15_12.04.01-20120710.tar.gz) resolves the problem. So, that update seems to be required.

    Regards, Clay Montgomery

    1. Post
      Author
      ericn

      Hi Clay,

      I’ll check into the image shortly. The kernel provided in the package should boot on Nitrogen6X, but perhaps only on the one of the SD card slots.

      What messages are you getting on the serial console during the boot? I wonder if the write-protect pin is being read incorrectly (there is no write protect pin on a microSD card slot, but the internal pull-up/pull-down should be set to the de-asserted state).

      1. reginaldreed

        The link for the alternate kernel isn’t working, this is what I get:

        This XML file does not appear to have any style information associated with it. The document tree is shown below.

        NoSuchKey
        The specified key does not exist.

        Where can I find a working kernel for the Nitrogen6x?

        1. Post
          Author
          ericn

          Sorry Reginald,

          This release is quite old, and there have been a number of kernel and userspace fixes since it was released. Please refer to one of the current LTIB releases as listed on this page.

          I’ll upload a new 1.1.1 release later today.

    1. Post
      Author
      ericn

      Hello Clay,

      I’m not sure it meets the criteria for being an SDK, but header files are in /usr/include within the SD card image and libraries in /usr/lib.

      There’s also some sample source in /opt/vivante/.

      I’m not aware of any app notes or documents available at the moment.

  2. Praveen K

    Hi ,

    I would like to use the kernel image(For i.mx6q) provided by you.
    Before using it, I would like to know whether touch screen and usb camera drivers are enabled or not.
    If not Please help me in enabling it.

    Thanks & Regards,
    Praveen

    1. Post
      Author
      ericn

      Hi Praveen,

      The drivers for the touch screens we support are included in our default
      kernels. USB camera drivers are not.

      You can select the appropriate drivers through ‘make menuconfig’ in your
      kernel directory.

  3. Richard

    Hi,

    I’ve tried this LTIB rootfs and the beta version, but with both of them if I try to run any of the example openCL binaries they segfault before doing anything useful, e.g: http://pastebin.com/gH2CtkHe

    Curiously, the Timesys build that comes with the board doesn’t experience this issue. Can anyone point me in the direction of someone who might be able to help with this issue? Or where I might be able to get a suitable version of LTIB sources so I can try building my own rootfs?

    Thanks,
    Richard

    1. Post
      Author
      ericn

      Hi Richard,

      I suspect you need to load the galcore module.

      I just ran a test against the latest 12.09 release and this was needed there.

      root@freescale ~$ lsmod
      Module                  Size  Used by
      galcore               132499  0
      wl12xx_sdio             3499  0
      ov5642_camera          73596  0
      camera_sensor_clock      689  1 ov5642_camera
      root@freescale ~$ cd /opt/viv_samples/cl11/UnitTest/
      root@freescale /opt/viv_samples/cl11/UnitTest$
      root@freescale /opt/viv_samples/cl11/UnitTest$ ls
      clinfo        loadstore     math          test_vivante  threadwalker
      root@freescale /opt/viv_samples/cl11/UnitTest$ ./clinfo
      
      >>>>>>>> ./clinfo Starting...
      
      Available platforms: 1
      
      Platform ID: 0
      	 CL_PLATFORM_NAME:       Vivante OpenCL Platform
      	 CL_PLATFORM_PROFILE:    EMBEDDED_PROFILE
      	 CL_PLATFORM_VERSION:    OpenCL 1.1
      	 CL_PLATFORM_VENDOR:     Vivante Corporation
      	 CL_PLATFORM_EXTENSIONS: None
      
      
      	 Available devices:      1
      
      	 Device ID:  	0
      	 Device Ptr: 	0x2abd01b8
      		 CL_DEVICE_NAME: Vivante OpenCL Device
      		 CL_DEVICE_VENDOR: Vivante Corporation
      		 CL_DEVICE_TYPE: 				GPU
       		 CL_DEVICE_OPENCL_C_VERSION: 			OpenCL C 1.1
      		 CL_DEVICE_VENDOR_ID: 				0x00564956
      		 CL_DEVICE_PLATFORM: 				0x2abd032c
      		 CL_DEVICE_VERSION: 				OpenCL 1.1
      		 CL_DEVICE_PROFILE: 				EMBEDDED_PROFILE
      		 CL_DRIVER_VERSION: 				OpenCL 1.1
      		 CL_DEVICE_MAX_COMPUTE_UNITS: 			4
      		 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS: 		3
      			 CL_DEVICE_MAX_WORK_ITEM_SIZES[0]: 	1024
      			 CL_DEVICE_MAX_WORK_ITEM_SIZES[1]: 	1024
      			 CL_DEVICE_MAX_WORK_ITEM_SIZES[2]: 	1024
      		 CL_DEVICE_MAX_WORK_GROUP_SIZE: 		1024
      		 CL_DEVICE_MAX_CLOCK_FREQUENCY: 		500 MHz
      		 CL_DEVICE_IMAGE_SUPPORT: 			Yes
      			 CL_DEVICE_MAX_READ_IMAGE_ARGS: 	8
      			 CL_DEVICE_MAX_WRITE_IMAGE_ARGS: 	8
      			 CL_DEVICE_IMAGE2D_MAX_WIDTH: 		8192
      			 CL_DEVICE_IMAGE2D_MAX_HEIGHT: 		8192
      			 CL_DEVICE_IMAGE3D_MAX_WIDTH: 		0
      			 CL_DEVICE_IMAGE3D_MAX_HEIGHT: 		0
      			 CL_DEVICE_IMAGE3D_MAX_DEPTH: 		0
      			 CL_DEVICE_MAX_SAMPLERS: 		8
      
      		 CL_DEVICE_EXTENSIONS: 	 cl_khr_byte_addressable_store
      
      
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR: 	4
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT: 	4
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 		4
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 	0
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 	4
      		 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 	0
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR: 		4
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT: 		4
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 		4
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 		0
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 		4
      		 CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 		0
      		 CL_DEVICE_MAX_PARAMETER_SIZE: 			256
      		 CL_DEVICE_MEM_BASE_ADDR_ALIGN: 		1024
      		 CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE: 		128
      		 CL_DEVICE_SINGLE_FP_CONFIG:
      			 CL_FP_DENORM: 				No
      			 CL_FP_INF_NAN: 			No
      			 CL_FP_ROUND_TO_NEAREST: 		No
      			 CL_FP_ROUND_TO_ZERO: 			Yes
      			 CL_FP_ROUND_TO_INF: 			No
      			 CL_FP_FMA: 				No
      			 CL_FP_SOFT_FLOAT: 			No
      		 CL_DEVICE_ADDRESS_BITS: 			32
      		 CL_DEVICE_GLOBAL_MEM_SIZE: 			64 MByte
      		 CL_DEVICE_MAX_MEM_ALLOC_SIZE: 			32 MByte
      		 CL_DEVICE_GLOBAL_MEM_CACHE_TYPE: 		Read/Write
      		 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 		64
      		 CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 		4096
      		 CL_DEVICE_LOCAL_MEM_SIZE: 			1 KByte
      		 CL_DEVICE_LOCAL_MEM_TYPE: 			Global
      		 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 		4 KByte
      		 CL_DEVICE_MAX_CONSTANT_ARGS: 			9
      		 CL_DEVICE_ERROR_CORRECTION_SUPPORT: 		Yes
      		 CL_DEVICE_QUEUE_PROPERTIES:
      			 CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE:Yes
      			 CL_QUEUE_PROFILING_ENABLE:             Yes
      		 CL_DEVICE_HOST_UNIFIED_MEMORY: 		Yes
      		 CL_DEVICE_PROFILING_TIMER_RESOLUTION: 		1000
      		 CL_DEVICE_ENDIAN_LITTLE: 			Yes
      		 CL_DEVICE_AVAILABLE: 				Yes
      		 CL_DEVICE_COMPILER_AVAILABLE: 			Yes
      		 CL_DEVICE_EXECUTION_CAPABILITIES:
      			 CL_EXEC_KERNEL: 			Yes
      			 CL_EXEC_NATIVE_KERNEL: 		No
      
      >>>>>>>> Creating CLInfo context...
      
      
      	 Context Properties:
      	 Context Ptr:        0x333b8e60
      		 CL_CONTEXT_REFERENCE_COUNT: 			1
      		 CL_CONTEXT_NUM_DEVICES: 			1
      		 CL_CONTEXT_DEVICES: 				0x2abd01b8
      		 CL_CONTEXT_PROPERTIES: 			0x00001084
      								0x2abd032c
      								0x00000000
      
      
      >>>>>>>> Creating CLInfo command queue...
      
      
      	 Command Queue Properties:
      		 CL_QUEUE_CONTEXT: 				0x333b8e60
      		 CL_QUEUE_DEVICE: 				0x2abd01b8
      		 CL_QUEUE_REFERENCE_COUNT: 			1
      		 CL_QUEUE_PROPERTIES:
      			 CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE:Yes
      			 CL_QUEUE_PROFILING_ENABLE:             Yes
      
      >>>>>>>> Creating CLInfo program...
      
      >>>>>>>> Building CLInfo program...
      
      
      	 Program Properties:
      		 CL_PROGRAM_CONTEXT: 				0x333b8e60
      		 CL_PROGRAM_REFERENCE_COUNT: 			1
      		 CL_PROGRAM_NUM_DEVICES: 			1
      		 CL_PROGRAM_DEVICES: 				0x2abd01b8
      		 CL_PROGRAM_SOURCE: 				(Size:60)
      
      ------------------ BEGIN --------------------
      __kernel void hello() {     size_t i =  get_global_id(0); }
      ------------------- END ---------------------
      
      		 CL_PROGRAM_BINARY_SIZES[0]: 			232
      		 CL_PROGRAM_BINARIES:
      			 Device Number 0:
      
      ------------------ BEGIN --------------------
      SHDR    CL                      #global_id                        i                                     hello                                  0                   0
      ------------------- END ---------------------
      
      
      	 Program Build Properties:
      		 CL_PROGRAM_BUILD_STATUS: 			0
      		 CL_PROGRAM_BUILD_OPTIONS: 			""
      		 CL_PROGRAM_BUILD_LOG:				""
      
      >>>>>>>> Creating CLInfo kernel...
      
      
      	 Kernel Properties:
      		 CL_KERNEL_FUNCTION_NAME: 			"hello"
      		 CL_KERNEL_CONTEXT: 				0x333b8e60
      		 CL_KERNEL_PROGRAM: 				0x333b6508
      		 CL_KERNEL_NUM_ARGS: 				0
      		 CL_KERNEL_REFERENCE_COUNT: 			1
      
      
      	 Kernel Workgroup Properties:
      		 CL_KERNEL_WORK_GROUP_SIZE: 			192
      		 CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE: 	16
      		 CL_KERNEL_COMPILE_WORK_GROUP_SIZE: 		0
      								0
      								0
      		 CL_KERNEL_LOCAL_MEM_SIZE: 			0
      		 CL_KERNEL_PRIVATE_MEM_SIZE: 			0
      
      >>>>>>>> Releasing CLInfo kernel...
      
      >>>>>>>> Releasing CLInfo program...
      
      >>>>>>>> Releasing CLInfo command queue...
      
      >>>>>>>> Releasing CLInfo context...
      
      >>>>>>>> Press  to quit...
      
      
      >>>>>>>> Exiting...
      
      1. rcagley

        I installed gpu-viv-bin-mx6q-12.09.01 by simply unzipping to my root filesystem. When I run clinfo I get no output

        # ./clinfo
        #

        I do have galcore loaded…
        # lsmod
        Module Size Used by Not tainted
        galcore 126960 0

        Anything else I should be doing?

        1. Post
          Author
          1. rcagley

            Here’s the first bit…no clue what it means…keeps going on for awhile

            # strace ./clinfo
            execve("./clinfo", ["./clinfo"], [/* 16 vars */]) = 0
            brk(0)                                  = 0x16000
            uname({sys="Linux", node="buildroot", ...}) = 0
            access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
            mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x20
            access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
            open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
            fstat64(3, {st_mode=S_IFREG|0644, st_size=13176, ...}) = 0
            mmap2(NULL, 13176, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2abb2000
            close(3)                                = 0
            access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
            open("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp/libOpenCL.so", O_RDONLY|O_CLOEX)
            stat64("/lib/arm-linux-gnueabihf/tls/v7l/neon/vfp", 0x7e97c410) = -1 ENOENT (No)
            open("/lib/arm-linux-gnueabihf/tls/v7l/neon/libOpenCL.so", O_RDONLY|O_CLOEXEC) )
            stat64("/lib/arm-linux-gnueabihf/tls/v7l/neon", 0x7e97c410) = -1 ENOENT (No suc
            
          2. Post
            Author
            ericn

            Please forward the entire content to me at eric.nelson at boundarydevices.com
            (maybe zipping it first) and I’ll help walk you through it.

            Note that strace sends its’ output to stderr, so you’ll want to invoke it like so:

            # strace ./clinfo 2>&1 | tee strace.out
            
  4. synthnassizer

    Hello there,
    I seem to be having a bit of odd problem while debugging an application which I compiled with Linaro gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux toolchain and it is running on a sabre lite board, loaded with the LTIB image that is discussed on this page.
    I am also using the (not stripped) shared libraries of the LTIB image for debug symbols in gdb.

    The problem which i wonder if it could be related, is the following:

    could the selected toolchain and rootfs shared libs be incompatible in some way?
    and that is why I can not get the application to spawn the threads properly?

    Thank you for your help.

    1. Post
      Author
      ericn

      I’m not familiar with that toolchain, but it could certainly be a problem if you’re not using the same glibc versions as the LTIB release.

      Is there a reason you’re not using the LTIB toolchain? The latest is available
      in the L3.0.35_1.1.0_SOURCE package on this page.

  5. JcPeP

    Hi,

    Quick question about this image: is this possible to set autologin at start-up and configure it to automatically launch an application? If so, what would be the proper way to do it?

    Thanks for your help.

    1. Post
      Author
      ericn

      Take a look at the script file /etc/rc.d/rcS and /etc/rc.d/rc.conf and you’ll see the basic startup sequence.

      The variable cfg_services defines the startup sequence in terms of the scripts in /etc/rc.d/init.d.

      Note that you’ll generally want to use daemon to launch your application and detach it from the console, and that these scripts are run as root.

  6. ELP13

    Hello there,

    I installed recently this image on my Freescale iMX6 Sabre Lite Board, and I am now trying to use the can0 interface. I am setting it up via the command
    $ ip link set can0 up type can bitrate 500000
    and sending can frames usint the command
    $ while true; do cantest can0 123#12345678; echo “Done”; done;
    but I don’t seem to receive any data on the machine connected to it.

    Is the CAN driver configured and working for this board? Is it the proper way to configure the CAN interface and send frames? If not, can you indicate me how to do it?

    Thanks in advance.

    1. Post
      Author
  7. kevin

    Hi,

    I am currently trying to connect TCA6408 IO expander to my nitrogen6x board. Kernel already supported a driver for this IO expander. (linux-3.0.35/drivers/gpio/pca953x.c).

    I have enabled this driver in kernel config and build the image. But I could not get any input from IO expander (External circuit is working properly). and kernel module is initialing properly. Does any body know the issue of this?

    Is there any modification in this driver(pca953x.c) for nitrogen6x ? and i want to know, how to check kernel log (printk messages)

    1. Post
      Author
      1. Kevin

        Dear Ericn,

        Thank you for your information.

        As I mentioned, I have nitrogen6x board. but My LTIB config’s does not have “board nitrogen6x”. Instead that I selected “board (mx6q_sabrelite)”.
        you mentioned modification has been changed here “https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_3.0.35_4.1.0/arch/arm/mach-mx6/board-mx6q_sabrelite.c” this file.

        Is it OK?

        Now i got this error message:
        [ 212.477858] pca953x: probe of 2-0021 failed with error -22

        please advice me soon…

        1. Post
          Author
          ericn

          Sorry Kevin,

          It seems that I didn’t read the message thoroughly enough (I didn’t note the error message in the kernel compile). My previous statement still applies, but you should select the SABRE SD board instead of SABRE Lite (and still replace the kernel image).

      2. kevin

        Dear ericn,

        Thank you for your information.

        As I mentioned above, I have nitrogen6x board. But my ltib -> config does not have “nitrogen6x” board. Instead of that I select “mx6q_sabrelite” as my board.

        Is it OK?

        I changed “board-mx6q_sabrelite.c” file Instead of the “mx6_nitrogen6x.c”.

        Now I got following error message:
        [ 212.477858] pca953x: probe of 2-0021 failed with error -22

        Please advice me soon…

        1. Post
          Author
          ericn

          Hi Kevin,

          The Freescale LTIB release doesn’t contain support for our boards. It does contain fledgling SABRE Lite support, but that code base isn’t thoroughly tested by Freescale, so we recommend using either the SABRE SD or SABRE Lite board in LTIB, then compiling our matching kernel separately as discussed in this post.

          1. kevin

            Dear ericn,

            I tried on SABRELite board but something occurred again. I explain my target and what I have done up to now.

            I want to connect TCA6408 IO Expander and get key input to my embedded system.
            I am trying with SABRELite (iMX6Q) Boad and my development environment is LTIB (L3.0.35_4.1.0_130816_source.tar.gz)

            I have done below modifications

            1.) add an entry into “board-mx6q_sabrelite.c”

            static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
                    {
                          I2C_BOARD_INFO("pca953x", 0x21),
                          .irq = gpio_to_irq(MX6Q_SABRELITE_CAP_TCH_INT1),
                    },
            };
            

            2.) Enable driver from menuconfig

            ---------------------------------------------------------------------------------
            ---  GPIO Support
             PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports
            [ * ]         Interrupt controller support for PCA953x
            ---------------------------------------------------------------------------------
            

            When I boot the system, driver registration is OK.
            But there is an error(pca953x: probe of 2-0020 failed with error -22) in Probe() function.

            #Console Log

            Freescale USB OTG Driver loaded, $Revision: 1.55 $
            pca953x: probe of 2-0020 failed with error -22
            imx-ipuv3 imx-ipuv3.0: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
            imx-ipuv3 imx-ipuv3.1: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)
            mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 driver probed
            mxc_mipi_csi2 mxc_mipi_csi2: i.MX MIPI CSI2 dphy version is 0x3130302a
            MIPI CSI2 driver module loaded
            Advanced Linux Sound Architecture Driver Version 1.0.24.
            

            This error occured becauseof (pdata == NULL)

            #linux-3.0.35/drivers/gpio/pca953x.c
            static int __devinit pca953x_probe(struct i2c_client *client,
            				   const struct i2c_device_id *id)
            {
            	struct pca953x_platform_data *pdata;
            	struct pca953x_chip *chip;
            	int ret = 0;
            
            	chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
            	if (chip == NULL)
            		return -ENOMEM;
            
            	pdata = client->dev.platform_data;
            	if (pdata == NULL) {
            		pdata = pca953x_get_alt_pdata(client);
            		/*
            		 * Unlike normal platform_data, this is allocated
            		 * dynamically and must be freed in the driver
            		 */
            		chip->dyn_pdata = pdata;
            	}
            
            	if (pdata == NULL) {
            		dev_dbg(&client->dev, "no platform datan");
            		ret = -EINVAL;
            		goto out_failed;
            	}
            

            I can not understand the problem. support me ericn

        2. Post
          Author
          ericn

          Hi Kevin,

          You need to supply some platform data in the i2c_board_info structure.

          From the code you supplied, the structure should be of type struct pca953x_platform_data and
          referred to in the platform_data field.

          i.e.

          static struct pca953x_platform_data my_pca953x_pdata = {
               // fill in platform details
          };
          
          static struct i2c_board_info mxc_i2c2_board_info[] __initdata = {
                  {
                        I2C_BOARD_INFO("pca953x", 0x21),
                        .irq = gpio_to_irq(MX6Q_SABRELITE_CAP_TCH_INT1),
                        .platform_data = &my_pca953x_pdata
                  },
          };
          
          1. kevin

            Hi ericn,

            Thank you again for the support. But I am new for Linux device driver.
            I cannot understand what are the relevant platform data for SABRE Lite board.

            Could you please send me the platform details for SABRE Lite?

  8. kevin

    Hi ericn,

    I’m sorry. I got the platform details. driver is working properly.
    please ignore previous question

Leave a Reply

Your email address will not be published. Required fields are marked *