ARM: Include IDE/CF controller by default in PBX model.
authorAli Saidi <Ali.Saidi@ARM.com>
Mon, 4 Apr 2011 16:42:31 +0000 (11:42 -0500)
committerAli Saidi <Ali.Saidi@ARM.com>
Mon, 4 Apr 2011 16:42:31 +0000 (11:42 -0500)
Frame buffer and boot linux:
./build/ARM_FS/m5.opt configs/example/fs.py --benchmark=ArmLinuxFrameBuf --kernel=vmlinux.touchkit
Linux from a CF card:
./build/ARM_FS/m5.opt configs/example/fs.py --benchmark=ArmLinuxCflash --kernel=vmlinux.touchkit
Run Android
./build/ARM_FS/m5.opt configs/example/fs.py --benchmark=ArmAndroid --kernel=vmlinux.android
Run MP
./build/ARM_FS/m5.opt configs/example/fs.py --benchmark=ArmLinuxCflash --kernel=vmlinux.mp-2.6.38

configs/boot/null.rcS [new file with mode: 0644]
configs/common/Benchmarks.py
configs/common/FSConfig.py
src/dev/arm/RealView.py

diff --git a/configs/boot/null.rcS b/configs/boot/null.rcS
new file mode 100644 (file)
index 0000000..e69de29
index 366152d62b6bde3d8e3c35f4200de19bab6ffa79..608dba266188bd940be40bd3c2281fb9aa812898 100644 (file)
@@ -55,6 +55,8 @@ class SysConfig:
             return env.get('LINUX_IMAGE', disk('linux-latest.img'))
         elif buildEnv['TARGET_ISA'] == 'x86':
             return env.get('LINUX_IMAGE', disk('x86root.img'))
+        elif buildEnv['TARGET_ISA'] == 'arm':
+            return env.get('LINUX_IMAGE', disk('ael-arm.ext2'))
         else:
             print "Don't know what default disk image to use for ISA %s" % \
                 buildEnv['TARGET_ISA']
@@ -109,9 +111,10 @@ Benchmarks = {
     'ValStreamCopy':    [SysConfig('micro_streamcopy.rcS', '512MB')],
 
     'MutexTest':        [SysConfig('mutex-test.rcS', '128MB')],
-
-    'bnAn': [SysConfig('/z/saidi/work/m5.newmem.head/configs/boot/bn-app.rcS',
-                       '128MB', '/z/saidi/work/bottleneck/bnimg.img')]
+    'ArmLinux':         [SysConfig('null.rcS', '128MB', 'ael-arm.ext2')],
+    'ArmLinuxFrameBuf': [SysConfig('null.rcS', '128MB', 'ael-full.ext2')],
+    'ArmLinuxCflash':   [SysConfig('null.rcS', '256MB', 'linux-arm.img')],
+    'ArmAndroid':       [SysConfig('null.rcS', '256MB', 'android-mbr.img')],
 }
 
 benchs = Benchmarks.keys()
index 48ece0db4aa6916d8f9a2f3237d39868535f1b06..8ab06a5d03ea715b40d9386a415333782432933d 100644 (file)
@@ -206,16 +206,6 @@ def makeArmSystem(mem_mode, machine_type, mdesc = None, bare_metal=False):
 
     self.mem_mode = mem_mode
 
-    #self.cf0 = CowIdeDisk(driveID='master')
-    #self.cf0.childImage(mdesc.disk())
-    #self.cf_ctrl = IdeController(disks=[self.cf0],
-    #                             pci_func = 0, pci_dev = 0, pci_bus = 0,
-    #                             io_shift = 1, ctrl_offset = 2, Command = 0x1,
-    #                             BAR0 = 0x18000000, BAR0Size = '16B',
-    #                             BAR1 = 0x18000100, BAR1Size = '1B',
-    #                             BAR0LegacyIO = True, BAR1LegacyIO = True,)
-    #self.cf_ctrl.pio = self.iobus.port
-
     if machine_type == "RealView_PBX":
         self.realview = RealViewPBX()
     elif machine_type == "RealView_EB":
@@ -224,20 +214,39 @@ def makeArmSystem(mem_mode, machine_type, mdesc = None, bare_metal=False):
         print "Unknown Machine Type"
         sys.exit(1)
 
+    use_cf = False
+    if mdesc.disk()[-4:] == ".img":
+        use_cf = True
+        self.cf0 = CowIdeDisk(driveID='master')
+        self.cf0.childImage(mdesc.disk())
+        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)
+        self.physmem = PhysicalMemory(range = AddrRange(Addr('256MB')),
+                                      zero = True)
     else:
-        self.physmem = PhysicalMemory(range = AddrRange(Addr('128MB')), zero = True)
-        self.diskmem = PhysicalMemory(range = AddrRange(Addr('128MB'), size = '128MB'),
-                                  file = disk('ael-arm.ext2'))
-        self.diskmem.port = self.membus.port
-        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.machine_type = machine_type
+        boot_flags = 'earlyprintk console=ttyAMA0 lpj=19988480 norandmaps ' + \
+                     'rw loglevel=8 '
+        if use_cf:
+            self.physmem = PhysicalMemory(range = AddrRange(Addr('256MB')),
+                                          zero = True)
+            boot_flags += "mem=256MB root=/dev/sda1 "
+        else:
+            self.physmem = PhysicalMemory(range = AddrRange(Addr('128MB')),
+                                          zero = True)
+            self.diskmem = PhysicalMemory(range = AddrRange(Addr('128MB'),
+                                          size = '128MB'),
+                                          file = disk(mdesc.disk()))
+            self.diskmem.port = self.membus.port
+            boot_flags +=  "mem=128MB slram=slram0,0x8000000,+0x8000000 " + \
+                            "mtdparts=slram0:- root=/dev/mtdblock0 "
+        if mdesc.disk().count('android'):
+            boot_flags += "init=/init "
+        self.boot_osflags = boot_flags
 
     self.physmem.port = self.membus.port
     self.realview.attachOnChipIO(self.membus)
index ef3f68a8848317076f95974cd129b5317bcc095f..8a43c5b8d0309cdf6b76740500e6660de0ac4872 100644 (file)
@@ -43,6 +43,7 @@
 from m5.params import *
 from m5.proxy import *
 from Device import BasicPioDevice, PioDevice, IsaFake, BadAddr, DmaDevice
+from Ide import *
 from Platform import Platform
 from Terminal import Terminal
 from Uart import Uart
@@ -131,6 +132,12 @@ class RealViewPBX(RealView):
     clcd = Pl111(pio_addr=0x10020000, int_num=55)
     kmi0   = Pl050(pio_addr=0x10006000, int_num=52)
     kmi1   = Pl050(pio_addr=0x10007000, int_num=53, is_mouse=True)
+    cf_ctrl = IdeController(disks=[], pci_func=0, pci_dev=0, pci_bus=0,
+                            io_shift = 1, ctrl_offset = 2, Command = 0x1,
+                            BAR0 = 0x18000000, BAR0Size = '16B',
+                            BAR1 = 0x18000100, BAR1Size = '1B',
+                            BAR0LegacyIO = True, BAR1LegacyIO = True)
+
 
     l2x0_fake     = IsaFake(pio_addr=0x1f002000, pio_size=0xfff)
     flash_fake    = IsaFake(pio_addr=0x40000000, pio_size=0x4000000)
@@ -149,7 +156,6 @@ class RealViewPBX(RealView):
     aaci_fake     = AmbaFake(pio_addr=0x10004000)
     mmc_fake      = AmbaFake(pio_addr=0x10005000)
     rtc_fake      = AmbaFake(pio_addr=0x10017000, amba_id=0x41031)
-    cf0_fake      = IsaFake(pio_addr=0x18000000, pio_size=0xfff)
 
 
     # Attach I/O devices that are on chip
@@ -168,6 +174,7 @@ class RealViewPBX(RealView):
        self.clcd.pio          = bus.port
        self.kmi0.pio          = bus.port
        self.kmi1.pio          = bus.port
+       self.cf_ctrl.pio       = bus.port
        self.dmac_fake.pio     = bus.port
        self.uart1_fake.pio    = bus.port
        self.uart2_fake.pio    = bus.port
@@ -184,7 +191,6 @@ class RealViewPBX(RealView):
        self.mmc_fake.pio      = bus.port
        self.rtc_fake.pio      = bus.port
        self.flash_fake.pio    = bus.port
-       self.cf0_fake.pio      = bus.port
 
 # Reference for memory map and interrupt number
 # RealView Emulation Baseboard User Guide (ARM DUI 0143B)