Finished tree allocator functions. Writing Linux DTB parsing routins
authorJustin Sobota <jsobota@ti.com>
Thu, 13 Dec 2012 00:47:43 +0000 (19:47 -0500)
committerJustin Sobota <jsobota@ti.com>
Thu, 13 Dec 2012 00:47:43 +0000 (19:47 -0500)
14 files changed:
device/resources.dtb [deleted file]
device/resources2.dtb [deleted file]
device/tci6614-global-policy.dts.old [moved from device/tci6614-global-policy.dts with 100% similarity]
device/tci6614-global-resources.dtb [new file with mode: 0644]
device/tci6614-global-resources.dts [new file with mode: 0644]
device/tci6614-linux-evm.dtb [new file with mode: 0644]
device/tci6614-linux-evm.dts [new file with mode: 0644]
device/tci6614-resources.dts [deleted file]
device/test_tree1.dtb [deleted file]
include/rm_dtb_utilloc.h
include/rm_loc.h
src/rm.c
src/rm_dtb_util.c
test/rm_test.c

diff --git a/device/resources.dtb b/device/resources.dtb
deleted file mode 100644 (file)
index 8b59a9d..0000000
Binary files a/device/resources.dtb and /dev/null differ
diff --git a/device/resources2.dtb b/device/resources2.dtb
deleted file mode 100644 (file)
index 3080147..0000000
Binary files a/device/resources2.dtb and /dev/null differ
diff --git a/device/tci6614-global-resources.dtb b/device/tci6614-global-resources.dtb
new file mode 100644 (file)
index 0000000..c205bd2
Binary files /dev/null and b/device/tci6614-global-resources.dtb differ
diff --git a/device/tci6614-global-resources.dts b/device/tci6614-global-resources.dts
new file mode 100644 (file)
index 0000000..ce56b32
--- /dev/null
@@ -0,0 +1,210 @@
+/dts-v1/;
+
+/ {
+    device-name = "TCI6614";
+    
+    /* Device Resource Definitions */
+
+       /* TODO: where do following get defined in the linux DTB
+                        #define ARM_LINUX_CPPI_QMSS_TX_CH_NUM           12
+                        #define ARM_LINUX_CPPI_QMSS_RX_CH_NUM           12
+                        #define ARM_LINUX_CPPI_QMSS_FLOW                12
+       */
+       
+    qmss {
+        pdsps {
+               allocator = "integer";
+               resource-range = <0 2>;
+        };
+        memory-regions {
+                       allocator = "integer";
+                       resource-range = <0 20>;
+                       linux-dtb-alias = "hwqueue0", "regions", "region-12", "id", "end", <0>, "end";
+        };
+        link-ram {
+            allocator = "tree";
+            resource-range = <0x00000000 0xFFFFFFFF>;
+        };
+        accumulator-ch {
+            allocator = "integer";
+            resource-range = <0 48>;
+               /* Each new line specifies a different path.  The last string in the line
+                * must result in a property tied to a value */
+               linux-dtb-alias = "hwqueue0", "queues", "accumulator-low-0", "accumulator", "end", <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-1", "accumulator", "end", <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-2", "accumulator", "end", <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-3", "accumulator", "end", <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-high", "accumulator", "end", <1>, "end";            
+        };
+        qos-cluster {
+                       allocator = "integer";
+                       resource-range = <0 8>;
+        };
+        qos-queue {
+                       allocator = "integer";
+                       resource-range = <0 64>;
+        };        
+
+        /* Queue definitions based on csl_qm_queue.h */
+        low-prio-queue {
+               allocator = "tree";
+               resource-range = <0 512>;
+               /* Each new line specifies a different path. */
+               linux-dtb-alias = "hwqueue0", "queues", "accumulator-low-0", "values", "end", <0>, <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-1", "values", "end", <0>, <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-2", "values", "end", <0>, <1>, "end",
+                                                 "hwqueue0", "queues", "accumulator-low-3", "values", "end", <0>, <1>, "end";
+        };
+        aif-queue {
+               allocator = "tree";
+               resource-range = <512 128>;
+        };
+        pass-queue {
+               allocator = "integer";
+               resource-range = <640 9>;
+        };     
+        intc-queue {
+               allocator = "integer";
+               resource-range = <662 10>;
+        };
+        srio-queue {
+               allocator = "integer";
+               resource-range = <672 16>;
+               linux-dtb-alias = "hwqueue0", "queues", "riotx", "values", "end", <0>, <1>, "end";
+        }; 
+        fftc-a-queue {
+               allocator = "integer";
+               resource-range = <688 4>;
+        };
+        fftc-b-queue {
+               allocator = "integer";
+               resource-range = <692 4>;
+        };
+        bcp-queue {
+               allocator = "integer";
+               resource-range = <864 8>;
+        };
+        high-prio-queue {
+               allocator = "integer";
+               resource-range = <704 32>;
+               linux-dtb-alias = "hwqueue0", "queues", "accumulator-high", "values", "end", <0>, <1>, "end";
+        };
+        starvation-queue {
+               allocator = "tree";
+               resource-range = <736 64>;
+        };
+        infra-queue {
+               allocator = "integer";
+               resource-range = <800 32>;
+               linux-dtb-alias = "hwqueue0", "queues", "infradma", "values", "end", <0>, <1>, "end";
+        };
+        traffic-shaping-queue {
+               allocator = "integer";
+               resource-range = <832 32>;
+        };
+        gp-queue {
+               allocator = "tree";
+               resource-range = <896 7296>;
+               linux-dtb-alias = "hwqueue0", "queues", "general", "values", "end", <0>, <1>, "end";
+        };          
+    }; /* qmss */
+
+    /* CPPI channel and flow ID ranges based on tci6614 cppi_device.c */
+    cppi {
+        srio-rx-ch {
+               allocator = "integer";
+               resource-range = <0 16>;
+        };
+        srio-tx-ch {
+               allocator = "integer";
+               resource-range = <0 16>;
+        };
+        srio-rx-flow-id {
+               allocator = "integer";
+               resource-range = <0 20>;
+        };   
+
+        aif-rx-ch {
+               allocator = "tree";
+               resource-range = <0 129>;
+        };
+        aif-tx-ch {
+               allocator = "tree";
+               resource-range = <0 129>;
+        };
+        aif-rx-flow-id {
+               allocator = "tree";
+               resource-range = <0 129>;
+        };      
+
+        fftc-a-rx-ch {
+               allocator = "integer";
+               resource-range = <0 4>;
+        };
+        fftc-a-tx-ch {
+               allocator = "integer";
+               resource-range = <0 4>;
+        };
+        fftc-a-rx-flow-id {
+               allocator = "integer";
+               resource-range = <0 8>;
+        };   
+
+        fftc-b-rx-ch {
+               allocator = "integer";
+               resource-range = <0 4>;
+        };
+        fftc-b-tx-ch {
+               allocator = "integer";
+               resource-range = <0 4>;
+        };
+        fftc-b-rx-flow-id {
+               allocator = "integer";
+               resource-range = <0 8>;
+        };   
+
+        pass-rx-ch {
+               allocator = "integer";
+               resource-range = <0 23>;
+        };
+        pass-tx-ch {
+               allocator = "integer";
+               resource-range = <0 9>;
+        };
+        pass-rx-flow-id {
+               allocator = "integer";
+               resource-range = <0 32>;
+        };   
+
+        qmss-rx-ch {
+               allocator = "integer";
+               resource-range = <0 32>;
+        };
+        qmss-tx-ch {
+               allocator = "integer";
+               resource-range = <0 32>;
+        };
+        qmss-rx-flow-id {
+               allocator = "tree";
+               resource-range = <0 64>;
+        };   
+
+        bcp-rx-ch {
+               allocator = "integer";
+               resource-range = <0 8>;
+        };
+        bcp-tx-ch {
+               allocator = "integer";
+               resource-range = <0 8>;
+        };
+        bcp-rx-flow-id {
+               allocator = "tree";
+               resource-range = <0 64>;
+        };           
+    }; /* cppi */
+
+    pa-lut {
+        allocator = "integer";   
+        resource-range = <0 5>;
+    };    
+};
diff --git a/device/tci6614-linux-evm.dtb b/device/tci6614-linux-evm.dtb
new file mode 100644 (file)
index 0000000..7bd99b8
Binary files /dev/null and b/device/tci6614-linux-evm.dtb differ
diff --git a/device/tci6614-linux-evm.dts b/device/tci6614-linux-evm.dts
new file mode 100644 (file)
index 0000000..125f264
--- /dev/null
@@ -0,0 +1,1024 @@
+/dts-v1/;
+
+
+/ {
+       model = "Texas Instruments TCI6614 EVM";
+       compatible = "ti,tci6614-evm";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8 mem=512M rootwait=1 rw ubi.mtd=2,2048 rootfstype=ubifs root=ubi0:rootfs";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x80000000 0x8000000>;
+       };
+
+       droppolicies: default-drop-policies {
+               no-drop {
+                       default;
+                       packet-units;
+                       limit = <0>;
+               };
+               tail-drop-64pkts {
+                       packet-units;
+                       limit = <64>;
+               };
+               tail-drop-100pkts {
+                       packet-units;
+                       limit = <100>;
+               };
+               tail-drop-32kb {
+                       byte-units;
+                       limit = <32768>;
+               };
+               tail-drop-64kb {
+                       byte-units;
+                       limit = <65536>;
+               };
+               red-32kb-128kb {
+                       byte-units;
+                       limit = <196608>;
+                       random-early-drop = <32768 131072 2 2000>;
+               };
+               red-32kb-64kb {
+                       byte-units;
+                       limit = <131072>;
+                       random-early-drop = <32768 65536 2 2000>;
+               };
+               all-drop {
+                       byte-units;
+                       limit = <0>;
+               };
+       };
+
+       qostree: qos-tree {
+               strict-priority;                /* or weighted-round-robin */
+               byte-units;                     /* packet-units or byte-units */
+               output-rate = <31250000 25000>;
+               overhead-bytes = <24>;          /* valid only if units are bytes */
+               output-queue = <645>;           /* allowed only on root node */
+
+               high-priority {
+                       byte-units;             /* packet-units or byte-units */
+                       priority = <0>;
+                       signaling {
+                               input-queues = <8046 8071>;
+                               stats-class  = "fastpath-hp";
+                               drop-policy = "no-drop";
+                       };
+                       linux-signaling {
+                               input-queues = <8077>;
+                               stats-class  = "linux-hp";
+                               drop-policy = "no-drop";
+                       };
+               };
+
+               wrr-aggregator {
+                       weighted-round-robin;
+                       priority = <1>;
+                       byte-units;                     /* packet-units or byte-units */
+                       overhead-bytes = <24>;          /* valid only if units are bytes */
+                       wrr-cos0 {
+                               weighted-round-robin;           /* or weighted-round-robin */
+                               byte-units;                     /* packet-units or byte-units */
+                               weight = <20>;
+                               overhead-bytes = <24>;          /* valid only if units are bytes */
+                               4g-cos0 {
+                                       drop-policy = "tail-drop-32kb";
+                                       weight = <5>;
+                                       input-queues = <8010 8065>;
+                                       stats-class  = "cos0";
+                               };
+                               3g-cos0 {
+                                       drop-policy = "tail-drop-32kb";
+                                       weight = <5>;
+                                       input-queues = <8012>;
+                                       stats-class  = "cos0";
+                               };
+                               wifi-cos0 {
+                                       drop-policy = "tail-drop-32kb";
+                                       weight = <5>;
+                                       input-queues = <8014>;
+                                       stats-class  = "cos0";
+                               };
+                               linux-cos0 {
+                                       drop-policy = "tail-drop-32kb";
+                                       weight = <5>;
+                                       input-queues = <8073>;
+                                       stats-class  = "linux-cos0";
+                               };
+                       };
+                       wrr-cos1 {
+                               weighted-round-robin;           /* or weighted-round-robin */
+                               byte-units;                     /* packet-units or byte-units */
+                               weight = <40>;
+                               overhead-bytes = <24>;          /* valid only if units are bytes */
+                               4g-cos1 {
+                                       drop-policy = "red-32kb-128kb";
+                                       weight = <10>;
+                                       input-queues = <8018 8066>;
+                                       stats-class  = "cos1";
+                               };
+                               3g-cos1 {
+                                       drop-policy = "red-32kb-128kb";
+                                       weight = <10>;
+                                       input-queues = <8020>;
+                                       stats-class  = "cos1";
+                               };
+                               wifi-cos1 {
+                                       drop-policy = "red-32kb-128kb";
+                                       weight = <10>;
+                                       input-queues = <8022>;
+                                       stats-class  = "cos1";
+                               };
+                               linux-cos1 {
+                                       drop-policy = "red-32kb-128kb";
+                                       weight = <10>;
+                                       input-queues = <8074>;
+                                       stats-class  = "linux-cos1";
+                               };
+                       };
+                       wrr-cos2 {
+                               weighted-round-robin;           /* or weighted-round-robin */
+                               byte-units;                     /* packet-units or byte-units */
+                               weight = <60>;
+                               overhead-bytes = <24>;          /* valid only if units are bytes */
+                               4g-cos2 {
+                                       drop-policy = "red-32kb-64kb";
+                                       weight = <15>;
+                                       input-queues = <8026 8067>;
+                                       stats-class  = "cos2";
+                               };
+                               3g-cos2 {
+                                       drop-policy = "red-32kb-64kb";
+                                       weight = <15>;
+                                       input-queues = <8028>;
+                                       stats-class  = "cos2";
+                               };
+                               wifi-cos2 {
+                                       drop-policy = "red-32kb-64kb";
+                                       weight = <15>;
+                                       input-queues = <8030>;
+                                       stats-class  = "cos2";
+                               };
+                               linux-cos2 {
+                                       drop-policy = "red-32kb-64kb";
+                                       weight = <15>;
+                                       input-queues = <8075>;
+                                       stats-class  = "linux-cos2";
+                               };
+                       };
+                       wrr-cos3 {
+                               weighted-round-robin;           /* or weighted-round-robin */
+                               byte-units;                     /* packet-units or byte-units */
+                               weight = <80>;
+                               overhead-bytes = <24>;          /* valid only if units are bytes */
+                               4g-cos3 {
+                                       drop-policy = "tail-drop-64kb";
+                                       weight = <20>;
+                                       input-queues = <8034 8068>;
+                                       stats-class  = "cos3";
+                               };
+                               3g-cos3 {
+                                       drop-policy = "tail-drop-64kb";
+                                       weight = <20>;
+                                       input-queues = <8036>;
+                                       stats-class  = "cos3";
+                               };
+                               wifi-cos3 {
+                                       drop-policy = "tail-drop-64kb";
+                                       weight = <20>;
+                                       input-queues = <8038>;
+                                       stats-class  = "cos3";
+                               };
+                               linux-cos3 {
+                                       drop-policy = "tail-drop-64kb";
+                                       weight = <20>;
+                                       input-queues = <8076>;
+                                       stats-class  = "linux-cos3";
+                               };
+                       };
+               };
+
+               best-effort {
+                       byte-units;             /* packet-units or byte-units */
+                       priority = <2>;
+                       drop-policy = "tail-drop-64kb";
+                       fastpath-best-effort {
+                               // queues between 8000 to 8063 not assigned
+                               // in the above nodes are assigned below as
+                               // unclassified DSCP values
+                               // queues between 8064 to 8071 not assigned
+                               // in the above nodes are assigned below as
+                               // unclassified VLAN p-bit values
+                               input-queues = <8000 8001 8002 8003 8004 
+                                               8005 8006 8007 8008 8009 8011 
+                                               8013 8015 8016 8017 8019 8021
+                                               8023 8024 8025 8027 8029 8031 
+                                               8032 8033 8035 8037 8039 8040 
+                                               8041 8042 8043 8044 8045 8047 
+                                               8048 8049 8050 8051 8052 8053 
+                                               8054 8055 8056 8057 8058 8059
+                                               8060 8061 8062 8063 
+                                               8064 8069 8070>; 
+                               stats-class  = "fastpath-be";
+                       };
+                       linux-best-effort {
+                               input-queues = <8072>;
+                               stats-class  = "linux-be";
+                       };
+               };
+       };
+       soc6614@2000000 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus", "ti,tci6614-bus";
+               ranges;
+
+               hwqueue0: hwqueue@2a00000 {
+                       compatible = "ti,keystone-hwqueue";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       reg             = <0x2a00000 0xc0000>;
+                       range           = <0 0x2000>;
+                       linkram0        = <0x80000 0x4000>;
+                       linkram1        = <0x0 0x10000>;
+
+                       qmgrs {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               qmgr0 {
+                                       managed-queues = <0 0x2000>;    /* managed queues */
+                                       reg = <0x2a00000 0x20000        /* 0 - peek     */
+                                              0x2a62000 0x6000         /* 1 - status   */
+                                              0x2a68000 0x2000         /* 2 - config   */
+                                              0x2a6a000 0x4000         /* 3 - region   */
+                                              0x2a20000 0x20000        /* 4 - push     */
+                                              0x2a20000 0x20000>;      /* 5 - pop      */
+                               };
+                       };
+
+                       queues {
+                               qpend-arm {
+                                       values = <650 8>;
+                                       irq-base= <41>;
+                                       reserved;
+                               };
+                               general {
+                                       values = <4000 64>;
+                               };
+                               pa {
+                                       values = <640 9>;
+                                       reserved;
+                               };
+                               infradma {
+                                       values = <800 12>;
+                                       reserved;
+                               };
+                               accumulator-low-0 {
+                                       values = <0 32>;
+                                       // pdsp-id, channel, entries, pacing mode, latency
+                                       accumulator = <0 32 8 2 0>;
+                                       irq-base = <363>;
+                                       multi-queue;
+                                       reserved;
+                               };
+                               accumulator-low-1 {
+                                       values = <32 32>;
+                                       // pdsp-id, channel, entries, pacing mode, latency
+                                       accumulator = <0 33 8 2 0>;
+                                       irq-base = <364>;
+                                       multi-queue;
+                               };
+                               accumulator-low-2 {
+                                       values = <64 32>;
+                                       // pdsp-id, channel, entries, pacing mode, latency
+                                       accumulator = <0 34 8 2 0>;
+                                       irq-base = <365>;
+                                       multi-queue;
+                               };
+                               accumulator-low-3 {
+                                       values = <96 32>;
+                                       // pdsp-id, channel, entries, pacing mode, latency
+                                       accumulator = <0 35 8 2 0>;
+                                       irq-base = <366>;
+                                       multi-queue;
+                               };
+                               accumulator-high {
+                                       values = <728 8>;
+                                       // pdsp-id, channel, entries, pacing mode, latency
+                                       accumulator = <0 20 8 2 0>;
+                                       irq-base = <150>;
+                                       reserved;
+                               };
+                               qos-inputs {
+                                       values                  = <8000 192>;
+                                       pdsp-id                 = <1>;
+                                       ticks-per-sec           = <10000>;
+                                       qos-cfg                 = <4 50 1 1 0xf00 0 0>;
+                                       sched-port-configs      = <0 20 0x1c8>;
+                                       drop-out-profiles       = <0 36 0xc>;
+                                       drop-cfg-profiles       = <0 8 0x14>;
+                                       drop-queue-configs      = <0 80 0x4>;
+                                       statistics-profiles     = <0 48>;
+                                       drop-policies           = <&droppolicies>;
+                                       qos-tree                = <&qostree>;
+                                       reserved;
+                               };
+                               riotx {
+                                       values = <672 1>;
+                                       reserved;
+                               };
+                       };
+                       regions {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               region-12 {
+                                       id = <12>;
+                                       values  = <4096 128>;   /* num_desc desc_size */
+                                       link-index = <0x4000>;
+                               };
+                       };
+                       descriptors {
+                               pool-net {
+                                       values = <2048 128>;    /* num_desc desc_size */
+                                       region-id = <12>;
+                               };
+                               pool-udma {
+                                       values = <1152 128>;    /* num_desc desc_size */
+                                       region-id = <12>;
+                               };
+                               pool-rio {
+                                       values = <128 128>;
+                                       region-id = <12>;
+                               };
+                       };
+                       pdsps {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               pdsp0@0x2a60000 {
+                                       firmware = "keystone/qmss_pdsp_acc48_le_1_0_3_12.fw";
+                                       reg = <0x2a60000 0x1000    /*iram */
+                                              0x2a6e000 0x1000    /*reg*/
+                                              0x2aa0000 0x3c8     /*intd */
+                                              0x2ab8000 0x4000>;  /*cmd*/
+                                       id = <0>;
+                               };
+                               pdsp1@0x2a61000 {
+                                       firmware = "keystone/qmss_qos.fw";
+                                       reg = <0x2a61000 0x1000    /*iram */
+                                              0x2a6f000 0x1000    /*reg*/
+                                              0x2aa0000 0x3c8     /*intd */
+                                              0x2abc000 0x4000>;  /*cmd*/
+                                       id = <1>;
+                               };
+                       };
+               };
+
+               infradma: pktdma@2a6c000 {
+                       compatible = "ti,keystone-pktdma";
+                       reg = <0x2a6c000 0x100          /* 0 - global  */
+                              0x2a6c400 0x400          /* 1 - txchan  */
+                              0x2a6c800 0x400          /* 2 - rxchan  */
+                              0x2a6cc00 0x400          /* 3 - txsched */
+                              0x2a6d000 0x400>;        /* 4 - rxflow  */
+                       loop-back;
+                       /* big-endian; */
+                       enable-all;
+                       /* debug; */
+                       /* rx-priority = <0>; */
+                       /* tx-priority = <0>; */
+                       logical-queue-managers  = <2>;
+                       queues-per-queue-manager = <4096>;
+                       qm-base-address = <0x34020000 0x34030000>;
+
+                       channels {
+                               udmatx0 {
+                                       transmit;
+                                       label           = "udmatx0";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <800>;
+                                       complete-queue  = <0>;
+                                       /* debug; */
+                                       channel         = <0>;
+                                       priority        = <1>;
+                                       flowtag         = <0>;
+                               };
+                               udmatx1 {
+                                       transmit;
+                                       label           = "udmatx1";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <801>;
+                                       complete-queue  = <1>;
+                                       /* debug; */
+                                       channel         = <1>;
+                                       priority        = <1>;
+                                       flowtag         = <1>;
+                               };
+                               udmatx2 {
+                                       transmit;
+                                       label           = "udmatx2";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <802>;
+                                       complete-queue  = <2>;
+                                       /* debug; */
+                                       channel         = <2>;
+                                       priority        = <1>;
+                                       flowtag         = <2>;
+                               };
+                               udmatx3 {
+                                       transmit;
+                                       label           = "udmatx3";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <803>;
+                                       complete-queue  = <3>;
+                                       /* debug; */
+                                       channel         = <3>;
+                                       priority        = <1>;
+                                       flowtag         = <3>;
+                               };
+                               udmatx4 {
+                                       transmit;
+                                       label           = "udmatx4";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <804>;
+                                       complete-queue  = <4>;
+                                       /* debug; */
+                                       channel         = <4>;
+                                       priority        = <1>;
+                                       flowtag         = <4>;
+                               };
+                               udmatx5 {
+                                       transmit;
+                                       label           = "udmatx5";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <805>;
+                                       complete-queue  = <5>;
+                                       /* debug; */
+                                       channel         = <5>;
+                                       priority        = <1>;
+                                       flowtag         = <5>;
+                               };
+                               udmatx6 {
+                                       transmit;
+                                       label           = "udmatx6";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <806>;
+                                       complete-queue  = <6>;
+                                       /* debug; */
+                                       channel         = <6>;
+                                       priority        = <1>;
+                                       flowtag         = <6>;
+                               };
+                               udmatx7 {
+                                       transmit;
+                                       label           = "udmatx7";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <807>;
+                                       complete-queue  = <7>;
+                                       /* debug; */
+                                       channel         = <7>;
+                                       priority        = <1>;
+                                       flowtag         = <7>;
+                               };
+                               udmatx8 {
+                                       transmit;
+                                       label           = "udmatx8";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <808>;
+                                       complete-queue  = <8>;
+                                       /* debug; */
+                                       channel         = <8>;
+                                       priority        = <1>;
+                                       flowtag         = <8>;
+                               };
+                               udmatx9 {
+                                       transmit;
+                                       label           = "udmatx9";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <809>;
+                                       complete-queue  = <9>;
+                                       /* debug; */
+                                       channel         = <9>;
+                                       priority        = <1>;
+                                       flowtag         = <9>;
+                               };
+                               udmatx10 {
+                                       transmit;
+                                       label           = "udmatx10";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <810>;
+                                       complete-queue  = <10>;
+                                       /* debug; */
+                                       channel         = <10>;
+                                       priority        = <1>;
+                                       flowtag         = <10>;
+                               };
+                               udmatx11 {
+                                       transmit;
+                                       label           = "udmatx11";
+                                       pool            = "pool-udma";
+                                       submit-queue    = <811>;
+                                       complete-queue  = <11>;
+                                       /* debug; */
+                                       channel         = <11>;
+                                       priority        = <1>;
+                                       flowtag         = <11>;
+                               };
+                               udmarx0 {
+                                       receive;
+                                       label           = "udmarx0";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <16>;
+                                       /* debug; */
+                                       channel         = <0>;
+                                       flow            = <0>;
+                               };
+                               udmarx1 {
+                                       receive;
+                                       label           = "udmarx1";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <17>;
+                                       /* debug; */
+                                       channel         = <1>;
+                                       flow            = <1>;
+                               };
+                               udmarx2 {
+                                       receive;
+                                       label           = "udmarx2";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <18>;
+                                       /* debug; */
+                                       channel         = <2>;
+                                       flow            = <2>;
+                               };
+                               udmarx3 {
+                                       receive;
+                                       label           = "udmarx3";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <19>;
+                                       /* debug; */
+                                       channel         = <3>;
+                                       flow            = <3>;
+                               };
+                               udmarx4 {
+                                       receive;
+                                       label           = "udmarx4";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <20>;
+                                       /* debug; */
+                                       channel         = <4>;
+                                       flow            = <4>;
+                               };
+                               udmarx5 {
+                                       receive;
+                                       label           = "udmarx5";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <21>;
+                                       /* debug; */
+                                       channel         = <5>;
+                                       flow            = <5>;
+                               };
+                               udmarx6 {
+                                       receive;
+                                       label           = "udmarx6";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <22>;
+                                       /* debug; */
+                                       channel         = <6>;
+                                       flow            = <6>;
+                               };
+                               udmarx7 {
+                                       receive;
+                                       label           = "udmarx7";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <23>;
+                                       /* debug; */
+                                       channel         = <7>;
+                                       flow            = <7>;
+                               };
+                               udmarx8 {
+                                       receive;
+                                       label           = "udmarx8";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <24>;
+                                       /* debug; */
+                                       channel         = <8>;
+                                       flow            = <8>;
+                               };
+                               udmarx9 {
+                                       receive;
+                                       label           = "udmarx9";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <25>;
+                                       /* debug; */
+                                       channel         = <9>;
+                                       flow            = <9>;
+                               };
+                               udmarx10 {
+                                       receive;
+                                       label           = "udmarx10";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <26>;
+                                       /* debug; */
+                                       channel         = <10>;
+                                       flow            = <10>;
+                               };
+                               udmarx11 {
+                                       receive;
+                                       label           = "udmarx11";
+                                       pool            = "pool-udma";
+                                       /* submit-queue = <xx>; */
+                                       complete-queue  = <27>;
+                                       /* debug; */
+                                       channel         = <11>;
+                                       flow            = <11>;
+                               };
+                       };
+               };
+
+               padma: pktdma@2004000 {
+                       compatible = "ti,keystone-pktdma";
+                       reg = <0x2004000 0x100          /* 0 - global  */
+                              0x2004400 0x120          /* 1 - txchan  */
+                              0x2004800 0x300          /* 2 - rxchan  */
+                              0x2004c00 0x120          /* 3 - txsched */
+                              0x2005000 0x400>;        /* 4 - rxflow  */
+                       /* loop-back;  */
+                       /* bigendian; */
+                       enable-all;
+                       /* debug; */
+                       /* rx-priority = <0>; */
+                       /* tx-priority = <0>; */
+                       logical-queue-managers  = <2>;
+                       queues-per-queue-manager = <4096>;
+                       qm-base-address = <0x34020000 0x34030000>;
+
+                       channels {
+                               nettx {
+                                       transmit;
+                                       label           = "nettx";
+                                       pool            = "pool-net";
+                                       submit-queue    = <648>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <0>; */
+                                       /* priority = <1>; */
+                               };
+                               netrx {
+                                       receive;
+                                       label           = "netrx";
+                                       pool            = "pool-net";
+                                       /* submit-queue   = <xx>; */
+                                       complete-queue = <650>;
+                                       /* debug; */
+                                       /* channel = <0>; */
+                                       flow            = <23>;
+                               };
+                               satx {
+                                       transmit;
+                                       label           = "satx";
+                                       pool            = "pool-net";
+                                       submit-queue    = <646>;
+                               };
+                               patx-cmd {
+                                       transmit;
+                                       label           = "patx-cmd";
+                                       pool            = "pool-net";
+                                       submit-queue    = <640>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               patx-dat {
+                                       transmit;
+                                       label           = "patx-dat";
+                                       pool            = "pool-net";
+                                       submit-queue    = <645>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               parx {
+                                       receive;
+                                       label           = "parx";
+                                       pool            = "pool-net";
+                                       /* submit-queue   = <xx>; */
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <0>; */
+                                       flow            = <31>;
+                               };
+                               qos0 {
+                                       transmit;
+                                       label           = "qos0";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8072>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               qos1 {
+                                       transmit;
+                                       label           = "qos1";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8073>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               qos2 {
+                                       transmit;
+                                       label           = "qos2";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8074>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               qos3 {
+                                       transmit;
+                                       label           = "qos3";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8075>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               qos4 {
+                                       transmit;
+                                       label           = "qos4";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8076>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                               qos5 {
+                                       transmit;
+                                       label           = "qos5";
+                                       pool            = "pool-net";
+                                       submit-queue    = <8077>;
+                                       /* complete-queue = <xx>; */
+                                       /* debug; */
+                                       /* channel = <xx>; */
+                                       /* priority = <1>; */
+                               };
+                       };
+               };
+
+               riodma: pktdma@2901000 {
+                       compatible = "ti,keystone-pktdma";
+                       reg = <0x2901000 0x100          /* 0 - global  */
+                              0x2901400 0x200          /* 1 - txchan  */
+                              0x2901800 0x200          /* 2 - rxchan  */
+                              0x2901c00 0x200          /* 3 - txsched */
+                              0x2902000 0x300>;        /* 4 - rxflow  */
+                       enable-all;
+
+                       logical-queue-managers  = <2>;
+                       queues-per-queue-manager = <4096>;
+                       qm-base-address = <0x34020000 0x34030000>;
+
+                       channels {
+                               riotx {
+                                       transmit;
+                                       label           = "riotx";
+                                       pool            = "pool-rio";
+                                       submit-queue    = <672>;
+                                       /*complete-queue        = <657>;*/
+                                       /*debug;*/
+                               };
+                               riorx {
+                                       receive;
+                                       label           = "riorx";
+                                       pool            = "pool-rio";
+                                       complete-queue  = <653>;
+                                       flow            = <21>;
+                               };
+                       };
+               };
+
+               mdio: mdio@2090300 {
+                       compatible      = "ti,davinci_mdio";
+                       reg             = <0x2090300 0x100>;
+                       bus-freq        = <50000000>;
+               };
+
+               udma0 {
+                       compatible = "ti,keystone-udma";
+               };
+
+               netcp: netcp@2090000 {
+                       reg = <0x2090000 0xf00
+                               0x2620110 0x8>;
+                       compatible = "ti,keystone-netcp";
+
+                       rx-channel = "netrx";
+                       rx-queue-depth = <128 128 0 0>;
+                       rx-buffer-size = <1500 4096 0 0>;
+
+                       efuse-mac = <1>;
+                       local-mac-address = [00 18 31 7e 3e 6e];
+
+                       cpsw: cpsw@2090000 {
+                               label = "keystone-cpsw";
+
+                               tx-channel = "nettx";
+                               tx_queue_depth = <32>;
+                               intf_tx_queues = <6>;
+
+                               sgmii_module_ofs  = <0x100>;
+                               switch_module_ofs = <0x800>;
+                               host_port_reg_ofs = <0x834>;
+                               slave_reg_ofs     = <0x860>;
+                               sliver_reg_ofs    = <0x900>;
+                               hw_stats_reg_ofs  = <0xb00>;
+                               ale_reg_ofs       = <0xe00>;
+
+                               num_slaves  = <2>;
+                               ale_ageout  = <10>;
+                               ale_entries = <1024>;
+                               ale_ports   = <3>;
+
+                               slaves {
+                                       slave0 {
+                                               label           = "slave0";
+                                               link-interface  = <2>;
+                                       };
+                                       slave1 {
+                                               label           = "slave1";
+                                               link-interface  = <1>;
+                                       };
+                               };
+                       };
+                       pa: pa@2000000 {
+                               label = "keystone-pa";
+                               checksum-offload        = <2>;
+                               txhook-order            = <10>;
+                               txhook-softcsum         = <40>;
+                               rxhook-order            = <10>;
+
+                               tx_cmd_queue_depth      = <32>;
+                               tx_data_queue_depth     = <32>;
+                               rx_pool_depth           = <32>;
+                               rx_buffer_size          = <128>;
+                       };
+                       qos: qos@0 {
+                               label = "keystone-qos";
+                               input-channels {
+                                       chan-0 {
+                                               tx-channel = "qos0";
+                                               tx_queue_depth = <128>;
+                                       };
+                                       chan-1 {
+                                               tx-channel = "qos1";
+                                               tx_queue_depth = <128>;
+                                       };
+                                       chan-2 {
+                                               tx-channel = "qos2";
+                                               tx_queue_depth = <128>;
+                                       };
+                                       chan-3 {
+                                               tx-channel = "qos3";
+                                               tx_queue_depth = <128>;
+                                       };
+                                       chan-4 {
+                                               tx-channel = "qos4";
+                                               tx_queue_depth = <128>;
+                                       };
+                                       chan-5 {
+                                               tx-channel = "qos5";
+                                               tx_queue_depth = <128>;
+                                       };
+                               };
+                       };
+                       sa: pa@20c0000 {
+                               label = "keystone-sa";
+
+                               tx_queue_depth = <32>;
+                       };
+               };
+
+               crypto: crypto@20c0000 {
+                       compatible = "ti,keystone-crypto";
+                       reg = <0x20c0000 0x40000>;
+               };
+
+               ipcirq: ipcirq@26202bc {        /* ipc irq chip */
+                       compatible = "ti,keystone-ipc-irq";
+                       reg  = <0x026202bc 4    /* host ack register */
+                               0x0262027c 4>;  /* ipc host interrupt generation register */
+                       irq  = <129>;           /* it should match the value in irqs.h */
+                       base = <512>;           /* base irq number
+                                                  following is the source id to irq mapping
+                                                  SRCS0 <-> base ... SRCS27 <-> (base + 27)
+                                                  note that SRCS0 is bit 4 in ipc register */
+               };
+
+               rproc0: rproc@2620040 {
+                       compatible = "ti,keystone-rproc";
+                       reg = <0x02620040 4                             /* boot address register */
+                              0x02350a5c 4                             /* module control register */
+                              0x02350120 4                             /* power domain transition command register */
+                              0x02620240 4>;                           /* ipc interrupt generation register */
+                       addr-map = <0x10800000 0x00800000 0x100000      /* l2-ram  global, local, size */
+                                   0x10800000 0x10800000 0x100000      /* l2-ram  global, global, size */
+                                   0x0c000000 0x0c000000 0x200000      /* msmc-sram  global, local, size */
+                                   0xa0000000 0xa0000000 0x20000000>;  /* ddr3-sram  global, local, size */
+                       exception-irq   = <512>;                        /* ipc irq for DSP exception */
+                       firmware        = "dsp-core0.out";
+                       core            = "dsp-core0";
+               };
+
+               rproc1: rproc@2620044 {
+                       compatible = "ti,keystone-rproc";
+                       reg = <0x02620044 4
+                              0x02350a60 4
+                              0x02350120 4
+                              0x02620244 4>;
+                       addr-map = <0x11800000 0x00800000 0x100000
+                                   0x11800000 0x11800000 0x100000
+                                   0x0c000000 0x0c000000 0x200000
+                                   0xa0000000 0xa0000000 0x20000000>;
+                       exception-irq   = <513>;
+                       firmware        = "dsp-core1.out";
+                       core            = "dsp-core1";
+               };
+
+               rproc2: rproc@2620048 {
+                       compatible = "ti,keystone-rproc";
+                       reg = <0x02620048 4
+                              0x02350a68 4
+                              0x02350120 4
+                              0x02620248 4>;
+                       addr-map = <0x12800000 0x00800000 0x100000
+                                   0x12800000 0x12800000 0x100000
+                                   0x0c000000 0x0c000000 0x200000
+                                   0xa0000000 0xa0000000 0x20000000>;
+                       exception-irq   = <514>;
+                       firmware        = "dsp-core2.out";
+                       core            = "dsp-core2";
+               };
+
+               rproc3: rproc@262004C {
+                       compatible = "ti,keystone-rproc";
+                       reg = <0x0262004c 4
+                              0x02350a70 4
+                              0x02350120 4
+                              0x0262024c 4>;
+                       addr-map = <0x13800000 0x00800000 0x100000
+                                   0x13800000 0x13800000 0x100000
+                                   0x0c000000 0x0c000000 0x200000
+                                   0xa0000000 0xa0000000 0x20000000>;
+                       exception-irq   = <515>;
+                       firmware        = "dsp-core3.out";
+                       core            = "dsp-core3";
+               };
+
+               rapidio: rapidio@2900000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0x2900000 0x21000               /* rio regs */
+                               0x2620000 0x3b0>;               /* boot config regs */
+                       compatible = "ti,keystone-rapidio";
+
+                       tx_channel = "riotx";
+                       tx_queue_depth = <32>;
+
+                       rx_channel = "riorx";
+                       rx_queue_depth  = <64 0 0 0>;
+                       rx_buffer_size  = <1552 0 0 0>;
+
+                        ports = <0x1>;      /* bitfield of port(s) to probe on this controller */
+                        dev-id-size = <0>;  /* RapidIO common transport system size.
+                                            * 0 - Small size. 8-bit deviceID fields. 256 devices.
+                                             * 1 - Large size, 16-bit deviceID fields. 65536 devices. */
+               };
+       };
+};
diff --git a/device/tci6614-resources.dts b/device/tci6614-resources.dts
deleted file mode 100644 (file)
index 0505e96..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/dts-v1/;
-
-/ {
-    device-name = "TCI6614";
-    
-    /* Device Resource Definitions */
-
-    timers {
-        resource-name = "timers";  /* BIOS will have a resource defined with
-                                    * resourceName "Timers" when requesting
-                                    * timer services from the RM */
-        resource-range = <0 16>; /* 16 Timers in the device starting at index 0 and
-                                  * ending at index 15 */
-        allocator = "integer"; /* Initialize and use an integer allocator
-                                * for the timer resource */
-        ns-assignment = "Shared_Timer" , <56>; /* Initialize timer 5 as a named 
-                                                * resource for sharing via the RM
-                                                * nameserver by name 
-                                                * Shared_Timer */
-        ns-assign1 = "this" , <1000000>; /* Initialize timer 5 as a named 
-                                          * resource for sharing via the RM
-                                          * nameserver by name 
-                                          * Shared_Timer */
-        ns-assign2 = "Shared_Timers" , <356>; /* Initialize timer 5 as a named 
-                                               * resource for sharing via the RM
-                                               * nameserver by name 
-                                               * Shared_Timer */
-        ns-assign3 = "Shared_Timers" , <56>; /* Initialize timer 5 as a named 
-                                              * resource for sharing via the RM
-                                              * nameserver by name 
-                                              * Shared_Timer */                                           
-    };
-
-    /* Multiple resource definition for QMSS since there are different queue
-     * types */
-    qmss {
-        qmss-gp-queues {
-            resource-name = "general-queues";  /* QMSS LLD will have a resource 
-                                        * defined with resourceName 
-                                        * "GP-Queues" when requesting
-                                        * queue services from the RM */
-            resource-range = <0 4000>;  /* Device has 4000 general purpose queues
-                                * starting at index 0 and ending at index
-                                * 3999 */
-            allocator = "tree"; /* Initialize and use a tree allocator
-                                  * for the general purpose queues */
-        };
-        qmss-accum-queues {
-            resource-name = "accumulator-queues";  /* QMSS LLD will have a resource 
-                                           * defined with resourceName 
-                                           * "Accum-Queues" when requesting
-                                           * queue services from the RM */
-            resource-range = <4001 32>;  /* Device has 32 accumulator queues
-                                 * starting at index 4000 and ending at
-                                 * index 4031 */
-            allocator = "integer"; /* Initialize and use an integer allocator
-                                     * for the accumulator queues */
-        };
-    };
-};
diff --git a/device/test_tree1.dtb b/device/test_tree1.dtb
deleted file mode 100644 (file)
index e137200..0000000
Binary files a/device/test_tree1.dtb and /dev/null differ
index 82031280d0f27806cd030909cbfb383181cc27d5..3b49c0de4abaabaf9116828d09605dfeb37ea127 100644 (file)
@@ -72,6 +72,11 @@ typedef struct {
  ***********Resource List DTB Parsing Defines and Functions************
  **********************************************************************/
 
+/** 
+* @brief Linux DTB alias offset not set
+*/
+#define RM_DTB_LINUX_ALIAS_OFFSET_NOT_SET 0xFFFF
+
 typedef enum {
     /** Resource DTB unknown property type */
     Rm_resourcePropType_UNKNOWN = 0,
@@ -81,10 +86,20 @@ typedef enum {
     Rm_resourcePropType_RESOURCE_RANGE = 2,
     /** Resource DTB resource allocator property type */
     Rm_resourcePropType_RESOURCE_ALLOCATOR = 3,
+    /** Resource DTB resource alias path in Linux DTB */
+    Rm_resourcePropType_RESOURCE_LINUX_ALIAS = 4,    
     /** Resource DTB NameServer assignment property type */
-    Rm_resourcePropType_NSASSIGNMENT = 4,    
+    Rm_resourcePropType_NSASSIGNMENT = 5,    
 } Rm_ResourcePropType;
 
+typedef struct {
+    char *pathList;
+    uint32_t pathListLenBytes;
+    uint32_t base;
+    uint32_t length;
+    void *nextLinuxAlias;
+} Rm_LinuxAlias;
+
 typedef struct {
     char *nsName;
     uint32_t resourceValue;
@@ -94,10 +109,12 @@ typedef struct {
 Rm_ResourcePropType Rm_resourceGetPropertyType(const char *propertyName);
 char *Rm_resourceExtractDeviceName(const void *dtbDataPtr, int32_t dtbDataLen);
 void Rm_resourceFreeDeviceName(char *deviceName);
-Rm_ResourceRange *Rm_resourceExtractResourceRange(const void *dtbDataPtr, int32_t dtbDataLen);
-void Rm_resourceFreeResourceRange(Rm_ResourceRange *rangeList);
-char *Rm_resourceExtractResourceAllocator(const void *dtbDataPtr, int32_t dtbDataLen);
-void Rm_resourceFreeResourceAllocator(char *resourceAllocatorType);
+Rm_ResourceRange *Rm_resourceExtractRange(const void *dtbDataPtr, int32_t dtbDataLen);
+void Rm_resourceFreeRange(Rm_ResourceRange *rangeList);
+char *Rm_resourceExtractAllocator(const void *dtbDataPtr, int32_t dtbDataLen);
+void Rm_resourceFreeAllocator(char *resourceAllocatorType);
+Rm_LinuxAlias *Rm_resourceExtractLinuxAlias(const void *dtbDataPtr, int32_t dtbDataLen);
+void Rm_resourceFreeLinuxAlias(Rm_LinuxAlias *aliasList);
 Rm_NsAssignment *Rm_resourceExtractNsAssignment(const void *dtbDataPtr, int32_t dtbDataLen);
 void Rm_resourceFreeNsAssignmentList(Rm_NsAssignment *nsAssignmentList);
 
@@ -131,8 +148,8 @@ typedef struct {
 Rm_PolicyPropType Rm_policyGetPropertyType(const char *propertyName);
 char *Rm_policyExtractPolicyType(const void *dtbDataPtr, int32_t dtbDataLen);
 void Rm_policyFreePolicyType(char *policyType);
-Rm_ResourceRange *Rm_policyExtractResourceAssignedRanges(const void *dtbDataPtr, int32_t dtbDataLen);
-void Rm_policyFreeResourceAssignedRanges(Rm_ResourceRange *rangeList);
+Rm_ResourceRange *Rm_policyExtractAssignedRanges(const void *dtbDataPtr, int32_t dtbDataLen);
+void Rm_policyFreeAssignedRanges(Rm_ResourceRange *rangeList);
 Rm_AllocationSize *Rm_policyExtractAllocationSizes(const void *dtbDataPtr, int32_t dtbDataLen);
 void Rm_policyFreeAllocationSizesPropList(Rm_AllocationSize *allocationSizeList);
 Rm_AssignedNsNames *Rm_policyExtractAssignedNsNames(const void *dtbDataPtr, int32_t dtbDataLen);
index 061a9ba95d3af848ff4bbe549be8f46f2224eef7..4b5f4ebc13a634ad219a839ecf91081a2e266a59 100644 (file)
@@ -139,6 +139,8 @@ typedef struct {
     int32_t rangeLen;
     const void *nsAssignData;
     int32_t nsAssignLen;
+    const void *linuxAliasData;
+    int32_t linuxAliasLen;
 } Rm_ResourceProperties;
 
 typedef enum {
@@ -155,6 +157,13 @@ typedef enum {
 typedef struct {
     char *srcInstName;
     Rm_AllocatorOp operation;
+    /* When pre-allocating, the policy's ranges and alignment for the resource
+     * for the RM instance will be copied to the following three variables.  These
+     * variables will be used as the basis for pre-allocating a resource. */
+    uint32_t policyBase;
+    uint32_t policyLength;
+    uint32_t policyAlignment;
+    /* Will contain the actual allocation/free values */
     Rm_ResourceInfo *resourceInfo;
 } Rm_AllocatorOpInfo;
 
index 1f1478086273f9b1210a24eae74ee55fc147cf31..5096e1d485eccb63f4819f9c3b3f2a23b3cdc93c 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -592,32 +592,28 @@ int32_t Rm_createTreeAllocator(Rm_Inst *rmInst, const char *resourceName, Rm_Res
     /* Assign the tree's root to the allocator */\r
     allocator->allocatorRootEntry = treeRootEntry;\r
 \r
-    /* Print the base values as a test */\r
-    RB_FOREACH(treeNode, _Rm_ResourceTree, (Rm_ResourceTree *) allocator->allocatorRootEntry)\r
-    {\r
-        Rm_osalLog("Tree node base: %d length: %d and allocated to: %s\n", treeNode->base, treeNode->length, treeNode->allocatedTo);\r
-    }\r
-\r
     return(0);   /* TODO: FIX THIS RETURN */\r
 }\r
 \r
 int32_t Rm_createAndInitAllocator(Rm_Inst *rmInst, const char *resourceName, \r
-                                  Rm_ResourceProperties *resourceProperties)\r
+                                  Rm_ResourceProperties *resourceProperties, void *linuxDtb)\r
 {\r
     char *allocatorType = NULL;\r
     Rm_ResourceRange *range = NULL;\r
     Rm_ResourceRange *rangeBasePtr = NULL;\r
     Rm_NsAssignment *nsAssignments = NULL;\r
     Rm_NsAssignment *nsAssignmentBasePtr = NULL;\r
+    Rm_LinuxAlias *linuxAlias = NULL;\r
+    Rm_LinuxAlias *linuxAliasBasePtr = NULL;\r
     int32_t retVal = RM_DTB_UTIL_RESULT_OKAY;\r
 \r
     /* TODO: NEED CHECKS FOR VALIDITY OF ALL THE resourceProperties FIELDS */\r
 \r
     /* Extract the resource properties from the DTB */\r
-    allocatorType = Rm_resourceExtractResourceAllocator(resourceProperties->allocatorData, \r
-                                                        resourceProperties->allocatorLen);\r
-    range = rangeBasePtr = Rm_resourceExtractResourceRange(resourceProperties->rangeData, \r
-                                                           resourceProperties->rangeLen);\r
+    allocatorType = Rm_resourceExtractAllocator(resourceProperties->allocatorData, \r
+                                                resourceProperties->allocatorLen);\r
+    range = rangeBasePtr = Rm_resourceExtractRange(resourceProperties->rangeData, \r
+                                                   resourceProperties->rangeLen);\r
 \r
     /* Create an allocator based on the allocator type specified */\r
     if (strcmp(allocatorType, &rmIntegerAllocator[0]) == 0)\r
@@ -635,6 +631,10 @@ int32_t Rm_createAndInitAllocator(Rm_Inst *rmInst, const char *resourceName,
         /* Allocator type not recognized.  Free the resource properties and return */\r
         retVal = -21; /* TEMP ERROR: Can't conflict with LIBFDT errors */\r
     }\r
+\r
+    /* Reserve the resources taken by the Linux kernel specified in the Linux DTB */\r
+    linuxAlias = linuxAliasBasePtr = Rm_resourceExtractLinuxAlias(resourceProperties->linuxAliasData,\r
+                                                                  resourceProperties->linuxAliasLen);\r
     \r
     if (retVal >= RM_DTB_UTIL_RESULT_OKAY)\r
     {\r
@@ -658,8 +658,9 @@ int32_t Rm_createAndInitAllocator(Rm_Inst *rmInst, const char *resourceName,
     }\r
 \r
     /* Free the memory allocated for the resource properties */\r
-    Rm_resourceFreeResourceAllocator(allocatorType);\r
-    Rm_resourceFreeResourceRange(rangeBasePtr);\r
+    Rm_resourceFreeAllocator(allocatorType);\r
+    Rm_resourceFreeRange(rangeBasePtr);\r
+    Rm_resourceFreeLinuxAlias(linuxAliasBasePtr);\r
 \r
     return(retVal);\r
 }\r
@@ -722,6 +723,21 @@ int32_t Rm_parseResourceProperty(void *globalResourceDtb, int32_t offset, Rm_Res
                 propertyInfo->nsAssignLen = propertyLen;\r
             }\r
         }\r
+        else if (propertyType == Rm_resourcePropType_RESOURCE_LINUX_ALIAS)\r
+        {\r
+            if (propertyInfo->linuxAliasData || propertyInfo->linuxAliasLen)\r
+            {\r
+                /* The linuxAlias fields have already been populated.  Return an error.\r
+                 * The resource list has specified a property field more than once\r
+                 * for a resource node */\r
+                retVal = -28; /* TEMP ERROR: Can't conflict with LIBFDT errors */\r
+            }\r
+            else\r
+            {\r
+                propertyInfo->linuxAliasData = propertyData;\r
+                propertyInfo->linuxAliasLen = propertyLen;\r
+            }\r
+        }        \r
         else\r
         {\r
             retVal = -20; /* TEMP ERROR: Can't conflict with LIBFDT errors */\r
@@ -750,7 +766,8 @@ int32_t Rm_parseResourceProperty(void *globalResourceDtb, int32_t offset, Rm_Res
     return (retVal);\r
 }\r
 \r
-int32_t Rm_parseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t nodeOffset, int32_t depth)\r
+int32_t Rm_parseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t nodeOffset, int32_t depth,\r
+                             void *linuxDtb)\r
 {\r
        const char *resourceName = fdt_get_name(globalResourceDtb, nodeOffset, NULL);\r
     Rm_ResourceProperties resourceProperties;\r
@@ -776,7 +793,7 @@ int32_t Rm_parseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t n
             }\r
             \r
             /* Initialize an allocator with the resource properties if no error was returned */\r
-            Rm_createAndInitAllocator(rmInst, resourceName, &resourceProperties);\r
+            Rm_createAndInitAllocator(rmInst, resourceName, &resourceProperties, linuxDtb);\r
        }\r
         else if (offset != -FDT_ERR_NOTFOUND)\r
         {\r
@@ -792,7 +809,7 @@ int32_t Rm_parseResourceNode(Rm_Inst *rmInst, void *globalResourceDtb, int32_t n
      * at the start of the recursion will signal the end of the resource list */\r
     if ((offset >= RM_DTB_UTIL_STARTING_NODE_OFFSET) && (depth >= RM_DTB_UTIL_STARTING_DEPTH))\r
     {\r
-        error = Rm_parseResourceNode(rmInst, globalResourceDtb, offset, depth);\r
+        error = Rm_parseResourceNode(rmInst, globalResourceDtb, offset, depth, linuxDtb);\r
         if (error < -FDT_ERR_NOTFOUND)\r
         {\r
             return (error);\r
@@ -1032,10 +1049,91 @@ int32_t Rm_integerFree(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)
 /* Called when an allocate request is made but the base is unspecified.  RM must preallocate\r
  * resources which then must be checked against the RM policy for the instance.  If the\r
  * policy does not agree another resource(s) must be preallocated and tested against the \r
- * policy */\r
+ * policy.  Policy will provide initialize the preallocate with the base that it allows\r
+ * for the rm instance for the specified resource. */\r
 int32_t Rm_treePreAllocate(Rm_Allocator *allocator, Rm_AllocatorOpInfo *opInfo)\r
 {\r
+    Rm_ResourceTreeNode findNode;\r
+    Rm_ResourceTreeNode *matchingNode = NULL;\r
+    uint32_t policyRangeEnd = opInfo->policyBase + opInfo->policyLength - 1;\r
+    uint32_t index;\r
+    bool resourceFound = FALSE;\r
+    int32_t retVal = RM_SERVICE_PROCESSING;\r
 \r
+    /* Find the tree node that contains the first value in the specified policy range. */\r
+    findNode.base = opInfo->policyBase;\r
+    findNode.length = 1;\r
+    matchingNode = RB_FIND(_Rm_ResourceTree, allocator->allocatorRootEntry, &findNode);\r
+\r
+    if (matchingNode != NULL)\r
+    {\r
+        /* Begin searching for an available range of resources starting from the\r
+         * matching node */\r
+        for (index = matchingNode->base; index <= policyRangeEnd;)\r
+        {\r
+            /* Is the matchingNode free? */\r
+            if (strcmp(matchingNode->allocatedTo, RM_NOT_ALLOCATED_STRING) == 0)\r
+            {\r
+                uint32_t matchEnd = matchingNode->base + matchingNode->length - 1;\r
+\r
+                /* Move index to the first resource satisfying the alignment property */\r
+                if ((index % opInfo->policyAlignment) != 0)\r
+                {\r
+                    index += (opInfo->policyAlignment - (index % opInfo->policyAlignment));\r
+                }\r
+                \r
+                /* Move through the node's resource range looking for a contiguous set of resources\r
+                 * that satisfy the request. */\r
+                while ((index <= matchEnd) && (index <= policyRangeEnd))\r
+                {\r
+                    if (((index + opInfo->resourceInfo->length - 1) <= matchEnd) &&\r
+                        ((index + opInfo->resourceInfo->length - 1) <= policyRangeEnd))\r
+                    {\r
+                        /* Found a resource range in the node that satisfies the requirements */\r
+                        opInfo->resourceInfo->base = index;\r
+                        resourceFound = TRUE;\r
+                        break;\r
+                    }\r
+\r
+                    /* Move index to the next resource value that satisfies the alignment property */\r
+                    index += (opInfo->policyAlignment - (index % opInfo->policyAlignment));\r
+                }\r
+            }\r
+            \r
+            if (!resourceFound)\r
+            {\r
+                /* Move to the next tree node */\r
+                matchingNode = RB_NEXT(_Rm_ResourceTree, allocator->allocatorRootEntry, matchingNode);\r
+                if (matchingNode == NULL)\r
+                {\r
+                    /* Reached end of tree.  Resource range does not exist.  Leave the search\r
+                     * loop */\r
+                    break;\r
+                }\r
+                else\r
+                {\r
+                    index = matchingNode->base;\r
+                }\r
+            }\r
+            else\r
+            {\r
+                /* Found a resource range that satisfies the request properties.  Break out of the\r
+                 * search loop */\r
+                break;\r
+            }\r
+        }\r
+\r
+        if (!resourceFound)\r
+        {\r
+            retVal = RM_SERVICE_DENIED_RESOURCE_ALREADY_ALLOCATED;\r
+        }\r
+    }\r
+    else\r
+    {\r
+        retVal = RM_SERVICE_DENIED_RESOURCE_VALUE_RANGE_DOES_NOT_EXIST;\r
+    }\r
+\r
+    return(retVal); \r
 }\r
 \r
 /* Assume the policy has already approved of the allocation */\r
@@ -1825,7 +1923,7 @@ void Rm_transactionProcessor (Rm_Inst *rmInst, Rm_Transaction *transaction)
     }\r
 }\r
 \r
-int32_t Rm_initializeAllocators(Rm_Inst *rmInst, void *globalResourceDtb)\r
+int32_t Rm_initializeAllocators(Rm_Inst *rmInst, void *globalResourceDtb, void *linuxDtb)\r
 {\r
     int32_t nodeOffset = RM_DTB_UTIL_STARTING_NODE_OFFSET;\r
     int32_t startDepth = RM_DTB_UTIL_STARTING_DEPTH;\r
@@ -1833,17 +1931,11 @@ int32_t Rm_initializeAllocators(Rm_Inst *rmInst, void *globalResourceDtb)
 \r
     /* Recursively parse the Global Resource List, creating an allocator for\r
      * each resource as specified in the node */\r
-    result = Rm_parseResourceNode(rmInst, globalResourceDtb, nodeOffset, startDepth);\r
+    result = Rm_parseResourceNode(rmInst, globalResourceDtb, nodeOffset, startDepth, linuxDtb);\r
 \r
     return(result);\r
 }\r
          \r
-int32_t Rm_reserveLinuxResources(Rm_Inst *rmInst, void *linuxResourceDtb)\r
-{\r
-    return(0);\r
-\r
-}\r
-\r
 /**********************************************************************\r
  ********************** Application visible APIs **********************\r
  **********************************************************************/\r
@@ -1886,21 +1978,21 @@ Rm_Handle Rm_init(Rm_InitCfg *initCfg)
     /* RM Server specific actions */\r
     if (rmInst->instType == Rm_instType_SERVER)\r
     {\r
-        /* Open the ResourceList file and provide it to the resource initializer. */\r
+        /* Open the ResourceList file and provide it to the resource initializer.  The Linux\r
+         * DTB will be parsed simultaneously for resource's consumed by the kernel.  The resources\r
+         * used by the kernel will be marked as used in the resource allocators. */\r
         if (initCfg->globalResourceList)\r
         {\r
             globalResourceDtb = initCfg->globalResourceList;\r
-            fdt_open_into(globalResourceDtb, globalResourceDtb, fdt_totalsize(globalResourceDtb));            \r
-            Rm_initializeAllocators(rmInst, globalResourceDtb);\r
-        }\r
+            fdt_open_into(globalResourceDtb, globalResourceDtb, fdt_totalsize(globalResourceDtb));\r
 \r
-        /* Parse the Linux DTB for the resources reserved by the Linux kernel.  These resources\r
-         * will be marked as used in the resource allocators. */\r
-        if (initCfg->linuxDtb)\r
-        {\r
-            linuxResourceDtb = initCfg->linuxDtb;\r
-            fdt_open_into(linuxResourceDtb, linuxResourceDtb, fdt_totalsize(linuxResourceDtb));            \r
-            Rm_reserveLinuxResources(rmInst, linuxResourceDtb);\r
+            if (initCfg->linuxDtb)\r
+            {\r
+                linuxResourceDtb = initCfg->linuxDtb;\r
+                fdt_open_into(linuxResourceDtb, linuxResourceDtb, fdt_totalsize(linuxResourceDtb));   \r
+            }\r
+            \r
+            Rm_initializeAllocators(rmInst, globalResourceDtb, linuxResourceDtb);\r
         }\r
     }\r
 \r
index 7a0f779a029ff8de71470782146003e09258c299..3334df2733b96f28baa1050cc0fa27571e185fe1 100644 (file)
@@ -155,8 +155,10 @@ void Rm_commonFreeRangeList(Rm_ResourceRange *rangeList)
  * by an application integrator to define the properties of resources
  * listed in the Device Resource List */
 char rmResourceDeviceNameProp[] = "device-name";
-char rmResourceResourceRangeProp[] = "resource-range";
-char rmResourceResourceAllocatorProp[] = "allocator";
+char rmResourceRangeProp[] = "resource-range";
+char rmResourceAllocatorProp[] = "allocator";
+char rmResourceLinuxAliasProp[] = "linux-dtb-alias";
+char rmResourceLinuxAliasCompletionString[] = "end";
 char rmResourceNsAssignmentProp[] = "ns-assignment";
 
 Rm_ResourcePropType Rm_resourceGetPropertyType(const char * propertyName)
@@ -167,14 +169,18 @@ Rm_ResourcePropType Rm_resourceGetPropertyType(const char * propertyName)
     {
         propertyType = Rm_resourcePropType_DEVICE_NAME;
     }    
-    else if(strcmp(rmResourceResourceRangeProp, propertyName) == 0)
+    else if(strcmp(rmResourceRangeProp, propertyName) == 0)
     {
         propertyType = Rm_resourcePropType_RESOURCE_RANGE;
     }
-    else if(strcmp(rmResourceResourceAllocatorProp, propertyName) == 0)
+    else if(strcmp(rmResourceAllocatorProp, propertyName) == 0)
     {
         propertyType = Rm_resourcePropType_RESOURCE_ALLOCATOR;
     }
+    else if(strcmp(rmResourceLinuxAliasProp, propertyName) == 0)
+    {
+        propertyType = Rm_resourcePropType_RESOURCE_LINUX_ALIAS;
+    }    
     else if(strcmp(rmResourceNsAssignmentProp, propertyName) == 0)
     {
         propertyType = Rm_resourcePropType_NSASSIGNMENT;
@@ -193,7 +199,7 @@ void Rm_resourceFreeDeviceName(char *deviceName)
     Rm_commonFreeName(deviceName);
 }
 
-Rm_ResourceRange *Rm_resourceExtractResourceRange(const void *dtbDataPtr, int32_t dtbDataLen)
+Rm_ResourceRange *Rm_resourceExtractRange(const void *dtbDataPtr, int32_t dtbDataLen)
 {
     return(Rm_commonExtractRange(dtbDataPtr, dtbDataLen));
 }
@@ -204,7 +210,7 @@ void Rm_resourceFreeResourceRange(Rm_ResourceRange *rangeList)
 }
 
 /* MODIFY TO RETURN AN ALLOCATOR TYPE INSTEAD OF A STRING??? */
-char *Rm_resourceExtractResourceAllocator(const void *dtbDataPtr, int32_t dtbDataLen)
+char *Rm_resourceExtractAllocator(const void *dtbDataPtr, int32_t dtbDataLen)
 {
     return(Rm_commonExtractName(dtbDataPtr, dtbDataLen));
 }
@@ -214,6 +220,117 @@ void Rm_resourceFreeResourceAllocator(char *resourceAllocatorType)
     Rm_commonFreeName(resourceAllocatorType);
 }
 
+Rm_LinuxAlias *Rm_resourceExtractLinuxAlias(const void *dtbDataPtr, int32_t dtbDataLen)
+{
+    uint8_t *aliasData = (uint8_t *)dtbDataPtr;
+    uint8_t *pathStart = NULL;
+    uint32_t pathLenBytes;
+    uint32_t nameLenBytes;
+    uint32_t extractedValue;
+    uint8_t *extractedValueBytePtr;        
+    Rm_LinuxAlias *startAlias = NULL;
+    Rm_LinuxAlias *newAlias = NULL;
+    Rm_LinuxAlias *prevAlias = NULL;
+    int8_t i = 0;
+    uint16_t j;
+    
+    /* Linux aliases are stored in the DTB as a list of null-terminated character
+     * strings ending with a string defined as "end".  Following the string list 
+     * will be one or two values specifying the fields in the linux DTB property
+     * that contain the relevant data.  If two field offsets are specified the 
+     * Linux DTB contains a base + length. If one field offset is specified the 
+     * Linux DTB contains a single value for reservation.  An "end" string follows
+     * the offset fields.  There is no padding between the "end" string and the 32-bit 
+     * offsets.  Therefore the 32-bit offsets may not be on a 4-byte boundary and must
+     * be constructed upon extraction */
+
+    /* Extract the alias data from the DTB */
+    while(i < dtbDataLen)
+    {
+        /* Creat a new Linux alias entry */
+        newAlias = (Rm_LinuxAlias *) Rm_osalMalloc(sizeof(Rm_LinuxAlias));
+        
+        /* Populate the new alias entry.  Allocate a buffer for the alias
+         * path string (adding one for each null character). */
+        pathStart = aliasData + i;
+        pathLenBytes = 0;
+        while (strcmp((char *)aliasData[i], rmResourceLinuxAliasCompletionString) != 0)
+        {
+            nameLenBytes = strlen((char *) aliasData[i]) + 1;
+            pathLenBytes += nameLenBytes;
+            i += nameLenBytes;
+        }
+        newAlias->pathList = (char *) Rm_osalMalloc(pathLenBytes);
+        newAlias->pathListLenBytes = pathLenBytes;
+        memcpy((void *) newAlias->pathList, (void *)pathStart, pathLenBytes);
+
+        /* Skip past the first "end" string */
+        i += (strlen((char *) aliasData[i]) + 1);       
+        
+        /* Extract the first 32-bit offset */
+        extractedValueBytePtr = (uint8_t *)&extractedValue;
+        for (j = 0; j < sizeof(uint32_t); j++, i++)
+        {
+            extractedValueBytePtr[j] = aliasData[i];
+        }
+        /* flip the endianness */
+        newAlias->base = fdt32_to_cpu(extractedValue);
+
+        /* Check for the "end" string. Extract the second offset if it isn't there */
+        if (strcmp((char *) aliasData[i], rmResourceLinuxAliasCompletionString) != 0)
+        {
+            /* Extract the second 32-bit offset */
+            extractedValueBytePtr = (uint8_t *)&extractedValue;
+            for (j = 0; j < sizeof(uint32_t); j++, i++)
+            {
+                extractedValueBytePtr[j] = aliasData[i];
+            }
+            /* flip the endianness */
+            newAlias->base = fdt32_to_cpu(extractedValue);
+        }
+        else
+        {
+            newAlias->length = RM_DTB_LINUX_ALIAS_OFFSET_NOT_SET;
+        }
+
+        /* Skip past the second "end" string */
+        i += (strlen((char *) aliasData[i]) + 1);   
+
+        newAlias->nextLinuxAlias = NULL;
+
+        if (prevAlias == NULL)
+        {
+            /* Save the first entry so it can be returned */
+            startAlias = newAlias;
+        }
+        else
+        {
+            prevAlias->nextLinuxAlias = (void *) newAlias;
+        }
+        prevAlias = newAlias;
+    }
+
+    /* Return a pointer to the start of the Linux alias list */
+    return (startAlias);
+}
+
+/* Function to clean up the memory allocated for a linked list of extracted Linux
+ * aliases. */
+void Rm_resourceFreeLinuxAlias(Rm_LinuxAlias *aliasList)
+{
+    Rm_LinuxAlias *nextAlias;
+    
+    while (aliasList != NULL)
+    {
+        nextAlias = aliasList->nextLinuxAlias;
+        /* Free the path string list memory first */
+        Rm_osalFree((void *)aliasList->pathList, aliasList->pathListLenBytes);
+        /* Free the list element */
+        Rm_osalFree((void *)aliasList, sizeof(Rm_LinuxAlias));
+        aliasList = nextAlias;
+    }
+}
+
 /* Construct and return a list of NameServer assignments as specified in the Resource DTB */
 Rm_NsAssignment *Rm_resourceExtractNsAssignment(const void *dtbDataPtr, int32_t dtbDataLen)
 {
@@ -301,9 +418,9 @@ void Rm_resourceFreeNsAssignmentList (Rm_NsAssignment *nsAssignmentList)
  * by an application integrator to define the properties of resources
  * listed in a Resource Manager Policy */
 char rmPolicyPolicyTypeProp[] = "policy-type";
-char rmPolicyResourceAssignedRangesProp[] = "assigned-ranges";
-char rmPolicyResourceAllocationSizesProp[] = "allocation-sizes";
-char rmPolicyResourceAssignedNsNamesProp[] = "assigned-ns-names";
+char rmPolicyAssignedRangesProp[] = "assigned-ranges";
+char rmPolicyAllocationSizesProp[] = "allocation-sizes";
+char rmPolicyAssignedNsNamesProp[] = "assigned-ns-names";
 
 Rm_PolicyPropType Rm_policyGetPropertyType(const char * propertyName)
 {
@@ -313,15 +430,15 @@ Rm_PolicyPropType Rm_policyGetPropertyType(const char * propertyName)
     {
         propertyType = Rm_policyPropType_POLICY_TYPE;
     } 
-    else if(strcmp(rmPolicyResourceAssignedRangesProp, propertyName) == 0)
+    else if(strcmp(rmPolicyAssignedRangesProp, propertyName) == 0)
     {
         propertyType = Rm_policyPropType_RESOURCE_ASSIGNED_RANGES;
     }
-    else if(strcmp(rmPolicyResourceAllocationSizesProp, propertyName) == 0)
+    else if(strcmp(rmPolicyAllocationSizesProp, propertyName) == 0)
     {
         propertyType = Rm_policyPropType_RESOURCE_ALLOCATION_SIZES;
     }
-    else if(strcmp(rmPolicyResourceAssignedNsNamesProp, propertyName) == 0)
+    else if(strcmp(rmPolicyAssignedNsNamesProp, propertyName) == 0)
     {
         propertyType = Rm_policyPropType_ASSIGNED_NS_NAMES;
     }
@@ -340,12 +457,12 @@ void Rm_policyFreePolicyType(char *policyType)
     Rm_commonFreeName(policyType);
 }
 
-Rm_ResourceRange *Rm_policyExtractResourceAssignedRanges(const void *dtbDataPtr, int32_t dtbDataLen)
+Rm_ResourceRange *Rm_policyExtractAssignedRanges(const void *dtbDataPtr, int32_t dtbDataLen)
 {
     return(Rm_commonExtractRange(dtbDataPtr, dtbDataLen));
 }
 
-void Rm_policyFreeResourceAssignedRanges(Rm_ResourceRange *rangeList)
+void Rm_policyFreeAssignedRanges(Rm_ResourceRange *rangeList)
 {
     Rm_commonFreeRangeList(rangeList);
 }
index a3f15691e6926ca1d91b409b953e9b89f207fbf8..855986c2d67b475debf77db11dd009c3c1ea9d7a 100644 (file)
@@ -653,10 +653,13 @@ Int main(Int argc, Char* argv[])
     Rm_InitCfg rmInitCfg;
     Task_Params taskParams;
     FILE *globalResourceFp;
+    FILE *linuxDtbFp;
     FILE *globalPolicyFp;
     Int globalResourceFileSize;
+    Int linuxDtbFileSize;
     Int globalPolicyFileSize;
     void *globalResourceList = NULL;
+    void *linuxDtb = NULL;
     void *globalPolicy = NULL;
     Int status;
     Int readSize;
@@ -675,25 +678,33 @@ Int main(Int argc, Char* argv[])
     if (MultiProc_self()== 0)
     {
         /* Open the Global Resource and Policy DTB files */
-        globalResourceFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\resources2.dtb", "rb");
+        globalResourceFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-global-resources.dtb", "rb");
+        linuxDtbFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\tci6614-linux-evm.dtb", "rb");
         globalPolicyFp = fopen("C:\\ti\\pdk_tci6614_1_0_0_11\\packages\\ti\\drv\\rm\\device\\global-policy.dtb", "rb");
 
-        /* Get the size of the Global Resource List and Global Policy */
+        /* Get the size of the Global Resource List, Linux DTB, and Global Policy */
         fseek(globalResourceFp, 0, SEEK_END);
         globalResourceFileSize = ftell(globalResourceFp);
         rewind(globalResourceFp);
 
+        fseek(linuxDtbFp, 0, SEEK_END);
+        linuxDtbFileSize = ftell(linuxDtbFp);
+        rewind(linuxDtbFp);
+
         fseek(globalPolicyFp, 0, SEEK_END);
         globalPolicyFileSize = ftell(globalPolicyFp);
         rewind(globalPolicyFp);      
 
-        /* Allocate buffers to hold the Global Resource List and Global Policy */
+        /* Allocate buffers to hold the Global Resource List, Linux DTB, and Global Policy */
         globalResourceList = Osal_rmMalloc(globalResourceFileSize);
+        linuxDtb = Osal_rmMalloc(linuxDtbFileSize);
         globalPolicy = Osal_rmMalloc(globalPolicyFileSize);
 
         /* Read the file data into the allocated buffers */
         readSize = fread(globalResourceList, 1, globalResourceFileSize, globalResourceFp);
         System_printf("Read Size compared to file size: %d : %d\n", readSize, globalResourceFileSize);
+        readSize = fread(linuxDtb, 1, linuxDtbFileSize, linuxDtbFp);
+        System_printf("Read Size compared to file size: %d : %d\n", readSize, linuxDtbFileSize);        
         readSize = fread(globalPolicy, 1, globalPolicyFileSize, globalPolicyFp);
         System_printf("Read Size compared to file size: %d : %d\n", readSize, globalPolicyFileSize);
         
@@ -702,8 +713,9 @@ Int main(Int argc, Char* argv[])
         /* Create the RM Server instance */
         rmInitCfg.instName = &rmServerName[0];
         rmInitCfg.instType = Rm_instType_SERVER;
-        /* SET TO NULL - FEATURES NOT ADDED YET */
+        /* Provide the DTBs to the RM Server */
         rmInitCfg.globalResourceList = globalResourceList;
+        rmInitCfg.linuxDtb = linuxDtb;
         rmInitCfg.startupPolicy = globalPolicy;
 
         /* Get the RM Server handle */