]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
tcl/target/rp2350: workarounds for ROM API issues
authorTomas Vanek <vanekt@fbl.cz>
Tue, 13 Aug 2024 14:23:20 +0000 (16:23 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Fri, 25 Apr 2025 09:35:37 +0000 (09:35 +0000)
A0 chip: remove pad isolation
A2 chip: instead of reset init fixes we will fix the flash driver
with the following patch by Luke Wren:
8729: flash/nor/rp2xxx: fix flash operation after halt in RISC-V bootsel
https://review.openocd.org/c/openocd/+/8729

I don't have A1 version to test.

Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Change-Id: I9e9fab04ead929fe6e0a17c6c2f32a6f02e9beb9
Reviewed-on: https://review.openocd.org/c/openocd/+/8450
Tested-by: jenkins
tcl/target/rp2350.cfg

index 775561f062a3210c7de38c8f81c15a9246dff1e2..d2465bd2fea0d2ddb5097b6ecc2aa5587bad1789 100644 (file)
@@ -94,8 +94,7 @@ if { [info exists _TARGETNAME_RV0] } {
        target create $_TARGETNAME_RV0 riscv -dap $_CHIPNAME.dap -ap-num 0xa000 -coreid 0
        $_TARGETNAME_RV0 riscv set_enable_virt2phys off
 
-       # Workaround for stray IO_QSPI: GPIO_QSPI_SD1_CTRL: INOVER bit in RISC-V BOOTSEL
-       $_TARGETNAME_RV0 configure -event reset-init { mww 0x4003002c 0 }
+       $_TARGETNAME_RV0 configure -event reset-init "_rv_reset_init"
 
        if { [info exists _TARGETNAME_CM0] } {
                # just for setting after init when the event become-available is not fired
@@ -204,3 +203,22 @@ if { $_RESCUE } {
        init
        rescue_reset
 }
+
+proc _rv_reset_init { } {
+       set chip_id [format 0x%08x [read_memory 0x40000000 32 1]]
+
+       # Version related workarounds
+       switch $chip_id {
+               0x00004927 { # A0
+                       # remove IO_QSPI isolation
+                       mww 0x40030014 0
+                       mww 0x4003001c 0
+                       mww 0x40030024 0
+                       mww 0x4003002c 0
+                       mww 0x40030034 0
+                       mww 0x4003003c 0
+               }
+       }
+
+       rp2xxx rom_api_call FC
+}