
Hi Stefano
-----Original Message----- From: Peng Fan Sent: 2019年1月29日 9:15 To: 'Stefano Babic' sbabic@denx.de Cc: Fabio Estevam fabio.estevam@nxp.com; dl-uboot-imx uboot-imx@nxp.com; u-boot@lists.denx.de Subject: RE: [PATCH 07/10] clk: imx8: add i.MX8QM clk driver
Hi Stefano
Ok - I see you decide to split the code on depend of the SOC type. Nevertheless, even if defines are different, it seems to me that there is still a lot of common code (_imx8_clk_enable is very similar). Do we need really a separate file for each MX8 variant ? Which are the blocking points that avoid to do this ? I am looking at the patch, but I do not find such as issue. Can you explain it ?
I do not want to mix i.MX8QXP and QM currently, although it looks most same logic except the macros. Linux side code still not merged by upstream, there will be some change there I think. Then I think uboot side code also need some restructure following Linux change. Another one is there are many variants, not only QXP/QM, add all the macros in one file will make it not elegant and end up of more and more ifdef in one file.
I just have time and go through my patches again, because we use clk id from imx8qxp-clock.h and imx8qm-clock.h and some ids has same value but with different name, saying QM/QXP. If we use the QM/QXP macros in clk-imx8.c with case, such as: case IMX8QM_UART0_IPG_CLK: case IMX8QM_UART0_CLK: case IMX8QXP_UART0_IPG_CLK: case IMX8QXP_UART0_CLK: resource = SC_R_UART_0; pm_clk = SC_PM_CLK_PER; break;
gcc will complains error: drivers/clk/imx/clk-imx8.c: In function ‘imx8_clk_get_rate’: drivers/clk/imx/clk-imx8.c:124:2: error: duplicate case value case IMX8QXP_UART0_IPG_CLK: ^~~~
Because some QM/QXP macros has same value currently.
However we could not let the imx8qxp-clock.h and imx8qm-clock.h be mixed into one header file, we reuse Linux headers.
So I need to have clk-imx8qm.c and clk-imx8qxp.c separately.
Do you have more concerns about the QM patch set?
Thanks, Peng.
Thanks, Peng.
Regards, Stefano
--
==============================================================
======= DENX Software Engineering GmbH, Managing Director: Wolfgang
Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email:
sbabic@denx.de
==============================================================
=======