Lines Matching +full:addr +full:- +full:range
3 # SPDX-License-Identifier: Apache-2.0
27 # specific SOC anyway), so it really doesn't matter and we hard-code
30 # (For future reference: in /proc/device-tree on current ChromeOS
33 # that device node, and the two dram areas are "memory-region"
35 # nodes under "/reserved-memory").
46 compat = readfile(glob("/proc/device-tree/**/adsp@*/compatible", recursive=True)[0], "r")
47 m = re.match(r'.*(mt\d{4})-dsp', compat)
54 # also refers by reference to reserved-memory regions of system
58 # (addr, size) tuple.
60 path = glob("/proc/device-tree/**/adsp@*/", recursive=True)[0]
61 rnames = readfile(path + "reg-names", "r").split('\0')[:-1]
64 for i, ph in enumerate(struct.unpack(">II", readfile(path + "memory-region"))):
65 for rmem in glob("/proc/device-tree/reserved-memory/*/"):
68 (addr, sz) = struct.unpack(">QQ", readfile(rmem + "reg"))
69 maps[f"dram{i}"] = (addr, sz)
83 r.EMI_MAP_ADDR = 0x981C # == host SRAM mapping - 0x40000000 (controls MMIO map?)
88 return range(0x700000, 0x800000)
118 return range(0x700000, 0x800000)
151 return range(0x580000, 0x600000)
170 # Temporary logging protocol: watch the 1M null-terminated log
171 # stream at 0x60700000 -- the top of the linkable region of
203 addr = self.base_addr + val
204 self.ptrs[name] = ctypes.c_uint32.from_address(addr)
222 # integer argument representing a local/in-process address for the
233 def __init__(self, addr): argument
234 r = Regs(addr)
240 # Sanity-check, the 32M size limit isn't a rule, but seems reasonable
244 self.data = (ctypes.c_char * r.WLEN).from_address(addr + 16)
257 behind = seq - last_seq
258 if behind > ((end - start) % wlen):
260 copy = (end - behind) % wlen
261 suffix = min(behind, wlen - copy)
262 for i in range(suffix):
265 l2 = behind - suffix
267 for i in range(l2):
271 return msg[0:msglen].decode("utf-8", "replace")
274 # Locates a winstream descriptor in the firmware via its 96-bit magic
286 magoff = maps[m].find(magic[8:], magoff) - 8
288 addr = le4(maps[m][magoff + 12 : magoff + 16])
289 return addr
295 off = globaddr - mmio[m][0]
355 # zero-fill SRAM, as that's been observed to reboot the host
358 # pylint: disable=consider-using-enumerate
359 for i in range(sram_len):
361 # for i in range(sram_len, mmio["sram"][1]):
363 for i in range(len(dram)):
365 for i in range(len(dram), mmio["dram1"][1]):