]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc/85xx: Update setting of SRIO LIODNs
authorKumar Gala <galak@kernel.crashing.org>
Fri, 14 Oct 2011 05:01:23 +0000 (00:01 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 18 Oct 2011 05:36:15 +0000 (00:36 -0500)
Properly set the LIODN values associated with SRIO controller.  On
P4080/P3060 we have an LIODN per port and one for the RMU.  On
P2041/P3041/P5020 we have 2 LIODNs per port.

Update the tables for all of these devices to properly handle both
styles.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/cpu/mpc85xx/liodn.c
arch/powerpc/cpu/mpc85xx/p2041_ids.c
arch/powerpc/cpu/mpc85xx/p3041_ids.c
arch/powerpc/cpu/mpc85xx/p3060_ids.c
arch/powerpc/cpu/mpc85xx/p4080_ids.c
arch/powerpc/cpu/mpc85xx/p5020_ids.c
arch/powerpc/include/asm/fsl_liodn.h

index e0ea502a05fed42208c454e4a3e8f41fb9e5206e..e14de9dc960702f270313a360049c42771e67e14 100644 (file)
@@ -40,6 +40,21 @@ int get_dpaa_liodn(enum fsl_dpaa_dev dpaa_dev, u32 *liodns, int liodn_offset)
        return liodn_bases[dpaa_dev].num_ids;
 }
 
+static void set_srio_liodn(struct srio_liodn_id_table *tbl, int size)
+{
+       int i;
+
+       for (i = 0; i < size; i++) {
+               unsigned long reg_off = tbl[i].reg_offset[0];
+               out_be32((u32 *)reg_off, tbl[i].id[0]);
+
+               if (tbl[i].num_ids == 2) {
+                       reg_off = tbl[i].reg_offset[1];
+                       out_be32((u32 *)reg_off, tbl[i].id[1]);
+               }
+       }
+}
+
 static void set_liodn(struct liodn_id_table *tbl, int size)
 {
        int i;
@@ -138,6 +153,9 @@ void set_liodns(void)
        /* setup general liodn offsets */
        set_liodn(liodn_tbl, liodn_tbl_sz);
 
+       /* setup SRIO port liodns */
+       set_srio_liodn(srio_liodn_tbl, srio_liodn_tbl_sz);
+
        /* setup SEC block liodn bases & offsets if we have one */
        if (IS_E_PROCESSOR(get_svr())) {
                set_liodn(sec_liodn_tbl, sec_liodn_tbl_sz);
index 8d254961e2f3ee78cba7300221116a32d5484091..8d7c354f957d455a4800099104eb8254bcd8ea65 100644 (file)
@@ -40,6 +40,12 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 };
 #endif
 
+struct srio_liodn_id_table srio_liodn_tbl[] = {
+       SET_SRIO_LIODN_2(1, 199, 200),
+       SET_SRIO_LIODN_2(2, 201, 202),
+};
+int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
+
 struct liodn_id_table liodn_tbl[] = {
 #ifdef CONFIG_SYS_DPAA_QBMAN
        SET_QMAN_LIODN(31),
index 96f32725f535008c0deee7935632cea4fee4baf8..7ce9fc4cc51e9b7fdc7e88bd4c1afff4e1278a3f 100644 (file)
@@ -40,6 +40,12 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 };
 #endif
 
+struct srio_liodn_id_table srio_liodn_tbl[] = {
+       SET_SRIO_LIODN_2(1, 199, 200),
+       SET_SRIO_LIODN_2(2, 201, 202),
+};
+int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
+
 struct liodn_id_table liodn_tbl[] = {
 #ifdef CONFIG_SYS_DPAA_QBMAN
        SET_QMAN_LIODN(31),
index 07703d44ebad10f370c8b5e0cbf2078224653c0b..d32142f6369c90cfc26c380e67c47564820ef50b 100644 (file)
@@ -40,6 +40,12 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 };
 #endif
 
+struct srio_liodn_id_table srio_liodn_tbl[] = {
+       SET_SRIO_LIODN_1(1, 198),
+       SET_SRIO_LIODN_1(2, 199),
+};
+int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
+
 struct liodn_id_table liodn_tbl[] = {
        SET_USB_LIODN(1, "fsl-usb2-mph", 127),
        SET_USB_LIODN(2, "fsl-usb2-dr", 157),
@@ -50,9 +56,7 @@ struct liodn_id_table liodn_tbl[] = {
        SET_DMA_LIODN(1, 196),
        SET_DMA_LIODN(2, 197),
 
-       SET_GUTS_LIODN("fsl,rapidio-delta", 198, rio1liodnr, 0),
-       SET_GUTS_LIODN(NULL, 199, rio2liodnr, 0),
-       SET_GUTS_LIODN(NULL, 200, rmuliodnr, 0),
+       SET_GUTS_LIODN("fsl,srio-rmu", 200, rmuliodnr, 0xd3000),
 
 #ifdef CONFIG_SYS_DPAA_QBMAN
        SET_QMAN_LIODN(31),
index 560c02ad571fcf6ec3c3f7eeb188270baf529f4d..a6ea6af64fbc007ab5b5e40bfaa22779eec7e479 100644 (file)
@@ -40,6 +40,12 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 };
 #endif
 
+struct srio_liodn_id_table srio_liodn_tbl[] = {
+       SET_SRIO_LIODN_1(1, 198),
+       SET_SRIO_LIODN_1(2, 199),
+};
+int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
+
 struct liodn_id_table liodn_tbl[] = {
        SET_USB_LIODN(1, "fsl-usb2-mph", 127),
        SET_USB_LIODN(2, "fsl-usb2-dr", 157),
@@ -53,9 +59,7 @@ struct liodn_id_table liodn_tbl[] = {
        SET_DMA_LIODN(1, 196),
        SET_DMA_LIODN(2, 197),
 
-       SET_GUTS_LIODN("fsl,rapidio-delta", 198, rio1liodnr, 0),
-       SET_GUTS_LIODN(NULL, 199, rio2liodnr, 0),
-       SET_GUTS_LIODN(NULL, 200, rmuliodnr, 0),
+       SET_GUTS_LIODN("fsl,srio-rmu", 200, rmuliodnr, 0xd3000),
 
 #ifdef CONFIG_SYS_DPAA_QBMAN
        SET_QMAN_LIODN(31),
index 4254dd56c790dcaaf917ddd0f9c6983cd01805fe..65d877555122ed47c93ea8ba419d61734dcfabb0 100644 (file)
@@ -40,6 +40,12 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 };
 #endif
 
+struct srio_liodn_id_table srio_liodn_tbl[] = {
+       SET_SRIO_LIODN_2(1, 199, 200),
+       SET_SRIO_LIODN_2(2, 201, 202),
+};
+int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
+
 struct liodn_id_table liodn_tbl[] = {
 #ifdef CONFIG_SYS_DPAA_QBMAN
        SET_QMAN_LIODN(31),
index 9ad104eb8a1d287c9d0c4fe8b1bf288dd5c4b07f..c65f76370ff5d14fb37e2741b369b3336fea0120 100644 (file)
 
 #include <asm/types.h>
 
+struct srio_liodn_id_table {
+       u32 id[2];
+       unsigned long reg_offset[2];
+       u8 num_ids;
+       u8 portid;
+};
+#define SET_SRIO_LIODN_1(port, idA) \
+       { .id = { idA }, .num_ids = 1, .portid = port, \
+         .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \
+               + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
+       }
+
+#define SET_SRIO_LIODN_2(port, idA, idB) \
+       { .id = { idA, idB }, .num_ids = 2, .portid = port, \
+         .reg_offset[0] = offsetof(ccsr_gur_t, rio##port##liodnr) \
+               + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
+         .reg_offset[1] = offsetof(ccsr_gur_t, rio##port##maintliodnr) \
+               + CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
+       }
+
 struct liodn_id_table {
        const char * compat;
        u32 id[2];
@@ -158,7 +178,9 @@ extern void fdt_fixup_liodn(void *blob);
 extern struct liodn_id_table liodn_tbl[], liodn_bases[], sec_liodn_tbl[];
 extern struct liodn_id_table raide_liodn_tbl[];
 extern struct liodn_id_table fman1_liodn_tbl[], fman2_liodn_tbl[];
+extern struct srio_liodn_id_table srio_liodn_tbl[];
 extern int liodn_tbl_sz, sec_liodn_tbl_sz, raide_liodn_tbl_sz;
 extern int fman1_liodn_tbl_sz, fman2_liodn_tbl_sz;
+extern int srio_liodn_tbl_sz;
 
 #endif