Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 2 contributors
2  milkymist/dvisampler/clocking.py
View
@@ -4,7 +4,7 @@
class Clocking(Module, AutoCSR):
def __init__(self, pads):
- self._r_pll_reset = CSRStorage()
+ self._r_pll_reset = CSRStorage(reset=1)
self._r_locked = CSRStatus()
self.locked = Signal()
4 milkymist/lasmicon/multiplexer.py
View
@@ -162,12 +162,12 @@ def steerer_sel(steerer, phy_settings, r_w_n):
if r_w_n == "read":
if i == phy_settings.rdphase:
s = steerer.sel[i].eq(STEER_REQ)
- elif i == phy_settings.wrcmdphase:
+ elif i == phy_settings.rdcmdphase:
s = steerer.sel[i].eq(STEER_CMD)
elif r_w_n == "write":
if i == phy_settings.wrphase:
s = steerer.sel[i].eq(STEER_REQ)
- elif i == phy_settings.rdcmdphase:
+ elif i == phy_settings.wrcmdphase:
s = steerer.sel[i].eq(STEER_CMD)
else:
raise ValueError
46 software/videomixer/dvisamplerX.c
View
@@ -44,6 +44,8 @@ void dvisamplerX_init_video(void)
{
unsigned int mask;
+ dvisamplerX_clocking_pll_reset_write(1);
+
dvisamplerX_dma_ev_pending_write(dvisamplerX_dma_ev_pending_read());
dvisamplerX_dma_ev_enable_write(0x3);
mask = irq_getmask();
@@ -224,27 +226,45 @@ static void dvisamplerX_check_overflow(void)
}
}
+static int dvisamplerX_connected;
static int dvisamplerX_locked;
static int dvisamplerX_last_event;
void dvisamplerX_service(void)
{
- if(dvisamplerX_locked) {
- if(dvisamplerX_clocking_locked_read()) {
- if(elapsed(&dvisamplerX_last_event, identifier_frequency_read()/2)) {
- dvisamplerX_adjust_phase();
- dvisamplerX_print_status();
- }
- } else {
- printf("dvisamplerX: lost PLL lock\n");
+ if(dvisamplerX_connected) {
+ if(!dvisamplerX_edid_hpd_notif_read()) {
+ printf("dvisamplerX: disconnected\n");
+ dvisamplerX_connected = 0;
dvisamplerX_locked = 0;
+ dvisamplerX_clocking_pll_reset_write(1);
+ dvisamplerX_edid_hpd_en_write(0);
+ } else {
+ if(dvisamplerX_locked) {
+ if(dvisamplerX_clocking_locked_read()) {
+ if(elapsed(&dvisamplerX_last_event, identifier_frequency_read()/2)) {
+ dvisamplerX_adjust_phase();
+ dvisamplerX_print_status();
+ }
+ } else {
+ printf("dvisamplerX: lost PLL lock\n");
+ dvisamplerX_locked = 0;
+ }
+ } else {
+ if(dvisamplerX_clocking_locked_read()) {
+ printf("dvisamplerX: PLL locked\n");
+ dvisamplerX_phase_startup();
+ dvisamplerX_print_status();
+ dvisamplerX_locked = 1;
+ }
+ }
}
} else {
- if(dvisamplerX_clocking_locked_read()) {
- printf("dvisamplerX: PLL locked\n");
- dvisamplerX_phase_startup();
- dvisamplerX_print_status();
- dvisamplerX_locked = 1;
+ if(dvisamplerX_edid_hpd_notif_read()) {
+ printf("dvisamplerX: connected\n");
+ dvisamplerX_connected = 1;
+ dvisamplerX_edid_hpd_en_write(1);
+ dvisamplerX_clocking_pll_reset_write(0);
}
}
dvisamplerX_check_overflow();

No commit comments for this range

Something went wrong with that request. Please try again.