-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ def get_sdram_phy_header(sdram_phy_settings): | |
nphases = sdram_phy_settings.nphases | ||
r += "#define DFII_NPHASES "+str(nphases)+"\n\n" | ||
|
||
r += "static void cdelay(int i);\n" | ||
r += "extern void cdelay(int i);\n" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sbourdeauducq
Member
|
||
|
||
# commands_px functions | ||
for n in range(nphases): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
|
||
#include <generated/csr.h> | ||
|
||
void cdelay(int i); | ||
This comment has been minimized.
Sorry, something went wrong.
sbourdeauducq
Member
|
||
|
||
void sdrsw(void); | ||
void sdrhw(void); | ||
void sdrrow(char *_row); | ||
|
4 comments
on commit 1330c7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specification of this function is: it should wait for at least the given number of CPU cycles.
When I wrote this code, there wasn't timer support and only SDRAM needs it, so I made it a function local to the SDRAM code (hence the static forward declaration that you just removed).
If you make it global, it should not live in the SDRAM code anymore. I guess a good place would be libbase/time.c
, and it should probably use timers too. Of course, this will need careful testing, especially as there might be some bugs in the SDRAM timing computations (e.g. the margin
parameter of the ns
function is inappropriate for any PHY other than half-rate, but you used it with others). Writing clean code is hard...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I tried here to fix a warning, but I'll have a closer look and put a delay function in libbase/time.c
. IIRC there is also a delay function in libnet/microudp.c
that we can try to remove. Once done I'll apply these change also to master. I'll have a closer look at SDRAM too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enjoy-digital can I revert this in the meantime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you can.
extern
is not necessary for function prototype declarations.