Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for NXP QorIQ Layerscape Platform ls1043 #1871

Closed
wants to merge 13 commits into from

Conversation

ruchi393
Copy link
Contributor

@ruchi393 ruchi393 commented Mar 8, 2019

The patch series adds basic support for NXP QorIQ Layerscape Platforms. ls1043 platform support has been re-written to start the flow from BL2 binary instead of BL31. Additional boot sources like SD, NAND, QSPI have been added along with TRUSTED BOARD BOOT support.

@ssg-bot
Copy link

ssg-bot commented Mar 8, 2019

Can one of the admins verify this patch?

@ruchi393 ruchi393 changed the title Nxp qoriq Support for NXP QorIQ Layerscape Platform ls1043 Mar 8, 2019
@arm-tf-bot
Copy link

This pull request modifies subsystem(s) maintained by @qoriq-open-source. Can you please review the changes?

drivers/nxp/ifc/nand/ifc.h Outdated Show resolved Hide resolved
drivers/nxp/sfp/sfp_error_codes.h Outdated Show resolved Hide resolved
drivers/nxp/sfp/sfp_error_codes.h Outdated Show resolved Hide resolved
plat/nxp/common/layerscape/README.TRUSTED_BOOT Outdated Show resolved Hide resolved
plat/nxp/common/layerscape/tbbr.mk Outdated Show resolved Hide resolved
plat/nxp/psci/aarch64/psci_utils.S Outdated Show resolved Hide resolved
plat/nxp/sip_svc/aarch64/sipsvc.S Show resolved Hide resolved
plat/nxp/soc-ls1043/aarch64/ls1043.S Show resolved Hide resolved
plat/nxp/soc-ls1043/ls1043aqds/platform_def.h Outdated Show resolved Hide resolved
plat/nxp/soc-ls1043/ls1043ardb/platform_def.h Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Mar 8, 2019

You need to modify maintainers.rst to point at your documentation files/folders and update the maintainer if needed.

Also, you need to be able to build your platform with ERROR_DEPRECATED=1. You'll need to do some minor changes for that.

Ruchika Gupta and others added 7 commits March 11, 2019 09:32
Add hooks for initialization of NOR and NAND flash
attached to IFC controller.NAND driver provided init and
read functionality. NOR is XIP memory. The driver provides
placeholder for initialization.

Signed-off-by: Ruchika Gupta <[email protected]>
Init function is added for QSPI NOR flash. The default
configuration of the controller allows XIP read of the flash.

The driver adds init function to take care of endianness
of read transactions

Signed-off-by: Ruchika Gupta <[email protected]>
NXP QorIQ platforms require the bl2.bin to be combined with
certain commands and RCW. This tool converts the bl2.bin
to the required bl2.pbl format.

Signed-off-by: Pankaj Gupta <[email protected]>
Signed-off-by: Ruchika Gupta <[email protected]>
Ruchika Gupta added 6 commits March 12, 2019 14:23
QorIQ series have a builtin BL1 or ROM which transfers
control to the external bootloader in EL3 mode.
The patch series establishes common bootflow across NXP
QorIQ Layerscape ARMv8 platforms where ROM loads BL2
in SoC Internal Memory. BL2 binary runs in EL3 mode and
further loads BL31, BL32 and BL33.

The earlier support added in plat/layerscape is now moved
to a common plat/nxp folder removing the BL1 binary.

Following feature set are supported:
        - LS1043 RDB and QDS board
        - Boot from NOR, QSPI, SD, NAND flash
	- Support for complete PSCI functionality
	- OPTEE Boot

Signed-off-by: rocket <[email protected]>
Signed-off-by: York Sun <[email protected]>
Signed-off-by: Pankaj Gupta <[email protected]>
Signed-off-by: Ruchika Gupta <[email protected]>
CAAM is the cryptographic accelerator present on QorIQ
Layerscape Platforms. Functionality has been added
for generating random number, platform specific key and
do RSA verification and hash using this accelerator.

Signed-off-by: Pankaj Gupta <[email protected]>
Signed-off-by: Ruchika Gupta <[email protected]>
On NXP QorIQ devices, for establishing chain of trust
a header called CSF header is created for each image.
This driver is a parser for the CSF header used in CoT

Signed-off-by: Ruchika Gupta <[email protected]>
Two flows are supported for TRUSTED BOOT. One is the ARM TBBR
flow which uses MBED TLS and other is traditional QorIQ Secure
boot methodology using CSF Headers. README.TRUSED_BOOT provides
more details on the TRUSTED BOOT supported.

Signed-off-by: Ruchika Gupta <[email protected]>
@@ -0,0 +1,175 @@
NXP SoCs - Overview
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't render correctly in rst (check http://rst.ninjs.org).

If you don't really want the rst formatting capabilities maybe you could just save it as txt. If you want to use rst, please make sure that it renders properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file has to be rst formatted as it will enable auto-generation of HTML and other formats easily. This will enable easier migration to trustedfirmware.org later.

* ---------------------------------------------
*/

#if MULTI_CONSOLE_API
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are only going to keep the multi console. You shouldn't check for MULTI_CONSOLE_API in your code, you should assume it is going to be 1 and force it to 1 in the makefile.

/* generate a lsb-based mask for the core
* SoC core = ((cluster * cpu_per_cluster) + core)
* mask = (1 << SoC core)
*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix the coding style.

#ifndef __ASSEMBLER__
#include <endian.h>

#define FETCH_SOC_ID(x) (((x & DCFG_ENDIANNESS_MASK) == NXP_MANUFACTURER_ID) ?\
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add parentheses to x.

#define SCR_FIQ_MASK 0x4

#define CPUECTLR_EL1 S3_1_C15_C2_1
#define CPUACTLR_EL1 S3_1_C15_C2_0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All definitions between lines 46 and 62 look to me like they should be in common files (either lib/cpu headers or arch.h/arch_helpers.h).

int sfp_check_its(void);
int sfp_check_oem_wp(void);

#ifdef NXP_SFP_BE
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add parentheses to a.

return -1;
}

fp = fopen(argv[1], "rwb+");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just rb+ or wb+ depending on what you need. rwb+ doesn't look like it's allowed to me.

/* high voltage bits 2.7 - 3.6 */
mmc->voltages_caps = MMC_OCR_VDD_FF8;

#ifdef SD_DMA_CAPABILITY
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the options of this driver should probably be prefixed by NXP_ and documented (at least in the header of the driver).

#define esdhc_out32(a, v) mmio_write_32((uintptr_t)a, bswap32(v))
#elif defined(NXP_ESDHC_LE)
#define esdhc_in32(a) mmio_read_32((uintptr_t)a)
#define esdhc_out32(a, v) mmio_write_32((uintptr_t)a, v)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add parentheses to a.

#if defined(PHY_GEN2_FW_IMAGE_BUFFER) && !defined(NXP_DDR_PHY_GEN2)
#error Missing NXP_DDR_PHY_GEN2
#endif
#ifdef NXP_DDR_PHY_GEN2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options should be documented somewhere. At least create a list of the available options, even if they don't describe much of what they do. I understand that most DDR drivers are mostly magic code with magic constants.

@ghost
Copy link

ghost commented Apr 5, 2019

As part of the migration to trustedfirmware.org ARM-software/tf-issues#681 we have switched the main development repository to Gerrit (https://review.trustedfirmware.org/). It is unfortunate that the switch has happened while your PR was being reviewed, but we don't intend to merge more patches through GitHub to avoid confusion.

Could you please follow the instructions in https://github.com/ARM-software/arm-trusted-firmware/blob/master/contributing.rst to continue with the review? We're sorry for the inconvenience.

@sandrine-bailleux-arm
Copy link
Contributor

In addition to the contribution guidelines, the following Getting starting guide might help in this process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants