diff mbox series

ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4

Message ID 20200212102009.17428-1-m.szyprowski@samsung.com (mailing list archive)
State New, archived
Headers show
Series ARM: bcm2835_defconfig: add minimal support for Raspberry Pi4 | expand

Commit Message

Marek Szyprowski Feb. 12, 2020, 10:20 a.m. UTC
Add drivers for the minimal set of devices needed to boot Raspberry Pi4
board.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/configs/bcm2835_defconfig | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nicolas Saenz Julienne Feb. 12, 2020, 6:31 p.m. UTC | #1
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 <m.szyprowski@samsung.com>

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/linuxppc-dev@lists.ozlabs.org/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
Marek Szyprowski Feb. 13, 2020, 7:35 a.m. UTC | #2
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 <m.szyprowski@samsung.com>
> 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/linuxppc-dev@lists.ozlabs.org/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
Stefan Wahren Feb. 13, 2020, 9:59 a.m. UTC | #3
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 <m.szyprowski@samsung.com>
>> 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
Marek Szyprowski Feb. 14, 2020, 12:25 p.m. UTC | #4
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 <m.szyprowski@samsung.com>
>>> 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
Nicolas Saenz Julienne Feb. 14, 2020, 3:14 p.m. UTC | #5
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 <m.szyprowski@samsung.com>
> >>> 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
Marek Szyprowski Feb. 17, 2020, 12:22 p.m. UTC | #6
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 <m.szyprowski@samsung.com>
>>>>> 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
Nicolas Saenz Julienne Feb. 17, 2020, 8:18 p.m. UTC | #7
[ 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
Florian Fainelli Feb. 17, 2020, 9:44 p.m. UTC | #8
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.
diff mbox series

Patch

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