Building 03.22 PSP release Components for OMAP-L138

From Texas Instruments Wiki
Jump to: navigation, search

Content is no longer maintained and is being kept for reference only!



Content is no longer maintained and is being kept for reference only!



Rebuilding the Linux kernel

To rebuild the Linux kernel, follow the steps below.

Preparing your Environment

  1. If you have not already done so, install the arago toolchain on your Linux host.
  2. If U-Boot is not built yet, build U-Boot first, as building Linux Kernel requires mkimage utility, which gets built along with U-Boot. Refer to Rebuilding U-Boot for steps to build U-Boot. Once built, mkimage will be present under the tools folder of U-Boot source (/home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/u-boot/uboot-xx.xx.xx.xx/tools). Ensure that this path is added to the $PATH variable by adding the following
  3. host$ export PATH=home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/u-boot/uboot-xx.xx.xx.xx/tools:$PATH 
    

    to the ~/.bashrc file. You can then source the ~/.bashrc file with the following command

    host$ source ~/.bashrc 
    
  4. Use your Linux host to extract source files for building the target Linux kernel from the src/kernel/linux-#.#.#.#.tar.gz tarball from the OMAP-L138 Linux PSP package, which is located in the DaVinci-PSP-SDK-#.#.#.# directory under the main SDK installation directory (/home/<user>/OMAP_L138_arm_x_xx_xx_xx/DaVinci-PSP-SDK-xx.xx.xx.xx/src/kernel for default path installation). Use the tar command to extract the sources.
  5. host$ tar zxf linux-#.#.#.#.tar.gz
    

    NOTE
    Patches from the kernel-patches-#.#.#.#.tar.gz file have already been applied on Linux Kernel. This is the list of patches which have been developed on top of the base Linux kernel version. You can find information about the base Linux kernel version from the release notes accompanying the PSP release.

  6. Change directory (cd command) to the top-level directory of the Linux kernel source files obtained in the previous step.
  7. host$ cd linux-xx.xx.xx.xx
    

Basic Configuration of the Kernel

Based on what chip and development board you are using, you will need to configure the kernel for different options. Most of these setings are build into the Make file provided by TI, and you can switch between builds using some simple make options.

  1. Clean your installation of previous build settings
  2. host$ make distclean ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- 
    
  3. Configure the kernel according to the default configuration provided. The steps below assume that the arago toolchain is already present in your $PATH variable.
  4. host$ make da850_omapl138_defconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- 
    
  5. Modify the kernel options you would like to run. This may take some planning, but the default settings are a good place to start. For more information on these settings, look further down the page at Driver configuration in the Linux kernel or see detailed instructions for different processors root file system. There are two menu configs that are commmon to run:
  6. host$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- menuconfig 
    (or)
    host$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- xconfig
    

Building uImage

Run the following command to build the kernel image:

host$ make uImage ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

The compiled uImage is copied into the arch/arm/boot directory under the kernel tree.

Once the kernel has been compiled, if you are using tftp boot, use the following commands to copy the uImage to a place where U-Boot can use TFTP to download it to the EVM. These commands assume you are using the default TFTP root area, which is /tftpboot. If you use another TFTP root location, please change /tftpboot to your own TFTP root location:

host$ cp arch/arm/boot/uImage /tftpboot

Note
If the uImage build fails with a similar message as follows:

"mkimage" command not found - U-Boot images will not be built

it could be that the path to the u-boot uImage script has not been added to the command search path. Include the path "{u-boot source path}/tools" to your PATH environment variable.

Building Modules

To build all features configured as modules (M), issue the following command:

host$ make modules ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

Installing modules to Target File System

To install the compiled modules into the target root file system, issue the following command:

host$ make modules_install INSTALL_MOD_PATH=<root fs path> ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-

where the <root fs path> is the path of your target root file system on the host machine (/home/user/workdir/filesys for example).


See Loading Linux Kernel Modules for more information on using kernel modules after you build them.

Driver configuration in the Linux kernel

This section describes the procedure to configure the kernel to support various drivers.

  1. To begin, if you have not done basic configuration of the kernel go to that section, and do that first. Once you have compiled with base configuration, return here.
  2. Once you base configuration is set, you can use menu based configurations to change details about your kernel's build.

    host$  make menuconfig ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-
    
  3. To select/de-select a feature, press 'space' after bringing cursor over selection box. When '*' appears in selection box, the feature is selected, when the selection box is empty, the feature is de-selected.
  4. To configure a particular feature as module, press 'space' until an 'M' appears in the selection box. Note that some of the menu options which are required to be deselected here (selection box empty) may not appear at all because the internal checks which render the option invalid. In this case, it is safe to assume that the options have been automatically disabled.

USB 2.0

USB2.0 interface is build into the default config in Dual Role mode meaning it can either be a Host or Device (OTG is not supported) automatically without need for user intervention. In the Dual Role mode support for MSC application is available in Host mode while RNDIS/CDC gadget application is available in Device mode by default. User can choose to change the application/mode supported by following the below steps if needed.

Configuring for Host

Device Drivers --->

    USB support --->
        <*> Support for Host-side USB
        --- Miscellaneous USB options
        [*] USB device class-devices
        --- USB Host Controller Drivers
        <*> Inventra Highspeed Dual Role Controller (TI, ADI, ...)
        --- Platform Glue Layer
        [*] DA8xx/OMAP-L1x
             <*>     MUSB DMA mode (TI CPPI4.1)  --->
             [ ]     Disable DMA (always use PIO)

(please see Inventra HDRC USB Controller for more details on the underlying driver)

When required to support HID devices (mouse, keyboard etc), choose the following

Device Drivers --->
	Input device support --->
		<*> Mouse interface
		[*] Keyboards --->
			<*> AT keyboard

	HID Devices --->
		<*> USB Human Interface Device(full HID) support

When required to support MSC devices (pen drive etc), choose the following

Device Drivers --->
	SCSI device support --->
		--- SCSI device support
		[*] legacy /proc/scsi/support
		--- SCSI support type (disk, tape, CD-ROM)
		<*> SCSI disk support
	USB support --->
		<*> USB Mass Storage support
		

 When required to support UVC, UAC class (Webcam, Speakers, Microphone etc.) choose the following

Device Drivers --->
	Multimedia support --->
		Video capture adapters --->
			V4L USB devices --->
				<*> USB Video Class (UVC)
				[*] UVC input events device support
	Sound card support --->
		Advanced Linux Sound Architecture --->
			USB sound devices --->
				<*> USB Audio/MIDI driver
				

Configuring for Gadget

	Device Drivers --->
    		USB support --->
        		< > Support for Host-side USB
        		<*> Inventra Highspeed Dual Role Controller (TI, ...)
			USB Gadget Support
                              <*> Inventra Highspeed Dual Role Controller--->
         

When required to support Ethernet gadget choose the following

	Device Drivers --->       
		USB support --->
			USB Gadget Support --->
				<*> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet support)) 
        	    		[*]     RNDIS support (EXPERIMENTAL)

When required to support File backed storage gadget, choose the following

	Device Drivers --->
		USB support --->
			USB Gadget Support --->
   				<M> USB Gadget Drivers
            			<M> File-backed Storage Gadget
				[*] File-backed Storage Gadget testing version (NEW)

Please make sure that Inventra HDRC is selected as USB peripheral controller which will appear only when "USB_GADGET" is selected. as shown below so after selecting Gadget Support go back to driver mode option to select "USB Peripheral (gadget stack)" and then come back again to select Inventra HDRC as USB peripheral controller.

	Device Drivers --->       
		USB support --->
			<*> USB Gadget Support --->

USB 1.1

	Device Drivers --->
		USB support --->
			<*> Support for Host-side USB
			--- Miscellaneous USB options
			[*] USB device filesystem
			--- USB Host Controller Drivers
			<*>   OHCI HCD support

To support MSC, HID, UVC, UAC applications over USB 1.1 interface refer to USB2.0 procedures for the same.

Audio

Device Drivers --->
    <*> Sound card support --->
        <*> Advanced Linux Sound Architecture --->
            <*> ALSA for SoC audio support --->
                <*> SoC Audio for the TI DAVINCI chip 

For OMAP-L138 (or DA850, AM18x) EVM board:

                <*> SoC Audio support for DA850/OMAP-L138 EVM

Graphical LCD

Device Drivers --->
         Graphics support  --->
             <*> Support for frame buffer devices --->
             <*> DA8xx/OMAP-L1xx Framebuffer support 

Character LCD

Device Drivers --->
         Graphics support  --->
             <*> Support for frame buffer devices --->
                < > DA8xx/OMAP-L1xx Framebuffer support
         <*> Parallel port support  ---> 
         [*] Staging drivers  --->
             [ ]   Exclude Staging drivers from being built
             <*>       Parallel port LCD/Keypad Panel support
             (0)       Default parallel port number (0=LPT1)
             (3)       Default panel profile (0-5, 0=custom)
             [ ]       Change LCD initialization message ?
             -*-       DA8XX/OMAP-L1/AM1xxx Dummy Parallel Port 
System Type --->
         TI DaVinci Implementations  --->
             [*] TI DA850/OMAP-L138/AM18x Reference Platform
                   Select peripherals connected to expander on UI board (Character LCD) ---> 

NAND

Device Drivers --->

    < > MMC/SD/SDIO card support  ---> 

    <*> Memory Technology Device (MTD)  support --->
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        -*-   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
        <*>   NAND Device Support ---> 
            <*> Support NAND on DaVinci SoC

WARNING
Please disable MMC support when NAND has to be used. They are pin multiplexed and NAND will not work when MMC is enabled.

NOR

Note: NOR flash is supported only on OMAP-L138 (or DA850, AM18xx) EVM

Device Drivers --->

    < > MMC/SD/SDIO card support  ---> 

    <*> Memory Technology Device (MTD)  support --->
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        -*-   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
              RAM/ROM/Flash chip drivers ---> 
                 <*> Detect flash chips by Common Flash Interface (CFI) probe
                 <*> Support for Intel/Sharp flash chips
              Mapping drivers for chip access --->
                 <*> Flash device in physical memory map

WARNING
Please disable MMC support when NOR has to be used. They are pin multiplexed and NOR will not work when MMC is enabled.

SPI

Device Drivers --->

        [*] SPI support  ---> 
            <*>     Texas Instruments DaVinci/DA8x/OMAP-L/AM1x SoC SPI controller

        <*> Memory Technology Device (MTD) support  --->
        [*]   Command line partition table parsing
        <*>   Direct char device access to MTD devices
        -*-   Common interface to block layer for MTD 'translation layers'
        <*>   Caching block device access to MTD devices
              Self-contained MTD device drivers  --->
                  <*> Support most SPI Flash chips (AT26DF, M25P, W25X, ...)
                  [*]   Use FAST_READ OPCode allowing SPI CLK <= 50MHz

MMC/SD

Device Drivers --->

    <*>MMC/SD/SDIO card support  ---> 
        <*>   MMC block device driver
        <*>   TI DAVINCI Multimedia Card Interface support 

RTC

Device Drivers --->

    <*> Real Time Clock  ---> 
        <*>   TI OMAP1

SATA

	Device Drivers --->
		<*> Serial ATA (prod) and Parallel ATA (experimental) drivers --->
			[*] SATA Port Multiplier support
			<*> Platform AHCI SATA support
	

eCAP

         Device Drivers --->
                 <*> PWM Support --->
                    <*> eCAP PWM Support   

eHRPWM

         Device Drivers --->
                  <*> PWM Support --->
                   <*> eHRPWM Support 

NOTE
Please disable framebuffer driver support from menuconfig when eHRPWM module 1 output A (eHRPWM.1:0/) needs to be used. Since it is pin multiplexed with this eHRPWM module, the driver will not work when it is enabled.

 Device Drivers --->
         Graphics support  --->
             <*> Support for frame buffer devices --->
             < > DA8xx/OMAP-L1xx Framebuffer support 

NOTE
Please disable spi driver support from menuconfig when eHRPWM module 1 output B (eHRPWM.1:1/) needs to be used. Since it is pin multiplexed with this eHRPWM module, the driver will not work when it is enabled.

 Device Drivers --->
         [*]SPI support  --->
             < > Texas Instruments DaVinci/DA8x/OMAP-L/AM18x SoC SPI controller 

eCAP Capture

         Device Drivers --->
                 <*> PWM Support --->
                    <*> eCAP capture Support

NOTE
Please disable Sound Card driver support from menuconfig when eCAP capture needs to be used. Since they are pin multiplexed with eCAP, the driver will not work when these are enabled.


Device Drivers --->

    < > Sound card support  --->   

Power Management

CPUFreq

CPU Power Management  --->
        CPU Frequency scaling --->
	        [*] CPU Frequency scaling 
		Default CPUFreq governor (userspace)  ---> 
			(X) usespace 
Device Drivers  --->
	Multifunction device drivers  --->       
		<*> TPS6507x Power Management / Touch Screen chips
	[*] Voltage and Current Regulator Support  --->
		<*>   TI TPS6507X Power regulators

CPUIdle

CPU Power Management  --->
	[*] CPU idle PM support

Suspend-to-RAM

Power management options  --->
	 [*] Power Management support
	 [*] Suspend to RAM and standby 

Ethernet

[*] Networking support  --->
	Networking options  --->
		[*] TCP/IP networking 
		[*]   IP: kernel level autoconfiguration
		[*]     IP: DHCP support
Device Drivers --->
	[*] Network device support  --->
               	<*>   Generic Media Independent Interface device support
		[*]   Ethernet driver support  --->
		      <*>   Texas Instruments (TI) devices
                      <*>   TI DaVinci EMAC Support
                      -*-   TI DaVinci MDIO Support
                      -*-   TI DaVinci CPDMA Support
                                    

Using the RMII PHY on OMAP-L138 (or DA850, AM18xx) UI card

System Type --->
         TI DaVinci Implementations  --->
             [*] TI DA850/OMAP-L138/AM18x Reference Platform
                   Select peripherals connected to expander on UI board (RMII Ethernet PHY) --->

Device Drivers --->
        -*- GPIO Support  --->
                <*>   PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports  

WARNING
Note: When using RMII PHY, MII ethernet PHY will not be functional. Do not plug in ethernet cables to both the PHYs.

VPIF

Enabling capture using tvp514x

System Type  --->
        TI DaVinci Implementations  --->
                [*] TI DA850/OMAP-L138/AM18xx Reference Platform
                       Select peripherals connected to expander on UI board (Video Port Interface)  --->

Device Drivers --->
    <*> Multimedia support  --->
            <*>   Video For Linux
                [*]   Video capture adapters  --->
                        [*]   V4L platform devices  ---> 
                                <*>  DM646x/DA850/OMAPL138 EVM Video Display
                                <*>  DM646x/DA850/OMAPL138 EVM Video Capture
                                -*-  DaVinci VPIF Driver
                [ ]   Autoselect pertinent encoders/decoders and other helper chips
                      Encoders/decoders and other helper chips  --->  
                        <*> Texas Instruments TVP514x video decoder
                        -*- ADV7343 video encoder
                        -*- THS7303 Video Amplifier

Note: To run the vpif examples add the following to your bootargs

vpif_capture.ch0_bufsize=831488 vpif_display.ch2_bufsize=831488

WARNING
Please disable the graphical LCD frame buffer driver and the character LCD driver when VPIF display has to be used. They are pin multiplexed and VPIF display will not work when LCD is enabled.

Device Drivers --->
         Graphics support  --->
             < > DA8xx/OMAP-L1xx/AM1xxx Framebuffer support 

Enabling RAW capture using MT9T031 sensor [1]

Touchscreen

TPS65070

TPS65070 touchscreen controller is found on DA850 (or OMAP-L138, AM18xx) EVM

Device Drivers --->
	Multifunction device drivers  --->       
		<*> TPS6507x Power Management / Touch Screen chips
        Input device support  --->
                [*]   Touchscreens  --->   
                        <*>   TPS6507x based touchscreens         

Rebuilding U-Boot

Follow these steps to rebuild U-Boot:

  1. If you have not already done so, install the arago toolchain on your Linux host.
  2. Use your Linux host to extract source files for building U-Boot from the src/u-boot/u-boot-#.#.#.#.tar.gz tarball from the OMAP-L138 Linux PSP package, which is located in the DaVinci-PSP-SDK-#.#.#.# directory under the main SDK installation directory. Use the tar command to extract the sources.

    NOTE
    Patches from the uboot-patches-#.#.#.#.tar.gz file have already been applied to U-Boot. This is the list of patches which have been developed on top of the base version. You can find information about the base U-Boot version from the release notes accompanying the PSP release.

  3. Go to the u-boot directory created when you extracted the files.
  4. Run the following commands on your Linux host to build U-Boot.
  5. NOTE
    The steps below assume that the arago toolchain is already present in your $PATH variable.

    host$ make distclean CROSS_COMPILE=arm-arago-linux-gnueabi-
    host$ make da850evm_config CROSS_COMPILE=arm-arago-linux-gnueabi- 
    host$ make u-boot.ais CROSS_COMPILE=arm-arago-linux-gnueabi-
    

    The compiled u-boot.ais file will be created in the same directory. This file can be directly flashed to SPI flash using the steps mentioned here. A precompiled image for SPI boot mode (u-boot-spi.ais) is available under the images/u-boot/omapl1x8/ folder of PSP installation.


To change the default options, the EVM configuration file (include/configs/da850evm.h) needs to be edited.

To change U-Boot environment area location or size:

  • CONFIG_ENV_SIZE Configures the environment variable size.
  • CONFIG_ENV_OFFSET Configures the environment variable offset.


Choice of Flash supported:

NOTE
Only one of these Flash options should be defined at a time. Defining more than one Flash option results in a compilation error when you build U-Boot.

  • CONFIG_USE_SPIFLASH If this flag is defined, U-Boot supports the SPI flash on the EVM board. The environment variables are stored on the SPI flash. This option is switched on by default.
  • CONFIG_USE_NAND If this flag is defined, U-Boot supports U-Boot NAND flash access using the OMAP-L1 SoC. Environment variables are also stored on the NAND flash.
  • CONFIG_USE_NOR If this flag is defined, U-Boot supports U-Boot NOR flash access using the OMAP-L1 SoC. Environment variables are also stored on the NOR flash.

Configuring U-Boot for different boot modes

NAND boot mode

  • Use the below steps to compile U-Boot:
  • host$ make distclean CROSS_COMPILE=arm-arago-linux-gnueabi-
    host$ make da850evm_nand_config CROSS_COMPILE=arm-arago-linux-gnueabi- 
    host$ make u-boot.ais CROSS_COMPILE=arm-arago-linux-gnueabi-
    

    The compiled u-boot.ais file will be created in the same directory. This file can be directly flashed to NAND flash using the steps mentioned here. A precompiled image for NAND boot mode (u-boot-nand.ais) is available under the images/u-boot/omapl1x8/ folder of PSP installation.

NOR boot mode

Use the below steps to compile U-Boot:

host$ make distclean CROSS_COMPILE=arm-arago-linux-gnueabi-
host$ make da850evm_direct_nor_config CROSS_COMPILE=arm-arago-linux-gnueabi- 
host$ make all CROSS_COMPILE=arm-arago-linux-gnueabi-

The compiled u-boot.bin file will be created in the same directory. This file can be directly flashed to NOR flash using the steps mentioned here.

MMC/SD boot mode

IMPORTANT
Strict MMC/SD boot mode is only supported on SoCs which have d800k008 ROM revision. To find out the ROM revision, follow these steps.

  1. Use the below steps to compile U-Boot:
  2. host$ make distclean CROSS_COMPILE=arm-arago-linux-gnueabi-
    host$ make da850evm_mmc_config CROSS_COMPILE=arm-arago-linux-gnueabi- 
    host$ make all CROSS_COMPILE=arm-arago-linux-gnueabi-
    
  3. u-boot.bin file which needs to be written to MMC/SD card will be created in the same directory. This file should be written to MMC/SD card using the steps mentioned here. A precompiled image for pseudo MMC/SD boot mode (u-boot-mmcsd.bin) is available under the images/u-boot/omapl1x8/ folder of PSP installation.
  4. The compiled minimal u-boot (SPL) binary which needs to be flashed to SPI flash will be created under the spl directory.Convert the SPL binary to AIS format using the below command:
  5. host$ mkimage -s -n /dev/null -T aisimage -e 0x80000000 -d spl/u-boot-spl.bin spl/u-boot-spl.ais
    

    A precompiled AIS image for pseudo MMC/SD boot mode (u-boot-mmcsd.ais) is available under the images/u-boot/omapl1x8/ folder of PSP installation.

    Note
    Before executing above command, make sure that the path "{u-boot source path}/tools" is added to your PATH environment variable.

  6. Flash this AIS image to SPI flash.

Configuring U-Boot to enable peripherals

Enabling RMII

  1. Define the macro CONFIG_DRIVER_TI_EMAC_USE_RMII in include/configs/da850evm.h file.
  2. undef the macro CONFIG_MII in include/configs/da850evm.h file.