CVS commit: src/sys/arch/arm/at91

2023-05-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat May  6 21:37:37 UTC 2023

Modified Files:
src/sys/arch/arm/at91: at91twireg.h

Log Message:
s/Registre/Register/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/at91/at91twireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91twireg.h
diff -u src/sys/arch/arm/at91/at91twireg.h:1.2 src/sys/arch/arm/at91/at91twireg.h:1.3
--- src/sys/arch/arm/at91/at91twireg.h:1.2	Thu Jul  3 01:15:38 2008
+++ src/sys/arch/arm/at91/at91twireg.h	Sat May  6 21:37:37 2023
@@ -1,5 +1,5 @@
-/*	$Id: at91twireg.h,v 1.2 2008/07/03 01:15:38 matt Exp $	*/
-/*	$NetBSD: at91twireg.h,v 1.2 2008/07/03 01:15:38 matt Exp $	*/
+/*	$Id: at91twireg.h,v 1.3 2023/05/06 21:37:37 andvar Exp $	*/
+/*	$NetBSD: at91twireg.h,v 1.3 2023/05/06 21:37:37 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2007 Embedtronics Oy.
@@ -54,7 +54,7 @@
 #define	TWI_RHR		0x30U	/* 0x30: Receive Holding Register	*/
 #define	TWI_THR		0x34U	/* 0x34: Transmit Holding Register	*/
 
-/* Control Registre bits: */
+/* Control Register bits: */
 #define	TWI_CR_SWRST	0x80U	/* 1 = do software reset		*/
 #define	TWI_CR_MSDIS	0x08U	/* 1 = disable master mode		*/
 #define	TWI_CR_MSEN	0x04U	/* 1 = enable master mode		*/



CVS commit: src/sys/arch/arm/at91

2023-05-06 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat May  6 21:37:37 UTC 2023

Modified Files:
src/sys/arch/arm/at91: at91twireg.h

Log Message:
s/Registre/Register/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/at91/at91twireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/at91

2022-09-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Sep 27 06:34:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91cf.c

Log Message:
malloc -> kmem


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/at91/at91cf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91cf.c
diff -u src/sys/arch/arm/at91/at91cf.c:1.7 src/sys/arch/arm/at91/at91cf.c:1.8
--- src/sys/arch/arm/at91/at91cf.c:1.7	Sat Aug  7 16:18:43 2021
+++ src/sys/arch/arm/at91/at91cf.c	Tue Sep 27 06:34:44 2022
@@ -1,5 +1,5 @@
-/*	$Id: at91cf.c,v 1.7 2021/08/07 16:18:43 thorpej Exp $	*/
-/*	$NetBSD: at91cf.c,v 1.7 2021/08/07 16:18:43 thorpej Exp $	*/
+/*	$Id: at91cf.c,v 1.8 2022/09/27 06:34:44 skrll Exp $	*/
+/*	$NetBSD: at91cf.c,v 1.8 2022/09/27 06:34:44 skrll Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@@ -30,12 +30,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91cf.c,v 1.7 2021/08/07 16:18:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91cf.c,v 1.8 2022/09/27 06:34:44 skrll Exp $");
 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -174,7 +174,7 @@ at91cf_attach_common(device_t parent, de
 	printf("\n");
 
 	/* socket 0 */
-	ph = malloc(sizeof(struct at91cf_handle), M_DEVBUF, M_WAITOK|M_ZERO);
+	ph = kmem_zalloc(sizeof(*ph), KM_SLEEP);
 	sc->sc_ph = ph;
 	ph->ph_sc = sc;
 	ph->ph_space[IO].base = sa->sa_addr + IO_BASE;



CVS commit: src/sys/arch/arm/at91

2022-09-27 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Sep 27 06:34:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91cf.c

Log Message:
malloc -> kmem


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/at91/at91cf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/at91

2022-09-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Sep 17 19:32:01 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91emac.c at91emacvar.h

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/at91/at91emac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91emacvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91emac.c
diff -u src/sys/arch/arm/at91/at91emac.c:1.33 src/sys/arch/arm/at91/at91emac.c:1.34
--- src/sys/arch/arm/at91/at91emac.c:1.33	Thu Nov  4 06:57:51 2021
+++ src/sys/arch/arm/at91/at91emac.c	Sat Sep 17 19:32:01 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $	*/
+/*	$NetBSD: at91emac.c,v 1.34 2022/09/17 19:32:01 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.34 2022/09/17 19:32:01 thorpej Exp $");
 
 #include 
 #include 
@@ -180,7 +180,6 @@ emac_attach(device_t parent, device_t se
 static int
 emac_gctx(struct emac_softc *sc)
 {
-	struct ifnet * ifp = >sc_ec.ec_if;
 	uint32_t tsr;
 
 	tsr = EMAC_READ(ETH_TSR);
@@ -204,8 +203,8 @@ emac_gctx(struct emac_softc *sc)
 	}
 
 	// mark we're free
-	if (ifp->if_flags & IFF_OACTIVE) {
-		ifp->if_flags &= ~IFF_OACTIVE;
+	if (sc->tx_busy) {
+		sc->tx_busy = false;
 		/* Disable transmit-buffer-free interrupt */
 		/*EMAC_WRITE(ETH_IDR, ETH_ISR_TBRE);*/
 	}
@@ -615,7 +614,7 @@ start:
 	if (emac_gctx(sc) == 0) {
 		/* Enable transmit-buffer-free interrupt */
 		EMAC_WRITE(ETH_IER, ETH_ISR_TBRE);
-		ifp->if_flags |= IFF_OACTIVE;
+		sc->tx_busy = true;
 		ifp->if_timer = 10;
 		splx(s);
 		return;
@@ -754,7 +753,7 @@ emac_ifstop(struct ifnet *ifp, int disab
 	/* Down the MII. */
 	mii_down(>sc_mii);
 
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
 	sc->sc_mii.mii_media_status &= ~IFM_ACTIVE;
 }

Index: src/sys/arch/arm/at91/at91emacvar.h
diff -u src/sys/arch/arm/at91/at91emacvar.h:1.3 src/sys/arch/arm/at91/at91emacvar.h:1.4
--- src/sys/arch/arm/at91/at91emacvar.h:1.3	Fri Oct 23 06:53:13 2009
+++ src/sys/arch/arm/at91/at91emacvar.h	Sat Sep 17 19:32:01 2022
@@ -1,5 +1,5 @@
-/*	$Id: at91emacvar.h,v 1.3 2009/10/23 06:53:13 snj Exp $	*/
-/*  $NetBSD: at91emacvar.h,v 1.3 2009/10/23 06:53:13 snj Exp $	*/
+/*	$Id: at91emacvar.h,v 1.4 2022/09/17 19:32:01 thorpej Exp $	*/
+/*  $NetBSD: at91emacvar.h,v 1.4 2022/09/17 19:32:01 thorpej Exp $	*/
 /*-
  * Copyright (c) 2007 Embedtronics Oy
  * All rights reserved
@@ -63,6 +63,7 @@ struct emac_softc {
 	int			txqi, txqc;
 	struct emac_qmeta	txq[TX_QLEN];
 	callout_t		emac_tick_ch;
+	bool			tx_busy;
 };
 
 #endif /* _AT91EMACVAR_H_ */



CVS commit: src/sys/arch/arm/at91

2022-09-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Sep 17 19:32:01 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91emac.c at91emacvar.h

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/at91/at91emac.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91emacvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/at91

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:39:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91usartreg.h

Log Message:
s/Errorrs/Errors/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91usartreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91usartreg.h
diff -u src/sys/arch/arm/at91/at91usartreg.h:1.3 src/sys/arch/arm/at91/at91usartreg.h:1.4
--- src/sys/arch/arm/at91/at91usartreg.h:1.3	Fri Oct 23 06:53:13 2009
+++ src/sys/arch/arm/at91/at91usartreg.h	Sun Feb 13 00:39:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91usartreg.h,v 1.3 2009/10/23 06:53:13 snj Exp $	*/
+/*	$NetBSD: at91usartreg.h,v 1.4 2022/02/13 00:39:45 andvar Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@@ -40,7 +40,7 @@
 #define	US_RTOR		0x24U	/* 0x24: Receiver Time-out Reg	*/
 #define	US_TTGR		0x28U	/* 0x28: Transmitter Timeguard Reg */
 #define	US_FIDI		0x40U	/* 0x40: FI DI Ratio Register	*/
-#define	US_NER		0x44U	/* 0x44: Number of Errorrs Reg	*/
+#define	US_NER		0x44U	/* 0x44: Number of Errors Reg	*/
 #define	US_IF		0x4CU	/* 0x4C: IrDA Filter Register	*/
 #define	US_PDC		0x100U	/* 0x100: PDC			*/
 



CVS commit: src/sys/arch/arm/at91

2022-02-12 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Feb 13 00:39:45 UTC 2022

Modified Files:
src/sys/arch/arm/at91: at91usartreg.h

Log Message:
s/Errorrs/Errors/


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/at91/at91usartreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/at91

2021-11-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov  4 06:57:51 UTC 2021

Modified Files:
src/sys/arch/arm/at91: at91emac.c

Log Message:
Remove unnecessary duplicate bit define in mask

PR port-arm/50687


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/at91/at91emac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/arm/at91

2021-11-04 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov  4 06:57:51 UTC 2021

Modified Files:
src/sys/arch/arm/at91: at91emac.c

Log Message:
Remove unnecessary duplicate bit define in mask

PR port-arm/50687


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/arm/at91/at91emac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91emac.c
diff -u src/sys/arch/arm/at91/at91emac.c:1.32 src/sys/arch/arm/at91/at91emac.c:1.33
--- src/sys/arch/arm/at91/at91emac.c:1.32	Wed Feb 19 02:51:54 2020
+++ src/sys/arch/arm/at91/at91emac.c	Thu Nov  4 06:57:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: at91emac.c,v 1.32 2020/02/19 02:51:54 thorpej Exp $	*/
+/*	$NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.32 2020/02/19 02:51:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.33 2021/11/04 06:57:51 skrll Exp $");
 
 #include 
 #include 
@@ -774,7 +774,7 @@ emac_setaddr(struct ifnet *ifp)
 	/* disable receiver temporarily */
 	EMAC_WRITE(ETH_CTL, ctl & ~ETH_CTL_RE);
 
-	cfg &= ~(ETH_CFG_MTI | ETH_CFG_UNI | ETH_CFG_CAF | ETH_CFG_UNI);
+	cfg &= ~(ETH_CFG_MTI | ETH_CFG_UNI | ETH_CFG_CAF);
 
 	if (ifp->if_flags & IFF_PROMISC) {
 		cfg |=	ETH_CFG_CAF;



CVS commit: src/sys/arch/arm/at91

2019-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 23 16:05:01 UTC 2019

Modified Files:
src/sys/arch/arm/at91: at91emac.c

Log Message:
- Fix compile error (remove unused variable).
- KNF.
- ac -> ec
- Remove extra RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/at91/at91emac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/at91/at91emac.c
diff -u src/sys/arch/arm/at91/at91emac.c:1.27 src/sys/arch/arm/at91/at91emac.c:1.28
--- src/sys/arch/arm/at91/at91emac.c:1.27	Thu May 23 13:10:50 2019
+++ src/sys/arch/arm/at91/at91emac.c	Thu May 23 16:05:01 2019
@@ -1,5 +1,4 @@
-/*	$Id: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $	*/
-/*	$NetBSD: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $	*/
+/*	$NetBSD: at91emac.c,v 1.28 2019/05/23 16:05:01 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2007 Embedtronics Oy
@@ -33,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.27 2019/05/23 13:10:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91emac.c,v 1.28 2019/05/23 16:05:01 msaitoh Exp $");
 
 #include 
 #include 
@@ -608,7 +607,6 @@ emac_tick(void *arg)
 static int
 emac_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-	struct emac_softc *sc = ifp->if_softc;
 	int s, error;
 
 	s = splnet();
@@ -786,7 +784,7 @@ static void
 emac_setaddr(struct ifnet *ifp)
 {
 	struct emac_softc *sc = ifp->if_softc;
-	struct ethercom *ac = >sc_ec;
+	struct ethercom *ec = >sc_ec;
 	struct ether_multi *enm;
 	struct ether_multistep step;
 	uint8_t ias[3][ETHER_ADDR_LEN];
@@ -809,7 +807,7 @@ emac_setaddr(struct ifnet *ifp)
 
 	ifp->if_flags &= ~IFF_ALLMULTI;
 
-	ETHER_FIRST_MULTI(step, ac, enm);
+	ETHER_FIRST_MULTI(step, ec, enm);
 	while (enm != NULL) {
 		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
 			/*
@@ -858,9 +856,10 @@ emac_setaddr(struct ifnet *ifp)
 	EMAC_WRITE(ETH_SA1H, (sc->sc_enaddr[5] << 8)
 		   | (sc->sc_enaddr[4]));
 	if (nma > 1) {
-		DPRINTFN(1,("%s: en1 %02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
-		   ias[0][0], ias[0][1], ias[0][2],
-		   ias[0][3], ias[0][4], ias[0][5]));
+		DPRINTFN(1,("%s: en1 %02x:%02x:%02x:%02x:%02x:%02x\n",
+			__FUNCTION__,
+			ias[0][0], ias[0][1], ias[0][2],
+			ias[0][3], ias[0][4], ias[0][5]));
 		EMAC_WRITE(ETH_SA2L, (ias[0][3] << 24)
 			   | (ias[0][2] << 16) | (ias[0][1] << 8)
 			   | (ias[0][0]));
@@ -868,9 +867,10 @@ emac_setaddr(struct ifnet *ifp)
 			   | (ias[0][5]));
 	}
 	if (nma > 2) {
-		DPRINTFN(1,("%s: en2 %02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
-		   ias[1][0], ias[1][1], ias[1][2],
-		   ias[1][3], ias[1][4], ias[1][5]));
+		DPRINTFN(1,("%s: en2 %02x:%02x:%02x:%02x:%02x:%02x\n",
+			__FUNCTION__,
+			ias[1][0], ias[1][1], ias[1][2],
+			ias[1][3], ias[1][4], ias[1][5]));
 		EMAC_WRITE(ETH_SA3L, (ias[1][3] << 24)
 			   | (ias[1][2] << 16) | (ias[1][1] << 8)
 			   | (ias[1][0]));
@@ -878,9 +878,10 @@ emac_setaddr(struct ifnet *ifp)
 			   | (ias[1][5]));
 	}
 	if (nma > 3) {
-		DPRINTFN(1,("%s: en3 %02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
-		   ias[2][0], ias[2][1], ias[2][2],
-		   ias[2][3], ias[2][4], ias[2][5]));
+		DPRINTFN(1,("%s: en3 %02x:%02x:%02x:%02x:%02x:%02x\n",
+			__FUNCTION__,
+			ias[2][0], ias[2][1], ias[2][2],
+			ias[2][3], ias[2][4], ias[2][5]));
 		EMAC_WRITE(ETH_SA3L, (ias[2][3] << 24)
 			   | (ias[2][2] << 16) | (ias[2][1] << 8)
 			   | (ias[2][0]));



CVS commit: src/sys/arch/arm/at91

2019-05-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 23 16:05:01 UTC 2019

Modified Files:
src/sys/arch/arm/at91: at91emac.c

Log Message:
- Fix compile error (remove unused variable).
- KNF.
- ac -> ec
- Remove extra RCS Id.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/at91/at91emac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.