author | Gareth Stockwell <gareth.stockwell@accenture.com> |
Fri, 24 Sep 2010 13:44:00 +0100 | |
branch | graphics-phase-3 |
changeset 117 | b7d35cad610d |
parent 93 | 07b904f40417 |
permissions | -rw-r--r-- |
74 | 1 |
# |
2 |
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
# All rights reserved. |
|
4 |
# This component and the accompanying materials are made available |
|
5 |
# under the terms of "Eclipse Public License v1.0" |
|
6 |
# which accompanies this distribution, and is available |
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
# |
|
9 |
# Initial Contributors: |
|
10 |
# Nokia Corporation - initial contribution. |
|
11 |
# |
|
12 |
# Contributors: |
|
13 |
# |
|
14 |
# Description: syborg_nvmemorydevice.py |
|
15 |
# A simple non volatile memory device nvmemory.dll python wrapper |
|
16 |
# Represents a non volatile memory device register interface for quest OS in QEMU Syborg environment. |
|
17 |
# |
|
18 |
# Gets the following from devicetree (.dtb configuration file) |
|
19 |
# drive_size - the size of the non volatile memory array to be created if there is no such thing available when the system is started |
|
20 |
# sector_size - the size of the sector for the memory device |
|
21 |
# drive_image_name - the name of the image to be used |
|
22 |
# |
|
23 |
# Creates an empty image of specified size and name if there is not image available when the system is started |
|
24 |
# |
|
25 |
||
26 |
import ctypes |
|
27 |
import qemu |
|
28 |
import sys |
|
29 |
import os |
|
30 |
import array |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
31 |
import platform |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
32 |
import re |
74 | 33 |
|
34 |
class syborg_nvmemorydevice(qemu.devclass): |
|
35 |
# 256 MB default empty drive size if there is no readymade image available |
|
36 |
DEFAULT_DRIVE_SIZE = 0x10000000 |
|
37 |
DEVICE_SECTOR_SIZE = 0x200 |
|
38 |
DRIVE_NAME = "qemudrive.img" |
|
39 |
DRIVE_PATH = "nvmemory" |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
40 |
|
74 | 41 |
# Memory device registers |
42 |
R_NVMEM_ID = 0x0000 |
|
43 |
R_NVMEM_TRANSACTION_OFFSET = 0x0004 |
|
44 |
R_NVMEM_TRANSACTION_SIZE = 0x0008 |
|
45 |
R_NVMEM_TRANSACTION_DIRECTION = 0x000c |
|
46 |
R_NVMEM_TRANSACTION_EXECUTE = 0x0010 |
|
47 |
R_NVMEM_SHARED_MEMORY_BASE = 0x0014 |
|
48 |
R_NVMEM_NV_MEMORY_SIZE = 0x0018 |
|
49 |
R_NVMEM_SHARED_MEMORY_SIZE = 0x001c |
|
50 |
R_NVMEM_STATUS = 0x0020 |
|
51 |
R_NVMEM_ENABLE = 0x0024 |
|
52 |
R_NVMEM_LASTREG = 0x0028 # not a register, address of last register |
|
53 |
||
54 |
NVMEM_TRANSACTION_READ = 1 |
|
55 |
NVMEM_TRANSACTION_WRITE = 2 |
|
56 |
# Variables to store the information for current transaction |
|
57 |
shared_memory_base = 0 |
|
58 |
shared_memory_size = 0 |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
59 |
transaction_offset = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
60 |
transaction_size = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
61 |
transaction_direction = 0 |
74 | 62 |
# Variables to validate transaction |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
63 |
transaction_offset_set = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
64 |
transaction_size_set = 0 |
74 | 65 |
transaction_direction_set = 0 |
66 |
nvmemory_sector_count = 0 |
|
67 |
||
68 |
drive_size = 0 |
|
69 |
sector_size = 0 |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
70 |
drive_image_name = "" |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
71 |
host_plat = platform.platform(); |
74 | 72 |
|
73 |
def create(self): |
|
74 |
print "syborg_nvmemorydevice: create\n" |
|
75 |
||
76 |
# Get properties |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
77 |
self.drive_size = self.properties["drive_size"] |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
78 |
self.sector_size = self.properties["sector_size"] |
74 | 79 |
self.drive_image_name = self.properties["drive_image_name"] |
80 |
||
81 |
print "drive size: ", self.drive_size |
|
82 |
print "sector size: ", self.sector_size |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
83 |
print "drive name: ", self.drive_image_name |
74 | 84 |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
85 |
drive_path_and_name = os.path.join(self.DRIVE_PATH, self.drive_image_name) |
74 | 86 |
# Save working directory |
87 |
self.working_dir = os.getcwd() |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
88 |
nvmem_lib = "" |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
89 |
open_mode = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
90 |
if re.match('^linux',self.host_plat,re.I): |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
91 |
nvmemlib_name = "libnvmemmory.so" |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
92 |
open_mode = os.O_RDWR |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
93 |
else: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
94 |
nvmemlib_name = "nvmemmory.dll" |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
95 |
open_mode = os.O_RDWR|os.O_BINARY |
74 | 96 |
|
97 |
# Open the nvmemory library |
|
98 |
try: |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
99 |
self.nvmemlib = ctypes.CDLL(nvmemlib_name) |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
100 |
except Exception, e: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
101 |
print repr(e) |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
102 |
sys.exit("syborg_nvmemorydevice: nvmemmory load failed") |
74 | 103 |
|
104 |
# Create an instance of non volatile memory handler class |
|
105 |
self.obj = self.nvmemlib.nvmem_create( self.sector_size ) |
|
106 |
self.nvmemlib.nvmem_reset( self.obj ) |
|
107 |
||
108 |
# Create drive image path |
|
109 |
try: |
|
110 |
print "syborg_nvmemorydevice: Check drive image path\n" |
|
111 |
os.mkdir( self.DRIVE_PATH ) |
|
112 |
except: |
|
113 |
# Here we could check why we failed - usually because the path already exists \n" |
|
114 |
pass |
|
115 |
try: |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
116 |
self.filehandle = os.open( drive_path_and_name, open_mode ) |
74 | 117 |
os.close( self.filehandle ) |
118 |
except: |
|
119 |
print "syborg_nvmemorydevice: drive image not found - create\n" |
|
120 |
self.filehandle = open( drive_path_and_name, "wb" ) |
|
121 |
# Initialize file with zeroes. This may take a while |
|
122 |
temparray = array.array("B", [0,0,0,0,0,0,0,0]) |
|
123 |
arraylength = temparray.buffer_info()[1] * temparray.itemsize |
|
124 |
multiplier = self.drive_size / arraylength / 128 |
|
125 |
temparray = temparray * multiplier |
|
126 |
arraylength = temparray.buffer_info()[1] * temparray.itemsize |
|
127 |
print "array length: ", arraylength |
|
128 |
index = 0 |
|
129 |
while index < 128: |
|
130 |
temparray.tofile(self.filehandle) |
|
131 |
index = index+1 |
|
132 |
||
133 |
# Create path and get handle to the raw memory array |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
134 |
imagepath = os.path.join(self.working_dir, drive_path_and_name) |
74 | 135 |
print "imagepath: ", imagepath |
136 |
self.nvmemhandle = self.nvmemlib.nvmem_open( self.obj, imagepath ) |
|
137 |
if( self.nvmemhandle < 0 ): |
|
138 |
error_msg = "syborg_nvmemorydevice: nvmem_open error: ", self.nvmemhandle |
|
139 |
sys.exit( error_msg ) |
|
140 |
||
141 |
# Initialize callback and get memory sector count |
|
142 |
self.initialize_nvmem_callback() |
|
143 |
self.nvmemory_sector_count = self.nvmemlib.nvmem_get_sector_count( self.obj, self.nvmemhandle ) |
|
144 |
print "syborg_nvmemorydevice: created\n" |
|
145 |
||
146 |
def updateIrq(self,new_value): |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
147 |
self.set_irq_level(0, new_value) |
74 | 148 |
|
149 |
def nvmem_request_callback(self, result): |
|
150 |
#print "graphics_request_callback: " , result |
|
151 |
self.status_reg = result |
|
152 |
self.updateIrq(1) |
|
153 |
return 0 |
|
154 |
||
155 |
def initialize_nvmem_callback(self): |
|
156 |
self.CALLBACKFUNC = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int) |
|
157 |
self.nvmem_callback = self.CALLBACKFUNC(self.nvmem_request_callback) |
|
158 |
self.nvmemlib.nvmem_set_callback( self.obj, self.nvmem_callback ) |
|
159 |
||
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
160 |
def read_reg(self, offset): |
74 | 161 |
offset >>= 2 |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
162 |
#print "read register: 0x%x" % (offset) |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
163 |
if offset == self.R_NVMEM_ID: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
164 |
return 0xDEADBEEF |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
165 |
elif offset == self.R_NVMEM_TRANSACTION_OFFSET: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
166 |
return self.transaction_offset |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
167 |
elif offset == self.R_NVMEM_TRANSACTION_SIZE: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
168 |
return self.transaction_size |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
169 |
elif offset == self.R_NVMEM_TRANSACTION_DIRECTION: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
170 |
return self.transaction_direction |
74 | 171 |
elif offset == self.R_NVMEM_SHARED_MEMORY_BASE: |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
172 |
return self.shared_memory_base |
74 | 173 |
elif offset == self.R_NVMEM_SHARED_MEMORY_SIZE: |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
174 |
return self.shared_memory_size |
74 | 175 |
elif offset == self.R_NVMEM_NV_MEMORY_SIZE: |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
176 |
return self.nvmemory_sector_count |
74 | 177 |
elif offset == self.R_NVMEM_STATUS: |
178 |
self.updateIrq(0) |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
179 |
return self.status_reg |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
180 |
else: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
181 |
reg_read_error = "syborg_nvmemorydevice: Illegal register read at: ", offset |
74 | 182 |
sys.exit( reg_read_error ) |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
183 |
|
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
184 |
def write_reg(self, offset, value): |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
185 |
offset >>= 2 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
186 |
#print "write register: 0x%x value: 0x%x" % (offset, value) |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
187 |
if offset == self.R_NVMEM_TRANSACTION_OFFSET: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
188 |
self.transaction_offset = value |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
189 |
self.transaction_offset_set = 1 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
190 |
elif offset == self.R_NVMEM_TRANSACTION_SIZE: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
191 |
self.transaction_size = value |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
192 |
self.transaction_size_set = 1 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
193 |
elif offset == self.R_NVMEM_TRANSACTION_DIRECTION: |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
194 |
self.transaction_direction = value |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
195 |
self.transaction_direction_set = 1 |
74 | 196 |
elif offset == self.R_NVMEM_TRANSACTION_EXECUTE: |
197 |
if( (self.transaction_offset_set == 0) | (self.transaction_size_set == 0) | (self.transaction_direction_set == 0) ): |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
198 |
error_msg = "syborg_nvmemorydevice: Illegal transaction! All the required parameters are not set" |
74 | 199 |
sys.exit( error_msg ) |
200 |
elif(self.transaction_size == 0 ): |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
201 |
error_msg = "syborg_nvmemorydevice: Zero size transaction issued!" |
74 | 202 |
sys.exit( error_msg ) |
203 |
else: |
|
204 |
if( self.transaction_direction == self.NVMEM_TRANSACTION_READ ): |
|
205 |
self.nvmemlib.nvmem_read( self.obj, self.nvmemory_sharedmemory_host_address, self.nvmemhandle, self.transaction_offset, self.transaction_size ) |
|
206 |
elif( self.transaction_direction == self.NVMEM_TRANSACTION_WRITE ): |
|
207 |
self.nvmemlib.nvmem_write( self.obj, self.nvmemory_sharedmemory_host_address, self.nvmemhandle, self.transaction_offset, self.transaction_size ) |
|
208 |
else: |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
209 |
error_msg = "syborg_nvmemorydevice: Transaction direction not set!" |
74 | 210 |
sys.exit( error_msg ) |
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
211 |
self.transaction_offset_set = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
212 |
self.transaction_size_set = 0 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
213 |
self.transaction_direction_set = 0 |
74 | 214 |
elif offset == self.R_NVMEM_SHARED_MEMORY_BASE: |
215 |
self.shared_memory_base = value |
|
216 |
elif offset == self.R_NVMEM_SHARED_MEMORY_SIZE: |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
217 |
self.shared_memory_size = value |
74 | 218 |
elif offset == self.R_NVMEM_ENABLE: |
219 |
if( value > 0 ): |
|
220 |
self.nvmemory_memregion = qemu.memregion( self.shared_memory_base, self.shared_memory_size ) |
|
221 |
self.nvmemory_sharedmemory_host_address = self.nvmemory_memregion.region_host_addr() |
|
222 |
print"syborg_nvmemorydevice: host addr: 0x%08x" % (self.nvmemory_sharedmemory_host_address) |
|
223 |
else: |
|
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
224 |
reg_write_error = "syborg_nvmemorydevice: Illegal register write to: ", offset |
74 | 225 |
sys.exit( reg_write_error ) |
226 |
||
93
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
227 |
# Device class properties |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
228 |
regions = [qemu.ioregion(0x1000, readl=read_reg, writel=write_reg)] |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
229 |
irqs = 1 |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
230 |
name = "syborg,nvmemorydevice" |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
231 |
properties = {"drive_size":DEFAULT_DRIVE_SIZE, "sector_size":DEVICE_SECTOR_SIZE, "drive_image_name":DRIVE_NAME} |
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
232 |
|
07b904f40417
Provisional fix for bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents:
74
diff
changeset
|
233 |
qemu.register_device(syborg_nvmemorydevice) |