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
Conversation
Can one of the admins verify this patch? |
IP Review +1 |
Please add documentation for how to build and deploy to docs/plat/. |
@antonio-nino-diaz-arm This pull is against master branch, shouldn't it go into integration branch? |
|
||
#if DEBUG_CONSOLE_A35 | ||
static void lpuart32_serial_setbrg(unsigned int base, int baudrate) | ||
{ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will add check.
Update the maintainers.rst file as well. |
There was a problem hiding this 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.
There was a problem hiding this 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.
- In the commit messages it’d be great if you added a space before the opening brackets.
- Is there any public documentation available? If yes, please mention that somewhere in the commit messages.
- Could the assembler stuff be written in C?
- Please add to the commit message, what Linux kernel version you used for testing.
- How can this be built and tested?
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
if (tmp_sbr == 0) | ||
tmp_sbr = 1; | ||
|
||
/* calculate difference in actual buad w/ current values */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/buad/baud/
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
tmp_diff = tmp_diff - baudrate; | ||
|
||
/* select best values between sbr and sbr+1 */ | ||
if (tmp_diff > (baudrate - (rate / (tmp_osr * (tmp_sbr + 1))))) { |
There was a problem hiding this comment.
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?
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
{ | ||
unsigned int tmp; | ||
|
||
/*disable TX & RX before enabling clocks */ |
There was a problem hiding this comment.
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 /*
.
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
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++) { |
There was a problem hiding this comment.
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?
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
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.
plat/imx/imx8qx/imx8qx_bl31_setup.c
Outdated
imx8_partition_resources(); | ||
|
||
/* | ||
* tell BL3-1 where the non-secure software image is located |
There was a problem hiding this comment.
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.
plat/imx/common/mxcuart_console.S
Outdated
#include <asm_macros.S> | ||
|
||
/* UART Control Register Bit Fields.*/ | ||
#define URXD_CHARRDY (1<<15) |
There was a problem hiding this comment.
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.
plat/imx/common/plat_imx8_gic.c
Outdated
{ | ||
/* | ||
* the GICv3 driver is initialized in EL3 and does not need | ||
* to be initialized again in SEL1. This is because the S-EL1 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
@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/imx/imx8qx/platform.mk
Outdated
PLAT_INCLUDES := -Iplat/imx/imx8qx/include \ | ||
-Iplat/imx/common/include \ | ||
|
||
PLAT_GIC_SOURCES := drivers/arm/gic/v3/gicv3_helpers.c \ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
plat/imx/common/mxcuart_console.S
Outdated
#include <asm_macros.S> | ||
|
||
/* UART Control Register Bit Fields.*/ | ||
#define URXD_CHARRDY (1 << 15) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
plat/imx/common/lpuart_console.S
Outdated
#include <assert_macros.S> | ||
#include "lpuart.h" | ||
|
||
#define UARTBAUD 0x10 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks.
plat/imx/common/include/iomux.h
Outdated
@@ -0,0 +1,25 @@ | |||
/* |
There was a problem hiding this comment.
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
plat/imx/common/include/sci/types.h
Outdated
@@ -0,0 +1,849 @@ | |||
/* |
There was a problem hiding this comment.
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
plat/imx/common/sci/svc/pad/rpc.h
Outdated
@@ -0,0 +1,66 @@ | |||
/* |
There was a problem hiding this comment.
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
plat/imx/common/sci/svc/pm/rpc.h
Outdated
@@ -0,0 +1,71 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment for filename
plat/imx/common/sci/svc/rm/rpc.h
Outdated
@@ -0,0 +1,81 @@ | |||
/* |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this 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.
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.