A20 (How To) add a 2nd Ethernet port (micrel 8851) on SPI

Started by pac, June 05, 2018, 06:57:13 PM

Previous topic - Next topic

pac

Hi All,
I have to add a 2nd etnernet port (micrel 8851) to my A20 using SPI2.
I have enabled the SPI2 in the FEX file but I have some trouble with the settings of the .dts

The FEX stub:

[spi2_para]
spi_used = 1
spi_cs_bitmap = 1
spi_cs0 = port:PC19<3><default><default><default>
spi_sclk = port:PC20<3><default><default><default>
spi_mosi = port:PC21<3><default><default><default>
spi_miso = port:PC22<3><default><default><default>

[spi_devices]
spi_dev_num = 1

[spi_board0]
modalias = "spidev"
max_speed_hz = 12000000
bus_num = 2
chip_select = 0
mode = 3
full_duplex = 0
manual_cs = 0
irq_gpio = 51

[gpio_para]
gpio_used = 1
gpio_num = 66
...
gpio_pin_51 = port:PI11<6><default><default><default>

In the kernel configuration I have selected Micrel KS8851 (SPI) driver

I'm using A20-build-3.4.103-release7 info

Any suggestion for settings of the .dts file ?

Thanks in advance
Paolo


rgiovoni

Hi All,
I have understood that for my kernel release the DTS file is not taken in care, only the FEX file is used.
S I can load the ks8851 module and the device is  identified.

But, when I set the new eth1 ethernet port up, it hangs : after some seconds, I get the following:

[ 5158.713073] ks8851 spi2.0: ks8851 network device is up !
[ 5169.451393] eth1: no IPv6 routers present
[ 5280.409571] INFO: task kworker/1:1:55 blocked for more than 120 seconds.
[ 5280.423592] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 5280.433624] kworker/1:1     D c0556124     0    55      2 0x00000000
[ 5280.452278] [<c0556124>] (__schedule+0x364/0x784) from [<c05549e4>] (schedule_timeout+0x194/0x218)
[ 5280.460293] [<c05549e4>] (schedule_timeout+0x194/0x218) from [<c0555bc4>] (wait_for_common+0xd8/0x12c)
[ 5280.468182] [<c0555bc4>] (wait_for_common+0xd8/0x12c) from [<c037c498>] (__spi_sync+0x60/0xa4)
[ 5280.476547] [<c037c498>] (__spi_sync+0x60/0xa4) from [<bf180540>] (ks8851_tx_work+0xa0/0x19c [ks8851])
[ 5280.485778] [<bf180540>] (ks8851_tx_work+0xa0/0x19c [ks8851]) from [<c004b008>] (process_one_work+0x130/0x390)
[ 5280.494126] [<c004b008>] (process_one_work+0x130/0x390) from [<c004b564>] (worker_thread+0x134/0x2e4)
[ 5280.501517] [<c004b564>] (worker_thread+0x134/0x2e4) from [<c004fe08>] (kthread+0x84/0x90)
[ 5280.508585] [<c004fe08>] (kthread+0x84/0x90) from [<c000f6c4>] (kernel_thread_exit+0x0/0x8)

Any suggestion?
Thanks in advance

Paolo