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>
This commit is contained in:
parent
f5b9e73641
commit
1a0c64219d
arch/powerpc
@ -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);
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -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),
|
||||
|
@ -25,6 +25,26 @@
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user