[PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup

Bernhard Beschow posted 13 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221003203142.24355-1-shentey@gmail.com
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Bin Meng <bin.meng@windriver.com>
There is a newer version of this series
configs/devices/ppc-softmmu/default.mak |   3 +-
docs/system/ppc/ppce500.rst             |  28 ++++
hw/block/pflash_cfi01.c                 |   8 +-
hw/gpio/Kconfig                         |   3 +
hw/gpio/meson.build                     |   2 +-
hw/ppc/Kconfig                          |  11 ++
hw/ppc/e500.c                           | 133 +++++++++++++--
hw/ppc/e500.h                           |   1 -
hw/ppc/e500plat.c                       |   1 -
hw/ppc/meson.build                      |   6 +-
hw/ppc/mpc8544ds.c                      |   9 +-
hw/sd/sdhci-internal.h                  |  20 ---
hw/sd/sdhci.c                           | 210 +++++++++++++++++++++---
include/hw/sd/sdhci.h                   |   3 +
14 files changed, 368 insertions(+), 70 deletions(-)
[PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Bernhard Beschow 1 year, 6 months ago
Cover letter:
~~~~~~~~~~~~~

This series adds support for -pflash and direct SD card access to the
PPC e500 boards. The idea is to increase compatibility with "real" firmware
images where only the bare minimum of drivers is compiled in.

The series is structured as follows:

Patches 1-5 perform some general cleanup which paves the way for the rest of
the series.

Patches 6-9 add -pflash handling where memory-mapped flash can be added on
user's behalf. That is, the flash memory region in the eLBC is only added if
the -pflash argument is supplied. Note that the cfi01 device model becomes
stricter in checking the size of the emulated flash space.

Patches 10-13 add a new device model - the Freescale eSDHC - to the e500
boards which was missing so far.

User documentation is also added as the new features become available.

Tesing done:
* `qemu-system-ppc -M ppce500 -cpu e500mc -m 256 -kernel uImage -append
"console=ttyS0 rootwait root=/dev/mtdblock0 nokaslr" -drive
if=pflash,file=rootfs.ext2,format=raw`
* `qemu-system-ppc -M ppce500 -cpu e500mc -m 256 -kernel uImage -append
"console=ttyS0 rootwait root=/dev/mmcblk0" -device sd-card,drive=mydrive -drive
id=mydrive,if=none,file=rootfs.ext2,format=raw`

The load was created using latest Buildroot with `make
qemu_ppc_e500mc_defconfig` where the rootfs was configured to be of ext2 type.
In both cases it was possible to log in and explore the root file system.

v2:
~~~
Bin:
- Add source for MPC8544DS platform bus' memory map in commit message.
- Keep "ESDHC" in comment referring to Linux driver.
- Use "qemu-system-ppc{64|32} in documentation.
- Use g_autofree in device tree code.
- Remove unneeded device tree properties.
- Error out if pflash size doesn't fit into eLBC memory window.
- Remove unused ESDHC defines.
- Define macro ESDHC_WML for register offset with magic constant.
- Fix some whitespace issues when adding eSDHC device to e500.

Phil:
- Fix tense in commit message.

Bernhard Beschow (13):
  hw/ppc/meson: Allow e500 boards to be enabled separately
  hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
  docs/system/ppc/ppce500: Add heading for networking chapter
  hw/ppc/e500: Reduce usage of sysbus API
  hw/ppc/mpc8544ds: Rename wrongly named method
  hw/ppc/mpc8544ds: Add platform bus
  hw/ppc/e500: Remove if statement which is now always true
  hw/block/pflash_cfi01: Error out if device length isn't a power of two
  hw/ppc/e500: Implement pflash handling
  hw/sd/sdhci-internal: Unexport ESDHC defines
  hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*
  hw/sd/sdhci: Implement Freescale eSDHC device model
  hw/ppc/e500: Add Freescale eSDHC to e500 boards

 configs/devices/ppc-softmmu/default.mak |   3 +-
 docs/system/ppc/ppce500.rst             |  28 ++++
 hw/block/pflash_cfi01.c                 |   8 +-
 hw/gpio/Kconfig                         |   3 +
 hw/gpio/meson.build                     |   2 +-
 hw/ppc/Kconfig                          |  11 ++
 hw/ppc/e500.c                           | 133 +++++++++++++--
 hw/ppc/e500.h                           |   1 -
 hw/ppc/e500plat.c                       |   1 -
 hw/ppc/meson.build                      |   6 +-
 hw/ppc/mpc8544ds.c                      |   9 +-
 hw/sd/sdhci-internal.h                  |  20 ---
 hw/sd/sdhci.c                           | 210 +++++++++++++++++++++---
 include/hw/sd/sdhci.h                   |   3 +
 14 files changed, 368 insertions(+), 70 deletions(-)

-- 
2.37.3

Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Philippe Mathieu-Daudé via 1 year, 6 months ago
Hi Daniel,

On 3/10/22 22:31, Bernhard Beschow wrote:
> Cover letter:
> ~~~~~~~~~~~~~
> 
> This series adds support for -pflash and direct SD card access to the
> PPC e500 boards. The idea is to increase compatibility with "real" firmware
> images where only the bare minimum of drivers is compiled in.

> Bernhard Beschow (13):
>    hw/ppc/meson: Allow e500 boards to be enabled separately
>    hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
>    docs/system/ppc/ppce500: Add heading for networking chapter
>    hw/ppc/e500: Reduce usage of sysbus API
>    hw/ppc/mpc8544ds: Rename wrongly named method
>    hw/ppc/mpc8544ds: Add platform bus
>    hw/ppc/e500: Remove if statement which is now always true

This first part is mostly reviewed and can already go via your
ppc-next queue.

>    hw/block/pflash_cfi01: Error out if device length isn't a power of two
>    hw/ppc/e500: Implement pflash handling
>    hw/sd/sdhci-internal: Unexport ESDHC defines
>    hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*
>    hw/sd/sdhci: Implement Freescale eSDHC device model
>    hw/ppc/e500: Add Freescale eSDHC to e500 boards

This second part still need work. I can take it via the sdmmc-next
queue.

Regards,

Phil.
Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Daniel Henrique Barboza 1 year, 6 months ago
Hey,

On 10/3/22 18:27, Philippe Mathieu-Daudé wrote:
> Hi Daniel,
> 
> On 3/10/22 22:31, Bernhard Beschow wrote:
>> Cover letter:
>> ~~~~~~~~~~~~~
>>
>> This series adds support for -pflash and direct SD card access to the
>> PPC e500 boards. The idea is to increase compatibility with "real" firmware
>> images where only the bare minimum of drivers is compiled in.
> 
>> Bernhard Beschow (13):
>>    hw/ppc/meson: Allow e500 boards to be enabled separately
>>    hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
>>    docs/system/ppc/ppce500: Add heading for networking chapter
>>    hw/ppc/e500: Reduce usage of sysbus API
>>    hw/ppc/mpc8544ds: Rename wrongly named method
>>    hw/ppc/mpc8544ds: Add platform bus
>>    hw/ppc/e500: Remove if statement which is now always true
> 
> This first part is mostly reviewed and can already go via your
> ppc-next queue.

We're missing an ACK in patch 6/13:

hw/ppc/mpc8544ds: Add platform bus

I'll need some time to understand what's been doing there to provide my own
R-b. Or you can toss a R-b there :D


Thanks,


Daniel



> 
>>    hw/block/pflash_cfi01: Error out if device length isn't a power of two
>>    hw/ppc/e500: Implement pflash handling
>>    hw/sd/sdhci-internal: Unexport ESDHC defines
>>    hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*
>>    hw/sd/sdhci: Implement Freescale eSDHC device model
>>    hw/ppc/e500: Add Freescale eSDHC to e500 boards
> 
> This second part still need work. I can take it via the sdmmc-next
> queue.
> 
> Regards,
> 
> Phil.

Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Bernhard Beschow 1 year, 6 months ago
Am 4. Oktober 2022 12:43:35 UTC schrieb Daniel Henrique Barboza <danielhb413@gmail.com>:
>Hey,
>
>On 10/3/22 18:27, Philippe Mathieu-Daudé wrote:
>> Hi Daniel,
>> 
>> On 3/10/22 22:31, Bernhard Beschow wrote:
>>> Cover letter:
>>> ~~~~~~~~~~~~~
>>> 
>>> This series adds support for -pflash and direct SD card access to the
>>> PPC e500 boards. The idea is to increase compatibility with "real" firmware
>>> images where only the bare minimum of drivers is compiled in.
>> 
>>> Bernhard Beschow (13):
>>>    hw/ppc/meson: Allow e500 boards to be enabled separately
>>>    hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
>>>    docs/system/ppc/ppce500: Add heading for networking chapter
>>>    hw/ppc/e500: Reduce usage of sysbus API
>>>    hw/ppc/mpc8544ds: Rename wrongly named method
>>>    hw/ppc/mpc8544ds: Add platform bus
>>>    hw/ppc/e500: Remove if statement which is now always true
>> 
>> This first part is mostly reviewed and can already go via your
>> ppc-next queue.
>
>We're missing an ACK in patch 6/13:
>
>hw/ppc/mpc8544ds: Add platform bus

Bin: Ping?

Best regards,
Bernhard
>
>I'll need some time to understand what's been doing there to provide my own
>R-b. Or you can toss a R-b there :D
>
>
>Thanks,
>
>
>Daniel
>
>
>
>> 
>>>    hw/block/pflash_cfi01: Error out if device length isn't a power of two
>>>    hw/ppc/e500: Implement pflash handling
>>>    hw/sd/sdhci-internal: Unexport ESDHC defines
>>>    hw/sd/sdhci: Rename ESDHC_* defines to USDHC_*
>>>    hw/sd/sdhci: Implement Freescale eSDHC device model
>>>    hw/ppc/e500: Add Freescale eSDHC to e500 boards
>> 
>> This second part still need work. I can take it via the sdmmc-next
>> queue.
>> 
>> Regards,
>> 
>> Phil.
Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Bin Meng 1 year, 6 months ago
On Sun, Oct 9, 2022 at 12:11 AM Bernhard Beschow <shentey@gmail.com> wrote:
>
> Am 4. Oktober 2022 12:43:35 UTC schrieb Daniel Henrique Barboza <danielhb413@gmail.com>:
> >Hey,
> >
> >On 10/3/22 18:27, Philippe Mathieu-Daudé wrote:
> >> Hi Daniel,
> >>
> >> On 3/10/22 22:31, Bernhard Beschow wrote:
> >>> Cover letter:
> >>> ~~~~~~~~~~~~~
> >>>
> >>> This series adds support for -pflash and direct SD card access to the
> >>> PPC e500 boards. The idea is to increase compatibility with "real" firmware
> >>> images where only the bare minimum of drivers is compiled in.
> >>
> >>> Bernhard Beschow (13):
> >>>    hw/ppc/meson: Allow e500 boards to be enabled separately
> >>>    hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
> >>>    docs/system/ppc/ppce500: Add heading for networking chapter
> >>>    hw/ppc/e500: Reduce usage of sysbus API
> >>>    hw/ppc/mpc8544ds: Rename wrongly named method
> >>>    hw/ppc/mpc8544ds: Add platform bus
> >>>    hw/ppc/e500: Remove if statement which is now always true
> >>
> >> This first part is mostly reviewed and can already go via your
> >> ppc-next queue.
> >
> >We're missing an ACK in patch 6/13:
> >
> >hw/ppc/mpc8544ds: Add platform bus
>
> Bin: Ping?
>

Sorry for the delay. I have provided the R-b to this patch.

Regards,
Bin
Re: [PATCH v2 00/13] ppc/e500: Add support for two types of flash, cleanup
Posted by Daniel Henrique Barboza 1 year, 6 months ago

On 10/9/22 00:30, Bin Meng wrote:
> On Sun, Oct 9, 2022 at 12:11 AM Bernhard Beschow <shentey@gmail.com> wrote:
>>
>> Am 4. Oktober 2022 12:43:35 UTC schrieb Daniel Henrique Barboza <danielhb413@gmail.com>:
>>> Hey,
>>>
>>> On 10/3/22 18:27, Philippe Mathieu-Daudé wrote:
>>>> Hi Daniel,
>>>>
>>>> On 3/10/22 22:31, Bernhard Beschow wrote:
>>>>> Cover letter:
>>>>> ~~~~~~~~~~~~~
>>>>>
>>>>> This series adds support for -pflash and direct SD card access to the
>>>>> PPC e500 boards. The idea is to increase compatibility with "real" firmware
>>>>> images where only the bare minimum of drivers is compiled in.
>>>>
>>>>> Bernhard Beschow (13):
>>>>>     hw/ppc/meson: Allow e500 boards to be enabled separately
>>>>>     hw/gpio/meson: Introduce dedicated config switch for hw/gpio/mpc8xxx
>>>>>     docs/system/ppc/ppce500: Add heading for networking chapter
>>>>>     hw/ppc/e500: Reduce usage of sysbus API
>>>>>     hw/ppc/mpc8544ds: Rename wrongly named method
>>>>>     hw/ppc/mpc8544ds: Add platform bus
>>>>>     hw/ppc/e500: Remove if statement which is now always true
>>>>
>>>> This first part is mostly reviewed and can already go via your
>>>> ppc-next queue.
>>>
>>> We're missing an ACK in patch 6/13:
>>>
>>> hw/ppc/mpc8544ds: Add platform bus
>>
>> Bin: Ping?
>>
> 
> Sorry for the delay. I have provided the R-b to this patch.

Thanks for the review.

Patches 1-7 queued in gitlab.com/danielhb/qemu/tree/ppc-next.


Daniel

> 
> Regards,
> Bin