SJA1110 Link Configuration via SPI Without SDK

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SJA1110 Link Configuration via SPI Without SDK

293 次查看
dbecerra
Contributor I

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:

Register Name R/W Value Comment
0x60hPOWER_DOWN_CONTROLW0x60hDisable True Power Down Mode
0x00hBASIC_CONTROL_REGISTERW0x8000hSoft Reset
0x00h(same as above)RWait while bit15 == 1Wait until reset is done
0x70hSPECIAL_INTERNAL_TEST_CONTROLSW0x1600hDisable DSP/AFE register reset
0x44hMODE_CONTROL_STATUSW0x40hDisable Auto-MDIX, force MDIX mode
0x00hBASIC_CONTROL_REGISTERW0x2100h100 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

标记 (1)
0 项奖励
回复
1 回复

258 次查看
PavelL
NXP Employee
NXP Employee

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

 

0 项奖励
回复