Skip to contentSkip to conversation

powerpc: make MAL use the new DCR methods

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Oct 11, 2006 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: make MAL use the new DCR methods

This is a test patch to validate the new DCR method code for the "native" case. It will ultimately be the first of a pile porting the EMAC driver to ARCH=powerpc and non-native DCRs.

drivers/net/ibm_emac/ibm_emac_mal.h +4 -2
Index: linux-cell/drivers/net/ibm_emac/ibm_emac_mal.h
===================================================================
@@ -24,6 +24,7 @@
 #include <linux/netdevice.h>
 
 #include <asm/io.h>
+#include <asm/dcr.h>
 
 /*
  * These MAL "versions" probably aren't the real versions IBM uses for these 
@@ -191,6 +192,7 @@ struct mal_commac {
 
 struct ibm_ocp_mal {
 	int			dcrbase;
+	dcr_host_t		dcrhost;
 
 	struct list_head	poll_list;
 	struct net_device	poll_dev;
@@ -207,12 +209,12 @@ struct ibm_ocp_mal {
 
 static inline u32 get_mal_dcrn(struct ibm_ocp_mal *mal, int reg)
 {
-	return mfdcr(mal->dcrbase + reg);
+	return dcr_read(mal->dcrhost, mal->dcrbase + reg);
 }
 
 static inline void set_mal_dcrn(struct ibm_ocp_mal *mal, int reg, u32 val)
 {
-	mtdcr(mal->dcrbase + reg, val);
+	dcr_write(mal->dcrhost, mal->dcrbase + reg, val);
 }
 
 /* Register MAL devices */
Acked-by on v1 1/1
#1 lore raw
Quoted 33 lines · Benjamin Herrenschmidt

This is a test patch to validate the new DCR method code for the "native" case. It will ultimately be the first of a pile porting the EMAC driver to ARCH=powerpc and non-native DCRs.

Index: linux-cell/drivers/net/ibm_emac/ibm_emac_mal.h
===================================================================

drivers/net/ibm_emac/ibm_emac_mal.h +2 -1
@@ -24,6 +24,7 @@
 #include <linux/netdevice.h>
 
 #include <asm/io.h>
+#include <asm/dcr.h>
 
 /*
  * These MAL "versions" probably aren't the real versions IBM uses for these 
@@ -191,6 +192,7 @@ struct mal_commac {
 
 struct ibm_ocp_mal {
 	int			dcrbase;
+	dcr_host_t		dcrhost;
 
 	struct list_head	poll_list;
 	struct net_device	poll_dev;
@@ -207,12 +209,12 @@ struct ibm_ocp_mal {
 
 static inline u32 get_mal_dcrn(struct ibm_ocp_mal *mal, int reg)
 {
-	return mfdcr(mal->dcrbase + reg);

drivers/net/ibm_emac/ibm_emac_mal.h struct ibm_ocp_mal { · line 220

Quoted 10 lines
drivers/net/ibm_emac/ibm_emac_mal.h +2 -1
+	return dcr_read(mal->dcrhost, mal->dcrbase + reg);
 }
 
 static inline void set_mal_dcrn(struct ibm_ocp_mal *mal, int reg, u32 val)
 {
-	mtdcr(mal->dcrbase + reg, val);
+	dcr_write(mal->dcrhost, mal->dcrbase + reg, val);
 }
 
 /* Register MAL devices */

Looks fine to me.