[U-Boot] [PATCH v2 4/7] Tegra114: Add common CPU (shared) files
Tom Warren
twarren.nvidia at gmail.com
Tue Jan 22 22:49:16 CET 2013
Simon,
On Tue, Jan 22, 2013 at 2:45 PM, Simon Glass <sjg at chromium.org> wrote:
> Hi Tom,
>
> On Tue, Jan 22, 2013 at 1:37 PM, Tom Warren <twarren.nvidia at gmail.com> wrote:
>> Simon,
>>
>> On Tue, Jan 22, 2013 at 1:54 PM, Simon Glass <sjg at chromium.org> wrote:
>>> Hi Tom,
>>>
>>> On Fri, Jan 18, 2013 at 1:12 PM, Tom Warren <twarren.nvidia at gmail.com> wrote:
>>>> These files are used by both SPL and main U-Boot.
>>>>
>>>> Signed-off-by: Tom Warren <twarren at nvidia.com>
>>>> ---
>>>> Changes in v2:
>>>> - update all new copyright header dates to 2013
>>>> - use ODMDATA correctly in query_dram_size
>>>>
>>>> arch/arm/cpu/tegra-common/ap.c | 9 +-
>>>> arch/arm/cpu/tegra-common/board.c | 21 +-
>>>> arch/arm/cpu/tegra114-common/Makefile | 41 ++
>>>> arch/arm/cpu/tegra114-common/clock.c | 1150 ++++++++++++++++++++++++++++++++
>>>> arch/arm/cpu/tegra114-common/funcmux.c | 63 ++
>>>> arch/arm/cpu/tegra114-common/pinmux.c | 506 ++++++++++++++
>>>> 6 files changed, 1786 insertions(+), 4 deletions(-)
>>>> create mode 100644 arch/arm/cpu/tegra114-common/Makefile
>>>> create mode 100644 arch/arm/cpu/tegra114-common/clock.c
>>>> create mode 100644 arch/arm/cpu/tegra114-common/funcmux.c
>>>> create mode 100644 arch/arm/cpu/tegra114-common/pinmux.c
>>>>
>>>
>>> I'm a bit concerned about the code duplication here. Isn't much of
>>> this code common?
>>>
>>> Regards,
>>> Simon
>>
>> funcmux.c differs almost entirely (different muxes for different UARTs
>> used on the boards). Pinmux.c differs quite a bit, mostly in tables.
>> And clock.c has a few minor name diffs (DVC vs I2C5), but there are
>> extra enums for the additional RST/ENA bits on T114, plus the
>> differences in clock_early_init WRT the PLL rates. And that's just for
>> the T30 vs. T114 differences - T20 is vastly different in it's pinmux
>> HW regs, and device RST/ENA bits.
>
> I suppose I was mostly thinking of clock.c - most of that code looks
> very familiar.
>
>>
>> I view it as a worthy exercise that could be applied after T114
>> baseline code is in, to see just how much more common code could be
>> factored out and put into arm/cpu/tegra-common, but I don't see it as
>> being a huge amount. T30 and T114 would share the most code, but
>> where would it go? since it can't be shared w/T20?
>>
>> Tom
>
> We had the same discussion with T30. I suppose you could have clock.c
> for common stuff and clock-t20.c, clock-t30.c, etc. for the extra /
> unusual bits.
OK, since I have to do a V3 patchset for T114 anyway, I'll take a pass
at it. But only for clock code - I don't want to get too bogged down -
there's too much backing up on the tracks behind me ;)
Tom
>
> Regards,
> Simon
More information about the U-Boot
mailing list