Index: trunk/platforms/tsar_generic_leti/arch.py
===================================================================
--- trunk/platforms/tsar_generic_leti/arch.py	(revision 975)
+++ trunk/platforms/tsar_generic_leti/arch.py	(revision 1029)
@@ -61,5 +61,6 @@
           nb_ttys   = 1,
           fbf_width = 128,
-          ioc_type  = 'HBA' ):
+          ioc_type  = 'HBA',
+          mwr_type  = 'CPY'):
 
     ### define architecture constants
@@ -67,6 +68,6 @@
     nb_nics         = 1
     nb_cmas         = 2
-    x_io            = x_size - 1  # LETI constraint
-    y_io            = y_size - 1  # LETI constraint
+    x_io            = 0
+    y_io            = 0
     x_width         = 4
     y_width         = 4
@@ -146,6 +147,6 @@
 
     ### define ramdisk vseg / must be identity mapping in cluster[0][0]
-    ### occupies 15 BPP after the boot  
-    ramdisk_vbase        = 0x00200000
+    ### occupies 16 BPP after the boot  
+    ramdisk_vbase        = 0x02000000
     ramdisk_size         = 0x02000000      # 32 Mbytes
 
@@ -157,5 +158,5 @@
     kernel_code_size     = 0x00100000      # 1 Mbytes per cluster
 
-    kernel_init_vbase    = 0x80100000
+    kernel_init_vbase    = 0x88000000
     kernel_init_size     = 0x00100000      # 1 Mbytes per cluster
 
@@ -217,11 +218,18 @@
                                          arg0 = 16, arg1 = 16, arg2 = 16 )
 
-                mapping.addIrq( xcu, index = 8, src = mmc, isrtype = 'ISR_MMC' )
+                mapping.addIrq( xcu, index = 8 , src = mmc, isrtype = 'ISR_MMC' )
+
+                if ( x==0 ) and ( y==0 ):
+                    tty = mapping.addPeriph( 'TTY', base = tty_base + offset, size = tty_size, 
+                                             ptype = 'TTY', channels = nb_ttys )
+
+                    mapping.addIrq( xcu, index = 10, src = tty,
+                                    isrtype = 'ISR_TTY_RX', channel = 0 )
 
                 for p in xrange ( nb_procs ):
                     mapping.addProc( x, y, p )
 
-            ###  external peripherals in cluster_io 
-            if ( (x==x_io) and (y==y_io) ):
+            ###  peripherals in external cluster_io 
+            if ( x_io!=0 ) and ( y_io!=0 ) and ( x==( x_size-1 ) ) and ( y==( y_size-1 ) ) :
 
                 if ( ioc_type != 'RDK' ):
@@ -261,9 +269,9 @@
                                 isrtype = 'ISR_CMA', channel = 3 )
 
-                if   ( ioc_type == 'BDV' ): isr_type = 'ISR_BDV'
-                elif ( ioc_type == 'HBA' ): isr_type = 'ISR_HBA'
-                elif ( ioc_type == 'SDC' ): isr_type = 'ISR_SDC'
-
                 if ( ioc_type != 'RDK' ):
+                    if   ( ioc_type == 'BDV' ): isr_type = 'ISR_BDV'
+                    elif ( ioc_type == 'HBA' ): isr_type = 'ISR_HBA'
+                    elif ( ioc_type == 'SDC' ): isr_type = 'ISR_SDC'
+
                     mapping.addIrq( pic, index = 8, src = ioc,
                                     isrtype = isr_type, channel = 0 )
@@ -316,26 +324,7 @@
     ### identity mapping / non local / big pages
     if (ioc_type == 'RDK'):
-
         mapping.addGlobal( 'seg_ramdisk', ramdisk_vbase, ramdisk_size,
                            'C_W_', vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
                            identity = True, local = True, big = True )
-
-    ### global vsegs kernel_code, kernel_init : local / big page
-    ### replicated in all clusters containing processors
-    ### same content => same name / same vbase
-    for x in xrange( x_size ):
-        for y in xrange( y_size - 1 ):
-
-            mapping.addGlobal( 'seg_kernel_code', 
-                               kernel_code_vbase, kernel_code_size,
-                               'CXW_', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
-                               binpath = 'build/kernel/kernel.elf',
-                               local = True, big = True )
-
-            mapping.addGlobal( 'seg_kernel_init', 
-                               kernel_init_vbase, kernel_init_size,
-                               'CXW_', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
-                               binpath = 'build/kernel/kernel.elf',
-                               local = True, big = True )
 
     ### global vseg kernel_data: non local / big page
@@ -344,6 +333,23 @@
                        kernel_data_vbase, kernel_data_size,
                        'C_W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM',
-                       binpath = 'build/kernel/kernel.elf', 
+                       binpath = 'bin/kernel/kernel.elf', 
                        local = False, big = True )
+
+    ### global vsegs kernel_code, kernel_init : local / big page
+    ### replicated in all clusters containing processors
+    ### same content => same name / same vbase
+    for x in xrange( x_size ):
+        for y in xrange( y_size - 1 ):
+            mapping.addGlobal( 'seg_kernel_code', 
+                               kernel_code_vbase, kernel_code_size,
+                               'CXW_', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
+                               binpath = 'bin/kernel/kernel.elf',
+                               local = True, big = True )
+
+            mapping.addGlobal( 'seg_kernel_init', 
+                               kernel_init_vbase, kernel_init_size,
+                               'CXW_', vtype = 'ELF', x = x, y = y, pseg = 'RAM',
+                               binpath = 'bin/kernel/kernel.elf',
+                               local = True, big = True )
 
     ### Global vsegs kernel_ptab_x_y: non local / big page
@@ -353,5 +359,4 @@
         for y in xrange( y_size - 1 ):
             offset = ((x << y_width) + y) * kernel_ptab_size
-
             mapping.addGlobal( 'seg_kernel_ptab_%d_%d' %(x,y), 
                                kernel_ptab_vbase + offset, kernel_ptab_size,
@@ -359,4 +364,15 @@
                                local = False, big = True )
 
+    ### global vsegs kernel_sched : non local / small pages
+    ### allocated in all clusters containing processors
+    ### different content => name & vbase indexed by (x,y)
+    for x in xrange( x_size ):
+        for y in xrange( y_size - 1 ):
+            offset = ((x << y_width) + y) * kernel_ptab_size
+            mapping.addGlobal( 'seg_kernel_sched_%d_%d' %(x,y), 
+                               kernel_sched_vbase + offset , kernel_sched_size,
+                               'C_W_', vtype = 'SCHED', x = x, y = y, pseg = 'RAM',
+                               local = False, big = False )
+
     ### global vsegs kernel_heap_x_y : non local / big pages
     ### distributed in all clusters containing processors
@@ -365,5 +381,4 @@
         for y in xrange( y_size - 1 ):
             offset = ((x << y_width) + y) * kernel_heap_size
-
             mapping.addGlobal( 'seg_kernel_heap_%d_%d' %(x,y), 
                                kernel_heap_vbase + offset , kernel_heap_size,
@@ -373,27 +388,29 @@
     ### global vsegs for external peripherals: non local / big page
     ### only mapped in cluster_io
-    mapping.addGlobal( 'seg_ioc', ioc_base, ioc_size,
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'IOC',
-                       local = False, big = True )
+    if ioc_type != 'RDK':
+        mapping.addGlobal( 'seg_ioc', ioc_base, ioc_size,
+                           '__W_', vtype = 'PERI', x = x_io, y = y_io,
+                           pseg = 'IOC', local = False, big = True )
 
     mapping.addGlobal( 'seg_tty', tty_base, tty_size, 
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'TTY',
-                       local = False, big = True )
-
-    mapping.addGlobal( 'seg_nic', nic_base, nic_size,
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'NIC',
-                       local = False, big = True )
-
-    mapping.addGlobal( 'seg_cma', cma_base, cma_size,
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'CMA',
-                       local = False, big = True )
-
-    mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size,
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'FBF',
-                       local = False, big = True )
-
-    mapping.addGlobal( 'seg_pic', pic_base, pic_size,
-                       '__W_', vtype = 'PERI', x = x_io, y = y_io, pseg = 'PIC',
-                       local = False, big = True )
+                       '__W_', vtype = 'PERI', x = x_io, y = y_io,
+                       pseg = 'TTY', local = False, big = True )
+
+    if ( x_io!=0 ) and ( y_io!=0 ) :
+        mapping.addGlobal( 'seg_nic', nic_base, nic_size,
+                           '__W_', vtype = 'PERI', x = x_size-1, y = y_size-1,
+                           pseg = 'NIC', local = False, big = True )
+
+        mapping.addGlobal( 'seg_cma', cma_base, cma_size,
+                           '__W_', vtype = 'PERI', x = x_size-1, y = y_size-1,
+                           pseg = 'CMA', local = False, big = True )
+
+        mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size,
+                           '__W_', vtype = 'PERI', x = x_size-1, y = y_size-1,
+                           pseg = 'FBF', local = False, big = True )
+
+        mapping.addGlobal( 'seg_pic', pic_base, pic_size,
+                           '__W_', vtype = 'PERI', x = x_size-1, y = y_size-1,
+                           pseg = 'PIC', local = False, big = True )
 
     ### global vsegs for internal peripherals : non local / small pages
@@ -412,16 +429,4 @@
                                mmc_base + offset, mmc_size,
                                '__W_', vtype = 'PERI' , x = x , y = y , pseg = 'MMC',
-                               local = False, big = False )
-
-    ### global vsegs kernel_sched : non local / small pages
-    ### allocated in all clusters containing processors
-    ### different content => name & vbase indexed by (x,y)
-    for x in xrange( x_size ):
-        for y in xrange( y_size - 1 ):
-            offset = ((x << y_width) + y) * kernel_ptab_size
-
-            mapping.addGlobal( 'seg_kernel_sched_%d_%d' %(x,y), 
-                               kernel_sched_vbase + offset , kernel_sched_size,
-                               'C_W_', vtype = 'SCHED', x = x, y = y, pseg = 'RAM',
                                local = False, big = False )
 
