Browse Source

rtc: assume RTC 32 kHz is supported to work if GPIO serial not used

If we don't use the GPIO serial workaround, assume we don't need the
RTC 32 kHz workaround either.
H. Peter Anvin 3 years ago
parent
commit
a642f1f7a9

+ 4 - 6
fpga/max80.sv

@@ -8,11 +8,7 @@
 // Sharing JTAG pins (via JTAGEN)
 `undef SHARED_JTAG
 
-module max80
-#(
-  // Pull-up installed on RTC 32 kHz line
-  parameter rtc_32khz_rework = 1'b0
-) (
+module max80 (
 	      // Clock oscillator
 	      input	    clock_48, // 48 MHz
 
@@ -658,6 +654,8 @@ module max80
    assign tty_cts = tty_dtr_q[0] ? 1'bz : tty_cts_out;
    assign gpio[3] = tty_dtr_q[1] ? 1'bz : tty_cts_out;
 
+   // DTR on GPIO -> assume RTC 32 kHz output is nonfunctional
+   wire rtc_32khz_rework = tty_dtr_q[1];
 
    // SD card
    sdcard #(
@@ -705,7 +703,7 @@ module max80
      end
 
    // 32kHz clock synchronized with sys_clk
-   wire clk_32kHz = rtc_32khz_rework ? rtc_32khz : ctr_32khz;
+   wire clk_32kHz = rtc_32khz_rework ? ~rtc_32khz : ctr_32khz;
 
    sysclock #(.PERIODIC_HZ_LG2 ( 5 ))
    sysclock (

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof