[Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string

Stewart Hildebrand posted 1 patch 4 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20191004004745.26522-1-stewart.hildebrand@dornerworks.com
There is a newer version of this series
xen/arch/arm/platforms/brcm-raspberry-pi.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Stewart Hildebrand 4 years, 6 months ago
Both upstream [1] and downstream [2] Linux kernels use "brcm,bcm2711"
as the compatible string for Raspberry Pi 4. Add this string to our
platform compatible list.

The brcm,bcm2838 convention is abandoned. Remove it.

Rename the variables within the file to a rpi4_* prefix since the file
is meant to cover the Raspberry Pi 4 platform.

[1] https://patchwork.kernel.org/patch/11165407/
[2] https://github.com/raspberrypi/linux/commit/53fdd7b8c8cb9c87190caab4fd459f89e1b4a7f8

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
---
 xen/arch/arm/platforms/brcm-raspberry-pi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c
index e22d2b3184..b697fa2c6c 100644
--- a/xen/arch/arm/platforms/brcm-raspberry-pi.c
+++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c
@@ -19,13 +19,13 @@
 
 #include <asm/platform.h>
 
-static const char *const brcm_bcm2838_dt_compat[] __initconst =
+static const char *const rpi4_dt_compat[] __initconst =
 {
-    "brcm,bcm2838",
+    "brcm,bcm2711",
     NULL
 };
 
-static const struct dt_device_match brcm_bcm2838_blacklist_dev[] __initconst =
+static const struct dt_device_match rpi4_blacklist_dev[] __initconst =
 {
     /*
      * The aux SPIs share an IRQ and a page with the aux UART.
@@ -40,9 +40,9 @@ static const struct dt_device_match brcm_bcm2838_blacklist_dev[] __initconst =
     { /* sentinel */ },
 };
 
-PLATFORM_START(brcm_bcm2838, "Raspberry Pi 4")
-    .compatible     = brcm_bcm2838_dt_compat,
-    .blacklist_dev  = brcm_bcm2838_blacklist_dev,
+PLATFORM_START(rpi4, "Raspberry Pi 4")
+    .compatible     = rpi4_dt_compat,
+    .blacklist_dev  = rpi4_blacklist_dev,
 PLATFORM_END
 
 /*
-- 
2.23.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Julien Grall 4 years, 6 months ago
Hi Stewart,

Sorry for the delay in answer.

On 04/10/2019 01:47, Stewart Hildebrand wrote:
> Both upstream [1] and downstream [2] Linux kernels use "brcm,bcm2711"
> as the compatible string for Raspberry Pi 4. Add this string to our
> platform compatible list.

Did the RPI foundation released any kernel with the old binding?

If so, I am ok if we don't support the compatible in Xen (we don't have a 
release with it yet!), but it would be worth mentioning in the commit message 
that this is going to break for some users (TBD) so they need to upgrade.

@Juergen: I would like to consider this patch for Xen 4.13. This is limited to 
RPI4 and would avoid us to ship it with a compatible that is going to disappear.

> 
> The brcm,bcm2838 convention is abandoned. Remove it.
> 
> Rename the variables within the file to a rpi4_* prefix since the file
> is meant to cover the Raspberry Pi 4 platform.
> 
> [1] https://patchwork.kernel.org/patch/11165407/
> [2] https://github.com/raspberrypi/linux/commit/53fdd7b8c8cb9c87190caab4fd459f89e1b4a7f8
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>
> ---
>   xen/arch/arm/platforms/brcm-raspberry-pi.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c
> index e22d2b3184..b697fa2c6c 100644
> --- a/xen/arch/arm/platforms/brcm-raspberry-pi.c
> +++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c
> @@ -19,13 +19,13 @@
>   
>   #include <asm/platform.h>
>   
> -static const char *const brcm_bcm2838_dt_compat[] __initconst =
> +static const char *const rpi4_dt_compat[] __initconst =
>   {
> -    "brcm,bcm2838",
> +    "brcm,bcm2711",
>       NULL
>   };
>   
> -static const struct dt_device_match brcm_bcm2838_blacklist_dev[] __initconst =
> +static const struct dt_device_match rpi4_blacklist_dev[] __initconst =
>   {
>       /*
>        * The aux SPIs share an IRQ and a page with the aux UART.
> @@ -40,9 +40,9 @@ static const struct dt_device_match brcm_bcm2838_blacklist_dev[] __initconst =
>       { /* sentinel */ },
>   };
>   
> -PLATFORM_START(brcm_bcm2838, "Raspberry Pi 4")
> -    .compatible     = brcm_bcm2838_dt_compat,
> -    .blacklist_dev  = brcm_bcm2838_blacklist_dev,
> +PLATFORM_START(rpi4, "Raspberry Pi 4")
> +    .compatible     = rpi4_dt_compat,
> +    .blacklist_dev  = rpi4_blacklist_dev,
>   PLATFORM_END
>   
>   /*
> 

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Stewart Hildebrand 4 years, 6 months ago
On Wednesday, October 9, 2019 11:30 AM, Julien Grall <julien.grall@arm.com> wrote:
>On 04/10/2019 01:47, Stewart Hildebrand wrote:
>> Both upstream [1] and downstream [2] Linux kernels use "brcm,bcm2711"
>> as the compatible string for Raspberry Pi 4. Add this string to our
>> platform compatible list.
>
>Did the RPI foundation released any kernel with the old binding?

Sure, I see the following tags in their linux tree since initial RPi4
support until the binding was updated:
raspberrypi-kernel_1.20190709-1
raspberrypi-kernel_1.20190718-1
raspberrypi-kernel_1.20190819-1
raspberrypi-kernel_1.20190925-1

These correspond with their binary releases at [3], except the binary
releases also have an earlier 1.20190620+1 tag with RPi4 support.

However, even with Xen looking for bcm2838, you wouldn't be able to
grab one of those releases and boot without running into other issues.
You'd still need a couple of additional patches at [4]. Currently the
only way that I'm aware of to successfully boot into dom0 and launch
domU is to build the dom0 kernel from source with the extra patches
applied found at [4].

>If so, I am ok if we don't support the compatible in Xen (we don't have a
>release with it yet!), but it would be worth mentioning in the commit message
>that this is going to break for some users (TBD) so they need to upgrade.

See below for suggestion.

>@Juergen: I would like to consider this patch for Xen 4.13. This is limited to
>RPI4 and would avoid us to ship it with a compatible that is going to disappear.
>
>>
>> The brcm,bcm2838 convention is abandoned. Remove it.
>>
>> Rename the variables within the file to a rpi4_* prefix since the file
>> is meant to cover the Raspberry Pi 4 platform.

"If you are using a device tree with the old compatible string
brcm,bcm2838, you will need to upgrade your device tree to one that has
the new brcm,bcm2711 compatible string."

>>
>> [1] https://patchwork.kernel.org/patch/11165407/
>> [2] https://github.com/raspberrypi/linux/commit/53fdd7b8c8cb9c87190caab4fd459f89e1b4a7f8
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@dornerworks.com>

[3] https://github.com/raspberrypi/firmware
[4] https://github.com/dornerworks/xen-rpi4-builder/tree/master/patches/linux

Stew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Julien Grall 4 years, 6 months ago
Hi,

On 10/9/19 5:59 PM, Stewart Hildebrand wrote:
> On Wednesday, October 9, 2019 11:30 AM, Julien Grall <julien.grall@arm.com> wrote:
>> On 04/10/2019 01:47, Stewart Hildebrand wrote:
>>> Both upstream [1] and downstream [2] Linux kernels use "brcm,bcm2711"
>>> as the compatible string for Raspberry Pi 4. Add this string to our
>>> platform compatible list.
>>
>> Did the RPI foundation released any kernel with the old binding?
> 
> Sure, I see the following tags in their linux tree since initial RPi4
> support until the binding was updated:
> raspberrypi-kernel_1.20190709-1
> raspberrypi-kernel_1.20190718-1
> raspberrypi-kernel_1.20190819-1
> raspberrypi-kernel_1.20190925-1
> 
> These correspond with their binary releases at [3], except the binary
> releases also have an earlier 1.20190620+1 tag with RPi4 support.
> 
> However, even with Xen looking for bcm2838, you wouldn't be able to
> grab one of those releases and boot without running into other issues.
> You'd still need a couple of additional patches at [4]. Currently the
> only way that I'm aware of to successfully boot into dom0 and launch
> domU is to build the dom0 kernel from source with the extra patches
> applied found at [4].

Is there any plan to upstream those patches?

> 
>> If so, I am ok if we don't support the compatible in Xen (we don't have a
>> release with it yet!), but it would be worth mentioning in the commit message
>> that this is going to break for some users (TBD) so they need to upgrade.
> 
> See below for suggestion.
> 
>> @Juergen: I would like to consider this patch for Xen 4.13. This is limited to
>> RPI4 and would avoid us to ship it with a compatible that is going to disappear.
>>
>>>
>>> The brcm,bcm2838 convention is abandoned. Remove it.
>>>
>>> Rename the variables within the file to a rpi4_* prefix since the file
>>> is meant to cover the Raspberry Pi 4 platform.
> 
> "If you are using a device tree with the old compatible string
> brcm,bcm2838, you will need to upgrade your device tree to one that has
> the new brcm,bcm2711 compatible string."

That's fine with me.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Stewart Hildebrand 4 years, 6 months ago
On Tuesday, October 15, 2019 7:02 AM, Julien Grall wrote:
>Hi,

Hi!

>
>On 10/9/19 5:59 PM, Stewart Hildebrand wrote:
>> However, even with Xen looking for bcm2838, you wouldn't be able to
>> grab one of those releases and boot without running into other issues.
>> You'd still need a couple of additional patches at [4]. Currently the
>> only way that I'm aware of to successfully boot into dom0 and launch
>> domU is to build the dom0 kernel from source with the extra patches
>> applied found at [4].
>
>Is there any plan to upstream those patches?

Two of the patches are adding device tree nodes (xen,xen-bootargs,
etc), so those are unlikely to be upstreamed. One patch is a
hack/workaround to disable DMA for the SD card, also unlikely to be
upstreamed. Finally, the last patch adds a check to avoid invoking
xen_dma_ops recursively. This one could potentially be upstreamed,
though we haven't submitted or gathered any input from the linux or
raspberry pi communities yet.

We are tracking the following patch sets [5] [6] [7] for upstream, and
our current plan is basically to wait until they have been merged, try
booting the upstream kernel, then see if it is still necessary to apply
the DMA workarounds.

[5] https://patchwork.kernel.org/cover/11165395/
[6] https://patchwork.kernel.org/cover/11159379/
[7] https://patchwork.kernel.org/cover/11141719/

>> "If you are using a device tree with the old compatible string
>> brcm,bcm2838, you will need to upgrade your device tree to one that has
>> the new brcm,bcm2711 compatible string."
>
>That's fine with me.

OK, since it's simply a matter of adding this to the commit message,
can it be added on commit? Or should I spin a v3 with the updated
commit message?

Finally, @Juergen, are you willing to accept this patch for 4.13? Since
both upstream linux and downstream raspberry pi linux communities have
decided to use the bcm2711 convention, we don't currently match this
platform compatible. Meaning we can't currently boot on RPi4 without
this patch.

Stew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v2] xen/arm: platform: fix Raspberry Pi compatible string
Posted by Julien Grall 4 years, 6 months ago
Hi,

On 15/10/2019 17:18, Stewart Hildebrand wrote:
> On Tuesday, October 15, 2019 7:02 AM, Julien Grall wrote:
>> Hi,
> 
> Hi!
> 
>>
>> On 10/9/19 5:59 PM, Stewart Hildebrand wrote:
>>> However, even with Xen looking for bcm2838, you wouldn't be able to
>>> grab one of those releases and boot without running into other issues.
>>> You'd still need a couple of additional patches at [4]. Currently the
>>> only way that I'm aware of to successfully boot into dom0 and launch
>>> domU is to build the dom0 kernel from source with the extra patches
>>> applied found at [4].
>>
>> Is there any plan to upstream those patches?
> 
> Two of the patches are adding device tree nodes (xen,xen-bootargs,
> etc), so those are unlikely to be upstreamed. One patch is a
> hack/workaround to disable DMA for the SD card, also unlikely to be
> upstreamed. Finally, the last patch adds a check to avoid invoking
> xen_dma_ops recursively. This one could potentially be upstreamed,
> though we haven't submitted or gathered any input from the linux or
> raspberry pi communities yet.
> 
> We are tracking the following patch sets [5] [6] [7] for upstream, and
> our current plan is basically to wait until they have been merged, try
> booting the upstream kernel, then see if it is still necessary to apply
> the DMA workarounds.
> 
> [5] https://patchwork.kernel.org/cover/11165395/
> [6] https://patchwork.kernel.org/cover/11159379/
> [7] https://patchwork.kernel.org/cover/11141719/

Thank you for the information. Let Stefano and I know if we can help.

> 
>>> "If you are using a device tree with the old compatible string
>>> brcm,bcm2838, you will need to upgrade your device tree to one that has
>>> the new brcm,bcm2711 compatible string."
>>
>> That's fine with me.
> 
> OK, since it's simply a matter of adding this to the commit message,
> can it be added on commit? Or should I spin a v3 with the updated
> commit message?

Can you please respin the patch and CC Juergen?
Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel