From dc3155c1be5fbd19266af0a7e1c567b3369ff512 Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Mon, 5 Sep 2016 18:42:21 +0000 Subject: [PATCH] Revert r305119, move the control module register data to am335x_scm.h and fix if_cpsw.c to include the correct header. Discussed with: bz --- sys/arm/ti/am335x/am335x_scm.h | 2 ++ sys/arm/ti/cpsw/if_cpsw.c | 9 +++++---- sys/arm/ti/cpsw/if_cpswreg.h | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/arm/ti/am335x/am335x_scm.h b/sys/arm/ti/am335x/am335x_scm.h index 642620881f70..6116be063adf 100644 --- a/sys/arm/ti/am335x/am335x_scm.h +++ b/sys/arm/ti/am335x/am335x_scm.h @@ -42,6 +42,8 @@ #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 #define SCM_USB_STS1 0x62C +#define SCM_MAC_ID0_LO 0x630 +#define SCM_MAC_ID0_HI 0x634 #define SCM_PWMSS_CTRL 0x664 #endif /* __AM335X_SCM_H__ */ diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index 038d2d2089c1..27f187c05d68 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -87,8 +90,6 @@ __FBSDID("$FreeBSD$"); #include "if_cpswreg.h" #include "if_cpswvar.h" - -#include #include "miibus_if.h" @@ -1019,14 +1020,14 @@ cpswp_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ - ti_scm_reg_read_4(CPSW_MAC_ID0_HI + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_HI + sc->unit * 8, ®); mac_addr[0] = reg & 0xFF; mac_addr[1] = (reg >> 8) & 0xFF; mac_addr[2] = (reg >> 16) & 0xFF; mac_addr[3] = (reg >> 24) & 0xFF; /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ - ti_scm_reg_read_4(CPSW_MAC_ID0_LO + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_LO + sc->unit * 8, ®); mac_addr[4] = reg & 0xFF; mac_addr[5] = (reg >> 8) & 0xFF; diff --git a/sys/arm/ti/cpsw/if_cpswreg.h b/sys/arm/ti/cpsw/if_cpswreg.h index c6f3e89c4254..bea6f1904e3c 100644 --- a/sys/arm/ti/cpsw/if_cpswreg.h +++ b/sys/arm/ti/cpsw/if_cpswreg.h @@ -46,9 +46,6 @@ #define CPSW_PORT_P_SA_LO(p) (CPSW_PORT_OFFSET + 0x120 + ((p-1) * 0x100)) #define CPSW_PORT_P_SA_HI(p) (CPSW_PORT_OFFSET + 0x124 + ((p-1) * 0x100)) -#define CPSW_MAC_ID0_LO 0x0630 -#define CPSW_MAC_ID0_HI 0x0634 - #define CPSW_CPDMA_OFFSET 0x0800 #define CPSW_CPDMA_TX_CONTROL (CPSW_CPDMA_OFFSET + 0x04) #define CPSW_CPDMA_TX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x08)