Hello,
I'm working with the SJA1110 Ethernet switch and I'm currently facing issues establishing a link. I'm attempting to configure everything via SPI, without using the SDK.
So far, I've used the following initialization sequence:
SJA1110AEL_write_word(VM_DAC_CONTROL0, 0x107B);
SJA1110AEL_write_word(POWER_DOWN_CONTROL, 0x0060);
SJA1110AEL_write_word(VM_DAC_CONTROL0, 0x907B);
uint32_t trim_val = SJA1110AEL_read_word(SHADOW1_27); // SHADOW1_27 = 0
trim_val = (trim_val >> 16) & 0x3;
SJA1110AEL_write_word(CBTX_TRIM_CONFIG, trim_val);
SJA1110AEL_write_word(BASIC_CONTROL_REGISTER, 0x8000);
uint32_t timeout = 1000000;
while ((((SJA1110AEL_read_word(BASIC_CONTROL_REGISTER) >> 15) & 0x1) && --timeout);
if (timeout == 0) {
return false; // Reset failed
}
SJA1110AEL_write_word(BASIC_CONTROL_REGISTER, 0x3100);
SJA1110AEL_write_word(CBTX_AFE_SPARE_REG, 0x0002);
With this configuration, I noticed that there is no activity in the link bit of the BASIC_STATUS register.
While searching for a solution, I found the following sequence on a forum:
0x60h | POWER_DOWN_CONTROL | W | 0x60h | Disable True Power Down Mode |
0x00h | BASIC_CONTROL_REGISTER | W | 0x8000h | Soft Reset |
0x00h | (same as above) | R | Wait while bit15 == 1 | Wait until reset is done |
0x70h | SPECIAL_INTERNAL_TEST_CONTROLS | W | 0x1600h | Disable DSP/AFE register reset |
0x44h | MODE_CONTROL_STATUS | W | 0x40h | Disable Auto-MDIX, force MDIX mode |
0x00h | BASIC_CONTROL_REGISTER | W | 0x2100h | 100 Mbps, Full Duplex |
Using this configuration, the link bit is set to 1, but only briefly—it drops back to 0 after a couple of seconds. I'm somewhat skeptical of this approach, especially since the SPECIAL_INTERNAL_TEST_CONTROLS register modifies bits that aren't documented in the datasheet.
Is there an officially supported way to configure the switch without the SDK? If not, I missing a step to make link?
Any guidance would be greatly appreciated.
Best regards,
Daniel
Hello @dbecerra ,
Your use case is very rare.
You need to upload the switchcore configuration. Without switchcore configuration, the switch will not forward any traffic. If you don't want to use SDK, the configuration can be created manually (based on UM11107 and AN12925 - both documents are available in the Documentation, Secure files - Multi-Gig Safe and Secure TSN Ethernet Switch with Integrated 100BASE-T1 PHYs | NXP Semiconductors) or by python scripts (available in Software section - SJA1110-EVM Evaluation Board | NXP Semiconductors).
After successful upload, the CONFIGDONE bit in CFG_STAT register shall be set, as well as the pin DEVICE_CFG_N goes low.
Best regards,
Pavel