[f1c100s]add ddr support for f1c100s

This commit is contained in:
JianjunJiang 2021-05-26 15:21:47 +08:00
parent 278b8706b8
commit 3c45b10e86
2 changed files with 20 additions and 1 deletions

View File

@ -24,7 +24,25 @@ static int chip_jtag(struct xfel_ctx_t * ctx)
static int chip_ddr(struct xfel_ctx_t * ctx, const char * type)
{
return 0;
W32(0x01c20800 + 0x024, 0x00007222);
W32(0x01c20800 + 0x2c0, 0x00000aaa);
W32(0x01c20000 + 0x020, 0x90000c00);
usleep(1);
W32(0x01c20000 + 0x060, 0x01004000);
W32(0x01c20000 + 0x2c0, R32(0x01c20000 + 0x2c0) & ~(0x1 << 14));
usleep(1);
W32(0x01c20000 + 0x2c0, R32(0x01c20000 + 0x2c0) | (0x1 << 14));
W32(0x01c20800 + 0x2c4, 0x00010501);
W32(0x01c01000 + 0x004, 0xb7ceedc2);
W32(0x01c01000 + 0x008, 0x00a70008);
W32(0x01c01000 + 0x000, 0x0001318a);
W32(0x01c01000 + 0x00c, 0x000800c8);
W32(0x01c01000 + 0x00c, R32(0x01c01000 + 0x00c) | (1 << 0));
usleep(1);
W32(0x01c01000 + 0x024, 0x00161600);
W32(0x01c01000 + 0x010, 0x000004c0);
return 1;
}
static int chip_spinor(struct xfel_ctx_t * ctx)

1
x.h
View File

@ -26,6 +26,7 @@ extern "C" {
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <unistd.h>
#include <libusb.h>
static inline uint16_t __swab16(uint16_t x)