riscv: Separate memory init from paging init
authorAtish Patra <atish.patra@wdc.com>
Thu, 19 Nov 2020 00:38:27 +0000 (16:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:57:14 +0000 (09:57 +0100)
commit0cf9cb06149398daab565586b56825418567a7e1
treed2f38981a45beaf21b2b9d975ec283468615bb3f
parentd7716240bca508fb9e74d00d96304bc30acc3d6c
riscv: Separate memory init from paging init

[ Upstream commit cbd34f4bb37d62d8a027f54205bff07e73340da4 ]

Currently, we perform some memory init functions in paging init. But,
that will be an issue for NUMA support where DT needs to be flattened
before numa initialization and memblock_present can only be called
after numa initialization.

Move memory initialization related functions to a separate function.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Greentime Hu <greentime.hu@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Stable-dep-of: 50e63dd8ed92 ("riscv: fix reserved memory setup")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/include/asm/pgtable.h
arch/riscv/kernel/setup.c
arch/riscv/mm/init.c