mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* MMC prepare for zynq
@ 2025-07-03  7:18 Gwenhael Goavec-Merou
  2025-07-04 14:56 ` Ahmad Fatoum
  0 siblings, 1 reply; 5+ messages in thread
From: Gwenhael Goavec-Merou @ 2025-07-03  7:18 UTC (permalink / raw)
  To: barebox

Dear all,

I'm trying to uses my zedboard with barebox but can't be able to boot this.

According to mails found in this mailing list I have done this sequence:

export ARCH=arm
export CROSS_COMPILE=$SOMEWHERE/arm-buildroot-linux-gnueabihf-

make zynq_defconfig
make -j$(nproc)

And copied in the first SDCard FAT partition:
- images/barebox-avnet-zedboard.img as BOOT.bin
- barebox.bin

But I have nothing displayed through serial port.

Are there somewhere details on how to prepare SD Card for a zynq board?

Thanks

Gwenhael



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMC prepare for zynq
  2025-07-03  7:18 MMC prepare for zynq Gwenhael Goavec-Merou
@ 2025-07-04 14:56 ` Ahmad Fatoum
  2025-07-04 17:38   ` Johannes Roith
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmad Fatoum @ 2025-07-04 14:56 UTC (permalink / raw)
  To: Gwenhael Goavec-Merou, barebox; +Cc: johannes

Hi Gwenhael,

On 7/3/25 09:18, Gwenhael Goavec-Merou wrote:
> Dear all,
> 
> I'm trying to uses my zedboard with barebox but can't be able to boot this.
> 
> According to mails found in this mailing list I have done this sequence:
> 
> export ARCH=arm
> export CROSS_COMPILE=$SOMEWHERE/arm-buildroot-linux-gnueabihf-
> 
> make zynq_defconfig
> make -j$(nproc)

That looks correct IMO.

> And copied in the first SDCard FAT partition:
> - images/barebox-avnet-zedboard.img as BOOT.bin
> - barebox.bin

Which binary is barebox.bin?

> But I have nothing displayed through serial port.

Two things come to mind:

- The Image is 184K. Does the Zynq enforce a maximum limit on the BOOT.BIN?

- Does DEBUG_LL produce any output? For details on how to configure
DEBUG_LL, see the troubleshooting guide I just Cc'd you on.

> Are there somewhere details on how to prepare SD Card for a zynq board?

I haven't done work with the Zynq 7000 so far, but Lucas and Johannes
did. I Cc'd them as they may be able to give some tips for troubleshooting.

Cheers,
Ahmad

> 
> Thanks
> 
> Gwenhael
> 
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMC prepare for zynq
  2025-07-04 14:56 ` Ahmad Fatoum
@ 2025-07-04 17:38   ` Johannes Roith
  2025-07-05  7:01     ` Gwenhael Goavec-Merou
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Roith @ 2025-07-04 17:38 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

Hi Gwenhael, hi Ahmad

Am Fri, Jul 04, 2025 at 04:56:01PM +0200 schrieb Ahmad Fatoum:
> Hi Gwenhael,
> 
> On 7/3/25 09:18, Gwenhael Goavec-Merou wrote:
> > Dear all,
> > 
> > I'm trying to uses my zedboard with barebox but can't be able to boot this.
> > 
> > According to mails found in this mailing list I have done this sequence:
> > 
> > export ARCH=arm
> > export CROSS_COMPILE=$SOMEWHERE/arm-buildroot-linux-gnueabihf-
> > 
> > make zynq_defconfig
> > make -j$(nproc)
> 
> That looks correct IMO.
> 
> > And copied in the first SDCard FAT partition:
> > - images/barebox-avnet-zedboard.img as BOOT.bin
> > - barebox.bin
> 
> Which binary is barebox.bin?

The first one is the correct one. Just copy the images/barebox-avnet-zedboard.img
with the name BOOT.bin to an SD-Card whose first partition is FAT32.
> 
> > But I have nothing displayed through serial port.
> 
> Two things come to mind:
> 
> - The Image is 184K. Does the Zynq enforce a maximum limit on the BOOT.BIN?

Yes, there is a limitation for the size of the First Stage Bootloader
(FSBL) as Xilinx calls it, which is the available SRAM size in the ZYNQ
7000 (192 kBytes). Currently Barebox PBL and Barebox Proper are combined
to one image (images/barebox-avnet-zedboard.img) but you will get an
error in the build process, if your image exceeds this size.
> 
> - Does DEBUG_LL produce any output? For details on how to configure
> DEBUG_LL, see the troubleshooting guide I just Cc'd you on.
> 
> > Are there somewhere details on how to prepare SD Card for a zynq board?
> 
> I haven't done work with the Zynq 7000 so far, but Lucas and Johannes
> did. I Cc'd them as they may be able to give some tips for troubleshooting.

I would also take a look at this message on the mailing list:

https://lore.barebox.org/barebox/DB7PR02MB43323CD77E0507E560475BCAABF00@DB7PR02MB4332.eurprd02.prod.outlook.com/

Here, the content of the file
arch/arm/boards/avnet-zedboard/zedboard.zynqcfg caused a boot error for
barebox. With my Digilent Cora Z7 board, I also had to modify the file
by deleting everything but the last line, to get barebox booting. Have
you already tried this?

> 
> Cheers,
> Ahmad
> 
> > 
> > Thanks
> > 
> > Gwenhael
> > 
> > 
> 
> -- 
> Pengutronix e.K.                  |                             |
> Steuerwalder Str. 21              | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
> 

Best regards,
Johannes



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMC prepare for zynq
  2025-07-04 17:38   ` Johannes Roith
@ 2025-07-05  7:01     ` Gwenhael Goavec-Merou
  2025-07-05 11:57       ` Johannes Roith
  0 siblings, 1 reply; 5+ messages in thread
From: Gwenhael Goavec-Merou @ 2025-07-05  7:01 UTC (permalink / raw)
  To: Johannes Roith, Ahmad Fatoum; +Cc: barebox

Hi,
Thanks for informations: after deleting everything but the last two lines, 
barebox starts has expected.
Now I have and error with SDCard but maybe related to lines removes or something 
similar.

Thanks!

Gwenhael

Le 04/07/2025 à 7:38 PM, Johannes Roith a écrit :
> Hi Gwenhael, hi Ahmad
> 
> Am Fri, Jul 04, 2025 at 04:56:01PM +0200 schrieb Ahmad Fatoum:
>> Hi Gwenhael,
>>
>> On 7/3/25 09:18, Gwenhael Goavec-Merou wrote:
>>> Dear all,
>>>
>>> I'm trying to uses my zedboard with barebox but can't be able to boot this.
>>>
>>> According to mails found in this mailing list I have done this sequence:
>>>
>>> export ARCH=arm
>>> export CROSS_COMPILE=$SOMEWHERE/arm-buildroot-linux-gnueabihf-
>>>
>>> make zynq_defconfig
>>> make -j$(nproc)
>>
>> That looks correct IMO.
>>
>>> And copied in the first SDCard FAT partition:
>>> - images/barebox-avnet-zedboard.img as BOOT.bin
>>> - barebox.bin
>>
>> Which binary is barebox.bin?
> 
> The first one is the correct one. Just copy the images/barebox-avnet-zedboard.img
> with the name BOOT.bin to an SD-Card whose first partition is FAT32.
>>
>>> But I have nothing displayed through serial port.
>>
>> Two things come to mind:
>>
>> - The Image is 184K. Does the Zynq enforce a maximum limit on the BOOT.BIN?
> 
> Yes, there is a limitation for the size of the First Stage Bootloader
> (FSBL) as Xilinx calls it, which is the available SRAM size in the ZYNQ
> 7000 (192 kBytes). Currently Barebox PBL and Barebox Proper are combined
> to one image (images/barebox-avnet-zedboard.img) but you will get an
> error in the build process, if your image exceeds this size.
>>
>> - Does DEBUG_LL produce any output? For details on how to configure
>> DEBUG_LL, see the troubleshooting guide I just Cc'd you on.
>>
>>> Are there somewhere details on how to prepare SD Card for a zynq board?
>>
>> I haven't done work with the Zynq 7000 so far, but Lucas and Johannes
>> did. I Cc'd them as they may be able to give some tips for troubleshooting.
> 
> I would also take a look at this message on the mailing list:
> 
> https://lore.barebox.org/barebox/DB7PR02MB43323CD77E0507E560475BCAABF00@DB7PR02MB4332.eurprd02.prod.outlook.com/
> 
> Here, the content of the file
> arch/arm/boards/avnet-zedboard/zedboard.zynqcfg caused a boot error for
> barebox. With my Digilent Cora Z7 board, I also had to modify the file
> by deleting everything but the last line, to get barebox booting. Have
> you already tried this?
> 
>>
>> Cheers,
>> Ahmad
>>
>>>
>>> Thanks
>>>
>>> Gwenhael
>>>
>>>
>>
>> -- 
>> Pengutronix e.K.                  |                             |
>> Steuerwalder Str. 21              | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
>>
> 
> Best regards,
> Johannes




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: MMC prepare for zynq
  2025-07-05  7:01     ` Gwenhael Goavec-Merou
@ 2025-07-05 11:57       ` Johannes Roith
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Roith @ 2025-07-05 11:57 UTC (permalink / raw)
  To: Gwenhael Goavec-Merou; +Cc: barebox, Ahmad Fatoum

Hi,

Am Sat, Jul 05, 2025 at 09:01:38AM +0200 schrieb Gwenhael Goavec-Merou:
> Hi,
> Thanks for informations: after deleting everything but the last two lines,
> barebox starts has expected.

Sounds good. So, you are getting to barebox 3 second countdown and you
can activate the hush shell, right?

> Now I have and error with SDCard but maybe related to lines removes or
> something similar.

I also got some errors with the SD-Cards on my Digilent Cora Z7 Board. 

One error was that the Chip Detect and Write Protect pins where not set
correctly in the pinmux. I had to add the following line to lowlevel.c
to resolve this:

	/* Set SD Detect and Write Protect Pin to 47 */
	writel(0x002f002f, 0xF8000830);

My board had a micro-SD card slot with no Write Protect pin. That is why
I used MIO47 for both CD and WP. On your board, you have a Write protect
pin available, so you can set the register to 0x002f002e.

The second error I faced was, that the clock for the SD card IP was set
too low. By increasing it to 250 MHz, it worked properly.

The clock divider selection is done over the following register also in
lowlevel.c:

	writel(0x00000401, ZYNQ_CLOCK_CTRL_BASE + ZYNQ_SDIO_CLK_CTRL);

Maybe tinkering with this value also helps you to boot from the SD Card.

If you are getting it working, maybe submitting a patch with your
changes would be a good idea to make it easier for others to use barebox
with the Zedboard.

Best regards,
Johannes

> 
> Thanks!
> 
> Gwenhael
> 
> Le 04/07/2025 à 7:38 PM, Johannes Roith a écrit :
> > Hi Gwenhael, hi Ahmad
> > 
> > Am Fri, Jul 04, 2025 at 04:56:01PM +0200 schrieb Ahmad Fatoum:
> > > Hi Gwenhael,
> > > 
> > > On 7/3/25 09:18, Gwenhael Goavec-Merou wrote:
> > > > Dear all,
> > > > 
> > > > I'm trying to uses my zedboard with barebox but can't be able to boot this.
> > > > 
> > > > According to mails found in this mailing list I have done this sequence:
> > > > 
> > > > export ARCH=arm
> > > > export CROSS_COMPILE=$SOMEWHERE/arm-buildroot-linux-gnueabihf-
> > > > 
> > > > make zynq_defconfig
> > > > make -j$(nproc)
> > > 
> > > That looks correct IMO.
> > > 
> > > > And copied in the first SDCard FAT partition:
> > > > - images/barebox-avnet-zedboard.img as BOOT.bin
> > > > - barebox.bin
> > > 
> > > Which binary is barebox.bin?
> > 
> > The first one is the correct one. Just copy the images/barebox-avnet-zedboard.img
> > with the name BOOT.bin to an SD-Card whose first partition is FAT32.
> > > 
> > > > But I have nothing displayed through serial port.
> > > 
> > > Two things come to mind:
> > > 
> > > - The Image is 184K. Does the Zynq enforce a maximum limit on the BOOT.BIN?
> > 
> > Yes, there is a limitation for the size of the First Stage Bootloader
> > (FSBL) as Xilinx calls it, which is the available SRAM size in the ZYNQ
> > 7000 (192 kBytes). Currently Barebox PBL and Barebox Proper are combined
> > to one image (images/barebox-avnet-zedboard.img) but you will get an
> > error in the build process, if your image exceeds this size.
> > > 
> > > - Does DEBUG_LL produce any output? For details on how to configure
> > > DEBUG_LL, see the troubleshooting guide I just Cc'd you on.
> > > 
> > > > Are there somewhere details on how to prepare SD Card for a zynq board?
> > > 
> > > I haven't done work with the Zynq 7000 so far, but Lucas and Johannes
> > > did. I Cc'd them as they may be able to give some tips for troubleshooting.
> > 
> > I would also take a look at this message on the mailing list:
> > 
> > https://lore.barebox.org/barebox/DB7PR02MB43323CD77E0507E560475BCAABF00@DB7PR02MB4332.eurprd02.prod.outlook.com/
> > 
> > Here, the content of the file
> > arch/arm/boards/avnet-zedboard/zedboard.zynqcfg caused a boot error for
> > barebox. With my Digilent Cora Z7 board, I also had to modify the file
> > by deleting everything but the last line, to get barebox booting. Have
> > you already tried this?
> > 
> > > 
> > > Cheers,
> > > Ahmad
> > > 
> > > > 
> > > > Thanks
> > > > 
> > > > Gwenhael
> > > > 
> > > > 
> > > 
> > > -- 
> > > Pengutronix e.K.                  |                             |
> > > Steuerwalder Str. 21              | http://www.pengutronix.de/  |
> > > 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
> > > Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
> > > 
> > 
> > Best regards,
> > Johannes
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-05 11:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-03  7:18 MMC prepare for zynq Gwenhael Goavec-Merou
2025-07-04 14:56 ` Ahmad Fatoum
2025-07-04 17:38   ` Johannes Roith
2025-07-05  7:01     ` Gwenhael Goavec-Merou
2025-07-05 11:57       ` Johannes Roith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox