summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/mpc85xx/liodn.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2011-10-14 00:01:23 -0500
committerKumar Gala <galak@kernel.crashing.org>2011-10-18 00:36:15 -0500
commit1a0c64219df1fe4f8c40ed2ecaa0da1b4e0e26f7 (patch)
tree02518fbf1d3cb746a4947623ec1bf5c233f1d9ff /arch/powerpc/cpu/mpc85xx/liodn.c
parentf5b9e736418422f9f3501b9854294b38275f4abd (diff)
powerpc/85xx: Update setting of SRIO LIODNs
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>
Diffstat (limited to 'arch/powerpc/cpu/mpc85xx/liodn.c')
-rw-r--r--arch/powerpc/cpu/mpc85xx/liodn.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/liodn.c b/arch/powerpc/cpu/mpc85xx/liodn.c
index e0ea502a05f..e14de9dc960 100644
--- a/arch/powerpc/cpu/mpc85xx/liodn.c
+++ b/arch/powerpc/cpu/mpc85xx/liodn.c
@@ -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);