07-17-2016, 10:28 AM
(This post was last modified: 07-17-2016, 10:44 AM by martinayotte.)
You don't need CONFIG_SPI_SUN4I/CONFIG_SPI_SUN6I, but you need CONFIG_SPI_SUNXI=y
EDIT : BTW, the CONFIG_SPI_SPIDEV can also be done as modules, ie. : CONFIG_SPI_SPIDEV=m
(quoting myself )
Ok ! I've spent more time on the case, and I've finally figured out !!!
In the AllWinner specs, the EMAC is mapped at address 0x1c30000 and supposed to use 64K of memory, but in the DTS, the register mapping is mapping 256K, which overlap many other peripherals such as the GPU, the HighSpeed Timer, the DRAM Controller and the SPIs.
When I've enabled with "okay" the SPIs, they were grabbing their respective memory spaces, and then when Networking was turned on, I was getting this message in dmesg :
sunxi-gmac 1c30000.eth: can't request region for resource [mem 0x01c30000-0x01c6ffff]
This gave me the clue !!! why "eth" is trying to map such addresses so big where it is clearly overlaps the SPIs ?
Looking at DTS, and even in the AllWinner original one, we can see :
eth@01c30000 {
compatible = "allwinner,sunxi-gmac";
reg = <0x0 0x1c30000 0x0 0x40000 0x0 0x1c00000 0x0 0x30>;
Changing that with the following solve the issue, I've now both networking and SPIs running :
eth@01c30000 {
compatible = "allwinner,sunxi-gmac";
reg = <0x0 0x1c30000 0x0 0x10000 0x0 0x1c00000 0x0 0x30>;
EDIT : BTW, the CONFIG_SPI_SPIDEV can also be done as modules, ie. : CONFIG_SPI_SPIDEV=m
Quote:martinayotte
Unfortunately, both SPI0 and SPI1 are currently disabled, see at line 1838 :
https://github.com/longsleep/build-pine6....dts#L1838
Few weeks ago, I've tried to enable them, but unfortunately, they have some thing wrong in their definitions, since as soon they are enabled, the kernel boots and their some crash in vfe and other stuff and end up with root login in serial debug and I could see that ethernet is not working, even doing "ifconfig" completely hangs.
(quoting myself )
Ok ! I've spent more time on the case, and I've finally figured out !!!
In the AllWinner specs, the EMAC is mapped at address 0x1c30000 and supposed to use 64K of memory, but in the DTS, the register mapping is mapping 256K, which overlap many other peripherals such as the GPU, the HighSpeed Timer, the DRAM Controller and the SPIs.
When I've enabled with "okay" the SPIs, they were grabbing their respective memory spaces, and then when Networking was turned on, I was getting this message in dmesg :
sunxi-gmac 1c30000.eth: can't request region for resource [mem 0x01c30000-0x01c6ffff]
This gave me the clue !!! why "eth" is trying to map such addresses so big where it is clearly overlaps the SPIs ?
Looking at DTS, and even in the AllWinner original one, we can see :
eth@01c30000 {
compatible = "allwinner,sunxi-gmac";
reg = <0x0 0x1c30000 0x0 0x40000 0x0 0x1c00000 0x0 0x30>;
Changing that with the following solve the issue, I've now both networking and SPIs running :
eth@01c30000 {
compatible = "allwinner,sunxi-gmac";
reg = <0x0 0x1c30000 0x0 0x10000 0x0 0x1c00000 0x0 0x30>;