diff options
Diffstat (limited to 'include/asm-ppc/ibm_ocp.h')
-rw-r--r-- | include/asm-ppc/ibm_ocp.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index 6f10a25bd628..9c21de1ff4ed 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h | |||
@@ -131,9 +131,22 @@ static inline void ibm_ocp_set_emac(int start, int end) | |||
131 | /* Copy MAC addresses to EMAC additions */ | 131 | /* Copy MAC addresses to EMAC additions */ |
132 | for (i=start; i<=end; i++) { | 132 | for (i=start; i<=end; i++) { |
133 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); | 133 | def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, i); |
134 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | 134 | if (i == 0) |
135 | &__res.bi_enetaddr[i], | 135 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, |
136 | 6); | 136 | __res.bi_enetaddr, 6); |
137 | #if defined(CONFIG_405EP) || defined(CONFIG_44x) | ||
138 | else if (i == 1) | ||
139 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
140 | __res.bi_enet1addr, 6); | ||
141 | #endif | ||
142 | #if defined(CONFIG_440GX) | ||
143 | else if (i == 2) | ||
144 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
145 | __res.bi_enet2addr, 6); | ||
146 | else if (i == 3) | ||
147 | memcpy(((struct ocp_func_emac_data *)def->additions)->mac_addr, | ||
148 | __res.bi_enet3addr, 6); | ||
149 | #endif | ||
137 | } | 150 | } |
138 | } | 151 | } |
139 | #endif | 152 | #endif |