diff mbox

[U-Boot,05/12] aspeed/ast2500: Device Tree and bindings for some of the clocks

Message ID 20170104194656.124368-6-maxims@google.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Maxim Sloyko Jan. 4, 2017, 7:46 p.m. UTC
Signed-off-by: Maxim Sloyko <maxims@google.com>
---

 arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
 include/dt-bindings/clock/ast2500-scu.h |  29 +++
 2 files changed, 452 insertions(+)
 create mode 100644 arch/arm/dts/ast2500.dtsi
 create mode 100644 include/dt-bindings/clock/ast2500-scu.h

Comments

Tom Rini Jan. 4, 2017, 8:58 p.m. UTC | #1
On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:

> Signed-off-by: Maxim Sloyko <maxims@google.com>
> ---
> 
>  arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>  2 files changed, 452 insertions(+)
>  create mode 100644 arch/arm/dts/ast2500.dtsi
>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
> 
> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
> new file mode 100644
> index 0000000000..1a2a3f7ee3
> --- /dev/null
> +++ b/arch/arm/dts/ast2500.dtsi
> @@ -0,0 +1,423 @@
> +/* This device tree is copied from
> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi

Is this also found in the Linux kernel or not yet?  Thanks!
Maxim Sloyko Jan. 5, 2017, 1:18 a.m. UTC | #2
On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
> On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>
>> Signed-off-by: Maxim Sloyko <maxims@google.com>
>> ---
>>
>>  arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
>>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>>  2 files changed, 452 insertions(+)
>>  create mode 100644 arch/arm/dts/ast2500.dtsi
>>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>>
>> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>> new file mode 100644
>> index 0000000000..1a2a3f7ee3
>> --- /dev/null
>> +++ b/arch/arm/dts/ast2500.dtsi
>> @@ -0,0 +1,423 @@
>> +/* This device tree is copied from
>> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>
> Is this also found in the Linux kernel or not yet?  Thanks!

Yes, this is also in in main Linux kernel now, as I've found out, but
actually there is a number of differences, most notably there is no
pin configuration in this device tree, because there is no pinctrl
driver.

Should I remove this reference or modify it?

>
> --
> Tom
Tom Rini Jan. 5, 2017, 3:26 a.m. UTC | #3
On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
> >
> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
> >> ---
> >>
> >>  arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
> >>  2 files changed, 452 insertions(+)
> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
> >>
> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
> >> new file mode 100644
> >> index 0000000000..1a2a3f7ee3
> >> --- /dev/null
> >> +++ b/arch/arm/dts/ast2500.dtsi
> >> @@ -0,0 +1,423 @@
> >> +/* This device tree is copied from
> >> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
> >
> > Is this also found in the Linux kernel or not yet?  Thanks!
> 
> Yes, this is also in in main Linux kernel now, as I've found out, but
> actually there is a number of differences, most notably there is no
> pin configuration in this device tree, because there is no pinctrl
> driver.
> 
> Should I remove this reference or modify it?

Ideally, we will take the kernel dts files and then add what we need on
top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
-u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
Maxim Sloyko Jan. 5, 2017, 10:20 p.m. UTC | #4
On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>> >
>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
>> >> ---
>> >>
>> >>  arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>> >>  2 files changed, 452 insertions(+)
>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>> >>
>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>> >> new file mode 100644
>> >> index 0000000000..1a2a3f7ee3
>> >> --- /dev/null
>> >> +++ b/arch/arm/dts/ast2500.dtsi
>> >> @@ -0,0 +1,423 @@
>> >> +/* This device tree is copied from
>> >> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>> >
>> > Is this also found in the Linux kernel or not yet?  Thanks!
>>
>> Yes, this is also in in main Linux kernel now, as I've found out, but
>> actually there is a number of differences, most notably there is no
>> pin configuration in this device tree, because there is no pinctrl
>> driver.

Actually, I take that back, I was looking at the wrong linux Linux
kernel tree still... Only basic version of device tree has made it to
mainline kernel, but it's enough at the moment, so I used that
instead.

>>
>> Should I remove this reference or modify it?
>
> Ideally, we will take the kernel dts files and then add what we need on
> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi

OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
added modifications in ast2500-u-boot.dtsi and now include
ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
you.

Thanks!

>
> --
> Tom
Simon Glass Jan. 14, 2017, 5:13 p.m. UTC | #5
Hi Maxim,

On 5 January 2017 at 15:20, Maxim Sloyko <maxims@google.com> wrote:
> On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
>> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
>>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
>>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>>> >
>>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
>>> >> ---
>>> >>
>>> >>  arch/arm/dts/ast2500.dtsi               | 423 ++++++++++++++++++++++++++++++++
>>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>>> >>  2 files changed, 452 insertions(+)
>>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
>>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>>> >>
>>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>>> >> new file mode 100644
>>> >> index 0000000000..1a2a3f7ee3
>>> >> --- /dev/null
>>> >> +++ b/arch/arm/dts/ast2500.dtsi
>>> >> @@ -0,0 +1,423 @@
>>> >> +/* This device tree is copied from
>>> >> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>>> >
>>> > Is this also found in the Linux kernel or not yet?  Thanks!
>>>
>>> Yes, this is also in in main Linux kernel now, as I've found out, but
>>> actually there is a number of differences, most notably there is no
>>> pin configuration in this device tree, because there is no pinctrl
>>> driver.
>
> Actually, I take that back, I was looking at the wrong linux Linux
> kernel tree still... Only basic version of device tree has made it to
> mainline kernel, but it's enough at the moment, so I used that
> instead.
>
>>>
>>> Should I remove this reference or modify it?
>>
>> Ideally, we will take the kernel dts files and then add what we need on
>> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
>> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
>> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
>
> OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
> added modifications in ast2500-u-boot.dtsi and now include
> ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
> you.

There is some magic in the Makefile which automatically includes the
.dtsi if you name it correctly:

# Try these files in order to find the U-Boot-specific .dtsi include file
u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
$<))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
$(wildcard $(dts_dir)/u-boot.dtsi)


So you should not need to include it explicitly.

Regards,
Simon
Maxim Sloyko Jan. 17, 2017, 11:27 p.m. UTC | #6
On Sat, Jan 14, 2017 at 9:13 AM, Simon Glass <sjg@chromium.org> wrote:

> Hi Maxim,
>
> On 5 January 2017 at 15:20, Maxim Sloyko <maxims@google.com> wrote:
> > On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
> >> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
> >>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
> >>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
> >>> >
> >>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
> >>> >> ---
> >>> >>
> >>> >>  arch/arm/dts/ast2500.dtsi               | 423
> ++++++++++++++++++++++++++++++++
> >>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
> >>> >>  2 files changed, 452 insertions(+)
> >>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
> >>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
> >>> >>
> >>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
> >>> >> new file mode 100644
> >>> >> index 0000000000..1a2a3f7ee3
> >>> >> --- /dev/null
> >>> >> +++ b/arch/arm/dts/ast2500.dtsi
> >>> >> @@ -0,0 +1,423 @@
> >>> >> +/* This device tree is copied from
> >>> >> + * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/
> boot/dts/aspeed-g5.dtsi
> >>> >
> >>> > Is this also found in the Linux kernel or not yet?  Thanks!
> >>>
> >>> Yes, this is also in in main Linux kernel now, as I've found out, but
> >>> actually there is a number of differences, most notably there is no
> >>> pin configuration in this device tree, because there is no pinctrl
> >>> driver.
> >
> > Actually, I take that back, I was looking at the wrong linux Linux
> > kernel tree still... Only basic version of device tree has made it to
> > mainline kernel, but it's enough at the moment, so I used that
> > instead.
> >
> >>>
> >>> Should I remove this reference or modify it?
> >>
> >> Ideally, we will take the kernel dts files and then add what we need on
> >> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
> >> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
> >> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
> >
> > OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
> > added modifications in ast2500-u-boot.dtsi and now include
> > ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
> > you.
>
> There is some magic in the Makefile which automatically includes the
> .dtsi if you name it correctly:
>
> # Try these files in order to find the U-Boot-specific .dtsi include file
> u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
> $<))-u-boot.dtsi) \
> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
> $(wildcard $(dts_dir)/u-boot.dtsi)
>
>
> So you should not need to include it explicitly.
>

Well, it looks like the only applicable for this case would be
CONFIG_SYS_SOC, but it looks like this setting also affects the mach- and
arch- directories used. In this case I want different aspeed SoCs to share
those directories, but
they will have different DTs.


>
> Regards,
> Simon
>
Simon Glass Jan. 21, 2017, 3:52 a.m. UTC | #7
Hi Maxim,

On 17 January 2017 at 16:27, Maxim Sloyko <maxims@google.com> wrote:
>
>
> On Sat, Jan 14, 2017 at 9:13 AM, Simon Glass <sjg@chromium.org> wrote:
>>
>> Hi Maxim,
>>
>> On 5 January 2017 at 15:20, Maxim Sloyko <maxims@google.com> wrote:
>> > On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
>> >> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
>> >>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
>> >>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>> >>> >
>> >>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
>> >>> >> ---
>> >>> >>
>> >>> >>  arch/arm/dts/ast2500.dtsi               | 423
>> >>> >> ++++++++++++++++++++++++++++++++
>> >>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>> >>> >>  2 files changed, 452 insertions(+)
>> >>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
>> >>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>> >>> >>
>> >>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>> >>> >> new file mode 100644
>> >>> >> index 0000000000..1a2a3f7ee3
>> >>> >> --- /dev/null
>> >>> >> +++ b/arch/arm/dts/ast2500.dtsi
>> >>> >> @@ -0,0 +1,423 @@
>> >>> >> +/* This device tree is copied from
>> >>> >> + *
>> >>> >> https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>> >>> >
>> >>> > Is this also found in the Linux kernel or not yet?  Thanks!
>> >>>
>> >>> Yes, this is also in in main Linux kernel now, as I've found out, but
>> >>> actually there is a number of differences, most notably there is no
>> >>> pin configuration in this device tree, because there is no pinctrl
>> >>> driver.
>> >
>> > Actually, I take that back, I was looking at the wrong linux Linux
>> > kernel tree still... Only basic version of device tree has made it to
>> > mainline kernel, but it's enough at the moment, so I used that
>> > instead.
>> >
>> >>>
>> >>> Should I remove this reference or modify it?
>> >>
>> >> Ideally, we will take the kernel dts files and then add what we need on
>> >> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
>> >> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
>> >> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
>> >
>> > OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
>> > added modifications in ast2500-u-boot.dtsi and now include
>> > ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
>> > you.
>>
>> There is some magic in the Makefile which automatically includes the
>> .dtsi if you name it correctly:
>>
>> # Try these files in order to find the U-Boot-specific .dtsi include file
>> u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
>> $<))-u-boot.dtsi) \
>> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
>> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
>> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
>> $(wildcard $(dts_dir)/u-boot.dtsi)
>>
>>
>> So you should not need to include it explicitly.
>
>
> Well, it looks like the only applicable for this case would be
> CONFIG_SYS_SOC, but it looks like this setting also affects the mach- and
> arch- directories used. In this case I want different aspeed SoCs to share
> those directories, but
> they will have different DTs.

The first option is to a .dtsi derived from the .dts filename. Does that help?

Regards,
Simon
Maxim Sloyko Jan. 23, 2017, 5:52 p.m. UTC | #8
On Fri, Jan 20, 2017 at 7:52 PM, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Maxim,
>
> On 17 January 2017 at 16:27, Maxim Sloyko <maxims@google.com> wrote:
> >
> >
> > On Sat, Jan 14, 2017 at 9:13 AM, Simon Glass <sjg@chromium.org> wrote:
> >>
> >> Hi Maxim,
> >>
> >> On 5 January 2017 at 15:20, Maxim Sloyko <maxims@google.com> wrote:
> >> > On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
> >> >> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
> >> >>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
> >> >>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
> >> >>> >
> >> >>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
> >> >>> >> ---
> >> >>> >>
> >> >>> >>  arch/arm/dts/ast2500.dtsi               | 423
> >> >>> >> ++++++++++++++++++++++++++++++++
> >> >>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
> >> >>> >>  2 files changed, 452 insertions(+)
> >> >>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
> >> >>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
> >> >>> >>
> >> >>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
> >> >>> >> new file mode 100644
> >> >>> >> index 0000000000..1a2a3f7ee3
> >> >>> >> --- /dev/null
> >> >>> >> +++ b/arch/arm/dts/ast2500.dtsi
> >> >>> >> @@ -0,0 +1,423 @@
> >> >>> >> +/* This device tree is copied from
> >> >>> >> + *
> >> >>> >> https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
> >> >>> >
> >> >>> > Is this also found in the Linux kernel or not yet?  Thanks!
> >> >>>
> >> >>> Yes, this is also in in main Linux kernel now, as I've found out, but
> >> >>> actually there is a number of differences, most notably there is no
> >> >>> pin configuration in this device tree, because there is no pinctrl
> >> >>> driver.
> >> >
> >> > Actually, I take that back, I was looking at the wrong linux Linux
> >> > kernel tree still... Only basic version of device tree has made it to
> >> > mainline kernel, but it's enough at the moment, so I used that
> >> > instead.
> >> >
> >> >>>
> >> >>> Should I remove this reference or modify it?
> >> >>
> >> >> Ideally, we will take the kernel dts files and then add what we need on
> >> >> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
> >> >> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
> >> >> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
> >> >
> >> > OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
> >> > added modifications in ast2500-u-boot.dtsi and now include
> >> > ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
> >> > you.
> >>
> >> There is some magic in the Makefile which automatically includes the
> >> .dtsi if you name it correctly:
> >>
> >> # Try these files in order to find the U-Boot-specific .dtsi include file
> >> u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
> >> $<))-u-boot.dtsi) \
> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
> >> $(wildcard $(dts_dir)/u-boot.dtsi)
> >>
> >>
> >> So you should not need to include it explicitly.
> >
> >
> > Well, it looks like the only applicable for this case would be
> > CONFIG_SYS_SOC, but it looks like this setting also affects the mach- and
> > arch- directories used. In this case I want different aspeed SoCs to share
> > those directories, but
> > they will have different DTs.
>
> The first option is to a .dtsi derived from the .dts filename. Does that help?

Hmm, probably not... if I understand that correctly.

This is what I have right now:

ast2500.dtsi -- device tree from the linux kernel, used by all
ast2500-based boards.
ast2500-u-boot.dtsi -- these are u-boot specific additions, with
u-boot,dm-pre-reloc labels, clock specification and SDRAM driver node.
These are still need to be shared by all ast2500-based boards.
ast2500-evb.dts -- Eval board specific stuff, right now basically just
chosen node with stdout-path and clock frequency specification for
SDRAM.

I don't this it would make sense to have ast2500-evb-u-boot.dtsi just
to avoid include, because when I later create ast2500-zaius-bmc.dts or
something like that, I would have the same problem.

>
> Regards,
> Simon
Simon Glass Jan. 23, 2017, 7:51 p.m. UTC | #9
Hi Maxim,

On 23 January 2017 at 10:52, Maxim Sloyko <maxims@google.com> wrote:
> On Fri, Jan 20, 2017 at 7:52 PM, Simon Glass <sjg@chromium.org> wrote:
>>
>> Hi Maxim,
>>
>> On 17 January 2017 at 16:27, Maxim Sloyko <maxims@google.com> wrote:
>> >
>> >
>> > On Sat, Jan 14, 2017 at 9:13 AM, Simon Glass <sjg@chromium.org> wrote:
>> >>
>> >> Hi Maxim,
>> >>
>> >> On 5 January 2017 at 15:20, Maxim Sloyko <maxims@google.com> wrote:
>> >> > On Wed, Jan 4, 2017 at 7:26 PM, Tom Rini <trini@konsulko.com> wrote:
>> >> >> On Wed, Jan 04, 2017 at 05:18:42PM -0800, Maxim Sloyko wrote:
>> >> >>> On Wed, Jan 4, 2017 at 12:58 PM, Tom Rini <trini@konsulko.com> wrote:
>> >> >>> > On Wed, Jan 04, 2017 at 11:46:49AM -0800, Maxim Sloyko wrote:
>> >> >>> >
>> >> >>> >> Signed-off-by: Maxim Sloyko <maxims@google.com>
>> >> >>> >> ---
>> >> >>> >>
>> >> >>> >>  arch/arm/dts/ast2500.dtsi               | 423
>> >> >>> >> ++++++++++++++++++++++++++++++++
>> >> >>> >>  include/dt-bindings/clock/ast2500-scu.h |  29 +++
>> >> >>> >>  2 files changed, 452 insertions(+)
>> >> >>> >>  create mode 100644 arch/arm/dts/ast2500.dtsi
>> >> >>> >>  create mode 100644 include/dt-bindings/clock/ast2500-scu.h
>> >> >>> >>
>> >> >>> >> diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
>> >> >>> >> new file mode 100644
>> >> >>> >> index 0000000000..1a2a3f7ee3
>> >> >>> >> --- /dev/null
>> >> >>> >> +++ b/arch/arm/dts/ast2500.dtsi
>> >> >>> >> @@ -0,0 +1,423 @@
>> >> >>> >> +/* This device tree is copied from
>> >> >>> >> + *
>> >> >>> >> https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
>> >> >>> >
>> >> >>> > Is this also found in the Linux kernel or not yet?  Thanks!
>> >> >>>
>> >> >>> Yes, this is also in in main Linux kernel now, as I've found out, but
>> >> >>> actually there is a number of differences, most notably there is no
>> >> >>> pin configuration in this device tree, because there is no pinctrl
>> >> >>> driver.
>> >> >
>> >> > Actually, I take that back, I was looking at the wrong linux Linux
>> >> > kernel tree still... Only basic version of device tree has made it to
>> >> > mainline kernel, but it's enough at the moment, so I used that
>> >> > instead.
>> >> >
>> >> >>>
>> >> >>> Should I remove this reference or modify it?
>> >> >>
>> >> >> Ideally, we will take the kernel dts files and then add what we need on
>> >> >> top of that in one of CONFIG_SYS_CPU/CONFIG_SYS_SOC/CONFIG_SYS_VENDOR
>> >> >> -u-boot.dtsi files, see for example arch/arm/dts/sunxi-u-boot.dtsi or
>> >> >> arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
>> >> >
>> >> > OK, so I took the device tree from the Linux kernel, (ast2500.dtsi),
>> >> > added modifications in ast2500-u-boot.dtsi and now include
>> >> > ast2500-u-boot.dtsi in ast2500-evb.dts. Let me know if I misunderstood
>> >> > you.
>> >>
>> >> There is some magic in the Makefile which automatically includes the
>> >> .dtsi if you name it correctly:
>> >>
>> >> # Try these files in order to find the U-Boot-specific .dtsi include file
>> >> u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir
>> >> $<))-u-boot.dtsi) \
>> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
>> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
>> >> $(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
>> >> $(wildcard $(dts_dir)/u-boot.dtsi)
>> >>
>> >>
>> >> So you should not need to include it explicitly.
>> >
>> >
>> > Well, it looks like the only applicable for this case would be
>> > CONFIG_SYS_SOC, but it looks like this setting also affects the mach- and
>> > arch- directories used. In this case I want different aspeed SoCs to share
>> > those directories, but
>> > they will have different DTs.
>>
>> The first option is to a .dtsi derived from the .dts filename. Does that help?
>
> Hmm, probably not... if I understand that correctly.
>
> This is what I have right now:
>
> ast2500.dtsi -- device tree from the linux kernel, used by all
> ast2500-based boards.
> ast2500-u-boot.dtsi -- these are u-boot specific additions, with
> u-boot,dm-pre-reloc labels, clock specification and SDRAM driver node.
> These are still need to be shared by all ast2500-based boards.
> ast2500-evb.dts -- Eval board specific stuff, right now basically just
> chosen node with stdout-path and clock frequency specification for
> SDRAM.
>
> I don't this it would make sense to have ast2500-evb-u-boot.dtsi just
> to avoid include, because when I later create ast2500-zaius-bmc.dts or
> something like that, I would have the same problem.

Yes you may as well have your own include.

The idea is to use the same files as Linux, and put the U-Boot
additions in a separate file. But it's not critical - just a new idea
we had. Also if you can get the U-Boot additions into the upstream
Linux version then you won't need this.

Regards,
Simon
diff mbox

Patch

diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
new file mode 100644
index 0000000000..1a2a3f7ee3
--- /dev/null
+++ b/arch/arm/dts/ast2500.dtsi
@@ -0,0 +1,423 @@ 
+/* This device tree is copied from
+ * https://github.com/openbmc/linux/blob/c5682cb/arch/arm/boot/dts/aspeed-g5.dtsi
+ */
+
+#include <dt-bindings/clock/ast2500-scu.h>
+
+#include "skeleton.dtsi"
+
+/ {
+	model = "Aspeed BMC";
+	compatible = "aspeed,ast2500";
+	#address-cells = <1>;
+	#size-cells = <1>;
+	interrupt-parent = <&vic>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			compatible = "arm,arm1176jzf-s";
+			device_type = "cpu";
+			reg = <0>;
+		};
+	};
+
+	scu: clock-controller@1e6e2000 {
+		compatible = "aspeed,ast2500-scu";
+		reg = <0x1e6e2000 0x1000>;
+		u-boot,dm-pre-reloc;
+		#clock-cells = <1>;
+		#reset-cells = <1>;
+	};
+
+	sdrammc: sdrammc@1e6e0000 {
+		u-boot,dm-pre-reloc;
+		compatible = "aspeed,ast2500-sdrammc";
+		reg = <0x1e6e0000 0x174
+			0x1e6e0200 0x1d4 >;
+		clocks = <&scu PLL_MPLL>;
+	};
+
+	ahb {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+		u-boot,dm-pre-reloc;
+
+		fmc: flash-controller@1e620000 {
+			reg = < 0x1e620000 0xc4
+				0x20000000 0x10000000 >;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "aspeed,ast2500-fmc";
+			status = "disabled";
+			aspeed,fmc-has-dma;
+			interrupts = <19>;
+			flash@0 {
+				reg = < 0 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+			flash@1 {
+				reg = < 1 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+			flash@2 {
+				reg = < 2 >;
+				compatible = "jedec,spi-nor";
+				// compatible = "cfi,flash", "jedec,flash";
+				status = "disabled";
+			};
+		};
+
+		spi1: flash-controller@1e630000 {
+			reg = < 0x1e630000 0xc4
+				0x30000000 0x08000000 >;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "aspeed,ast2500-smc";
+			status = "disabled";
+			flash@0 {
+				reg = < 0 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+			flash@1 {
+				reg = < 1 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+		};
+
+		spi2: flash-controller@1e631000 {
+			reg = < 0x1e631000 0xc4
+				0x38000000 0x08000000 >;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "aspeed,ast2500-smc";
+			status = "disabled";
+			flash@0 {
+				reg = < 0 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+			flash@1 {
+				reg = < 1 >;
+				compatible = "jedec,spi-nor";
+				status = "disabled";
+			};
+		};
+
+		vic: interrupt-controller@1e6c0080 {
+			compatible = "aspeed,ast2400-vic";
+			interrupt-controller;
+			#interrupt-cells = <1>;
+			valid-sources = <0xfefff7ff 0x0807ffff>;
+			reg = <0x1e6c0080 0x80>;
+		};
+
+		mac0: ethernet@1e660000 {
+			compatible = "faraday,ftgmac100";
+			reg = <0x1e660000 0x180>;
+			interrupts = <2>;
+			no-hw-checksum;
+			status = "disabled";
+		};
+
+		mac1: ethernet@1e680000 {
+			compatible = "faraday,ftgmac100";
+			reg = <0x1e680000 0x180>;
+			interrupts = <3>;
+			no-hw-checksum;
+			status = "disabled";
+		};
+
+		apb {
+			compatible = "simple-bus";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+			u-boot,dm-pre-reloc;
+
+			syscon: syscon@1e6e2000 {
+				compatible = "aspeed,g5-scu", "syscon", "simple-mfd";
+				reg = <0x1e6e2000 0x1a8>;
+			};
+
+			sram@1e720000 {
+				compatible = "mmio-sram";
+				reg = <0x1e720000 0x9000>;	// 36K
+			};
+
+			gpio: gpio@1e780000 {
+				#gpio-cells = <2>;
+				gpio-controller;
+				compatible = "aspeed,ast2500-gpio";
+				reg = <0x1e780000 0x1000>;
+				interrupts = <20>;
+			};
+
+			timer: timer@1e782000 {
+				compatible = "aspeed,ast2500-timer";
+				u-boot,dm-pre-reloc;
+				reg = <0x1e782000 0x90>;
+			};
+
+			ibt: ibt@1e789140 {
+				compatible = "aspeed,bt-host";
+				reg = <0x1e789140 0x18>;
+				interrupts = <8>;
+			};
+
+			wdt1: wdt@1e785000 {
+				compatible = "aspeed,ast2500-wdt";
+				reg = <0x1e785000 0x1c>;
+			};
+
+			wdt2: wdt@1e785020 {
+				compatible = "aspeed,ast2500-wdt";
+				reg = <0x1e785020 0x1c>;
+				status = "disabled";
+			};
+
+			wdt3: wdt@1e785040 {
+				compatible = "aspeed,wdt";
+				reg = <0x1e785074 0x1c>;
+				status = "disabled";
+			};
+
+			uart1: serial@1e783000 {
+				compatible = "ns16550a";
+				reg = <0x1e783000 0x1000>;
+				reg-shift = <2>;
+				interrupts = <9>;
+				clocks = <&scu PCLK_UART1>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			uart2: serial@1e78d000 {
+				compatible = "ns16550a";
+				reg = <0x1e78d000 0x1000>;
+				reg-shift = <2>;
+				interrupts = <32>;
+				clocks = <&scu PCLK_UART2>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			uart3: serial@1e78e000 {
+				compatible = "ns16550a";
+				reg = <0x1e78e000 0x1000>;
+				reg-shift = <2>;
+				interrupts = <33>;
+				clocks = <&scu PCLK_UART3>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			uart4: serial@1e78f000 {
+				compatible = "ns16550a";
+				reg = <0x1e78f000 0x1000>;
+				reg-shift = <2>;
+				interrupts = <34>;
+				clocks = <&scu PCLK_UART4>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			uart5: serial@1e784000 {
+				compatible = "ns16550a";
+				reg = <0x1e784000 0x1000>;
+				interrupts = <10>;
+				reg-shift = <2>;
+				clocks = <&scu PCLK_UART5>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			vuart: vuart@1e787000 {
+				compatible = "aspeed,vuart";
+				reg = <0x1e787000 0x1000>;
+				reg-shift = <2>;
+				interrupts = <8>;
+				no-loopback-test;
+				status = "disabled";
+			};
+
+			i2c: i2c@1e78a000 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				#interrupt-cells = <1>;
+
+				compatible = "aspeed,ast2400-i2c-controller";
+				reg = <0x1e78a000 0x40>;
+				ranges = <0 0x1e78a000 0x1000>;
+				interrupts = <12>;
+				clock-ranges;
+				interrupt-controller;
+
+				i2c0: i2c-bus@40 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x40 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <0>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <0>;
+					interrupt-parent = <&i2c>;
+				};
+
+				i2c1: i2c-bus@80 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x80 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <1>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <1>;
+				};
+
+				i2c2: i2c-bus@c0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0xC0 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <2>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <2>;
+				};
+
+				i2c3: i2c-bus@100 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x100 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <3>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <3>;
+				};
+
+				i2c4: i2c-bus@140 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x140 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <4>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <4>;
+				};
+
+				i2c5: i2c-bus@180 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x180 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <5>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <5>;
+				};
+
+				i2c6: i2c-bus@1c0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x1C0 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <6>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <6>;
+				};
+
+				i2c7: i2c-bus@300 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x300 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <7>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <7>;
+				};
+
+				i2c8: i2c-bus@340 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x340 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <8>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <8>;
+				};
+
+				i2c9: i2c-bus@380 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x380 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <9>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <9>;
+				};
+
+				i2c10: i2c-bus@3c0 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x3c0 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <10>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <10>;
+				};
+
+				i2c11: i2c-bus@400 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x400 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <11>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <11>;
+				};
+
+				i2c12: i2c-bus@440 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x440 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <12>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <12>;
+				};
+
+				i2c13: i2c-bus@480 {
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x480 0x40>;
+					compatible = "aspeed,ast2400-i2c-bus";
+					bus = <13>;
+					clock-frequency = <100000>;
+					status = "disabled";
+					interrupts = <13>;
+				};
+
+			};
+
+		};
+	};
+};
diff --git a/include/dt-bindings/clock/ast2500-scu.h b/include/dt-bindings/clock/ast2500-scu.h
new file mode 100644
index 0000000000..ca58b12943
--- /dev/null
+++ b/include/dt-bindings/clock/ast2500-scu.h
@@ -0,0 +1,29 @@ 
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/* Core Clocks */
+#define PLL_HPLL	1
+#define PLL_DPLL	2
+#define PLL_D2PLL	3
+#define PLL_MPLL	4
+#define ARMCLK		5
+
+
+/* Bus Clocks, derived from core clocks */
+#define BCLK_PCLK	101
+#define BCLK_LHCLK	102
+#define BCLK_MACCLK	103
+#define BCLK_SDCLK	104
+#define BCLK_ARMCLK	105
+
+#define MCLK_DDR	201
+
+/* Special clocks */
+#define PCLK_UART1	501
+#define PCLK_UART2	502
+#define PCLK_UART3	503
+#define PCLK_UART4	504
+#define PCLK_UART5	505