From 221444b660084d7c5ffad322c7ad1d12729b8d98 Mon Sep 17 00:00:00 2001 From: linmin Date: Tue, 4 Jun 2024 14:23:32 +0800 Subject: [PATCH 046/219] chore(es_buddy):Memory workaround for g2d hardware problem Changelogs: 1.Modified the buddy_system_init() interface in buddy.h accroding to the modification of libs/common whose commit id is:f0a47cf4ca77323388f8 This is a workaround for g2d because the g2d hardware has problem with accessing the 4GB boundary address. 2.Reserved 4kB size of memory at 4GB address boundary in eic7700-evb.dts and eic7700-evb-a2.dts, so that it is excluded from system memory and will never be used by g2d. --- arch/riscv/boot/dts/eswin/eic7700-evb-a2.dts | 5 +++++ arch/riscv/boot/dts/eswin/eic7700-evb.dts | 5 +++++ drivers/memory/eswin/buddy.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/eswin/eic7700-evb-a2.dts b/arch/riscv/boot/dts/eswin/eic7700-evb-a2.dts index f5c4712de03e..3f35d2201584 100644 --- a/arch/riscv/boot/dts/eswin/eic7700-evb-a2.dts +++ b/arch/riscv/boot/dts/eswin/eic7700-evb-a2.dts @@ -112,6 +112,11 @@ secure_memory_nid_0_part_1 { no-map; }; + g2d_4GB_boundary_reserved_4k { + no-map; + reg = <0x0 0xfffff000 0x0 0x1000>; + }; + mmz_nid_0_part_0 { compatible = "eswin-reserve-memory"; reg = <0x1 0x40000000 0x2 0x80000000>; diff --git a/arch/riscv/boot/dts/eswin/eic7700-evb.dts b/arch/riscv/boot/dts/eswin/eic7700-evb.dts index e3c9de0ada5d..f41705285b0b 100644 --- a/arch/riscv/boot/dts/eswin/eic7700-evb.dts +++ b/arch/riscv/boot/dts/eswin/eic7700-evb.dts @@ -111,6 +111,11 @@ secure_memory_nid_0_part_1 { no-map; }; + g2d_4GB_boundary_reserved_4k { + no-map; + reg = <0x0 0xfffff000 0x0 0x1000>; + }; + mmz_nid_0_part_0 { compatible = "eswin-reserve-memory"; reg = <0x1 0x40000000 0x2 0x80000000>; diff --git a/drivers/memory/eswin/buddy.h b/drivers/memory/eswin/buddy.h index e3c509a511c6..bc0fd6eb6ddb 100644 --- a/drivers/memory/eswin/buddy.h +++ b/drivers/memory/eswin/buddy.h @@ -105,7 +105,7 @@ struct mem_block { }; #endif -void buddy_system_init(struct mem_zone *zone, +void buddy_system_init(struct mem_block *memblock, struct esPage_s *start_page, unsigned long start_addr, unsigned long page_num); -- 2.47.0