[Midnightbsd-cvs] src [12397] sync with freebsd 11

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Mar 6 12:12:55 EST 2020


Revision: 12397
          http://svnweb.midnightbsd.org/src/?rev=12397
Author:   laffer1
Date:     2020-03-06 12:12:55 -0500 (Fri, 06 Mar 2020)
Log Message:
-----------
sync with freebsd 11

Modified Paths:
--------------
    trunk/sys/arm/lpc/files.lpc
    trunk/sys/arm/lpc/if_lpe.c
    trunk/sys/arm/lpc/if_lpereg.h
    trunk/sys/arm/lpc/lpc_dmac.c
    trunk/sys/arm/lpc/lpc_fb.c
    trunk/sys/arm/lpc/lpc_gpio.c
    trunk/sys/arm/lpc/lpc_intc.c
    trunk/sys/arm/lpc/lpc_machdep.c
    trunk/sys/arm/lpc/lpc_mmc.c
    trunk/sys/arm/lpc/lpc_ohci.c
    trunk/sys/arm/lpc/lpc_pll.c
    trunk/sys/arm/lpc/lpc_pwr.c
    trunk/sys/arm/lpc/lpc_rtc.c
    trunk/sys/arm/lpc/lpc_spi.c
    trunk/sys/arm/lpc/lpc_timer.c
    trunk/sys/arm/lpc/lpcreg.h
    trunk/sys/arm/lpc/lpcvar.h
    trunk/sys/arm/lpc/ssd1289.c
    trunk/sys/arm/lpc/std.lpc

Property Changed:
----------------
    trunk/sys/arm/lpc/files.lpc
    trunk/sys/arm/lpc/std.lpc

Modified: trunk/sys/arm/lpc/files.lpc
===================================================================
--- trunk/sys/arm/lpc/files.lpc	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/files.lpc	2020-03-06 17:12:55 UTC (rev 12397)
@@ -1,8 +1,4 @@
-# $FreeBSD: stable/10/sys/arm/lpc/files.lpc 278727 2015-02-13 22:32:02Z ian $
-arm/arm/bus_space_base.c		standard
-arm/arm/bus_space_generic.c		standard
-arm/arm/cpufunc_asm_arm9.S		standard
-arm/arm/cpufunc_asm_armv5.S		standard
+# $MidnightBSD$
 arm/lpc/lpc_machdep.c			standard
 arm/lpc/lpc_pwr.c			standard
 arm/lpc/lpc_intc.c			standard


Property changes on: trunk/sys/arm/lpc/files.lpc
___________________________________________________________________
Deleted: mnbsd:nokeywords
## -1 +0,0 ##
-MidnightBSD=%H
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sys/arm/lpc/if_lpe.c
===================================================================
--- trunk/sys/arm/lpc/if_lpe.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/if_lpe.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/if_lpe.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/if_lpe.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/endian.h>
@@ -173,7 +173,7 @@
 
 #define	lpe_lock(_sc)		mtx_lock(&(_sc)->lpe_mtx)
 #define	lpe_unlock(_sc)		mtx_unlock(&(_sc)->lpe_mtx)
-#define	lpe_lock_assert(sc)	mtx_assert(&(_sc)->lpe_mtx, MA_OWNED)
+#define	lpe_lock_assert(_sc)	mtx_assert(&(_sc)->lpe_mtx, MA_OWNED)
 
 #define	lpe_read_4(_sc, _reg)		\
     bus_space_read_4((_sc)->lpe_bst, (_sc)->lpe_bsh, (_reg))
@@ -755,7 +755,7 @@
 
 		/* Check received frame for errors */
 		if (hws->lhs_info & LPE_HWDESC_RXERRS) {
-			ifp->if_ierrors++;
+			if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
 			lpe_discard_rxbuf(sc, cons);
 			lpe_init_rxbuf(sc, cons);
 			goto skip;
@@ -765,7 +765,7 @@
 		m->m_pkthdr.rcvif = ifp;
 		m->m_data += 2;
 
-		ifp->if_ipackets++;
+		if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
 
 		lpe_unlock(sc);
 		(*ifp->if_input)(ifp, m);	
@@ -801,12 +801,12 @@
 		bus_dmamap_sync(sc->lpe_cdata.lpe_tx_buf_tag,
 		    txd->lpe_txdesc_dmamap, BUS_DMASYNC_POSTWRITE);
 
-		ifp->if_collisions += LPE_HWDESC_COLLISIONS(hws->lhs_info);
+		if_inc_counter(ifp, IFCOUNTER_COLLISIONS, LPE_HWDESC_COLLISIONS(hws->lhs_info));
 
 		if (hws->lhs_info & LPE_HWDESC_TXERRS)
-			ifp->if_oerrors++;
+			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
 		else
-			ifp->if_opackets++;
+			if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
 
 		if (txd->lpe_txdesc_first) {
 			bus_dmamap_unload(sc->lpe_cdata.lpe_tx_buf_tag,

Modified: trunk/sys/arm/lpc/if_lpereg.h
===================================================================
--- trunk/sys/arm/lpc/if_lpereg.h	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/if_lpereg.h	2020-03-06 17:12:55 UTC (rev 12397)
@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: stable/10/sys/arm/lpc/if_lpereg.h 261455 2014-02-04 03:36:42Z eadler $
+ * $FreeBSD: stable/11/sys/arm/lpc/if_lpereg.h 331722 2018-03-29 02:50:57Z eadler $
  */
 
 #ifndef	_ARM_LPC_IF_LPEREG_H

Modified: trunk/sys/arm/lpc/lpc_dmac.c
===================================================================
--- trunk/sys/arm/lpc/lpc_dmac.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_dmac.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_dmac.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_dmac.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: trunk/sys/arm/lpc/lpc_fb.c
===================================================================
--- trunk/sys/arm/lpc/lpc_fb.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_fb.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_fb.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_fb.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,12 +50,9 @@
 #include <sys/kdb.h>
 
 #include <machine/bus.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
 #include <machine/resource.h>
 #include <machine/intr.h>
 
-#include <dev/fdt/fdt_common.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
@@ -283,10 +280,9 @@
 static int
 lpc_fb_fdt_read(phandle_t node, const char *name, uint32_t *ret)
 {
-	if (OF_getprop(node, name, ret, sizeof(uint32_t)) <= 0)
+	if (OF_getencprop(node, name, ret, sizeof(uint32_t)) <= 0)
 		return (ENOENT);
 
-	*ret = fdt32_to_cpu(*ret);
 	return (0);
 }
 

Modified: trunk/sys/arm/lpc/lpc_gpio.c
===================================================================
--- trunk/sys/arm/lpc/lpc_gpio.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_gpio.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -51,7 +51,7 @@
 
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_gpio.c 278782 2015-02-14 20:37:33Z loos $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_gpio.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,12 +74,11 @@
 #include <sys/gpio.h>
 
 #include <machine/bus.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
 #include <machine/resource.h>
 #include <machine/intr.h>
 #include <machine/fdt.h>
 
+#include <dev/gpio/gpiobusvar.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
@@ -91,6 +90,7 @@
 struct lpc_gpio_softc
 {
 	device_t		lg_dev;
+	device_t		lg_busdev;
 	struct resource *	lg_res;
 	bus_space_tag_t		lg_bst;
 	bus_space_handle_t	lg_bsh;
@@ -136,6 +136,7 @@
 static int lpc_gpio_attach(device_t);
 static int lpc_gpio_detach(device_t);
 
+static device_t lpc_gpio_get_bus(device_t);
 static int lpc_gpio_pin_max(device_t, int *);
 static int lpc_gpio_pin_getcaps(device_t, uint32_t, uint32_t *);
 static int lpc_gpio_pin_getflags(device_t, uint32_t, uint32_t *);
@@ -193,10 +194,13 @@
 
 	lpc_gpio_sc = sc;
 
-	device_add_child(dev, "gpioc", -1);
-	device_add_child(dev, "gpiobus", -1);
+	sc->lg_busdev = gpiobus_attach_bus(dev);
+	if (sc->lg_busdev == NULL) {
+		bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->lg_res);
+		return (ENXIO);
+	}
 
-	return (bus_generic_attach(dev));
+	return (0);
 }
 
 static int
@@ -205,6 +209,16 @@
 	return (EBUSY);
 }
 
+static device_t
+lpc_gpio_get_bus(device_t dev)
+{
+	struct lpc_gpio_softc *sc;
+
+	sc = device_get_softc(dev);
+
+	return (sc->lg_busdev);
+}
+
 static int
 lpc_gpio_pin_max(device_t dev, int *npins)
 {
@@ -505,7 +519,7 @@
 }
 
 void
-platform_gpio_init()
+lpc_gpio_init(void)
 {
 	bus_space_tag_t bst;
 	bus_space_handle_t bsh;
@@ -528,6 +542,7 @@
 	DEVMETHOD(device_detach,	lpc_gpio_detach),
 
 	/* GPIO interface */
+	DEVMETHOD(gpio_get_bus,		lpc_gpio_get_bus),
 	DEVMETHOD(gpio_pin_max,		lpc_gpio_pin_max),
 	DEVMETHOD(gpio_pin_getcaps,	lpc_gpio_pin_getcaps),
 	DEVMETHOD(gpio_pin_getflags,	lpc_gpio_pin_getflags),

Modified: trunk/sys/arm/lpc/lpc_intc.c
===================================================================
--- trunk/sys/arm/lpc/lpc_intc.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_intc.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_intc.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_intc.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,10 +60,10 @@
 
 static struct lpc_intc_softc *intc_softc = NULL;
 
-#define	intc_read_4(reg)		\
-    bus_space_read_4(intc_softc->li_bst, intc_softc->li_bsh, reg)
-#define	intc_write_4(reg, val)		\
-    bus_space_write_4(intc_softc->li_bst, intc_softc->li_bsh, reg, val)
+#define	intc_read_4(_sc, _reg)		\
+    bus_space_read_4((_sc)->li_bst, (_sc)->li_bsh, (_reg))
+#define	intc_write_4(_sc, _reg, _val)		\
+    bus_space_write_4((_sc)->li_bst, (_sc)->li_bsh, (_reg), (_val))
 
 static int
 lpc_intc_probe(device_t dev)
@@ -101,12 +101,12 @@
 	arm_post_filter = lpc_intc_eoi;
 
 	/* Clear interrupt status registers and disable all interrupts */
-	intc_write_4(LPC_INTC_MIC_ER, 0);
-	intc_write_4(LPC_INTC_SIC1_ER, 0);
-	intc_write_4(LPC_INTC_SIC2_ER, 0);
-	intc_write_4(LPC_INTC_MIC_RSR, ~0);
-	intc_write_4(LPC_INTC_SIC1_RSR, ~0);
-	intc_write_4(LPC_INTC_SIC2_RSR, ~0);
+	intc_write_4(sc, LPC_INTC_MIC_ER, 0);
+	intc_write_4(sc, LPC_INTC_SIC1_ER, 0);
+	intc_write_4(sc, LPC_INTC_SIC2_ER, 0);
+	intc_write_4(sc, LPC_INTC_MIC_RSR, ~0);
+	intc_write_4(sc, LPC_INTC_SIC1_RSR, ~0);
+	intc_write_4(sc, LPC_INTC_SIC2_RSR, ~0);
 	return (0);
 }
 
@@ -129,11 +129,12 @@
 int
 arm_get_next_irq(int last)
 {
+	struct lpc_intc_softc *sc = intc_softc;
 	uint32_t value;
 	int i;
 
 	/* IRQs 0-31 are mapped to LPC_INTC_MIC_SR */
-	value = intc_read_4(LPC_INTC_MIC_SR);
+	value = intc_read_4(sc, LPC_INTC_MIC_SR);
 	for (i = 0; i < 32; i++) {
 		if (value & (1 << i))
 			return (i);
@@ -140,7 +141,7 @@
 	}
 
 	/* IRQs 32-63 are mapped to LPC_INTC_SIC1_SR */
-	value = intc_read_4(LPC_INTC_SIC1_SR);
+	value = intc_read_4(sc, LPC_INTC_SIC1_SR);
 	for (i = 0; i < 32; i++) {
 		if (value & (1 << i))
 			return (i + 32);
@@ -147,7 +148,7 @@
 	}
 
 	/* IRQs 64-95 are mapped to LPC_INTC_SIC2_SR */
-	value = intc_read_4(LPC_INTC_SIC2_SR);
+	value = intc_read_4(sc, LPC_INTC_SIC2_SR);
 	for (i = 0; i < 32; i++) {
 		if (value & (1 << i))
 			return (i + 64);
@@ -159,6 +160,7 @@
 void
 arm_mask_irq(uintptr_t nb)
 {
+	struct lpc_intc_softc *sc = intc_softc;
 	int reg;
 	uint32_t value;
 
@@ -175,14 +177,15 @@
 		reg = LPC_INTC_MIC_ER;
 
 	/* Clear bit in ER register */
-	value = intc_read_4(reg);
+	value = intc_read_4(sc, reg);
 	value &= ~(1 << nb);
-	intc_write_4(reg, value);
+	intc_write_4(sc, reg, value);
 }
 
 void
 arm_unmask_irq(uintptr_t nb)
 {
+	struct lpc_intc_softc *sc = intc_softc;
 	int reg;
 	uint32_t value;
 
@@ -196,14 +199,15 @@
 		reg = LPC_INTC_MIC_ER;
 
 	/* Set bit in ER register */
-	value = intc_read_4(reg);
+	value = intc_read_4(sc, reg);
 	value |= (1 << nb);
-	intc_write_4(reg, value);
+	intc_write_4(sc, reg, value);
 }
 
 static void
 lpc_intc_eoi(void *data)
 {
+	struct lpc_intc_softc *sc = intc_softc;
 	int reg;
 	int nb = (int)data;
 	uint32_t value;
@@ -218,16 +222,13 @@
 		reg = LPC_INTC_MIC_RSR;
 
 	/* Set bit in RSR register */
-	value = intc_read_4(reg);
+	value = intc_read_4(sc, reg);
 	value |= (1 << nb);
-	intc_write_4(reg, value);
+	intc_write_4(sc, reg, value);
 
 }
 
-struct fdt_fixup_entry fdt_fixup_table[] = {
-	{ NULL, NULL }
-};
-
+#ifndef INTRNG
 static int
 fdt_pic_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig,
     int *pol)
@@ -245,3 +246,4 @@
 	&fdt_pic_decode_ic,
 	NULL
 };
+#endif

Modified: trunk/sys/arm/lpc/lpc_machdep.c
===================================================================
--- trunk/sys/arm/lpc/lpc_machdep.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_machdep.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -40,12 +40,13 @@
 #include "opt_platform.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_machdep.c 266084 2014-05-14 19:18:58Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_machdep.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
+#include <sys/devmap.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -52,8 +53,8 @@
 
 #include <machine/bus.h>
 #include <machine/fdt.h>
-#include <machine/devmap.h>
 #include <machine/machdep.h>
+#include <machine/platform.h> 
 
 #include <arm/lpc/lpcreg.h>
 #include <arm/lpc/lpcvar.h>
@@ -61,29 +62,29 @@
 #include <dev/fdt/fdt_common.h>
 
 vm_offset_t
-initarm_lastaddr(void)
+platform_lastaddr(void)
 {
 
-	return (arm_devmap_lastaddr());
+	return (devmap_lastaddr());
 }
 
 void
-initarm_early_init(void)
+platform_probe_and_attach(void)
 {
 }
 
 void
-initarm_gpio_init(void)
+platform_gpio_init(void)
 {
 
 	/*
 	 * Set initial values of GPIO output ports
 	 */
-	platform_gpio_init();
+	lpc_gpio_init();
 }
 
 void
-initarm_late_init(void)
+platform_late_init(void)
 {
 }
 
@@ -90,13 +91,13 @@
 /*
  * Add a single static device mapping.
  * The values used were taken from the ranges property of the SoC node in the
- * dts file when this code was converted to arm_devmap_add_entry().
+ * dts file when this code was converted to devmap_add_entry().
  */
 int
-initarm_devmap_init(void)
+platform_devmap_init(void)
 {
 
-	arm_devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE);
+	devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE);
 	return (0);
 }
 

Modified: trunk/sys/arm/lpc/lpc_mmc.c
===================================================================
--- trunk/sys/arm/lpc/lpc_mmc.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_mmc.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_mmc.c 318198 2017-05-11 21:01:02Z marius $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_mmc.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -40,8 +40,6 @@
 #include <sys/rman.h>
 
 #include <machine/bus.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
 #include <machine/resource.h>
 #include <machine/intr.h>
 

Modified: trunk/sys/arm/lpc/lpc_ohci.c
===================================================================
--- trunk/sys/arm/lpc/lpc_ohci.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_ohci.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_ohci.c 278278 2015-02-05 20:03:02Z hselasky $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_ohci.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/stdint.h>
 #include <sys/stddef.h>

Modified: trunk/sys/arm/lpc/lpc_pll.c
===================================================================
--- trunk/sys/arm/lpc/lpc_pll.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_pll.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,4 +26,4 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_pll.c 239278 2012-08-15 05:37:10Z gonzo $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_pll.c 331722 2018-03-29 02:50:57Z eadler $");

Modified: trunk/sys/arm/lpc/lpc_pwr.c
===================================================================
--- trunk/sys/arm/lpc/lpc_pwr.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_pwr.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_pwr.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_pwr.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: trunk/sys/arm/lpc/lpc_rtc.c
===================================================================
--- trunk/sys/arm/lpc/lpc_rtc.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_rtc.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_rtc.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_rtc.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/bus.h>

Modified: trunk/sys/arm/lpc/lpc_spi.c
===================================================================
--- trunk/sys/arm/lpc/lpc_spi.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_spi.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_spi.c 266152 2014-05-15 16:11:06Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_spi.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -48,8 +48,6 @@
 #include <sys/watchdog.h>
 
 #include <machine/bus.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
 #include <machine/resource.h>
 #include <machine/intr.h>
 
@@ -144,12 +142,16 @@
 lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
 {
 	struct lpc_spi_softc *sc = device_get_softc(dev);
-	struct spibus_ivar *devi = SPIBUS_IVAR(child);
+	uint32_t cs;
 	uint8_t *in_buf, *out_buf;
 	int i;
 
+	spibus_get_cs(child, &cs);
+
+	cs &= ~SPIBUS_CS_HIGH;
+
 	/* Set CS active */
-	lpc_gpio_set_state(child, devi->cs, 0);
+	lpc_gpio_set_state(child, cs, 0);
 
 	/* Wait for FIFO to be ready */
 	while ((lpc_spi_read_4(sc, LPC_SSP_SR) & LPC_SSP_SR_TNF) == 0);
@@ -171,7 +173,7 @@
 	}
 
 	/* Set CS inactive */
-	lpc_gpio_set_state(child, devi->cs, 1);
+	lpc_gpio_set_state(child, cs, 1);
 
 	return (0);
 }

Modified: trunk/sys/arm/lpc/lpc_timer.c
===================================================================
--- trunk/sys/arm/lpc/lpc_timer.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpc_timer.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/lpc_timer.c 266207 2014-05-16 02:21:51Z ian $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/lpc_timer.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,7 +41,6 @@
 #include <machine/cpu.h>
 #include <machine/intr.h>
 
-#include <dev/fdt/fdt_common.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
@@ -159,7 +158,7 @@
 
 	/* Get PERIPH_CLK encoded in parent bus 'bus-frequency' property */
 	node = ofw_bus_get_node(dev);
-	if (OF_getprop(OF_parent(node), "bus-frequency", &freq,
+	if (OF_getencprop(OF_parent(node), "bus-frequency", &freq,
 	    sizeof(pcell_t)) <= 0) {
 		bus_release_resources(dev, lpc_timer_spec, sc->lt_res);
 		bus_teardown_intr(dev, sc->lt_res[2], intrcookie);
@@ -167,8 +166,6 @@
 		return (ENXIO);
 	}
 
-	freq = fdt32_to_cpu(freq);
-
 	/* Set desired frequency in event timer and timecounter */
 	sc->lt_et.et_frequency = (uint64_t)freq;
 	lpc_timecounter.tc_frequency = (uint64_t)freq;	

Modified: trunk/sys/arm/lpc/lpcreg.h
===================================================================
--- trunk/sys/arm/lpc/lpcreg.h	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpcreg.h	2020-03-06 17:12:55 UTC (rev 12397)
@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: stable/10/sys/arm/lpc/lpcreg.h 266084 2014-05-14 19:18:58Z ian $
+ * $FreeBSD: stable/11/sys/arm/lpc/lpcreg.h 331722 2018-03-29 02:50:57Z eadler $
  */
 
 #ifndef	_ARM_LPC_LPCREG_H

Modified: trunk/sys/arm/lpc/lpcvar.h
===================================================================
--- trunk/sys/arm/lpc/lpcvar.h	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/lpcvar.h	2020-03-06 17:12:55 UTC (rev 12397)
@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: stable/10/sys/arm/lpc/lpcvar.h 239278 2012-08-15 05:37:10Z gonzo $
+ * $FreeBSD: stable/11/sys/arm/lpc/lpcvar.h 331722 2018-03-29 02:50:57Z eadler $
  */
 
 #ifndef	_ARM_LPC_LPCVAR_H
@@ -39,7 +39,7 @@
 void lpc_pwr_write(device_t, int, uint32_t);
 
 /* GPIO */
-void platform_gpio_init(void);
+void lpc_gpio_init(void);
 int lpc_gpio_set_flags(device_t, int, int);
 int lpc_gpio_set_state(device_t, int, int);
 int lpc_gpio_get_state(device_t, int, int *);

Modified: trunk/sys/arm/lpc/ssd1289.c
===================================================================
--- trunk/sys/arm/lpc/ssd1289.c	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/ssd1289.c	2020-03-06 17:12:55 UTC (rev 12397)
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: stable/10/sys/arm/lpc/ssd1289.c 239278 2012-08-15 05:37:10Z gonzo $");
+__FBSDID("$FreeBSD: stable/11/sys/arm/lpc/ssd1289.c 331722 2018-03-29 02:50:57Z eadler $");
 
 #include <sys/param.h>
 #include <sys/systm.h>

Modified: trunk/sys/arm/lpc/std.lpc
===================================================================
--- trunk/sys/arm/lpc/std.lpc	2020-03-06 17:08:20 UTC (rev 12396)
+++ trunk/sys/arm/lpc/std.lpc	2020-03-06 17:12:55 UTC (rev 12397)
@@ -1,4 +1,4 @@
-# $FreeBSD: stable/10/sys/arm/lpc/std.lpc 266110 2014-05-15 02:41:23Z ian $
+# $MidnightBSD$
 #
 # DM644x
 #
@@ -9,6 +9,5 @@
 makeoptions	CONF_CFLAGS="-march=armv5te"
 options		PHYSADDR=0x80000000
 makeoptions	KERNPHYSADDR=0x80100000
-options		KERNPHYSADDR=0x80100000
 makeoptions	KERNVIRTADDR=0xc0100000
 options		KERNVIRTADDR=0xc0100000


Property changes on: trunk/sys/arm/lpc/std.lpc
___________________________________________________________________
Deleted: mnbsd:nokeywords
## -1 +0,0 ##
-MidnightBSD=%H
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list