* [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller
@ 2022-03-27 11:38 Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 1/6] MIPS: Loongson64: dts: update the display controller device node Sui Jingfeng
` (4 more replies)
0 siblings, 5 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
There is a display controller in loongson's LS2K1000 SoC and LS7A1000
bridge chip, the display controller is a PCI device in those chips. It
has two display pipes but with only one hardware cursor. Each way has
a DVO interface which provide RGB888 signals, vertical & horizontal
synchronisations, data enable and the pixel clock. Each CRTC is able to
scanout from 1920x1080 resolution at 60Hz, the maxmium resolution is
2048x2048 according to the hardware spec. Loongson display controllers
are simple which require scanout buffers to be physically contiguous.
For LS7A1000 bridge chip, the DC is equipped with a dedicated video RAM
which is typically 64MB or more. In this case, VRAM helper based driver
is intend to be used even through the DC can scanout form system memory.
While LS2K1000 is a SoC which is a typically UMA device, only system
memory is available. Therefore CMA helper based driver is intend to be
used. It is possible to use VRAM helper based driver on LS2K1000 by
carving out part of system memory as VRAM though.
For LS7A1000, there are 4 dedicated GPIOs whose control register is
located at the DC register space, They are used to emulate two way i2c.
One for DVO0, another for DVO1. LS2K1000 and LS2K0500 SoC don't have such
GPIO hardwared, they grab i2c adapter from other module, either general
purpose GPIO emulated i2c or hardware i2c adapter.
+------+ +-----------------------------------+
| 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
+-------+ +------+
The above picture give a simple usage of LS7A1000, note that the encoder
is not necessary adv7125 or tfp410, other candicates can be ch7034b,
sil9022, ite66121 and lt8618 etc.
v2: Fixup warnings reported by kernel test robot
v3: Fix more grammar mistakes in Kconfig reported by Randy Dunlap and give
more details about lsdc.
v4:
1) Add dts required and explain why device tree is required.
2) Give more description about lsdc and VRAM helper based driver.
3) Fix warnings reported by kernel test robot.
4) Introduce stride_alignment member into struct lsdc_chip_desc, the
stride alignment is 256 bytes for ls7a1000, ls2k1000 and ls2k0500.
v5:
1) Using writel and readl replace writeq and readq, to fix kernel test
robot report build error on other archtecture.
2) Set default fb format to XRGB8888 at crtc reset time.
v6:
1) Explain why we are not switch to drm dridge subsystem on ls2k1000.
2) Explain why tiny drm driver is not suitable for us.
3) Give a short description of the trival dirty update implement based
on CMA helper.
v7:
1) Remove select I2C_GPIO and I2C_LS2X in Kconfig, it is not ready now
2) Licensing issues are fixed suggested by Krzysztof Kozlowski.
3) Remove lsdc_pixpll_print(), part of it move to debugfs.
4) Set prefer_shadow to true if vram based driver is in using.
5) Replace double blank lines with single line in all files.
6) Verbose cmd line parameter is replaced with drm_dbg()
7) All warnnings reported by ./scripts/checkpatch.pl --strict are fixed
8) Get edid from dtb support is removed as suggested by Maxime Ripard
9) Fix typos and various improvement
v8:
1) Drop damage update implement and its command line.
2) Drop DRM_LSDC_VRAM_DRIVER config option as suggested by Maxime.
3) Deduce DC's identification from its compatible property.
4) Drop the board specific dts patch.
5) Add documention about the display controller device node.
v9:
1) Fix the warnings reported by checkpatch script and fix typos
v10:
1) Pass `make dt_binding_check` validation
2) Fix warnings reported by kernel test robot
v11:
1) Convert the driver to use drm bridge and of graph framework.
2) Dump register value support through debugfs.
3) Select DRM_TTM and DRM_TTM_HELPER in Kconfig which fix linkage
problem when built it into the kernel.
4) Non 64 pixel(256 bytes aligned) horiziontal resolutons got
supported by hacking, default is disabled, enable it by using
'loongson.relax_alignment=1' on kernel cmd line.
5) Various improvement as required by Maxime.
v12:
1) Add gammma support, it is broken because hardware engineer
does not implement this correctly. Using 'loongson.gamma=1' on
the kernel cmd line to enable this and see what will happen.
We implemlent this for IC varification.
2) Separate debugfs related code from lsdc_drv.c
3) Built-in GPIO emulate i2c refinement.
4) Various improvement as required by Rob.
Sui Jingfeng (6):
MIPS: Loongson64: dts: update the display controller device node
MIPS: Loongson64: introduce board specific dts and add model property
dt-bindings: display: Add Loongson display controller
MIPS: Loongson64: defconfig: enable display bridge drivers
drm/loongson: add drm driver for loongson display controller
MAINTAINERS: add maintainers for DRM LSDC driver
.../loongson/loongson,display-controller.yaml | 322 ++++++++++
MAINTAINERS | 9 +
arch/mips/boot/dts/loongson/Makefile | 4 +
arch/mips/boot/dts/loongson/lemote_a1901.dts | 96 +++
.../boot/dts/loongson/loongson64-2k1000.dtsi | 8 +
.../boot/dts/loongson/ls2k1000_pai_udb.dts | 107 ++++
.../boot/dts/loongson/ls3a4000_7a1000_evb.dts | 138 +++++
arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 24 +-
arch/mips/configs/loongson2k_defconfig | 5 +
arch/mips/configs/loongson3_defconfig | 5 +
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/loongson/Kconfig | 25 +
drivers/gpu/drm/loongson/Makefile | 16 +
drivers/gpu/drm/loongson/lsdc_crtc.c | 395 ++++++++++++
drivers/gpu/drm/loongson/lsdc_debugfs.c | 176 ++++++
drivers/gpu/drm/loongson/lsdc_debugfs.h | 17 +
drivers/gpu/drm/loongson/lsdc_drv.c | 417 +++++++++++++
drivers/gpu/drm/loongson/lsdc_drv.h | 155 +++++
drivers/gpu/drm/loongson/lsdc_i2c.c | 285 +++++++++
drivers/gpu/drm/loongson/lsdc_i2c.h | 38 ++
drivers/gpu/drm/loongson/lsdc_irq.c | 57 ++
drivers/gpu/drm/loongson/lsdc_irq.h | 17 +
drivers/gpu/drm/loongson/lsdc_output.c | 261 ++++++++
drivers/gpu/drm/loongson/lsdc_output.h | 21 +
drivers/gpu/drm/loongson/lsdc_pci_drv.c | 346 +++++++++++
drivers/gpu/drm/loongson/lsdc_plane.c | 447 ++++++++++++++
drivers/gpu/drm/loongson/lsdc_pll.c | 573 ++++++++++++++++++
drivers/gpu/drm/loongson/lsdc_pll.h | 87 +++
drivers/gpu/drm/loongson/lsdc_regs.h | 221 +++++++
30 files changed, 4270 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
create mode 100644 arch/mips/boot/dts/loongson/lemote_a1901.dts
create mode 100644 arch/mips/boot/dts/loongson/ls2k1000_pai_udb.dts
create mode 100644 arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
create mode 100644 drivers/gpu/drm/loongson/Kconfig
create mode 100644 drivers/gpu/drm/loongson/Makefile
create mode 100644 drivers/gpu/drm/loongson/lsdc_crtc.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_debugfs.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_debugfs.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_drv.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_drv.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_i2c.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_i2c.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_irq.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_irq.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_output.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_output.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_pci_drv.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_plane.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_pll.c
create mode 100644 drivers/gpu/drm/loongson/lsdc_pll.h
create mode 100644 drivers/gpu/drm/loongson/lsdc_regs.h
--
2.25.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v12 1/6] MIPS: Loongson64: dts: update the display controller device node
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
@ 2022-03-27 11:38 ` Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 2/6] MIPS: Loongson64: introduce board specific dts and add model property Sui Jingfeng
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
The display controller is a pci device, it is used in ls2k1000 SoC and
LS7A1000 bridge. Its PCI vendor id is 0x0014, its PCI device id is 0x7a06.
In order to let the driver to know which chip the DC is contained in,
the compatible of the display controller is named according to the chip's
name.
For LS7A1000, there are 4 dedicated GPIOs whose control register is
located at the DC register space. They are used to emulate i2c for reading
edid from the monitor. One for DVO0, another for DVO1.
LS2K1000 and LS2K0500 SoC don't have such GPIOs, they grab i2c adapter
from other module, either general purpose GPIO emulated i2c or hardware
i2c adapter.
This patch add common part of the DC device node only, it does not contain
ports device note. As it is for the generic, boards only with transparent
encoders should works simply by inherit from this.
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
---
.../boot/dts/loongson/loongson64-2k1000.dtsi | 8 +++++++
arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 24 +++++++++++++++----
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi b/arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi
index 8143a61111e3..2ecb5a232f22 100644
--- a/arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi
+++ b/arch/mips/boot/dts/loongson/loongson64-2k1000.dtsi
@@ -198,6 +198,14 @@ sata@8,0 {
interrupt-parent = <&liointc0>;
};
+ lsdc: display-controller@6,0 {
+ compatible = "loongson,ls2k1000-dc";
+
+ reg = <0x3000 0x0 0x0 0x0 0x0>;
+ interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-parent = <&liointc0>;
+ };
+
pci_bridge@9,0 {
compatible = "pci0014,7a19.0",
"pci0014,7a19",
diff --git a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
index 2f45fce2cdc4..1d3fe73b31d5 100644
--- a/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
+++ b/arch/mips/boot/dts/loongson/ls7a-pch.dtsi
@@ -160,15 +160,29 @@ gpu@6,0 {
interrupt-parent = <&pic>;
};
- dc@6,1 {
- compatible = "pci0014,7a06.0",
- "pci0014,7a06",
- "pciclass030000",
- "pciclass0300";
+ lsdc: display-controller@6,1 {
+ compatible = "loongson,ls7a1000-dc";
reg = <0x3100 0x0 0x0 0x0 0x0>;
interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
interrupt-parent = <&pic>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c6: i2c@6 {
+ compatible = "loongson,gpio-i2c";
+ loongson,sda = <0>;
+ loongson,scl = <1>;
+ loongson,nr = <6>;
+ };
+
+ i2c7: i2c@7 {
+ compatible = "loongson,gpio-i2c";
+ loongson,sda = <2>;
+ loongson,scl = <3>;
+ loongson,nr = <7>;
+ };
};
hda@7,0 {
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v12 2/6] MIPS: Loongson64: introduce board specific dts and add model property
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 1/6] MIPS: Loongson64: dts: update the display controller device node Sui Jingfeng
@ 2022-03-27 11:38 ` Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Sui Jingfeng
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
This patch introduce three board specific dts and assign different
model property to them according to the board name on the top overlay
of the PCB.
The model property added is used to provide board specific information,
mips kernel use it as machine name. For example:
$ cat /proc/cpuinfo
system type : Generic Loongson64 System
machine : LX-6901 <-------------------- notice here
processor : 0
cpu model : ICT Loongson-3 V0.1 FPU V0.1
BogoMIPS : 3594.02
tlb_entries : 2112
isa : mips64r2
ASEs implemented : vz msa loongson-ext2
...
1) ls3A4000 evaluation board
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
+-------+ +------+
2) lemote A1901 motherboard
This board is made by LEMOTE corporation, it has two name, one is
LX-6901, another is A1901. This board has only one VGA output which
is connected to the DVO1 of the display controller.
+------+ +-----------------------------------+
| DDR4 | | +-------------------+ |
+------+ | | PCIe Root complex | LS7A1000 |
|| MC0 | +--++---------++----+ |
+----------+ HT 3.0 | || || |
| LS3A4000 |<-------->| +---++---+ +--++--+ +---------+ +------+
| CPU |<-------->| | GC1000 | | LSDC |<-->| DDR3 MC |<->| VRAM |
+----------+ | +--------+ +-+--+-+ +---------+ +------+
|| MC1 +---------------|--|----------------+
+------+ | |
| DDR4 | DVO0 is not get used | | DVO1 +-------+
+------+ <--------------------+ +-------->|ADV7125|---> VGA
+-------+
3) ls2k1000 pai evaluation board
ls2k1000 is a two core 1.0Ghz Mips64r2 compatible SoC, desprite very
slow, lacking i2c driver support, various display dridge drivers can
only be tested on it. We still try to provide a minimal support.
___________________ ____________________
| -------| | |
| CRTC0 --> | DVO0 ------------------------> | 1024x600 DPI Panel |
| _ _ -------| | Which panel to use |____________________|
| | | | | | | with this board is a ___________________
| |_| |_| | | choice of the user | |
| | +--------------------> | 800x480 DPI Panel |
| DC In LS2K1000 | |___________________|
| _ _ | +------+
| | | | | <---->| i2c1 |-----------+
| |_| |_| | +------+ |
| | | <--- config | DDC _________
| -------| +---------+ | | |
| CRTC1 --> | DVO1 ---> | sii9022 | --> HDMI connector --> | Monitor |
| -------| +---------+ |_________|
|___________________|
The sii9022 HDMI transmitter working in transparent mode, because the
PCB designer make the board working in this way. In this case the EDID
is read from the monitor directly, not through sii9022's ddc channel.
The i2c0 is not get used by lsdc driver for this board.
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
---
arch/mips/boot/dts/loongson/Makefile | 4 +
arch/mips/boot/dts/loongson/lemote_a1901.dts | 96 ++++++++++++
.../boot/dts/loongson/ls2k1000_pai_udb.dts | 107 ++++++++++++++
.../boot/dts/loongson/ls3a4000_7a1000_evb.dts | 138 ++++++++++++++++++
4 files changed, 345 insertions(+)
create mode 100644 arch/mips/boot/dts/loongson/lemote_a1901.dts
create mode 100644 arch/mips/boot/dts/loongson/ls2k1000_pai_udb.dts
create mode 100644 arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
diff --git a/arch/mips/boot/dts/loongson/Makefile b/arch/mips/boot/dts/loongson/Makefile
index 5c6433e441ee..c60acbafbfce 100644
--- a/arch/mips/boot/dts/loongson/Makefile
+++ b/arch/mips/boot/dts/loongson/Makefile
@@ -6,4 +6,8 @@ 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_MACH_LOONGSON64) += ls2k1000_pai_udb.dtb
+dtb-$(CONFIG_MACH_LOONGSON64) += lemote_a1901.dtb
+dtb-$(CONFIG_MACH_LOONGSON64) += ls3a4000_7a1000_evb.dtb
+
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
diff --git a/arch/mips/boot/dts/loongson/lemote_a1901.dts b/arch/mips/boot/dts/loongson/lemote_a1901.dts
new file mode 100644
index 000000000000..880bb9153c03
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/lemote_a1901.dts
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "loongson64g-package.dtsi"
+#include "ls7a-pch.dtsi"
+
+/ {
+ model = "LX-6901";
+
+ 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_rgb1>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ adv7123_out: endpoint {
+ remote-endpoint = <&vga_connector_in>;
+ };
+ };
+ };
+ };
+
+ vga-connector {
+ compatible = "vga-connector";
+ label = "vga";
+
+ ddc-i2c-bus = <&i2c7>;
+
+ port {
+ vga_connector_in: endpoint {
+ remote-endpoint = <&adv7123_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 {
+ status = "disabled";
+ };
+
+ port@1 {
+ reg = <1>;
+ status = "ok";
+ dc_out_rgb1: endpoint {
+ remote-endpoint = <&adv7123_in>;
+ };
+ };
+ };
+};
diff --git a/arch/mips/boot/dts/loongson/ls2k1000_pai_udb.dts b/arch/mips/boot/dts/loongson/ls2k1000_pai_udb.dts
new file mode 100644
index 000000000000..972987975ada
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/ls2k1000_pai_udb.dts
@@ -0,0 +1,107 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
+
+#include "loongson64-2k1000.dtsi"
+
+/ {
+ model = "LS2K1000_PAI_UDB_V1.5";
+
+ panel: display@0 {
+ compatible = "panel-dpi";
+ label = "LCD070CG1024600+DC21";
+
+ rotation = <0>;
+ width-mm = <86>;
+ height-mm = <154>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dc_out_rgb0>;
+ };
+ };
+
+ panel-timing {
+ clock-frequency = <51200000>;
+ hactive = <1024>;
+ vactive = <600>;
+ hsync-len = <4>;
+ hfront-porch = <160>;
+ hback-porch = <156>;
+ vfront-porch = <11>;
+ vback-porch = <23>;
+ vsync-len = <1>;
+
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;
+ pixelclk-active = <1>;
+ };
+ };
+
+ monitor: display@1 {
+ compatible = "panel-dpi";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ monitor_in: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dc_out_rgb1>;
+ };
+ };
+
+ panel-timing {
+ clock-frequency = <65000000>;
+ hactive = <1024>;
+ vactive = <768>;
+ hfront-porch = <24>;
+ hsync-len = <136>;
+ hback-porch = <160>;
+ vfront-porch = <3>;
+ vback-porch = <6>;
+ vsync-len = <29>;
+
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;
+ pixelclk-active = <1>;
+ };
+ };
+};
+
+&lsdc {
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dc_out_rgb0: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dc_out_rgb1: endpoint {
+ remote-endpoint = <&monitor_in>;
+ };
+ };
+ };
+};
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..e342eb9ea12e
--- /dev/null
+++ b/arch/mips/boot/dts/loongson/ls3a4000_7a1000_evb.dts
@@ -0,0 +1,138 @@
+// 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 {
+ reg = <0>;
+ dc_out_rgb0: endpoint {
+ remote-endpoint = <&adv7123_in>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dc_out_rgb1: endpoint {
+ remote-endpoint = <&tfp410_in>;
+ };
+ };
+ };
+};
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 1/6] MIPS: Loongson64: dts: update the display controller device node Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 2/6] MIPS: Loongson64: introduce board specific dts and add model property Sui Jingfeng
@ 2022-03-27 11:38 ` Sui Jingfeng
2022-03-27 12:54 ` Jiaxun Yang
2022-03-27 14:02 ` Rob Herring
2022-03-27 11:38 ` [PATCH v12 4/6] MIPS: Loongson64: defconfig: enable display bridge drivers Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 6/6] MAINTAINERS: add maintainers for DRM LSDC driver Sui Jingfeng
4 siblings, 2 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
Add DT bindings and simple usages for Loongson display controller
found in LS7A1000 bridges chip and LS2k1000 SoC.
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
---
.../loongson/loongson,display-controller.yaml | 322 ++++++++++++++++++
1 file changed, 322 insertions(+)
create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
diff --git a/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
new file mode 100644
index 000000000000..b380602036f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
@@ -0,0 +1,322 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/loongson/loongson,display-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson LS7A1000/LS2K1000/LS2K0500 Display Controller Device Tree Bindings
+
+maintainers:
+ - Sui Jingfeng <suijingfeng@loongson.cn>
+
+description: |+
+
+ Loongson display controllers are simple which require scanout buffers
+ to be physically contiguous. LS2K1000/LS2K0500 is a SOC, only system
+ memory is available. LS7A1000/LS7A2000 is bridge chip which is equipped
+ with a dedicated video RAM which is 64MB or more, precise size can be
+ read from the PCI BAR 2 of the GPU device(0x0014:0x7A15) in the bridge
+ chip.
+
+ LSDC has two display pipes, each way has a DVO interface which provide
+ RGB888 signals, vertical & horizontal synchronisations, data enable and
+ the pixel clock. LSDC has two CRTC, each CRTC is able to scanout from
+ 1920x1080 resolution at 60Hz. Each CRTC has two FB address registers.
+
+ For LS7A1000, there are 4 dedicated GPIOs whose control register is
+ located at the DC register space. They are used to emulate two way i2c,
+ One for DVO0, another for DVO1.
+
+ LS2K1000 and LS2K0500 SoC grab i2c adapter from other module, either
+ general purpose GPIO emulated i2c or hardware i2c in the SoC.
+
+ LSDC's display pipeline have several components as below description,
+
+ The display controller in LS7A1000:
+ ___________________ _________
+ | -------| | |
+ | CRTC0 --> | DVO0 ----> Encoder0 ---> Connector0 ---> | Monitor |
+ | _ _ -------| ^ ^ |_________|
+ | | | | | -------| | |
+ | |_| |_| | i2c0 <--------+-------------+
+ | -------|
+ | DC IN LS7A1000 |
+ | _ _ -------|
+ | | | | | | i2c1 <--------+-------------+
+ | |_| |_| -------| | | _________
+ | -------| | | | |
+ | CRTC1 --> | DVO1 ----> Encoder1 ---> Connector1 ---> | Panel |
+ | -------| |_________|
+ |___________________|
+
+ Simple usage of LS7A1000 with LS3A4000 CPU:
+
+ +------+ +------------------------------------+
+ | 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
+ +-------+ +------+
+
+ The display controller in LS2K1000/LS2K0500:
+ ___________________ _________
+ | -------| | |
+ | CRTC0 --> | DVO0 ----> Encoder0 ---> Connector0 ---> | Monitor |
+ | _ _ -------| ^ ^ |_________|
+ | | | | | | | |
+ | |_| |_| | +------+ |
+ | <---->| i2c0 |<---------+
+ | DC IN LS2K1000 | +------+
+ | _ _ | +------+
+ | | | | | <---->| i2c1 |----------+
+ | |_| |_| | +------+ | _________
+ | -------| | | | |
+ | CRTC1 --> | DVO1 ----> Encoder1 ---> Connector1 ---> | Panel |
+ | -------| |_________|
+ |___________________|
+
+properties:
+ $nodename:
+ pattern: "^display-controller@[0-9a-f],[0-9a-f]$"
+
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - loongson,ls7a1000-dc
+ - loongson,ls2k1000-dc
+ - loongson,ls2k0500-dc
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ '#address-cells':
+ const: 1
+
+ '#size-cells':
+ const: 0
+
+ i2c@6:
+ $ref: /schemas/i2c/i2c-controller.yaml#
+ description: |
+ Built-in GPIO emulate i2c exported for display bridge configuration,
+ monitor detection and edid read back etc, for ls7a1000 only.
+
+ properties:
+ $nodename:
+ const: i2c
+
+ compatible:
+ const: loongson,gpio-i2c
+
+ reg:
+ minItems: 1
+ description: address offset and range
+
+ loongson,nr:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Indicates the I2C bus number this DT node represents.
+
+ loongson,sda:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: gpio pin used for the sda signal
+
+ loongson,scl:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: gpio pin used for the scl signal
+
+ loongson,udelay:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: delay between GPIO operations, unit is us.
+
+ loongson,timeout:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: timeout to get data, unit is ms.
+
+ required:
+ - compatible
+ - loongson,sda
+ - loongson,scl
+ - loongson,nr
+
+ i2c@7:
+ $ref: /schemas/i2c/i2c-controller.yaml#
+ description: |
+ Built-in GPIO emulate i2c exported for display bridge configuration,
+ monitor detection and edid read back etc, for ls7a1000 only.
+ properties:
+ $nodename:
+ const: i2c
+
+ compatible:
+ const: loongson,gpio-i2c
+
+ reg:
+ minItems: 1
+ description: address offset and range
+
+ loongson,nr:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Indicates the I2C bus number this DT node represents.
+
+ loongson,sda:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: gpio pin used for the sda signal
+
+ loongson,scl:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: gpio pin used for the scl signal
+
+ loongson,udelay:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: delay between GPIO operations, unit is us.
+
+ loongson,timeout:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: timeout to get data, unit is ms.
+
+ required:
+ - compatible
+ - loongson,sda
+ - loongson,scl
+ - loongson,nr
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: output port node connected with DPI panels or external encoders, with only one endpoint.
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: output port node connected with DPI panels or external encoders, with only one endpoint.
+
+ required:
+ - port@0
+ - port@1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - ports
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ bus {
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <2>;
+
+ display-controller@6,1 {
+ compatible = "loongson,ls7a1000-dc";
+ reg = <0x3100 0x0 0x0 0x0 0x0>;
+ interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
+ };
+ };
+
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ bus {
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <2>;
+
+ display-controller@6,1 {
+ compatible = "loongson,ls7a1000-dc";
+ reg = <0x3100 0x0 0x0 0x0 0x0>;
+ interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@6 {
+ compatible = "loongson,gpio-i2c";
+ reg = <0x00001650 0x00000020>;
+ loongson,nr = <6>;
+ loongson,sda = <0>;
+ loongson,scl = <1>;
+ loongson,udelay = <5>;
+ loongson,timeout = <2200>;
+ };
+
+ i2c@7 {
+ compatible = "loongson,gpio-i2c";
+ reg = <0x00001650 0x00000020>;
+ loongson,nr = <7>;
+ loongson,sda = <2>;
+ loongson,scl = <3>;
+ loongson,udelay = <5>;
+ loongson,timeout = <2200>;
+ };
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ endpoint {
+ remote-endpoint = <&vga_encoder_in>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ endpoint {
+ remote-endpoint = <&dvi_encoder_in>;
+ };
+ };
+ };
+ };
+ };
+
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ bus {
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <2>;
+
+ display-controller@6,0 {
+ compatible = "loongson,ls2k1000-dc";
+ reg = <0x3100 0x0 0x0 0x0 0x0>;
+ interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ port@0 {
+ reg = <0>;
+ endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ endpoint {
+ remote-endpoint = <&hdmi_encoder_in>;
+ };
+ };
+ };
+ };
+ };
+...
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v12 4/6] MIPS: Loongson64: defconfig: enable display bridge drivers
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
` (2 preceding siblings ...)
2022-03-27 11:38 ` [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Sui Jingfeng
@ 2022-03-27 11:38 ` Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 6/6] MAINTAINERS: add maintainers for DRM LSDC driver Sui Jingfeng
4 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
ls3A4000 evb board ship with adv7123 and tfp410 while ls2k1000 PI board
use a DPI panel from FORLINX company and a sii9022 HDMI transmitter.
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
---
arch/mips/configs/loongson2k_defconfig | 5 +++++
arch/mips/configs/loongson3_defconfig | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/arch/mips/configs/loongson2k_defconfig b/arch/mips/configs/loongson2k_defconfig
index e948ca487e2d..0a97c332a5c3 100644
--- a/arch/mips/configs/loongson2k_defconfig
+++ b/arch/mips/configs/loongson2k_defconfig
@@ -243,6 +243,11 @@ CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_DRM=y
CONFIG_DRM_RADEON=y
+CONFIG_DRM_DISPLAY_CONNECTOR=m
+CONFIG_DRM_PANEL_SIMPLE=m
+CONFIG_DRM_SII902X=m
+CONFIG_DRM_SIMPLE_BRIDGE=m
+CONFIG_DRM_TI_TFP410=m
CONFIG_FB_RADEON=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_PLATFORM=m
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
index 25ecd15bc952..35e2fc998768 100644
--- a/arch/mips/configs/loongson3_defconfig
+++ b/arch/mips/configs/loongson3_defconfig
@@ -280,6 +280,11 @@ CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_DRM=y
CONFIG_DRM_RADEON=m
+CONFIG_DRM_DISPLAY_CONNECTOR=m
+CONFIG_DRM_PANEL_SIMPLE=m
+CONFIG_DRM_SII902X=m
+CONFIG_DRM_SIMPLE_BRIDGE=m
+CONFIG_DRM_TI_TFP410=m
CONFIG_DRM_QXL=y
CONFIG_DRM_VIRTIO_GPU=y
CONFIG_FB=y
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v12 6/6] MAINTAINERS: add maintainers for DRM LSDC driver
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
` (3 preceding siblings ...)
2022-03-27 11:38 ` [PATCH v12 4/6] MIPS: Loongson64: defconfig: enable display bridge drivers Sui Jingfeng
@ 2022-03-27 11:38 ` Sui Jingfeng
4 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-27 11:38 UTC (permalink / raw)
To: 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, Jiaxun Yang,
Lucas Stach, Maarten Lankhorst, Ilia Mirkin, Qing Zhang,
suijingfeng
Cc: linux-mips, linux-kernel, devicetree, dri-devel
This patch add myself as maintainer
My company email is <suijingfeng@loongson.cn>
my personal email is <15330273260@189.cn>
Signed-off-by: Sui Jingfeng <15330273260@189.cn>
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 10476280acb8..21184d8577f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6487,6 +6487,15 @@ T: git git://anongit.freedesktop.org/drm/drm-misc
F: drivers/gpu/drm/lima/
F: include/uapi/drm/lima_drm.h
+DRM DRIVERS FOR LOONGSON
+M: suijingfeng <suijingfeng@loongson.cn>
+L: dri-devel@lists.freedesktop.org
+S: Maintained
+W: https://www.loongson.cn/
+T: git git://anongit.freedesktop.org/drm/drm-misc
+F: Documentation/devicetree/bindings/display/loongson/
+F: drivers/gpu/drm/loongson/
+
DRM DRIVERS FOR MEDIATEK
M: Chun-Kuang Hu <chunkuang.hu@kernel.org>
M: Philipp Zabel <p.zabel@pengutronix.de>
--
2.25.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller
2022-03-27 11:38 ` [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Sui Jingfeng
@ 2022-03-27 12:54 ` Jiaxun Yang
2022-03-28 1:52 ` Sui Jingfeng
2022-03-27 14:02 ` Rob Herring
1 sibling, 1 reply; 10+ messages in thread
From: Jiaxun Yang @ 2022-03-27 12:54 UTC (permalink / raw)
To: Sui Jingfeng, 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, linux-kernel, devicetree, dri-devel
在 2022/3/27 12:38, Sui Jingfeng 写道:
> Add DT bindings and simple usages for Loongson display controller
> found in LS7A1000 bridges chip and LS2k1000 SoC.
>
> Signed-off-by: Sui Jingfeng <15330273260@189.cn>
[...]
> +
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + bus {
> +
> + #address-cells = <3>;
> + #size-cells = <2>;
> + #interrupt-cells = <2>;
> +
> + display-controller@6,1 {
> + compatible = "loongson,ls7a1000-dc";
> + reg = <0x3100 0x0 0x0 0x0 0x0>;
> + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + i2c@6 {
> + compatible = "loongson,gpio-i2c";
> + reg = <0x00001650 0x00000020>;
Hi Jingfeng,
Thanks for your patch.
Just curious about what is this "reg" for?
> + loongson,nr = <6>;
Why nr start from 6?
The approach you are handling I2C seems to be wired..
Actually you can reference how network subsystem is handling
MDIO controller built-in into Ethernet controller [1] in this case. It is
basically the same problem.
[1]:
https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/net/snps,dwmac.yaml
Thanks.
- Jiaxun
> + loongson,sda = <0>;
> + loongson,scl = <1>;
> + loongson,udelay = <5>;
> + loongson,timeout = <2200>;
> + };
> +
> + i2c@7 {
> + compatible = "loongson,gpio-i2c";
> + reg = <0x00001650 0x00000020>;
> + loongson,nr = <7>;
> + loongson,sda = <2>;
> + loongson,scl = <3>;
> + loongson,udelay = <5>;
> + loongson,timeout = <2200>;
> + };
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + port@0 {
> + reg = <0>;
> + endpoint {
> + remote-endpoint = <&vga_encoder_in>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + endpoint {
> + remote-endpoint = <&dvi_encoder_in>;
> + };
> + };
> + };
> + };
> + };
> +
> + - |
> + #include <dt-bindings/interrupt-controller/irq.h>
> + bus {
> +
> + #address-cells = <3>;
> + #size-cells = <2>;
> + #interrupt-cells = <2>;
> +
> + display-controller@6,0 {
> + compatible = "loongson,ls2k1000-dc";
> + reg = <0x3100 0x0 0x0 0x0 0x0>;
> + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
> +
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + port@0 {
> + reg = <0>;
> + endpoint {
> + remote-endpoint = <&panel_in>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + endpoint {
> + remote-endpoint = <&hdmi_encoder_in>;
> + };
> + };
> + };
> + };
> + };
> +...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller
2022-03-27 11:38 ` [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Sui Jingfeng
2022-03-27 12:54 ` Jiaxun Yang
@ 2022-03-27 14:02 ` Rob Herring
2022-03-28 2:24 ` Sui Jingfeng
1 sibling, 1 reply; 10+ messages in thread
From: Rob Herring @ 2022-03-27 14:02 UTC (permalink / raw)
To: Sui Jingfeng
Cc: devicetree, dri-devel, Roland Scheidegger, Christian Gmeiner,
Maxime Ripard, Ilia Mirkin, Lucas Stach, Thomas Bogendoerfer,
linux-kernel, Qing Zhang, Maarten Lankhorst, Krzysztof Kozlowski,
Dan Carpenter, Rob Herring, Daniel Vetter, suijingfeng,
David Airlie, Jiaxun Yang, linux-mips, David S . Miller,
Zack Rusin, Thomas Zimmermann, Sam Ravnborg, Andrey Zhizhikin
On Sun, 27 Mar 2022 19:38:43 +0800, Sui Jingfeng wrote:
> Add DT bindings and simple usages for Loongson display controller
> found in LS7A1000 bridges chip and LS2k1000 SoC.
>
> Signed-off-by: Sui Jingfeng <15330273260@189.cn>
> ---
> .../loongson/loongson,display-controller.yaml | 322 ++++++++++++++++++
> 1 file changed, 322 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dt.yaml: display-controller@6,1: 'ports' is a required property
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1609879
This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller
2022-03-27 12:54 ` Jiaxun Yang
@ 2022-03-28 1:52 ` Sui Jingfeng
0 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-28 1:52 UTC (permalink / raw)
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, linux-kernel, devicetree, dri-devel
On 2022/3/27 20:54, Jiaxun Yang wrote:
>
>
> 在 2022/3/27 12:38, Sui Jingfeng 写道:
>> Add DT bindings and simple usages for Loongson display controller
>> found in LS7A1000 bridges chip and LS2k1000 SoC.
>>
>> Signed-off-by: Sui Jingfeng <15330273260@189.cn>
> [...]
>> +
>> + - |
>> + #include <dt-bindings/interrupt-controller/irq.h>
>> + bus {
>> +
>> + #address-cells = <3>;
>> + #size-cells = <2>;
>> + #interrupt-cells = <2>;
>> +
>> + display-controller@6,1 {
>> + compatible = "loongson,ls7a1000-dc";
>> + reg = <0x3100 0x0 0x0 0x0 0x0>;
>> + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + i2c@6 {
>> + compatible = "loongson,gpio-i2c";
>> + reg = <0x00001650 0x00000020>;
> Hi Jingfeng,
>
> Thanks for your patch.
>
> Just curious about what is this "reg" for?
Hi, Jiaxun
Thanks for you take valuable time to review my patch.
Without it make dt_binding_check generate warnings:
Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dts:65.23-73.19:
Warning (unit_address_vs_reg):
/example-1/bus/display-controller@6,1/i2c@6: node has a unit name, but
no reg or ranges property
reg are the control register offset and size of the dedicate GPIO, they
are not get used by the driver currently,
put in there just for silence the warning .
>> + loongson,nr = <6>;
> Why nr start from 6?
Bus number greater than 6 is safe because ls7a1000 bridge have 6 hardware I2C controller integrated. but
the driver for it is not upstream yet. To avoid potential conflict with the bus number of the hardware I2C driver.
In the future, if someone contribute the hardware I2C driver to upstream,
you don't need change it. Let me give you an example to show what it will be:
aliases {
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
i2c3 = &i2c3;
i2c4 = &i2c4;
i2c5 = &i2c5;
i2c6 = &i2c6;
i2c7 = &i2c7;
};
i2c0: i2c@10090000 {
compatible = "loongson,ls-i2c";
reg = <0x10090000 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c1: i2c@10090100 {
compatible = "loongson,ls-i2c";
reg = <0x10090100 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c2: i2c@10090200 {
compatible = "loongson,ls-i2c";
reg = <0x10090200 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c3: i2c@10090300 {
compatible = "loongson,ls-i2c";
reg = <0x10090300 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c4: i2c@10090400 {
compatible = "loongson,ls-i2c";
reg = <0x10090400 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c5: i2c@10090500 {
compatible = "loongson,ls-i2c";
reg = <0x10090500 0x8>;
interrupts = <73>;
interrupt-parent = <&platic>;
#address-cells = <1>;
#size-cells = <0>;
};
> The approach you are handling I2C seems to be wired..
>
It is not wired, you can change it to 0 or 1 it you like currently,
you can even remove loongson,nr = <6> and loongson,nr = <7>,
then the i2c core driver will automatically allocate one for you.
It is very flexible actually.
> Actually you can reference how network subsystem is handling
> MDIO controller built-in into Ethernet controller [1] in this case. It is
> basically the same problem.
>
> [1]:
> https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/net/snps,dwmac.yaml
>
> Thanks.
> - Jiaxun
>
>> + loongson,sda = <0>;
>> + loongson,scl = <1>;
>> + loongson,udelay = <5>;
>> + loongson,timeout = <2200>;
>> + };
>> +
>> + i2c@7 {
>> + compatible = "loongson,gpio-i2c";
>> + reg = <0x00001650 0x00000020>;
>> + loongson,nr = <7>;
>> + loongson,sda = <2>;
>> + loongson,scl = <3>;
>> + loongson,udelay = <5>;
>> + loongson,timeout = <2200>;
>> + };
>> +
>> + ports {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + port@0 {
>> + reg = <0>;
>> + endpoint {
>> + remote-endpoint = <&vga_encoder_in>;
>> + };
>> + };
>> +
>> + port@1 {
>> + reg = <1>;
>> + endpoint {
>> + remote-endpoint = <&dvi_encoder_in>;
>> + };
>> + };
>> + };
>> + };
>> + };
>> +
>> + - |
>> + #include <dt-bindings/interrupt-controller/irq.h>
>> + bus {
>> +
>> + #address-cells = <3>;
>> + #size-cells = <2>;
>> + #interrupt-cells = <2>;
>> +
>> + display-controller@6,0 {
>> + compatible = "loongson,ls2k1000-dc";
>> + reg = <0x3100 0x0 0x0 0x0 0x0>;
>> + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> + ports {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + port@0 {
>> + reg = <0>;
>> + endpoint {
>> + remote-endpoint = <&panel_in>;
>> + };
>> + };
>> +
>> + port@1 {
>> + reg = <1>;
>> + endpoint {
>> + remote-endpoint = <&hdmi_encoder_in>;
>> + };
>> + };
>> + };
>> + };
>> + };
>> +...
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller
2022-03-27 14:02 ` Rob Herring
@ 2022-03-28 2:24 ` Sui Jingfeng
0 siblings, 0 replies; 10+ messages in thread
From: Sui Jingfeng @ 2022-03-28 2:24 UTC (permalink / raw)
To: Rob Herring
Cc: devicetree, dri-devel, Roland Scheidegger, Christian Gmeiner,
Maxime Ripard, Ilia Mirkin, Lucas Stach, Thomas Bogendoerfer,
linux-kernel, Qing Zhang, Maarten Lankhorst, Krzysztof Kozlowski,
Dan Carpenter, Rob Herring, Daniel Vetter, suijingfeng,
David Airlie, Jiaxun Yang, linux-mips, David S . Miller,
Zack Rusin, Thomas Zimmermann, Sam Ravnborg, Andrey Zhizhikin
On 2022/3/27 22:02, Rob Herring wrote:
> On Sun, 27 Mar 2022 19:38:43 +0800, Sui Jingfeng wrote:
>> Add DT bindings and simple usages for Loongson display controller
>> found in LS7A1000 bridges chip and LS2k1000 SoC.
>>
>> Signed-off-by: Sui Jingfeng <15330273260@189.cn>
>> ---
>> .../loongson/loongson,display-controller.yaml | 322 ++++++++++++++++++
>> 1 file changed, 322 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
>>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.example.dt.yaml: display-controller@6,1: 'ports' is a required property
> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/loongson/loongson,display-controller.yaml
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/patch/1609879
>
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.
>
It is my fault, remove the ports from the required will fix this,
I run make dt_binding_check before made it optional.
I will resend the patch.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-03-28 2:25 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-27 11:38 [PATCH v12 0/6] drm/loongson: add drm driver for loongson display controller Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 1/6] MIPS: Loongson64: dts: update the display controller device node Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 2/6] MIPS: Loongson64: introduce board specific dts and add model property Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 3/6] dt-bindings: display: Add Loongson display controller Sui Jingfeng
2022-03-27 12:54 ` Jiaxun Yang
2022-03-28 1:52 ` Sui Jingfeng
2022-03-27 14:02 ` Rob Herring
2022-03-28 2:24 ` Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 4/6] MIPS: Loongson64: defconfig: enable display bridge drivers Sui Jingfeng
2022-03-27 11:38 ` [PATCH v12 6/6] MAINTAINERS: add maintainers for DRM LSDC driver Sui Jingfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox