2020-02-12 11:10:40

by Marek Szyprowski

[permalink] [raw]
Subject: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Add drivers for the minimal set of devices needed to boot Raspberry Pi4
board.

Signed-off-by: Marek Szyprowski <[email protected]>
---
arch/arm/configs/bcm2835_defconfig | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index 519ff58e67b3..b5e7c1bd95f2 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -72,6 +72,7 @@ CONFIG_BLK_DEV_SD=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_SCAN_ASYNC=y
CONFIG_NETDEVICES=y
+CONFIG_BCMGENET=y
CONFIG_USB_LAN78XX=y
CONFIG_USB_USBNET=y
CONFIG_USB_NET_SMSC95XX=y
@@ -99,6 +100,8 @@ CONFIG_THERMAL=y
CONFIG_BCM2835_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_BCM2835_WDT=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_GPIO=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_DRM=y
--
2.17.1


2020-02-12 18:33:08

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Hi Marek,
On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
> board.
>
> Signed-off-by: Marek Szyprowski <[email protected]>

Just so you know, the amount of support on the RPi4 you might be able to get
updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
PCIe (so no USBs).

FYI I've been working on getting a workable configuration for arm32, short of
creating a new config altogether:
https://www.mail-archive.com/[email protected]/msg163770.html

That said, if you insist on booting with bcm2835_defconfig, I have no problem
with the patch.

Regards,
Nicolas

> arch/arm/configs/bcm2835_defconfig | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/configs/bcm2835_defconfig
> b/arch/arm/configs/bcm2835_defconfig
> index 519ff58e67b3..b5e7c1bd95f2 100644
> --- a/arch/arm/configs/bcm2835_defconfig
> +++ b/arch/arm/configs/bcm2835_defconfig
> @@ -72,6 +72,7 @@ CONFIG_BLK_DEV_SD=y
> CONFIG_SCSI_CONSTANTS=y
> CONFIG_SCSI_SCAN_ASYNC=y
> CONFIG_NETDEVICES=y
> +CONFIG_BCMGENET=y
> CONFIG_USB_LAN78XX=y
> CONFIG_USB_USBNET=y
> CONFIG_USB_NET_SMSC95XX=y
> @@ -99,6 +100,8 @@ CONFIG_THERMAL=y
> CONFIG_BCM2835_THERMAL=y
> CONFIG_WATCHDOG=y
> CONFIG_BCM2835_WDT=y
> +CONFIG_REGULATOR=y
> +CONFIG_REGULATOR_GPIO=y
> CONFIG_MEDIA_SUPPORT=y
> CONFIG_MEDIA_CAMERA_SUPPORT=y
> CONFIG_DRM=y


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part

2020-02-13 07:35:38

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Hi Nicolas

On 12.02.2020 19:31, Nicolas Saenz Julienne wrote:
> Hi Marek,
> On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
>> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
>> board.
>>
>> Signed-off-by: Marek Szyprowski <[email protected]>
> Just so you know, the amount of support on the RPi4 you might be able to get
> updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
> PCIe (so no USBs).

Yes, I know. A lots of core features is missing: SMP, HIGHMEM, LPAE, PCI
and so on, but having a possibility to boot RPi4 with this defconfig
increases the test coverage.

> FYI I've been working on getting a workable configuration for arm32, short of
> creating a new config altogether:
> https://www.mail-archive.com/[email protected]/msg163770.html
>
> That said, if you insist on booting with bcm2835_defconfig, I have no problem
> with the patch.

Right, having a proper multi defconfig with LPAE is also needed on other
boards. I would add VIRTUALIZATION and KVM to it too.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2020-02-13 10:01:00

by Stefan Wahren

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Hi Marek,

On 13.02.20 08:35, Marek Szyprowski wrote:
> Hi Nicolas
>
> On 12.02.2020 19:31, Nicolas Saenz Julienne wrote:
>> Hi Marek,
>> On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
>>> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
>>> board.
>>>
>>> Signed-off-by: Marek Szyprowski <[email protected]>
>> Just so you know, the amount of support on the RPi4 you might be able to get
>> updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
>> PCIe (so no USBs).
> Yes, I know. A lots of core features is missing: SMP, HIGHMEM, LPAE, PCI
> and so on, but having a possibility to boot RPi4 with this defconfig
> increases the test coverage.

in case you want to increase test coverage, we better enable all
Raspberry Pi 4 relevant hardware parts (hwrng, thermal, PCI ...). This
is what we did for older Pi boards.

SMP, HIGHMEM, LPAE are different and shouldn't be enabled in
bcm2835_defconfig from my PoV.

Best regards
Stefan

2020-02-14 12:27:23

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Hi Stefan,

On 13.02.2020 10:59, Stefan Wahren wrote:
> On 13.02.20 08:35, Marek Szyprowski wrote:
>> On 12.02.2020 19:31, Nicolas Saenz Julienne wrote:
>>> On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
>>>> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
>>>> board.
>>>>
>>>> Signed-off-by: Marek Szyprowski <[email protected]>
>>> Just so you know, the amount of support on the RPi4 you might be able to get
>>> updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
>>> PCIe (so no USBs).
>> Yes, I know. A lots of core features is missing: SMP, HIGHMEM, LPAE, PCI
>> and so on, but having a possibility to boot RPi4 with this defconfig
>> increases the test coverage.
> in case you want to increase test coverage, we better enable all
> Raspberry Pi 4 relevant hardware parts (hwrng, thermal, PCI ...). This
> is what we did for older Pi boards.

Okay, I will add thermal in v2. HWRNG is already selected as module.
Enabling PCI without LPAE makes no sense as the driver won't be able to
initialize properly.

> SMP, HIGHMEM, LPAE are different and shouldn't be enabled in
> bcm2835_defconfig from my PoV.

Maybe it would make sense to also add bcm2711_defconfig or
bcm2835_lpae_defconfig?

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2020-02-14 15:20:20

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

On Fri Feb 14, 2020 at 1:25 PM, Marek Szyprowski wrote:
> Hi Stefan,
>
> On 13.02.2020 10:59, Stefan Wahren wrote:
> > On 13.02.20 08:35, Marek Szyprowski wrote:
> >> On 12.02.2020 19:31, Nicolas Saenz Julienne wrote:
> >>> On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
> >>>> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
> >>>> board.
> >>>>
> >>>> Signed-off-by: Marek Szyprowski <[email protected]>
> >>> Just so you know, the amount of support on the RPi4 you might be able to get
> >>> updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
> >>> PCIe (so no USBs).
> >> Yes, I know. A lots of core features is missing: SMP, HIGHMEM, LPAE, PCI
> >> and so on, but having a possibility to boot RPi4 with this defconfig
> >> increases the test coverage.
> > in case you want to increase test coverage, we better enable all
> > Raspberry Pi 4 relevant hardware parts (hwrng, thermal, PCI ...). This
> > is what we did for older Pi boards.
>
> Okay, I will add thermal in v2. HWRNG is already selected as module.
> Enabling PCI without LPAE makes no sense as the driver won't be able to
> initialize properly.

Agree on this.

> > SMP, HIGHMEM, LPAE are different and shouldn't be enabled in
> > bcm2835_defconfig from my PoV.
>
> Maybe it would make sense to also add bcm2711_defconfig or
> bcm2835_lpae_defconfig?

IMO bcm2711_defconfig if the last resort solution. I don't think you can
do bcm2835_lpae_defconfig as RPi and RPi2 SoCs don't support LPAE. An
intemediate solution is being discussed here:
https://lkml.org/lkml/2020/1/10/694

Regards,
Nicolas

2020-02-17 12:58:35

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Hi Nicolas,

On 14.02.2020 16:14, Nicolas Saenz Julienne wrote:
> On Fri Feb 14, 2020 at 1:25 PM, Marek Szyprowski wrote:
>> On 13.02.2020 10:59, Stefan Wahren wrote:
>>> On 13.02.20 08:35, Marek Szyprowski wrote:
>>>> On 12.02.2020 19:31, Nicolas Saenz Julienne wrote:
>>>>> On Wed, 2020-02-12 at 11:20 +0100, Marek Szyprowski wrote:
>>>>>> Add drivers for the minimal set of devices needed to boot Raspberry Pi4
>>>>>> board.
>>>>>>
>>>>>> Signed-off-by: Marek Szyprowski <[email protected]>
>>>>> Just so you know, the amount of support on the RPi4 you might be able to get
>>>>> updating bcm2835_defconfig's config is very limited. Only 1GB of ram and no
>>>>> PCIe (so no USBs).
>>>> Yes, I know. A lots of core features is missing: SMP, HIGHMEM, LPAE, PCI
>>>> and so on, but having a possibility to boot RPi4 with this defconfig
>>>> increases the test coverage.
>>> in case you want to increase test coverage, we better enable all
>>> Raspberry Pi 4 relevant hardware parts (hwrng, thermal, PCI ...). This
>>> is what we did for older Pi boards.
>> Okay, I will add thermal in v2. HWRNG is already selected as module.
>> Enabling PCI without LPAE makes no sense as the driver won't be able to
>> initialize properly.
> Agree on this.
>>> SMP, HIGHMEM, LPAE are different and shouldn't be enabled in
>>> bcm2835_defconfig from my PoV.
>> Maybe it would make sense to also add bcm2711_defconfig or
>> bcm2835_lpae_defconfig?
> IMO bcm2711_defconfig if the last resort solution. I don't think you can
> do bcm2835_lpae_defconfig as RPi and RPi2 SoCs don't support LPAE.

Okay, if you want I can send a patch adding bcm2711_defconfig.

> An
> intemediate solution is being discussed here:
> https://lkml.org/lkml/2020/1/10/694

Right, I also agree that multi_v7_lpae_defconfig is needed. Best would
be to have both (bcm2711 for quick tests of board-dedicated kernel and
multi for distributions).

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2020-02-17 20:35:03

by Nicolas Saenz Julienne

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

[ Adding Florian to the coversation ]

On Mon, 2020-02-17 at 13:22 +0100, Marek Szyprowski wrote:
> Hi Nicolas,
> On 14.02.2020 16:14, Nicolas Saenz Julienne wrote:
> > IMO bcm2711_defconfig if the last resort solution. I don't think you can
> > do bcm2835_lpae_defconfig as RPi and RPi2 SoCs don't support LPAE.
>
> Okay, if you want I can send a patch adding bcm2711_defconfig.
>
> > An intemediate solution is being discussed here:
> > https://lkml.org/lkml/2020/1/10/694
>
> Right, I also agree that multi_v7_lpae_defconfig is needed. Best would
> be to have both (bcm2711 for quick tests of board-dedicated kernel and
> multi for distributions).

So I understand you'd be creating a new bcm2711_defconfig based on
bcm2835_defconfig plus whatever is needed. Sounds OK to me. It'd be nice to
have a small kernel config to do bisects with.

Any comments Florian, Stefan?

Regards,
Nicolas


Attachments:
signature.asc (499.00 B)
This is a digitally signed message part

2020-02-17 21:45:41

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4



On 2/17/2020 12:18 PM, Nicolas Saenz Julienne wrote:
> [ Adding Florian to the coversation ]
>
> On Mon, 2020-02-17 at 13:22 +0100, Marek Szyprowski wrote:
>> Hi Nicolas,
>> On 14.02.2020 16:14, Nicolas Saenz Julienne wrote:
>>> IMO bcm2711_defconfig if the last resort solution. I don't think you can
>>> do bcm2835_lpae_defconfig as RPi and RPi2 SoCs don't support LPAE.
>>
>> Okay, if you want I can send a patch adding bcm2711_defconfig.
>>
>>> An intemediate solution is being discussed here:
>>> https://lkml.org/lkml/2020/1/10/694
>>
>> Right, I also agree that multi_v7_lpae_defconfig is needed. Best would
>> be to have both (bcm2711 for quick tests of board-dedicated kernel and
>> multi for distributions).
>
> So I understand you'd be creating a new bcm2711_defconfig based on
> bcm2835_defconfig plus whatever is needed. Sounds OK to me. It'd be nice to
> have a small kernel config to do bisects with.
>
> Any comments Florian, Stefan?

If we can make bcm2711_defconfig a fragment that applies to
bcm2835_defconfig then we are not maintaining a completely new
configuration file and we take advantage of all existing coverage from
bcm2835_defconfig. A completely new bcm2711_defconfig would be hard to
justify IMHO when multi_v7_lpae_defconfig is sort of what we would prefer.

BTW, if you register the PCI outbound window as part of 2711's machine
descriptor map_io callback, you should have it trickled down from
iotable_init() -> create_mapping() -> __create_mapping() ->
create_36bit_mapping which should allow the creation of such a mapping
into the 32-bit virtual address space of the kernel. You would not quite
be able to use the entire 4GB of DRAM in such a configuration because
your virtual address space already needs ~41MB of register space + 64MB
of PCIe outbound space but at least bcm2835_defconfig would keep working.

NB: this only works AFAICT if you do this at map_io() time, not sure if
ioremap() will accept a >= 4GB physical address.
--
Florian