diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py --- a/configs/common/FSConfig.py +++ b/configs/common/FSConfig.py @@ -265,6 +265,78 @@ return self +def makeArmRubySystem(mem_mode, machine_type, mdesc = None, bare_metal=False): + assert machine_type + + if bare_metal: + self = ArmSystem() + else: + self = LinuxArmSystem() + + if not mdesc: + # generic system + mdesc = SysConfig() + + self.readfile = mdesc.script() + self.piobus = Bus(bus_id=0) + self.mem_mode = mem_mode + + if machine_type == "RealView_PBX": + self.realview = RealViewPBX() + elif machine_type == "RealView_EB": + self.realview = RealViewEB() + elif machine_type == "VExpress_ELT": + self.realview = VExpress_ELT() + else: + print "Unknown Machine Type" + sys.exit(1) + print machine_type + self.cf0 = CowIdeDisk(driveID='master') + self.cf0.childImage(mdesc.disk()) + # default to an IDE controller rather than a CF one + # assuming we've got one + try: + self.realview.ide.disks = [self.cf0] + except: + self.realview.cf_ctrl.disks = [self.cf0] + + if bare_metal: + # EOT character on UART will end the simulation + self.realview.uart.end_on_eot = True + self.physmem = PhysicalMemory(range = AddrRange(Addr('256MB')), zero = True) + else: + self.kernel = binary('vmlinux.arm.smp.fb.2.6.38.8') + self.machine_type = machine_type + if convert.toMemorySize(mdesc.mem()) > convert.toMemorySize('256MB'): + print "The currently implemented ARM platforms only easily support 256MB of DRAM" + print "It might be possible to get some more by using 256MB@0x30000000, but this" + print "is untested and may require some heroics" + + boot_flags = 'earlyprintk console=ttyAMA0 lpj=19988480 norandmaps ' + \ + 'rw loglevel=8 mem=%s root=/dev/sda1' % mdesc.mem() + + self.physmem = PhysicalMemory(range = AddrRange(Addr(mdesc.mem())), + zero = True) + self.nvmem = PhysicalMemory(range = AddrRange(Addr('2GB'), + size = '64MB'), zero = True) + + self.boot_loader = binary('boot.arm') + self.boot_loader_mem = self.nvmem + self.gic_cpu_addr = self.realview.gic.cpu_addr + self.flags_addr = self.realview.realview_io.pio_addr + 0x30 + + if mdesc.disk().count('android'): + boot_flags += " init=/init " + self.boot_osflags = boot_flags + self.nvmem.port = self.piobus.port + self.physmem.port = self.piobus.port + self.realview.attachOnChipIO(self.piobus) + self.realview.attachIO(self.piobus) + self.intrctrl = IntrControl() + self.terminal = Terminal() + self.vncserver = VncServer() + + return self def makeLinuxMipsSystem(mem_mode, mdesc = None): class BaseMalta(Malta): diff -git a/configs/example/ruby_fs.py b/configs/example/ruby_fs.py --- a/configs/example/ruby_fs.py +++ b/configs/example/ruby_fs.py @@ -63,6 +63,13 @@ # System options parser.add_option("--kernel", action="store", type="string") parser.add_option("--script", action="store", type="string") + +if buildEnv['TARGET_ISA'] == "arm": + parser.add_option("--bare-metal", action="store_true", + help="Provide the raw system without the linux specific bits") + parser.add_option("--machine-type", action="store", type="choice", + choices=ArmMachineType.map.keys(), default="RealView_PBX") + # Benchmark options parser.add_option("-b", "--benchmark", action="store", type="string", dest="benchmark", @@ -116,6 +123,9 @@ elif buildEnv['TARGET_ISA'] == "x86": system = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0], True) setWorkCountOptions(system, options) +elif buildEnv['TARGET_ISA'] == "arm": + system = makeArmRubySystem(test_mem_mode, options.machine_type, bm[0], bare_metal=options.bare_metal) + setWorkCountOptions(system, options) else: fatal("incapable of building non-alpha or non-x86 full system!") @@ -126,8 +136,7 @@ system.readfile = options.script system.cpu = [CPUClass(cpu_id=i) for i in xrange(options.num_cpus)] -Ruby.create_system(options, system, system.piobus, system._dma_devices) - +Ruby.create_system(options, system, system.membus, system.dma_devices) for (i, cpu) in enumerate(system.cpu): # @@ -140,6 +149,9 @@ cpu.dtb.walker.port = system.ruby._cpu_ruby_ports[i].port cpu.interrupts.pio = system.piobus.port cpu.interrupts.int_port = system.piobus.port + if buildEnv['TARGET_ISA'] == "arm": + cpu.itb.walker.port = system.ruby._cpu_ruby_ports[i].port + cpu.dtb.walker.port = system.ruby._cpu_ruby_ports[i].port root = Root(system = system)