blob: a01cb72a471eb8d94b81da6d296b0054412cd662 [file] [log] [blame]
/* Copyright lowRISC contributors. */
/* Licensed under the Apache License, Version 2.0, see LICENSE for details. */
/* SPDX-License-Identifier: Apache-2.0 */
<%!
def memory_to_flags(memory):
memory_type = memory["type"]
memory_access = memory.get("swaccess", "rw")
assert memory_access in ["ro", "rw"]
flags_str = ""
if memory_access == "ro":
flags_str += "r"
else:
flags_str += "rw"
if memory_type in ["rom", "eflash"]:
flags_str += "x"
return flags_str
%>\
/**
* Partial linker script for chip memory configuration.
*/
MEMORY {
% for m in top["memory"]:
${m["name"]}(${memory_to_flags(m)}) : ORIGIN = ${m["base_addr"]}, LENGTH = ${m["size"]}
% endfor
}