fs.py revision 2549
1import os
2from SysPaths import *
3
4# Base for tests is directory containing this file.
5test_base = os.path.dirname(__file__)
6
7class BaseTsunami(Tsunami):
8    cchip = TsunamiCChip(pio_addr=0x801a0000000)
9    pchip = TsunamiPChip(pio_addr=0x80180000000)
10    pciconfig = PciConfigAll(pio_addr=0x801fe000000)
11    fake_sm_chip = IsaFake(pio_addr=0x801fc000370)
12
13    fake_uart1 = IsaFake(pio_addr=0x801fc0002f8)
14    fake_uart2 = IsaFake(pio_addr=0x801fc0003e8)
15    fake_uart3 = IsaFake(pio_addr=0x801fc0002e8)
16    fake_uart4 = IsaFake(pio_addr=0x801fc0003f0)
17
18    fake_ppc = IsaFake(pio_addr=0x801fc0003bc)
19
20    fake_OROM = IsaFake(pio_addr=0x800000a0000, pio_size=0x60000)
21
22    fake_pnp_addr = IsaFake(pio_addr=0x801fc000279)
23    fake_pnp_write = IsaFake(pio_addr=0x801fc000a79)
24    fake_pnp_read0 = IsaFake(pio_addr=0x801fc000203)
25    fake_pnp_read1 = IsaFake(pio_addr=0x801fc000243)
26    fake_pnp_read2 = IsaFake(pio_addr=0x801fc000283)
27    fake_pnp_read3 = IsaFake(pio_addr=0x801fc0002c3)
28    fake_pnp_read4 = IsaFake(pio_addr=0x801fc000303)
29    fake_pnp_read5 = IsaFake(pio_addr=0x801fc000343)
30    fake_pnp_read6 = IsaFake(pio_addr=0x801fc000383)
31    fake_pnp_read7 = IsaFake(pio_addr=0x801fc0003c3)
32
33    fake_ata0 = IsaFake(pio_addr=0x801fc0001f0)
34    fake_ata1 = IsaFake(pio_addr=0x801fc000170)
35
36    fb = BadDevice(pio_addr=0x801fc0003d0, devicename='FrameBuffer')
37    io = TsunamiIO(pio_addr=0x801fc000000)
38    uart = Uart8250(pio_addr=0x801fc0003f8)
39#    ethernet = NSGigE(configdata=NSGigEPciData(),
40#                      pci_bus=0, pci_dev=1, pci_func=0)
41#    etherint = NSGigEInt(device=Parent.ethernet)
42    console = AlphaConsole(pio_addr=0x80200000000, disk=Parent.simple_disk)
43#    bridge = PciFake(configdata=BridgePciData(), pci_bus=0, pci_dev=2, pci_func=0)
44
45#class FreeBSDTsunami(BaseTsunami):
46#    disk0 = FreeBSDRootDisk(delay='0us', driveID='master')
47#    ide = IdeController(disks=[Parent.disk0],
48#                        configdata=IdeControllerPciData(),
49#                        pci_func=0, pci_dev=0, pci_bus=0)
50
51#class LinuxTsunami(BaseTsunami):
52#    disk0 = LinuxRootDisk(delay='0us', driveID='master')
53#    ide = IdeController(disks=[Parent.disk0],
54#                        configdata=IdeControllerPciData(),
55#                        pci_func=0, pci_dev=0, pci_bus=0)
56
57class LinuxAlphaSystem(LinuxAlphaSystem):
58    magicbus = Bus()
59    physmem = PhysicalMemory(range = AddrRange('128MB'))
60    c1 = Connector(side_a=Parent.physmem, side_b=Parent.magicbus)
61    tsunami = BaseTsunami()
62    c2 = Connector(side_a=Parent.tsunami.cchip, side_a_name='pio', side_b=Parent.magicbus)
63    c3 = Connector(side_a=Parent.tsunami.pchip, side_a_name='pio', side_b=Parent.magicbus)
64    c4 = Connector(side_a=Parent.tsunami.pciconfig, side_a_name='pio', side_b=Parent.magicbus)
65    c5 = Connector(side_a=Parent.tsunami.fake_sm_chip, side_a_name='pio', side_b=Parent.magicbus)
66    c7 = Connector(side_a=Parent.tsunami.fake_uart1, side_a_name='pio', side_b=Parent.magicbus)
67    c8 = Connector(side_a=Parent.tsunami.fake_uart2, side_a_name='pio', side_b=Parent.magicbus)
68    c9 = Connector(side_a=Parent.tsunami.fake_uart3, side_a_name='pio', side_b=Parent.magicbus)
69    c10 = Connector(side_a=Parent.tsunami.fake_uart4, side_a_name='pio', side_b=Parent.magicbus)
70    c12 = Connector(side_a=Parent.tsunami.fake_ppc, side_a_name='pio', side_b=Parent.magicbus)
71    c14 = Connector(side_a=Parent.tsunami.fake_OROM, side_a_name='pio', side_b=Parent.magicbus)
72    c16 = Connector(side_a=Parent.tsunami.fake_pnp_addr, side_a_name='pio', side_b=Parent.magicbus)
73    c17 = Connector(side_a=Parent.tsunami.fake_pnp_write, side_a_name='pio', side_b=Parent.magicbus)
74    c18 = Connector(side_a=Parent.tsunami.fake_pnp_read0, side_a_name='pio', side_b=Parent.magicbus)
75    c19 = Connector(side_a=Parent.tsunami.fake_pnp_read1, side_a_name='pio', side_b=Parent.magicbus)
76    c20 = Connector(side_a=Parent.tsunami.fake_pnp_read2, side_a_name='pio', side_b=Parent.magicbus)
77    c21 = Connector(side_a=Parent.tsunami.fake_pnp_read3, side_a_name='pio', side_b=Parent.magicbus)
78    c22 = Connector(side_a=Parent.tsunami.fake_pnp_read4, side_a_name='pio', side_b=Parent.magicbus)
79    c23 = Connector(side_a=Parent.tsunami.fake_pnp_read5, side_a_name='pio', side_b=Parent.magicbus)
80    c24 = Connector(side_a=Parent.tsunami.fake_pnp_read6, side_a_name='pio', side_b=Parent.magicbus)
81    c25 = Connector(side_a=Parent.tsunami.fake_pnp_read7, side_a_name='pio', side_b=Parent.magicbus)
82    c27 = Connector(side_a=Parent.tsunami.fake_ata0, side_a_name='pio', side_b=Parent.magicbus)
83    c28 = Connector(side_a=Parent.tsunami.fake_ata1, side_a_name='pio', side_b=Parent.magicbus)
84    c30 = Connector(side_a=Parent.tsunami.fb, side_a_name='pio', side_b=Parent.magicbus)
85    c31 = Connector(side_a=Parent.tsunami.io, side_a_name='pio', side_b=Parent.magicbus)
86    c32 = Connector(side_a=Parent.tsunami.uart, side_a_name='pio', side_b=Parent.magicbus)
87    c33 = Connector(side_a=Parent.tsunami.console, side_a_name='pio', side_b=Parent.magicbus)
88    raw_image = RawDiskImage(image_file=disk('linux.img'),
89                             read_only=True)
90    simple_disk = SimpleDisk(disk=Parent.raw_image)
91    intrctrl = IntrControl()
92    cpu = SimpleCPU(mem=Parent.magicbus)
93    sim_console = SimConsole(listener=ConsoleListener(port=3456))
94    kernel = binary('vmlinux')
95    pal = binary('ts_osfpal')
96    console = binary('console')
97    boot_osflags = 'root=/dev/hda1 console=ttyS0'
98    readfile = os.path.join(test_base, 'halt.sh')
99
100
101BaseCPU.itb = AlphaITB()
102BaseCPU.dtb = AlphaDTB()
103BaseCPU.system = Parent.any
104
105class TsunamiRoot(Root):
106    pass
107
108
109root = TsunamiRoot(clock = '2GHz', system = LinuxAlphaSystem())
110