Mon Mar 29 13:14:14 2021 UTC ()
Make VIRTEX_* kernels compile. Not tested.


(rin)
diff -r1.5 -r1.6 src/sys/arch/evbppc/virtex/autoconf.c
diff -r1.3 -r1.4 src/sys/arch/evbppc/virtex/consinit.c
diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/design_gsrd2.c
diff -r1.25 -r1.26 src/sys/arch/evbppc/virtex/machdep.c
diff -r1.16 -r1.17 src/sys/arch/evbppc/virtex/dev/if_temac.c
diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/dev/tft_ll.c

cvs diff -r1.5 -r1.6 src/sys/arch/evbppc/virtex/autoconf.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/autoconf.c 2012/07/29 18:05:42 1.5
+++ src/sys/arch/evbppc/virtex/autoconf.c 2021/03/29 13:14:13 1.6
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.5 2012/07/29 18:05:42 mlelstv Exp $ */
+/*	$NetBSD: autoconf.c,v 1.6 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2012/07/29 18:05:42 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.6 2021/03/29 13:14:13 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -76,7 +76,7 @@
 
 
 /* List of port-specific devices to attach to the processor local bus. */
-static const struct plb_dev local_plb_devs [] = {
+static struct plb_dev local_plb_devs [] = {
 	{ XILVIRTEX, "xcvbus" },
 	{ 0, NULL }
 };

cvs diff -r1.3 -r1.4 src/sys/arch/evbppc/virtex/consinit.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/consinit.c 2011/07/01 19:03:50 1.3
+++ src/sys/arch/evbppc/virtex/consinit.c 2021/03/29 13:14:13 1.4
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.3 2011/07/01 19:03:50 dyoung Exp $ */
+/*	$NetBSD: consinit.c,v 1.4 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -33,7 +33,7 @@
 #include "xlcom.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2011/07/01 19:03:50 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.4 2021/03/29 13:14:13 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,7 +54,6 @@
 #endif
 #endif
 
-struct consdev 		*cn_tab = NULL;
 bus_space_tag_t 	consdev_iot;
 bus_space_handle_t 	consdev_ioh;
 

cvs diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/design_gsrd2.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/design_gsrd2.c 2011/06/18 06:44:27 1.4
+++ src/sys/arch/evbppc/virtex/design_gsrd2.c 2021/03/29 13:14:13 1.5
@@ -1,4 +1,4 @@
-/* 	$NetBSD: design_gsrd2.c,v 1.4 2011/06/18 06:44:27 matt Exp $ */
+/* 	$NetBSD: design_gsrd2.c,v 1.5 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -32,7 +32,7 @@
 #include "opt_virtex.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: design_gsrd2.c,v 1.4 2011/06/18 06:44:27 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: design_gsrd2.c,v 1.5 2021/03/29 13:14:13 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -96,6 +96,7 @@
  * DCR bus space leaf access routines.
  */
 
+#ifndef DESIGN_DFC
 static void
 tft0_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr,
     uint32_t val)
@@ -124,6 +125,7 @@
 
 	return (val);
 }
+#endif /* !DESIGN_DFC */
 
 static void
 tft1_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr,
@@ -232,9 +234,11 @@
 	DCR_BST_BODY(DCR_TEMAC_BASE, temac_read_4, temac_write_4)
 };
 
+#ifndef DESIGN_DFC
 static const struct powerpc_bus_space tft0_bst = {
 	DCR_BST_BODY(DCR_TFT0_BASE, tft0_read_4, tft0_write_4)
 };
+#endif
 
 static const struct powerpc_bus_space tft1_bst = {
 	DCR_BST_BODY(DCR_TFT1_BASE, tft1_read_4, tft1_write_4)

cvs diff -r1.25 -r1.26 src/sys/arch/evbppc/virtex/machdep.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/machdep.c 2020/06/11 19:20:43 1.25
+++ src/sys/arch/evbppc/virtex/machdep.c 2021/03/29 13:14:13 1.26
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.25 2020/06/11 19:20:43 ad Exp $ */
+/*	$NetBSD: machdep.c,v 1.26 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 2020/06/11 19:20:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.26 2021/03/29 13:14:13 rin Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -100,7 +100,6 @@
 char machine_arch[] = MACHINE_ARCH;	/* from <machine/param.h> */
 
 char bootpath[256];
-vaddr_t msgbuf_vaddr;
 
 void initppc(vaddr_t, vaddr_t);
 

cvs diff -r1.16 -r1.17 src/sys/arch/evbppc/virtex/dev/if_temac.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/dev/if_temac.c 2020/02/04 07:36:04 1.16
+++ src/sys/arch/evbppc/virtex/dev/if_temac.c 2021/03/29 13:14:13 1.17
@@ -1,4 +1,4 @@
-/* 	$NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $ */
+/* 	$NetBSD: if_temac.c,v 1.17 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.17 2021/03/29 13:14:13 rin Exp $");
 
 
 #include <sys/param.h>
@@ -230,7 +230,7 @@
 static inline void 	gmi_write_4(uint32_t, uint32_t);
 static inline void 	gmi_read_8(uint32_t, uint32_t *, uint32_t *);
 static inline uint32_t 	gmi_read_4(uint32_t);
-static inline void 	hif_wait_stat(uint32_t);
+static inline int 	hif_wait_stat(uint32_t);
 
 #define cdmac_rx_stat(sc) \
     bus_space_read_4((sc)->sc_dma_rxt, (sc)->sc_dma_rsh, 0 /* XXX hack */)
@@ -1029,7 +1029,7 @@
 		m_freem(txs->txs_mbuf);
 		txs->txs_mbuf = NULL;
 
-		sc->sc_if.if_opackets++;
+		if_statinc(&sc->sc_if, if_opackets);
 		sent = 1;
 
 		sc->sc_txsreap = TEMAC_TXSNEXT(sc->sc_txsreap);

cvs diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/dev/tft_ll.c (expand / switch to context diff)
--- src/sys/arch/evbppc/virtex/dev/tft_ll.c 2011/07/01 19:03:50 1.4
+++ src/sys/arch/evbppc/virtex/dev/tft_ll.c 2021/03/29 13:14:13 1.5
@@ -1,4 +1,4 @@
-/* 	$NetBSD: tft_ll.c,v 1.4 2011/07/01 19:03:50 dyoung Exp $ */
+/* 	$NetBSD: tft_ll.c,v 1.5 2021/03/29 13:14:13 rin Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tft_ll.c,v 1.4 2011/07/01 19:03:50 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tft_ll.c,v 1.5 2021/03/29 13:14:13 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,7 +60,9 @@
 struct ll_tft_control {
 	struct cdmac_descr      cd_dsc;
 	u_char                  cd_img[];
-} __packed;
+};
+
+CTASSERT(offsetof(struct ll_tft_control, cd_img) == sizeof(struct cdmac_descr));
 
 struct ll_tft_softc {
 	struct tft_softc 	lsc_sc;