ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disable
Subsystems (3)
PATCH 1/2 ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disable
On Gen5, the 'bridge disable' command write 0x0 to brgmodrst register, which releases all bridges from reset, instead of putting all bridges into reset. Fix this by inverting the mask and actually putting the bridges into reset.
--- arch/arm/mach-socfpga/misc_gen5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-socfpga/misc_gen5.c +1 -1
@@ -231,7 +231,7 @@ void do_bridge_reset(int enable, unsigned int mask) }else {writel (0 , &sysmgr_regs->fpgaintfgrp_module);writel (0 , &sdr_ctrl->fpgaport_rst); -writel (0 , &reset_manager_base->brg_mod_reset); +writel (0x7 , &reset_manager_base->brg_mod_reset);writel (1 , &nic301_regs->remap); } }
Signature · 1 line
2.24.0.432.g9d3f5f5b63
PATCH 2/2 ARM: socfpga: Purge pending transactions upon enabling bridges on Gen5
On Gen5, when the FPGA is loaded and there was some prior interaction between the HPS and the FPGA via bridges (e.g. Linux was running and using some of the IPs in the FPGA) followed by warm reset, it has been observed that there might be outstanding unfinished transactions. This leads to an obscure misbehavior of the bridge.
When the bridge is enabled again in U-Boot and there are outstanding transactions, a read from within the bridge address range would return a result of the previous read instead. Example:
=> bridge enable ; md 0xff200000 1ff200000: 1234abcd
=> bridge enable ; md 0xff200010 1ff200010: 5678dcba <------- this is in fact a value which is stored in
a memory@0xff200000
=> bridge enable ; md 0xff200000 1
ff200000: 90effe09 <------- this is in fact a value which is stored in
a memory at 0xff200010and so it continues. Issuing a write does lock the system up completely.
This patch opens the FPGA bridges in 'bridge enable' command, the tears them down again, and then opens them again. This allows these outstanding transactions to complete and makes this misbehavior go away.
However, it is not entirely clear whether this is the correct solution.
--- arch/arm/mach-socfpga/misc_gen5.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc_gen5.c +3 -0
@@ -228,6 +228,9 @@ void do_bridge_reset(int enable, unsigned int mask)writel (iswgrp_handoff[3 ], &sdr_ctrl->fpgaport_rst);writel (iswgrp_handoff[0 ], &reset_manager_base->brg_mod_reset);writel (iswgrp_handoff[1 ], &nic301_regs->remap); + +writel (0x7 , &reset_manager_base->brg_mod_reset); +writel (iswgrp_handoff[0 ], &reset_manager_base->brg_mod_reset); }else {writel (0 , &sysmgr_regs->fpgaintfgrp_module);writel (0 , &sdr_ctrl->fpgaport_rst);
Signature · 1 line
2.24.0.432.g9d3f5f5b63
Tan
PATCH 2/2 ARM: socfpga: Purge pending transactions upon enabling bridges on Gen5
Quoted 39 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, November 21, 2019 5:35 AM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; See, Chin Liang <[email protected]>; Dalon Westergreen <[email protected]>; Dinh Nguyen <[email protected]>; Tan, Ley Foon <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>
Subject: [PATCH 2/2] ARM: socfpga: Purge pending transactions upon enabling bridges on Gen5On Gen5, when the FPGA is loaded and there was some prior interaction between the HPS and the FPGA via bridges (e.g. Linux was running and using some of the IPs in the FPGA) followed by warm reset, it has been observed that there might be outstanding unfinished transactions. This leads to an obscure misbehavior of the bridge.
When the bridge is enabled again in U-Boot and there are outstanding transactions, a read from within the bridge address range would return a result of the previous read instead. Example:
=> bridge enable ; md0xff2000001ff200000:1234abcd
=> bridge enable ; md0xff2000101ff200010:5678dcba<------- this is in fact a value which is stored ina memory at 0xff200000 => bridge enable ; md 0xff200000 1 ff200000: 90effe09 <------- this is in fact a value which is stored in a memory at 0xff200010 and so it continues. Issuing a writedoes lock the system up completely.
This patch opens the FPGA bridges in 'bridge enable' command, the tears them down again, and then opens them again. This allows these outstanding transactions to complete and makes this misbehavior go away.
However, it is not entirely clear whether this is the correct solution.
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dalon Westergreen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Ley Foon Tan <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>
Regards
Ley Foon
PATCH 2/2 ARM: socfpga: Purge pending transactions upon enabling bridges on Gen5
On 11/21/19 10:59 AM, Tan, Ley Foon wrote:
[...]
Hi,
Quoted 35 lines
Quoted 27 lines
Subject: [PATCH 2/2] ARM: socfpga: Purge pending transactions upon enabling bridges on Gen5
On Gen5, when the FPGA is loaded and there was some prior interaction between the HPS and the FPGA via bridges (e.g. Linux was running and using some of the IPs in the FPGA) followed by warm reset, it has been observed that there might be outstanding unfinished transactions. This leads to an obscure misbehavior of the bridge.
When the bridge is enabled again in U-Boot and there are outstanding transactions, a read from within the bridge address range would return a result of the previous read instead. Example:
=> bridge enable ; md0xff2000001ff200000:1234abcd
=> bridge enable ; md0xff2000101ff200010:5678dcba<------- this is in fact a value which is stored ina memory at 0xff200000 => bridge enable ; md 0xff200000 1 ff200000: 90effe09 <------- this is in fact a value which is stored in a memory at 0xff200010 and so it continues. Issuing a writedoes lock the system up completely.
This patch opens the FPGA bridges in 'bridge enable' command, the tears them down again, and then opens them again. This allows these outstanding transactions to complete and makes this misbehavior go away.
However, it is not entirely clear whether this is the correct solution.
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dalon Westergreen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Ley Foon Tan <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>
Quoted 1 line
Reviewed-by Ley Foon Tan <[email protected]>
Do you think there is anyone still at Altera/intel who might be able to tell us what this problem really is about ? And whether there is some way to purge those stuck transactions without turning the bridges on and off and then on again ? Or whether there is a way to even verify there are stuck transactions ?
Signature · 2 lines
Best regards, Marek Vasut
Tan
PATCH 1/2 ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disable
In reply to Marek VasutQuoted 19 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, November 21, 2019 5:35 AM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; See, Chin Liang <[email protected]>; Dalon Westergreen <[email protected]>; Dinh Nguyen <[email protected]>; Tan, Ley Foon <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>
Subject: [PATCH 1/2] ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disableOn Gen5, the 'bridge disable' command write
0x0to brgmodrst register, which releases all bridges from reset, instead of putting all bridges into reset. Fix this by inverting the mask and actually putting the bridges into reset.
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dalon Westergreen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Ley Foon Tan <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>
Quoted 20 lines
--- arch/arm/mach-socfpga/misc_gen5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach- renamed from arch/arm/mach-socfpga/misc_gen5.c +0
-0
socfpga/misc_gen5.c
index31681b799d..36f00aee31100644arch/arm/mach-socfpga/misc_gen5.c +1
-2@@ -231,7 +231,7 @@ void do_bridge_reset(int enable, unsigned int mask) }else {writel (0 , &sysmgr_regs->fpgaintfgrp_module);writel (0 , &sdr_ctrl->fpgaport_rst); -writel (0 , &reset_manager_base->brg_mod_reset); +writel (0x7 , &reset_manager_base->brg_mod_reset);writel (1 , &nic301_regs->remap); } } --2.24.0.432.g9d3f5f5b63
PATCH 1/2 ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disable
Quoted 16 lines · Ley Foon
Quoted 16 lines
-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, November 21, 2019 5:35 AM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; See, Chin Liang <[email protected]>; Dalon Westergreen <[email protected]>; Dinh Nguyen <[email protected]>; Tan, Ley Foon <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>
Subject: [PATCH 1/2] ARM: socfpga: Actually put bridges into reset on Gen5 in bridge disable
Quoted 3 lines
Quoted 3 lines
On Gen5, the 'bridge disable' command write
0x0to brgmodrst register, which releases all bridges from reset, instead of putting all bridges into reset. Fix this by inverting the mask and actually putting the bridges into reset.
Haha, I didn't notice that as I only used 'bridge enable' so far :-)
Quoted 32 lines
Quoted 8 lines
Signed-off-by Marek Vasut <[email protected]>Cc Chin Liang See <[email protected]>Cc Dalon Westergreen <[email protected]>Cc Dinh Nguyen <[email protected]>Cc Ley Foon Tan <[email protected]>Cc Simon Goldschmidt <[email protected]>Cc Tien Fong Chee <[email protected]>Reviewed-by Ley Foon Tan <[email protected]>Quoted 20 lines
--- arch/arm/mach-socfpga/misc_gen5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach- renamed from arch/arm/mach-socfpga/misc_gen5.c +0
-0
socfpga/misc_gen5.c
index31681b799d..36f00aee31100644arch/arm/mach-socfpga/misc_gen5.c +1
-2@@ -231,7 +231,7 @@ void do_bridge_reset(int enable, unsigned int mask) }else {writel (0 , &sysmgr_regs->fpgaintfgrp_module);writel (0 , &sdr_ctrl->fpgaport_rst); -writel (0 , &reset_manager_base->brg_mod_reset); +writel (0x7 , &reset_manager_base->brg_mod_reset);writel (1 , &nic301_regs->remap); } } --2.24.0.432.g9d3f5f5b63