12 Apr, 2019

1 commit


10 Apr, 2019

1 commit


24 Mar, 2019

1 commit


04 Dec, 2018

1 commit


28 Nov, 2018

1 commit


22 Apr, 2018

1 commit


20 Apr, 2018

1 commit


12 Apr, 2018

1 commit


10 Apr, 2018

1 commit


09 Apr, 2018

2 commits


04 Apr, 2018

3 commits


03 Apr, 2018

1 commit

  • Calling csf_is_valid() with an un-signed image may lead to data abort
    as the CSF pointer could be pointing to a garbage address when accessed
    in HAB_HDR_LEN(*(const struct hab_hdr *)(ulong)ivt_initial->csf).

    Authenticate image from DDR location 0x80800000...
    Check CSF for Write Data command before authenticating image
    data abort
    pc : [] lr : []
    reloc pc : [] lr : []
    sp : fdf45dc8 ip : 00000214 fp : 00000000
    r10: fffb6170 r9 : fdf4fec0 r8 : 00722020
    r7 : 80f20000 r6 : 80800000 r5 : 80800000 r4 : 00720000
    r3 : 17a5aca3 r2 : 00000000 r1 : 80f2201f r0 : 00000019
    Flags: NzcV IRQs off FIQs off Mode SVC_32
    Resetting CPU ...

    resetting ...

    To avoid such errors during authentication process, validate IVT structure
    by calling validate_ivt function which checks the following values in an IVT:

    IVT_HEADER = 0x4X2000D1
    ENTRY != 0x0
    RES1 = 0x0
    DCD = 0x0 /* Recommended */
    SELF != 0x0 /* Absoulute address of IVT */
    CSF != 0x0
    RES2 = 0x0

    This commit also checks if Image's start address is 4 byte aligned.

    commit "0088d127 MLK-14945 HAB: Check if IVT valid before authenticating image"
    removed as this patch addresses the issue.

    Signed-off-by: Utkarsh Gupta
    (cherry picked from commit dabffd1b04df3b0393ef6a9a35b5fd816edd8c63)

    Utkarsh Gupta
     

02 Apr, 2018

9 commits

  • Prior instantiating RNG we have to ensure if the CAAM job rings are
    available. Avoid hardcoded job ring max size and use the definition at
    fsl_sec.h

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit b81379d3d2228760cc061a56c3c610b4e9fa9783)

    Breno Lima
     
  • Prior calling sec_in32() we have to ensure CAAM clock is enabled, the
    function sec_in32() is reading CAAM registers and if CAAM clock is disabled
    the system will hang.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit c4da7540e7548f36c6ad90292db7057b828a7956)

    Breno Lima
     
  • The CAAM output ring size register offset is currently defined in fsl_sec.h
    as FSL_CAAM_ORSR_JRa_OFFSET, use this definition to avoid hardcoded value in
    i.MX common code.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit 9d381708210270a1cf9bf25924c8932c436967e8)

    Breno Lima
     
  • Currently the dek_blob command is enabled by default if
    CONFIG_SECURE_BOOT is defined. Move CONFIG_CMD_DEKBLOB
    enablement to Kconfig so users can select if required
    by their application.

    This commit is based in a previous submission from Simon Glass
    in U-Boot upstream:
    https://lists.denx.de/pipermail/u-boot/2017-April/289052.html

    Signed-off-by: Simon Glass
    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit 93e089f9202b2f9600a87eae2472db21fe5d7459)

    Breno Lima
     
  • U-Boot can instantiate CAAM RNG if needed by crypto operations.
    Call sec_init() prior running a blob operation to ensure
    RNG is correctly instantiated.

    Make sure CAAM clock is enabled and check if a job ring is
    available for that operation.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit b2b745515d06f05ea288524e26cf2389d6924ff2)

    Breno Lima
     
  • The blob_encap and blob_decap functions were not flushing the dcache
    before passing data to CAAM/DMA and not invalidating the dcache when
    getting data back.
    Therefore, blob encapsulation and decapsulation failed with errors like
    the following due to data cache incoherency:
    "40000006: DECO: desc idx 0: Invalid KEY command"

    To ensure coherency, we require the key_mod, src and dst buffers to be
    aligned to the cache line size and flush/invalidate the memory regions.
    The same requirements apply to the job descriptor.

    Tested on an i.MX6Q board.

    Reviewed-by: Sumit Garg
    Signed-off-by: Clemens Gruber
    [Breno: Backported to v2017.03]
    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    (cherry picked from commit f4e19b92bc40184eee7d33e53cd190dfb692b196)

    Clemens Gruber
     
  • In order to build CMD_BLOB on i.MX CAAM supported devices it's
    necessary to select SECURE_BOOT. Add SECURE_BOOT and CAAM supported
    SoCs as dependency.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li
    (cherry picked from commit 4afb519038d190687cac6d410e9ad65d0655f1c0)

    Breno Lima
     
  • This converts the following to Kconfig:
    CONFIG_CMD_BLOB

    Signed-off-by: Simon Glass
    [trini: Add imply CMD_BLOB under CHAIN_OF_TRUST]
    Signed-off-by: Tom Rini
    [Breno: Backported to v2017.03]
    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    (cherry picked from commit 921eb14d54c612680c3e73d9ddf9e1b9f526905f)

    Simon Glass
     
  • When enabling CONFIG_CMD_BLOB and/or CONFIG_CMD_DEKBLOB, the build fails
    with a linker error:
    ...
    LD u-boot
    arch/arm/mach-imx/built-in.o: In function `blob_encap_dek':
    /home/clemens/dev/u-boot/arch/arm/mach-imx/cmd_dek.c:46: undefined
    reference to `blob_dek'

    This is due to an error in the Makefile, resulting in obj-yy/obj-yn/..
    and fsl_blob.o is therefore not linked.

    Fix it by splitting it up into two obj-y lines.

    Signed-off-by: Clemens Gruber
    Reviewed-by: Fabio Estevam
    [Breno: Backported to v2017.03]
    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    (cherry picked from commit e62c55b64fa81236caf9adaa9737de2f2c4777e3)

    Clemens Gruber
     

28 Mar, 2018

6 commits


27 Mar, 2018

1 commit


26 Mar, 2018

1 commit

  • Change USDHC0 and USDHC1 per clock source from APLL_PFD1,
    and set the APll_PFD1 clock rate to 352.8MHz.

    Also gate off APll_PFD1/2/3 before boot OS, otherwise set
    the clock rate of APll_PFD1/2/3 during OS boot up will triger
    some warning message.

    Reviewed-by: Ye Li
    Signed-off-by: Haibo Chen

    Haibo Chen
     

23 Mar, 2018

3 commits

  • Currently it's not possible to build i.MX6SL EVK with CONFIG_SECURE_BOOT
    enabled:

    In file included from drivers/crypto/fsl/jobdesc.c:12:0:
    drivers/crypto/fsl/jobdesc.c: In function ‘inline_cnstr_jobdesc_blob_dek’:
    include/fsl_sec.h:268:25: error: ‘CAAM_ARB_BASE_ADDR’ undeclared (first
    use in this function)
    #define SEC_MEM_PAGE1 (CAAM_ARB_BASE_ADDR + 0x1000)
    ^
    drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro
    ‘SEC_MEM_PAGE1’
    memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
    ^
    include/fsl_sec.h:268:25: note: each undeclared identifier is reported only
    once for each function it appears in
    #define SEC_MEM_PAGE1 (CAAM_ARB_BASE_ADDR + 0x1000)
    ^
    drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro
    ‘SEC_MEM_PAGE1’
    memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
    ^
    scripts/Makefile.build:280: recipe for target 'drivers/crypto/fsl/jobdesc.o'
    failed

    Currently the MX6SL option is selected via CONFIG_SYS_EXTRA_OPTIONS, so
    CONFIG_FSL_CAAM is being wrongly selected by the imx-common Kconfig.
    Select CONFIG_MX6SL via Kconfig to address this issue.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    Breno Lima
     
  • Since commit 6e1f4d2652e79 ("arm: imx-common: add SECURE_BOOT option
    to Kconfig") it's preferable to select CONFIG_SECURE_BOOT via Kconfig.

    Add ARCH_MX7ULP as a CONFIG_SECURE_BOOT dependency, do not select
    CONFIG_FSL_CAAM since CAAM is not implemented for i.MX7ULP yet.

    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    Breno Lima
     
  • Currently is not possible to call HAB API on i.MX7ULP:

    => hab_status

    Secure boot disabled

    System is hanging here.

    The function is_mx8m() is returning true for i.MX7ULP, thus calling
    HAB API with a wrong HAB RVT address.

    Align SoC ID and CPU ID with U-Boot upstream to address this issue:
    http://git.denx.de/?p=u-boot.git;a=commit;h=4fdffb98568651f6581bccb53f5277cb0d2dcdc5

    Signed-off-by: Peng Fan
    Signed-off-by: Breno Lima
    Reviewed-by: Ye Li

    Peng Fan
     

20 Mar, 2018

1 commit


19 Mar, 2018

4 commits

  • The u-boot does not support to use two different gadget drivers at same time.
    So for all iMX8QM/QXP MEK and ARM2 defconfigs, enable the CDNS3 usb gadget
    to support device mode on typec port and disable CI UDC driver for OTG port.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan

    Ye Li
     
  • All iMX8QM/iMX8QXP MEK ARM2 boards have typec port for CDNS3 USB. This patch
    addes board level codes to init and clean up CDNS3 USB gadget driver.

    Signed-off-by: Ye Li
    Reviewed-by: Peng Fan

    Ye Li
     
  • Implemented the clock enable and disable interfaces for CDNS3 USB
    driver.

    Signed-off-by: Ye Li
    Acked-by: Peter Chen

    Ye Li
     
  • Porting the cadence USB3 (CDNS3) driver from kernel to u-boot. We only support
    the gadget (device mode), while the host mode is not supported. Users remains
    to use xhci-imx8 driver for host mode.

    Some changes in the CDNS3 driver porting:

    1. Add match_ep call back to usb_gadget_ops. The CDNS3 gadget driver replies
    on this operation to bind the usb_ep/usb_ss_ep with the endpoint descriptor
    when function layer uses usb_ep_autoconfig to add endpoint descriptors to gadget.
    So that CDNS3 driver can know the EP information and configure the EP once the
    set configuration request is received.

    2. U-boot does not have CMA, so it won't allocate uncached memory. Need to flush
    TRB and its DMA buffer before prime to usb controller and after complete transfer.

    3. In core.c, we add functions to hook with u-boot. It needs uplayer like
    to pass the register base address of each part of the USB controller.

    4. Force the CDNS3 gadget max speed to HS. The SuperSpeed is not supported by u-boot,
    so disable it in gadget driver. A configuration USB_CDNS3_GADGET_FORCE_HIGHSPEED is
    selected.

    5. Added gadget_is_cdns3 checking to provide bcdUSB value in device descriptor.

    6. Moved some new fields in usb_ep structure to usb_ss_ep, since u-boot does not have them.

    7. Remove host part codes as it is not supported by this driver.

    Signed-off-by: Ye Li
    Acked-by: Peter Chen

    Ye Li