mbox series

[00/11] mach-snapdragon: various improvements for newer boards

Message ID 20240809-b4-snapdragon-improvements-v1-0-7c353f3e8f74@linaro.org
Headers show
Series mach-snapdragon: various improvements for newer boards | expand

Message

Caleb Connolly Aug. 8, 2024, 11:59 p.m. UTC
Supporting the newer SM8550 and SM8650 SoCs unfortunately requires a
bump in complexity for us. Qualcomm changed a lot about how the memory
map is handed over to the "kernel", adding many holes, not mapping
certain regions, and adding regions with 0 size. The SM8650 HDK has a
whopping 14 memory regions, some as small as 44k.

Supporting this properly has proven to be a bit of a headache, but I
think this implementation is "pretty good".

In addition, we set a valid fallback fdt_addr_r in the U-Boot
environment, allocate a buffer for fastboot, and set the loadaddr
variable too.

board_fdt_blob_setup() is refactored for readability and potential
future expansion (e.g. if supporting multi-dtb FIT becomes desirable).

Finally, a function is proposed to allow for mapping new memory regions
at runtime, and the cmd-db driver makes use of it to map itself, since
SM8650 boards don't seem to include it in their memory map.

Tested on SM8650 HDK, SDM845 OnePlus 6, SM6115 RB2, SM8250 RB5.

---
Caleb Connolly (10):
      mach-snapdragon: refactor board_fdt_blob_setup()
      mach-snapdragon: parse memory ourselves
      mach-snapdragon: set serial number
      mach-snapdragon: allocate fastboot buffer dynamically
      mach-snapdragon: populate fallback FDT
      mach-snapdragon: set loadaddr
      armv8: mmu: add a way to map additional regions
      soc: qcom: cmd-db: use strncmp() instead of memcmp()
      soc: qcom: cmd-db: map cmd-db region
      qcom_defconfig: bump CONFIG_NR_DRAM_BANKS

Neil Armstrong (1):
      mach-snapdragon: use 1MiB for get_page_table_size()

 arch/arm/cpu/armv8/cache_v8.c    |  25 +++++
 arch/arm/include/asm/system.h    |  10 ++
 arch/arm/mach-snapdragon/board.c | 203 ++++++++++++++++++++++++++++++++++-----
 configs/qcom_defconfig           |   1 +
 drivers/soc/qcom/cmd-db.c        |  11 ++-
 5 files changed, 221 insertions(+), 29 deletions(-)
---
change-id: 20240809-b4-snapdragon-improvements-fd6d714a7fbd
base-commit: a2ce853383b18a2cf920268ee341f2585a11adef

// Caleb (they/them)

Comments

Neil Armstrong Aug. 19, 2024, 11:44 a.m. UTC | #1
On 09/08/2024 01:59, Caleb Connolly wrote:
> Supporting the newer SM8550 and SM8650 SoCs unfortunately requires a
> bump in complexity for us. Qualcomm changed a lot about how the memory
> map is handed over to the "kernel", adding many holes, not mapping
> certain regions, and adding regions with 0 size. The SM8650 HDK has a
> whopping 14 memory regions, some as small as 44k.
> 
> Supporting this properly has proven to be a bit of a headache, but I
> think this implementation is "pretty good".
> 
> In addition, we set a valid fallback fdt_addr_r in the U-Boot
> environment, allocate a buffer for fastboot, and set the loadaddr
> variable too.
> 
> board_fdt_blob_setup() is refactored for readability and potential
> future expansion (e.g. if supporting multi-dtb FIT becomes desirable).
> 
> Finally, a function is proposed to allow for mapping new memory regions
> at runtime, and the cmd-db driver makes use of it to map itself, since
> SM8650 boards don't seem to include it in their memory map.
> 
> Tested on SM8650 HDK, SDM845 OnePlus 6, SM6115 RB2, SM8250 RB5.
> 
> ---
> Caleb Connolly (10):
>        mach-snapdragon: refactor board_fdt_blob_setup()
>        mach-snapdragon: parse memory ourselves
>        mach-snapdragon: set serial number
>        mach-snapdragon: allocate fastboot buffer dynamically
>        mach-snapdragon: populate fallback FDT
>        mach-snapdragon: set loadaddr
>        armv8: mmu: add a way to map additional regions
>        soc: qcom: cmd-db: use strncmp() instead of memcmp()
>        soc: qcom: cmd-db: map cmd-db region
>        qcom_defconfig: bump CONFIG_NR_DRAM_BANKS
> 
> Neil Armstrong (1):
>        mach-snapdragon: use 1MiB for get_page_table_size()
> 
>   arch/arm/cpu/armv8/cache_v8.c    |  25 +++++
>   arch/arm/include/asm/system.h    |  10 ++
>   arch/arm/mach-snapdragon/board.c | 203 ++++++++++++++++++++++++++++++++++-----
>   configs/qcom_defconfig           |   1 +
>   drivers/soc/qcom/cmd-db.c        |  11 ++-
>   5 files changed, 221 insertions(+), 29 deletions(-)
> ---
> change-id: 20240809-b4-snapdragon-improvements-fd6d714a7fbd
> base-commit: a2ce853383b18a2cf920268ee341f2585a11adef
> 
> // Caleb (they/them)
> 

Thanks for posting those :-)

Please add my:
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

I'll rebase my tree and test it ASAP !

Neil
Caleb Connolly Aug. 22, 2024, 1:10 a.m. UTC | #2
On Fri, 09 Aug 2024 01:59:23 +0200, Caleb Connolly wrote:
> Supporting the newer SM8550 and SM8650 SoCs unfortunately requires a
> bump in complexity for us. Qualcomm changed a lot about how the memory
> map is handed over to the "kernel", adding many holes, not mapping
> certain regions, and adding regions with 0 size. The SM8650 HDK has a
> whopping 14 memory regions, some as small as 44k.
> 
> Supporting this properly has proven to be a bit of a headache, but I
> think this implementation is "pretty good".
> 
> [...]

Applied, thanks!

[01/11] mach-snapdragon: refactor board_fdt_blob_setup()
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/9e8c8769a076
[02/11] mach-snapdragon: parse memory ourselves
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/07f036907680
[03/11] mach-snapdragon: use 1MiB for get_page_table_size()
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/4673e5c94235
[04/11] mach-snapdragon: set serial number
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/c4c7bc917e83
[05/11] mach-snapdragon: allocate fastboot buffer dynamically
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/5f6c2202348c
[06/11] mach-snapdragon: populate fallback FDT
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/8ab7b82c0667
[07/11] mach-snapdragon: set loadaddr
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/1465eb4026b6
[08/11] armv8: mmu: add a way to map additional regions
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/fc417bb2f133
[09/11] soc: qcom: cmd-db: use strncmp() instead of memcmp()
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/d83fdebf0b82
[10/11] soc: qcom: cmd-db: map cmd-db region
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/8b890a0f0d88
[11/11] qcom_defconfig: bump CONFIG_NR_DRAM_BANKS
        https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/commit/10d5f66dd826

Best regards,