File tree 2 files changed +0
-24
lines changed
2 files changed +0
-24
lines changed Original file line number Diff line number Diff line change 6
6
#include "rp2_psram.h"
7
7
8
8
9
- void __no_inline_not_in_flash_func (psram_set_qmi_timing )() {
10
- // Make sure flash is deselected - QMI doesn't appear to have a busy flag(!)
11
- while ((ioqspi_hw -> io [1 ].status & IO_QSPI_GPIO_QSPI_SS_STATUS_OUTTOPAD_BITS ) != IO_QSPI_GPIO_QSPI_SS_STATUS_OUTTOPAD_BITS ) {
12
- ;
13
- }
14
-
15
- // Use the minimum divisor assuming a 133MHz flash.
16
- // RX delay equal to the divisor means sampling at the same time as the next falling edge of SCK after the
17
- // falling edge that generated the data. This is pretty tight at 133MHz but seems to work with the Winbond flash chips.
18
- const int max_flash_freq = 133000000 ;
19
- const int divisor = (clock_get_hz (clk_sys ) + max_flash_freq - 1 ) / max_flash_freq ;
20
- const int rxdelay = divisor ;
21
- qmi_hw -> m [0 ].timing = (1 << QMI_M0_TIMING_COOLDOWN_LSB ) |
22
- rxdelay << QMI_M1_TIMING_RXDELAY_LSB |
23
- divisor << QMI_M1_TIMING_CLKDIV_LSB ;
24
-
25
- // Force a read through XIP to ensure the timing is applied
26
- volatile uint32_t * ptr = (volatile uint32_t * )0x14000000 ;
27
- (void )* ptr ;
28
- }
29
-
30
9
size_t __no_inline_not_in_flash_func (psram_detect )() {
31
10
int psram_size = 0 ;
32
11
@@ -110,8 +89,6 @@ size_t __no_inline_not_in_flash_func(psram_init)(uint cs_pin) {
110
89
return 0 ;
111
90
}
112
91
113
- psram_set_qmi_timing ();
114
-
115
92
// Enable direct mode, PSRAM CS, clkdiv of 10.
116
93
qmi_hw -> direct_csr = 10 << QMI_DIRECT_CSR_CLKDIV_LSB | \
117
94
QMI_DIRECT_CSR_EN_BITS | \
Original file line number Diff line number Diff line change 5
5
6
6
#define PSRAM_LOCATION _u(0x11000000)
7
7
8
- extern void psram_set_qmi_timing ();
9
8
extern size_t psram_init (uint cs_pin );
10
9
11
10
#endif
You can’t perform that action at this time.
0 commit comments