Forums » Software Development »
PHY not working with QSPI flash boot
Added by Alexandre Lopes over 9 years ago
Hi,
I am trying to set up the MitySOM such that U-Boot is stored on the flash memory and the Linux Kernel, DTS and FPGA image are loaded via TFTP.
Whenever I boot from the SD card with a preloader and U-boot compiled according to the instructions on the MitySOMs wiki, I can load everything via TFTP and mount
the root filesystem via NFS. The problem arrises when I boot from the QSPI flash. U-boot runs without any problems but the network doesn't work.
The only difference between the two U-Boot compilations is that whenever I compile U-Boot for the QSPI flash, I tick the "BOOT_FROM_QSPI" option on the BSP Editor.
If I boot from the SD card, run the U-Boot macro initphy and then dhcp I get
MitySOM-5CSx # dhcp designware_board_phy_init: enter Waiting for PHY auto negotiation to complete. done ENET Speed is 100 Mbps - FULL duplex connection BOOTP broadcast 1 BOOTP broadcast 2 *** Unhandled DHCP Option in OFFER/ACK: 44 *** Unhandled DHCP Option in OFFER/ACK: 46 *** Unhandled DHCP Option in OFFER/ACK: 78 *** Unhandled DHCP Option in OFFER/ACK: 79 *** Unhandled DHCP Option in OFFER/ACK: 44 *** Unhandled DHCP Option in OFFER/ACK: 46 *** Unhandled DHCP Option in OFFER/ACK: 78 *** Unhandled DHCP Option in OFFER/ACK: 79 DHCP client bound to address 10.14.44.141
while if I boot from the QSPI flash, using the same procedure, I get (I've set GPIO pin 28 to 0 and then 1, i.e. initphy)
MitySOM-5CSx # dhcp failed to find phy failed to configure phy: -1
The MAC address and the mii interface are properly set, as U-Boot sets the
ethactand
ethaddraccordingly.
I've compared both cases and the only thing that changes between compilations is the value of the CONFIG_PRELOADER_BOOT_FROM_QSPI/CONFIG_PRELOADER_BOOT_FROM_MMC macros (for the QSPI boot the former is set to 1 and the later to 0 and for MMC boot it's the opposite) which are used by several header files.
The only thing I can image at the moment is that by setting the QSPI macro something related to the Micrel driver is somehow affected.
Any idea on how to solve this problem? Thanks.
Best,
Alexandre Lopes
--------------
Extra info:
- Board: 80-000578RC-3C
- U-Boot boot-up message:
U-Boot SPL 2013.01.01 (May 20 2015 - 10:14:40) BOARD : Critical Link MitySOM-5CSx Module CLOCK: EOSC1 clock 25000 KHz CLOCK: EOSC2 clock 25000 KHz CLOCK: F2S_SDR_REF clock 0 KHz CLOCK: F2S_PER_REF clock 0 KHz CLOCK: MPU clock 925 MHz CLOCK: DDR clock 400 MHz CLOCK: UART clock 100000 KHz CLOCK: MMC clock 50000 KHz CLOCK: QSPI clock 370000 KHz RESET: COLD INFO : Watchdog enabled SDRAM: Initializing MMR registers SDRAM: Calibrating PHY SEQ.C: Preparing to start memory calibration SEQ.C: CALIBRATION PASSED SDRAM: 1024 MiB SDRAM: ECC Enabled SF: Read data capture delay calibrated to 7 (0 - 15) SF: Detected N25Q128A with page size 65536, total: 16777216
Replies (8)
RE: PHY not working with QSPI flash boot - Added by Alexandre Lopes over 9 years ago
Any ideas of what the problem might be?
Can somebody at least reproduce this behavior?
RE: PHY not working with QSPI flash boot - Added by Michael Williamson over 9 years ago
Sorry,
The only thing that comes to mind is if somehow the uBoot environment has changed or the SPL build removed the phylib or emac driver. You might compare the printenv's from both configurations a little closer. You might also make sure you have the necessary phy commands (mii command is there, etc.).
Are you using a DevKit? I notice the PHY is linking up at 100 Mbps from SD card. Should you be getting Gigabit links (we normally get 1 Gbps links).
When you try to boot from the QSPI, do you get ethernet link (link lights on remote end or local end if hooked up)? If you don't, then the PHY is probably stuck in reset or doesn't have a clock. If you do, then it's probably something with the preloader pin mux configuration.
-Mike
RE: PHY not working with QSPI flash boot - Added by Alexandre Lopes over 9 years ago
Hi Mike,
Thanks for replying. The U-Boot environments are identical. The driver should also be there as I have just noticed, after several attempts, that someties U-Boot does manage to find the interface (although it doesn't work properly):
MitySOM-5CSx # dhcp designware_board_phy_init: enter Waiting for PHY auto negotiation to complete............ TIMEOUT! ENET Speed is 10 Mbps - HALF duplex connection BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 BOOTP broadcast 4 BOOTP broadcast 5
MitySOM-5CSx # mii info 0-30 PHY 0x1F: OUI = 0x0885, Model = 0x22, Rev = 0x02, 10baseT, HDX
This behavior appears to be non deterministic, though (has happened twice over many resets), which means it is also very difficult to probe the PHY's registers
(as mii info returns nothing if no PHY is detected...)
I am using a Dev-Kit from Critical Link. The board is: 80-000578RC-3C.
As for the NIC LEDs, they are both off, except for the above-mentioned special situation in which case one of them is on (the data one is obviously off since I can't get data to flow through the interface...).
"If you don't, then the PHY is probably stuck in reset or doesn't have a clock".
How can I check that if I can't read the PHY registers?
"If you do, then it's probably something with the preloader pin mux configuration."
That shouldn't have changed between builds. The spl_bsp/generated folders are identical (apart from the CONFIG_PRELOADER_BOOT_FROM_QSPI and the CONFIG_PRELOADER_BOOT_FROM_MMC macros in build.h).
Should I look for differences somewhere else?
In any case, I have run a diff between both builds and apart from linking against different libraries (libmmc vs libspi_flash) and some different initialization code, there doesn't seem to be too much of a difference.
Thanks a lot.
Alex
RE: PHY not working with QSPI flash boot - Added by Alexandre Lopes over 9 years ago
I just want to report that this problem is not present when using an Altera Cyclone V DevKit.
I have no problem with the PHY when booting from QSPI flash and I am able to obtain an IP address via DHCP and load a Linux Kernel via TFTP.
The only difference between builds are the steps here described: https://support.criticallink.com/redmine/projects/mityarm-5cs/wiki/Building_u-Boot_and_Preloader (i.e. the problem seems to be related to the MitySoM board configuration). Can someone from Critical Link please try to reproduce the problem? Is this a problem you are aware of and have corrected in a more recent release?
RE: PHY not working with QSPI flash boot - Added by Michael Williamson over 9 years ago
Hi,
We are not aware of any problem until your post. We had tried to reproduces this problem after you originally posted and didn't see the issue. Sorry I did not mention it. I have asked the engineer to re-run it and capture the results (he didn't originally).
I notice you are setting the MPU clock rate to 925 MHz. What is your module part number? I don't believe we offer an 925 speedgrade option for the module. Are you overclocking the part? We tested using a 800 MHz MPU clock rate (for a -C7 speed grade). Can you retest using 800 MHz clock speed?
The ethenet link should link up at 1 Gbps if you have a gigabit ethernet device. I noticed in both cases links speeds reported of 100 and 10 MHz. That is not consistent with our factory testing.
Can you use the binary SD image delivered with the dev kit on the MMC and confirm the ethernet links up at 1 Gbps?
-Mike
RE: PHY not working with QSPI flash boot - Added by Alexandre Lopes over 9 years ago
Hi Mike,
I have tested it with the image that is available here: http://support.criticallink.com/files/mitysom-5csx/sd_image_MitySOM-5CSX_rev3A.zip.
The Ethernet link appears to be 100Mbps as well.
I hadn't notice the different clock rate, but you're right. Whenever I boot from the SD card using my image the MPU clock rate is 800MHz as it should:
U-Boot SPL 2013.01.01 (Mar 23 2015 - 13:52:19)
BOARD : Critical Link MitySOM-5CSx Module
CLOCK: EOSC1 clock 25000 KHz
CLOCK: EOSC2 clock 25000 KHz
CLOCK: F2S_SDR_REF clock 0 KHz
CLOCK: F2S_PER_REF clock 0 KHz
CLOCK: MPU clock 800 MHz
CLOCK: DDR clock 400 MHz
CLOCK: UART clock 100000 KHz
CLOCK: MMC clock 50000 KHz
CLOCK: QSPI clock 400000 KHz
RESET: COLD
INFO : Watchdog enabled
SDRAM: Initializing MMR registers
SDRAM: Calibrating PHY
SEQ.C: Preparing to start memory calibration
SEQ.C: CALIBRATION PASSED
SDRAM: 1024 MiB
SDRAM: ECC Enabled
ALTERA DWMMC: 0
while if I boot from the QSPI flash the clock rate is 925MHz.
As for jumpers configurations the original was 0000011101 (i.e. BOOTSEL = 0x5 - SD card 3.3V) and for the QSPI flash I am using 0000011011 (i.e. BOOTSEL = 0x6 - QSPI 1.8V).
Where can I actually change the speed grade?
The module is a 5CSX-H6-42A-RC.
Thanks for the help.
Alex
RE: PHY not working with QSPI flash boot - Added by Michael Williamson over 9 years ago
I am checking with our hardware guy here but I don't think the MPU rate is altered by the BOOTSEL pins after u-Boot.
I think the MPU rate is configured in the QSYS HPS configuration setup and the PLL settings are passed via headers to the preloader build.
Which version of Quartus are you running?
RE: PHY not working with QSPI flash boot - Added by Alexandre Lopes over 9 years ago
Hi Mike,
Thanks for all the support. I've managed to solve the problem by downloading the 5CSX Project once again, downloading a new U-Boot version and adding the board specific files to U-Boot and compiling everything again. I still don't know where the problem was and why it worked with the SD card but not with the QSPI flash...
Alex