All of lore.kernel.org
 help / color / mirror / Atom feed
* eMMC support
@ 2020-09-16 18:30 Sai Pavan Boddu
  2020-09-17  0:55 ` Joel Stanley
  0 siblings, 1 reply; 16+ messages in thread
From: Sai Pavan Boddu @ 2020-09-16 18:30 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Edgar Iglesias, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

Hi Philippe,

We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by "Vincent Palatin"
https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html

I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?

Note: Here is the existing support available in Xilinx fork, which might require some work
https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c

Regards,
Sai Pavan

[-- Attachment #2: Type: text/html, Size: 2614 bytes --]

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

* Re: eMMC support
  2020-09-16 18:30 eMMC support Sai Pavan Boddu
@ 2020-09-17  0:55 ` Joel Stanley
  2020-09-17  6:25   ` Cédric Le Goater
  2020-09-21 10:29   ` Sai Pavan Boddu
  0 siblings, 2 replies; 16+ messages in thread
From: Joel Stanley @ 2020-09-17  0:55 UTC (permalink / raw)
  To: Sai Pavan Boddu, Cédric Le Goater
  Cc: Edgar Iglesias, Philippe Mathieu-Daudé, qemu-devel

On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com> wrote:
>
> Hi Philippe,
>
>
>
> We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by “Vincent Palatin”
>
> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html

I would be interested in emmc support for the aspeed machines. Please
cc me when you post patches.

> I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?

The patches had minor review comments, but I assume the reason they
didn't go anywhere is the author never followed up with further
revisions. I would suggest applying them to the current tree, cleaning
up any style changes that have happened since they were posted, and
re-posting them for review.

Cheers,

Joel

>
>
>
> Note: Here is the existing support available in Xilinx fork, which might require some work
> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
>
>
>
> Regards,
> Sai Pavan


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

* Re: eMMC support
  2020-09-17  0:55 ` Joel Stanley
@ 2020-09-17  6:25   ` Cédric Le Goater
  2020-09-21 10:27     ` Sai Pavan Boddu
  2021-01-20  8:55     ` Cédric Le Goater
  2020-09-21 10:29   ` Sai Pavan Boddu
  1 sibling, 2 replies; 16+ messages in thread
From: Cédric Le Goater @ 2020-09-17  6:25 UTC (permalink / raw)
  To: Joel Stanley, Sai Pavan Boddu
  Cc: Edgar Iglesias, Philippe Mathieu-Daudé, qemu-devel

On 9/17/20 2:55 AM, Joel Stanley wrote:
> On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com> wrote:
>>
>> Hi Philippe,
>>
>>
>>
>> We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by “Vincent Palatin”
>>
>> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
> 
> I would be interested in emmc support for the aspeed machines. Please
> cc me when you post patches.
> 
>> I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?
> 
> The patches had minor review comments, but I assume the reason they
> didn't go anywhere is the author never followed up with further
> revisions. I would suggest applying them to the current tree, cleaning
> up any style changes that have happened since they were posted, and
> re-posting them for review.

It seems we only care about these three patches :

  https://patchwork.ozlabs.org/patch/106762
  https://patchwork.ozlabs.org/patch/106761
  https://patchwork.ozlabs.org/patch/106763

It should not be too complex to get something going.
>> Note: Here is the existing support available in Xilinx fork, which might require some work
>> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c

What are the relevant patches ? 

Thanks,

C. 


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

* RE: eMMC support
  2020-09-17  6:25   ` Cédric Le Goater
@ 2020-09-21 10:27     ` Sai Pavan Boddu
  2021-01-20  8:55     ` Cédric Le Goater
  1 sibling, 0 replies; 16+ messages in thread
From: Sai Pavan Boddu @ 2020-09-21 10:27 UTC (permalink / raw)
  To: Cédric Le Goater, Joel Stanley
  Cc: Edgar Iglesias, Philippe Mathieu-Daudé, qemu-devel

Hi Cedric,

> -----Original Message-----
> From: Cédric Le Goater <clg@kaod.org>
> Sent: Thursday, September 17, 2020 11:55 AM
> To: Joel Stanley <joel@jms.id.au>; Sai Pavan Boddu <saipava@xilinx.com>
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>; Edgar Iglesias
> <edgari@xilinx.com>; qemu-devel@nongnu.org
> Subject: Re: eMMC support
> 
> On 9/17/20 2:55 AM, Joel Stanley wrote:
> > On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com>
> wrote:
> >>
> >> Hi Philippe,
> >>
> >>
> >>
> >> We are looking to add eMMC support, I searched the mailing list and
> found a series posted on eMMC by “Vincent Palatin”
> >>
> >> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
> >
> > I would be interested in emmc support for the aspeed machines. Please
> > cc me when you post patches.
> >
> >> I would like to consider the above work and mix-up with more changes to
> start adding support for eMMC. Do you have any suggestions on the
> approach followed in above patches ?
> >
> > The patches had minor review comments, but I assume the reason they
> > didn't go anywhere is the author never followed up with further
> > revisions. I would suggest applying them to the current tree, cleaning
> > up any style changes that have happened since they were posted, and
> > re-posting them for review.
> 
> It seems we only care about these three patches :
> 
>   https://patchwork.ozlabs.org/patch/106762
>   https://patchwork.ozlabs.org/patch/106761
>   https://patchwork.ozlabs.org/patch/106763
[Sai Pavan Boddu] Yeah, thanks for pointing. 
> 
> It should not be too complex to get something going.
> >> Note: Here is the existing support available in Xilinx fork, which
> >> might require some work
> >> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
> 
> What are the relevant patches ?
[Sai Pavan Boddu] I would send out a series merging both the works, to make it easy for review.

Thanks,
Sai Pavan
> 
> Thanks,
> 
> C.

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

* RE: eMMC support
  2020-09-17  0:55 ` Joel Stanley
  2020-09-17  6:25   ` Cédric Le Goater
@ 2020-09-21 10:29   ` Sai Pavan Boddu
  1 sibling, 0 replies; 16+ messages in thread
From: Sai Pavan Boddu @ 2020-09-21 10:29 UTC (permalink / raw)
  To: Joel Stanley, Cédric Le Goater
  Cc: Edgar Iglesias, Philippe Mathieu-Daudé, qemu-devel

Hi Joel,

> -----Original Message-----
> From: Joel Stanley <joel@jms.id.au>
> Sent: Thursday, September 17, 2020 6:25 AM
> To: Sai Pavan Boddu <saipava@xilinx.com>; Cédric Le Goater
> <clg@kaod.org>
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>; Edgar Iglesias
> <edgari@xilinx.com>; qemu-devel@nongnu.org
> Subject: Re: eMMC support
> 
> On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com>
> wrote:
> >
> > Hi Philippe,
> >
> >
> >
> > We are looking to add eMMC support, I searched the mailing list and found
> a series posted on eMMC by “Vincent Palatin”
> >
> > https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
> 
> I would be interested in emmc support for the aspeed machines. Please cc
> me when you post patches.
> 
> > I would like to consider the above work and mix-up with more changes to
> start adding support for eMMC. Do you have any suggestions on the
> approach followed in above patches ?
> 
> The patches had minor review comments, but I assume the reason they
> didn't go anywhere is the author never followed up with further revisions. I
> would suggest applying them to the current tree, cleaning up any style
> changes that have happened since they were posted, and re-posting them
> for review.
[Sai Pavan Boddu] Ok thanks. I will re-post the patches mixing up with some of our work.

Regards,
Sai Pavan
> 
> Cheers,
> 
> Joel
> 
> >
> >
> >
> > Note: Here is the existing support available in Xilinx fork, which
> > might require some work
> > https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
> >
> >
> >
> > Regards,
> > Sai Pavan

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

* Re: eMMC support
  2020-09-17  6:25   ` Cédric Le Goater
  2020-09-21 10:27     ` Sai Pavan Boddu
@ 2021-01-20  8:55     ` Cédric Le Goater
  2021-01-20 16:00       ` Edgar Iglesias
  1 sibling, 1 reply; 16+ messages in thread
From: Cédric Le Goater @ 2021-01-20  8:55 UTC (permalink / raw)
  To: Joel Stanley, Sai Pavan Boddu
  Cc: Edgar Iglesias, Philippe Mathieu-Daudé, qemu-devel

On 9/17/20 8:25 AM, Cédric Le Goater wrote:
> On 9/17/20 2:55 AM, Joel Stanley wrote:
>> On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com> wrote:
>>>
>>> Hi Philippe,
>>>
>>>
>>>
>>> We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by “Vincent Palatin”
>>>
>>> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
>>
>> I would be interested in emmc support for the aspeed machines. Please
>> cc me when you post patches.
>>
>>> I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?
>>
>> The patches had minor review comments, but I assume the reason they
>> didn't go anywhere is the author never followed up with further
>> revisions. I would suggest applying them to the current tree, cleaning
>> up any style changes that have happened since they were posted, and
>> re-posting them for review.
> 
> It seems we only care about these three patches :
> 
>   https://patchwork.ozlabs.org/patch/106762
>   https://patchwork.ozlabs.org/patch/106761
>   https://patchwork.ozlabs.org/patch/106763
> 
> It should not be too complex to get something going.
>>> Note: Here is the existing support available in Xilinx fork, which might require some work
>>> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
> 
> What are the relevant patches ? 

FYI, aspeed machines successfully boot on top of 16G emmc disk images.
I merged some of xilinx patches on top of the aspeed-6.0 branch to 
improve the model completeness but only the one fixing powerup was 
really necessary. 

The initial diffstat is rather small.

 hw/sd/sd.c             |  168 ++++++++++++++++++++++++++++++++++++++++++-------

We can surely find a way to merge support in mainline without 
covering the whole specs. The Extended CSD register would be the 
big part.

See :

   https://github.com/legoater/qemu/commits/aspeed-6.0

Cheers,

C.


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

* Re: eMMC support
  2021-01-20  8:55     ` Cédric Le Goater
@ 2021-01-20 16:00       ` Edgar Iglesias
  2021-02-01 17:55         ` Sai Pavan Boddu
  0 siblings, 1 reply; 16+ messages in thread
From: Edgar Iglesias @ 2021-01-20 16:00 UTC (permalink / raw)
  To: Cédric Le Goater, Sai Pavan Boddu, Joel Stanley
  Cc: qemu-devel, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]


On 20 Jan 2021 09:55, Cédric Le Goater <clg@kaod.org> wrote:
>
> On 9/17/20 8:25 AM, Cédric Le Goater wrote:
> > On 9/17/20 2:55 AM, Joel Stanley wrote:
> >> On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com> wrote:
> >>>
> >>> Hi Philippe,
> >>>
> >>>
> >>>
> >>> We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by “Vincent Palatin”
> >>>
> >>> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
> >>
> >> I would be interested in emmc support for the aspeed machines. Please
> >> cc me when you post patches.
> >>
> >>> I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?
> >>
> >> The patches had minor review comments, but I assume the reason they
> >> didn't go anywhere is the author never followed up with further
> >> revisions. I would suggest applying them to the current tree, cleaning
> >> up any style changes that have happened since they were posted, and
> >> re-posting them for review.
> >
> > It seems we only care about these three patches :
> >
> >   https://patchwork.ozlabs.org/patch/106762
> >   https://patchwork.ozlabs.org/patch/106761
> >   https://patchwork.ozlabs.org/patch/106763
> >
> > It should not be too complex to get something going.
> >>> Note: Here is the existing support available in Xilinx fork, which might require some work
> >>> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
> >
> > What are the relevant patches ?
>
> FYI, aspeed machines successfully boot on top of 16G emmc disk images.
> I merged some of xilinx patches on top of the aspeed-6.0 branch to
> improve the model completeness but only the one fixing powerup was
> really necessary.
>
> The initial diffstat is rather small.
>
>  hw/sd/sd.c             |  168 ++++++++++++++++++++++++++++++++++++++++++-------
>
> We can surely find a way to merge support in mainline without
> covering the whole specs. The Extended CSD register would be the
> big part.

Thanks Cedric, that would be great!
Feel free to submit any of our patches for merge in upstream. Or perhaps Sai can submit and you guys can help with reviewing.

We've had upstreaming of eMMC on our todo list for a while but never seem to find the time.

Best regards,
Edgar


>
> See :
>
>    https://github.com/legoater/qemu/commits/aspeed-6.0
>
> Cheers,
>
> C.


[-- Attachment #2: Type: text/html, Size: 4524 bytes --]

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

* RE: eMMC support
  2021-01-20 16:00       ` Edgar Iglesias
@ 2021-02-01 17:55         ` Sai Pavan Boddu
  2021-02-01 22:01           ` Cédric Le Goater
  0 siblings, 1 reply; 16+ messages in thread
From: Sai Pavan Boddu @ 2021-02-01 17:55 UTC (permalink / raw)
  To: Edgar Iglesias, Cédric Le Goater, Joel Stanley
  Cc: qemu-devel, Philippe Mathieu-Daudé

[-- Attachment #1: Type: text/plain, Size: 3093 bytes --]

Hi Cédric

From: Edgar Iglesias <edgari@xilinx.com>
Sent: Wednesday, January 20, 2021 9:30 PM
To: Cédric Le Goater <clg@kaod.org>; Sai Pavan Boddu <saipava@xilinx.com>; Joel Stanley <joel@jms.id.au>
Cc: qemu-devel@nongnu.org; Philippe Mathieu-Daudé <f4bug@amsat.org>
Subject: Re: eMMC support


On 20 Jan 2021 09:55, Cédric Le Goater <clg@kaod.org<mailto:clg@kaod.org>> wrote:
>
> On 9/17/20 8:25 AM, Cédric Le Goater wrote:
> > On 9/17/20 2:55 AM, Joel Stanley wrote:
> >> On Wed, 16 Sep 2020 at 18:35, Sai Pavan Boddu <saipava@xilinx.com<mailto:saipava@xilinx.com>> wrote:
> >>>
> >>> Hi Philippe,
> >>>
> >>>
> >>>
> >>> We are looking to add eMMC support, I searched the mailing list and found a series posted on eMMC by “Vincent Palatin”
> >>>
> >>> https://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02833.html
> >>
> >> I would be interested in emmc support for the aspeed machines. Please
> >> cc me when you post patches.
> >>
> >>> I would like to consider the above work and mix-up with more changes to start adding support for eMMC. Do you have any suggestions on the approach followed in above patches ?
> >>
> >> The patches had minor review comments, but I assume the reason they
> >> didn't go anywhere is the author never followed up with further
> >> revisions. I would suggest applying them to the current tree, cleaning
> >> up any style changes that have happened since they were posted, and
> >> re-posting them for review.
> >
> > It seems we only care about these three patches :
> >
> >   https://patchwork.ozlabs.org/patch/106762
> >   https://patchwork.ozlabs.org/patch/106761
> >   https://patchwork.ozlabs.org/patch/106763
> >
> > It should not be too complex to get something going.
> >>> Note: Here is the existing support available in Xilinx fork, which might require some work
> >>> https://github.com/Xilinx/qemu/blob/master/hw/sd/sd.c
> >
> > What are the relevant patches ?
>
> FYI, aspeed machines successfully boot on top of 16G emmc disk images.
> I merged some of xilinx patches on top of the aspeed-6.0 branch to
> improve the model completeness but only the one fixing powerup was
> really necessary.
>
> The initial diffstat is rather small.
>
>  hw/sd/sd.c             |  168 ++++++++++++++++++++++++++++++++++++++++++-------
>
> We can surely find a way to merge support in mainline without
> covering the whole specs. The Extended CSD register would be the
> big part.
[Sai Pavan Boddu] I’m revisiting eMMC now, made some patches on top of previous series sent by “Vincent Palatin”.
Would you like to share your changes, which made aspeed machines to work ?

Regards,
Sai Pavan

Thanks Cedric, that would be great!
Feel free to submit any of our patches for merge in upstream. Or perhaps Sai can submit and you guys can help with reviewing.

We've had upstreaming of eMMC on our todo list for a while but never seem to find the time.

Best regards,
Edgar

>
> See :
>
>    https://github.com/legoater/qemu/commits/aspeed-6.0
>
> Cheers,
>
> C.


[-- Attachment #2: Type: text/html, Size: 9691 bytes --]

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

* Re: eMMC support
  2021-02-01 17:55         ` Sai Pavan Boddu
@ 2021-02-01 22:01           ` Cédric Le Goater
  2021-02-01 22:06             ` Cédric Le Goater
  0 siblings, 1 reply; 16+ messages in thread
From: Cédric Le Goater @ 2021-02-01 22:01 UTC (permalink / raw)
  To: Sai Pavan Boddu, Edgar Iglesias, Joel Stanley, Andrew Jeffery
  Cc: qemu-devel, Philippe Mathieu-Daudé

Hello, 

>> FYI, aspeed machines successfully boot on top of 16G emmc disk images.
>> I merged some of xilinx patches on top of the aspeed-6.0 branch to
>> improve the model completeness but only the one fixing powerup was
>> really necessary.
>> 
>> The initial diffstat is rather small.
>> 
>>  hw/sd/sd.c             |  168 ++++++++++++++++++++++++++++++++++++++++++-------
>> 
>> We can surely find a way to merge support in mainline without
>> covering the whole specs. The Extended CSD register would be the
>> big part.
> 
> */[Sai Pavan Boddu] I’m revisiting eMMC now, made some patches on top of previous series sent by “Vincent Palatin”./*
> 
> */Would you like to share your changes, which made aspeed machines to work ?/*
> 
> */Regards,
> Sai Pavan/*

The patchset is in the aspeed-6.0 branch : 

    df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot area as a boot rom
    27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
    2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
    42c9d57f5cd0 Joel Stanley - sd: mmc: Subtract bootarea size from blk
    218301406607 Joel Stanley - sd: mmc: Support boot area in emmc image
    df0452923b56 Cédric Le Goater - sd: mmc: Add Extended CSD register definitions
    416c02bbfd32 Sai Pavan Boddu - sd: mmc: Add mmc switch function support
    a228aef1a209 Sai Pavan Boddu - sd: mmc: add CMD21 tuning sequence
    9b177d7baf8e Sai Pavan Boddu - sd: mmc: Update CMD1 definition for MMC
    6677e4eb6812 Vincent Palatin - sd: add eMMC support
    
Also based on Vincent Palatin initial patches, reworked by Joel and I.

Booting an aspeed machine requires a bit of work since you need to build
an eMMc disk image with uboot in the boot partitions. 

Here is a little script from Joel to get you going.

Thanks,

C.


#!/bin/sh

URLBASE=https://jenkins.openbmc.org/view/latest/job/latest-master/label=docker-builder,target=witherspoon-tacoma/lastSuccessfulBuild/artifact/openbmc/build/tmp/deploy/images/witherspoon-tacoma/

IMAGESIZE=128
OUTFILE=mmc.img

FILES="u-boot.bin u-boot-spl.bin obmc-phosphor-image-witherspoon-tacoma.wic.xz"

for file in ${FILES}; do

	if test -f ${file}; then
		echo "${file}: Already downloaded"
	else
		echo "${file}: Downloading"
		wget -nv ${URLBASE}/${file}
	fi
done

echo

echo "Creating empty image..."
dd status=none if=/dev/zero of=${OUTFILE} bs=1M count=${IMAGESIZE}
echo "Adding SPL..."
dd status=none if=u-boot-spl.bin of=${OUTFILE} conv=notrunc
echo "Adding u-boot..."
dd status=none if=u-boot.bin of=${OUTFILE} conv=notrunc bs=1K seek=64
echo "Adding userdata..."
unxz -c obmc-phosphor-image-witherspoon-tacoma.wic.xz | dd status=progress of=${OUTFILE} conv=notrunc bs=1M seek=2
echo "Fixing size to keep qemu happy..."
truncate --size 16G ${OUTFILE}

echo "Done!"
echo
echo " qemu-system-arm -M tacoma-bmc -nographic -drive file=mmc.img,if=sd,index=2,format=raw"



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

* Re: eMMC support
  2021-02-01 22:01           ` Cédric Le Goater
@ 2021-02-01 22:06             ` Cédric Le Goater
  2021-02-09 19:39               ` Sai Pavan Boddu
  0 siblings, 1 reply; 16+ messages in thread
From: Cédric Le Goater @ 2021-02-01 22:06 UTC (permalink / raw)
  To: Sai Pavan Boddu, Edgar Iglesias, Joel Stanley, Andrew Jeffery
  Cc: qemu-devel, Philippe Mathieu-Daudé

On 2/1/21 11:01 PM, Cédric Le Goater wrote:
> Hello, 
> 
>>> FYI, aspeed machines successfully boot on top of 16G emmc disk images.
>>> I merged some of xilinx patches on top of the aspeed-6.0 branch to
>>> improve the model completeness but only the one fixing powerup was
>>> really necessary.
>>>  
>>> The initial diffstat is rather small.
>>>  
>>>  hw/sd/sd.c             |  168 ++++++++++++++++++++++++++++++++++++++++++-------
>>>  
>>> We can surely find a way to merge support in mainline without
>>> covering the whole specs. The Extended CSD register would be the
>>> big part.
>>
>> */[Sai Pavan Boddu] I’m revisiting eMMC now, made some patches on top of previous series sent by “Vincent Palatin”./*
>>
>> */Would you like to share your changes, which made aspeed machines to work ?/*
>>
>> */Regards,
>> Sai Pavan/*
> 
> The patchset is in the aspeed-6.0 branch : 
> 
>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot area as a boot rom
>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
>     42c9d57f5cd0 Joel Stanley - sd: mmc: Subtract bootarea size from blk
>     218301406607 Joel Stanley - sd: mmc: Support boot area in emmc image
>     df0452923b56 Cédric Le Goater - sd: mmc: Add Extended CSD register definitions
>     416c02bbfd32 Sai Pavan Boddu - sd: mmc: Add mmc switch function support
>     a228aef1a209 Sai Pavan Boddu - sd: mmc: add CMD21 tuning sequence
>     9b177d7baf8e Sai Pavan Boddu - sd: mmc: Update CMD1 definition for MMC
>     6677e4eb6812 Vincent Palatin - sd: add eMMC support

here : 

https://github.com/legoater/qemu/commits/aspeed-6.0

C.



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

* RE: eMMC support
  2021-02-01 22:06             ` Cédric Le Goater
@ 2021-02-09 19:39               ` Sai Pavan Boddu
  2021-02-10  9:56                 ` Cédric Le Goater
  0 siblings, 1 reply; 16+ messages in thread
From: Sai Pavan Boddu @ 2021-02-09 19:39 UTC (permalink / raw)
  To: Cédric Le Goater, Edgar Iglesias, Joel Stanley, Andrew Jeffery
  Cc: qemu-devel, Philippe Mathieu-Daudé

Hi Cedric,

> -----Original Message-----
> From: Cédric Le Goater <clg@kaod.org>
> Sent: Tuesday, February 2, 2021 3:37 AM
> To: Sai Pavan Boddu <saipava@xilinx.com>; Edgar Iglesias <edgari@xilinx.com>;
> Joel Stanley <joel@jms.id.au>; Andrew Jeffery <andrew@aj.id.au>
> Cc: qemu-devel@nongnu.org; Philippe Mathieu-Daudé <f4bug@amsat.org>
> Subject: Re: eMMC support
> 
> On 2/1/21 11:01 PM, Cédric Le Goater wrote:
> > Hello,
> >
> >>> FYI, aspeed machines successfully boot on top of 16G emmc disk images.
> >>> I merged some of xilinx patches on top of the aspeed-6.0 branch to
> >>> improve the model completeness but only the one fixing powerup was
> >>> really necessary.
> >>>
> >>> The initial diffstat is rather small.
> >>>
> >>>  hw/sd/sd.c             |  168
> >>> ++++++++++++++++++++++++++++++++++++++++++-------
> >>>
> >>> We can surely find a way to merge support in mainline without
> >>> covering the whole specs. The Extended CSD register would be the big
> >>> part.
> >>
> >> */[Sai Pavan Boddu] I’m revisiting eMMC now, made some patches on top
> >> of previous series sent by “Vincent Palatin”./*
> >>
> >> */Would you like to share your changes, which made aspeed machines to
> >> work ?/*
> >>
> >> */Regards,
> >> Sai Pavan/*
> >
> > The patchset is in the aspeed-6.0 branch :
> >
> >     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot
> area as a boot rom
> >     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
> >     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
[Sai Pavan Boddu] I see you guys have implemented the boot area access here,
I was assuming, your use-case just need to access data from boot partitions.
We are not implementing eMMC boot operations or Alternative bootmode  right ?

And also is it good to calculate the address offset once when partition access bits are set, rather than doing it for every read/write ?

Regards,
Sai Pavan
> >     42c9d57f5cd0 Joel Stanley - sd: mmc: Subtract bootarea size from blk
> >     218301406607 Joel Stanley - sd: mmc: Support boot area in emmc image
> >     df0452923b56 Cédric Le Goater - sd: mmc: Add Extended CSD register
> definitions
> >     416c02bbfd32 Sai Pavan Boddu - sd: mmc: Add mmc switch function
> support
> >     a228aef1a209 Sai Pavan Boddu - sd: mmc: add CMD21 tuning sequence
> >     9b177d7baf8e Sai Pavan Boddu - sd: mmc: Update CMD1 definition for
> MMC
> >     6677e4eb6812 Vincent Palatin - sd: add eMMC support
> 
> here :
> 
> https://github.com/legoater/qemu/commits/aspeed-6.0
> 
> C.


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

* Re: eMMC support
  2021-02-09 19:39               ` Sai Pavan Boddu
@ 2021-02-10  9:56                 ` Cédric Le Goater
  2021-02-10 12:46                   ` Sai Pavan Boddu
  2021-02-10 13:05                   ` Joel Stanley
  0 siblings, 2 replies; 16+ messages in thread
From: Cédric Le Goater @ 2021-02-10  9:56 UTC (permalink / raw)
  To: Sai Pavan Boddu, Edgar Iglesias, Joel Stanley, Andrew Jeffery
  Cc: qemu-devel, Philippe Mathieu-Daudé

Hello Sai Pavan,

[ ... ] 

>>> The patchset is in the aspeed-6.0 branch :
>>>
>>>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot
>>>                                     area as a boot rom
>>>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
>>>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
>
> [Sai Pavan Boddu] I see you guys have implemented the boot area access here,

The boot partition modeling fits our needs to boot the Aspeed machine 
but this is very custom. 

> I was assuming, your use-case just need to access data from boot partitions.
> We are not implementing eMMC boot operations or Alternative bootmode right ?

Joel could say more about it ? 

> And also is it good to calculate the address offset once when partition 
> access bits are set, rather than doing it for every read/write ?

Yes and no. It would add state to the sd object.

Thanks,

C.


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

* RE: eMMC support
  2021-02-10  9:56                 ` Cédric Le Goater
@ 2021-02-10 12:46                   ` Sai Pavan Boddu
  2021-02-10 13:05                   ` Joel Stanley
  1 sibling, 0 replies; 16+ messages in thread
From: Sai Pavan Boddu @ 2021-02-10 12:46 UTC (permalink / raw)
  To: Cédric Le Goater, Edgar Iglesias, Joel Stanley, Andrew Jeffery
  Cc: qemu-devel, Philippe Mathieu-Daudé

Hi Cedric

> -----Original Message-----
> From: Cédric Le Goater <clg@kaod.org>
> Sent: Wednesday, February 10, 2021 3:27 PM
> To: Sai Pavan Boddu <saipava@xilinx.com>; Edgar Iglesias <edgari@xilinx.com>;
> Joel Stanley <joel@jms.id.au>; Andrew Jeffery <andrew@aj.id.au>
> Cc: qemu-devel@nongnu.org; Philippe Mathieu-Daudé <f4bug@amsat.org>
> Subject: Re: eMMC support
> 
> Hello Sai Pavan,
> 
> [ ... ]
> 
> >>> The patchset is in the aspeed-6.0 branch :
> >>>
> >>>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot
> >>>                                     area as a boot rom
> >>>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
> >>>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to
> >>> emmc
> >
> > [Sai Pavan Boddu] I see you guys have implemented the boot area access
> > here,
> 
> The boot partition modeling fits our needs to boot the Aspeed machine but
> this is very custom.
> 
> > I was assuming, your use-case just need to access data from boot partitions.
> > We are not implementing eMMC boot operations or Alternative bootmode
> right ?
>
> Joel could say more about it ?
[Sai Pavan Boddu] Anyway BOOT_PARTITION_ENABLE bits are persistent over power cycles, which needs be implemented as properties.
> 
> > And also is it good to calculate the address offset once when
> > partition access bits are set, rather than doing it for every read/write ?
> 
> Yes and no. It would add state to the sd object.
[Sai Pavan Boddu] Yeah. We already have a member in the state "sd->data_start", which can be updated based on value in PARTITION_ACCESS. I feel there is no harm in updating data_start, correct me if I'm wrong.

Regards,
Sai Pavan
> 
> Thanks,
> 
> C.

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

* Re: eMMC support
  2021-02-10  9:56                 ` Cédric Le Goater
  2021-02-10 12:46                   ` Sai Pavan Boddu
@ 2021-02-10 13:05                   ` Joel Stanley
  2021-02-10 13:37                     ` Cédric Le Goater
  2021-02-10 16:52                     ` Sai Pavan Boddu
  1 sibling, 2 replies; 16+ messages in thread
From: Joel Stanley @ 2021-02-10 13:05 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: Sai Pavan Boddu, Andrew Jeffery, Edgar Iglesias, qemu-devel,
	Philippe Mathieu-Daudé

On Wed, 10 Feb 2021 at 09:56, Cédric Le Goater <clg@kaod.org> wrote:
>
> Hello Sai Pavan,
>
> [ ... ]
>
> >>> The patchset is in the aspeed-6.0 branch :
> >>>
> >>>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot
> >>>                                     area as a boot rom
> >>>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
> >>>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
> >
> > [Sai Pavan Boddu] I see you guys have implemented the boot area access here,
>
> The boot partition modeling fits our needs to boot the Aspeed machine
> but this is very custom.
>
> > I was assuming, your use-case just need to access data from boot partitions.
> > We are not implementing eMMC boot operations or Alternative bootmode right ?
>
> Joel could say more about it ?

The solution I came up with has room for improvement. There's no way
to tell the qemu sd device what boot partitions it should expect to
find, and likewise there's no way for the emulated machine to check
that the image is formatted in the way it expects.

If there was a way to add metadata to the image (through qcow2?) then
we could use this to define the boot partition sizes in the image, and
have the model use these numbers to populate CSD_EXT. It's only an
idea, and I don't know if qcow2 supports this kind of metadata.

Cheers,

Joel


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

* Re: eMMC support
  2021-02-10 13:05                   ` Joel Stanley
@ 2021-02-10 13:37                     ` Cédric Le Goater
  2021-02-10 16:52                     ` Sai Pavan Boddu
  1 sibling, 0 replies; 16+ messages in thread
From: Cédric Le Goater @ 2021-02-10 13:37 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Sai Pavan Boddu, Andrew Jeffery, Edgar Iglesias, qemu-devel,
	Philippe Mathieu-Daudé

On 2/10/21 2:05 PM, Joel Stanley wrote:
> On Wed, 10 Feb 2021 at 09:56, Cédric Le Goater <clg@kaod.org> wrote:
>>
>> Hello Sai Pavan,
>>
>> [ ... ]
>>
>>>>> The patchset is in the aspeed-6.0 branch :
>>>>>
>>>>>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first boot
>>>>>                                     area as a boot rom
>>>>>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC property
>>>>>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to emmc
>>>
>>> [Sai Pavan Boddu] I see you guys have implemented the boot area access here,
>>
>> The boot partition modeling fits our needs to boot the Aspeed machine
>> but this is very custom.
>>
>>> I was assuming, your use-case just need to access data from boot partitions.
>>> We are not implementing eMMC boot operations or Alternative bootmode right ?
>>
>> Joel could say more about it ?
> 
> The solution I came up with has room for improvement. There's no way
> to tell the qemu sd device what boot partitions it should expect to
> find, and likewise there's no way for the emulated machine to check
> that the image is formatted in the way it expects.
> 
> If there was a way to add metadata to the image (through qcow2?) then
> we could use this to define the boot partition sizes in the image, and
> have the model use these numbers to populate CSD_EXT. It's only an
> idea, and I don't know if qcow2 supports this kind of metadata.

We could add a new QEMU MMC block device with a set of properties
to describe the layout maybe ? 

C.


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

* RE: eMMC support
  2021-02-10 13:05                   ` Joel Stanley
  2021-02-10 13:37                     ` Cédric Le Goater
@ 2021-02-10 16:52                     ` Sai Pavan Boddu
  1 sibling, 0 replies; 16+ messages in thread
From: Sai Pavan Boddu @ 2021-02-10 16:52 UTC (permalink / raw)
  To: Joel Stanley, Cédric Le Goater
  Cc: Andrew Jeffery, Edgar Iglesias, qemu-devel, Philippe Mathieu-Daudé

Hi Joel

> -----Original Message-----
> From: Joel Stanley <joel@jms.id.au>
> Sent: Wednesday, February 10, 2021 6:35 PM
> To: Cédric Le Goater <clg@kaod.org>
> Cc: Sai Pavan Boddu <saipava@xilinx.com>; Edgar Iglesias <edgari@xilinx.com>;
> Andrew Jeffery <andrew@aj.id.au>; qemu-devel@nongnu.org; Philippe
> Mathieu-Daudé <f4bug@amsat.org>
> Subject: Re: eMMC support
> 
> On Wed, 10 Feb 2021 at 09:56, Cédric Le Goater <clg@kaod.org> wrote:
> >
> > Hello Sai Pavan,
> >
> > [ ... ]
> >
> > >>> The patchset is in the aspeed-6.0 branch :
> > >>>
> > >>>     df91d012672c Cédric Le Goater - hw/arm/aspeed: Load eMMC first
> boot
> > >>>                                     area as a boot rom
> > >>>     27b75a7ad322 Cédric Le Goater - hw/arm/aspeed: Add eMMC
> property
> > >>>     2836cf5a15a1 Joel Stanley - hw/arm/aspeed: Set boot device to
> > >>> emmc
> > >
> > > [Sai Pavan Boddu] I see you guys have implemented the boot area
> > > access here,
> >
> > The boot partition modeling fits our needs to boot the Aspeed machine
> > but this is very custom.
> >
> > > I was assuming, your use-case just need to access data from boot partitions.
> > > We are not implementing eMMC boot operations or Alternative bootmode
> right ?
> >
> > Joel could say more about it ?
> 
> The solution I came up with has room for improvement. There's no way to tell
> the qemu sd device what boot partitions it should expect to find, and likewise
> there's no way for the emulated machine to check that the image is formatted
> in the way it expects.
[Sai Pavan Boddu] I guess bits of PARTITION_CONFIG[PARTITION_ACCESS], would tell SD which boot partition needs to be enabled.
> 
> If there was a way to add metadata to the image (through qcow2?) then we
> could use this to define the boot partition sizes in the image, and have the
> model use these numbers to populate CSD_EXT. It's only an idea, and I don't
> know if qcow2 supports this kind of metadata.
[Sai Pavan Boddu] yeah nice. I don’t know if qemu-img has any option as such.
Anyway only few fields in CSD_EXT are useful for us, which should be ok to implement as properties.

Regards,
Sai Pavan
> 
> Cheers,
> 
> Joel

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

end of thread, other threads:[~2021-02-10 17:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16 18:30 eMMC support Sai Pavan Boddu
2020-09-17  0:55 ` Joel Stanley
2020-09-17  6:25   ` Cédric Le Goater
2020-09-21 10:27     ` Sai Pavan Boddu
2021-01-20  8:55     ` Cédric Le Goater
2021-01-20 16:00       ` Edgar Iglesias
2021-02-01 17:55         ` Sai Pavan Boddu
2021-02-01 22:01           ` Cédric Le Goater
2021-02-01 22:06             ` Cédric Le Goater
2021-02-09 19:39               ` Sai Pavan Boddu
2021-02-10  9:56                 ` Cédric Le Goater
2021-02-10 12:46                   ` Sai Pavan Boddu
2021-02-10 13:05                   ` Joel Stanley
2021-02-10 13:37                     ` Cédric Le Goater
2021-02-10 16:52                     ` Sai Pavan Boddu
2020-09-21 10:29   ` Sai Pavan Boddu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.