Index: /trunk/softs/tsar_boot/README.txt
===================================================================
--- /trunk/softs/tsar_boot/README.txt	(revision 301)
+++ /trunk/softs/tsar_boot/README.txt	(revision 302)
@@ -4,5 +4,5 @@
 ===============================================================================
 src/        Source files
-			The entry point of this boot loader is the file reset.S
+            The entry point of this boot loader is the file reset.S
 
 include/    Header files
@@ -13,21 +13,23 @@
       --->  defs_platform.h:
 
-			 This file is mandatory. This file defines the
+             This file is mandatory. This file defines the
              NB_PROCS per cluster, the NB_CLUSTERS and the base address of
              the TTY, IOC and XICU devices.
+             It also defines the IRQ_PER_PROC constant. This constant is used
+             to know how many XICU irq outputs are connected to each processor.
 
       --->  platform_soclib.dts:
 
-			 Device tree file. It is mandatory if compiling
-			 for a SOCLIB platform. If the application to execute does not use
-			 a device tree file, create an empty one.
+             Device tree file. It is mandatory if compiling
+             for a SOCLIB platform. If the application to execute does not use
+             a device tree file, create an empty one.
 
       --->  platform_fpga.dts:
-			 Device tree file. It is mandatory if compiling
-			 for a FPGA platform. If the application to execute does not use
-			 a device tree file, create an empty one.
+             Device tree file. It is mandatory if compiling
+             for a FPGA platform. If the application to execute does not use
+             a device tree file, create an empty one.
 
       --->  ldscript:
-			 LD script defining the segments of this boot loader.
+             LD script defining the segments of this boot loader.
              We define two segments:
                 seg_stack_base: Base address of the stack used by processor 0
Index: /trunk/softs/tsar_boot/conf/platform_fpga_de2-115/defs_platform.h
===================================================================
--- /trunk/softs/tsar_boot/conf/platform_fpga_de2-115/defs_platform.h	(revision 301)
+++ /trunk/softs/tsar_boot/conf/platform_fpga_de2-115/defs_platform.h	(revision 302)
@@ -1,7 +1,9 @@
-#define NB_PROCS	4
-#define NB_CLUSTERS	1
+#define NB_PROCS     4
+#define NB_CLUSTERS  1
 
-#define IOC_BASE	0xFB000000
-#define VCIBD_BASE	0xFB000000
-#define TTY_BASE	0xFC000000
-#define ICU_BASE	0xFD000000
+#define IRQ_PER_PROC 1
+
+#define IOC_BASE     0xFB000000
+#define VCIBD_BASE   0xFB000000
+#define TTY_BASE     0xFC000000
+#define ICU_BASE     0xFD000000
Index: /trunk/softs/tsar_boot/src/boot_ioc.c
===================================================================
--- /trunk/softs/tsar_boot/src/boot_ioc.c	(revision 301)
+++ /trunk/softs/tsar_boot/src/boot_ioc.c	(revision 302)
@@ -3,7 +3,4 @@
 
 #ifndef SOCLIB_IOC
-static struct sdcard_dev  _sdcard_device;
-static struct spi_dev   * _spi_device   = ( struct spi_dev * )IOC_BASE;
-#endif
 
 #ifndef SYSCLK_FREQ
@@ -11,4 +8,9 @@
 #define SYSCLK_FREQ 50000000U
 #endif
+
+static struct sdcard_dev  _sdcard_device;
+static struct spi_dev   * _spi_device   = ( struct spi_dev * )IOC_BASE;
+#endif
+
 
 int boot_ioc_init()
Index: /trunk/softs/tsar_boot/src/reset.S
===================================================================
--- /trunk/softs/tsar_boot/src/reset.S	(revision 301)
+++ /trunk/softs/tsar_boot/src/reset.S	(revision 302)
@@ -99,10 +99,17 @@
      * Compute the output index for the Write Triggered Interruption mask. 
      * Each processor enable the WTI for its irq output 
-     */
-     
-    sll     t4,     t1,     2       /* t4 <= OUT_INDEX = local_id * 4  */
-    li      t5,     (0xC << 7)      /* t5 <= FUNC      = XICU_MSK_HWI  */
-    or      t4,     t4,     t5      /* t4 <= FUNC | INDEX | 00         */
-    or      t5,     t3,     t4      /* t5 <= &XICU[MSK_WTI][OUT_INDEX] */
+     * Each processor may have IRQ_PER_PROC private irq outputs from
+     * the XICU
+     */
+
+    move    t4,     t1              /* t4 <= local_id                   */
+    li      t5,     IRQ_PER_PROC    /* t5 <= IRQ_PER_PROC               */
+    multu   t4,     t5              
+    mflo    t6                      /* t6 <= IRQ_PER_PROC * local_id    */
+    sll     t4,     t6,     2       /* t4 <= OUT_INDEX = t6 * 4         */
+
+    li      t5,     (0xC << 7)      /* t5 <= FUNC      = XICU_MSK_HWI   */
+    or      t4,     t4,     t5      /* t4 <= FUNC | INDEX | 00          */
+    or      t5,     t3,     t4      /* t5 <= &XICU[MSK_WTI][OUT_INDEX]  */
     
     /* Compute and set WTI mask */
@@ -142,7 +149,7 @@
 
     /**
-     * Jump to the boot elf loader routing routine 
+     * Jump to the boot elf loader routine 
      * Passing as argument the block number in which it must be
-     * the boot loader elf file
+     * the executable elf file to load
      */
 
@@ -209,2 +216,6 @@
 
     .set reorder
+
+/*
+ * vim: tabstop=4 : shiftwidth=4 : expandtab
+ */
