[U-Boot] [v4 1/6] Driver/DDR: Moving Freescale DDR driver to a common driver
york sun
yorksun at freescale.com
Tue Dec 3 06:48:02 CET 2013
On Dec 2, 2013, at 9:15 PM, Masahiro Yamada wrote:
> Hello York.
>
>> --- a/arch/powerpc/cpu/mpc83xx/Makefile
>> +++ b/arch/powerpc/cpu/mpc83xx/Makefile
>> @@ -38,11 +38,11 @@ obj-$(CONFIG_OF_LIBFDT) += fdt.o
>> # Stub implementations of cache management functions for USB
>> obj-y += cache.o
>>
>> -ifdef CONFIG_FSL_DDR2
>> -obj-$(CONFIG_MPC8349) += ../mpc85xx/ddr-gen2.o
>> +ifdef CONFIG_SYS_FSL_DDR2
>> +obj-$(CONFIG_MPC8349) += $(SRCTREE)/drivers/ddr/fsl/mpc85xx_ddr_gen2.o
>
> This Makefile is NG.
> The object file, mpc85xx_ddr_gen2.o, is created under a strange path.
It has been this way. I am not saying it is good. Explained below.
>
> Just build with O= and find out where this object is created.
>
> $ rm -rf build/
> $ make O=build MPC8349EMDS_config
> Configuring for MPC8349EMDS board...
> $ make O=build CROSS_COMPILE=powerpc-linux-
> <<snip>>
> $ find . -name mpc85xx_ddr_gen2.o
> ./build/arch/powerpc/cpu/mpc83xx/home/yamada/workspace/u-boot/drivers/ddr/fsl/mpc85xx_ddr_gen2.o
>
>
>
> And it also looks weird to me.
>
> Why did you put this code in arch/powerpc/cpu/mpc83xx/Makefie,
> not drivers/ddr/fsl/Makefile ?
>
I understand this looks weird. Most 83xx didn't use the same driver as 85xx SoCs do. Freescale DDR driver has two parts. One is the calculation. This can be shared by all families. The other, smaller, is the writing registers part. Each family has its own driver. You may have noticed one for 85xx, and one for 86xx. We could create one for 83xx. But till now, there is no other 83xx SoC uses it.
After this patch set, we have consolidated Freescale DDR drivers and header files into one set. It becomes more clear that we can and probably should merge this one as well. It's on my list to clean up, but this one has low priority.
Hope I explained it clearly.
York
More information about the U-Boot
mailing list