|
44 | 44 | #include "xzynq_gqspi.h" |
45 | 45 | #endif |
46 | 46 |
|
47 | | -#define CORTEXA53_0_CPU_CLK_FREQ_HZ 1099989014 |
| 47 | +#define CORTEXA53_0_CPU_CLK_FREQ_HZ 1099989014 |
48 | 48 | #define CORTEXA53_0_TIMESTAMP_CLK_FREQ 99998999 |
49 | 49 |
|
50 | 50 | /* Generic Quad-SPI */ |
|
149 | 149 | #define QSPIDMA_DST_CTRL2_DEF 0x081BFFF8UL |
150 | 150 |
|
151 | 151 | /* QSPIDMA_DST_STS */ |
152 | | -#define QSPIDMA_DST_STS_WTC 0xE000U |
| 152 | +#define QSPIDMA_DST_STS_WTC 0xE000U |
153 | 153 |
|
154 | 154 | /* QSPIDMA_DST_I_STS */ |
155 | 155 | #define QSPIDMA_DST_I_STS_ALL_MASK 0xFEU |
156 | 156 |
|
157 | 157 | /* IOP System-level Control */ |
158 | 158 | #define IOU_SLCR_BASSE 0xFF180000 |
159 | | -#define IOU_TAPDLY_BYPASS (*((volatile uint32_t*)(IOU_SLCR_BASSE + 390))) |
| 159 | +#define IOU_TAPDLY_BYPASS (*((volatile uint32_t*)(IOU_SLCR_BASSE + 0x390))) |
160 | 160 | #define IOU_TAPDLY_BYPASS_LQSPI_RX (1UL << 2) /* LQSPI Tap Delay Enable on Rx Clock signal. 0: enable. 1: disable (bypass tap delay). */ |
161 | 161 |
|
162 | 162 |
|
|
185 | 185 |
|
186 | 186 |
|
187 | 187 | /* Flash Commands */ |
188 | | -#define WRITE_ENABLE_CMD 0x06U |
189 | | -#define WRITE_DISABLE_CMD 0x04U |
| 188 | +#define WRITE_ENABLE_CMD 0x06U |
| 189 | +#define WRITE_DISABLE_CMD 0x04U |
190 | 190 | #define READ_ID_CMD 0x9FU |
191 | 191 | #define MULTI_IO_READ_ID_CMD 0xAFU |
192 | 192 | #define READ_FSR_CMD 0x70U |
193 | 193 | #define ENTER_QSPI_MODE_CMD 0x35U |
194 | 194 | #define EXIT_QSPI_MODE_CMD 0xF5U |
195 | 195 | #define ENTER_4B_ADDR_MODE_CMD 0xB7U |
196 | 196 | #define EXIT_4B_ADDR_MODE_CMD 0xE9U |
197 | | - |
198 | 197 | #define FAST_READ_CMD 0x0BU |
199 | 198 | #define QUAD_READ_4B_CMD 0x6CU |
200 | | - |
201 | 199 | #define PAGE_PROG_CMD 0x02U |
202 | 200 | #define QUAD_PAGE_PROG_4B_CMD 0x34U |
203 | | - |
204 | 201 | #define SEC_ERASE_CMD 0xD8U |
205 | 202 | #define SEC_4K_ERASE_CMD 0x20U |
206 | | - |
207 | 203 | #define RESET_ENABLE_CMD 0x66U |
208 | 204 | #define RESET_MEMORY_CMD 0x99U |
209 | 205 |
|
@@ -282,6 +278,7 @@ static int qspi_transfer(QspiDev_t* pDev, |
282 | 278 | return GQSPI_CODE_SUCCESS; |
283 | 279 | } |
284 | 280 | #else |
| 281 | + |
285 | 282 | static inline int qspi_isr_wait(uint32_t wait_mask, uint32_t wait_val) |
286 | 283 | { |
287 | 284 | uint32_t timeout = 0; |
@@ -759,6 +756,7 @@ void qspi_init(uint32_t cpu_clock, uint32_t flash_freq) |
759 | 756 | GQSPI_CFG = reg_cfg; |
760 | 757 |
|
761 | 758 | /* use tap delay bypass < 40MHz SPI clock */ |
| 759 | + IOU_TAPDLY_BYPASS |= IOU_TAPDLY_BYPASS_LQSPI_RX; |
762 | 760 | GQSPI_LPBK_DLY_ADJ = 0; |
763 | 761 | QSPI_DATA_DLY_ADJ = 0; |
764 | 762 |
|
@@ -888,7 +886,8 @@ void hal_init(void) |
888 | 886 | printf("\nwolfBoot Secure Boot\n"); |
889 | 887 | #endif |
890 | 888 |
|
891 | | - asm volatile("msr cntfrq_el0, %0" : : "r" (cpu_freq) : "memory"); |
| 889 | + /* This is only allowed for EL-3 */ |
| 890 | + //asm volatile("msr cntfrq_el0, %0" : : "r" (cpu_freq) : "memory"); |
892 | 891 |
|
893 | 892 | zynq_init(cpu_freq); |
894 | 893 | } |
|
0 commit comments