Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-17 Thread Pali Rohár
On Monday 16 January 2023 16:33:09 Tony Dinh wrote:
> Hi all,
> 
> On Sat, Jan 14, 2023 at 1:45 PM Tony Dinh  wrote:
> >
> > Hi Pali & Tom,
> >
> > On Sat, Jan 14, 2023 at 12:06 PM Pali Rohár  wrote:
> > >
> > > On Saturday 14 January 2023 15:03:41 Tom Rini wrote:
> > > > On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> > > > > On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > > > > > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > > > > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > > > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += 
> > > > > > > > mv_ddr_build_message.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > > > > >
> > > > > > > And all these new files are ddr4 specific, so should be wrapped 
> > > > > > > in makefile section:
> > > > > > > ifdef CONFIG_DDR4
> > > > > >
> > > > > > Looking at the Makefile in question, I think we might want to make 
> > > > > > the
> > > > > > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > > > > > control building of what objects are built.  Perhaps:
> > > > > > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > > > > > should only be for SPL instead, even?
> > > > >
> > > > > Some cleanup like this can be done. But it is related to DDR4 support
> > > > > and is mostly independent of it. So lets do it after having DDR4 
> > > > > there.
> > > >
> > > > We're going to also want to not build the DDR3 code on the DDR4
> > > > platforms, right? A little clean up would make adding the DDR4 code a
> > > > bit cleaner for both cases. It's not a hard no, if someone really wants
> > > > to do the clean-up after.
> > >
> > > I can look at it _after_ all other stuff is done and merged.
> >
> > Thanks for the review and comments! and thanks Pali in advance for the
> > Makefile improvement after.  I will submit the V2 patches to fix the
> > dead code and other editorial issues per Pali's review.
> 
> Am I correct in assuming that the preferred license header is
> // SPDX-License-Identifier: GPL-2.0
> 
> and _not_
> /* SPDX-License-Identifier: GPL-2.0 */
> 
> Or does it not matter which form we use as long as it is consistent in an 
> area?
> 
> Thanks,
> Tony

Well, the best is to not change licence headers in existing u-boot files.


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-16 Thread Tony Dinh
On Mon, Jan 16, 2023 at 4:33 PM Tony Dinh  wrote:
>
> Hi all,
>
> On Sat, Jan 14, 2023 at 1:45 PM Tony Dinh  wrote:
> >
> > Hi Pali & Tom,
> >
> > On Sat, Jan 14, 2023 at 12:06 PM Pali Rohár  wrote:
> > >
> > > On Saturday 14 January 2023 15:03:41 Tom Rini wrote:
> > > > On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> > > > > On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > > > > > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > > > > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > > > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += 
> > > > > > > > mv_ddr_build_message.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > > > > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > > > > >
> > > > > > > And all these new files are ddr4 specific, so should be wrapped 
> > > > > > > in makefile section:
> > > > > > > ifdef CONFIG_DDR4
> > > > > >
> > > > > > Looking at the Makefile in question, I think we might want to make 
> > > > > > the
> > > > > > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > > > > > control building of what objects are built.  Perhaps:
> > > > > > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > > > > > should only be for SPL instead, even?
> > > > >
> > > > > Some cleanup like this can be done. But it is related to DDR4 support
> > > > > and is mostly independent of it. So lets do it after having DDR4 
> > > > > there.
> > > >
> > > > We're going to also want to not build the DDR3 code on the DDR4
> > > > platforms, right? A little clean up would make adding the DDR4 code a
> > > > bit cleaner for both cases. It's not a hard no, if someone really wants
> > > > to do the clean-up after.
> > >
> > > I can look at it _after_ all other stuff is done and merged.
> >
> > Thanks for the review and comments! and thanks Pali in advance for the
> > Makefile improvement after.  I will submit the V2 patches to fix the
> > dead code and other editorial issues per Pali's review.
>
> Am I correct in assuming that the preferred license header is
> // SPDX-License-Identifier: GPL-2.0
>
> and _not_
> /* SPDX-License-Identifier: GPL-2.0 */
>
> Or does it not matter which form we use as long as it is consistent in an 
> area?

NVM, I was scratching my head why patman kept warning me for using one
form or the others!

/Licenses/README

   The SPDX license identifier is added in the form of a comment.  The comment
   style depends on the file type::

  C source: // SPDX-License-Identifier: 
  C header: /* SPDX-License-Identifier:  */
  ASM:  /* SPDX-License-Identifier:  */
  scripts:  # SPDX-License-Identifier: 
  .rst: .. SPDX-License-Identifier: 
  .dts{i}:  // SPDX-License-Identifier: 

All the best,
Tony


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-16 Thread Tony Dinh
Hi all,

On Sat, Jan 14, 2023 at 1:45 PM Tony Dinh  wrote:
>
> Hi Pali & Tom,
>
> On Sat, Jan 14, 2023 at 12:06 PM Pali Rohár  wrote:
> >
> > On Saturday 14 January 2023 15:03:41 Tom Rini wrote:
> > > On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> > > > On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > > > > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > > > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += 
> > > > > > > mv_ddr_build_message.o
> > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > > > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > > > >
> > > > > > And all these new files are ddr4 specific, so should be wrapped in 
> > > > > > makefile section:
> > > > > > ifdef CONFIG_DDR4
> > > > >
> > > > > Looking at the Makefile in question, I think we might want to make the
> > > > > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > > > > control building of what objects are built.  Perhaps:
> > > > > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > > > > should only be for SPL instead, even?
> > > >
> > > > Some cleanup like this can be done. But it is related to DDR4 support
> > > > and is mostly independent of it. So lets do it after having DDR4 there.
> > >
> > > We're going to also want to not build the DDR3 code on the DDR4
> > > platforms, right? A little clean up would make adding the DDR4 code a
> > > bit cleaner for both cases. It's not a hard no, if someone really wants
> > > to do the clean-up after.
> >
> > I can look at it _after_ all other stuff is done and merged.
>
> Thanks for the review and comments! and thanks Pali in advance for the
> Makefile improvement after.  I will submit the V2 patches to fix the
> dead code and other editorial issues per Pali's review.

Am I correct in assuming that the preferred license header is
// SPDX-License-Identifier: GPL-2.0

and _not_
/* SPDX-License-Identifier: GPL-2.0 */

Or does it not matter which form we use as long as it is consistent in an area?

Thanks,
Tony


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-14 Thread Tony Dinh
Hi Pali & Tom,

On Sat, Jan 14, 2023 at 12:06 PM Pali Rohár  wrote:
>
> On Saturday 14 January 2023 15:03:41 Tom Rini wrote:
> > On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> > > On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > > > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
> > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > > >
> > > > > And all these new files are ddr4 specific, so should be wrapped in 
> > > > > makefile section:
> > > > > ifdef CONFIG_DDR4
> > > >
> > > > Looking at the Makefile in question, I think we might want to make the
> > > > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > > > control building of what objects are built.  Perhaps:
> > > > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > > > should only be for SPL instead, even?
> > >
> > > Some cleanup like this can be done. But it is related to DDR4 support
> > > and is mostly independent of it. So lets do it after having DDR4 there.
> >
> > We're going to also want to not build the DDR3 code on the DDR4
> > platforms, right? A little clean up would make adding the DDR4 code a
> > bit cleaner for both cases. It's not a hard no, if someone really wants
> > to do the clean-up after.
>
> I can look at it _after_ all other stuff is done and merged.

Thanks for the review and comments! and thanks Pali in advance for the
Makefile improvement after.  I will submit the V2 patches to fix the
dead code and other editorial issues per Pali's review.

All the best,
Tony


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-14 Thread Pali Rohár
On Saturday 14 January 2023 15:03:41 Tom Rini wrote:
> On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> > On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
> > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > > 
> > > > And all these new files are ddr4 specific, so should be wrapped in 
> > > > makefile section:
> > > > ifdef CONFIG_DDR4
> > > 
> > > Looking at the Makefile in question, I think we might want to make the
> > > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > > control building of what objects are built.  Perhaps:
> > > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > > should only be for SPL instead, even?
> > 
> > Some cleanup like this can be done. But it is related to DDR4 support
> > and is mostly independent of it. So lets do it after having DDR4 there.
> 
> We're going to also want to not build the DDR3 code on the DDR4
> platforms, right? A little clean up would make adding the DDR4 code a
> bit cleaner for both cases. It's not a hard no, if someone really wants
> to do the clean-up after.

I can look at it _after_ all other stuff is done and merged.


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-14 Thread Tom Rini
On Sat, Jan 14, 2023 at 07:51:00PM +0100, Pali Rohár wrote:
> On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> > On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
> > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > > 
> > > And all these new files are ddr4 specific, so should be wrapped in 
> > > makefile section:
> > > ifdef CONFIG_DDR4
> > 
> > Looking at the Makefile in question, I think we might want to make the
> > whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> > control building of what objects are built.  Perhaps:
> > drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> > should only be for SPL instead, even?
> 
> Some cleanup like this can be done. But it is related to DDR4 support
> and is mostly independent of it. So lets do it after having DDR4 there.

We're going to also want to not build the DDR3 code on the DDR4
platforms, right? A little clean up would make adding the DDR4 code a
bit cleaner for both cases. It's not a hard no, if someone really wants
to do the clean-up after.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-14 Thread Pali Rohár
On Friday 13 January 2023 21:00:21 Tom Rini wrote:
> On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> > On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
> > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> > >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> > >  obj-$(CONFIG_SPL_BUILD) += xor.o
> > 
> > And all these new files are ddr4 specific, so should be wrapped in makefile 
> > section:
> > ifdef CONFIG_DDR4
> 
> Looking at the Makefile in question, I think we might want to make the
> whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
> control building of what objects are built.  Perhaps:
> drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
> should only be for SPL instead, even?

Some cleanup like this can be done. But it is related to DDR4 support
and is mostly independent of it. So lets do it after having DDR4 there.


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-13 Thread Tom Rini
On Sat, Jan 14, 2023 at 02:41:32AM +0100, Pali Rohár wrote:
> On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> > @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
> >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
> >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
> >  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> > +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
> >  obj-$(CONFIG_SPL_BUILD) += xor.o
> 
> And all these new files are ddr4 specific, so should be wrapped in makefile 
> section:
> ifdef CONFIG_DDR4

Looking at the Makefile in question, I think we might want to make the
whole thing ifdef CONFIG_SPL_BUILD ... endif and then more finely
control building of what objects are built.  Perhaps:
drivers/Makefile:obj-$(CONFIG_ARMADA_38X) += ddr/marvell/a38x/
should only be for SPL instead, even?

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-13 Thread Pali Rohár
On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> @@ -16,4 +19,9 @@ obj-$(CONFIG_SPL_BUILD) += mv_ddr_build_message.o
>  obj-$(CONFIG_SPL_BUILD) += mv_ddr_common.o
>  obj-$(CONFIG_SPL_BUILD) += mv_ddr_spd.o
>  obj-$(CONFIG_SPL_BUILD) += mv_ddr_topology.o
> +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_mpr_pda_if.o
> +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training.o
> +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_calibration.o
> +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_db.o
> +obj-$(CONFIG_SPL_BUILD) += mv_ddr4_training_leveling.o
>  obj-$(CONFIG_SPL_BUILD) += xor.o

And all these new files are ddr4 specific, so should be wrapped in makefile 
section:
ifdef CONFIG_DDR4


Re: [PATCH] ddr: marvell: a38x: Add support for DDR4 from Marvell mv-ddr-marvell repository

2023-01-13 Thread Pali Rohár
Hello! Thanks for this DDR4 patch.

I have a few comments below, mostly about adding dead/removed code.

On Friday 13 January 2023 16:38:55 Tony Dinh wrote:
> This syncs drivers/ddr/marvell/a38x/ with the master branch of repository
> https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git
> 
> up to the commit "mv_ddr: a3700: Use the right size for memset to not 
> overflow"
> d5acc10c287e40cc2feeb28710b92e45c93c702c
> 
> This patch was created by following steps:
> 
> 1. Replace all a38x files in U-Boot tree by files from upstream github
>Marvell mv-ddr-marvell repository.
> 
> 2. Run following command to omit portions not relevant for a38x, ddr3, 
> and ddr4:
> 
> files=drivers/ddr/marvell/a38x/*
> sed 's/#if defined(CONFIG_ARMADA_38X) || 
> defined(CONFIG_ARMADA_39X)/#ifdef TRUE/' -i $files
> unifdef -m -UMV_DDR -UMV_DDR_ATF -UCONFIG_APN806 \
> -UCONFIG_MC_STATIC -UCONFIG_MC_STATIC_PRINT -UCONFIG_PHY_STATIC \
> -UCONFIG_PHY_STATIC_PRINT -UCONFIG_CUSTOMER_BOARD_SUPPORT \
> -UCONFIG_A3700 -UA3900 -UA80X0 -UA70X0 -DTRUE $files

marvell/a38x/ subdir contains only a38x code. Moreover all a39x stubs
were already removed from u-boot (it was never complete):
https://source.denx.de/u-boot/u-boot/-/commit/15942805b7efe47e186d8b30ec378666561ad1f9

So do not re-introduce CONFIG_ARMADA_39X code. Instead run unifdef with
additional args: -DCONFIG_ARMADA_38X -UCONFIG_ARMADA_39X

And with that, additional 'sed' and -DTRUE is not needed at all. It was
needed only as a hack for simulating logical OR: defined(A) || defined(B)

Also I see there CONFIG_64BIT checks. I think that CONFIG_64BIT code is
not relevant for 32-bit A38x, so I would suggest to eliminate it with
unifdef -UCONFIG_64BIT.

> 3. Manually change license to SPDX-License-Identifier
>(upstream license in  upstream github repository contains long license
>texts and U-Boot is using just SPDX-License-Identifier.

There are still some license comment style changes (// vs /* ... */).

> After applying this patch, a38x ddr3 ddr4 code in upstream Marvell github
> repository and in U-Boot would be fully identical. So in future applying
> above steps could be used to sync code again.
> 
> The only change in this patch are:
> - Removal of common board_topology_map code using ifdefs in mv_ddr_brd.c
> - Some fixes with include files.
> - Some basic type defines (original from ATF headers) in mv_ddr_plat.c
> 
> Reference:
> "ddr: marvell: a38x: Sync code with Marvell mv-ddr-marvell repository"
> 
> https://source.denx.de/u-boot/u-boot/-/commit/107c3391b95bcc2ba09a876da4fa0c31b6c1e460
> 
> Signed-off-by: Tony Dinh 
> ---
> 
>  drivers/ddr/marvell/a38x/Makefile |8 +
>  drivers/ddr/marvell/a38x/ddr3_debug.c |  120 +
>  drivers/ddr/marvell/a38x/ddr3_init.c  |   25 +
>  drivers/ddr/marvell/a38x/ddr3_init.h  |   14 +
>  drivers/ddr/marvell/a38x/ddr3_logging_def.h   |   29 +-
>  drivers/ddr/marvell/a38x/ddr3_training.c  |  135 +
>  drivers/ddr/marvell/a38x/ddr3_training_bist.c |   12 +
>  .../a38x/ddr3_training_centralization.c   |6 +
>  drivers/ddr/marvell/a38x/ddr3_training_db.c   |  278 ++
>  drivers/ddr/marvell/a38x/ddr3_training_ip.h   |   17 +
>  .../ddr/marvell/a38x/ddr3_training_ip_db.h|  156 +-
>  .../marvell/a38x/ddr3_training_ip_engine.c|  147 +-
>  .../ddr/marvell/a38x/ddr3_training_ip_flow.h  |7 +-
>  .../ddr/marvell/a38x/ddr3_training_leveling.c |  139 +-
>  drivers/ddr/marvell/a38x/ddr_init.c   |8 +
>  drivers/ddr/marvell/a38x/ddr_mv_wrapper.h |   47 +
>  drivers/ddr/marvell/a38x/dram_if.c|   31 +
>  drivers/ddr/marvell/a38x/mv_ddr4_mpr_pda_if.c |  674 +
>  drivers/ddr/marvell/a38x/mv_ddr4_mpr_pda_if.h |   59 +
>  drivers/ddr/marvell/a38x/mv_ddr4_training.c   |  571 
>  drivers/ddr/marvell/a38x/mv_ddr4_training.h   |   32 +
>  .../a38x/mv_ddr4_training_calibration.c   | 2340 +
>  .../a38x/mv_ddr4_training_calibration.h   |   26 +
>  .../ddr/marvell/a38x/mv_ddr4_training_db.c|  545 
>  .../marvell/a38x/mv_ddr4_training_leveling.c  |  441 
>  .../marvell/a38x/mv_ddr4_training_leveling.h  |   11 +
>  drivers/ddr/marvell/a38x/mv_ddr_brd.c |   82 +
>  drivers/ddr/marvell/a38x/mv_ddr_init.c|   60 +
>  drivers/ddr/marvell/a38x/mv_ddr_init.h|   11 +
>  drivers/ddr/marvell/a38x/mv_ddr_mrs.c |  248 ++
>  drivers/ddr/marvell/a38x/mv_ddr_mrs.h |   83 +
>  drivers/ddr/marvell/a38x/mv_ddr_plat.c|  257 ++
>  drivers/ddr/marvell/a38x/mv_ddr_plat.h|   11 +
>  drivers/ddr/marvell/a38x/mv_ddr_regs.h|   59 +
>  drivers/ddr/marvell/a38x/mv_ddr_static.c  |   12 +
>  drivers/ddr/marvell/a38x/mv_ddr_static.h  |   11 +
>  drivers/ddr/marvell/a38x/mv_ddr_sys_env_lib.h |7 +
>  drivers/ddr/marvell/a38x/mv_ddr_topology.h