From e69ece1008ba94f703a05e606d99860da840c0f2 Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov <7954832+dimerr@users.noreply.github.com> Date: Sun, 8 Nov 2026 06:16:15 +0000 Subject: [PATCH] anyka: EV200: osmem 40M, the rest of the 64 MiB is video memory OpenIPC's EV200 kernel now runs from the bottom of DDR and gives the ISP and the encoder the DDR above mem=, totalmem - osmem, as the other OpenIPC SoCs do. With mem=64M there is none. Default osmem to 40M on the EV200, the split the vendor firmware uses (24 of the 64 MiB for video). The EV300 and EV330 keep all of it. Verified on qemu-hisilicon ak3918ev200: this U-Boot with an empty environment and an OpenIPC/firmware ak3918ev200_lite image boots with mem=40M, the kernel reserves 24 MiB at 0x82800000 for video, and it reaches the login prompt. --- CLAUDE.md | 5 ++++- include/configs/openipc-common.h | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 9dd5f17b6eb6..23a9004dd6de 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -119,7 +119,10 @@ The memory map is the same in all three generations: system control at data to the load address and enters 0x40 bytes into the zImage, which hangs. OpenIPC builds entry = load; vendor kernels need repacking with `mkimage -e `. -- `mem=` is the whole DDR (`osmem` 64M/128M), as the vendor passes it. The +- `mem=` is the whole DDR (`osmem` 64M/128M), as the vendor passes it, + except on the EV200: `osmem` is 40M there, and OpenIPC's EV200 kernel + gives the ISP and the encoder the DDR above `mem=` (totalmem - osmem), + as the vendor firmware gives them 24 of the 64 MiB. The MTD name is `spi0.0` (`SFC`): the vendor kernels' `ak_spiflash` takes the SPI device's name. The console is `ttySAK0`. diff --git a/include/configs/openipc-common.h b/include/configs/openipc-common.h index 279b69790541..4f51b6c6bb70 100644 --- a/include/configs/openipc-common.h +++ b/include/configs/openipc-common.h @@ -24,10 +24,14 @@ #define VENDOR "anyka" /* - * Kernel memory (mem=): all of it, as the vendor U-Boot passes. The media - * drivers take their buffers from the kernel. + * Kernel memory (mem=). The EV200 kernel gives the ISP and the encoder the + * DRAM above mem= (totalmem - osmem), as the other OpenIPC SoCs do, and the + * vendor firmware gives them 24 MiB of the 64. Elsewhere all of it, as the + * vendor U-Boot passes: the media drivers take their buffers from the kernel. */ -#if PHYS_SDRAM_1_SIZE == 0x08000000 +#if defined(CONFIG_AK39_EV200) +#define OPENIPC_OSMEM "40M" +#elif PHYS_SDRAM_1_SIZE == 0x08000000 #define OPENIPC_OSMEM "128M" #else #define OPENIPC_OSMEM "64M"