26 Jun, 2013

36 commits

  • Normally, multiple public keys can be provided and U-Boot is not
    required to use all of them for verification. This is because some
    images may not be signed, or may be optionally signed.

    But we still need a mechanism to determine when a key must be used.
    This feature cannot be implemented in the FIT itself, since anyone
    could change it to mark a key as optional. The requirement for
    key verification must go in with the public keys, in a place that
    is protected from modification.

    Add a -r option which tells mkimage to mark all keys that it uses
    for signing as 'required'.

    If some keys are optional and some are required, run mkimage several
    times (perhaps with different key directories if some keys are very
    secret) using the -F flag to update an existing FIT.

    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut

    Simon Glass
     
  • When signing an image, it is useful to add some details about which tool
    or person is authorising the signing. Add a comment field which can take
    care of miscellaneous requirements.

    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut

    Simon Glass
     
  • When signing images it is sometimes necessary to sign with different keys
    at different times, or make the signer entirely separate from the FIT
    creation to avoid needing the private keys to be publicly available in
    the system.

    Add a -F option so that key signing can be a separate step, and possibly
    done multiple times as different keys are avaiable.

    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut

    Simon Glass
     
  • FIT image verification requires public keys. Add a convenient option to
    mkimage to write the public keys to an FDT blob when it uses then for
    signing an image. This allows us to use:

    mkimage -f test.its -K dest.dtb -k keys test.fit

    and have the signatures written to test.fit and the corresponding public
    keys written to dest.dtb. Then dest.dtb can be used as the control FDT
    for U-Boot (CONFIG_OF_CONTROL), thus providing U-Boot with access to the
    public keys it needs.

    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut

    Simon Glass
     
  • Keys required for signing images will be in a specific directory. Add a
    -k option to specify that directory.

    Also update the mkimage man page with this information and a clearer list
    of available commands.

    Signed-off-by: Simon Glass
    Reviewed-by: Marek Vasut (v1)

    Simon Glass
     
  • RSA provides a public key encryption facility which is ideal for image
    signing and verification.

    Images are signed using a private key by mkimage. Then at run-time, the
    images are verified using a private key.

    This implementation uses openssl for the host part (mkimage). To avoid
    bringing large libraries into the U-Boot binary, the RSA public key
    is encoded using a simple numeric representation in the device tree.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add support for signing images using a new signature node. The process
    is handled by fdt_add_verification_data() which now takes parameters to
    provide the keys and related information.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a structure to describe an algorithm which can sign and (later) verify
    images.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add configs to enable tracing when it is needed.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Some changes are needed to x86 timer functions to support tracing. Add
    these so that the feature works correctly.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add tracing to Exynos5 boards, so that tracing can be enabled when building
    with 'make FTRACE=1'. We use a 16MB trace buffer.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • For tracing to work it has to be able to access the microsecond timer
    without causing a recursive call to the function entry/exit handlers.
    Add attributes to the relevant functions to support this.

    Signed-off-by: Simon Glass

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Implement this feature on ARM for tracing.

    It would be nice to have generic bootm support so that it is easily
    implemented on any arch.

    Signed-off-by: Simon Glass
    Acked-by: Albert ARIBAUD

    Simon Glass
     
  • For tracing it is useful to run as much of U-Boot as possible so as to get
    a complete picture. Quite a bit of work happens in bootm, and we don't want
    to have to stop tracing before bootm starts.

    Add a way of doing a 'fake' boot of the OS - which does everything up to
    the point where U-Boot is about to jump to the OS image. This allows
    tracing to record right until the end.

    This requires arch support to work.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present the bootm code is mostly duplicated for the plain 'bootm'
    command and its sub-command variant. This makes the code harder to
    maintain and means that changes must be made to several places.

    Introduce do_bootm_states() which performs selected portions of the bootm
    work, so that both plain 'bootm' and 'bootm ' can use the
    same code.

    Additional duplication exists in bootz, so tidy that up as well. This
    is not intended to change behaviour, apart from minor fixes where the
    previously-duplicated code missed some chunks of code.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • At present the arguments to bootm are processed in a somewhat confusing
    way. Sub-functions must know how many arguments their calling functions
    have processed, and the OS boot function must also have this information.
    Also it isn't obvious that 'bootm' and 'bootm start' provide arguments in
    the same way.

    Adjust the code so that arguments are removed from the list before calling
    a sub-function. This means that all functions can know that argv[0] is the
    first argument of which they need to take notice.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • It is difficult to automatically test tracing on most architectures, but
    with sandbox it is easy enough to do a simple sanity check.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Support tracing on sandbox by adding suitable CONFIG options. To enable it,
    compile U-Boot with FTRACE=1.

    The timer functions are marked to skip tracing, since these are called from
    the tracing code itself, and we want to avoid an infinite loop.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This tool provides the facility to decode U-Boot trace data and write out
    a text file in Linux ftrace format for use with pytimechart.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add hooks for tracing to generic board, including:

    - allow early tracing to start early as possible in U-Boot
    - reserve memory for trace buffer
    - copy early trace buffer to main trace buffer after relocation
    - setup full tracing support after relocation

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Use -finstrument-functions when tracing is enabled (make FTRACE=1).
    Tracing is not currently supported by SPL even if sufficient memory is
    available.

    When tracing is enabled, we #define FTRACE. This can be used by
    board config files to conditionally enable the tracing options.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a trace command with sub-commands to start/stop tracing, print out
    statistics and dump trace information to memory for later upload to a host.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Add a library which supports tracing of execution using built-in gcc
    features and a microsecond timer. This can be used to record a list of
    function which are executed, along with a timestamp for each. Later
    this information can be sent to the host for processing.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Move bootstage's numbering printing code into a generic place so that it can
    be used by tracing also.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • The unstash code is a bit loose with its printf() types, which gives
    warnings on sandbox. Correct this.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • When this test fails it is useful to see the output from U-Boot. Add
    printing of this information on failure.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • For some reason this does not normally cause a compiler warning, but the code
    seems to be incorrect. Add the missing return.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • Enabling FIT produces a compile error. Fix this.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • I am not sure of the meaning of extern inline, but this gives errors
    when building with function instrumenting enabled. Change these functions
    to static inline.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • This patch initiates cros-ec in board_init() to enable it for smdk5250.

    This patch depends on the patch in the MMC series that brings in exynos5-dt.c.
    Refer to http://patchwork.ozlabs.org/patch/240084.

    Signed-off-by: Simon Glass
    Signed-off-by: Vincent Palatin
    Signed-off-by: Hung-ying Tyan
    Acked-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds cros-ec related device nodes to exynos5250-snow.dts.
    It also adds a gpio node to exynos5250.dtsi.

    Signed-off-by: Hung-ying Tyan
    Acked-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds the driver for keyboard that's controlled by ChromeOS EC.

    Signed-off-by: Randall Spangler
    Signed-off-by: Simon Glass
    Signed-off-by: Vincent Palatin
    Signed-off-by: Hung-ying Tyan
    Acked-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds LPC support for carrying out the cros_ec protocol.

    Signed-off-by: Randall Spangler
    Signed-off-by: Simon Glass
    Signed-off-by: Hung-ying Tyan
    Acked-by: Simon Glass
    Tested-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds SPI support for carrying out the cros_ec protocol.

    Signed-off-by: Hung-ying Tyan
    Signed-off-by: Randall Spangler
    Signed-off-by: Simon Glass
    Acked-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds I2C support for carrying out the cros_ec protocol.

    Signed-off-by: Randall Spangler
    Signed-off-by: Simon Glass
    Signed-off-by: Hung-ying Tyan
    Acked-by: Simon Glass
    Tested-by: Simon Glass

    Hung-ying Tyan
     
  • This patch adds the cros_ec driver that implements the protocol for
    communicating with Google's ChromeOS embedded controller.

    Signed-off-by: Bernie Thompson
    Signed-off-by: Bill Richardson
    Signed-off-by: Che-Liang Chiou
    Signed-off-by: Doug Anderson
    Signed-off-by: Gabe Black
    Signed-off-by: Hung-ying Tyan
    Signed-off-by: Louis Yung-Chieh Lo
    Signed-off-by: Randall Spangler
    Signed-off-by: Sean Paul
    Signed-off-by: Simon Glass
    Signed-off-by: Vincent Palatin
    Acked-by: Simon Glass
    Tested-by: Simon Glass

    Hung-ying Tyan
     

25 Jun, 2013

4 commits