Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3009792pxp; Tue, 22 Mar 2022 10:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk2jFuLcYOj41PICTLC3ieWi0wGtwL6FdeYCsXqz+4C7Wj7Z9YrkcaRyanxSKh/nu+re+T X-Received: by 2002:a05:6402:2794:b0:419:2ea9:7de3 with SMTP id b20-20020a056402279400b004192ea97de3mr14861515ede.169.1647969063380; Tue, 22 Mar 2022 10:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647969063; cv=none; d=google.com; s=arc-20160816; b=RfrxXLY5C5BCHrhobsI/Bs3qWe2LfklgDMXq4GJ5R8vp0aCt2hKiDf2VSaB7dP7WYv 8wi/tG6lR3gQUPq+7/vvyf5zqu9HBQxmzZomWkfpS5jfMj+IAVdgeA8jAVUc/Z8kEMf4 DEKlY2eMdqgstxkwhc9gdRwbpRMzgdSySvSSuXroJwn60IrQGdFRH7B8TTeG6y1K2gJi iEzA0+3Z5yAlllsZQ17rWBaO3WTGJ711jJ4RNHOpMVAaohfmJdUeRyqid7WLLMImqOlt u1KxUfbVDxsvNo1tpPTYqcoAynUl0m+cWTJ6iGItIe67lIy3qP0H2Znyg73pVqhrNmNF h/gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:hmm_source_type:hmm_attache_num :hmm_source_ip; bh=5bcva/u7/KAzBoLiPw4t/Kaqm+H0aNL+xwDi1UZGI2c=; b=Hmlcebn+0Z75xOPcR9qFSDzbNx9vAvUA1ks4EeWQyi0qgV2xcqlY8fLeC7CT1szVoU AXdl9hUv0xiGoHT4pOr91zrAaYHofqMG63hlQsFXxTejBcwKnTLX9gXKKXoMkmERs0e6 xQ1XyD1fgo5u/DeT5qPohNcc2cDegw4h3H9wyF5hkeXrytnDDnBG5E2LvEUjjVYk8xAx q218UYbZFzUmifNWEYi6KA7C+Sulzhqau+tcVE14VHyAqLE7+OSZru+kDf1fMs0o54rp XY2bXUD/iQ9cqEsCrEDb/w2UoANimCuMwtvSioVu75t2DtXJhbfhV0dARlexa5ZULCBQ WQnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a17090600d500b006df76385c91si9806186eji.305.2022.03.22.10.10.35; Tue, 22 Mar 2022 10:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235757AbiCVNkK (ORCPT + 99 others); Tue, 22 Mar 2022 09:40:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235702AbiCVNkD (ORCPT ); Tue, 22 Mar 2022 09:40:03 -0400 Received: from 189.cn (ptr.189.cn [183.61.185.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 14BAD1F633; Tue, 22 Mar 2022 06:38:32 -0700 (PDT) HMM_SOURCE_IP: 10.64.8.43:60198.555504461 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-114.242.206.180 (unknown [10.64.8.43]) by 189.cn (HERMES) with SMTP id C74A8100225; Tue, 22 Mar 2022 21:38:28 +0800 (CST) Received: from ([114.242.206.180]) by gateway-151646-dep-b7fbf7d79-vjdjk with ESMTP id bbab2de56e904e23a38356a55f9eb734 for jiaxun.yang@flygoat.com; Tue, 22 Mar 2022 21:38:31 CST X-Transaction-ID: bbab2de56e904e23a38356a55f9eb734 X-Real-From: 15330273260@189.cn X-Receive-IP: 114.242.206.180 X-MEDUSA-Status: 0 Sender: 15330273260@189.cn Message-ID: <2c671752-6684-f87b-7b2d-90568d36adde@189.cn> Date: Tue, 22 Mar 2022 21:38:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v11 2/7] MIPS: Loongson64: dts: introduce ls3A4000 evaluation board Content-Language: en-US To: Jiaxun Yang , Maxime Ripard , Thomas Zimmermann , Roland Scheidegger , Zack Rusin , Christian Gmeiner , David Airlie , Daniel Vetter , Rob Herring , Thomas Bogendoerfer , Dan Carpenter , Krzysztof Kozlowski , Andrey Zhizhikin , Sam Ravnborg , "David S . Miller" , Lucas Stach , Maarten Lankhorst , Ilia Mirkin , Qing Zhang , suijingfeng Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20220321162916.1116541-1-15330273260@189.cn> <20220321162916.1116541-3-15330273260@189.cn> <2644866a-8db2-923e-4227-2aa6d8e375fe@flygoat.com> From: Sui Jingfeng <15330273260@189.cn> In-Reply-To: <2644866a-8db2-923e-4227-2aa6d8e375fe@flygoat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FROM_LOCAL_DIGITS, FROM_LOCAL_HEX,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + bool "LS2K1000 generic" + +endchoice + endif # MACH_LOONGSON64 diff --git a/arch/mips/loongson64/setup.c b/arch/mips/loongson64/setup.c index cb10d14da433..f8859039a4e0 100644 --- a/arch/mips/loongson64/setup.c +++ b/arch/mips/loongson64/setup.c @@ -16,6 +16,13 @@ void *loongson_fdt_blob; void __init plat_mem_setup(void) { + void *fdt; + + fdt = get_fdt(); + + if (fdt) + loongson_fdt_blob = fdt; + if (loongson_fdt_blob) __dt_setup_arch(loongson_fdt_blob); } >> >> 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 <15330273260@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 000000000000..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 = <&dc_out_rgb0>; >> +                }; >> +            }; >> + >> +            port@1 { >> +                reg = <1>; >> +                adv7123_out: endpoint { >> +                    remote-endpoint = <&vga_connector_in>; >> +                }; >> +            }; >> +        }; >> +    }; >> + >> +    vga-connector { >> +        compatible = "vga-connector"; >> +        label = "vga"; >> + >> +        ddc-i2c-bus = <&i2c6>; >> + >> +        port { >> +            vga_connector_in: endpoint { >> +                remote-endpoint = <&adv7123_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 = <&dc_out_rgb1>; >> +                }; >> +            }; >> + >> +            port@1 { >> +                reg = <1>; >> +                tfp410_out: endpoint { >> +                    remote-endpoint = <&dvi_connector_in>; >> +                }; >> +            }; >> +        }; >> +    }; >> + >> +    dvi-connector { >> +        compatible = "dvi-connector"; >> +        label = "dvi"; >> +        digital; >> + >> +        ddc-i2c-bus = <&i2c7>; >> + >> +        port { >> +            dvi_connector_in: endpoint { >> +                remote-endpoint = <&tfp410_out>; >> +            }; >> +        }; >> +    }; >> +}; >> + >> +&package0 { >> +    htvec: interrupt-controller@efdfb000080 { >> +        compatible = "loongson,htvec-1.0"; >> +        reg = <0xefd 0xfb000080 0x40>; >> +        interrupt-controller; >> +        #interrupt-cells = <1>; >> + >> +        interrupt-parent = <&liointc>; >> +        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 IRQ_TYPE_LEVEL_HIGH>, >> +                 <31 IRQ_TYPE_LEVEL_HIGH>; >> +    }; >> +}; >> + >> +&pch { >> +    msi: msi-controller@2ff00000 { >> +        compatible = "loongson,pch-msi-1.0"; >> +        reg = <0 0x2ff00000 0 0x8>; >> +        interrupt-controller; >> +        msi-controller; >> +        loongson,msi-base-vec = <64>; >> +        loongson,msi-num-vecs = <192>; >> +        interrupt-parent = <&htvec>; >> +    }; >> +}; >> + >> +&lsdc { >> +    ports { >> +        #address-cells = <1>; >> +        #size-cells = <0>; >> + >> +        port@0 { >> +            endpoint { >> +                remote-endpoint = <&adv7123_in>; >> +            }; >> +        }; >> + >> +        port@1 { >> +            endpoint { >> +                remote-endpoint = <&tfp410_in>; >> +            }; >> +        }; >> +    }; >> +}; >