drm/ast: Disable fast reset after DRAM initial
Subsystems (3)
PATCH 1/1 drm/ast: Disable fast reset after DRAM initial
[Bug][AST2500]
When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode.
--- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 4 ++ drivers/gpu/drm/ast/ast_post.c | 72 ++++++++++++++++++++++------------ 3 files changed, 51 insertions(+), 26 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +1 -0
@@ -320,6 +320,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 */ void ast_set_dp501_video_output (struct drm_device *dev,u8 mode);bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size);
drivers/gpu/drm/ast/ast_main.c +4 -0
@@ -96,6 +96,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); jregd1 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd1 ,0xff );if (!(jregd0 &0x80 ) || !(jregd1 &0x10 )) { +/* Patch AST2500 */ +if (((dev->pdev->revision &0xF0 ) ==0x40 ) && ((jregd0 &0xC0 ) ==0 )) +patch_ahb_ast2500 (ast); +/* Double check it's actually working */ data =ast_read32 (ast,0xf004 );if (data !=0xFFFFFFFF ) {
drivers/gpu/drm/ast/ast_post.c +46 -26
91 lines not on this page · raw message
--
2.18.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerHi
Am 11.01.21 um 07:43 schrieb KuoHsiang Chou:
Quoted 20 lines
[Bug][AST2500]
When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode.Signed-off-by KuoHsiang Chou <[email protected]>--- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 4 ++ drivers/gpu/drm/ast/ast_post.c | 72 ++++++++++++++++++++++------------ 3 files changed, 51 insertions(+), 26 deletions(-)drivers/gpu/drm/ast/ast_drv.h +0
-0
drivers/gpu/drm/ast/ast_drv.h bool ast_is_vga_enabled(struct drm_device *dev); · line 323
Quoted 4 lines
drivers/gpu/drm/ast/ast_drv.h +1
-0@@ -320,6 +320,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);
The function name should be named ast_patch_ahb_2500() because it's not static.
drivers/gpu/drm/ast/ast_main.c static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) · line 100
Quoted 13 lines
drivers/gpu/drm/ast/ast_drv.h +0
-0/* ast dp501 */ void ast_set_dp501_video_output (struct drm_device *dev,u8 mode);bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size);drivers/gpu/drm/ast/ast_main.c +2
-0@@ -96,6 +96,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); jregd1 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd1 ,0xff );if (!(jregd0 &0x80 ) || !(jregd1 &0x10 )) { +/* Patch AST2500 */ +if (((dev->pdev->revision &0xF0 ) ==0x40 ) && ((jregd0 &0xC0 ) ==0 ))
The field dev->pdev is considered deprecated. Instead, you can get the CP device from dev->dev like this
struct pci_dev *pdev = to_pci_dev(dev->dev);
It's the same instance, but dev->pdev will removed soon.
Quoted 71 lines
drivers/gpu/drm/ast/ast_main.c +2
-0+patch_ahb_ast2500 (ast); +/* Double check it's actually working */ data =ast_read32 (ast,0xf004 );if (data !=0xFFFFFFFF ) {drivers/gpu/drm/ast/ast_post.c +36
-14@@ -2026,6 +2026,33 @@ static bool ast_dram_init_2500(struct ast_private *ast)return true; } +void patch_ahb_ast2500 (struct ast_private *ast) +{ +u32 data; + +patch_ahb_lock: +/* Clear bus lock condition */ +ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); +ast_moutdwm (ast,0x1e600084 ,0x00010000 ); +ast_moutdwm (ast,0x1e600088 ,0x00000000 ); +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); + data =ast_mindwm (ast,0x1e6e2070 ); +if (data &0x08000000 ) {/* check fast reset */ + +ast_moutdwm (ast,0x1E785004 ,0x00000010 ); +ast_moutdwm (ast,0x1E785008 ,0x00004755 ); +ast_moutdwm (ast,0x1E78500c ,0x00000033 ); +udelay (1000 ); + } +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); +do { + data =ast_mindwm (ast,0x1e6e2000 ); +if (data ==0xffffffff ) + goto patch_ahb_lock; + }while (data !=1 ); +ast_moutdwm (ast,0x1e6e207c ,0x08000000 );/* clear fast reset */ +} +void ast_post_chip_2500 (struct drm_device *dev) {struct ast_private *ast =to_ast_private (dev);@@ -2033,39 +2060,32 @@ void ast_post_chip_2500(struct drm_device *dev)u8 reg; reg =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); -if ((reg &0x80 ) ==0 ) {/* vga only */ +if ((reg &0xC0 ) ==0 ) {/* vga only */ /* Clear bus lock condition */ -ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); -ast_moutdwm (ast,0x1e600084 ,0x00010000 ); -ast_moutdwm (ast,0x1e600088 ,0x00000000 ); -ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); -ast_write32 (ast,0xf004 ,0x1e6e0000 ); -ast_write32 (ast,0xf000 ,0x1 ); -ast_write32 (ast,0x12000 ,0x1688a8a8 ); -while (ast_read32 (ast,0x12000 ) !=0x1 ) - ; - -ast_write32 (ast,0x10000 ,0xfc600309 ); -while (ast_read32 (ast,0x10000 ) !=0x1 ) - ; +patch_ahb_ast2500 (ast); + +/* Disable watchdog */ +ast_moutdwm (ast,0x1E78502C ,0x00000000 ); +ast_moutdwm (ast,0x1E78504C ,0x00000000 ); +/* Reset USB port */ +ast_moutdwm (ast,0x1E6E2090 ,0x20000000 );/* add at V1.2 */ +ast_moutdwm (ast,0x1E6E2094 ,0x00004000 );/* add at V1.2 */
drivers/gpu/drm/ast/ast_post.c void ast_post_chip_2500(struct drm_device *dev) · line 2082
Quoted 10 lines
drivers/gpu/drm/ast/ast_post.c +10
-0+if (ast_mindwm (ast,0x1E6E2070 ) &0x00800000 ) {/* add at V1.2 */ +ast_moutdwm (ast,0x1E6E207C ,0x00800000 );/* add at V1.2 */ +mdelay (100 );/* add at V1.2 */ +ast_moutdwm (ast,0x1E6E2070 ,0x00800000 );/* add at V1.2 */ + }/* add at V1.2 */ +/* Modify eSPI reset pin */ + temp =ast_mindwm (ast,0x1E6E2070 );/* add at V1.3 */ +if (temp &0x02000000 ) {/* add at V1.3 */ +ast_moutdwm (ast,0x1E6E207C ,0x00004000 );/* add at V1.3 */ + }
Do these v1.2 and v1.3 code paths not need a version check in the code?
Best regards
Thomas
Quoted 29 lines
drivers/gpu/drm/ast/ast_post.c +0
-13/* Slow down CPU/AHB CLK in VGA only mode */ temp =ast_read32 (ast,0x12008 ); temp |=0x73 ;ast_write32 (ast,0x12008 , temp); -/* Reset USB port to patch USB unknown device issue */ -ast_moutdwm (ast,0x1e6e2090 ,0x20000000 ); - temp =ast_mindwm (ast,0x1e6e2094 ); - temp |=0x00004000 ; -ast_moutdwm (ast,0x1e6e2094 , temp); - temp =ast_mindwm (ast,0x1e6e2070 ); -if (temp &0x00800000 ) { -ast_moutdwm (ast,0x1e6e207c ,0x00800000 ); -mdelay (100 ); -ast_moutdwm (ast,0x1e6e2070 ,0x00800000 ); - } -if (!ast_dram_init_2500 (ast))drm_err (dev,"DRAM init failed !\n" ); --2.18.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 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
PATCH v2 1/1 drm/ast: Disable fast reset after DRAM initial
[Bug][AST2500]
V1:
When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode.
V2:
Use to_pci_dev() to get revision of PCI configuration.
--- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 5 +++ drivers/gpu/drm/ast/ast_post.c | 71 +++++++++++++++++++++------------- 3 files changed, 51 insertions(+), 26 deletions(-)
drivers/gpu/drm/ast/ast_drv.h +1 -0
@@ -320,6 +320,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 ast_patch_ahb_2500 (struct ast_private *ast);/* ast dp501 */ void ast_set_dp501_video_output (struct drm_device *dev,u8 mode);bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size);
drivers/gpu/drm/ast/ast_main.c +5 -0
@@ -69,6 +69,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) {struct device_node *np = dev->pdev->dev.of_node;struct ast_private *ast =to_ast_private (dev); +struct pci_dev *pdev =to_pci_dev (dev->dev);uint32_t data, jregd0, jregd1;/* Defaults */
@@ -96,6 +97,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); jregd1 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd1 ,0xff );if (!(jregd0 &0x80 ) || !(jregd1 &0x10 )) { +/* Patch AST2500 */ +if (((pdev->revision &0xF0 ) ==0x40 ) && ((jregd0 &0xC0 ) ==0 )) +ast_patch_ahb_2500 (ast); +/* Double check it's actually working */ data =ast_read32 (ast,0xf004 );if (data !=0xFFFFFFFF ) {
drivers/gpu/drm/ast/ast_post.c +45 -26
90 lines not on this page · raw message
--
2.18.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thomas Zimmermann
maintainerHi
Am 12.01.21 um 08:58 schrieb KuoHsiang Chou:
Quoted 120 lines
[Bug][AST2500]
V1:
When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode.V2:
Useto_pci_dev()to get revision of PCI configuration.Signed-off-by KuoHsiang Chou <[email protected]>--- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 5 +++ drivers/gpu/drm/ast/ast_post.c | 71 +++++++++++++++++++++------------- 3 files changed, 51 insertions(+), 26 deletions(-)drivers/gpu/drm/ast/ast_drv.h +1
-0@@ -320,6 +320,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 ast_patch_ahb_2500 (struct ast_private *ast);/* ast dp501 */ void ast_set_dp501_video_output (struct drm_device *dev,u8 mode);bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size);drivers/gpu/drm/ast/ast_main.c +5
-0@@ -69,6 +69,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) {struct device_node *np = dev->pdev->dev.of_node;struct ast_private *ast =to_ast_private (dev); +struct pci_dev *pdev =to_pci_dev (dev->dev);uint32_t data, jregd0, jregd1;/* Defaults */ @@ -96,6 +97,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); jregd1 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd1 ,0xff );if (!(jregd0 &0x80 ) || !(jregd1 &0x10 )) { +/* Patch AST2500 */ +if (((pdev->revision &0xF0 ) ==0x40 ) && ((jregd0 &0xC0 ) ==0 )) +ast_patch_ahb_2500 (ast); +/* Double check it's actually working */ data =ast_read32 (ast,0xf004 );if (data !=0xFFFFFFFF ) {drivers/gpu/drm/ast/ast_post.c +35
-14@@ -2026,6 +2026,33 @@ static bool ast_dram_init_2500(struct ast_private *ast)return true; } +void ast_patch_ahb_2500 (struct ast_private *ast) +{ +u32 data; + +patch_ahb_lock: +/* Clear bus lock condition */ +ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); +ast_moutdwm (ast,0x1e600084 ,0x00010000 ); +ast_moutdwm (ast,0x1e600088 ,0x00000000 ); +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); + data =ast_mindwm (ast,0x1e6e2070 ); +if (data &0x08000000 ) {/* check fast reset */ + +ast_moutdwm (ast,0x1E785004 ,0x00000010 ); +ast_moutdwm (ast,0x1E785008 ,0x00004755 ); +ast_moutdwm (ast,0x1E78500c ,0x00000033 ); +udelay (1000 ); + } +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); +do { + data =ast_mindwm (ast,0x1e6e2000 ); +if (data ==0xffffffff ) + goto patch_ahb_lock; + }while (data !=1 ); +ast_moutdwm (ast,0x1e6e207c ,0x08000000 );/* clear fast reset */ +} +void ast_post_chip_2500 (struct drm_device *dev) {struct ast_private *ast =to_ast_private (dev);@@ -2033,39 +2060,31 @@ void ast_post_chip_2500(struct drm_device *dev)u8 reg; reg =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); -if ((reg &0x80 ) ==0 ) {/* vga only */ +if ((reg &0xC0 ) ==0 ) {/* vga only */ /* Clear bus lock condition */ -ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); -ast_moutdwm (ast,0x1e600084 ,0x00010000 ); -ast_moutdwm (ast,0x1e600088 ,0x00000000 ); -ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); -ast_write32 (ast,0xf004 ,0x1e6e0000 ); -ast_write32 (ast,0xf000 ,0x1 ); -ast_write32 (ast,0x12000 ,0x1688a8a8 ); -while (ast_read32 (ast,0x12000 ) !=0x1 ) - ; - -ast_write32 (ast,0x10000 ,0xfc600309 ); -while (ast_read32 (ast,0x10000 ) !=0x1 ) - ; +ast_patch_ahb_2500 (ast); + +/* Disable watchdog */ +ast_moutdwm (ast,0x1E78502C ,0x00000000 ); +ast_moutdwm (ast,0x1E78504C ,0x00000000 ); +/* Reset USB port */ +ast_moutdwm (ast,0x1E6E2090 ,0x20000000 );
drivers/gpu/drm/ast/ast_post.c void ast_post_chip_2500(struct drm_device *dev) · line 2081
Quoted 10 lines
drivers/gpu/drm/ast/ast_post.c +10
-0+ast_moutdwm (ast,0x1E6E2094 ,0x00004000 ); +if (ast_mindwm (ast,0x1E6E2070 ) &0x00800000 ) { +ast_moutdwm (ast,0x1E6E207C ,0x00800000 ); +mdelay (100 ); +ast_moutdwm (ast,0x1E6E2070 ,0x00800000 ); + } +/* Modify eSPI reset pin */ + temp =ast_mindwm (ast,0x1E6E2070 ); +if (temp &0x02000000 ) +ast_moutdwm (ast,0x1E6E207C ,0x00004000 );
Instead of answering my question, you simply deleted the comments. It doesn't work like that.
Best regards
Thomas
Quoted 29 lines
drivers/gpu/drm/ast/ast_post.c +0
-13/* Slow down CPU/AHB CLK in VGA only mode */ temp =ast_read32 (ast,0x12008 ); temp |=0x73 ;ast_write32 (ast,0x12008 , temp); -/* Reset USB port to patch USB unknown device issue */ -ast_moutdwm (ast,0x1e6e2090 ,0x20000000 ); - temp =ast_mindwm (ast,0x1e6e2094 ); - temp |=0x00004000 ; -ast_moutdwm (ast,0x1e6e2094 , temp); - temp =ast_mindwm (ast,0x1e6e2070 ); -if (temp &0x00800000 ) { -ast_moutdwm (ast,0x1e6e207c ,0x00800000 ); -mdelay (100 ); -ast_moutdwm (ast,0x1e6e2070 ,0x00800000 ); - } -if (!ast_dram_init_2500 (ast))drm_err (dev,"DRAM init failed !\n" ); --2.18.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 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
-----Original Message-----
From: Thomas Zimmermann [mailto:[email protected]]
Sent: Monday, January 18, 2021 5:06 PM
To: Kuo-Hsiang Chou <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH v2] drm/ast: Disable fast reset after DRAM initial
Hi, Thomas,
Hi
Am 12.01.21 um 08:58 schrieb KuoHsiang Chou:
Quoted 122 lines
[Bug][AST2500]
V1:
When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode.V2:
Useto_pci_dev()to get revision of PCI configuration.Signed-off-by KuoHsiang Chou <[email protected]>--- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 5 +++ drivers/gpu/drm/ast/ast_post.c | 71 +++++++++++++++++++++------------- 3 files changed, 51 insertions(+), 26 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/ast/ast_drv.hindexda6dfb677540..a2cf5fef2399100644drivers/gpu/drm/ast/ast_drv.h +1
-1@@ -320,6 +320,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 ast_patch_ahb_2500 (struct ast_private *ast);/* ast dp501 */ void ast_set_dp501_video_output (struct drm_device *dev,u8 mode);bool ast_backup_fw (struct drm_device *dev,u8 *addr,u32 size); diff --git a/drivers/gpu/drm/ast/ast_main.c
b/drivers/gpu/drm/ast/ast_main.cindex3775fe26f792..0e4dfcc25623100644drivers/gpu/drm/ast/ast_main.c +5
-0@@ -69,6 +69,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) {struct device_node *np = dev->pdev->dev.of_node;struct ast_private *ast =to_ast_private (dev); +struct pci_dev *pdev =to_pci_dev (dev->dev);uint32_t data, jregd0, jregd1;/* Defaults */ @@ -96,6 +97,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd0 ,0xff ); jregd1 =ast_get_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xd1 ,0xff );if (!(jregd0 &0x80 ) || !(jregd1 &0x10 )) { +/* Patch AST2500 */ +if (((pdev->revision &0xF0 ) ==0x40 ) && ((jregd0 &0xC0 ) ==0 )) +ast_patch_ahb_2500 (ast); +/* Double check it's actually working */ data =ast_read32 (ast,0xf004 );if (data !=0xFFFFFFFF ) {(quoted diff) +0
-0
b/drivers/gpu/drm/ast/ast_post.cindex8902c2f84bf9..1f0007daa005100644drivers/gpu/drm/ast/ast_post.c +26
-0@@ -2026,6 +2026,33 @@ static bool ast_dram_init_2500(struct ast_private *ast)return true; } +void ast_patch_ahb_2500 (struct ast_private *ast) { +u32 data; + +patch_ahb_lock: +/* Clear bus lock condition */ +ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); +ast_moutdwm (ast,0x1e600084 ,0x00010000 ); +ast_moutdwm (ast,0x1e600088 ,0x00000000 ); +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); + data =ast_mindwm (ast,0x1e6e2070 ); +if (data &0x08000000 ) {/* check fast reset */ + +ast_moutdwm (ast,0x1E785004 ,0x00000010 ); +ast_moutdwm (ast,0x1E785008 ,0x00004755 ); +ast_moutdwm (ast,0x1E78500c ,0x00000033 ); +udelay (1000 ); + } +ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); +do { + data =ast_mindwm (ast,0x1e6e2000 ); +if (data ==0xffffffff ) + goto patch_ahb_lock; + }while (data !=1 ); +ast_moutdwm (ast,0x1e6e207c ,0x08000000 );/* clear fast reset */ +} +void ast_post_chip_2500 (struct drm_device *dev) { struct ast_private *ast = to_ast_private(dev); @@ -2033,39 +2060,31@@ void
ast_post_chip_2500(struct drm_device *dev)
u8 reg;reg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff);drivers/gpu/drm/ast/ast_post.c +8
-14-if ((reg &0x80 ) ==0 ) {/* vga only */ +if ((reg &0xC0 ) ==0 ) {/* vga only */ /* Clear bus lock condition */ -ast_moutdwm (ast,0x1e600000 ,0xAEED1A03 ); -ast_moutdwm (ast,0x1e600084 ,0x00010000 ); -ast_moutdwm (ast,0x1e600088 ,0x00000000 ); -ast_moutdwm (ast,0x1e6e2000 ,0x1688A8A8 ); -ast_write32 (ast,0xf004 ,0x1e6e0000 ); -ast_write32 (ast,0xf000 ,0x1 ); -ast_write32 (ast,0x12000 ,0x1688a8a8 ); -while (ast_read32 (ast,0x12000 ) !=0x1 ) - ; - -ast_write32 (ast,0x10000 ,0xfc600309 ); -while (ast_read32 (ast,0x10000 ) !=0x1 ) - ; +ast_patch_ahb_2500 (ast); + +/* Disable watchdog */ +ast_moutdwm (ast,0x1E78502C ,0x00000000 ); +ast_moutdwm (ast,0x1E78504C ,0x00000000 ); +/* Reset USB port */ +ast_moutdwm (ast,0x1E6E2090 ,0x20000000 );
drivers/gpu/drm/ast/ast_post.c void ast_post_chip_2500(struct drm_device *dev) · line 2081
Quoted 10 lines
drivers/gpu/drm/ast/ast_post.c +10
-0+ast_moutdwm (ast,0x1E6E2094 ,0x00004000 ); +if (ast_mindwm (ast,0x1E6E2070 ) &0x00800000 ) { +ast_moutdwm (ast,0x1E6E207C ,0x00800000 ); +mdelay (100 ); +ast_moutdwm (ast,0x1E6E2070 ,0x00800000 ); + } +/* Modify eSPI reset pin */ + temp =ast_mindwm (ast,0x1E6E2070 ); +if (temp &0x02000000 ) +ast_moutdwm (ast,0x1E6E207C ,0x00004000 );
Instead of answering my question, you simply deleted the comments. It doesn't work like that.
My bad!
About to /* add at V1.2 */ and /* add at V1.3 */, the comments should be some marks of recommendations came from HW designer. Therefore, I thought this kind of comments could be deleted directly.
Sorry for my poor English, so that the biggest error is that I misunderstood your question likes a sentence of "why not ....". Should I recover the comments? Thanks!
Best Regards,
Kuo-Hsiang Chou
Best regards
Thomas
Quoted 24 lines
/* Slow down CPU/AHB CLK in VGA only mode */ temp = ast_read32(ast, 0x12008); temp |= 0x73; ast_write32(ast, 0x12008, temp);drivers/gpu/drm/ast/ast_post.c +0
-13-/* Reset USB port to patch USB unknown device issue */ -ast_moutdwm (ast,0x1e6e2090 ,0x20000000 ); - temp =ast_mindwm (ast,0x1e6e2094 ); - temp |=0x00004000 ; -ast_moutdwm (ast,0x1e6e2094 , temp); - temp =ast_mindwm (ast,0x1e6e2070 ); -if (temp &0x00800000 ) { -ast_moutdwm (ast,0x1e6e207c ,0x00800000 ); -mdelay (100 ); -ast_moutdwm (ast,0x1e6e2070 ,0x00800000 ); - } -if (!ast_dram_init_2500 (ast))drm_err (dev,"DRAM init failed !\n" ); --2.18.4
Quoted 5 lines
_______________________________________________
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