15 Mar, 2016

40 commits

  • Enable support for PMMC the TI power processor on K2G. This processor
    manages all power management related activities on the SoC and and
    allows the Operating Systems on compute processors such as ARM, DSP to
    offload the power logic away into the power processor.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • Enable support for PMMC the TI power processor on K2G. This processor
    manages all power management related activities on the SoC and and
    allows the Operating Systems on compute processors such as ARM, DSP to
    offload the power logic away into the power processor. U-boot just has a
    load responsibility, hence the view of the hardware from a bootloader
    perspective is different from the view of hardware from a Operating
    System perspective. While bootloader just loads up the firmware,
    Operating Systems look at the resultant system as "hardware".

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • Many TI System on Chip (SoC) solutions do have a dedicated
    microcontroller for doing power management functionality. These include
    the AM335x, AM437x, Keystone K2G SoCs. The functionality provided by
    these microcontrollers and the communication mechanisms vary very
    widely. However, we are able to consolidate some basic functionality to
    be generic enough starting with K2G SoC family. Introduce a basic remote
    proc driver to support these microcontrollers. In fact, on SoCs starting
    with K2G, basic power management functions are primarily accessible for
    the High Level Operating Systems(HLOS) via these microcontroller solutions.

    Hence, having these started at a bootloader level is pretty much
    mandatory.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • These are useful for modules that need to be held in reset and are
    enabled for data to be loaded on to them. Typically these are
    microcontrollers or other processing entities in the system.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • '#define X a | b' is better defined as '#define X (a | b)' for obvious
    reasons.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • u-boot coding style guidance in
    http://www.denx.de/wiki/U-Boot/CodingStyle clearly mentions that the
    kernel doc style shall be followed for documentation in u-boot.

    Current PSC documentation standard does not, so fix that.

    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • With commit fe772ebd285b ("ARM: keystone2: Use common definition for
    clk_get_rate"), we have centralized the clock code into a common clock
    logic and the redundant files, unfortunately remained... Clean that
    up.

    Signed-off-by: Nishanth Menon
    Acked-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • Current AM57xx evm supports both BeagleBoard-X15
    (http://beagleboard.org/x15) and AM57xx EVM
    (http://www.ti.com/tool/tmdxevm5728).

    The AM572x EValuation Module(EVM) provides an affordable platform to
    quickly start evaluation of Sitara. ARM Cortex-A15 AM57x Processors
    (AM5728, AM5726, AM5718, AM5716) and accelerate development for HMI,
    machine vision, networking, medical imaging and many other industrial
    applications. This EVM is based on the same BeagleBoard-X15 Chassis
    and adds mPCIe, mSATA, LCD, touchscreen, Camera, push button and TI's
    wlink8 offering.

    Since the EEPROM contents are compatible between the BeagleBoard-X15 and
    the AM57xx-evm, we add support for the detection logic to enable
    support for various user programmable scripting capability.

    NOTE: U-boot configuration is currently a superset of AM57xx evm and
    BeagleBoard-X15 and no additional configuration tweaking is needed.

    This change also sets up the stage for future support of TI AM57xx EVMs
    to the same base bootloader build.

    Signed-off-by: Steve Kipisz
    Signed-off-by: Lokesh Vutla
    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Kipisz, Steven
     
  • Many TI EVMs have capability to store relevant board information
    such as DDR description in EEPROM. Further many pad configuration
    variations can occur as part of revision changes in the platform.
    In-order to support these at runtime, we for a board detection hook
    which is available for override from board files that may desire to do
    so.

    NOTE: All TI EVMs are capable of detecting board information based on
    early clocks that are configured. However, in case of additional needs
    this can be achieved within the override logic from within the board
    file.

    Signed-off-by: Steve Kipisz
    Reviewed-by: Tom Rini
    Reviewed-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Kipisz, Steven
     
  • Now that we have a generic TI eeprom logic which can be reused across
    platforms, reuse the same.

    This revision also includes fixes identified by Dave Gerlach

    Cc: Dave Gerlach
    Signed-off-by: Nishanth Menon
    Signed-off-by: Steven Kipisz
    Signed-off-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • Use the generic EEPROM detection logic instead of duplicating the AM
    eeprom logic.

    Signed-off-by: Nishanth Menon
    Signed-off-by: Steven Kipisz
    Signed-off-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Nishanth Menon
     
  • Several TI EVMs have EEPROM that can contain board description information
    such as revision, DDR definition, serial number, etc. In just about all
    cases, these EEPROM are on the I2C bus and provides us the opportunity
    to centralize the generic operations involved.

    The on-board EEPROM on the BeagleBone Black, BeagleBone, AM335x EVM,
    AM43x GP EVM, AM57xx-evm, BeagleBoard-X15 share the same format.
    However, DRA-7* EVMs, OMAP4SDP use a modified format.

    We hence introduce logic which is generic between these platforms
    without enforcing any specific format. This allows the boards to use the
    relevant format for operations that they might choose.

    This module will compile for all TI SoC based boards when
    CONFIG_TI_I2C_BOARD_DETECT is enabled to have optimal build times for
    platforms that require this support.

    It is important to note that this logic is fundamental to the board
    configuration process such as DDR configuration which is needed in
    SPL, hence cannot be part of the standard u-boot driver model (which
    is available later in the process). Hence, to aid efficiency, the
    eeprom contents are copied over to SRAM scratchpad memory area at the
    first invocation to retrieve data.

    To prevent churn with cases such as DRA7, where eeprom format maybe
    incompatible, we introduce a generic common format in eeprom which
    is made available over accessor functions for usage.

    Special handling for BBG1 EEPROM had to be introduced thanks to the
    weird eeprom rev contents used.

    The follow on patches introduce the use of this library for AM335x,
    AM437x, and AM57xx.

    Signed-off-by: Lokesh Vutla
    Signed-off-by: Steve Kipisz
    Signed-off-by: Roger Quadros
    Signed-off-by: Nishanth Menon
    Reviewed-by: Tom Rini

    Lokesh Vutla
     
  • Centralize gpi2c_init into omap_common from the sys_proto header so
    that the information can be reused across SoCs.

    Signed-off-by: Steve Kipisz
    Reviewed-by: Tom Rini
    Reviewed-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Kipisz, Steven
     
  • Early clock initialization is currently done in two stages for OMAP4/5
    SoCs. The first stage is the initialization of console clocks and
    then we initialize basic clocks for functionality necessary for SoC
    initialization and basic board functionality.

    By splitting up prcm_init and centralizing this clock initialization,
    we setup the code for follow on patches that can do board specific
    initialization such as board detection which will depend on these
    basic clocks.

    As part of this change, since the early clock initialization
    is centralized, we no longer need to expose the console clock
    initialization.

    NOTE: we change the sequence slightly by initializing console clocks
    timer after the io settings are complete, but this is not expected
    to have any functioanlity impact since we setup the basic IO drive
    strength initialization as part of do_io_settings.

    Signed-off-by: Steve Kipisz
    Reviewed-by: Tom Rini
    Reviewed-by: Lokesh Vutla
    Reviewed-by: Tom Rini

    Kipisz, Steven
     
  • Detect a FIT when loading from MMC and handle it using the new FIT SPL
    support.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • When building a FIT, more than one device tree can be included. The board
    can select (at run-time) the one that it wants.

    Add a Kconfig option to allow the list of devices trees (supported by the
    board) to be specified.

    When using SPL_LOAD_FIT, build u-boot.img in FIT format instead of the
    legacy image format. Include all the listed device tree files in this FIT.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This provides a way to load a FIT containing U-Boot and a selection of device
    tree files. The board can select the correct device tree by probing the
    hardware. Then U-Boot is started with the selected device tree.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • SPL calls this function with each device tree it can find in the FIT. The
    board should implement this function, using whatever hardware detection it
    can muster to determine the correct device tree.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Since we now support data outside the FIT image, bring it into the FIT image
    first before we do any processing. This avoids adding new functionality to
    the core FIT code for now.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • One limitation of FIT is that all the data is 'inline' within it, using a
    'data' property in each image node. This means that to find out what is in
    the FIT it is necessary to scan the entire file. Once loaded it can be
    scanned and then the images can be copied to the correct place in memory.

    In SPL it can take a significant amount of time to copy images around in
    memory. Also loading data that does not end up being used is wasteful. It
    would be useful if the FIT were small, acting as a directory, with the
    actual data stored elsewhere.

    This allows SPL to load the entire FIT, without the images, then load the
    images it wants later.

    Add a -E option to mkimage to request that it output an 'external' FIT.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • To make the auto-FIT feature useful we need to be able to provide a list of
    device tree files on the command line for mkimage to add into the FIT. Add
    support for this feature.

    So far there is no support for hashing or verified boot using this method.
    For those cases, a .its file must still be provided.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present, when generating a FIT, mkimage requires a .its file containing
    the structure of the FIT and referring to the images to be included.

    Creating the .its file is a separate step that makes it harder to use FIT.
    This is not required for creating legacy images.

    Often the FIT is pretty standard, consisting of an OS image, some device
    tree files and a single configuration. We can handle this case automatically
    and avoid needing a .its file at all.

    To start with, support automatically generate the FIT using a new '-f auto'
    option. Initially this only supports adding a single image (e.g. a linux
    kernel) and a single configuration.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sometimes it is useful to obtain the short name for an Operating System,
    architecture or compression mechanism. Provide functions for this.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This will be used in mkimage when working out the required size of the FIT
    based on the files to be placed into it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present FIT images are set up by providing a device tree source file
    which is a file with a .its extension. We want to support automatically
    creating this file based on the image supplied to mkimage. This means that
    even though the final file type is always IH_TYPE_FLATDT, the image inside
    may be something else.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present this file is omitted. It is used to build up a binary device
    tree. We plan to do this in mkimage, so include this file in the build.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • It is useful to know which sunxi board you are booting. Display this on
    start-up to avoid confusion.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add an option to enable libfdt in SPL. This can be useful when decoding
    FIT files in SPL.

    We need to make sure this option is not enabled in SPL by this change.
    Also this option needs to be enabled in host builds. Si add a new
    IMAGE_USE_LIBFDT #define which can be used in files that are built on the
    host but must also build for U-Boot and SPL.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This option has no meaning without OF_CONTROL, so add a dependency.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • There are already two FIT options in Kconfig but the CONFIG options are
    still in the header files. We need to do a proper move to fix this.

    Move these options to Kconfig and tidy up board configuration:

    CONFIG_FIT
    CONFIG_OF_BOARD_SETUP
    CONFIG_OF_SYSTEM_SETUP
    CONFIG_FIT_SIGNATURE
    CONFIG_FIT_BEST_MATCH
    CONFIG_FIT_VERBOSE
    CONFIG_OF_STDOUT_VIA_ALIAS
    CONFIG_RSA

    Unfortunately the first one is a little complicated. We need to make sure
    this option is not enabled in SPL by this change. Also this option is
    enabled automatically in the host builds by defining CONFIG_FIT in the
    image.h file. To solve this, add a new IMAGE_USE_FIT #define which can
    be used in files that are built on the host but must also build for U-Boot
    and SPL.

    Note: Masahiro's moveconfig.py script is amazing.

    Signed-off-by: Simon Glass
    [trini: Add microblaze change, various configs/ re-applies]
    Signed-off-by: Tom Rini

    Simon Glass
     
  • Move this option to Kconfig and tidy up existing boards.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Kconfig options must defined in the defconfig files. Since RSA_SOFTWARE_EXP
    relies on CONFIG_DM, unless it is set in kconfig we cannot enable RSA.
    Remove the hacks which enable CONFIG_DM in header files and update the
    defconfig.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Various boards have the wrong Kconfig ordering now. To avoid a misleading

    diff in the next patch, reorder the configuration correctly.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The existing function to add a new property to a tree being built requires
    that the entire contents of the new property be passed in. For some
    applications it is more convenient to be able to add the property contents
    later, perhaps by reading from a file. This avoids double-buffering of the
    contents.

    Add a new function to support this and adust the existing fdt_property() to
    use it.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This is not used outside mkimage.c, so make this variable static.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Sometimes incorrect arguments are supplied but the reason is not obvious to
    the user. Add some helpful messages.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • To avoid a forward declaration, move the usage() function higher in the
    file.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Adjust the code so that option alphabetical order matches the order in the
    switch() statement. This makes it easier to find options.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The current way of parsing arguments is a bit clumsy. It seems better to
    use getopt() which is commonly used for this purpose.

    Convert the code to use getopt() and make a few minor adjustments as needed.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present main() is very long. Split out the argument processing to make
    it easier to follow.

    Signed-off-by: Simon Glass

    Simon Glass