mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
Renesas ARM SoC updates for v6.15
- Remove the legacy CMA reservation code on R-Car Gen2, which causes
issues with highmem.
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQQ9qaHoIs/1I4cXmEiKwlD9ZEnxcAUCZ7ikEgAKCRCKwlD9ZEnx
cLV2AQDDZVL8MyxZuZF4viEAd0Fjp37h5tlJzsVBX/Qk/eF5wgEAzp/IgBs/TDOB
dCEswzR4MEu91+C1+RtFeRWhc86qGAY=
=pNjH
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmfJzIcACgkQYKtH/8kJ
UifLQQ//WUZB+8p/T5Vm2nXKMNUZ564ClfvgZa3NT5Uzv8Mpw3xQ+EMK5j0vTrlD
hdM5D3Dm+cOzL3MlK7uXXKwZlJvzoaSULH7mM6FQZQRexRLE6rUgWgh4E5rNijZ3
IAsgZTJi1VD0KKsxu5jKlb7l/JiBAC13B3dI4Z731autwy2J6OPNxiIMiCVm7cpo
Hx7o2g3QloUDN25uaA0WbI208Nv9SX+W7N5+IPExhW+B6astPMAhoIbkZbEa/yHP
uXHoDjh67vAs7amh8nzZcTsvHQ4p7BgEtRuC2z6lSXGf2Oq4H4XIaZuVS8jd64Jl
oFAv0/rRSbYduP2o1jFRdt+UU4FZdOrhlzl+xy+rqj1K3msn8MEzTfCZDVunEJa7
jQBrXear3x2bO1nc77b6Sd7ntFyQ3jXCFpjLrCjEErl5ASAXcBZQF1iyN/21JT8c
bVqKbaoe1Xiu4ehfKfhzKHJHCyR9OcBwzS1U9vf8jitcHtrTjv8mmb8YFRrGYW04
EYdbvWOVYssoDe2BAf2eE3RFb8k74JyKnJD5YdLXQexwyj2nRlK+TBMeSHIjep0O
xc25SMotdutLbJp48Gqfb+vFOAk6SS70NDMPG0GdvbyQ+22QWlKXPISLLNnpfLuA
I9yHQzP+vn1kWnaQ7ZDz0SldePivLGwau0dNGK/CiPYp9WqeoIE=
=jaYZ
-----END PGP SIGNATURE-----
Merge tag 'renesas-arm-soc-for-v6.15-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/arm
Renesas ARM SoC updates for v6.15
- Remove the legacy CMA reservation code on R-Car Gen2, which causes
issues with highmem.
* tag 'renesas-arm-soc-for-v6.15-tag1' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
ARM: shmobile: rcar-gen2: Remove CMA reservation code
Link: https://lore.kernel.org/r/cover.1740156740.git.geert+renesas@glider.be
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
f03f6e276b
|
|
@ -8,19 +8,15 @@
|
|||
*/
|
||||
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-map-ops.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_clk.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/psci.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/secure_cntvoff.h>
|
||||
#include "common.h"
|
||||
#include "rcar-gen2.h"
|
||||
|
||||
static const struct of_device_id cpg_matches[] __initconst = {
|
||||
{ .compatible = "renesas,r8a7742-cpg-mssr", .data = "extal" },
|
||||
|
|
@ -122,76 +118,6 @@ static void __init rcar_gen2_timer_init(void)
|
|||
timer_probe();
|
||||
}
|
||||
|
||||
struct memory_reserve_config {
|
||||
u64 reserved;
|
||||
u64 base, size;
|
||||
};
|
||||
|
||||
static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname,
|
||||
int depth, void *data)
|
||||
{
|
||||
const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
|
||||
const __be32 *reg, *endp;
|
||||
int l;
|
||||
struct memory_reserve_config *mrc = data;
|
||||
u64 lpae_start = 1ULL << 32;
|
||||
|
||||
/* We are scanning "memory" nodes only */
|
||||
if (type == NULL || strcmp(type, "memory"))
|
||||
return 0;
|
||||
|
||||
reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
|
||||
if (reg == NULL)
|
||||
reg = of_get_flat_dt_prop(node, "reg", &l);
|
||||
if (reg == NULL)
|
||||
return 0;
|
||||
|
||||
endp = reg + (l / sizeof(__be32));
|
||||
while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
|
||||
u64 base, size;
|
||||
|
||||
base = dt_mem_next_cell(dt_root_addr_cells, ®);
|
||||
size = dt_mem_next_cell(dt_root_size_cells, ®);
|
||||
|
||||
if (base >= lpae_start)
|
||||
continue;
|
||||
|
||||
if ((base + size) >= lpae_start)
|
||||
size = lpae_start - base;
|
||||
|
||||
if (size < mrc->reserved)
|
||||
continue;
|
||||
|
||||
if (base < mrc->base)
|
||||
continue;
|
||||
|
||||
/* keep the area at top near the 32-bit legacy limit */
|
||||
mrc->base = base + size - mrc->reserved;
|
||||
mrc->size = mrc->reserved;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init rcar_gen2_reserve(void)
|
||||
{
|
||||
struct memory_reserve_config mrc;
|
||||
|
||||
/* reserve 256 MiB at the top of the physical legacy 32-bit space */
|
||||
memset(&mrc, 0, sizeof(mrc));
|
||||
mrc.reserved = SZ_256M;
|
||||
|
||||
of_scan_flat_dt(rcar_gen2_scan_mem, &mrc);
|
||||
#ifdef CONFIG_DMA_CMA
|
||||
if (mrc.size && memblock_is_region_memory(mrc.base, mrc.size)) {
|
||||
static struct cma *rcar_gen2_dma_contiguous;
|
||||
|
||||
dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
|
||||
&rcar_gen2_dma_contiguous, true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
|
||||
"renesas,r8a7790",
|
||||
"renesas,r8a7791",
|
||||
|
|
@ -204,7 +130,6 @@ static const char * const rcar_gen2_boards_compat_dt[] __initconst = {
|
|||
DT_MACHINE_START(RCAR_GEN2_DT, "Generic R-Car Gen2 (Flattened Device Tree)")
|
||||
.init_late = shmobile_init_late,
|
||||
.init_time = rcar_gen2_timer_init,
|
||||
.reserve = rcar_gen2_reserve,
|
||||
.dt_compat = rcar_gen2_boards_compat_dt,
|
||||
MACHINE_END
|
||||
|
||||
|
|
@ -220,6 +145,5 @@ static const char * const rz_g1_boards_compat_dt[] __initconst = {
|
|||
DT_MACHINE_START(RZ_G1_DT, "Generic RZ/G1 (Flattened Device Tree)")
|
||||
.init_late = shmobile_init_late,
|
||||
.init_time = rcar_gen2_timer_init,
|
||||
.reserve = rcar_gen2_reserve,
|
||||
.dt_compat = rz_g1_boards_compat_dt,
|
||||
MACHINE_END
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user