Skip to contentSkip to conversation

drm/ast: Avoid to access BMC addressing when P2A is disabled

PATCH In review KuoHsiang Chou 4 participants 7 messages Oct 16, 2020 – Oct 19, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ast: Avoid to access BMC addressing when P2A is disabled

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update from 3.10 to 4.9 on 2 ODM's platform.
2. For AST2600.
3. For ASTDP.
4. v1.11

---
 drivers/gpu/drm/ast/Makefile          |   2 +-
 drivers/gpu/drm/ast/ast_dp.c          | 233 ++++++++++++++
 drivers/gpu/drm/ast/ast_dram_tables.h |  59 ++++
 drivers/gpu/drm/ast/ast_drv.c         |   2 +-
 drivers/gpu/drm/ast/ast_drv.h         |  31 +-
 drivers/gpu/drm/ast/ast_main.c        | 138 +++++++--
 drivers/gpu/drm/ast/ast_mode.c        | 146 +++++++--
 drivers/gpu/drm/ast/ast_post.c        | 553 ++++++++++++++++++++++++++++++----
 drivers/gpu/drm/ast/ast_tables.h      | 238 ++++++++++-----
 9 files changed, 1214 insertions(+), 188 deletions(-)
 create mode 100644 drivers/gpu/drm/ast/ast_dp.c
drivers/gpu/drm/ast/Makefile +1 -1
index 171aa06..a6974af 100644
@@ -4,6 +4,6 @@
 
 ccflags-y := -Iinclude/drm
 
-ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o ast_dp501.o
+ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o ast_dp501.o ast_dp.o
 
 obj-$(CONFIG_DRM_AST) := ast.o
drivers/gpu/drm/ast/ast_dp.c new file +233 -0

233 lines not on this page · raw message

drivers/gpu/drm/ast/ast_dram_tables.h +59 -0

63 lines not on this page · raw message

drivers/gpu/drm/ast/ast_drv.c +1 -1
index 736133f..1203f76 100644
@@ -54,6 +54,7 @@ static struct drm_driver driver;
 static const struct pci_device_id pciidlist[] = {
 	AST_VGA_DEVICE(PCI_CHIP_AST2000, NULL),
 	AST_VGA_DEVICE(PCI_CHIP_AST2100, NULL),
+	AST_VGA_DEVICE(PCI_CHIP_AIP200, NULL),
 	/*	AST_VGA_DEVICE(PCI_CHIP_AST1180, NULL), - don't bind to 1180 for now */
 	{0, 0, 0},
 };
@@ -257,4 +258,3 @@ module_exit(ast_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL and additional rights");
-
drivers/gpu/drm/ast/ast_drv.h +28 -3
index 3bedcf7..6a42183 100644
@@ -45,15 +45,16 @@
 
 #define DRIVER_NAME		"ast"
 #define DRIVER_DESC		"AST"
-#define DRIVER_DATE		"20120228"
+#define DRIVER_DATE		"20200729"
 
-#define DRIVER_MAJOR		0
-#define DRIVER_MINOR		1
+#define DRIVER_MAJOR		1
+#define DRIVER_MINOR		11
 #define DRIVER_PATCHLEVEL	0
 
 #define PCI_CHIP_AST2000 0x2000
 #define PCI_CHIP_AST2100 0x2010
 #define PCI_CHIP_AST1180 0x1180
+#define PCI_CHIP_AIP200  0xA200
 
 
 enum ast_chip {
@@ -64,7 +65,10 @@ enum ast_chip {
 	AST2150,
 	AST2300,
 	AST2400,
+	AST2500,
+	AST2600,
 	AST1180,
+	AIP200,
 };
 
 enum ast_tx_chip {
@@ -72,6 +76,7 @@ enum ast_tx_chip {
 	AST_TX_SIL164,
 	AST_TX_ITE66121,
 	AST_TX_DP501,
+	AST_TX_ASTDP,
 };
 
 #define AST_DRAM_512Mx16 0
@@ -80,6 +85,7 @@ enum ast_tx_chip {
 #define AST_DRAM_1Gx32   3
 #define AST_DRAM_2Gx16   6
 #define AST_DRAM_4Gx16   7
+#define AST_DRAM_8Gx16   8
 
 struct ast_fbdev;
 
@@ -88,6 +94,7 @@ struct ast_private {
 
 	void __iomem *regs;
 	void __iomem *ioregs;
+	void __iomem *reservedbuffer;
 
 	enum ast_chip chip;
 	bool vga2_clone;
@@ -113,6 +120,8 @@ struct ast_private {
 	struct ttm_bo_kmap_obj cache_kmap;
 	int next_cursor;
 	bool support_wide_screen;
+	bool support_newvga_mode;
+	bool RefCLK25MHz;
 	enum {
 		ast_use_p2a,
 		ast_use_dt,
@@ -123,6 +132,9 @@ struct ast_private {
 	u8 dp501_maxclk;
 	u8 *dp501_fw_addr;
 	const struct firmware *dp501_fw;	/* dp501 fw */
+
+    // ASTDP
+    u8 ASTDP_State;
 };
 
 int ast_driver_load(struct drm_device *dev, unsigned long flags);
@@ -204,6 +216,8 @@ static inline void ast_open_key(struct ast_private *ast)
 	ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x80, 0xA8);
 }
 
+static inline void ast_wait_one_vsync(struct ast_private *ast);
+
 #define AST_VIDMEM_SIZE_8M    0x00800000
 #define AST_VIDMEM_SIZE_16M   0x01000000
 #define AST_VIDMEM_SIZE_32M   0x02000000
@@ -397,6 +411,7 @@ bool ast_is_vga_enabled(struct drm_device *dev);
 void ast_post_gpu(struct drm_device *dev);
 u32 ast_mindwm(struct ast_private *ast, u32 r);
 void ast_moutdwm(struct ast_private *ast, u32 r, u32 v);
+void patch_ahb_ast2500(struct ast_private *ast);
 /* ast dp501 */
 int ast_load_dp501_microcode(struct drm_device *dev);
 void ast_set_dp501_video_output(struct drm_device *dev, u8 mode);
@@ -405,4 +420,14 @@ bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size);
 bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata);
 u8 ast_get_dp501_max_clk(struct drm_device *dev);
 void ast_init_3rdtx(struct drm_device *dev);
+void ast_release_firmware(struct drm_device *dev);
+/* aspeed DP */
+#define DPControlPower
+bool ast_dp_read_edid(struct drm_device *dev, u8 *ediddata);
+bool ast_dp_launch(struct drm_device *dev, u8 bPower);
+#ifdef DPControlPower
+void ast_dp_PowerOnOff(struct drm_device *dev, u8 Mode);
+#endif
+void ast_dp_SetOnOff(struct drm_device *dev, u8 Mode);
+void ast_dp_SetOutput(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode);
 #endif
drivers/gpu/drm/ast/ast_main.c +116 -22

253 lines not on this page · raw message

drivers/gpu/drm/ast/ast_mode.c +118 -28

289 lines not on this page · raw message

drivers/gpu/drm/ast/ast_post.c +489 -64

673 lines not on this page · raw message

drivers/gpu/drm/ast/ast_tables.h +169 -69

306 lines not on this page · raw message

--
2.7.2.windows.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#1 lore raw
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update from 3.10 to 4.9 on 2 ODM's platform.
2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

https://www.kernel.org/doc/html/v5.9/process/submitting-patches.html

Please maybe work with Thomas on having a better upstream development process for ast chipsets.

Thanks,
Dave.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 12 lines · David Airlie
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update from 3.10 to 4.9 on 2 ODM's platform.
2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

Quoted 8 lines

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

I noticed the patch included drmP.h - which has been gone for a while. So on top of what Dave wrote it should build (and work) on the latest kernel.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to David Airlie

Hi

Quoted 16 lines · David Airlie
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update from 3.10 to 4.9 on 2 ODM's platform.
2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

Quoted 6 lines

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

https://www.kernel.org/doc/html/v5.9/process/submitting-patches.html

Please follow this document when submitting patches.

Quoted 3 lines

Please maybe work with Thomas on having a better upstream development process for ast chipsets.

I'd welcome more support and contributions from Aspeed developers. But in its current form, the patch is not acceptable.

Best regards
Thomas

Quoted 9 lines

Thanks,
Dave.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 10 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

To Sirs,

Thanks for your answers about the patch and next upstream to kernel-5.9 must follow these rules.

This patch based on kernel-4.9.237 is required by our customers, because my customers said the native kernel of RHEL/CentOS 7.x is 3.10 and is required to update to 4.9.

BTW, how to verify the correctness before upstream my patch . As I known, the kernel version of RHEL8.2 is v4.18, so I need to update the kernel to v5.9 by myself, right? Or should I test my patch on Fedora-rawhide whose kernel is v5.10.0?

Regards and have a good day,
Kuo-Hsiang Chou

-----Original Message-----
From: Thomas Zimmermann [mailto:[email protected]]
Sent: Monday, October 19, 2020 3:08 PM
To: David Airlie <[email protected]>; Kuo-Hsiang Chou <[email protected]>
Cc: Jenmin Yuan <[email protected]>; [email protected]; Arc Sung <[email protected]>; dri-devel <[email protected]>; Tommy Huang <[email protected]>
Subject: Re: [PATCH] drm/ast: Avoid to access BMC addressing when P2A is disabled

Hi

Quoted 16 lines · David Airlie
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update from 3.10 to 4.9 on 2 ODM's platform.
2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

Quoted 6 lines

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

https://www.kernel.org/doc/html/v5.9/process/submitting-patches.html

Please follow this document when submitting patches.

Quoted 3 lines

Please maybe work with Thomas on having a better upstream development process for ast chipsets.

I'd welcome more support and contributions from Aspeed developers. But in its current form, the patch is not acceptable.

Best regards
Thomas

Quoted 9 lines

Thanks,
Dave.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Hi

Quoted 3 lines · Kuo-Hsiang Chou

To Sirs,

Thanks for your answers about the patch and next upstream to kernel-5.9 must follow these rules.

Thanks for wanting to contribute.

Quoted 5 lines

This patch based on kernel-4.9.237 is required by our customers, because my customers said the native kernel of RHEL/CentOS 7.x is 3.10 and is required to update to 4.9.

BTW, how to verify the correctness before upstream my patch . As I known, the kernel version of RHEL8.2 is v4.18, so I need to update the kernel to v5.9 by myself, right? Or should I test my patch on Fedora-rawhide whose kernel is v5.10.0?

v4.9 is way too old for active development. DRM drivers are developed in drm-tip, which is available at

git://anongit.freedesktop.org/drm/drm-tip

It usually contains the latest Linux kernel plus graphics drivers. Patches merged into DRM move into the official Linux kernel within 2 to 3 months. From there, bug fixes move into the older versions, such as v4.9.

I know that this looks like overhead in the short term. But long-term your customers will again update their kernels and then you already have the necessary changes available and merged.

To get started, I'd advice to get the kernel in the drm-tip git repo and build it on your distribution (RHEL/CentOS). That should still be possible. Then recreate the individual changes on top of the most recent version. Each change has to go into it's own commit with a nice commit message.

And that's it basically. Once you have the changes ready, you can send them out for review.

Best regards
Thomas

Quoted 66 lines

Regards and have a good day,
Kuo-Hsiang Chou

-----Original Message-----
From: Thomas Zimmermann [mailto:[email protected]]
Sent: Monday, October 19, 2020 3:08 PM
To: David Airlie <[email protected]>; Kuo-Hsiang Chou <[email protected]>
Cc: Jenmin Yuan <[email protected]>; [email protected]; Arc Sung <[email protected]>; dri-devel <[email protected]>; Tommy Huang <[email protected]>
Subject: Re: [PATCH] drm/ast: Avoid to access BMC addressing when P2A is disabled

Hi

Quoted 16 lines · David Airlie
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update

    from 3.10 to 4.9 on 2 ODM's platform.

2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

Quoted 6 lines

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

https://www.kernel.org/doc/html/v5.9/process/submitting-patches.html

Please follow this document when submitting patches.

Quoted 3 lines

Please maybe work with Thomas on having a better upstream development process for ast chipsets.

I'd welcome more support and contributions from Aspeed developers. But in its current form, the patch is not acceptable.

Best regards
Thomas

Quoted 9 lines

Thanks,
Dave.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Signature · 10 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

To Thomas,

Thanks and got it.

Regards,
Kuo-Hsiang Chou

-----Original Message-----
From: Thomas Zimmermann [mailto:[email protected]]
Sent: Monday, October 19, 2020 3:42 PM
To: Kuo-Hsiang Chou <[email protected]>; David Airlie <[email protected]>
Cc: Jenmin Yuan <[email protected]>; [email protected]; Arc Sung <[email protected]>; dri-devel <[email protected]>; Tommy Huang <[email protected]>
Subject: Re: [PATCH] drm/ast: Avoid to access BMC addressing when P2A is disabled

Hi

Quoted 3 lines · Kuo-Hsiang Chou

To Sirs,

Thanks for your answers about the patch and next upstream to kernel-5.9 must follow these rules.

Thanks for wanting to contribute.

Quoted 5 lines

This patch based on kernel-4.9.237 is required by our customers, because my customers said the native kernel of RHEL/CentOS 7.x is 3.10 and is required to update to 4.9.

BTW, how to verify the correctness before upstream my patch . As I known, the kernel version of RHEL8.2 is v4.18, so I need to update the kernel to v5.9 by myself, right? Or should I test my patch on Fedora-rawhide whose kernel is v5.10.0?

v4.9 is way too old for active development. DRM drivers are developed in drm-tip, which is available at

git://anongit.freedesktop.org/drm/drm-tip

It usually contains the latest Linux kernel plus graphics drivers. Patches merged into DRM move into the official Linux kernel within 2 to 3 months. From there, bug fixes move into the older versions, such as v4.9.

I know that this looks like overhead in the short term. But long-term your customers will again update their kernels and then you already have the necessary changes available and merged.

To get started, I'd advice to get the kernel in the drm-tip git repo and build it on your distribution (RHEL/CentOS). That should still be possible. Then recreate the individual changes on top of the most recent version. Each change has to go into it's own commit with a nice commit message.

And that's it basically. Once you have the changes ready, you can send them out for review.

Best regards
Thomas

Quoted 63 lines

Regards and have a good day,
Kuo-Hsiang Chou

-----Original Message-----
From: Thomas Zimmermann [mailto:[email protected]]
Sent: Monday, October 19, 2020 3:08 PM
To: David Airlie <[email protected]>; Kuo-Hsiang Chou <[email protected]>
Cc: Jenmin Yuan <[email protected]>; [email protected]; Arc Sung <[email protected]>; dri-devel <[email protected]>; Tommy Huang <[email protected]>
Subject: Re: [PATCH] drm/ast: Avoid to access BMC addressing when P2A is disabled

Hi

Quoted 16 lines · David Airlie
Quoted 7 lines · KuoHsiang Chou

The patch is upstreamed
1. For RHEL7.x, because its native kernel is suggested to update

    from 3.10 to 4.9 on 2 ODM's platform.

2. For AST2600.
3. For ASTDP.
4. v1.11

Hi,

I've cc'ed Thomas who is maintaining this upstream, but this patch in it's current form isn't acceptable, Maybe Thomas can provide more detailed info, but the basic rules are

Quoted 6 lines

One patch should do one thing.
Patches should be bisectable so any issues can be tracked down easier. Fixes should be separated from new code.
New features and chip support should be separate.

https://www.kernel.org/doc/html/v5.9/process/submitting-patches.html

Please follow this document when submitting patches.

Quoted 3 lines

Please maybe work with Thomas on having a better upstream development process for ast chipsets.

I'd welcome more support and contributions from Aspeed developers. But in its current form, the patch is not acceptable.

Best regards
Thomas

Quoted 9 lines

Thanks,
Dave.

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 7 lines

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel