Skip to content

Commit

Permalink
Provide some sdram.c function for outside use
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Dudek <[email protected]>
  • Loading branch information
mtdudek committed Dec 4, 2023
1 parent 77b227a commit 77b692c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 6 additions & 6 deletions litex/soc/software/liblitedram/sdram.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ static void sdram_dfii_pix_address_write(unsigned char phase, unsigned int value
}
}

static void sdram_dfii_pird_address_write(unsigned int value) {
void sdram_dfii_pird_address_write(unsigned int value) {
unsigned char rdphase = sdram_dfii_get_rdphase();
sdram_dfii_pix_address_write(rdphase, value);
}

static void sdram_dfii_piwr_address_write(unsigned int value) {
void sdram_dfii_piwr_address_write(unsigned int value) {
unsigned char wrphase = sdram_dfii_get_wrphase();
sdram_dfii_pix_address_write(wrphase, value);
}
Expand All @@ -181,12 +181,12 @@ static void sdram_dfii_pix_baddress_write(unsigned char phase, unsigned int valu
}
}

static void sdram_dfii_pird_baddress_write(unsigned int value) {
void sdram_dfii_pird_baddress_write(unsigned int value) {
unsigned char rdphase = sdram_dfii_get_rdphase();
sdram_dfii_pix_baddress_write(rdphase, value);
}

static void sdram_dfii_piwr_baddress_write(unsigned int value) {
void sdram_dfii_piwr_baddress_write(unsigned int value) {
unsigned char wrphase = sdram_dfii_get_wrphase();
sdram_dfii_pix_baddress_write(wrphase, value);
}
Expand All @@ -213,12 +213,12 @@ static void command_px(unsigned char phase, unsigned int value) {
}
}

static void command_prd(unsigned int value) {
void command_prd(unsigned int value) {
unsigned char rdphase = sdram_dfii_get_rdphase();
command_px(rdphase, value);
}

static void command_pwr(unsigned int value) {
void command_pwr(unsigned int value) {
unsigned char wrphase = sdram_dfii_get_wrphase();
command_px(wrphase, value);
}
Expand Down
11 changes: 11 additions & 0 deletions litex/soc/software/liblitedram/sdram.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ struct sdram_timings_s {
uint32_t tzqcs;
};

/*-----------------------------------------------------------------------*/
/* Helpers */
/*-----------------------------------------------------------------------*/
void cdelay(int i);
void command_prd(unsigned int value);
void command_pwr(unsigned int value);
void sdram_dfii_pird_address_write(unsigned int value);
void sdram_dfii_piwr_address_write(unsigned int value);
void sdram_dfii_pird_baddress_write(unsigned int value);
void sdram_dfii_piwr_baddress_write(unsigned int value);

/*-----------------------------------------------------------------------*/
/* Constants */
/*-----------------------------------------------------------------------*/
Expand Down

0 comments on commit 77b692c

Please sign in to comment.