ARM: Clarifies creation of Linux and baremetal ARM systems.
authorAli Saidi <Ali.Saidi@ARM.com>
Wed, 23 Feb 2011 21:10:48 +0000 (15:10 -0600)
committerAli Saidi <Ali.Saidi@ARM.com>
Wed, 23 Feb 2011 21:10:48 +0000 (15:10 -0600)
makeArmSystem creates both bare-metal and Linux systems more cleanly.
machine_type was never optional though listed as an optional argument; a system
such as "RealView_PBX" must now be explicitly specified.  Now that it is a
required argument, the placement of the arguments has changed slightly
requiring some changes to calls that create ARM systems.

configs/common/FSConfig.py
configs/example/fs.py
tests/configs/realview-simple-atomic.py
tests/configs/realview-simple-timing.py

index f58fd3d2e91ba6542371c814f80a6c54f2e86743..2c6696ea7b2af088d7a15d445c1985905af62c30 100644 (file)
@@ -184,8 +184,9 @@ def makeSparcSystem(mem_mode, mdesc = None):
 
     return self
 
-def makeLinuxArmSystem(mem_mode, mdesc = None, bare_metal=False,
-        machine_type = None):
+def makeArmSystem(mem_mode, machine_type, mdesc = None, bare_metal=False):
+    assert machine_type
+
     if bare_metal:
         self = ArmSystem()
     else:
@@ -228,10 +229,15 @@ def makeLinuxArmSystem(mem_mode, mdesc = None, bare_metal=False,
         print "Unknown Machine Type"
         sys.exit(1)
 
-    if not bare_metal and machine_type:
-        self.machine_type = machine_type
-    elif bare_metal:
+    if bare_metal:
+        # EOT character on UART will end the simulation
         self.realview.uart.end_on_eot = True
+    else:
+        self.machine_type = machine_type
+        self.kernel = binary('vmlinux.arm')
+        self.boot_osflags = 'earlyprintk mem=128MB console=ttyAMA0' +          \
+                ' lpj=19988480 norandmaps slram=slram0,0x8000000,+0x8000000' + \
+                ' mtdparts=slram0:- rw loglevel=8 root=/dev/mtdblock0'
 
     self.realview.attachOnChipIO(self.membus)
     self.realview.attachIO(self.iobus)
@@ -239,10 +245,6 @@ def makeLinuxArmSystem(mem_mode, mdesc = None, bare_metal=False,
     self.intrctrl = IntrControl()
     self.terminal = Terminal()
     self.vncserver = VncServer()
-    self.kernel = binary('vmlinux.arm')
-    self.boot_osflags = 'earlyprintk mem=128MB console=ttyAMA0 lpj=19988480' + \
-                        ' norandmaps slram=slram0,0x8000000,+0x8000000' +      \
-                        ' mtdparts=slram0:- rw loglevel=8 root=/dev/mtdblock0'
 
     return self
 
index b392f1a919bcaf2db2c230509f512eb71c4ab674..420cf1f8bc3fe3dda938374712d3ed290c8ed3dc 100644 (file)
@@ -134,8 +134,9 @@ elif buildEnv['TARGET_ISA'] == "x86":
     test_sys = makeLinuxX86System(test_mem_mode, options.num_cpus, bm[0])
     setWorkCountOptions(test_sys, options)
 elif buildEnv['TARGET_ISA'] == "arm":
-    test_sys = makeLinuxArmSystem(test_mem_mode, bm[0],
-            bare_metal=options.bare_metal, machine_type=options.machine_type)
+    test_sys = makeArmSystem(test_mem_mode,
+            options.machine_type, bm[0],
+            bare_metal=options.bare_metal)
 else:
     fatal("incapable of building non-alpha or non-sparc full system!")
 
@@ -184,7 +185,8 @@ if len(bm) == 2:
     elif buildEnv['TARGET_ISA'] == 'x86':
         drive_sys = makeX86System(drive_mem_mode, np, bm[1])
     elif buildEnv['TARGET_ISA'] == 'arm':
-        drive_sys = makeLinuxArmSystem(drive_mem_mode, bm[1])
+        drive_sys = makeArmSystem(drive_mem_mode,
+                machine_options.machine_type, bm[1])
     drive_sys.cpu = DriveCPUClass(cpu_id=0)
     drive_sys.cpu.connectAllPorts(drive_sys.membus)
     if options.fastmem:
index c20a67df72e823750ba5f4113ac3b17f93f2bd70..ab6d612d46899047906a9640a841ec71c259e361 100644 (file)
@@ -68,7 +68,7 @@ class IOCache(BaseCache):
 #cpu
 cpu = AtomicSimpleCPU(cpu_id=0)
 #the system
-system = FSConfig.makeLinuxArmSystem('atomic', None, False, "RealView_PBX")
+system = FSConfig.makeArmSystem('atomic', "RealView_PBX", None, False)
 system.bridge.filter_ranges_a=[AddrRange(0, Addr.max)]
 system.bridge.filter_ranges_b=[AddrRange(0, size='128MB')]
 system.iocache = IOCache()
index a1e363447fe11dfd38c855260667c2e8e6c8ed53..53b6ab2b23c4ef37ec65da825586a7c3808e4212 100644 (file)
@@ -69,7 +69,7 @@ class IOCache(BaseCache):
 #cpu
 cpu = TimingSimpleCPU(cpu_id=0)
 #the system
-system = FSConfig.makeLinuxArmSystem('timing', None, False, "RealView_PBX")
+system = FSConfig.makeArmSystem('timing', "RealView_PBX", None, False)
 
 system.cpu = cpu
 #create the l1/l2 bus