2021-09-28 02:59:59

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 0/6] *** Add AST2600 GFX node ***

Add AST2600 GFX support first.

Joel Stanley (5):
ARM: dts: aspeed: Add GFX node to AST2600
ARM: dts: aspeed: ast2600-evb: Enable GFX device
drm/aspeed: Add AST2600 support
HACK: drm/aspeed: INTR_STS hadndling
HACK: drm/aspeed: Paramterise modes

tommy-huang (1):
dt-bindings: gpu: Add ASPEED GFX bindings document

.../devicetree/bindings/gpu/aspeed-gfx.txt | 1 +
arch/arm/boot/dts/aspeed-ast2600-evb.dts | 13 +++++++++++++
arch/arm/boot/dts/aspeed-g6.dtsi | 11 +++++++++++
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 18 +++++++++++++-----
4 files changed, 38 insertions(+), 5 deletions(-)

--
2.17.1


2021-09-28 03:00:02

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 2/6] ARM: dts: aspeed: ast2600-evb: Enable GFX device

From: Joel Stanley <[email protected]>

Enable the GFX device with a framebuffer memory region.

Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: tommy-huang <[email protected]>
---
arch/arm/boot/dts/aspeed-ast2600-evb.dts | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-ast2600-evb.dts b/arch/arm/boot/dts/aspeed-ast2600-evb.dts
index b7eb552640cb..195ccd1952da 100644
--- a/arch/arm/boot/dts/aspeed-ast2600-evb.dts
+++ b/arch/arm/boot/dts/aspeed-ast2600-evb.dts
@@ -23,6 +23,19 @@
reg = <0x80000000 0x80000000>;
};

+ reserved-memory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges;
+
+ gfx_memory: framebuffer {
+ size = <0x01000000>;
+ alignment = <0x01000000>;
+ compatible = "shared-dma-pool";
+ reusable;
+ };
+ };
+
vcc_sdhci0: regulator-vcc-sdhci0 {
compatible = "regulator-fixed";
regulator-name = "SDHCI0 Vcc";
--
2.17.1

2021-09-28 03:00:17

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 5/6] HACK: drm/aspeed: Paramterise modes

From: Joel Stanley <[email protected]>

The AST2600 will run at 1024x868.

Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: tommy-huang <[email protected]>
---
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 33095477cc03..11a44b08bd3f 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -99,7 +99,7 @@ static const struct drm_mode_config_funcs aspeed_gfx_mode_config_funcs = {
.atomic_commit = drm_atomic_helper_commit,
};

-static int aspeed_gfx_setup_mode_config(struct drm_device *drm)
+static int aspeed_gfx_setup_mode_config(struct drm_device *drm, int width, int height)
{
int ret;

@@ -109,8 +109,8 @@ static int aspeed_gfx_setup_mode_config(struct drm_device *drm)

drm->mode_config.min_width = 0;
drm->mode_config.min_height = 0;
- drm->mode_config.max_width = 800;
- drm->mode_config.max_height = 600;
+ drm->mode_config.max_width = width;
+ drm->mode_config.max_height = height;
drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs;

return ret;
@@ -201,7 +201,7 @@ static int aspeed_gfx_load(struct drm_device *drm)
writel(0, priv->base + CRT_CTRL1);
writel(0, priv->base + CRT_CTRL2);

- ret = aspeed_gfx_setup_mode_config(drm);
+ ret = aspeed_gfx_setup_mode_config(drm, 800, 600);
if (ret < 0)
return ret;

--
2.17.1

2021-09-28 03:01:33

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 6/6] dt-bindings: gpu: Add ASPEED GFX bindings document

Add ast2600-gfx description for gfx driver.

Signed-off-by: tommy-huang <[email protected]>
---
Documentation/devicetree/bindings/gpu/aspeed-gfx.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/gpu/aspeed-gfx.txt b/Documentation/devicetree/bindings/gpu/aspeed-gfx.txt
index 958bdf962339..29ecf119cef2 100644
--- a/Documentation/devicetree/bindings/gpu/aspeed-gfx.txt
+++ b/Documentation/devicetree/bindings/gpu/aspeed-gfx.txt
@@ -3,6 +3,7 @@ Device tree configuration for the GFX display device on the ASPEED SoCs
Required properties:
- compatible
* Must be one of the following:
+ + aspeed,ast2600-gfx
+ aspeed,ast2500-gfx
+ aspeed,ast2400-gfx
* In addition, the ASPEED pinctrl bindings require the 'syscon' property to
--
2.17.1

2021-09-28 03:02:49

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 4/6] HACK: drm/aspeed: INTR_STS hadndling

From: Joel Stanley <[email protected]>

The 2600 uses this register differently. THis is a TODO to come up with
a method of handling that.

Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: tommy-huang <[email protected]>
---
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index ea9cb0a4f16c..33095477cc03 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -126,7 +126,8 @@ static irqreturn_t aspeed_gfx_irq_handler(int irq, void *data)

if (reg & CRT_CTRL_VERTICAL_INTR_STS) {
drm_crtc_handle_vblank(&priv->pipe.crtc);
- writel(reg, priv->base + CRT_CTRL1);
+ /* TODO */
+ writel(CRT_CTRL_VERTICAL_INTR_STS, priv->base + CRT_STATUS);
return IRQ_HANDLED;
}

--
2.17.1

2021-09-28 03:03:02

by Tommy Huang

[permalink] [raw]
Subject: [PATCH 1/6] ARM: dts: aspeed: Add GFX node to AST2600

From: Joel Stanley <[email protected]>

The GFX device is present in the AST2600 SoC.

Signed-off-by: Joel Stanley <[email protected]>
Signed-off-by: tommy-huang <[email protected]>
---
arch/arm/boot/dts/aspeed-g6.dtsi | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
index 1b47be1704f8..e38c3742761b 100644
--- a/arch/arm/boot/dts/aspeed-g6.dtsi
+++ b/arch/arm/boot/dts/aspeed-g6.dtsi
@@ -351,6 +351,17 @@
quality = <100>;
};

+ gfx: display@1e6e6000 {
+ compatible = "aspeed,ast2600-gfx", "aspeed,ast2500-gfx", "syscon";
+ reg = <0x1e6e6000 0x1000>;
+ reg-io-width = <4>;
+ clocks = <&syscon ASPEED_CLK_GATE_D1CLK>;
+ resets = <&syscon ASPEED_RESET_GRAPHICS>;
+ syscon = <&syscon>;
+ status = "disabled";
+ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
xdma: xdma@1e6e7000 {
compatible = "aspeed,ast2600-xdma";
reg = <0x1e6e7000 0x100>;
--
2.17.1

2021-10-04 19:08:04

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 6/6] dt-bindings: gpu: Add ASPEED GFX bindings document

On Tue, 28 Sep 2021 10:57:03 +0800, tommy-huang wrote:
> Add ast2600-gfx description for gfx driver.
>
> Signed-off-by: tommy-huang <[email protected]>
> ---
> Documentation/devicetree/bindings/gpu/aspeed-gfx.txt | 1 +
> 1 file changed, 1 insertion(+)
>

Acked-by: Rob Herring <[email protected]>