Changeset 424 for soft/giet_vm/giet_python
- Timestamp:
- Oct 3, 2014, 5:25:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_python/mapping.py
r423 r424 1233 1233 ################################################################################ 1234 1234 def linux_dts( self ): # compute string for linux.dts file generation 1235 # used for linux configuration 1235 # used for linux configuration 1236 1236 # header 1237 1237 s = '/dts-v1/;\n' … … 1248 1248 s += ' linux,stdout-path = &tty;\n' 1249 1249 s += ' bootargs = "console=tty0 console=ttyVTTY0 earlyprintk";\n' 1250 s += ' };\n\n' 1250 s += ' };\n\n' 1251 1251 1252 1252 # cpus (for each cluster) … … 1271 1271 1272 1272 # devices (ram or peripheral) are grouped per cluster 1273 # the "compatible" attribute links a peripheral device 1273 # the "compatible" attribute links a peripheral device 1274 1274 # to one or several drivers identified by ("major","minor") 1275 1275 … … 1289 1289 size = pseg.size 1290 1290 1291 s += ' ram @%d_%d: ram@%d_%d {\n' % (x,y,x,y)1291 s += ' ram_%d_%d: ram@0x%x {\n' % (x, y, pseg.base) 1292 1292 s += ' device_type = "memory";\n' 1293 1293 s += ' reg = <0x%x 0x%x 0x%x>;\n' % (msb, lsb, size) … … 1301 1301 1302 1302 # search XCU (can be replicated) 1303 if ( (periph.ptype == 'XCU') ): 1303 if ( (periph.ptype == 'XCU') ): 1304 1304 found_xcu = True 1305 1305 xcu = periph 1306 irq_ctrl_name = 'xcu @%d_%d' % (x,y)1307 1308 s += ' %s: %s {\n' % (irq_ctrl_name, irq_ctrl_name)1306 irq_ctrl_name = 'xcu_%d_%d' % (x, y) 1307 1308 s += ' %s: xcu@0x%x {\n' % (irq_ctrl_name, periph.pseg.base) 1309 1309 s += ' compatible = "soclib,vci_xicu","soclib,vci_xicu_timer";\n' 1310 1310 s += ' interrupt-controller;\n' 1311 1311 s += ' #interrupt-cells = <1>;\n' 1312 1312 s += ' clocks = <&freq>;\n' # the XCU component contains a timer 1313 s += ' reg = <0x%x 0x%x 0x%x>;\n' % (msb, lsb, size) 1313 s += ' reg = <0x%x 0x%x 0x%x>;\n' % (msb, lsb, size) 1314 1314 s += ' };\n\n' 1315 1315 1316 1316 # search PIC (non replicated) 1317 if ( periph.ptype == 'PIC' ): 1317 if ( periph.ptype == 'PIC' ): 1318 1318 found_pic = True 1319 1319 pic = periph 1320 1320 irq_ctrl_name = 'pic' 1321 1321 1322 s += ' %s: %s {\n' % (irq_ctrl_name, irq_ctrl_name)1322 s += ' %s: pic@0x%x {\n' % (irq_ctrl_name, periph.pseg.base) 1323 1323 s += ' compatible = "soclib,vci_iopic";\n' 1324 1324 s += ' interrupt-controller;\n' … … 1328 1328 1329 1329 # search ICU (non supported by Linux) 1330 if ( periph.ptype == 'ICU' ): 1330 if ( periph.ptype == 'ICU' ): 1331 1331 print '[genmap warning] in linux_dts() : ICU peripheral not supported by LINUX' 1332 1332 … … 1334 1334 if ( (found_xcu == False) and (found_pic == False) and (len(cluster.periphs) > 0) ): 1335 1335 print '[genmap error] in linux_dts() : No XCU/PIC in cluster(%d,%d)' % (x,y) 1336 sys.exit(1) 1336 sys.exit(1) 1337 1337 1338 1338 if ( found_pic == True ): irq_ctrl = pic 1339 1339 else: irq_ctrl = xcu 1340 1340 1341 1341 # scan all periphs to find TTY and IOC in current cluster 1342 1342 for periph in cluster.periphs: … … 1346 1346 1347 1347 # search TTY (non replicated) 1348 if ( periph.ptype == 'TTY' ): 1348 if ( periph.ptype == 'TTY' ): 1349 1349 1350 1350 # get HWI index to XCU or PIC (only TTY channel 0 is used by Linux) … … 1359 1359 s += ' compatible = "soclib,vci_multi_tty";\n' 1360 1360 s += ' interrupt-parent = <&%s>;\n' % (irq_ctrl_name) 1361 s += ' interrupt = <%d>;\n' % hwi_id1361 s += ' interrupts = <%d>;\n' % hwi_id 1362 1362 s += ' reg = <0x%x 0x%x 0x%x>;\n' % (msb, lsb, size) 1363 1363 s += ' };\n\n' 1364 1364 1365 1365 # search IOC (non replicated) 1366 elif ( periph.ptype == 'IOC' ): 1366 elif ( periph.ptype == 'IOC' ): 1367 1367 1368 1368 if ( periph.subtype == 'BDV' ): … … 1379 1379 s += ' compatible = "soclib,vci_blockdevice";\n' 1380 1380 s += ' interrupt-parent = <&%s>;\n' % (irq_ctrl_name) 1381 s += ' interrupt = <%d>;\n' % hwi_id1381 s += ' interrupts = <%d>;\n' % hwi_id 1382 1382 s += ' reg = <0x%x 0x%x 0x%x>;\n' % (msb, lsb, size) 1383 1383 s += ' };\n\n' … … 1394 1394 1395 1395 # other peripherals 1396 else: 1396 else: 1397 1397 type = periph.ptype 1398 1398 print '[genmap warning] in linux_dts() : %s peripheral not supported by LINUX' % (type) 1399 1400 # clocks 1399 1400 # clocks 1401 1401 s += ' /*** clocks ***/\n\n' 1402 1402 s += ' clocks {\n' 1403 s += ' freq @50MHZ: freq@50MHZ {\n'1403 s += ' freq: freq@50MHZ {\n' 1404 1404 s += ' #clock-cells = <0>;\n' 1405 1405 s += ' compatible = "fixed-clock";\n' … … 1409 1409 s += ' cpuclk {\n' 1410 1410 s += ' compatible = "soclib,mips32_clksrc";\n' 1411 s += ' clocks = <&freq @50MHZ>;\n'1411 s += ' clocks = <&freq>;\n' 1412 1412 s += ' };\n' 1413 1413 s += '};\n'
Note: See TracChangeset
for help on using the changeset viewer.