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(-)
From: Joel Stanley joel@jms.id.au
The GFX device is present in the AST2600 SoC.
Signed-off-by: Joel Stanley joel@jms.id.au Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- 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>;
From: Joel Stanley joel@jms.id.au
Enable the GFX device with a framebuffer memory region.
Signed-off-by: Joel Stanley joel@jms.id.au Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- 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";
From: Joel Stanley joel@jms.id.au
The values for the threshold and scan line size come from the ASPEED SDK.
The DAC register is SCUC0 in the AST2600 datasheet. It has the same layout as the previous generations.
Signed-off-by: Joel Stanley joel@jms.id.au Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index b53fee6f1c17..ea9cb0a4f16c 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -79,9 +79,16 @@ static const struct aspeed_gfx_config ast2500_config = { .scan_line_max = 128, };
+static const struct aspeed_gfx_config ast2600_config = { + .dac_reg = 0xc0, + .throd_val = CRT_THROD_LOW(0x50) | CRT_THROD_HIGH(0x70), + .scan_line_max = 128, +}; + static const struct of_device_id aspeed_gfx_match[] = { { .compatible = "aspeed,ast2400-gfx", .data = &ast2400_config }, { .compatible = "aspeed,ast2500-gfx", .data = &ast2500_config }, + { .compatible = "aspeed,ast2600-gfx", .data = &ast2600_config }, { }, }; MODULE_DEVICE_TABLE(of, aspeed_gfx_match);
From: Joel Stanley joel@jms.id.au
The 2600 uses this register differently. THis is a TODO to come up with a method of handling that.
Signed-off-by: Joel Stanley joel@jms.id.au Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- 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; }
From: Joel Stanley joel@jms.id.au
The AST2600 will run at 1024x868.
Signed-off-by: Joel Stanley joel@jms.id.au Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- 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;
Add ast2600-gfx description for gfx driver.
Signed-off-by: tommy-huang tommy_huang@aspeedtech.com --- 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
On Tue, 28 Sep 2021 10:57:03 +0800, tommy-huang wrote:
Add ast2600-gfx description for gfx driver.
Signed-off-by: tommy-huang tommy_huang@aspeedtech.com
Documentation/devicetree/bindings/gpu/aspeed-gfx.txt | 1 + 1 file changed, 1 insertion(+)
Acked-by: Rob Herring robh@kernel.org
dri-devel@lists.freedesktop.org