Author Topic: TE0720 boot from QSPI and Linux mount a rootfs in eMMC  (Read 10701 times)

danwwright

  • Jr. Member
  • **
  • Posts: 70
TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« on: September 20, 2015, 03:49:33 AM »
I'm using TE0720-02-refplnx with a TE0703 carrier board.  This I built using Vivado and Petalinux 2014.4.  Examining the MIO configuration in Vivado it appears that SD 0 and SD 1 are configured this way:

 SD 0: MIO 40...45
 SD 1: MIO 46...51

and the GUI does not permit you to reverse those two configurations.  So in Linux I would expect to see /dev/mmcblk0 as the SD card and /dev/mmcblk1 as the eMMC.  Using these assumptions I can boot from an SD card and successfully have Linux mount /dev/mmcblk0p2 (which is a partition on the SD card) as its rootfs and everything works fine.

But to boot from QSPI and have Linux mount a rootfs in eMMC I should tell Linux to use /dev/mmcblk1p1 (which is on the eMMC) as its rootfs.  And to make sure this is all correct I can boot to u-boot using the SD card and do this:

sf probe 0 0 0
sf read $netstart 0x000000520000 0x400000
bootm $netstart

Here 0x000000520000 is where I had flashed image.ub where Linux will attempt to mount /dev/mmcblk1p1.  And that WORKS.  I see Linux running fine and the rootfs IS what I had set up in partition 1 of the eMMC.

But when I change switch 4 on the TE0703 (for QSPI boot) and remove the SD card and boot I get u-boot coming up fine but then it says:  "Card did not respond to voltage select!"

But since I am in u-boot I then try:

sf probe 0 0 0
sf read $netstart 0x000000520000 0x400000
bootm $netstart

But here after Linux loads it fails in its attempt to mount its rootfs (I assume because it then just hangs).

Now in the two cases my u-boot commands are reading into RAM and jumping to the SAME code- but with the TE0703 switch 4 in one position with an SD card present the boot succeeds but with it in the other position and no SD card the boot fails. 

Does Linux when it detects an SD card then call the SD card /dev/mmcblk0 and calls the eMMC /dev/mmcblk1 ?
But if no SD card is detected perhaps Linux then calls the eMMC /dev/mmcblk0 ?



Oleksandr Kiyenko

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 333
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #1 on: September 21, 2015, 08:46:57 AM »
Hello,

Yes, linux can change device ordering. You can try to use aliases to reorder sd controllers.
Add something like this to your device tree
aliases {
   mshc0 = &sdhci1;
   mshc1 = &sdhci0;
};

Best regards
Oleksandr Kiyenko

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #2 on: September 21, 2015, 04:12:43 PM »
Thanks but won't these aliases too shift depending upon whether an SD card is present?

Oleksandr Kiyenko

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 333
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #3 on: September 21, 2015, 04:21:17 PM »
If SD card is not always present, it's a way to make eMMC to be mmcblk0 in any case. So if SD present eMMC will be mmcblk0, SD will be mmcblk1. If no SD present eMMC will be also mmclkblk0. I did so on old project, but without aliases, I have to write new device tree to reorder devices.

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #4 on: September 21, 2015, 07:26:19 PM »
Okay- thanks.  And is the offset of 0x000000520000 in the QSPI flash the conventional location for flashing image.ub?

Also will there soon be a general purpose reference design (like TE0720-02-refplnx) for the 2015.2 Vivado/Petalinux?

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #5 on: September 22, 2015, 08:07:50 PM »
Actually the aliases failed to alter the boot behavior.  The bootable partition in the eMMC is p1.  I find that if I have Linux attempt to mount  /dev/mmcblk1p1 the boot stalls here:

...
ipip: IPv4 over IPv4 tunneling driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
Registering SWP/SWPB emulation handler
Waiting for root device /dev/mmcblk1p1...      <-----------------------------

But if I specify instead mmcblk0p1 then I get this:

...
ipip: IPv4 over IPv4 tunneling driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
Registering SWP/SWPB emulation handler
Waiting for root device /dev/mmcblk0p1...      <-----------------------------

So the problem (whatever it is) is NOT a confusion over which mmcblk is the eMMC because both possibilities fail.

But if I boot into u-boot from an SD card and then load and jump (as explained earlier) Linux mounts the partition in eMMC just fine.

Also I find that on the TE0703 if a bootable SD card is inserted then the the TE0720 will boot from it REGARDLESS of the setting of switch 4.  Is that expected behavior?

Oleksandr Kiyenko

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 333
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #6 on: September 23, 2015, 10:26:38 AM »
Hello,

I read again your initial problem description and thiank that you should try:
1. Configure u-boot to work with eMMC
replace
#define CONFIG_ZYNQ_SDHCI0  0xE0100000
with
#define CONFIG_ZYNQ_SDHCI1  0xE0101000
2. Just in case configure SD1 controller CD pin to EMIO and connect it to ground (in newest Vivado versions it's default value, but was problem before)

Best regards
Oleksandr Kiyenko

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #7 on: September 23, 2015, 05:51:54 PM »
Unfortunately this does not change the behavior I see in the Linux boot. 

Currently the u-boot environment variables are set for SD-boot and with no CD card plugged in I had been getting from u-boot:
"Card did not respond to voltage select!"
That made sense because there was no card in the slot. 

After making the change you suggested to u-boot and with no CD card plugged in it now instead says:
"** Unrecognized filesystem type **"
because looking at partition 1 in the eMMC it sees an ext4 filesystem instead of the FAT it was expecting.  So I think we have convinced u-boot to treat the eMMC as SD0 instead of the SD card.  But Linux still has the same problem (whether I tell it mmcblk0p1 or mmcblk1p1 ).

It must be that Linux somehow "knows" whether an SD card is present and changes its behavior accordingly.  But the problem is not the ordering of which device it calls mmcblk0 because we tested both possibilities and both fail.  Do you see this behavior there?

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #8 on: September 26, 2015, 10:40:11 PM »
Actually I had not accomplished this part: "Just in case configure SD1 controller CD pin to EMIO and connect it to ground.".

I can easily connect this to "EMIO" in the block design editor.  But what I cannot figure out how to do is to somehow FIND that newly added port in the RTL to assign it to ground.  I see unanswered questions about this on the Xilinx forum but no answers.

Can you tell me how to do this?


danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #9 on: September 26, 2015, 11:17:21 PM »
Ooops!  Sorry- I see it now.  When you configure a peripheral port for EMIO then a new port appears in the diagram.  So then you can rout this signal anywhere you like in the diagram.  Just connect that to a constant 0?

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #10 on: September 27, 2015, 12:10:02 AM »
Yup!  Pin CD to 0 and everything works (using mmcblk0p1) !

Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #11 on: October 27, 2015, 02:57:36 PM »
Hi,

I am using  Xilinix TE0720 Zynq  with carrier TE0703-04.Can i boot this board without SD card?
Can u please suggest me how to boot this board and what are all the packages i need to install?

Thank you

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #12 on: October 27, 2015, 05:40:03 PM »
there is a DIP switch that chooses the boot mode SPI or SD card on TE0703

I do not understand the question about packages you want to install?

Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #13 on: October 28, 2015, 10:13:41 AM »
Thanks for your response.
 
 I installed minicom and tried to get U-Boot interactive console.But i got the following...

Welcome to minicom 2.5

OPTIONS: I18n                                                               
Compiled on May  2 2011, 00:39:27.                                           
Port /dev/ttyUSB0                                                           
                                                                             
Press CTRL-A Z for help on special keys                                       
                                       

Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #14 on: October 28, 2015, 10:27:23 AM »
Thanks for your response.
 I selected the QSPI boot mode in DIP switch.
 I installed minicom and tried to get U-Boot interactive console.But i got the following...

Welcome to minicom 2.5

OPTIONS: I18n                                                               
Compiled on May  2 2011, 00:39:27.                                           
Port /dev/ttyUSB0                                                           
                                                                             
Press CTRL-A Z for help on special keys                                       
                                       

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #15 on: October 28, 2015, 11:06:17 AM »
Thanks for your response.
 I selected the QSPI boot mode in DIP switch.
 I installed minicom and tried to get U-Boot interactive console.But i got the following...

Welcome to minicom 2.5

OPTIONS: I18n                                                               
Compiled on May  2 2011, 00:39:27.                                           
Port /dev/ttyUSB0                                                           
                                                                             
Press CTRL-A Z for help on special keys                                       
                                       

This seems like standard log messages, from minicom ?

Did you change boot mode? (DIP switch S2.4)

Does TE0720 boot from SPI?

https://wiki.trenz-electronic.de/display/TE0720/On-board+LEDs


 


Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #16 on: October 29, 2015, 10:29:00 AM »
Thank You so much.

I selected the QSPI boot mode in DIP switch.
Board booted successfullty when I change the minicom serial device settings as /dev/ttyUSB1. In serial device /dev/ttyUSB0 mode, it is not booted.Is there any configuration dependencies in serial device?

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #17 on: October 29, 2015, 10:36:50 AM »
Thank You so much.

I selected the QSPI boot mode in DIP switch.
Board booted successfullty when I change the minicom serial device settings as /dev/ttyUSB1. In serial device /dev/ttyUSB0 mode, it is not booted.Is there any configuration dependencies in serial device?

what you mean is not booting?

if you connect minimcom to incorrect serial port on host pc, then you would not see the messages sent to other port, that does not mean  the module does not boot, only that you can not see the messages.



Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #18 on: October 29, 2015, 12:15:48 PM »
Hello Antti Lukats,

Yes you are right. Board is booting up.
When i am connecting to /dev/ttyUSB1, i am able to see the messages. but not with port /dev/ttyUSB0 (In Minicom).

Just i want to know, why it is not working with /dev/ttyUSB0.
Whether board will only accept /dev/ttyUSB1 configuration (Like hard coded Value).

Let me know if i am not clear.
« Last Edit: October 29, 2015, 12:18:57 PM by Mythili »

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #19 on: October 29, 2015, 05:06:17 PM »
Hello Antti Lukats,

Yes you are right. Board is booting up.
When i am connecting to /dev/ttyUSB1, i am able to see the messages. but not with port /dev/ttyUSB0 (In Minicom).

Just i want to know, why it is not working with /dev/ttyUSB0.
Whether board will only accept /dev/ttyUSB1 configuration (Like hard coded Value).

Let me know if i am not clear.

/dev/ttyUSB0
/dev/ttyUSB1

are 2 different ports on your HOST PC, I assume, correct?

our micromodules have NO RELATION to the naming of serial ports on your host PC

if you

1 connect cable to CORRECT physical port
2 establisch connection to driver that is attached to hardware that controls that physical port
3 have proper terminal settins

then it should work

if you plug to wrong connector, or open wrong device then there would be no messages















Mythili

  • Active Member
  • *
  • Posts: 8
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #20 on: October 30, 2015, 07:21:35 AM »
Hello Lukats,

Thanks for your response.
I will check the same.

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #21 on: November 05, 2015, 12:10:19 AM »
I'm now looking at your TE0715 and TE0730 and the eMMC is not listed as being on the module.  Has the eMMC been eliminated from these newer modules?

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #22 on: November 05, 2015, 08:38:03 AM »
TE0715 has no on-board eMMC

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #23 on: November 07, 2015, 04:22:58 PM »
Examining the TE0715 schematics I find that MIO46-MIO51 that had been connected to the eMMC on the TE0720 have been given over to other uses on the TE0715 and those signals do not even appear on the B2B connectors.  So if we were to design a board for the TE0715 we could have an SD card OR an eMMC but not both.  Is that correct?

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #24 on: November 07, 2015, 04:32:16 PM »
Examining the TE0715 schematics I find that MIO46-MIO51 that had been connected to the eMMC on the TE0720 have been given over to other uses on the TE0715 and those signals do not even appear on the B2B connectors.  So if we were to design a board for the TE0715 we could have an SD card OR an eMMC but not both.  Is that correct?

Dear Dan,

your questions are not much related to the TOPIC what is about TE0720, if you have questions about TE0715 it would be better to ask them separately.

Anyway I answer here too:

1 On TE0715 you can not use on-board eMMC as there is NONE
2 On TE0715 you can not connect eMMC to the same pins as TE0715 as those pins are not on the B2B
3 You can use TE0715 with eMMC if you want:

option 1

if you use 2 channel SD card level shifter, like on TE0701, then you can connected SD to one channel and eMMC to another. Then you can say always boot from SD if SD is there, and later either continue using SD or switch and use eMMC. Using at same time would not be possible.

option 2

you connect eMMC to PL pins and route SDIO1 via EMIO, in that case you can use both at the same time.

Both options you can test out on TE0701 by connecting eMMC to different PMod slots.

Please understand that TE0720 and TE0715 are DIFFERENT products and not 100% compatible on all features.

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #25 on: November 07, 2015, 04:42:35 PM »
Okay- thanks for the clarification.  What carrier boards can we use with the TE07015?  Can we just use your standard TE0701 or TE0703 ?

Xiao Chen

  • Active Member
  • *
  • Posts: 6
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #26 on: November 09, 2015, 09:01:19 AM »
Okay- thanks for the clarification.  What carrier boards can we use with the TE07015?  Can we just use your standard TE0701 or TE0703 ?

yes, you can use TE0701 or TE0703 as carrier board for TE0715

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #27 on: November 09, 2015, 09:11:44 AM »
yes, you can use TE0701 or TE0703 as carrier board for TE0715

please note that TE0715 -30 is assembled with Z030 Zynq with HP banks, those banks must be powered 1.8V or lower, for this reason on TE0701 ALL banks must have 1.8 VCCIO. On TE0701 this limitation does not apply.

TE0715-xx-15 has only HR banks so you can use 3.3V also in all banks.

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #28 on: November 09, 2015, 05:57:38 PM »
Okay thanks.  You seem to be saying is that while the TE0715-xx-15 can be used safely in either the TE0701 or TE0703 the TE0715-xx-30 cannot be used safely in the TE0703 ans can only be used safely in the TE0701 provided that all banks are powered at 1.8V- is that correct?  Can that bank powering scheme on the TE0701 be accomplished by some set of jumper settings?  I looked at the TE0701 manual and it was not clear what needed to be done to put all banks at 1.8V.

Antti Lukats

  • Sr. Member
  • ****
  • Posts: 482
    • Trioflex
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #29 on: November 09, 2015, 06:33:09 PM »
Okay thanks.  You seem to be saying is that while the TE0715-xx-15 can be used safely in either the TE0701 or TE0703 the TE0715-xx-30 cannot be used safely in the TE0703 ans can only be used safely in the TE0701 provided that all banks are powered at 1.8V- is that correct?  Can that bank powering scheme on the TE0701 be accomplished by some set of jumper settings?  I looked at the TE0701 manual and it was not clear what needed to be done to put all banks at 1.8V.

its ok on 701 und 703, only need pay attention on bank powering

danwwright

  • Jr. Member
  • **
  • Posts: 70
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #30 on: November 09, 2015, 07:03:14 PM »
Okay- but again HOW can we adjust the bank powering on those boards?  Can this be done with jumper settings (WHICH jumpers?) or will the boards need to be modified via cuts and and jumper rework?  The documentation on the TE0701 or TE0703 don't detail how this might be done.


Xiao Chen

  • Active Member
  • *
  • Posts: 6
Re: TE0720 boot from QSPI and Linux mount a rootfs in eMMC
« Reply #31 on: November 10, 2015, 10:05:25 AM »
Okay- but again HOW can we adjust the bank powering on those boards?  Can this be done with jumper settings (WHICH jumpers?) or will the boards need to be modified via cuts and and jumper rework?  The documentation on the TE0701 or TE0703 don't detail how this might be done.



for TE0701 you need to do these:
1. Remove J17
2. Install J21 jumper on pins 2-3, supply from FMC_VADJ supply
3. Reprogram TE0701 CPLD with design that uses fixed 1.8V as always on FMC_VADJ
And all I/O banks on TE0701 must be powered with 1.8V. It is not possible to power the HR bank with
separate supply.