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

Add NXP's i.MX8QX and i.MX8QM SoC support #1410

Merged
5 commits merged into from Jun 19, 2018

Conversation

Anson-Huang
Copy link
Contributor

This pull request adds NXP's i.MX8QX and i.MX8QM SoC support, both of them are ARMv8 SoC, i.MX8QX is with 4 Cortex-A35 and 1 system controller (Cortext-M4), and i.MX8QM is with 2 Cortex-A72, 4 Cortex-A53 and 1 system controller (Cortext-M4).
This pull request adds basic SMP Linux kernel boot up support and debug lpuart support for them.

@ssg-bot
Copy link

ssg-bot commented Jun 11, 2018

Can one of the admins verify this patch?

@ghost
Copy link

ghost commented Jun 11, 2018

IP Review +1

@afaerber
Copy link
Contributor

Please add documentation for how to build and deploy to docs/plat/.

@afaerber
Copy link
Contributor

@antonio-nino-diaz-arm This pull is against master branch, shouldn't it go into integration branch?

@danh-arm danh-arm changed the base branch from master to integration June 12, 2018 11:46
@ghost ghost mentioned this pull request Jun 12, 2018

#if DEBUG_CONSOLE_A35
static void lpuart32_serial_setbrg(unsigned int base, int baudrate)
{

Choose a reason for hiding this comment

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

Add a check that, baudrate is not zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will add check.

@ghost
Copy link

ghost commented Jun 12, 2018

Update the maintainers.rst file as well.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

You need to add documentation and update the readme.rst and maintainers.rst files.

Copy link

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

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

Thank you for pushing this upstream.

  1. In the commit messages it’d be great if you added a space before the opening brackets.
  2. Is there any public documentation available? If yes, please mention that somewhere in the commit messages.
  3. Could the assembler stuff be written in C?
  4. Please add to the commit message, what Linux kernel version you used for testing.
  5. How can this be built and tested?

if (tmp_sbr == 0)
tmp_sbr = 1;

/* calculate difference in actual buad w/ current values */

Choose a reason for hiding this comment

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

s/buad/baud/

tmp_diff = tmp_diff - baudrate;

/* select best values between sbr and sbr+1 */
if (tmp_diff > (baudrate - (rate / (tmp_osr * (tmp_sbr + 1))))) {

Choose a reason for hiding this comment

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

Use a separate variable for the calculation, and use it in the body too?

{
unsigned int tmp;

/*disable TX & RX before enabling clocks */

Choose a reason for hiding this comment

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

Please add a space after the /*.

ERROR("sc_rm_move_all: %u\n", err);

/* iterate through peripherals to give NS OS part access */
for (i = 0; i < (sizeof(ns_access_allowed) / sizeof(sc_rsrc_t)); i++) {

Choose a reason for hiding this comment

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

Is there an ARRAY_SIZE macro?

}
}
}
}

Choose a reason for hiding this comment

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

Can you refactor the body into a separate function, so that the indentation level is decreased.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remove the else statement to reduce the indentation level, since we do NOT expect any error here, if there is any error, the debug print message will show and we need to fix.

}
}
}
}

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as upper, you can help review new pull request, thanks.

imx8_partition_resources();

/*
* tell BL3-1 where the non-secure software image is located

Choose a reason for hiding this comment

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

Below bl33_image_… functions are used. Does that match the BL3-1.

#include <asm_macros.S>

/* UART Control Register Bit Fields.*/
#define URXD_CHARRDY (1<<15)

Choose a reason for hiding this comment

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

In other files spaces are put around the operator.

{
/*
* the GICv3 driver is initialized in EL3 and does not need
* to be initialized again in SEL1. This is because the S-EL1

Choose a reason for hiding this comment

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

Inconsistent spelling of SEL1/S-EL1.

*/

/*
* the below macro print out relevant GIC

Choose a reason for hiding this comment

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

Either macros print or macro prints. (Also below.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to keep assembler stuff for now, since it is same as our internal code, if we have any optimization later, I will update in upstream as well. Otherwise
I addressed all the comments, please help review new pull request, thanks.

@paulmenzel
Copy link

@Anson-Huang, thank you for the update. The changes look good. To make it perfect I’d improve the commit messages too, but it’s not my call.

Thank you for writing the documentation.

PLAT_INCLUDES := -Iplat/imx/imx8qx/include \
-Iplat/imx/common/include \

PLAT_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to prefix internal variables with IMX_ as PLAT_ is usually reserved exporting values from platform for generic makefile use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I replace the PLAT_GIC_SOURCES with IMX_GIC_SOURCES.

#include <asm_macros.S>

/* UART Control Register Bit Fields.*/
#define URXD_CHARRDY (1 << 15)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would prefer if the defines here can move to a header file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the mxcuart support, the mxcuart is another UART IP rather than LPUART, i.MX8QX/QM are using LPUART ONLY, mxcuart will be added when other i.MX8 platforms added which use it.

#include <assert_macros.S>
#include "lpuart.h"

#define UARTBAUD 0x10
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these defines here move to lpuart.h ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks.

@@ -0,0 +1,25 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest file name as imx8_io_mux.h

Similar comments for all the headers in this folder because this is being included in the PLAT_INCLUDES path

@@ -0,0 +1,849 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer the file name to be sci_types.h

@@ -0,0 +1,66 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer sci_pad_rpc.h as file name

@@ -0,0 +1,71 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment for filename

@@ -0,0 +1,81 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest sc_rm_rpc.h as header name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I improve all these rph.c to sci_xx_rpc.h

NXP's i.MX8 SoCs have system controller (M4 core)
which takes control of clock management, power management,
partition management, PAD management etc., other
clusters like Cortex-A35 can send out command via MU
(Message Unit) to system controller for clock/power
management etc..

This patch adds basic IPC(inter-processor communication) support.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Add NXP's imx SoC debug uart driver.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
This patch adds support for NXP's imx SoC common
function support like topology, gic implementation.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
NXP's i.MX8QX is an ARMv8 SoC with 4 Cortex-A35 cores and
system controller (Cortex-M4) inside, documentation can
be found in below link:

https://www.nxp.com/products/processors-and-microcontrollers/
applications-processors/i.mx-applications-processors/i.mx-8-processors:IMX8-SERIES

This patch adds support for booting up SMP linux kernel (v4.9).

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
NXP's i.MX8QM is an ARMv8 SoC with 2 clusters, 2 Cortex-A72
cores in one cluster and 4 Cortex-A53 in the other cluster,
and also has system controller (Cortex-M4) inside, documentation
can be found in below link:

https://www.nxp.com/products/processors-and-microcontrollers/
applications-processors/i.mx-applications-processors/i.mx-8-processors:IMX8-SERIES

This patch adds support for booting up SMP linux kernel (v4.9).

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Copy link
Contributor

@soby-mathew soby-mathew left a comment

Choose a reason for hiding this comment

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

Thanks for the rework. Looks good to me.

@ghost ghost merged commit d135ad7 into ARM-software:integration Jun 19, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants