Fix all compiler warnings.

- Many times we need help the compiler to reason about variable type or
define.
This commit is contained in:
René van Dorst
2026-08-30 21:41:30 +02:00
parent aba69cd640
commit f187261085
8 changed files with 56 additions and 38 deletions
+7 -7
View File
@@ -1814,16 +1814,17 @@ void init_smi(void)
* which are at port 8 and additionally at port 3 for a dual SFP device
*/
// using 16bit value, because it can load cheap.
// Default: 0x00005555
// Workaround for SDCC BUG 4070: SFR_DATA_U32 = 0x00005555;
SFR_DATA_U16_UPPER = 0x0000;
SFR_DATA_U16= 05555;
SFR_DATA_U16 = 0x5555;
if (machine.n_10g == 2) {
REG_SET(RTL837X_REG_SMI_MAC_TYPE, 0x00015555);
} else {
REG_SET(RTL837X_REG_SMI_MAC_TYPE, machine.n_sfp == 2 ? 0x00005515 : 0x00005555);
}
// 0x00015555, only change the bytes that differs from the default.
SFR_DATA_16 = 0x01;
} else if (machine.n_sfp == 2)
// 0x00005515
SFR_DATA_0 = 0x15;
reg_write(RTL837X_REG_SMI_MAC_TYPE);
// Configure polling of all PHYs by the MAC to detect link-state changes
// Default: 0x000000ff
@@ -1839,7 +1840,6 @@ void init_smi(void)
}
}
reg_write(RTL837X_REG_SMI_PORT_POLLING);
// Enable MDC
reg_read_m(RTL837X_REG_SMI_CTRL);
sfr_mask_data(1, 0, 0x70); // Set bits 12-14 to enable MDC for SMI0-SMI2