arm: fix bare-metal memory setup.
The bare-metal configuration option still configured memory with the old scheme that no-longer works. This change unifies the code so there aren't any differences.
This commit is contained in:
parent
9900629f83
commit
3a5c975fd7
1 changed files with 18 additions and 21 deletions
|
@ -230,11 +230,27 @@ def makeArmSystem(mem_mode, machine_type, mdesc = None,
|
||||||
except:
|
except:
|
||||||
self.realview.cf_ctrl.disks = [self.cf0]
|
self.realview.cf_ctrl.disks = [self.cf0]
|
||||||
|
|
||||||
|
self.mem_ranges = []
|
||||||
|
size_remain = long(Addr(mdesc.mem()))
|
||||||
|
for region in self.realview._mem_regions:
|
||||||
|
if size_remain > long(region[1]):
|
||||||
|
self.mem_ranges.append(AddrRange(region[0], size=region[1]))
|
||||||
|
size_remain = size_remain - long(region[1])
|
||||||
|
else:
|
||||||
|
self.mem_ranges.append(AddrRange(region[0], size=size_remain))
|
||||||
|
size_remain = 0
|
||||||
|
break
|
||||||
|
warn("Memory size specified spans more than one region. Creating" \
|
||||||
|
" another memory controller for that range.")
|
||||||
|
|
||||||
|
if size_remain > 0:
|
||||||
|
fatal("The currently selected ARM platforms doesn't support" \
|
||||||
|
" the amount of DRAM you've selected. Please try" \
|
||||||
|
" another platform")
|
||||||
|
|
||||||
if bare_metal:
|
if bare_metal:
|
||||||
# EOT character on UART will end the simulation
|
# EOT character on UART will end the simulation
|
||||||
self.realview.uart.end_on_eot = True
|
self.realview.uart.end_on_eot = True
|
||||||
self.mem_ranges = [AddrRange(self.realview.mem_start_addr,
|
|
||||||
size = mdesc.mem())]
|
|
||||||
else:
|
else:
|
||||||
if machine_type == "VExpress_EMM64":
|
if machine_type == "VExpress_EMM64":
|
||||||
self.kernel = binary('vmlinux-3.16-aarch64-vexpress-emm64-pcie')
|
self.kernel = binary('vmlinux-3.16-aarch64-vexpress-emm64-pcie')
|
||||||
|
@ -251,25 +267,6 @@ def makeArmSystem(mem_mode, machine_type, mdesc = None,
|
||||||
'lpj=19988480 norandmaps rw loglevel=8 ' + \
|
'lpj=19988480 norandmaps rw loglevel=8 ' + \
|
||||||
'mem=%s root=/dev/sda1' % mdesc.mem()
|
'mem=%s root=/dev/sda1' % mdesc.mem()
|
||||||
|
|
||||||
self.mem_ranges = []
|
|
||||||
size_remain = long(Addr(mdesc.mem()))
|
|
||||||
for region in self.realview._mem_regions:
|
|
||||||
if size_remain > long(region[1]):
|
|
||||||
self.mem_ranges.append(AddrRange(region[0], size=region[1]))
|
|
||||||
size_remain = size_remain - long(region[1])
|
|
||||||
else:
|
|
||||||
self.mem_ranges.append(AddrRange(region[0], size=size_remain))
|
|
||||||
size_remain = 0
|
|
||||||
break
|
|
||||||
warn("Memory size specified spans more than one region. Creating" \
|
|
||||||
" another memory controller for that range.")
|
|
||||||
|
|
||||||
if size_remain > 0:
|
|
||||||
fatal("The currently selected ARM platforms doesn't support" \
|
|
||||||
" the amount of DRAM you've selected. Please try" \
|
|
||||||
" another platform")
|
|
||||||
|
|
||||||
|
|
||||||
self.realview.setupBootLoader(self.membus, self, binary)
|
self.realview.setupBootLoader(self.membus, self, binary)
|
||||||
self.gic_cpu_addr = self.realview.gic.cpu_addr
|
self.gic_cpu_addr = self.realview.gic.cpu_addr
|
||||||
self.flags_addr = self.realview.realview_io.pio_addr + 0x30
|
self.flags_addr = self.realview.realview_io.pio_addr + 0x30
|
||||||
|
|
Loading…
Reference in a new issue