Skip to content

Commit e772694

Browse files
Wei Liuwenlingz
authored andcommitted
acrn-config: dump iomem info from /proc/iomem
Need more information from iomem, so dump all the iomem information from /proc/iomem to instead of system ram information. Tracked-On: #4569 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com> Acked-by: Terry Zou <terry.zou@intel.com>
1 parent 8e7b80f commit e772694

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

misc/acrn-config/board_config/new_board_kconfig.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ def get_ram_range():
6161
# read system ram from board_info.xml
6262
ram_range = {}
6363

64-
sys_mem_lines = board_cfg_lib.get_info(
65-
board_cfg_lib.BOARD_INFO_FILE, "<SYSTEM_RAM_INFO>", "</SYSTEM_RAM_INFO>")
66-
for line in sys_mem_lines:
64+
io_mem_lines = board_cfg_lib.get_info(
65+
board_cfg_lib.BOARD_INFO_FILE, "<IOMEM_INFO>", "</IOMEM_INFO>")
66+
67+
for line in io_mem_lines:
68+
if 'System RAM' not in line:
69+
continue
6770
start_addr = int(line.split('-')[0], 16)
6871
end_addr = int(line.split('-')[1].split(':')[0], 16)
6972
mem_range = end_addr - start_addr

misc/acrn-config/target/misc.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,17 @@ def dump_system_ram(config):
145145
"""This will get systemd ram which are usable
146146
:param config: file pointer that opened for writing board config information
147147
"""
148-
print("\t<SYSTEM_RAM_INFO>", file=config)
148+
print("\t<IOMEM_INFO>", file=config)
149149
with open(MEM_PATH[0], 'rt') as mem_info:
150150

151151
while True:
152-
line = mem_info.readline().strip()
152+
line = mem_info.readline().strip('\n')
153153
if not line:
154154
break
155155

156-
pat_type = line.split(':')[1].strip()
157-
if pat_type == "System RAM":
158-
print("\t{}".format(line), file=config)
156+
print("\t{}".format(line), file=config)
159157

160-
print("\t</SYSTEM_RAM_INFO>", file=config)
158+
print("\t</IOMEM_INFO>", file=config)
161159
print("", file=config)
162160

163161

0 commit comments

Comments
 (0)