Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-23 Thread Sui Jingfeng



On 2022/3/23 20:53, Rob Herring wrote:

On Wed, Mar 23, 2022 at 09:53:14AM +0800, Sui Jingfeng wrote:

On 2022/3/23 00:06, Jiaxun Yang wrote:


在 2022/3/22 13:38, Sui Jingfeng 写道:

On 2022/3/22 21:05, Jiaxun Yang wrote:


在 2022/3/21 16:29, Sui Jingfeng 写道:

From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe
GEN2 x8 slot,
therefore can play with discrete graphics card.

Hi Jingfeng,

As we've discussed before if you are going to introduce new dts
then you *MUST*
include it in makefile and wire it up in code.

A dts file doing nothing lying in the tree is just suspicious.

Thanks.
- Jiaxun


Hi, Jiaxun,

I know what you means, but it is the kernel side developer's job.
I am just a naive graphic driver developer,I can not care so much.
Below is my private patch which can be used to built specific dts
into the linux kernel, therefore make the verification easier.

Hi Jingfeng,

In kernel world we take care all the stuff we touched ourself :-)

If you are not confident with them please drop those DTS from the
patchset
besides the generic one. I can do the rest for you after getting this
set merged.

Thanks.
- Jiaxun


Hi, Jiaxun

Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
How does the kernel get the dtb is another big issue, either from built-in
dtb or pass from the firmware(pmon and uefi etc). This should be
solved with another patch carefully. Providing board specific dts
helps to code review, it helps reviewers understand that there are
variant boards and have to be express with different OF graph.

Built-in DTBs are for legacy bootloaders that don't understand DT. I
would not expect a new platform to need this.


Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
Suppose loongson have 1000+ different board, do you want built all
of them into vmlinuz?

The point was to add the .dts to Makefile so it builds, not so it is
built-in. How are you testing those build with dtc and dtschema if not
added to kbuild?

OK, i see the key point.

Rob


Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-23 Thread Rob Herring
On Wed, Mar 23, 2022 at 09:53:14AM +0800, Sui Jingfeng wrote:
> 
> On 2022/3/23 00:06, Jiaxun Yang wrote:
> > 
> > 
> > 在 2022/3/22 13:38, Sui Jingfeng 写道:
> > > 
> > > On 2022/3/22 21:05, Jiaxun Yang wrote:
> > > > 
> > > > 
> > > > 在 2022/3/21 16:29, Sui Jingfeng 写道:
> > > > > From: suijingfeng 
> > > > > 
> > > > > The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
> > > > > mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe
> > > > > GEN2 x8 slot,
> > > > > therefore can play with discrete graphics card.
> > > > 
> > > > Hi Jingfeng,
> > > > 
> > > > As we've discussed before if you are going to introduce new dts
> > > > then you *MUST*
> > > > include it in makefile and wire it up in code.
> > > > 
> > > > A dts file doing nothing lying in the tree is just suspicious.
> > > > 
> > > > Thanks.
> > > > - Jiaxun
> > > > 
> > > Hi, Jiaxun,
> > > 
> > > I know what you means, but it is the kernel side developer's job.
> > > I am just a naive graphic driver developer,I can not care so much.
> > > Below is my private patch which can be used to built specific dts
> > > into the linux kernel, therefore make the verification easier.
> > Hi Jingfeng,
> > 
> > In kernel world we take care all the stuff we touched ourself :-)
> > 
> > If you are not confident with them please drop those DTS from the
> > patchset
> > besides the generic one. I can do the rest for you after getting this
> > set merged.
> > 
> > Thanks.
> > - Jiaxun
> > 
> Hi, Jiaxun
> 
> Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
> How does the kernel get the dtb is another big issue, either from built-in
> dtb or pass from the firmware(pmon and uefi etc). This should be
> solved with another patch carefully. Providing board specific dts
> helps to code review, it helps reviewers understand that there are
> variant boards and have to be express with different OF graph.

Built-in DTBs are for legacy bootloaders that don't understand DT. I 
would not expect a new platform to need this.

> 
> Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
> Suppose loongson have 1000+ different board, do you want built all
> of them into vmlinuz?

The point was to add the .dts to Makefile so it builds, not so it is 
built-in. How are you testing those build with dtc and dtschema if not 
added to kbuild?

Rob


Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-23 Thread Jiaxun Yang



在2022年3月23日三月 上午7:07,Sui Jingfeng写道:
> On 2022/3/23 10:29, Jiaxun Yang wrote:
>> If you want to blame somebody for the problem then please don't
>> blame us. We tried very hard to fit all those stuff into kernel's model
>> of devices. You should blame those who did the initial design of
>> Loongson's boot interface that failed to introduce a proper way
>> to describe the platform. 
>
> I am not blame anybody, please do not misleading.
Your language seems to be aggressive from my point of view.

> I am report problem and try to seek a better solution.
>
> I have my intention and ideas, i just don't want to solve
> all of the problems in one shot.
If so please just drop this part from the patch. I've repeated several times.

>
> I could provide one more patch wire all board specific dts up.
> But i don't know what's the opinions of other reviewers, does
> this is plausible?
Please carefully read section 6.1 about how should you work with reviewers.
https://www.kernel.org/doc/html/latest/process/6.Followthrough.html

Thanks.
-- 
- Jiaxun


Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-23 Thread Sui Jingfeng



On 2022/3/23 10:29, Jiaxun Yang wrote:

If you want to blame somebody for the problem then please don't
blame us. We tried very hard to fit all those stuff into kernel's model
of devices. You should blame those who did the initial design of
Loongson's boot interface that failed to introduce a proper way
to describe the platform. 


I am not blame anybody, please do not misleading.
I am report problem and try to seek a better solution.

I have my intention and ideas, i just don't want to solve
all of the problems in one shot.

I could provide one more patch wire all board specific dts up.
But i don't know what's the opinions of other reviewers, does
this is plausible?



Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Jiaxun Yang



在2022年3月23日三月 上午3:07,Sui Jingfeng写道:
> On 2022/3/23 10:29, Jiaxun Yang wrote:
>>
>>
>> 在 2022/3/23 1:53, Sui Jingfeng 写道:
>>> Hi, Jiaxun
>>>
>>> Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
>>> How does the kernel get the dtb is another big issue, either from 
>>> built-in
>>> dtb or pass from the firmware(pmon and uefi etc). This should be
>>> solved with another patch carefully. Providing board specific dts
>>> helps to code review, it helps reviewers understand that there are
>>> variant boards and have to be express with different OF graph.
>> Hi,
>>
>> I insist my taste on those code. If the only intention is to demonstrate
>> the usage of the driver then please just leave them in dt document
>> or commit message.
>>
>>>
>>> Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
>>> Suppose loongson have 1000+ different board, do you want built all
>>> of them into vmlinuz?
>> Note that we are supporting all those boards on "platform" bias. Which
>> means if they share similar design then they will use the same DTS.
>> If we have a new design then unfortunately our kernel binary must grow.
>>
>> For those who intended to build a size-optimized kernel they will be
>> able to disable unused DTS in Kconfig.
>>
>> If you want to blame somebody for the problem then please don't
>> blame us. We tried very hard to fit all those stuff into kernel's model
>> of devices. You should blame those who did the initial design of
>> Loongson's boot interface that failed to introduce a proper way
>> to describe the platform.
>>
>>>
>>> Besides, ls7a1000 and ls2k1000 lack a i2c driver, gpio driver,
>>> pwm driver, clk driver, can you pay more attention to salve those
>>> problems, please ?
>> Are you trying to make a TODO list for your colleague :-)
>>
>> We , community developers, don't owe you anything. So please
>> don't expect anything from us. I lost access to most Loongson
>> devices since I'm currently study abroad, but I'm determined to
>> keep platform code in a good shape. That's my duty as a maintainer.
>>
>> Thanks.
>> - Jiaxun
>
> Providing a few board specific dts doesn't hurt anybody.

There are a lot of things that don't hurt anybody but we shouldn't do.

The standard of reviewing the code is not "doesn't hurt anybody". It's "do the 
right thing".

Please reference:
https://www.kernel.org/doc/html/latest/process/6.Followthrough.html

>
> Can we leave the problem(passing correct dts to the kernel) untouched and
>
> solve it in the feature with a another patch, ok?

Then please drop platform DTS part.

I must NAK this part, sorry.

Thanks
-- 
- Jiaxun


Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Sui Jingfeng



On 2022/3/23 10:29, Jiaxun Yang wrote:



在 2022/3/23 1:53, Sui Jingfeng 写道:

Hi, Jiaxun

Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
How does the kernel get the dtb is another big issue, either from 
built-in

dtb or pass from the firmware(pmon and uefi etc). This should be
solved with another patch carefully. Providing board specific dts
helps to code review, it helps reviewers understand that there are
variant boards and have to be express with different OF graph.

Hi,

I insist my taste on those code. If the only intention is to demonstrate
the usage of the driver then please just leave them in dt document
or commit message.



Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
Suppose loongson have 1000+ different board, do you want built all
of them into vmlinuz?

Note that we are supporting all those boards on "platform" bias. Which
means if they share similar design then they will use the same DTS.
If we have a new design then unfortunately our kernel binary must grow.

For those who intended to build a size-optimized kernel they will be
able to disable unused DTS in Kconfig.

If you want to blame somebody for the problem then please don't
blame us. We tried very hard to fit all those stuff into kernel's model
of devices. You should blame those who did the initial design of
Loongson's boot interface that failed to introduce a proper way
to describe the platform.



Besides, ls7a1000 and ls2k1000 lack a i2c driver, gpio driver,
pwm driver, clk driver, can you pay more attention to salve those
problems, please ?

Are you trying to make a TODO list for your colleague :-)

We , community developers, don't owe you anything. So please
don't expect anything from us. I lost access to most Loongson
devices since I'm currently study abroad, but I'm determined to
keep platform code in a good shape. That's my duty as a maintainer.

Thanks.
- Jiaxun


Providing a few board specific dts doesn't hurt anybody.

Can we leave the problem(passing correct dts to the kernel) untouched and

solve it in the feature with a another patch, ok?



Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Jiaxun Yang




在 2022/3/23 1:53, Sui Jingfeng 写道:

Hi, Jiaxun

Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
How does the kernel get the dtb is another big issue, either from 
built-in

dtb or pass from the firmware(pmon and uefi etc). This should be
solved with another patch carefully. Providing board specific dts
helps to code review, it helps reviewers understand that there are
variant boards and have to be express with different OF graph.

Hi,

I insist my taste on those code. If the only intention is to demonstrate
the usage of the driver then please just leave them in dt document
or commit message.



Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
Suppose loongson have 1000+ different board, do you want built all
of them into vmlinuz?

Note that we are supporting all those boards on "platform" bias. Which
means if they share similar design then they will use the same DTS.
If we have a new design then unfortunately our kernel binary must grow.

For those who intended to build a size-optimized kernel they will be
able to disable unused DTS in Kconfig.

If you want to blame somebody for the problem then please don't
blame us. We tried very hard to fit all those stuff into kernel's model
of devices. You should blame those who did the initial design of
Loongson's boot interface that failed to introduce a proper way
to describe the platform.



Besides, ls7a1000 and ls2k1000 lack a i2c driver, gpio driver,
pwm driver, clk driver, can you pay more attention to salve those
problems, please ?

Are you trying to make a TODO list for your colleague :-)

We , community developers, don't owe you anything. So please
don't expect anything from us. I lost access to most Loongson
devices since I'm currently study abroad, but I'm determined to
keep platform code in a good shape. That's my duty as a maintainer.

Thanks.
- Jiaxun


Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Sui Jingfeng



On 2022/3/23 00:06, Jiaxun Yang wrote:



在 2022/3/22 13:38, Sui Jingfeng 写道:


On 2022/3/22 21:05, Jiaxun Yang wrote:



在 2022/3/21 16:29, Sui Jingfeng 写道:

From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe GEN2 x8 
slot,

therefore can play with discrete graphics card.


Hi Jingfeng,

As we've discussed before if you are going to introduce new dts then 
you *MUST*

include it in makefile and wire it up in code.

A dts file doing nothing lying in the tree is just suspicious.

Thanks.
- Jiaxun


Hi, Jiaxun,

I know what you means, but it is the kernel side developer's job.
I am just a naive graphic driver developer,I can not care so much.
Below is my private patch which can be used to built specific dts
into the linux kernel, therefore make the verification easier.

Hi Jingfeng,

In kernel world we take care all the stuff we touched ourself :-)

If you are not confident with them please drop those DTS from the 
patchset
besides the generic one. I can do the rest for you after getting this 
set merged.


Thanks.
- Jiaxun


Hi, Jiaxun

Build all dts into vmlinuz will make the vmlinuz bigger and bigger.
How does the kernel get the dtb is another big issue, either from built-in
dtb or pass from the firmware(pmon and uefi etc). This should be
solved with another patch carefully. Providing board specific dts
helps to code review, it helps reviewers understand that there are
variant boards and have to be express with different OF graph.

Now, there are about 6 dts under arch/mips/boot/dts/loongson/,
Suppose loongson have 1000+ different board, do you want built all
of them into vmlinuz?

Besides, ls7a1000 and ls2k1000 lack a i2c driver, gpio driver,
pwm driver, clk driver, can you pay more attention to salve those
problems, please ?



Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Jiaxun Yang




在 2022/3/22 13:38, Sui Jingfeng 写道:


On 2022/3/22 21:05, Jiaxun Yang wrote:



在 2022/3/21 16:29, Sui Jingfeng 写道:

From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe GEN2 x8 slot,
therefore can play with discrete graphics card.


Hi Jingfeng,

As we've discussed before if you are going to introduce new dts then 
you *MUST*

include it in makefile and wire it up in code.

A dts file doing nothing lying in the tree is just suspicious.

Thanks.
- Jiaxun


Hi, Jiaxun,

I know what you means, but it is the kernel side developer's job.
I am just a naive graphic driver developer,I can not care so much.
Below is my private patch which can be used to built specific dts
into the linux kernel, therefore make the verification easier.

Hi Jingfeng,

In kernel world we take care all the stuff we touched ourself :-)

If you are not confident with them please drop those DTS from the patchset
besides the generic one. I can do the rest for you after getting this 
set merged.


Thanks.
- Jiaxun



Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Sui Jingfeng



On 2022/3/22 21:05, Jiaxun Yang wrote:



在 2022/3/21 16:29, Sui Jingfeng 写道:

From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe GEN2 x8 slot,
therefore can play with discrete graphics card.


Hi Jingfeng,

As we've discussed before if you are going to introduce new dts then 
you *MUST*

include it in makefile and wire it up in code.

A dts file doing nothing lying in the tree is just suspicious.

Thanks.
- Jiaxun


Hi, Jiaxun,

I know what you means, but it is the kernel side developer's job.
I am just a naive graphic driver developer,I can not care so much.
Below is my private patch which can be used to built specific dts
into the linux kernel, therefore make the verification easier.


diff --git a/arch/mips/boot/dts/loongson/Makefile 
b/arch/mips/boot/dts/loongson/Makefile
index 5c6433e441ee..99b66675c4a1 100644
--- a/arch/mips/boot/dts/loongson/Makefile
+++ b/arch/mips/boot/dts/loongson/Makefile
@@ -1,9 +1,22 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64_2core_2k1000.dtb
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64c_4core_ls7a.dtb
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64c_4core_rs780e.dtb
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64c_8core_rs780e.dtb
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64g_4core_ls7a.dtb
-dtb-$(CONFIG_MACH_LOONGSON64)  += loongson64v_4core_virtio.dtb
+
+dtb-$(CONFIG_LOONGSON64_LS2K1000_PAI_V1_5) += ls2k1000_pai.dtb
+dtb-$(CONFIG_LOONGSON64_LS2K1000_EVB_V1_2) += ls2k1000_evb.dtb
+dtb-$(CONFIG_LOONGSON64_LS2K1000_GENERIC)  += loongson64_2core_2k1000.dtb
+
+dtb-$(CONFIG_LOONGSON64_LS3A3000_LS7A1000) += loongson64c_4core_ls7a.dtb
+dtb-$(CONFIG_LOONGSON64_LS3A3000_RS780E)   += loongson64c_4core_rs780e.dtb
+dtb-$(CONFIG_LOONGSON64_LS3B3000_RS780E)   += loongson64c_8core_rs780e.dtb
+
+dtb-$(CONFIG_LOONGSON64_LS3A4000_7A1000_LEMOTE_A1901) += lemote_a1901.dtb
+dtb-$(CONFIG_LOONGSON64_LS3A4000_7A1000_EVB_V1_4) += ls3a4000_7a1000_evb.dtb
+dtb-$(CONFIG_LOONGSON64_LS3A4000_7A1000_GENERIC)  += loongson64g_4core_ls7a.dtb
+
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64_2core_2k1000.dtb
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64c_4core_ls7a.dtb
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64c_4core_rs780e.dtb
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64c_8core_rs780e.dtb
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64g_4core_ls7a.dtb
+dtb-$(CONFIG_LOONGSON64_BOARD_DEFAULT) += loongson64v_4core_virtio.dtb
 
 obj-$(CONFIG_BUILTIN_DTB)	+= $(addsuffix .o, $(dtb-y))

diff --git a/arch/mips/include/asm/mach-loongson64/builtin_dtbs.h 
b/arch/mips/include/asm/mach-loongson64/builtin_dtbs.h
index 8be710557bdb..605bfa47b4b9 100644
--- a/arch/mips/include/asm/mach-loongson64/builtin_dtbs.h
+++ b/arch/mips/include/asm/mach-loongson64/builtin_dtbs.h
@@ -8,10 +8,10 @@
 #ifndef __ASM_MACH_LOONGSON64_BUILTIN_DTBS_H_
 #define __ASM_MACH_LOONGSON64_BUILTIN_DTBS_H_
 
-extern u32 __dtb_loongson64_2core_2k1000_begin[];

-extern u32 __dtb_loongson64c_4core_ls7a_begin[];
-extern u32 __dtb_loongson64c_4core_rs780e_begin[];
-extern u32 __dtb_loongson64c_8core_rs780e_begin[];
-extern u32 __dtb_loongson64g_4core_ls7a_begin[];
-extern u32 __dtb_loongson64v_4core_virtio_begin[];
+extern u32 __weak __dtb_loongson64_2core_2k1000_begin[];
+extern u32 __weak __dtb_loongson64c_4core_ls7a_begin[];
+extern u32 __weak __dtb_loongson64c_4core_rs780e_begin[];
+extern u32 __weak __dtb_loongson64c_8core_rs780e_begin[];
+extern u32 __weak __dtb_loongson64g_4core_ls7a_begin[];
+extern u32 __weak __dtb_loongson64v_4core_virtio_begin[];
 #endif
diff --git a/arch/mips/loongson64/Kconfig b/arch/mips/loongson64/Kconfig
index 517f1f8e81fb..7030185ed0c6 100644
--- a/arch/mips/loongson64/Kconfig
+++ b/arch/mips/loongson64/Kconfig
@@ -12,4 +12,43 @@ config RS780_HPET
  Note: This driver is doing some dangerous hack. Please only enable
  it on RS780E systems.
 
+choice

+   prompt "Board type"
+   depends on MACH_LOONGSON64
+   depends on BUILTIN_DTB
+   help
+pick a device tree that matches the target board.
+
+config LOONGSON64_BOARD_DEFAULT
+   bool "Default"
+
+config LOONGSON64_LS3A4000_7A1000_LEMOTE_A1901
+   bool "LEMOTE A1901 LS3A4000 board"
+
+config LOONGSON64_LS3A4000_7A1000_EVB_V1_4
+   bool "LS3A4000 LS7A1000 evaluation board v1.4"
+
+config LOONGSON64_LS3A4000_7A1000_GENERIC
+   bool "LS3A4000 LS7A1000 generic board"
+
+config LOONGSON64_LS3A3000_LS7A1000
+   bool "LS3A3000 LS7A1000 generic board"
+
+config LOONGSON64_LS3A3000_RS780E
+   bool "LS3A3000 RS780E generic board"
+
+config LOONGSON64_LS3B3000_RS780E
+   bool "LS3B3000 RS780E generic board"
+
+config LOONGSON64_LS2K1000_PAI_V1_5
+   bool "LS2K1000 PAI board V1.5"
+
+config LOONGSON64_LS2K1000_EVB_V1_2
+   bool "LS2K1000 evaluation board V1.2"
+
+config LOONGSON64_LS2K1000_GENERIC
+   

Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-22 Thread Jiaxun Yang




在 2022/3/21 16:29, Sui Jingfeng 写道:

From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe GEN2 x8 slot,
therefore can play with discrete graphics card.


Hi Jingfeng,

As we've discussed before if you are going to introduce new dts then you 
*MUST*

include it in makefile and wire it up in code.

A dts file doing nothing lying in the tree is just suspicious.

Thanks.
- Jiaxun



While the integrated display copntroller is equipped with a VGA output
and a DVI output, the VGA is connect to the DVO0 output port of the
display controller, the DVI is connected to DVO1 output port of the
display controller.

 +--++---+
 | DDR4 ||  +---+|
 +--+|  | PCIe Root complex |   LS7A1000 |
|| MC0   |  +--++-+++|
   +--+  HT 3.0  | || || |
   | LS3A4000 |<>| +---++---+  +--++--++-+   +--+
   |   CPU|<>| | GC1000 |  | LSDC |<-->| DDR3 MC |<->| VRAM |
   +--+  | ++  +-+--+-++-+   +--+
|| MC1   +---|--|+
 +--+|  |
 | DDR4 |  +---+   DVO0  |  |  DVO1   +--+
 +--+   VGA <--|ADV7125|<+  +>|TFP410|--> DVI/HDMI
   +---+  +--+

Signed-off-by: suijingfeng 
Signed-off-by: Sui Jingfeng <15330273...@189.cn>
---
  .../boot/dts/loongson/ls3a4000_7a1000_evb.dts | 136 ++
  1 file changed, 136 insertions(+)
  create mode 100644 arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts

diff --git a/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts 
b/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
new file mode 100644
index ..f467eddccdac
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "loongson64g-package.dtsi"
+#include "ls7a-pch.dtsi"
+
+/ {
+   compatible = "loongson,loongson64g-4core-ls7a";
+   model = "LS3A4000_7A1000_EVB_BOARD_V1.4";
+
+   vga-encoder {
+   compatible = "adi,adv7123", "dumb-vga-dac";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   adv7123_in: endpoint {
+   remote-endpoint = <_out_rgb0>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   adv7123_out: endpoint {
+   remote-endpoint = <_connector_in>;
+   };
+   };
+   };
+   };
+
+   vga-connector {
+   compatible = "vga-connector";
+   label = "vga";
+
+   ddc-i2c-bus = <>;
+
+   port {
+   vga_connector_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+
+   tfp410: dvi-encoder {
+   compatible = "ti,tfp410";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   tfp410_in: endpoint {
+   pclk-sample = <1>;
+   bus-width = <24>;
+   remote-endpoint = <_out_rgb1>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   tfp410_out: endpoint {
+   remote-endpoint = <_connector_in>;
+   };
+   };
+   };
+   };
+
+   dvi-connector {
+   compatible = "dvi-connector";
+   label = "dvi";
+   digital;
+
+   ddc-i2c-bus = <>;
+
+   port {
+   dvi_connector_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+};
+
+ {
+   htvec: interrupt-controller@efdfb80 {
+   compatible = "loongson,htvec-1.0";
+   reg = <0xefd 0xfb80 0x40>;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   interrupt-parent = <>;
+   interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
+  

[PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board

2022-03-21 Thread Sui Jingfeng
From: suijingfeng 

The board name is LS3A4000_7A1000_EVB_BOARD_V1.4, it consist of 1.8Ghz
mips64r5 4-core CPU and LS7A1000 bridge chip. It has PCIe GEN2 x8 slot,
therefore can play with discrete graphics card.

While the integrated display copntroller is equipped with a VGA output
and a DVI output, the VGA is connect to the DVO0 output port of the
display controller, the DVI is connected to DVO1 output port of the
display controller.

+--++---+
| DDR4 ||  +---+|
+--+|  | PCIe Root complex |   LS7A1000 |
   || MC0   |  +--++-+++|
  +--+  HT 3.0  | || || |
  | LS3A4000 |<>| +---++---+  +--++--++-+   +--+
  |   CPU|<>| | GC1000 |  | LSDC |<-->| DDR3 MC |<->| VRAM |
  +--+  | ++  +-+--+-++-+   +--+
   || MC1   +---|--|+
+--+|  |
| DDR4 |  +---+   DVO0  |  |  DVO1   +--+
+--+   VGA <--|ADV7125|<+  +>|TFP410|--> DVI/HDMI
  +---+  +--+

Signed-off-by: suijingfeng 
Signed-off-by: Sui Jingfeng <15330273...@189.cn>
---
 .../boot/dts/loongson/ls3a4000_7a1000_evb.dts | 136 ++
 1 file changed, 136 insertions(+)
 create mode 100644 arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts

diff --git a/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts 
b/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
new file mode 100644
index ..f467eddccdac
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
@@ -0,0 +1,136 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "loongson64g-package.dtsi"
+#include "ls7a-pch.dtsi"
+
+/ {
+   compatible = "loongson,loongson64g-4core-ls7a";
+   model = "LS3A4000_7A1000_EVB_BOARD_V1.4";
+
+   vga-encoder {
+   compatible = "adi,adv7123", "dumb-vga-dac";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   adv7123_in: endpoint {
+   remote-endpoint = <_out_rgb0>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   adv7123_out: endpoint {
+   remote-endpoint = <_connector_in>;
+   };
+   };
+   };
+   };
+
+   vga-connector {
+   compatible = "vga-connector";
+   label = "vga";
+
+   ddc-i2c-bus = <>;
+
+   port {
+   vga_connector_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+
+   tfp410: dvi-encoder {
+   compatible = "ti,tfp410";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   tfp410_in: endpoint {
+   pclk-sample = <1>;
+   bus-width = <24>;
+   remote-endpoint = <_out_rgb1>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   tfp410_out: endpoint {
+   remote-endpoint = <_connector_in>;
+   };
+   };
+   };
+   };
+
+   dvi-connector {
+   compatible = "dvi-connector";
+   label = "dvi";
+   digital;
+
+   ddc-i2c-bus = <>;
+
+   port {
+   dvi_connector_in: endpoint {
+   remote-endpoint = <_out>;
+   };
+   };
+   };
+};
+
+ {
+   htvec: interrupt-controller@efdfb80 {
+   compatible = "loongson,htvec-1.0";
+   reg = <0xefd 0xfb80 0x40>;
+   interrupt-controller;
+   #interrupt-cells = <1>;
+
+   interrupt-parent = <>;
+   interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
+<25 IRQ_TYPE_LEVEL_HIGH>,
+<26 IRQ_TYPE_LEVEL_HIGH>,
+<27 IRQ_TYPE_LEVEL_HIGH>,
+<28 IRQ_TYPE_LEVEL_HIGH>,
+<29 IRQ_TYPE_LEVEL_HIGH>,
+<30