svn commit: r368766 - head/sys/arm64/rockchip/clk

2020-12-18 Thread Emmanuel Vadot
Author: manu
Date: Fri Dec 18 16:55:54 2020
New Revision: 368766
URL: https://svnweb.freebsd.org/changeset/base/368766

Log:
  arm64: rk3399: Export the watchdog clock
  
  This clock is used by the watchdog IP and can be controlled only
  in the secure world.

Modified:
  head/sys/arm64/rockchip/clk/rk3399_cru.c

Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c
==
--- head/sys/arm64/rockchip/clk/rk3399_cru.cFri Dec 18 16:16:03 2020
(r368765)
+++ head/sys/arm64/rockchip/clk/rk3399_cru.cFri Dec 18 16:55:54 2020
(r368766)
@@ -1212,6 +1212,11 @@ static struct rk_clk rk3399_clks[] = {
FRACT(DCLK_VOP1_FRAC, "dclk_vop1_frac", "dclk_vop1_div", 0,
107),
 
+   /* 
+* This clock is controlled in the secure world
+*/
+   FFACT(PCLK_WDT, "pclk_wdt", "pclk_alive", 1, 1),
+
 /* Not yet implemented yet
  * MMC(SCLK_SDMMC_DRV, "sdmmc_drv","clk_sdmmc", RK3399_SDMMC_CON0, 
1),
  * MMC(SCLK_SDMMC_SAMPLE,  "sdmmc_sample", "clk_sdmmc", RK3399_SDMMC_CON1, 
1),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368725 - head/sys/dev/spibus

2020-12-17 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec 17 17:11:14 2020
New Revision: 368725
URL: https://svnweb.freebsd.org/changeset/base/368725

Log:
  Add IRQ resource to SPIBUS
  
  Add capability to SPIBUS to have child device with IRQ.
  For example many ADC chip have a dedicated pin to signal "data ready"
  and the host can just wait for a interrupt to go out and read the result.
  
  It is the same code as in R282674 and R282702 for IICBUS by Michal Meloun
  
  Submitted by: Oskar Holmund 
  Differential Revision:https://reviews.freebsd.org/D27396

Modified:
  head/sys/dev/spibus/ofw_spibus.c
  head/sys/dev/spibus/spibus.c
  head/sys/dev/spibus/spibusvar.h

Modified: head/sys/dev/spibus/ofw_spibus.c
==
--- head/sys/dev/spibus/ofw_spibus.cThu Dec 17 17:09:43 2020
(r368724)
+++ head/sys/dev/spibus/ofw_spibus.cThu Dec 17 17:11:14 2020
(r368725)
@@ -152,6 +152,10 @@ ofw_spibus_attach(device_t dev)
continue;
}
childdev = device_add_child(dev, NULL, -1);
+
+   resource_list_init(>opd_dinfo.rl);
+   ofw_bus_intr_to_rl(childdev, child,
+   >opd_dinfo.rl, NULL);
device_set_ivars(childdev, dinfo);
}
 
@@ -198,6 +202,15 @@ ofw_spibus_get_devinfo(device_t bus, device_t dev)
return (>opd_obdinfo);
 }
 
+static struct resource_list *
+ofw_spibus_get_resource_list(device_t bus __unused, device_t child)
+{
+   struct spibus_ivar *devi;
+
+   devi = SPIBUS_IVAR(child);
+   return (>rl);
+}
+
 static device_method_t ofw_spibus_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ofw_spibus_probe),
@@ -206,6 +219,7 @@ static device_method_t ofw_spibus_methods[] = {
/* Bus interface */
DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str),
DEVMETHOD(bus_add_child,ofw_spibus_add_child),
+   DEVMETHOD(bus_get_resource_list, ofw_spibus_get_resource_list),
 
/* ofw_bus interface */
DEVMETHOD(ofw_bus_get_devinfo,  ofw_spibus_get_devinfo),

Modified: head/sys/dev/spibus/spibus.c
==
--- head/sys/dev/spibus/spibus.cThu Dec 17 17:09:43 2020
(r368724)
+++ head/sys/dev/spibus/spibus.cThu Dec 17 17:11:14 2020
(r368725)
@@ -101,6 +101,8 @@ spibus_print_child(device_t dev, device_t child)
retval += bus_print_child_header(dev, child);
retval += printf(" at cs %d", devi->cs);
retval += printf(" mode %d", devi->mode);
+   retval += resource_list_print_type(>rl, "irq",
+   SYS_RES_IRQ, "%jd");
retval += bus_print_child_footer(dev, child);
 
return (retval);
@@ -202,6 +204,7 @@ spibus_add_child(device_t dev, u_int order, const char
device_delete_child(dev, child);
return (0);
}
+   resource_list_init(>rl);
device_set_ivars(child, devi);
return (child);
 }
@@ -210,6 +213,7 @@ static void
 spibus_hinted_child(device_t bus, const char *dname, int dunit)
 {
device_t child;
+   int irq;
struct spibus_ivar *devi;
 
child = BUS_ADD_CHILD(bus, 0, dname, dunit);
@@ -218,8 +222,22 @@ spibus_hinted_child(device_t bus, const char *dname, i
resource_int_value(dname, dunit, "clock", >clock);
resource_int_value(dname, dunit, "cs", >cs);
resource_int_value(dname, dunit, "mode", >mode);
+   if (resource_int_value(dname, dunit, "irq", ) == 0) {
+   if (bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1) != 0)
+   device_printf(bus,
+   "Warning: bus_set_resource() failed\n");
+   }
 }
 
+static struct resource_list *
+spibus_get_resource_list(device_t bus __unused, device_t child)
+{
+   struct spibus_ivar *devi;
+
+   devi = SPIBUS_IVAR(child);
+   return (>rl);
+}
+
 static int
 spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd)
 {
@@ -236,6 +254,17 @@ static device_method_t spibus_methods[] = {
DEVMETHOD(device_resume,spibus_resume),
 
/* Bus interface */
+   DEVMETHOD(bus_setup_intr,   bus_generic_setup_intr),
+   DEVMETHOD(bus_teardown_intr,bus_generic_teardown_intr),
+   DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+   DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+   DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+   DEVMETHOD(bus_adjust_resource,  bus_generic_adjust_resource),
+   DEVMETHOD(bus_alloc_resource,   bus_generic_rl_alloc_resource),
+   DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
+   DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+   DEVMETHOD(bus_get_resource_list, spibus_get_resource_list),
+
 

svn commit: r368724 - head/sys/arm/samsung

2020-12-17 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec 17 17:09:43 2020
New Revision: 368724
URL: https://svnweb.freebsd.org/changeset/base/368724

Log:
  arm: Remove samsung exnynos port
  
  Remove the exynos SoC support, this haven't been updated in a while,
  isn't present in GENERIC and nobody is motivated to resurect it.
  
  Differential Revision:https://reviews.freebsd.org/D2

Deleted:
  head/sys/arm/samsung/
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368722 - head/usr.bin/kyua

2020-12-17 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec 17 17:06:57 2020
New Revision: 368722
URL: https://svnweb.freebsd.org/changeset/base/368722

Log:
  kyua: Only install examples if requested
  
  Reviewed by:  brooks
  Differential Revision:https://reviews.freebsd.org/D27638

Modified:
  head/usr.bin/kyua/Makefile

Modified: head/usr.bin/kyua/Makefile
==
--- head/usr.bin/kyua/Makefile  Thu Dec 17 17:02:09 2020(r368721)
+++ head/usr.bin/kyua/Makefile  Thu Dec 17 17:06:57 2020(r368722)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 .include "${SRCTOP}/lib/kyua/Makefile.kyua"
 
 .PATH: ${KYUA_SRCDIR}
@@ -28,7 +30,11 @@ CFLAGS+= -I${KYUA_SRCDIR}
 # kyua uses auto_ptr
 CFLAGS+=   -Wno-deprecated-declarations
 
-FILESGROUPS=   DOCS EXAMPLES MISC STORE
+FILESGROUPS=   DOCS MISC STORE
+
+.if ${MK_EXAMPLES} != "no"
+FILESGROUPS+=  EXAMPLES
+.endif
 
 # Install a minimal default config that uses the 'tests' user.
 # The examples config is not appropriate for general use.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368662 - head/release/arm64

2020-12-15 Thread Emmanuel Vadot
Author: manu
Date: Tue Dec 15 15:13:06 2020
New Revision: 368662
URL: https://svnweb.freebsd.org/changeset/base/368662

Log:
  release: Rename arm64/RPI3.conf to arm64/RPI.conf
  
  We now have a u-boot port and config.txt for booting on all 64bits
  variant of the RPI boards (RPI2v1.1, RPI3* and RPI4*) so use
  the new u-boot-rpi-arm64 and the config_arm64.txt files.
  
  Discussed with: karels, kevans

Added:
  head/release/arm64/RPI.conf
 - copied, changed from r368661, head/release/arm64/RPI3.conf
Deleted:
  head/release/arm64/RPI3.conf

Copied and modified: head/release/arm64/RPI.conf (from r368661, 
head/release/arm64/RPI3.conf)
==
--- head/release/arm64/RPI3.confTue Dec 15 14:58:40 2020
(r368661, copy source)
+++ head/release/arm64/RPI.conf Tue Dec 15 15:13:06 2020(r368662)
@@ -8,7 +8,7 @@ DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-r
 EMBEDDED_TARGET_ARCH="aarch64"
 EMBEDDED_TARGET="arm64"
 EMBEDDEDBUILD=1
-EMBEDDEDPORTS="sysutils/u-boot-rpi3 sysutils/rpi-firmware"
+EMBEDDEDPORTS="sysutils/u-boot-rpi-arm64 sysutils/rpi-firmware"
 FAT_SIZE="50m -b 1m"
 FAT_TYPE="16"
 IMAGE_SIZE="3072M"
@@ -18,10 +18,10 @@ NODOC=1
 OL_DIR="${DTB_DIR}/overlays"
 OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
 PART_SCHEME="MBR"
-export BOARDNAME="RPI3"
+export BOARDNAME="RPI"
 
 arm_install_uboot() {
-   UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3"
+   UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi-arm64"
UBOOT_FILES="README u-boot.bin"
DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
@@ -39,9 +39,7 @@ arm_install_uboot() {
chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \
${FATMOUNT}/${_DF}
done
-   chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi4.txt \
-   ${FATMOUNT}
-   chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi3.txt \
+   chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_arm64.txt \
${FATMOUNT}/config.txt
chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
for _OL in ${OVERLAYS}; do
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368299 - head/sys/dev/dwc

2020-12-03 Thread Emmanuel Vadot
Author: manu
Date: Thu Dec  3 11:15:49 2020
New Revision: 368299
URL: https://svnweb.freebsd.org/changeset/base/368299

Log:
  if_dwc: Honor snps,pbl property
  
  DTS node can have this property which configure the burst length
  for both TX and RX if it's the same.
  This unbreak if_dwc on Allwinner A20 and possibly other boards that
  uses this prop.
  
  Reported by:  qroxana 

Modified:
  head/sys/dev/dwc/if_dwc.c
  head/sys/dev/dwc/if_dwc.h

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Thu Dec  3 10:41:06 2020(r368298)
+++ head/sys/dev/dwc/if_dwc.c   Thu Dec  3 11:15:49 2020(r368299)
@@ -1496,7 +1496,7 @@ dwc_attach(device_t dev)
uint32_t reg;
char *phy_mode;
phandle_t node;
-   uint32_t txpbl, rxpbl;
+   uint32_t txpbl, rxpbl, pbl;
bool nopblx8 = false;
bool fixed_burst = false;
 
@@ -1516,10 +1516,12 @@ dwc_attach(device_t dev)
OF_prop_free(phy_mode);
}
 
+   if (OF_getencprop(node, "snps,pbl", , sizeof(uint32_t)) <= 0)
+   pbl = BUS_MODE_DEFAULT_PBL;
if (OF_getencprop(node, "snps,txpbl", , sizeof(uint32_t)) <= 0)
-   txpbl = 8;
+   txpbl = pbl;
if (OF_getencprop(node, "snps,rxpbl", , sizeof(uint32_t)) <= 0)
-   rxpbl = 8;
+   rxpbl = pbl;
if (OF_hasprop(node, "snps,no-pbl-x8") == 1)
nopblx8 = true;
if (OF_hasprop(node, "snps,fixed-burst") == 1)
@@ -1569,6 +1571,7 @@ dwc_attach(device_t dev)
reg |= (rxpbl << BUS_MODE_RPBL_SHIFT);
if (fixed_burst)
reg |= BUS_MODE_FIXEDBURST;
+
WRITE4(sc, BUS_MODE, reg);
 
/*

Modified: head/sys/dev/dwc/if_dwc.h
==
--- head/sys/dev/dwc/if_dwc.h   Thu Dec  3 10:41:06 2020(r368298)
+++ head/sys/dev/dwc/if_dwc.h   Thu Dec  3 11:15:49 2020(r368299)
@@ -229,8 +229,8 @@
 #define BUS_MODE_PRIORXTX_21   1
 #define BUS_MODE_PRIORXTX_11   0
 #define BUS_MODE_PBL_SHIFT 8 /* Single block transfer size */
-#define BUS_MODE_PBL_BEATS_8   8
 #define BUS_MODE_SWR   (1 << 0) /* Reset */
+#define BUS_MODE_DEFAULT_PBL   8
 #defineTRANSMIT_POLL_DEMAND0x1004
 #defineRECEIVE_POLL_DEMAND 0x1008
 #defineRX_DESCR_LIST_ADDR  0x100C
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368186 - head/sys/cam/mmc

2020-11-30 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov 30 14:49:13 2020
New Revision: 368186
URL: https://svnweb.freebsd.org/changeset/base/368186

Log:
  mmccam: Convert some printf to CAM_DEBUG
  
  This not not useful if you are not debuging mmccam

Modified:
  head/sys/cam/mmc/mmc_xpt.c

Modified: head/sys/cam/mmc/mmc_xpt.c
==
--- head/sys/cam/mmc/mmc_xpt.c  Mon Nov 30 14:48:50 2020(r368185)
+++ head/sys/cam/mmc/mmc_xpt.c  Mon Nov 30 14:49:13 2020(r368186)
@@ -263,8 +263,8 @@ mmc_scan_lun(struct cam_periph *periph, struct cam_pat
xpt_done(request_ccb);
}
} else {
-   if (bootverbose)
-   xpt_print(path, " Set up the mmcprobe device...\n");
+   CAM_DEBUG(path, CAM_DEBUG_INFO,
+   (" Set up the mmcprobe device...\n"));
 
 status = cam_periph_alloc(mmcprobe_register, NULL,
  mmcprobe_cleanup,
@@ -382,7 +382,8 @@ mmc_announce_periph(struct cam_periph *periph)
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP)
return;
xpt_path_inq(, periph->path);
-   printf("XPT info: CLK %04X, ...\n", cts.proto_specific.mmc.ios.clock);
+   CAM_DEBUG(path, CAM_DEBUG_INFO,
+   ("XPT info: CLK %04d, ...\n", cts.proto_specific.mmc.ios.clock));
 }
 
 void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368185 - head/sys/arm/allwinner

2020-11-30 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov 30 14:48:50 2020
New Revision: 368185
URL: https://svnweb.freebsd.org/changeset/base/368185

Log:
  arm: allwinner: aw_mmc: Add a sysctl for debuging
  
  Add a new hw.aw_mmc.debug sysctl to help debugging the driver.
  Bit 0 will debug card changes (removal, insertion, power up/down)
  Bit 1 will debug ios changes
  Bit 2 will debug interrupts received
  Bit 3 will debug commands sent

Modified:
  head/sys/arm/allwinner/aw_mmc.c

Modified: head/sys/arm/allwinner/aw_mmc.c
==
--- head/sys/arm/allwinner/aw_mmc.c Mon Nov 30 11:45:47 2020
(r368184)
+++ head/sys/arm/allwinner/aw_mmc.c Mon Nov 30 14:48:50 2020
(r368185)
@@ -191,6 +191,17 @@ static void aw_mmc_cam_handle_mmcio(struct cam_sim *, 
 #defineAW_MMC_WRITE_4(_sc, _reg, _value)   
\
bus_write_4((_sc)->aw_res[AW_MMC_MEMRES], _reg, _value)
 
+SYSCTL_NODE(_hw, OID_AUTO, aw_mmc, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
+"aw_mmc driver");
+
+static int aw_mmc_debug = 0;
+SYSCTL_INT(_hw_aw_mmc, OID_AUTO, debug, CTLFLAG_RWTUN, _mmc_debug, 0,
+"Debug level bit0=card changes bit1=ios changes, bit2=interrupts, 
bit3=commands");
+#defineAW_MMC_DEBUG_CARD   0x1
+#defineAW_MMC_DEBUG_IOS0x2
+#defineAW_MMC_DEBUG_INT0x4
+#defineAW_MMC_DEBUG_CMD0x8
+
 #ifdef MMCCAM
 static void
 aw_mmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb)
@@ -227,7 +238,7 @@ aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb)
{
struct ccb_trans_settings *cts = >cts;
 
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Got 
XPT_GET_TRAN_SETTINGS\n");
 
cts->protocol = PROTO_MMCSD;
@@ -247,14 +258,14 @@ aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb)
}
case XPT_SET_TRAN_SETTINGS:
{
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Got 
XPT_SET_TRAN_SETTINGS\n");
aw_mmc_cam_settran_settings(sc, ccb);
ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
case XPT_RESET_BUS:
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Got XPT_RESET_BUS, ACK 
it...\n");
ccb->ccb_h.status = CAM_REQ_CMP;
break;
@@ -300,37 +311,37 @@ aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, u
/* Update only requested fields */
if (cts->ios_valid & MMC_CLK) {
ios->clock = new_ios->clock;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Clock => %d\n", ios->clock);
}
if (cts->ios_valid & MMC_VDD) {
ios->vdd = new_ios->vdd;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "VDD => %d\n", ios->vdd);
}
if (cts->ios_valid & MMC_CS) {
ios->chip_select = new_ios->chip_select;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "CS => %d\n", 
ios->chip_select);
}
if (cts->ios_valid & MMC_BW) {
ios->bus_width = new_ios->bus_width;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Bus width => %d\n", 
ios->bus_width);
}
if (cts->ios_valid & MMC_PM) {
ios->power_mode = new_ios->power_mode;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Power mode => %d\n", 
ios->power_mode);
}
if (cts->ios_valid & MMC_BT) {
ios->timing = new_ios->timing;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Timing => %d\n", 
ios->timing);
}
if (cts->ios_valid & MMC_BM) {
ios->bus_mode = new_ios->bus_mode;
-   if (bootverbose)
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_IOS))
device_printf(sc->aw_dev, "Bus mode => %d\n", 
ios->bus_mode);
}
 
@@ -346,14 +357,12 @@ aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb 
 
AW_MMC_LOCK(sc);
 
-#ifdef DEBUG
-   if (__predict_false(bootverbose)) {
+   if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_CMD)) {

Re: svn commit: r368163 - in head: sbin/ifconfig sys/dev/if_wg sys/dev/if_wg/include sys/dev/if_wg/include/crypto sys/dev/if_wg/include/sys sys/dev/if_wg/include/zinc sys/dev/if_wg/module sys/dev/if_w

2020-11-30 Thread Emmanuel Vadot
   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/blake2s.c   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/chacha20.c   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/chacha20poly1305.c   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/curve25519.c   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/poly1305.c   
> > (contents, props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/run.h   (contents, 
> > props changed)
> >   head/sys/dev/if_wg/module/curve25519.c   (contents, props changed)
> >   head/sys/dev/if_wg/module/if_wg_session.c   (contents, props 
> > changed)
> >   head/sys/dev/if_wg/module/module.c   (contents, props changed)
> >   head/sys/dev/if_wg/module/poly1305-x86_64.S   (contents, props 
> > changed)
> >   head/sys/dev/if_wg/module/wg_cookie.c   (contents, props changed)
> >   head/sys/dev/if_wg/module/wg_noise.c   (contents, props changed)
> >   head/sys/modules/if_wg/
> >   head/sys/modules/if_wg/Makefile   (contents, props changed)
> > Directory Properties:
> >   head/sys/dev/if_wg/include/crypto/   (props changed)
> >   head/sys/dev/if_wg/include/zinc/   (props changed)
> >   head/sys/dev/if_wg/module/crypto/   (props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/   (props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/chacha20/   (props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/poly1305/   (props changed)
> >   head/sys/dev/if_wg/module/crypto/zinc/selftest/   (props changed)
> 
> 
> Looking at sys/dev/if_wg/include/sys/support.h I wonder why zinc was not 
> done as linuxkpi code?  Could it be?
> 
> 
> /bz

 Adding a dependancy on linuxkpi for just a few compat funcs looks
overkill, also having it done that way means that mallocs are typed
with M_WG instead of the global M_LINUXKPI so it's better to track
leaks, if any.

-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368081 - head/sys/arm64/arm64

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 20:22:34 2020
New Revision: 368081
URL: https://svnweb.freebsd.org/changeset/base/368081

Log:
  arm64: Do not rely on SPCR table to detect acpi
  
  Since EDK2 commit d8e36289cef7bde628b023219cd65fa8e8d4562a, the Graphical 
console may
  completely hide SPCR, causing panics later when locating timers.
  As such simply rely on the ACPI Root pointer presence.
  
  Submitted by: dan.kotow...@a9development.com
  Reviewed by:  andrew, mw
  Differential Revision:https://reviews.freebsd.org/D27306

Modified:
  head/sys/arm64/arm64/machdep.c

Modified: head/sys/arm64/arm64/machdep.c
==
--- head/sys/arm64/arm64/machdep.c  Thu Nov 26 19:38:02 2020
(r368080)
+++ head/sys/arm64/arm64/machdep.c  Thu Nov 26 20:22:34 2020
(r368081)
@@ -1036,7 +1036,7 @@ bus_probe(void)
has_fdt = (OF_peer(0) != 0);
 #endif
 #ifdef DEV_ACPI
-   has_acpi = (acpi_find_table(ACPI_SIG_SPCR) != 0);
+   has_acpi = (AcpiOsGetRootPointer() != 0);
 #endif
 
env = kern_getenv("kern.cfg.order");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368067 - head/sys/arm/allwinner

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 17:19:47 2020
New Revision: 368067
URL: https://svnweb.freebsd.org/changeset/base/368067

Log:
  arm: allwinner: a23 timer functions are only used for arm64

Modified:
  head/sys/arm/allwinner/a10_timer.c

Modified: head/sys/arm/allwinner/a10_timer.c
==
--- head/sys/arm/allwinner/a10_timer.c  Thu Nov 26 17:19:30 2020
(r368066)
+++ head/sys/arm/allwinner/a10_timer.c  Thu Nov 26 17:19:47 2020
(r368067)
@@ -119,8 +119,10 @@ static uint64_t timer_read_counter64(struct a10_timer_
 static void a10_timer_eventtimer_setup(struct a10_timer_softc *sc);
 #endif
 
+#if defined(__aarch64__)
 static void a23_timer_timecounter_setup(struct a10_timer_softc *sc);
 static u_int a23_timer_get_timecount(struct timecounter *tc);
+#endif
 
 static int a10_timer_irq(void *);
 static int a10_timer_probe(device_t);
@@ -138,6 +140,7 @@ static struct timecounter a10_timer_timecounter = {
.tc_quality= 1000,
 };
 
+#if defined(__aarch64__)
 static struct timecounter a23_timer_timecounter = {
.tc_name   = "a10_timer timer0",
.tc_get_timecount  = a23_timer_get_timecount,
@@ -146,6 +149,7 @@ static struct timecounter a23_timer_timecounter = {
/* We want it to be selected over the arm generic timecounter */
.tc_quality= 2000,
 };
+#endif
 
 #defineA10_TIMER_MEMRES0
 #defineA10_TIMER_IRQRES1
@@ -158,7 +162,9 @@ static struct resource_spec a10_timer_spec[] = {
 
 static struct ofw_compat_data compat_data[] = {
{"allwinner,sun4i-a10-timer", A10_TIMER},
+#if defined(__aarch64__)
{"allwinner,sun8i-a23-timer", A23_TIMER},
+#endif
{NULL, 0},
 };
 
@@ -374,6 +380,7 @@ a10_timer_timer_stop(struct eventtimer *et)
  * Timecounter functions for A23 and above
  */
 
+#if defined(__aarch64__)
 static void
 a23_timer_timecounter_setup(struct a10_timer_softc *sc)
 {
@@ -415,6 +422,7 @@ a23_timer_get_timecount(struct timecounter *tc)
/* Counter count backwards */
return (~0u - val);
 }
+#endif
 
 /*
  * Timecounter functions for A10 and A13, using the 64 bits counter
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368066 - head/sys/arm/nvidia/tegra124

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 17:19:30 2020
New Revision: 368066
URL: https://svnweb.freebsd.org/changeset/base/368066

Log:
  arm: tegra: Remove unused variable

Modified:
  head/sys/arm/nvidia/tegra124/tegra124_machdep.c

Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Nov 26 17:19:13 
2020(r368065)
+++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Nov 26 17:19:30 
2020(r368066)
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
PMC_SCRATCH0_MODE_RCM)
 
 static platform_attach_t tegra124_attach;
-static platform_lastaddr_t tegra124_lastaddr;
 static platform_devmap_init_t tegra124_devmap_init;
 static platform_late_init_t tegra124_late_init;
 static platform_cpu_reset_t tegra124_cpu_reset;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368065 - head/sys/arm/mv

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 17:19:13 2020
New Revision: 368065
URL: https://svnweb.freebsd.org/changeset/base/368065

Log:
  arm: mv: Remove unused code

Modified:
  head/sys/arm/mv/mv_common.c

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Thu Nov 26 17:18:54 2020(r368064)
+++ head/sys/arm/mv/mv_common.c Thu Nov 26 17:19:13 2020(r368065)
@@ -79,7 +79,6 @@ struct soc_node_spec;
 
 static enum soc_family soc_family;
 
-static int mv_win_cesa_attr(int wng_sel);
 static int mv_win_cesa_attr_armv5(int eng_sel);
 static int mv_win_cesa_attr_armada38x(int eng_sel);
 static int mv_win_cesa_attr_armadaxp(int eng_sel);
@@ -93,7 +92,6 @@ void write_cpu_ctrl_armv7(uint32_t reg, uint32_t val);
 static int win_eth_can_remap(int i);
 
 static int decode_win_cesa_valid(void);
-static int decode_win_cpu_valid(void);
 static int decode_win_usb_valid(void);
 static int decode_win_usb3_valid(void);
 static int decode_win_eth_valid(void);
@@ -402,15 +400,6 @@ pm_is_disabled(uint32_t mask)
  * machines.
  */
 
-static int mv_win_cesa_attr(int eng_sel)
-{
-
-   if (soc_decode_win_spec->win_cesa_attr != NULL)
-   return (soc_decode_win_spec->win_cesa_attr(eng_sel));
-
-   return (-1);
-}
-
 static int mv_win_cesa_attr_armv5(int eng_sel)
 {
 
@@ -987,15 +976,6 @@ WIN_REG_BASE_IDX_WR(win_eth, br, MV_WIN_ETH_BASE)
 WIN_REG_BASE_IDX_WR(win_eth, sz, MV_WIN_ETH_SIZE)
 WIN_REG_BASE_IDX_WR(win_eth, har, MV_WIN_ETH_REMAP)
 
-WIN_REG_BASE_IDX_RD2(win_xor, br, MV_WIN_XOR_BASE)
-WIN_REG_BASE_IDX_RD2(win_xor, sz, MV_WIN_XOR_SIZE)
-WIN_REG_BASE_IDX_RD2(win_xor, har, MV_WIN_XOR_REMAP)
-WIN_REG_BASE_IDX_RD2(win_xor, ctrl, MV_WIN_XOR_CTRL)
-WIN_REG_BASE_IDX_WR2(win_xor, br, MV_WIN_XOR_BASE)
-WIN_REG_BASE_IDX_WR2(win_xor, sz, MV_WIN_XOR_SIZE)
-WIN_REG_BASE_IDX_WR2(win_xor, har, MV_WIN_XOR_REMAP)
-WIN_REG_BASE_IDX_WR2(win_xor, ctrl, MV_WIN_XOR_CTRL)
-
 WIN_REG_BASE_RD(win_eth, bare, 0x290)
 WIN_REG_BASE_RD(win_eth, epap, 0x294)
 WIN_REG_BASE_WR(win_eth, bare, 0x290)
@@ -1014,17 +994,6 @@ WIN_REG_BASE_IDX_WR(pcie_bar, br, MV_PCIE_BAR_BASE);
 WIN_REG_BASE_IDX_WR(pcie_bar, brh, MV_PCIE_BAR_BASE_H);
 WIN_REG_BASE_IDX_WR(pcie_bar, cr, MV_PCIE_BAR_CTRL);
 
-WIN_REG_BASE_IDX_RD(win_idma, br, MV_WIN_IDMA_BASE)
-WIN_REG_BASE_IDX_RD(win_idma, sz, MV_WIN_IDMA_SIZE)
-WIN_REG_BASE_IDX_RD(win_idma, har, MV_WIN_IDMA_REMAP)
-WIN_REG_BASE_IDX_RD(win_idma, cap, MV_WIN_IDMA_CAP)
-WIN_REG_BASE_IDX_WR(win_idma, br, MV_WIN_IDMA_BASE)
-WIN_REG_BASE_IDX_WR(win_idma, sz, MV_WIN_IDMA_SIZE)
-WIN_REG_BASE_IDX_WR(win_idma, har, MV_WIN_IDMA_REMAP)
-WIN_REG_BASE_IDX_WR(win_idma, cap, MV_WIN_IDMA_CAP)
-WIN_REG_BASE_RD(win_idma, bare, 0xa80)
-WIN_REG_BASE_WR(win_idma, bare, 0xa80)
-
 WIN_REG_BASE_IDX_RD(win_sata, cr, MV_WIN_SATA_CTRL);
 WIN_REG_BASE_IDX_RD(win_sata, br, MV_WIN_SATA_BASE);
 WIN_REG_BASE_IDX_WR(win_sata, cr, MV_WIN_SATA_CTRL);
@@ -1033,7 +1002,6 @@ WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN_SATA_BASE);
 WIN_REG_BASE_IDX_RD(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X);
 WIN_REG_BASE_IDX_WR(win_sata_armada38x, sz, MV_WIN_SATA_SIZE_ARMADA38X);
 WIN_REG_BASE_IDX_RD(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X);
-WIN_REG_BASE_IDX_RD(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X);
 WIN_REG_BASE_IDX_WR(win_sata_armada38x, cr, MV_WIN_SATA_CTRL_ARMADA38X);
 WIN_REG_BASE_IDX_WR(win_sata_armada38x, br, MV_WIN_SATA_BASE_ARMADA38X);
 
@@ -1200,65 +1168,6 @@ decode_win_overlap(int win, int win_no, const struct d
}
 
return (-1);
-}
-
-static int
-decode_win_cpu_valid(void)
-{
-   int i, j, rv;
-   uint32_t b, e, s;
-
-   if (cpu_wins_no > soc_decode_win_spec->mv_win_cpu_max) {
-   printf("CPU windows: too many entries: %d\n", cpu_wins_no);
-   return (0);
-   }
-
-   rv = 1;
-   for (i = 0; i < cpu_wins_no; i++) {
-   if (cpu_wins[i].target == 0) {
-   printf("CPU window#%d: DDR target window is not "
-   "supposed to be reprogrammed!\n", i);
-   rv = 0;
-   }
-
-   if (cpu_wins[i].remap != ~0 && win_cpu_can_remap(i) != 1) {
-   printf("CPU window#%d: not capable of remapping, but "
-   "val 0x%08x defined\n", i, cpu_wins[i].remap);
-   rv = 0;
-   }
-
-   s = cpu_wins[i].size;
-   b = cpu_wins[i].base;
-   e = b + s - 1;
-   if (s > (0x - b + 1)) {
-   /*
-* XXX this boundary check should account for 64bit
-* and remapping..
-*/
-   printf("CPU window#%d: no space for size 0x%08x at "
-   "0x%08x\n", i, s, b);
-   rv = 0;
-   continue;
-   }
-
-

svn commit: r368064 - head/sys/arm/ti

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 17:18:54 2020
New Revision: 368064
URL: https://svnweb.freebsd.org/changeset/base/368064

Log:
  arm: ti: Remove unused function ti_first_gpio_bank

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Thu Nov 26 17:18:18 2020(r368063)
+++ head/sys/arm/ti/ti_gpio.c   Thu Nov 26 17:18:54 2020(r368064)
@@ -134,22 +134,6 @@ static int ti_gpio_detach(device_t);
 static int ti_gpio_pic_attach(struct ti_gpio_softc *sc);
 static int ti_gpio_pic_detach(struct ti_gpio_softc *sc);
 
-static u_int
-ti_first_gpio_bank(void)
-{
-   switch(ti_chip()) {
-#ifdef SOC_OMAP4
-   case CHIP_OMAP_4:
-   return (OMAP4_FIRST_GPIO_BANK);
-#endif
-#ifdef SOC_TI_AM335X
-   case CHIP_AM335X:
-   return (AM335X_FIRST_GPIO_BANK);
-#endif
-   }
-   return (0);
-}
-
 static uint32_t
 ti_gpio_rev(void)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368061 - head/sys/dev/sdhci

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 16:40:39 2020
New Revision: 368061
URL: https://svnweb.freebsd.org/changeset/base/368061

Log:
  sdhci: mmccam: Update vccq in the driver ios
  
  Otherwise we always report that the card is running at 1.2V.

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Thu Nov 26 16:40:20 2020(r368060)
+++ head/sys/dev/sdhci/sdhci.c  Thu Nov 26 16:40:39 2020(r368061)
@@ -2683,6 +2683,11 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un
if (sdhci_debug > 1)
slot_printf(slot, "Bus mode => %d\n", ios->bus_mode);
}
+   if (cts->ios_valid & MMC_VCCQ) {
+   ios->vccq = new_ios->vccq;
+   if (sdhci_debug > 1)
+   slot_printf(slot, "VCCQ => %d\n", ios->vccq);
+   }
 
/* XXX Provide a way to call a chip-specific IOS update, required for 
TI */
return (sdhci_cam_update_ios(slot));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368060 - head/sys/dev/sdhci

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 16:40:20 2020
New Revision: 368060
URL: https://svnweb.freebsd.org/changeset/base/368060

Log:
  sdhci: Only print mmccam debug code if hw.sdhci.debug is > 1

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Thu Nov 26 16:39:56 2020(r368059)
+++ head/sys/dev/sdhci/sdhci.c  Thu Nov 26 16:40:20 2020(r368060)
@@ -2650,31 +2650,38 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un
/* Update only requested fields */
if (cts->ios_valid & MMC_CLK) {
ios->clock = sdhci_cam_get_possible_host_clock(slot, 
new_ios->clock);
-   slot_printf(slot, "Clock => %d\n", ios->clock);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "Clock => %d\n", ios->clock);
}
if (cts->ios_valid & MMC_VDD) {
ios->vdd = new_ios->vdd;
-   slot_printf(slot, "VDD => %d\n", ios->vdd);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "VDD => %d\n", ios->vdd);
}
if (cts->ios_valid & MMC_CS) {
ios->chip_select = new_ios->chip_select;
-   slot_printf(slot, "CS => %d\n", ios->chip_select);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "CS => %d\n", ios->chip_select);
}
if (cts->ios_valid & MMC_BW) {
ios->bus_width = new_ios->bus_width;
-   slot_printf(slot, "Bus width => %d\n", ios->bus_width);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "Bus width => %d\n", ios->bus_width);
}
if (cts->ios_valid & MMC_PM) {
ios->power_mode = new_ios->power_mode;
-   slot_printf(slot, "Power mode => %d\n", ios->power_mode);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "Power mode => %d\n", 
ios->power_mode);
}
if (cts->ios_valid & MMC_BT) {
ios->timing = new_ios->timing;
-   slot_printf(slot, "Timing => %d\n", ios->timing);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "Timing => %d\n", ios->timing);
}
if (cts->ios_valid & MMC_BM) {
ios->bus_mode = new_ios->bus_mode;
-   slot_printf(slot, "Bus mode => %d\n", ios->bus_mode);
+   if (sdhci_debug > 1)
+   slot_printf(slot, "Bus mode => %d\n", ios->bus_mode);
}
 
/* XXX Provide a way to call a chip-specific IOS update, required for 
TI */
@@ -2686,7 +2693,8 @@ sdhci_cam_update_ios(struct sdhci_slot *slot)
 {
struct mmc_ios *ios = >host.ios;
 
-   slot_printf(slot, "%s: power_mode=%d, clk=%d, bus_width=%d, 
timing=%d\n",
+   if (sdhci_debug > 1)
+   slot_printf(slot, "%s: power_mode=%d, clk=%d, bus_width=%d, 
timing=%d\n",
__func__, ios->power_mode, ios->clock, ios->bus_width, 
ios->timing);
SDHCI_LOCK(slot);
/* Do full reset on bus power down to clear from any state. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368059 - head/sys/cam/mmc

2020-11-26 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 26 16:39:56 2020
New Revision: 368059
URL: https://svnweb.freebsd.org/changeset/base/368059

Log:
  mmccam: We can't sleep during sdda_add_part so use M_NOWAIT
  
  Reviewed by:  kibab
  Differential Revision:https://reviews.freebsd.org/D25947

Modified:
  head/sys/cam/mmc/mmc_da.c

Modified: head/sys/cam/mmc/mmc_da.c
==
--- head/sys/cam/mmc/mmc_da.c   Thu Nov 26 16:36:50 2020(r368058)
+++ head/sys/cam/mmc/mmc_da.c   Thu Nov 26 16:39:56 2020(r368059)
@@ -202,7 +202,7 @@ static inline bool sdda_get_read_only(struct cam_perip
 static uint32_t mmc_get_spec_vers(struct cam_periph *periph);
 static uint64_t mmc_get_media_size(struct cam_periph *periph);
 static uint32_t mmc_get_cmd6_timeout(struct cam_periph *periph);
-static void sdda_add_part(struct cam_periph *periph, u_int type,
+static bool sdda_add_part(struct cam_periph *periph, u_int type,
 const char *name, u_int cnt, off_t media_size, bool ro);
 
 static struct periph_driver sddadriver =
@@ -1502,10 +1502,11 @@ finish_hs_tests:
sdda_process_mmc_partitions(periph, start_ccb);
} else if (mmcp->card_features & CARD_FEATURE_SD20) {
/* For SD[HC] cards, just add one partition that is the whole 
card */
-   sdda_add_part(periph, 0, "sdda",
+   if (sdda_add_part(periph, 0, "sdda",
periph->unit_number,
mmc_get_media_size(periph),
-   sdda_get_read_only(periph, start_ccb));
+   sdda_get_read_only(periph, start_ccb)) == false)
+   return;
softc->part_curr = 0;
}
cam_periph_hold(periph, PRIBIO|PCATCH);
@@ -1521,7 +1522,7 @@ finish_hs_tests:
AC_ADVINFO_CHANGED, sddaasync, periph, periph->path);
 }
 
-static void
+static bool
 sdda_add_part(struct cam_periph *periph, u_int type, const char *name,
 u_int cnt, off_t media_size, bool ro)
 {
@@ -1536,7 +1537,11 @@ sdda_add_part(struct cam_periph *periph, u_int type, c
ro ? "(read-only)" : ""));
 
part = sc->part[type] = malloc(sizeof(*part), M_DEVBUF,
-   M_WAITOK | M_ZERO);
+   M_NOWAIT | M_ZERO);
+   if (part == NULL) {
+   printf("Cannot add partition for sdda\n");
+   return (false);
+   }
 
part->cnt = cnt;
part->type = type;
@@ -1554,7 +1559,7 @@ sdda_add_part(struct cam_periph *periph, u_int type, c
/* TODO: Create device, assign IOCTL handler */
CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH,
("Don't know what to do with RPMB partitions yet\n"));
-   return;
+   return (false);
}
 
bioq_init(>bio_queue);
@@ -1620,11 +1625,13 @@ sdda_add_part(struct cam_periph *periph, u_int type, c
xpt_print(periph->path, "%s: lost periph during "
"registration!\n", __func__);
cam_periph_lock(periph);
-   return;
+   return (false);
}
disk_create(part->disk, DISK_VERSION);
cam_periph_lock(periph);
cam_periph_unhold(periph);
+
+   return (true);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk

2020-11-26 Thread Emmanuel Vadot
On Thu, 26 Nov 2020 08:37:13 -0700
Alan Somers  wrote:

> > >
> > > >  I think you should add a LINKS=... here so people script which uses
> > > > ping6 won't break (and of course adding support in the code to do ipv6
> > > > ping if progname is ping6 if this isn't the case).
> > > >
> > > >  Cheers,
> > > >
> > > > --
> > > > Emmanuel Vadot 
> > > >
> > >
> > > Yes, that would make sense.  But for how long?  Would the ping6 hard link
> > > stick around forever, or eventually be removed in some future version of
> > > FreeBSD?
> >
> >  I have no opinion on this matter.
> >  But since ping6 was present for a very long time I guess we're stuck
> > with it for a long time too.
> >
> 
> Do you have an opinion on whether there should be a /rescue/ping6 link too?

 I'll be honest I don't use ipv6 at all, I've just noticed this problem
when reading my morning email :)

-- 
Emmanuel Vadot  
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk

2020-11-26 Thread Emmanuel Vadot
On Thu, 26 Nov 2020 07:36:37 -0700
Alan Somers  wrote:

> On Thu, Nov 26, 2020 at 1:27 AM Emmanuel Vadot 
> wrote:
> 
> >
> >  Hi Alan,
> >
> > On Thu, 26 Nov 2020 04:29:31 + (UTC)
> > Alan Somers  wrote:
> >
> > > Author: asomers
> > > Date: Thu Nov 26 04:29:30 2020
> > > New Revision: 368045
> > > URL: https://svnweb.freebsd.org/changeset/base/368045
> > >
> > > Log:
> > >   Merge ping6 to ping
> > >
> > >   There is now a single ping binary, which chooses to use ICMP or ICMPv4
> > >   based on the -4 and -6 options, and the format of the address.
> > >
> > >   Submitted by:   Ján Su?an 
> > >   Sponsored by:   Google LLC (Google Summer of Code 2019)
> > >   MFC after:  Never
> > >   Differential Revision:  https://reviews.freebsd.org/D21377
> > >
> > > Added:
> > >   head/sbin/ping/main.c   (contents, props changed)
> > >   head/sbin/ping/main.h   (contents, props changed)
> > >   head/sbin/ping/ping.h   (contents, props changed)
> > >   head/sbin/ping/ping6.c
> > >  - copied, changed from r368010, head/sbin/ping6/ping6.c
> > >   head/sbin/ping/ping6.h   (contents, props changed)
> > >   head/sbin/ping/tests/ping_6_c1_s8_t1.out
> > >  - copied unchanged from r368010,
> > head/sbin/ping6/tests/ping6_c1_s8_t1.out
> > > Deleted:
> > >   head/sbin/ping6/Makefile
> > >   head/sbin/ping6/Makefile.depend
> > >   head/sbin/ping6/ping6.8
> > >   head/sbin/ping6/ping6.c
> > >   head/sbin/ping6/tests/Makefile
> > >   head/sbin/ping6/tests/ping6_c1_s8_t1.out
> > >   head/sbin/ping6/tests/ping6_test.sh
> > > Modified:
> > >   head/ObsoleteFiles.inc
> > >   head/UPDATING
> > >   head/etc/mtree/BSD.tests.dist
> > >   head/rescue/rescue/Makefile
> > >   head/sbin/Makefile
> > >   head/sbin/ping/Makefile
> > >   head/sbin/ping/ping.8
> > >   head/sbin/ping/ping.c
> > >   head/sbin/ping/tests/Makefile
> > >   head/sbin/ping/tests/ping_test.sh
> > >   head/tools/build/mk/OptionalObsoleteFiles.inc
> > >
> > > Modified: head/ObsoleteFiles.inc
> > >
> > ==
> > > --- head/ObsoleteFiles.incThu Nov 26 02:14:52 2020(r368044)
> > > +++ head/ObsoleteFiles.incThu Nov 26 04:29:30 2020(r368045)
> > > @@ -36,6 +36,16 @@
> > >  #   xargs -n1 | sort | uniq -d;
> > >  # done
> > >
> > > +# 20201124: ping6(8) was merged into ping(8)
> > > +OLD_FILES+=sbin/ping6
> > > +OLD_FILES+=rescue/ping6
> > > +OLD_FILES+=usr/lib/debug/sbin/ping6.debug
> > > +OLD_FILES+=usr/share/man/man8/ping6.8.gz
> > > +OLD_FILES+=usr/tests/sbin/ping6/Kyuafile
> > > +OLD_FILES+=usr/tests/sbin/ping6/ping6_c1_s8_t1.out
> > > +OLD_FILES+=usr/tests/sbin/ping6/ping6_test
> > > +OLD_DIRS+=usr/tests/sbin/ping6
> > > +
> > >  # 20201025: Remove cal data files
> > >  OLD_FILES+=usr/share/calendar/calendar.all
> > >  OLD_FILES+=usr/share/calendar/calendar.australia
> > >
> > > Modified: head/UPDATING
> > >
> > ==
> > > --- head/UPDATING Thu Nov 26 02:14:52 2020(r368044)
> > > +++ head/UPDATING Thu Nov 26 04:29:30 2020(r368045)
> > > @@ -26,6 +26,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
> > >   world, or to merely disable the most expensive debugging
> > functionality
> > >   at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
> > >
> > > +20201124:
> > > + ping6 has been merged into ping.  It can now be called as "ping
> > -6".
> > > + See ping(8) for details.
> > > +
> > >  20201108:
> > >   Default value of net.add_addr_allfibs has been changed to 0.
> > >   If you have multi-fib configuration and rely on existence of all
> > >
> > > Modified: head/etc/mtree/BSD.tests.dist
> > >
> > ==
> > > --- head/etc/mtree/BSD.tests.dist Thu Nov 26 02:14:52 2020
> > (r368044)
> > > +++ head/etc/mtree/BSD.tests.dist Thu Nov 26 04:29:30 2020
> > (r368045)
> > > @@ -448,8 +448,6 @@
> > >  ..
> > > 

Re: svn commit: r368045 - in head: . etc/mtree rescue/rescue sbin sbin/ping sbin/ping/tests sbin/ping6 sbin/ping6/tests tools/build/mk

2020-11-26 Thread Emmanuel Vadot
>  SUBDIR.${MK_IPFILTER}+=  ipf
>  SUBDIR.${MK_IPFW}+=  ipfw
> 
> Modified: head/sbin/ping/Makefile
> ==
> --- head/sbin/ping/Makefile   Thu Nov 26 02:14:52 2020(r368044)
> +++ head/sbin/ping/Makefile   Thu Nov 26 04:29:30 2020(r368045)
> @@ -5,11 +5,17 @@
>  
>  PACKAGE=runtime
>  PROG=ping
> -SRCS=ping.c utils.c
> +SRCS=main.c ping.c utils.c

 I think you should add a LINKS=... here so people script which uses
ping6 won't break (and of course adding support in the code to do ipv6
ping if progname is ping6 if this isn't the case).

 Cheers,

>  MAN= ping.8
>  BINOWN=  root
>  BINMODE=4555
>  LIBADD=  m
> +
> +.if ${MK_INET6_SUPPORT} != "no"
> +CFLAGS+= -DINET6 -DKAME_SCOPEID
> +SRCS+=   ping6.c
> +LIBADD+= md
> +.endif
>  
>  .if ${MK_DYNAMICROOT} == "no"
>  .warning ${PROG} built without libcasper support


-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368018 - head/sys/modules/dtb/allwinner

2020-11-25 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 25 11:21:03 2020
New Revision: 368018
URL: https://svnweb.freebsd.org/changeset/base/368018

Log:
  dtb: allwinner: Add pineh64 to the build

Modified:
  head/sys/modules/dtb/allwinner/Makefile

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Wed Nov 25 11:20:04 2020
(r368017)
+++ head/sys/modules/dtb/allwinner/Makefile Wed Nov 25 11:21:03 2020
(r368018)
@@ -47,7 +47,9 @@ DTS=  \
allwinner/sun50i-a64-pinebook.dts \
allwinner/sun50i-a64-sopine-baseboard.dts \
allwinner/sun50i-h5-orangepi-pc2.dts \
-   allwinner/sun50i-h5-nanopi-neo2.dts
+   allwinner/sun50i-h5-nanopi-neo2.dts \
+   allwinner/sun50i-h6-pine-h64.dts \
+   allwinner/sun50i-h6-pine-h64-model-b.dts
 
 DTSO=  sun50i-a64-opp.dtso \
sun50i-a64-pwm.dtso \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368017 - head/sys/arm/allwinner

2020-11-25 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 25 11:20:04 2020
New Revision: 368017
URL: https://svnweb.freebsd.org/changeset/base/368017

Log:
  arm: allwinner: aw_rtc: Add H6 compatible

Modified:
  head/sys/arm/allwinner/aw_rtc.c

Modified: head/sys/arm/allwinner/aw_rtc.c
==
--- head/sys/arm/allwinner/aw_rtc.c Wed Nov 25 11:19:42 2020
(r368016)
+++ head/sys/arm/allwinner/aw_rtc.c Wed Nov 25 11:20:04 2020
(r368017)
@@ -138,6 +138,7 @@ static struct ofw_compat_data compat_data[] = {
{ "allwinner,sun6i-a31-rtc", (uintptr_t) _conf },
{ "allwinner,sun8i-h3-rtc", (uintptr_t) _conf },
{ "allwinner,sun50i-h5-rtc", (uintptr_t) _conf },
+   { "allwinner,sun50i-h6-rtc", (uintptr_t) _conf },
{ NULL, 0 }
 };
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r368016 - head/sys/arm/allwinner/clkng

2020-11-25 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov 25 11:19:42 2020
New Revision: 368016
URL: https://svnweb.freebsd.org/changeset/base/368016

Log:
  arm64: allwinner: H6: Fix pll 4x clocks
  
  The clock configured by the registers are the 4x version not the 1x.

Modified:
  head/sys/arm/allwinner/clkng/ccu_h6.c

Modified: head/sys/arm/allwinner/clkng/ccu_h6.c
==
--- head/sys/arm/allwinner/clkng/ccu_h6.c   Wed Nov 25 10:56:38 2020
(r368015)
+++ head/sys/arm/allwinner/clkng/ccu_h6.c   Wed Nov 25 11:19:42 2020
(r368016)
@@ -196,10 +196,10 @@ NMM_CLK(pll_ddr0_clk,
 28, 1000,  /* lock */
 AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK);/* flags */
 
-static const char *pll_peri0_parents[] = {"osc24M"};
-NMM_CLK(pll_peri0_clk,
-CLK_PLL_PERIPH0,   /* id */
-"pll_periph0", pll_peri0_parents,  /* name, parents */
+static const char *pll_peri0_4x_parents[] = {"osc24M"};
+NMM_CLK(pll_peri0_4x_clk,
+CLK_PLL_PERIPH0_4X,/* id */
+"pll_periph0_4x", pll_peri0_4x_parents,/* name, parents */
 0x20,  /* offset */
 8, 7, 0, 0,/* n factor */
 0, 1, 0, 0,/* m0 factor */
@@ -207,7 +207,7 @@ NMM_CLK(pll_peri0_clk,
 31,/* gate */
 28, 1000,  /* lock */
 AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK);/* flags */
-static const char *pll_peri0_2x_parents[] = {"pll_periph0"};
+static const char *pll_peri0_2x_parents[] = {"pll_periph0_4x"};
 FIXED_CLK(pll_peri0_2x_clk,
 CLK_PLL_PERIPH0_2X,/* id */
 "pll_periph0_2x",  /* name */
@@ -216,20 +216,20 @@ FIXED_CLK(pll_peri0_2x_clk,
 1, /* mult */
 2, /* div */
 0);/* flags */
-static const char *pll_peri0_4x_parents[] = {"pll_periph0"};
-FIXED_CLK(pll_peri0_4x_clk,
-CLK_PLL_PERIPH0_4X,/* id */
-"pll_periph0_4x",  /* name */
-pll_peri0_4x_parents,  /* parent */
+static const char *pll_peri0_parents[] = {"pll_periph0_4x"};
+FIXED_CLK(pll_peri0_clk,
+CLK_PLL_PERIPH0,   /* id */
+"pll_periph0", /* name */
+pll_peri0_parents, /* parent */
 0, /* freq */
 1, /* mult */
 4, /* div */
 0);/* flags */
 
-static const char *pll_peri1_parents[] = {"osc24M"};
-NMM_CLK(pll_peri1_clk,
-CLK_PLL_PERIPH1,   /* id */
-"pll_periph1", pll_peri1_parents,  /* name, parents */
+static const char *pll_peri1_4x_parents[] = {"osc24M"};
+NMM_CLK(pll_peri1_4x_clk,
+CLK_PLL_PERIPH1_4X,/* id */
+"pll_periph1_4x", pll_peri1_4x_parents,/* name, parents */
 0x28,  /* offset */
 8, 7, 0, 0,/* n factor */
 0, 1, 0, 0,/* m0 factor */
@@ -237,7 +237,7 @@ NMM_CLK(pll_peri1_clk,
 31,/* gate */
 28, 1000,  /* lock */
 AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK);/* flags */
-static const char *pll_peri1_2x_parents[] = {"pll_periph1"};
+static const char *pll_peri1_2x_parents[] = {"pll_periph1_4x"};
 FIXED_CLK(pll_peri1_2x_clk,
 CLK_PLL_PERIPH1_2X,/* id */
 "pll_periph1_2x",  /* name */
@@ -246,11 +246,11 @@ FIXED_CLK(pll_peri1_2x_clk,
 1, /* mult */
 2, /* div */
 0);/* flags */
-static const char *pll_peri1_4x_parents[] = {"pll_periph1"};
-FIXED_CLK(pll_peri1_4x_clk,
-CLK_PLL_PERIPH1_4X,/* id */
-"pll_periph1_4x",  /* name */
-pll_peri1_4x_parents,  /* parent */
+static const char *pll_peri1_parents[] = {"pll_periph1_4x"};
+FIXED_CLK(pll_peri1_clk,
+CLK_PLL_PERIPH1,   /* id */
+"pll_periph1", /* name */
+pll_peri1_parents, /* parent */
 0, /* freq */
 1, /* mult */
 4, /* div */
@@ -268,10 +268,10 @@ NMM_CLK(pll_gpu_clk,
 28, 1000,  /* lock */
 AW_CLK_HAS_GATE | AW_CLK_HAS_LOCK);/* flags */
 
-static const char 

Re: svn commit: r367994 - head/release/arm

2020-11-24 Thread Emmanuel Vadot
On Tue, 24 Nov 2020 11:56:53 -0700
Ian Lepore  wrote:

> On Tue, 2020-11-24 at 17:52 +0000, Emmanuel Vadot wrote:
> > Author: manu
> > Date: Tue Nov 24 17:52:01 2020
> > New Revision: 367994
> > URL: https://svnweb.freebsd.org/changeset/base/367994
> > 
> > Log:
> >   Release: arm: Remove config for old boards
> >   
> >   All those board are impossible to buy nowadays and could boot using
> > the
> >   GENERICSD image after putting the correct u-boot on them.
> >   
> 
> The imx6 boards are most certainly not impossible to buy.  But I think
> they do work with the generic kernel.
> 
> -- Ian

 Wandboard seems to be obtainable from wandboard.org but there is so
many of them, does u-boot-wandboard works with all of them ?
 Same question for the hummingboard, I see some hummingboard on
solid-run website but I don't know if u-boot-cubox-hummingboard is made
for them or not.
 And yes they do boot with GENERIC kernel, in fact the release image
have been using GENERIC kernel for a long time.

> >   Reviewed by:  imp
> >   Relnotes: yes
> >   Differential Revision:https://reviews.freebsd.org/D27282
> > 
> > Deleted:
> >   head/release/arm/BANANAPI.conf
> >   head/release/arm/CUBIEBOARD.conf
> >   head/release/arm/CUBIEBOARD2.conf
> >   head/release/arm/CUBOX-HUMMINGBOARD.conf
> >   head/release/arm/PANDABOARD.conf
> >   head/release/arm/WANDBOARD.conf
> 


-- 
Emmanuel Vadot  
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367995 - head/release/arm

2020-11-24 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 24 17:53:13 2020
New Revision: 367995
URL: https://svnweb.freebsd.org/changeset/base/367995

Log:
  release: Merge the RPI2 and BEAGLEBONE image with the GENERICSD one
  
  Both RPI2 and BEAGLEBONE are still popular and used arm boards.
  Both u-boots can coexist as they are named differently and live in the
  fat partition.
  This leave us with only one image that can be used for both of those
  boards and all the other ones supported by FreeBSD provided that you
  install the correct u-boot on it.
  
  Reviewed by:  imp
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D27283

Deleted:
  head/release/arm/BEAGLEBONE.conf
  head/release/arm/RPI2.conf
Modified:
  head/release/arm/GENERICSD.conf

Modified: head/release/arm/GENERICSD.conf
==
--- head/release/arm/GENERICSD.conf Tue Nov 24 17:52:01 2020
(r367994)
+++ head/release/arm/GENERICSD.conf Tue Nov 24 17:53:13 2020
(r367995)
@@ -6,11 +6,64 @@
 EMBEDDED_TARGET_ARCH="armv7"
 EMBEDDED_TARGET="arm"
 EMBEDDEDBUILD=1
+EMBEDDEDPORTS="sysutils/u-boot-beaglebone sysutils/u-boot-rpi2 
sysutils/rpi-firmware"
 FAT_SIZE="50m -b 1m"
 FAT_TYPE="16"
 IMAGE_SIZE="3072M"
 KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
+BBB_UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone"
+RPI_UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2"
+RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware"
+RPI_OL_DIR="${RPI_FIRMWARE_DIR}/overlays"
+OVERLAYS="mmc.dtbo"
 PART_SCHEME="MBR"
 export BOARDNAME="GENERICSD"
+
+arm_install_uboot_rpi2() {
+   UBOOT_FILES="u-boot.bin"
+   RPI_FIRMWARE_FILES="bootcode.bin config.txt \
+   fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \
+   start.elf start_cd.elf start_db.elf start_x.elf \
+   bcm2709-rpi-2-b.dtb"
+   FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+   chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
+   chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+   for _UF in ${UBOOT_FILES}; do
+   chroot ${CHROOTDIR} cp -p ${RPI_UBOOT_DIR}/${_UF} \
+   ${FATMOUNT}/${_UF}
+   done
+   for _UF in ${RPI_FIRMWARE_FILES}; do
+   chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \
+   ${FATMOUNT}/${_UF}
+   done
+   chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays
+   for _OL in ${OVERLAYS}; do
+   chroot ${CHROOTDIR} cp -p ${RPI_OL_DIR}/${_OL} \
+   ${FATMOUNT}/overlays/${_OL}
+   done
+   sync
+   umount_loop ${CHROOTDIR}/${FATMOUNT}
+   chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+   
+   return 0
+}
+
+arm_install_uboot_bbb() {
+   FATMOUNT="${DESTDIR%${KERNEL}}/fat"
+   chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}"
+   chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT}
+   chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/MLO ${FATMOUNT}/MLO
+   chroot ${CHROOTDIR} cp -p ${BBB_UBOOT_DIR}/u-boot.img 
${FATMOUNT}/u-boot.img
+   sync
+   umount_loop ${CHROOTDIR}/${FATMOUNT}
+   chroot ${CHROOTDIR} rmdir ${FATMOUNT}
+
+   return 0
+}
+
+arm_install_uboot() {
+   arm_install_uboot_bbb
+   arm_install_uboot_rpi2
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367994 - head/release/arm

2020-11-24 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 24 17:52:01 2020
New Revision: 367994
URL: https://svnweb.freebsd.org/changeset/base/367994

Log:
  Release: arm: Remove config for old boards
  
  All those board are impossible to buy nowadays and could boot using the
  GENERICSD image after putting the correct u-boot on them.
  
  Reviewed by:  imp
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D27282

Deleted:
  head/release/arm/BANANAPI.conf
  head/release/arm/CUBIEBOARD.conf
  head/release/arm/CUBIEBOARD2.conf
  head/release/arm/CUBOX-HUMMINGBOARD.conf
  head/release/arm/PANDABOARD.conf
  head/release/arm/WANDBOARD.conf
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367993 - head/sys/arm/amlogic/aml8726

2020-11-24 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 24 17:51:10 2020
New Revision: 367993
URL: https://svnweb.freebsd.org/changeset/base/367993

Log:
  arm: Remove old amlogic support
  
  Remove the port for aml8726.
  Kernel config was removed in r346096 and this port was never migrated
  to GENERIC.
  It is also impossible to obtain such hardware nowadays.
  
  Reviewed by:  imp
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D27281

Deleted:
  head/sys/arm/amlogic/aml8726/aml8726_ccm.c
  head/sys/arm/amlogic/aml8726/aml8726_ccm.h
  head/sys/arm/amlogic/aml8726/aml8726_clkmsr.c
  head/sys/arm/amlogic/aml8726/aml8726_clkmsr.h
  head/sys/arm/amlogic/aml8726/aml8726_fb.c
  head/sys/arm/amlogic/aml8726/aml8726_fb.h
  head/sys/arm/amlogic/aml8726/aml8726_gpio.c
  head/sys/arm/amlogic/aml8726/aml8726_i2c.c
  head/sys/arm/amlogic/aml8726/aml8726_identsoc.c
  head/sys/arm/amlogic/aml8726/aml8726_if_dwc.c
  head/sys/arm/amlogic/aml8726/aml8726_l2cache.c
  head/sys/arm/amlogic/aml8726/aml8726_machdep.c
  head/sys/arm/amlogic/aml8726/aml8726_machdep.h
  head/sys/arm/amlogic/aml8726/aml8726_mmc.c
  head/sys/arm/amlogic/aml8726/aml8726_mmc.h
  head/sys/arm/amlogic/aml8726/aml8726_mp.c
  head/sys/arm/amlogic/aml8726/aml8726_pic.c
  head/sys/arm/amlogic/aml8726/aml8726_pinctrl.c
  head/sys/arm/amlogic/aml8726/aml8726_pinctrl.h
  head/sys/arm/amlogic/aml8726/aml8726_rng.c
  head/sys/arm/amlogic/aml8726/aml8726_rtc.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.c
  head/sys/arm/amlogic/aml8726/aml8726_sdxc-m8.h
  head/sys/arm/amlogic/aml8726/aml8726_soc.h
  head/sys/arm/amlogic/aml8726/aml8726_timer.c
  head/sys/arm/amlogic/aml8726/aml8726_uart.h
  head/sys/arm/amlogic/aml8726/aml8726_uart_console.c
  head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m3.c
  head/sys/arm/amlogic/aml8726/aml8726_usb_phy-m6.c
  head/sys/arm/amlogic/aml8726/aml8726_wdt.c
  head/sys/arm/amlogic/aml8726/files.aml8726
  head/sys/arm/amlogic/aml8726/std.aml8726
  head/sys/arm/amlogic/aml8726/uart_dev_aml8726.c
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367992 - head/sys/arm/rockchip

2020-11-24 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 24 17:50:22 2020
New Revision: 367992
URL: https://svnweb.freebsd.org/changeset/base/367992

Log:
  arm: Remove old rockchip support
  
  Remove the port for rk30xx.
  Kernel config was removed in r346096 and this port was never migrated
  to GENERIC.
  It is also impossible to obtain such hardware nowadays and this code
  don't provide anything beside booting.
  
  Reviewed by:  imp
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D27280

Deleted:
  head/sys/arm/rockchip/files.rk30xx
  head/sys/arm/rockchip/rk30xx_gpio.c
  head/sys/arm/rockchip/rk30xx_grf.c
  head/sys/arm/rockchip/rk30xx_grf.h
  head/sys/arm/rockchip/rk30xx_machdep.c
  head/sys/arm/rockchip/rk30xx_mp.c
  head/sys/arm/rockchip/rk30xx_mp.h
  head/sys/arm/rockchip/rk30xx_pmu.c
  head/sys/arm/rockchip/rk30xx_pmu.h
  head/sys/arm/rockchip/rk30xx_wdog.c
  head/sys/arm/rockchip/rk30xx_wdog.h
  head/sys/arm/rockchip/std.rk30xx
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367984 - head/sys/arm64/arm64

2020-11-24 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 24 14:05:35 2020
New Revision: 367984
URL: https://svnweb.freebsd.org/changeset/base/367984

Log:
  arm64: Check if we have a map before checking the flags
  
  This fixes amdgpu on arm64 where linuxkpi is calling id_mapped
  and we call might_bounce without a map.

Modified:
  head/sys/arm64/arm64/busdma_bounce.c

Modified: head/sys/arm64/arm64/busdma_bounce.c
==
--- head/sys/arm64/arm64/busdma_bounce.cTue Nov 24 13:19:31 2020
(r367983)
+++ head/sys/arm64/arm64/busdma_bounce.cTue Nov 24 14:05:35 2020
(r367984)
@@ -207,7 +207,7 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus
 {
 
/* Memory allocated by bounce_bus_dmamem_alloc won't bounce */
-   if ((map->flags & DMAMAP_FROM_DMAMEM) != 0)
+   if (map && (map->flags & DMAMAP_FROM_DMAMEM) != 0)
return (false);
 
if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367940 - head/sys/dev/dwc

2020-11-22 Thread Emmanuel Vadot
Author: manu
Date: Sun Nov 22 20:16:46 2020
New Revision: 367940
URL: https://svnweb.freebsd.org/changeset/base/367940

Log:
  if_dwc: Correctly configure the DMA engine based on the fdt properties
  
  Do not hardcode what we setup for the DMA engine configuration but
  lookup the fdt properties and configuring accordingly.
  Use a default value of 8 for the burst dma length for both TX and
  RX, this is what we used for TX before.

Modified:
  head/sys/dev/dwc/if_dwc.c
  head/sys/dev/dwc/if_dwc.h

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Sun Nov 22 18:54:14 2020(r367939)
+++ head/sys/dev/dwc/if_dwc.c   Sun Nov 22 20:16:46 2020(r367940)
@@ -1496,6 +1496,9 @@ dwc_attach(device_t dev)
uint32_t reg;
char *phy_mode;
phandle_t node;
+   uint32_t txpbl, rxpbl;
+   bool nopblx8 = false;
+   bool fixed_burst = false;
 
sc = device_get_softc(dev);
sc->dev = dev;
@@ -1513,6 +1516,15 @@ dwc_attach(device_t dev)
OF_prop_free(phy_mode);
}
 
+   if (OF_getencprop(node, "snps,txpbl", , sizeof(uint32_t)) <= 0)
+   txpbl = 8;
+   if (OF_getencprop(node, "snps,rxpbl", , sizeof(uint32_t)) <= 0)
+   rxpbl = 8;
+   if (OF_hasprop(node, "snps,no-pbl-x8") == 1)
+   nopblx8 = true;
+   if (OF_hasprop(node, "snps,fixed-burst") == 1)
+   fixed_burst = true;
+
if (IF_DWC_INIT(dev) != 0)
return (ENXIO);
 
@@ -1550,12 +1562,13 @@ dwc_attach(device_t dev)
return (ENXIO);
}
 
-   if (sc->mactype != DWC_GMAC_EXT_DESC) {
-   reg = BUS_MODE_FIXEDBURST;
-   reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT);
-   } else
-   reg = (BUS_MODE_EIGHTXPBL);
-   reg |= (BUS_MODE_PBL_BEATS_8 << BUS_MODE_PBL_SHIFT);
+   reg = BUS_MODE_USP;
+   if (!nopblx8)
+   reg |= BUS_MODE_EIGHTXPBL;
+   reg |= (txpbl << BUS_MODE_PBL_SHIFT);
+   reg |= (rxpbl << BUS_MODE_RPBL_SHIFT);
+   if (fixed_burst)
+   reg |= BUS_MODE_FIXEDBURST;
WRITE4(sc, BUS_MODE, reg);
 
/*

Modified: head/sys/dev/dwc/if_dwc.h
==
--- head/sys/dev/dwc/if_dwc.h   Sun Nov 22 18:54:14 2020(r367939)
+++ head/sys/dev/dwc/if_dwc.h   Sun Nov 22 20:16:46 2020(r367940)
@@ -220,6 +220,8 @@
 /* DMA */
 #defineBUS_MODE0x1000
 #define BUS_MODE_EIGHTXPBL (1 << 24) /* Multiplies PBL by 8 */
+#define BUS_MODE_USP   (1 << 23)
+#define BUS_MODE_RPBL_SHIFT17 /* Single block transfer size */
 #define BUS_MODE_FIXEDBURST(1 << 16)
 #define BUS_MODE_PRIORXTX_SHIFT14
 #define BUS_MODE_PRIORXTX_41   3
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367938 - head/release/arm64

2020-11-22 Thread Emmanuel Vadot
Author: manu
Date: Sun Nov 22 18:42:08 2020
New Revision: 367938
URL: https://svnweb.freebsd.org/changeset/base/367938

Log:
  release: rpi3: Copy the bcm2710 variant of the rpi2
  
  This is the dtb intented to be used for booting RPI2 v1.2 in aarch64.

Modified:
  head/release/arm64/RPI3.conf

Modified: head/release/arm64/RPI3.conf
==
--- head/release/arm64/RPI3.confSun Nov 22 16:13:09 2020
(r367937)
+++ head/release/arm64/RPI3.confSun Nov 22 18:42:08 2020
(r367938)
@@ -4,7 +4,7 @@
 #
 
 DTB_DIR="/usr/local/share/rpi-firmware"
-DTB="bcm2709-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb 
bcm2711-rpi-4-b.dtb"
+DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb 
bcm2711-rpi-4-b.dtb"
 EMBEDDED_TARGET_ARCH="aarch64"
 EMBEDDED_TARGET="arm64"
 EMBEDDEDBUILD=1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367888 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:31:25 2020
New Revision: 367888
URL: https://svnweb.freebsd.org/changeset/base/367888

Log:
  if_dwc: Add checksum offloading support

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:31:04 2020(r367887)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:31:25 2020(r367888)
@@ -155,7 +155,6 @@ __FBSDID("$FreeBSD$");
 #defineRDESC0_FS   (1U <<  9)  /* First Descriptor */
 #defineRDESC0_LS   (1U <<  8)  /* Last Descriptor */
 #defineRDESC0_ICE  (1U <<  7)  /* IPC Checksum Error */
-#defineRDESC0_GF   (1U <<  7)  /* Giant Frame */
 #defineRDESC0_LC   (1U <<  6)  /* Late Collision */
 #defineRDESC0_FT   (1U <<  5)  /* Frame Type */
 #defineRDESC0_RWT  (1U <<  4)  /* Receive Watchdog 
Timeout */
@@ -628,7 +627,7 @@ dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int 
 
 inline static void
 dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr,
-uint32_t len)
+  uint32_t len, uint32_t flags)
 {
uint32_t desc0, desc1;
 
@@ -641,10 +640,10 @@ dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_ad
if (sc->mactype != DWC_GMAC_EXT_DESC) {
desc0 = 0;
desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS |
-   NTDESC1_IC | len;
+   NTDESC1_IC | len | flags;
} else {
desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS |
-   ETDESC0_IC;
+   ETDESC0_IC | flags;
desc1 = len;
}
++sc->txcount;
@@ -667,6 +666,7 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct 
struct bus_dma_segment seg;
int error, nsegs;
struct mbuf * m;
+   uint32_t flags = 0;
 
if ((m = m_defrag(*mp, M_NOWAIT)) == NULL)
return (ENOMEM);
@@ -685,8 +685,22 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct 
 
sc->txbuf_map[idx].mbuf = m;
 
-   dwc_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len);
+   if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) {
+   if ((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) != 0) {
+   if (sc->mactype != DWC_GMAC_EXT_DESC)
+   flags = NTDESC1_CIC_FULL;
+   else
+   flags = ETDESC0_CIC_FULL;
+   } else {
+   if (sc->mactype != DWC_GMAC_EXT_DESC)
+   flags = NTDESC1_CIC_HDR;
+   else
+   flags = ETDESC0_CIC_HDR;
+   }
+   }
 
+   dwc_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len, flags);
+
return (0);
 }
 
@@ -807,6 +821,18 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwde
m->m_len = len;
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
 
+   if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0 &&
+ (rdesc0 & RDESC0_FT) != 0) {
+   m->m_pkthdr.csum_flags = CSUM_IP_CHECKED;
+   if ((rdesc0 & RDESC0_ICE) == 0)
+   m->m_pkthdr.csum_flags |= CSUM_IP_VALID;
+   if ((rdesc0 & RDESC0_PCE) == 0) {
+   m->m_pkthdr.csum_flags |=
+   CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
+   m->m_pkthdr.csum_data = 0x;
+   }
+   }
+
/* Remove trailing FCS */
m_adj(m, -ETHER_CRC_LEN);
 
@@ -893,7 +919,7 @@ setup_dma(struct dwc_softc *sc)
"could not create TX buffer DMA map.\n");
goto out;
}
-   dwc_setup_txdesc(sc, idx, 0, 0);
+   dwc_setup_txdesc(sc, idx, 0, 0, 0);
}
 
/*
@@ -1139,6 +1165,14 @@ dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
/* No work to do except acknowledge the change took */
if_togglecapenable(ifp, IFCAP_VLAN_MTU);
}
+   if (mask & IFCAP_RXCSUM)
+   if_togglecapenable(ifp, IFCAP_RXCSUM);
+   if (mask & IFCAP_TXCSUM)
+   if_togglecapenable(ifp, IFCAP_TXCSUM);
+   if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0)
+   if_sethwassistbits(ifp, CSUM_IP | CSUM_UDP | CSUM_TCP, 
0);
+   else
+   if_sethwassistbits(ifp, 0, CSUM_IP | CSUM_UDP | 
CSUM_TCP);
break;
 
default:
@@ -1173,7 +1207,7 @@ dwc_txfinish_locked(struct dwc_softc *sc)
bus_dmamap_unload(sc->txbuf_tag, bmap->map);

svn commit: r367887 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:31:04 2020
New Revision: 367887
URL: https://svnweb.freebsd.org/changeset/base/367887

Log:
  if_dwc: Add flow control support

Modified:
  head/sys/dev/dwc/if_dwc.c
  head/sys/dev/dwc/if_dwc.h

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:30:44 2020(r367886)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:31:04 2020(r367887)
@@ -224,6 +224,10 @@ static void dwc_stop_dma(struct dwc_softc *sc);
 
 static void dwc_tick(void *arg);
 
+/* Pause time field in the transmitted control frame */
+static int dwc_pause_time = 0x;
+TUNABLE_INT("hw.dwc.pause_time", _pause_time);
+
 /*
  * MIIBUS functions
  */
@@ -333,6 +337,15 @@ dwc_miibus_statchg(device_t dev)
else
reg &= ~(CONF_DM);
WRITE4(sc, MAC_CONFIGURATION, reg);
+
+   reg = FLOW_CONTROL_UP;
+   if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0)
+   reg |= FLOW_CONTROL_TX;
+   if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0)
+   reg |= FLOW_CONTROL_RX;
+   if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0)
+   reg |= dwc_pause_time << FLOW_CONTROL_PT_SHIFT;
+   WRITE4(sc, FLOW_CONTROL, reg);
 
IF_DWC_SET_SPEED(dev, IFM_SUBTYPE(mii->mii_media_active));
 

Modified: head/sys/dev/dwc/if_dwc.h
==
--- head/sys/dev/dwc/if_dwc.h   Fri Nov 20 11:30:44 2020(r367886)
+++ head/sys/dev/dwc/if_dwc.h   Fri Nov 20 11:31:04 2020(r367887)
@@ -70,6 +70,10 @@
 #define GMII_ADDRESS_GB(1 << 0)/* Busy */
 #defineGMII_DATA   0x14
 #defineFLOW_CONTROL0x18
+#define FLOW_CONTROL_PT_SHIFT  16
+#define FLOW_CONTROL_UP(1 << 3)/* Unicast pause enable 
*/
+#define FLOW_CONTROL_RX(1 << 2)/* RX Flow control 
enable */
+#define FLOW_CONTROL_TX(1 << 1)/* TX Flow control 
enable */
 #defineGMAC_VLAN_TAG   0x1C
 #defineVERSION 0x20
 #defineDEBUG   0x24
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367886 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:30:44 2020
New Revision: 367886
URL: https://svnweb.freebsd.org/changeset/base/367886

Log:
  if_awg: Add a awg_dma_start_tx function that trigger dma engine
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:30:23 2020
(r367885)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:30:44 2020
(r367886)
@@ -941,6 +941,18 @@ awg_setup_dma(device_t dev)
return (0);
 }
 
+static void
+awg_dma_start_tx(struct awg_softc *sc)
+{
+   uint32_t val;
+
+   AWG_ASSERT_LOCKED(sc);
+
+   /* Start and run TX DMA */
+   val = RD4(sc, EMAC_TX_CTL_1);
+   WR4(sc, EMAC_TX_CTL_1, val | TX_DMA_START);
+}
+
 /*
  * if_ functions
  */
@@ -949,7 +961,6 @@ static void
 awg_start_locked(struct awg_softc *sc)
 {
struct mbuf *m;
-   uint32_t val;
if_t ifp;
int cnt, err;
 
@@ -984,9 +995,7 @@ awg_start_locked(struct awg_softc *sc)
bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map,
BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
 
-   /* Start and run TX DMA */
-   val = RD4(sc, EMAC_TX_CTL_1);
-   WR4(sc, EMAC_TX_CTL_1, val | TX_DMA_START);
+   awg_dma_start_tx(sc);
}
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367885 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:30:23 2020
New Revision: 367885
URL: https://svnweb.freebsd.org/changeset/base/367885

Log:
  if_dwc: Use if_ function where appropriate
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:30:01 2020(r367884)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:30:23 2020(r367885)
@@ -983,25 +983,26 @@ dwc_txstart_locked(struct dwc_softc *sc)
 
ifp = sc->ifp;
 
-   if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
+   if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING|IFF_DRV_OACTIVE)) !=
+   IFF_DRV_RUNNING)
return;
 
enqueued = 0;
 
for (;;) {
if (sc->txcount == (TX_DESC_COUNT - 1)) {
-   ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+   if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0);
break;
}
 
-   IFQ_DRV_DEQUEUE(>if_snd, m);
+   m = if_dequeue(ifp);
if (m == NULL)
break;
if (dwc_setup_txbuf(sc, sc->tx_idx_head, ) != 0) {
-IFQ_DRV_PREPEND(>if_snd, m);
+   if_sendq_prepend(ifp, m);
break;
}
-   BPF_MTAP(ifp, m);
+   if_bpfmtap(ifp, m);
sc->tx_idx_head = next_txidx(sc, sc->tx_idx_head);
++enqueued;
}
@@ -1029,7 +1030,7 @@ dwc_init_locked(struct dwc_softc *sc)
 
DWC_ASSERT_LOCKED(sc);
 
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
return;
 
dwc_setup_rxfilter(sc);
@@ -1065,7 +1066,7 @@ dwc_stop_locked(struct dwc_softc *sc)
DWC_ASSERT_LOCKED(sc);
 
ifp = sc->ifp;
-   ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
+   if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
sc->tx_watchdog_count = 0;
sc->stats_harvest_count = 0;
 
@@ -1081,7 +1082,7 @@ dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct dwc_softc *sc;
struct mii_data *mii;
struct ifreq *ifr;
-   int mask, error;
+   int flags, mask, error;
 
sc = ifp->if_softc;
ifr = (struct ifreq *)data;
@@ -1090,25 +1091,25 @@ dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
switch (cmd) {
case SIOCSIFFLAGS:
DWC_LOCK(sc);
-   if (ifp->if_flags & IFF_UP) {
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-   if ((ifp->if_flags ^ sc->if_flags) &
-   (IFF_PROMISC | IFF_ALLMULTI))
+   if (if_getflags(ifp) & IFF_UP) {
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
+   flags = if_getflags(ifp) ^ sc->if_flags;
+   if ((flags & (IFF_PROMISC|IFF_ALLMULTI)) != 0)
dwc_setup_rxfilter(sc);
} else {
if (!sc->is_detaching)
dwc_init_locked(sc);
}
} else {
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
dwc_stop_locked(sc);
}
-   sc->if_flags = ifp->if_flags;
+   sc->if_flags = if_getflags(ifp);
DWC_UNLOCK(sc);
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
-   if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
DWC_LOCK(sc);
dwc_setup_rxfilter(sc);
DWC_UNLOCK(sc);
@@ -1120,10 +1121,10 @@ dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, >mii_media, cmd);
break;
case SIOCSIFCAP:
-   mask = ifp->if_capenable ^ ifr->ifr_reqcap;
+   mask = ifr->ifr_reqcap ^ if_getcapenable(ifp);
if (mask & IFCAP_VLAN_MTU) {
/* No work to do except acknowledge the change took */
-   ifp->if_capenable ^= IFCAP_VLAN_MTU;
+   if_togglecapenable(ifp, IFCAP_VLAN_MTU);
}
break;
 
@@ -1161,7 +1162,7 @@ dwc_txfinish_locked(struct dwc_softc *sc)
bmap->mbuf = NULL;
dwc_setup_txdesc(sc, sc->tx_idx_tail, 0, 0);
sc->tx_idx_tail = next_txidx(sc, sc->tx_idx_tail);
-   ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+   if_setdrvflagbits(ifp, 0, 

svn commit: r367884 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:30:01 2020
New Revision: 367884
URL: https://svnweb.freebsd.org/changeset/base/367884

Log:
  if_dwc: Reorder functions and sort them by usage
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:29:37 2020(r367883)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:30:01 2020(r367884)
@@ -195,6 +195,12 @@ struct dwc_hwdesc
uint32_t addr2; /* ptr to next descriptor / second buffer data*/
 };
 
+
+struct dwc_hash_maddr_ctx {
+   struct dwc_softc *sc;
+   uint32_t hash[8];
+};
+
 /*
  * The hardware imposes alignment restrictions on various objects involved in
  * DMA transfers.  These values are expressed in bytes (not bits).
@@ -216,281 +222,461 @@ static void dwc_enable_mac(struct dwc_softc *sc, bool 
 static void dwc_init_dma(struct dwc_softc *sc);
 static void dwc_stop_dma(struct dwc_softc *sc);
 
-static inline uint32_t
-next_rxidx(struct dwc_softc *sc, uint32_t curidx)
-{
+static void dwc_tick(void *arg);
 
-   return ((curidx + 1) % RX_DESC_COUNT);
-}
+/*
+ * MIIBUS functions
+ */
 
-static inline uint32_t
-next_txidx(struct dwc_softc *sc, uint32_t curidx)
+static int
+dwc_miibus_read_reg(device_t dev, int phy, int reg)
 {
+   struct dwc_softc *sc;
+   uint16_t mii;
+   size_t cnt;
+   int rv = 0;
 
-   return ((curidx + 1) % TX_DESC_COUNT);
-}
+   sc = device_get_softc(dev);
 
-static void
-dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
-{
+   mii = ((phy & GMII_ADDRESS_PA_MASK) << GMII_ADDRESS_PA_SHIFT)
+   | ((reg & GMII_ADDRESS_GR_MASK) << GMII_ADDRESS_GR_SHIFT)
+   | (sc->mii_clk << GMII_ADDRESS_CR_SHIFT)
+   | GMII_ADDRESS_GB; /* Busy flag */
 
-   if (error != 0)
-   return;
-   *(bus_addr_t *)arg = segs[0].ds_addr;
-}
+   WRITE4(sc, GMII_ADDRESS, mii);
 
-inline static void
-dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr,
-uint32_t len)
-{
-   uint32_t desc0, desc1;
-
-   /* Addr/len 0 means we're clearing the descriptor after xmit done. */
-   if (paddr == 0 || len == 0) {
-   desc0 = 0;
-   desc1 = 0;
-   --sc->txcount;
-   } else {
-   if (sc->mactype != DWC_GMAC_EXT_DESC) {
-   desc0 = 0;
-   desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS |
-   NTDESC1_IC | len;
-   } else {
-   desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS |
-   ETDESC0_IC;
-   desc1 = len;
+   for (cnt = 0; cnt < 1000; cnt++) {
+   if (!(READ4(sc, GMII_ADDRESS) & GMII_ADDRESS_GB)) {
+   rv = READ4(sc, GMII_DATA);
+   break;
}
-   ++sc->txcount;
+   DELAY(10);
}
 
-   sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr);
-   sc->txdesc_ring[idx].desc0 = desc0;
-   sc->txdesc_ring[idx].desc1 = desc1;
-
-   if (paddr && len) {
-   wmb();
-   sc->txdesc_ring[idx].desc0 |= TDESC0_OWN;
-   wmb();
-   }
+   return rv;
 }
 
 static int
-dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp)
+dwc_miibus_write_reg(device_t dev, int phy, int reg, int val)
 {
-   struct bus_dma_segment seg;
-   int error, nsegs;
-   struct mbuf * m;
+   struct dwc_softc *sc;
+   uint16_t mii;
+   size_t cnt;
 
-   if ((m = m_defrag(*mp, M_NOWAIT)) == NULL)
-   return (ENOMEM);
-   *mp = m;
+   sc = device_get_softc(dev);
 
-   error = bus_dmamap_load_mbuf_sg(sc->txbuf_tag, sc->txbuf_map[idx].map,
-   m, , , 0);
-   if (error != 0) {
-   return (ENOMEM);
-   }
+   mii = ((phy & GMII_ADDRESS_PA_MASK) << GMII_ADDRESS_PA_SHIFT)
+   | ((reg & GMII_ADDRESS_GR_MASK) << GMII_ADDRESS_GR_SHIFT)
+   | (sc->mii_clk << GMII_ADDRESS_CR_SHIFT)
+   | GMII_ADDRESS_GB | GMII_ADDRESS_GW;
 
-   KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs));
+   WRITE4(sc, GMII_DATA, val);
+   WRITE4(sc, GMII_ADDRESS, mii);
 
-   bus_dmamap_sync(sc->txbuf_tag, sc->txbuf_map[idx].map,
-   BUS_DMASYNC_PREWRITE);
+   for (cnt = 0; cnt < 1000; cnt++) {
+   if (!(READ4(sc, GMII_ADDRESS) & GMII_ADDRESS_GB)) {
+   break;
+}
+   DELAY(10);
+   }
 
-   sc->txbuf_map[idx].mbuf = m;
-
-   dwc_setup_txdesc(sc, idx, seg.ds_addr, seg.ds_len);
-
return (0);
 }
 
 static void
-dwc_txstart_locked(struct dwc_softc *sc)
+dwc_miibus_statchg(device_t dev)
 {
-   struct ifnet *ifp;
-   struct mbuf *m;
-   int enqueued;
+  

svn commit: r367883 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:29:37 2020
New Revision: 367883
URL: https://svnweb.freebsd.org/changeset/base/367883

Log:
  if_awg: Reorder functions and sort them by usage
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:29:20 2020
(r367882)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:29:37 2020
(r367883)
@@ -217,7 +217,10 @@ static struct resource_spec awg_spec[] = {
 };
 
 static void awg_txeof(struct awg_softc *sc);
+static void awg_start_locked(struct awg_softc *sc);
 
+static void awg_tick(void *softc);
+
 static int awg_parse_delay(device_t dev, uint32_t *tx_delay,
 uint32_t *rx_delay);
 static uint32_t syscon_read_emac_clk_reg(device_t dev);
@@ -225,6 +228,10 @@ static void syscon_write_emac_clk_reg(device_t dev, ui
 static phandle_t awg_get_phy_node(device_t dev);
 static bool awg_has_internal_phy(device_t dev);
 
+/*
+ * MII functions
+ */
+
 static int
 awg_miibus_readreg(device_t dev, int phy, int reg)
 {
@@ -346,6 +353,10 @@ awg_miibus_statchg(device_t dev)
WR4(sc, EMAC_TX_FLOW_CTL, val);
 }
 
+/*
+ * Media functions
+ */
+
 static void
 awg_media_status(if_t ifp, struct ifmediareq *ifmr)
 {
@@ -379,6 +390,217 @@ awg_media_change(if_t ifp)
return (error);
 }
 
+/*
+ * Core functions
+ */
+
+/* Bit Reversal - http://aggregate.org/MAGIC/#Bit%20Reversal */
+static uint32_t
+bitrev32(uint32_t x)
+{
+   x = (((x & 0x) >> 1) | ((x & 0x) << 1));
+   x = (((x & 0x) >> 2) | ((x & 0x) << 2));
+   x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4));
+   x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8));
+
+   return (x >> 16) | (x << 16);
+}
+
+static u_int
+awg_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
+{
+   uint32_t crc, hashreg, hashbit, *hash = arg;
+
+   crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN) & 0x7f;
+   crc = bitrev32(~crc) >> 26;
+   hashreg = (crc >> 5);
+   hashbit = (crc & 0x1f);
+   hash[hashreg] |= (1 << hashbit);
+
+   return (1);
+}
+
+static void
+awg_setup_rxfilter(struct awg_softc *sc)
+{
+   uint32_t val, hash[2], machi, maclo;
+   uint8_t *eaddr;
+   if_t ifp;
+
+   AWG_ASSERT_LOCKED(sc);
+
+   ifp = sc->ifp;
+   val = 0;
+   hash[0] = hash[1] = 0;
+
+   if (if_getflags(ifp) & IFF_PROMISC)
+   val |= DIS_ADDR_FILTER;
+   else if (if_getflags(ifp) & IFF_ALLMULTI) {
+   val |= RX_ALL_MULTICAST;
+   hash[0] = hash[1] = ~0;
+   } else if (if_foreach_llmaddr(ifp, awg_hash_maddr, hash) > 0)
+   val |= HASH_MULTICAST;
+
+   /* Write our unicast address */
+   eaddr = IF_LLADDR(ifp);
+   machi = (eaddr[5] << 8) | eaddr[4];
+   maclo = (eaddr[3] << 24) | (eaddr[2] << 16) | (eaddr[1] << 8) |
+  (eaddr[0] << 0);
+   WR4(sc, EMAC_ADDR_HIGH(0), machi);
+   WR4(sc, EMAC_ADDR_LOW(0), maclo);
+
+   /* Multicast hash filters */
+   WR4(sc, EMAC_RX_HASH_0, hash[1]);
+   WR4(sc, EMAC_RX_HASH_1, hash[0]);
+
+   /* RX frame filter config */
+   WR4(sc, EMAC_RX_FRM_FLT, val);
+}
+
+static void
+awg_setup_core(struct awg_softc *sc)
+{
+   uint32_t val;
+
+   AWG_ASSERT_LOCKED(sc);
+   /* Configure DMA burst length and priorities */
+   val = awg_burst_len << BASIC_CTL_BURST_LEN_SHIFT;
+   if (awg_rx_tx_pri)
+   val |= BASIC_CTL_RX_TX_PRI;
+   WR4(sc, EMAC_BASIC_CTL_1, val);
+
+}
+
+static void
+awg_enable_mac(struct awg_softc *sc, bool enable)
+{
+   uint32_t tx, rx;
+
+   AWG_ASSERT_LOCKED(sc);
+
+   tx = RD4(sc, EMAC_TX_CTL_0);
+   rx = RD4(sc, EMAC_RX_CTL_0);
+   if (enable) {
+   tx |= TX_EN;
+   rx |= RX_EN | CHECK_CRC;
+   } else {
+   tx &= ~TX_EN;
+   rx &= ~(RX_EN | CHECK_CRC);
+   }
+
+   WR4(sc, EMAC_TX_CTL_0, tx);
+   WR4(sc, EMAC_RX_CTL_0, rx);
+}
+
+static void 
+awg_get_eaddr(device_t dev, uint8_t *eaddr)
+{
+   struct awg_softc *sc;
+   uint32_t maclo, machi, rnd;
+   u_char rootkey[16];
+   uint32_t rootkey_size;
+
+   sc = device_get_softc(dev);
+
+   machi = RD4(sc, EMAC_ADDR_HIGH(0)) & 0x;
+   maclo = RD4(sc, EMAC_ADDR_LOW(0));
+
+   rootkey_size = sizeof(rootkey);
+   if (maclo == 0x && machi == 0x) {
+   /* MAC address in hardware is invalid, create one */
+   if (aw_sid_get_fuse(AW_SID_FUSE_ROOTKEY, rootkey,
+   _size) == 0 &&
+   (rootkey[3] | rootkey[12] | rootkey[13] | rootkey[14] |
+rootkey[15]) != 0) {
+   /* MAC address is derived from the root key in SID */
+   maclo = (rootkey[13] << 24) | 

svn commit: r367882 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:29:20 2020
New Revision: 367882
URL: https://svnweb.freebsd.org/changeset/base/367882

Log:
  if_dwc: dwc_get_hwaddr cannot fail, change return to void
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:29:00 2020(r367881)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:29:20 2020(r367882)
@@ -1153,7 +1153,7 @@ out:
return (0);
 }
 
-static int
+static void
 dwc_get_hwaddr(struct dwc_softc *sc, uint8_t *hwaddr)
 {
uint32_t hi, lo, rnd;
@@ -1185,8 +1185,6 @@ dwc_get_hwaddr(struct dwc_softc *sc, uint8_t *hwaddr)
hwaddr[4] = rnd >>  8;
hwaddr[5] = rnd >>  0;
}
-
-   return (0);
 }
 
 #defineGPIO_ACTIVE_LOW 1
@@ -1336,10 +1334,7 @@ dwc_attach(device_t dev)
}
 
/* Read MAC before reset */
-   if (dwc_get_hwaddr(sc, macaddr)) {
-   device_printf(sc->dev, "can't get mac\n");
-   return (ENXIO);
-   }
+   dwc_get_hwaddr(sc, macaddr);
 
/* Reset the PHY if needed */
if (dwc_reset(dev) != 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367881 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:29:00 2020
New Revision: 367881
URL: https://svnweb.freebsd.org/changeset/base/367881

Log:
  if_dwc: Add dwc_stop_dma and use it in dwc_stop_locked
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:28:23 2020(r367880)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:29:00 2020(r367881)
@@ -214,6 +214,7 @@ static void dwc_setup_rxfilter(struct dwc_softc *sc);
 static void dwc_setup_core(struct dwc_softc *sc);
 static void dwc_enable_mac(struct dwc_softc *sc, bool enable);
 static void dwc_init_dma(struct dwc_softc *sc);
+static void dwc_stop_dma(struct dwc_softc *sc);
 
 static inline uint32_t
 next_rxidx(struct dwc_softc *sc, uint32_t curidx)
@@ -359,7 +360,6 @@ static void
 dwc_stop_locked(struct dwc_softc *sc)
 {
struct ifnet *ifp;
-   uint32_t reg;
 
DWC_ASSERT_LOCKED(sc);
 
@@ -370,22 +370,8 @@ dwc_stop_locked(struct dwc_softc *sc)
 
callout_stop(>dwc_callout);
 
-   /* Stop DMA TX */
-   reg = READ4(sc, OPERATION_MODE);
-   reg &= ~(MODE_ST);
-   WRITE4(sc, OPERATION_MODE, reg);
-
-   /* Flush TX */
-   reg = READ4(sc, OPERATION_MODE);
-   reg |= (MODE_FTF);
-   WRITE4(sc, OPERATION_MODE, reg);
-
+   dwc_stop_dma(sc);
dwc_enable_mac(sc, false);
-
-   /* Stop DMA RX */
-   reg = READ4(sc, OPERATION_MODE);
-   reg &= ~(MODE_SR);
-   WRITE4(sc, OPERATION_MODE, reg);
 }
 
 static void dwc_clear_stats(struct dwc_softc *sc)
@@ -816,6 +802,29 @@ dwc_init_dma(struct dwc_softc *sc)
/* Start DMA */
reg = READ4(sc, OPERATION_MODE);
reg |= (MODE_ST | MODE_SR);
+   WRITE4(sc, OPERATION_MODE, reg);
+}
+
+static void
+dwc_stop_dma(struct dwc_softc *sc)
+{
+   uint32_t reg;
+
+   DWC_ASSERT_LOCKED(sc);
+
+   /* Stop DMA TX */
+   reg = READ4(sc, OPERATION_MODE);
+   reg &= ~(MODE_ST);
+   WRITE4(sc, OPERATION_MODE, reg);
+
+   /* Flush TX */
+   reg = READ4(sc, OPERATION_MODE);
+   reg |= (MODE_FTF);
+   WRITE4(sc, OPERATION_MODE, reg);
+
+   /* Stop DMA RX */
+   reg = READ4(sc, OPERATION_MODE);
+   reg &= ~(MODE_SR);
WRITE4(sc, OPERATION_MODE, reg);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367880 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:28:23 2020
New Revision: 367880
URL: https://svnweb.freebsd.org/changeset/base/367880

Log:
  if_awg: Add awg_stop_dma and use it in awg_stop
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:28:06 2020
(r367879)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:28:23 2020
(r367880)
@@ -781,6 +781,31 @@ awg_init_dma(struct awg_softc *sc)
 }
 
 static void
+awg_stop_dma(struct awg_softc *sc)
+{
+   uint32_t val;
+
+   AWG_ASSERT_LOCKED(sc);
+
+   /* Stop transmit DMA and flush data in the TX FIFO */
+   val = RD4(sc, EMAC_TX_CTL_1);
+   val &= ~TX_DMA_EN;
+   val |= FLUSH_TX_FIFO;
+   WR4(sc, EMAC_TX_CTL_1, val);
+
+   /* Disable interrupts */
+   awg_disable_dma_intr(sc);
+
+   /* Disable transmit DMA */
+   val = RD4(sc, EMAC_TX_CTL_1);
+   WR4(sc, EMAC_TX_CTL_1, val & ~TX_DMA_EN);
+
+   /* Disable receive DMA */
+   val = RD4(sc, EMAC_RX_CTL_1);
+   WR4(sc, EMAC_RX_CTL_1, val & ~RX_DMA_EN);
+}
+
+static void
 awg_init_locked(struct awg_softc *sc)
 {
struct mii_data *mii;
@@ -830,24 +855,8 @@ awg_stop(struct awg_softc *sc)
 
callout_stop(>stat_ch);
 
-   /* Stop transmit DMA and flush data in the TX FIFO */
-   val = RD4(sc, EMAC_TX_CTL_1);
-   val &= ~TX_DMA_EN;
-   val |= FLUSH_TX_FIFO;
-   WR4(sc, EMAC_TX_CTL_1, val);
-
+   awg_stop_dma(sc);
awg_enable_mac(sc, false);
-
-   /* Disable interrupts */
-   awg_disable_dma_intr(sc);
-
-   /* Disable transmit DMA */
-   val = RD4(sc, EMAC_TX_CTL_1);
-   WR4(sc, EMAC_TX_CTL_1, val & ~TX_DMA_EN);
-
-   /* Disable receive DMA */
-   val = RD4(sc, EMAC_RX_CTL_1);
-   WR4(sc, EMAC_RX_CTL_1, val & ~RX_DMA_EN);
 
sc->link = 0;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367879 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:28:06 2020
New Revision: 367879
URL: https://svnweb.freebsd.org/changeset/base/367879

Log:
  if_dwc: Use dwc_enable_mac in dwc_stop_locked
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:27:43 2020(r367878)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:28:06 2020(r367879)
@@ -380,10 +380,7 @@ dwc_stop_locked(struct dwc_softc *sc)
reg |= (MODE_FTF);
WRITE4(sc, OPERATION_MODE, reg);
 
-   /* Stop transmitters */
-   reg = READ4(sc, MAC_CONFIGURATION);
-   reg &= ~(CONF_TE | CONF_RE);
-   WRITE4(sc, MAC_CONFIGURATION, reg);
+   dwc_enable_mac(sc, false);
 
/* Stop DMA RX */
reg = READ4(sc, OPERATION_MODE);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367878 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:27:43 2020
New Revision: 367878
URL: https://svnweb.freebsd.org/changeset/base/367878

Log:
  if_dwc: Add a function to enable/disable the mac tx/rx
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:27:26 2020(r367877)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:27:43 2020(r367878)
@@ -212,6 +212,7 @@ static void dwc_rxfinish_locked(struct dwc_softc *sc);
 static void dwc_stop_locked(struct dwc_softc *sc);
 static void dwc_setup_rxfilter(struct dwc_softc *sc);
 static void dwc_setup_core(struct dwc_softc *sc);
+static void dwc_enable_mac(struct dwc_softc *sc, bool enable);
 static void dwc_init_dma(struct dwc_softc *sc);
 
 static inline uint32_t
@@ -483,6 +484,7 @@ dwc_init_locked(struct dwc_softc *sc)
 
dwc_setup_rxfilter(sc);
dwc_setup_core(sc);
+   dwc_enable_mac(sc, true);
dwc_init_dma(sc);
 
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
@@ -778,10 +780,23 @@ dwc_setup_core(struct dwc_softc *sc)
 
DWC_ASSERT_LOCKED(sc);
 
-   /* Enable transmitters */
+   /* Enable core */
reg = READ4(sc, MAC_CONFIGURATION);
reg |= (CONF_JD | CONF_ACS | CONF_BE);
-   reg |= (CONF_TE | CONF_RE);
+   WRITE4(sc, MAC_CONFIGURATION, reg);
+}
+
+static void
+dwc_enable_mac(struct dwc_softc *sc, bool enable)
+{
+   uint32_t reg;
+
+   DWC_ASSERT_LOCKED(sc);
+   reg = READ4(sc, MAC_CONFIGURATION);
+   if (enable)
+   reg |= CONF_TE | CONF_RE;
+   else
+   reg &= ~(CONF_TE | CONF_RE);
WRITE4(sc, MAC_CONFIGURATION, reg);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367877 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:27:26 2020
New Revision: 367877
URL: https://svnweb.freebsd.org/changeset/base/367877

Log:
  if_awg: Add a function to enable/disable the mac tx/rx
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:27:08 2020
(r367876)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:27:26 2020
(r367877)
@@ -716,15 +716,30 @@ awg_setup_core(struct awg_softc *sc)
val |= BASIC_CTL_RX_TX_PRI;
WR4(sc, EMAC_BASIC_CTL_1, val);
 
-   /* Enable transmitter */
-   val = RD4(sc, EMAC_TX_CTL_0);
-   WR4(sc, EMAC_TX_CTL_0, val | TX_EN);
+}
 
-   /* Enable receiver */
-   val = RD4(sc, EMAC_RX_CTL_0);
-   WR4(sc, EMAC_RX_CTL_0, val | RX_EN | CHECK_CRC);
+static void
+awg_enable_mac(struct awg_softc *sc, bool enable)
+{
+   uint32_t tx, rx;
+
+   AWG_ASSERT_LOCKED(sc);
+
+   tx = RD4(sc, EMAC_TX_CTL_0);
+   rx = RD4(sc, EMAC_RX_CTL_0);
+   if (enable) {
+   tx |= TX_EN;
+   rx |= RX_EN | CHECK_CRC;
+   } else {
+   tx &= ~TX_EN;
+   rx &= ~(RX_EN | CHECK_CRC);
+   }
+
+   WR4(sc, EMAC_TX_CTL_0, tx);
+   WR4(sc, EMAC_RX_CTL_0, rx);
 }
 
+
 static void
 awg_enable_dma_intr(struct awg_softc *sc)
 {
@@ -781,6 +796,7 @@ awg_init_locked(struct awg_softc *sc)
 
awg_setup_rxfilter(sc);
awg_setup_core(sc);
+   awg_enable_mac(sc, true);
awg_init_dma(sc);
 
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
@@ -820,13 +836,7 @@ awg_stop(struct awg_softc *sc)
val |= FLUSH_TX_FIFO;
WR4(sc, EMAC_TX_CTL_1, val);
 
-   /* Disable transmitter */
-   val = RD4(sc, EMAC_TX_CTL_0);
-   WR4(sc, EMAC_TX_CTL_0, val & ~TX_EN);
-
-   /* Disable receiver */
-   val = RD4(sc, EMAC_RX_CTL_0);
-   WR4(sc, EMAC_RX_CTL_0, val & ~RX_EN);
+   awg_enable_mac(sc, false);
 
/* Disable interrupts */
awg_disable_dma_intr(sc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367876 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:27:08 2020
New Revision: 367876
URL: https://svnweb.freebsd.org/changeset/base/367876

Log:
  if_dwc: Use if_setdrvflagbits to notify that we are running
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:26:46 2020(r367875)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:27:08 2020(r367876)
@@ -481,11 +481,11 @@ dwc_init_locked(struct dwc_softc *sc)
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
return;
 
-   ifp->if_drv_flags |= IFF_DRV_RUNNING;
-
dwc_setup_rxfilter(sc);
dwc_setup_core(sc);
dwc_init_dma(sc);
+
+   if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
 
/*
 * Call mii_mediachg() which will call back into dwc_miibus_statchg()
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367875 - head/sys/dev/dwc

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:26:46 2020
New Revision: 367875
URL: https://svnweb.freebsd.org/changeset/base/367875

Log:
  if_dwc: Split init code into sub function
  
  Be clear of what we enable or init.
  
  No functional changes intended

Modified:
  head/sys/dev/dwc/if_dwc.c

Modified: head/sys/dev/dwc/if_dwc.c
==
--- head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:26:20 2020(r367874)
+++ head/sys/dev/dwc/if_dwc.c   Fri Nov 20 11:26:46 2020(r367875)
@@ -211,6 +211,8 @@ static void dwc_txfinish_locked(struct dwc_softc *sc);
 static void dwc_rxfinish_locked(struct dwc_softc *sc);
 static void dwc_stop_locked(struct dwc_softc *sc);
 static void dwc_setup_rxfilter(struct dwc_softc *sc);
+static void dwc_setup_core(struct dwc_softc *sc);
+static void dwc_init_dma(struct dwc_softc *sc);
 
 static inline uint32_t
 next_rxidx(struct dwc_softc *sc, uint32_t curidx)
@@ -473,7 +475,6 @@ static void
 dwc_init_locked(struct dwc_softc *sc)
 {
struct ifnet *ifp = sc->ifp;
-   uint32_t reg;
 
DWC_ASSERT_LOCKED(sc);
 
@@ -483,27 +484,9 @@ dwc_init_locked(struct dwc_softc *sc)
ifp->if_drv_flags |= IFF_DRV_RUNNING;
 
dwc_setup_rxfilter(sc);
+   dwc_setup_core(sc);
+   dwc_init_dma(sc);
 
-   /* Initializa DMA and enable transmitters */
-   reg = READ4(sc, OPERATION_MODE);
-   reg |= (MODE_TSF | MODE_OSF | MODE_FUF);
-   reg &= ~(MODE_RSF);
-   reg |= (MODE_RTC_LEV32 << MODE_RTC_SHIFT);
-   WRITE4(sc, OPERATION_MODE, reg);
-
-   WRITE4(sc, INTERRUPT_ENABLE, INT_EN_DEFAULT);
-
-   /* Start DMA */
-   reg = READ4(sc, OPERATION_MODE);
-   reg |= (MODE_ST | MODE_SR);
-   WRITE4(sc, OPERATION_MODE, reg);
-
-   /* Enable transmitters */
-   reg = READ4(sc, MAC_CONFIGURATION);
-   reg |= (CONF_JD | CONF_ACS | CONF_BE);
-   reg |= (CONF_TE | CONF_RE);
-   WRITE4(sc, MAC_CONFIGURATION, reg);
-
/*
 * Call mii_mediachg() which will call back into dwc_miibus_statchg()
 * to set up the remaining config registers based on current media.
@@ -786,6 +769,42 @@ dwc_setup_rxfilter(struct dwc_softc *sc)
for (i = 0; i < nhash; i++)
WRITE4(sc, HASH_TABLE_REG(i), ctx.hash[i]);
}
+}
+
+static void
+dwc_setup_core(struct dwc_softc *sc)
+{
+   uint32_t reg;
+
+   DWC_ASSERT_LOCKED(sc);
+
+   /* Enable transmitters */
+   reg = READ4(sc, MAC_CONFIGURATION);
+   reg |= (CONF_JD | CONF_ACS | CONF_BE);
+   reg |= (CONF_TE | CONF_RE);
+   WRITE4(sc, MAC_CONFIGURATION, reg);
+}
+
+static void
+dwc_init_dma(struct dwc_softc *sc)
+{
+   uint32_t reg;
+
+   DWC_ASSERT_LOCKED(sc);
+
+   /* Initializa DMA and enable transmitters */
+   reg = READ4(sc, OPERATION_MODE);
+   reg |= (MODE_TSF | MODE_OSF | MODE_FUF);
+   reg &= ~(MODE_RSF);
+   reg |= (MODE_RTC_LEV32 << MODE_RTC_SHIFT);
+   WRITE4(sc, OPERATION_MODE, reg);
+
+   WRITE4(sc, INTERRUPT_ENABLE, INT_EN_DEFAULT);
+
+   /* Start DMA */
+   reg = READ4(sc, OPERATION_MODE);
+   reg |= (MODE_ST | MODE_SR);
+   WRITE4(sc, OPERATION_MODE, reg);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367874 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:26:20 2020
New Revision: 367874
URL: https://svnweb.freebsd.org/changeset/base/367874

Log:
  if_awg: Split init code into sub function
  
  Be clear of what we enable or init.
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:25:54 2020
(r367873)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:26:20 2020
(r367874)
@@ -705,50 +705,55 @@ awg_setup_rxfilter(struct awg_softc *sc)
 }
 
 static void
-awg_enable_intr(struct awg_softc *sc)
+awg_setup_core(struct awg_softc *sc)
 {
+   uint32_t val;
+
+   AWG_ASSERT_LOCKED(sc);
+   /* Configure DMA burst length and priorities */
+   val = awg_burst_len << BASIC_CTL_BURST_LEN_SHIFT;
+   if (awg_rx_tx_pri)
+   val |= BASIC_CTL_RX_TX_PRI;
+   WR4(sc, EMAC_BASIC_CTL_1, val);
+
+   /* Enable transmitter */
+   val = RD4(sc, EMAC_TX_CTL_0);
+   WR4(sc, EMAC_TX_CTL_0, val | TX_EN);
+
+   /* Enable receiver */
+   val = RD4(sc, EMAC_RX_CTL_0);
+   WR4(sc, EMAC_RX_CTL_0, val | RX_EN | CHECK_CRC);
+}
+
+static void
+awg_enable_dma_intr(struct awg_softc *sc)
+{
/* Enable interrupts */
WR4(sc, EMAC_INT_EN, RX_INT_EN | TX_INT_EN | TX_BUF_UA_INT_EN);
 }
 
 static void
-awg_disable_intr(struct awg_softc *sc)
+awg_disable_dma_intr(struct awg_softc *sc)
 {
/* Disable interrupts */
WR4(sc, EMAC_INT_EN, 0);
 }
 
 static void
-awg_init_locked(struct awg_softc *sc)
+awg_init_dma(struct awg_softc *sc)
 {
-   struct mii_data *mii;
uint32_t val;
-   if_t ifp;
 
-   mii = device_get_softc(sc->miibus);
-   ifp = sc->ifp;
-
AWG_ASSERT_LOCKED(sc);
 
-   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
-   return;
-
-   awg_setup_rxfilter(sc);
-
-   /* Configure DMA burst length and priorities */
-   val = awg_burst_len << BASIC_CTL_BURST_LEN_SHIFT;
-   if (awg_rx_tx_pri)
-   val |= BASIC_CTL_RX_TX_PRI;
-   WR4(sc, EMAC_BASIC_CTL_1, val);
-
/* Enable interrupts */
 #ifdef DEVICE_POLLING
-   if ((if_getcapenable(ifp) & IFCAP_POLLING) == 0)
-   awg_enable_intr(sc);
+   if ((if_getcapenable(sc->ifp) & IFCAP_POLLING) == 0)
+   awg_enable_dma_intr(sc);
else
-   awg_disable_intr(sc);
+   awg_disable_dma_intr(sc);
 #else
-   awg_enable_intr(sc);
+   awg_enable_dma_intr(sc);
 #endif
 
/* Enable transmit DMA */
@@ -758,15 +763,26 @@ awg_init_locked(struct awg_softc *sc)
/* Enable receive DMA */
val = RD4(sc, EMAC_RX_CTL_1);
WR4(sc, EMAC_RX_CTL_1, val | RX_DMA_EN | RX_MD);
+}
 
-   /* Enable transmitter */
-   val = RD4(sc, EMAC_TX_CTL_0);
-   WR4(sc, EMAC_TX_CTL_0, val | TX_EN);
+static void
+awg_init_locked(struct awg_softc *sc)
+{
+   struct mii_data *mii;
+   if_t ifp;
 
-   /* Enable receiver */
-   val = RD4(sc, EMAC_RX_CTL_0);
-   WR4(sc, EMAC_RX_CTL_0, val | RX_EN | CHECK_CRC);
+   mii = device_get_softc(sc->miibus);
+   ifp = sc->ifp;
 
+   AWG_ASSERT_LOCKED(sc);
+
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
+   return;
+
+   awg_setup_rxfilter(sc);
+   awg_setup_core(sc);
+   awg_init_dma(sc);
+
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
 
mii_mediachg(mii);
@@ -813,7 +829,7 @@ awg_stop(struct awg_softc *sc)
WR4(sc, EMAC_RX_CTL_0, val & ~RX_EN);
 
/* Disable interrupts */
-   awg_disable_intr(sc);
+   awg_disable_dma_intr(sc);
 
/* Disable transmit DMA */
val = RD4(sc, EMAC_TX_CTL_1);
@@ -1101,13 +1117,13 @@ awg_ioctl(if_t ifp, u_long cmd, caddr_t data)
if (error != 0)
break;
AWG_LOCK(sc);
-   awg_disable_intr(sc);
+   awg_disable_dma_intr(sc);
if_setcapenablebit(ifp, IFCAP_POLLING, 0);
AWG_UNLOCK(sc);
} else {
error = ether_poll_deregister(ifp);
AWG_LOCK(sc);
-   awg_enable_intr(sc);
+   awg_enable_dma_intr(sc);
if_setcapenablebit(ifp, 0, IFCAP_POLLING);
AWG_UNLOCK(sc);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367873 - head/sys/arm/allwinner

2020-11-20 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov 20 11:25:54 2020
New Revision: 367873
URL: https://svnweb.freebsd.org/changeset/base/367873

Log:
  if_awg: Remove the taskqueue for miibus_statchg
  
  I guess it was added so we can obtain the device lock but we already
  have it when the function is called.
  
  No functional changes intended

Modified:
  head/sys/arm/allwinner/if_awg.c

Modified: head/sys/arm/allwinner/if_awg.c
==
--- head/sys/arm/allwinner/if_awg.c Fri Nov 20 10:48:19 2020
(r367872)
+++ head/sys/arm/allwinner/if_awg.c Fri Nov 20 11:25:54 2020
(r367873)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -199,7 +198,6 @@ struct awg_softc {
device_tdev;
device_tmiibus;
struct callout  stat_ch;
-   struct task link_task;
void*ih;
u_int   mdc_div_ratio_m;
int link;
@@ -284,11 +282,14 @@ awg_miibus_writereg(device_t dev, int phy, int reg, in
 }
 
 static void
-awg_update_link_locked(struct awg_softc *sc)
+awg_miibus_statchg(device_t dev)
 {
+   struct awg_softc *sc;
struct mii_data *mii;
uint32_t val;
 
+   sc = device_get_softc(dev);
+
AWG_ASSERT_LOCKED(sc);
 
if ((if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) == 0)
@@ -346,28 +347,6 @@ awg_update_link_locked(struct awg_softc *sc)
 }
 
 static void
-awg_link_task(void *arg, int pending)
-{
-   struct awg_softc *sc;
-
-   sc = arg;
-
-   AWG_LOCK(sc);
-   awg_update_link_locked(sc);
-   AWG_UNLOCK(sc);
-}
-
-static void
-awg_miibus_statchg(device_t dev)
-{
-   struct awg_softc *sc;
-
-   sc = device_get_softc(dev);
-
-   taskqueue_enqueue(taskqueue_swi, >link_task);
-}
-
-static void
 awg_media_status(if_t ifp, struct ifmediareq *ifmr)
 {
struct awg_softc *sc;
@@ -1873,7 +1852,6 @@ awg_attach(device_t dev)
 
mtx_init(>mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF);
callout_init_mtx(>stat_ch, >mtx, 0);
-   TASK_INIT(>link_task, 0, awg_link_task, sc);
 
/* Setup clocks and regulators */
error = awg_setup_extres(dev);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367843 - head/release/arm64

2020-11-19 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 19 14:27:01 2020
New Revision: 367843
URL: https://svnweb.freebsd.org/changeset/base/367843

Log:
  release: Switch the Allwinner board to GPT
  
  Allwinner bootrom have an alternate location for u-boot at 128k.
  Work was made recently in u-boot to relocate correctly if loaded from
  there.
  The advantage of this offset is that we can now use a GPT scheme.

Modified:
  head/release/arm64/PINE64-LTS.conf
  head/release/arm64/PINE64.conf
  head/release/arm64/PINEBOOK.conf

Modified: head/release/arm64/PINE64-LTS.conf
==
--- head/release/arm64/PINE64-LTS.conf  Thu Nov 19 10:00:48 2020
(r367842)
+++ head/release/arm64/PINE64-LTS.conf  Thu Nov 19 14:27:01 2020
(r367843)
@@ -13,7 +13,7 @@ IMAGE_SIZE="3072M"
 KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
-PART_SCHEME="MBR"
+PART_SCHEME="GPT"
 FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp"
 export BOARDNAME="PINE64-LTS"
 
@@ -21,7 +21,7 @@ arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-pine64-lts"
UBOOT_FILES="u-boot-sunxi-with-spl.bin"
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-   of=/dev/${mddev} bs=1k seek=8 conv=sync
+   of=/dev/${mddev} bs=128k seek=1 conv=sync

return 0
 }

Modified: head/release/arm64/PINE64.conf
==
--- head/release/arm64/PINE64.conf  Thu Nov 19 10:00:48 2020
(r367842)
+++ head/release/arm64/PINE64.conf  Thu Nov 19 14:27:01 2020
(r367843)
@@ -13,7 +13,7 @@ IMAGE_SIZE="3072M"
 KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
-PART_SCHEME="MBR"
+PART_SCHEME="GPT"
 FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp"
 export BOARDNAME="PINE64"
 
@@ -21,7 +21,7 @@ arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-pine64"
UBOOT_FILES="u-boot-sunxi-with-spl.bin"
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-   of=/dev/${mddev} bs=1k seek=8 conv=sync
+   of=/dev/${mddev} bs=128k seek=1 conv=sync

return 0
 }

Modified: head/release/arm64/PINEBOOK.conf
==
--- head/release/arm64/PINEBOOK.confThu Nov 19 10:00:48 2020
(r367842)
+++ head/release/arm64/PINEBOOK.confThu Nov 19 14:27:01 2020
(r367843)
@@ -13,7 +13,7 @@ IMAGE_SIZE="3072M"
 KERNEL="GENERIC"
 MD_ARGS="-x 63 -y 255"
 NODOC=1
-PART_SCHEME="MBR"
+PART_SCHEME="GPT"
 FDT_OVERLAYS="sun50i-a64-timer,sun50i-a64-opp"
 export BOARDNAME="PINEBOOK"
 
@@ -21,7 +21,7 @@ arm_install_uboot() {
UBOOT_DIR="/usr/local/share/u-boot/u-boot-pinebook"
UBOOT_FILES="u-boot-sunxi-with-spl.bin"
chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
-   of=/dev/${mddev} bs=1k seek=8 conv=sync
+   of=/dev/${mddev} bs=128k seek=1 conv=sync
 
return 0
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367767 - head/sys/dev/extres/syscon

2020-11-17 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 17 14:59:58 2020
New Revision: 367767
URL: https://svnweb.freebsd.org/changeset/base/367767

Log:
  syscon: Add syscon_get_by_ofw_node
  
  This allow to get a syscon node defined under a specific fdt node (which isn't
  always the device one).

Modified:
  head/sys/dev/extres/syscon/syscon.c
  head/sys/dev/extres/syscon/syscon.h

Modified: head/sys/dev/extres/syscon/syscon.c
==
--- head/sys/dev/extres/syscon/syscon.c Tue Nov 17 14:58:30 2020
(r367766)
+++ head/sys/dev/extres/syscon/syscon.c Tue Nov 17 14:59:58 2020
(r367767)
@@ -264,6 +264,21 @@ syscon_get_ofw_node(struct syscon *syscon)
 }
 
 int
+syscon_get_by_ofw_node(device_t cdev, phandle_t node, struct syscon **syscon)
+{
+
+   SYSCON_TOPO_SLOCK();
+   *syscon = syscon_find_by_ofw_node(node);
+   if (*syscon == NULL) {
+   SYSCON_TOPO_UNLOCK();
+   device_printf(cdev, "Failed to find syscon node\n");
+   return (ENODEV);
+   }
+   SYSCON_TOPO_UNLOCK();
+   return (0);
+}
+
+int
 syscon_get_by_ofw_property(device_t cdev, phandle_t cnode, char *name,
 struct syscon **syscon)
 {

Modified: head/sys/dev/extres/syscon/syscon.h
==
--- head/sys/dev/extres/syscon/syscon.h Tue Nov 17 14:58:30 2020
(r367766)
+++ head/sys/dev/extres/syscon/syscon.h Tue Nov 17 14:59:58 2020
(r367767)
@@ -73,6 +73,7 @@ struct syscon *syscon_create_ofw_node(device_t pdev,
 phandle_t syscon_get_ofw_node(struct syscon *syscon);
 int syscon_get_by_ofw_property(device_t consumer, phandle_t node, char *name,
 struct syscon **syscon);
+int syscon_get_by_ofw_node(device_t cdev, phandle_t node, struct syscon 
**syscon);
 #endif
 
 #endif /* DEV_SYSCON_H */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367766 - head/sys/arm/allwinner/clkng

2020-11-17 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 17 14:58:30 2020
New Revision: 367766
URL: https://svnweb.freebsd.org/changeset/base/367766

Log:
  arm64: allwinner: Init the Display Engine clock
  
  In case u-boot was compiled without video support set the PLL
  to 432Mhz (which allow us to use most of the HDMI resolution for
  tcon) and set it as the parent for the DE clock.

Modified:
  head/sys/arm/allwinner/clkng/ccu_a64.c

Modified: head/sys/arm/allwinner/clkng/ccu_a64.c
==
--- head/sys/arm/allwinner/clkng/ccu_a64.c  Tue Nov 17 14:57:34 2020
(r367765)
+++ head/sys/arm/allwinner/clkng/ccu_a64.c  Tue Nov 17 14:58:30 2020
(r367766)
@@ -789,6 +789,8 @@ static struct aw_clk_init a64_init_clks[] = {
{"ahb1", "pll_periph0", 0, false},
{"ahb2", "pll_periph0", 0, false},
{"dram", "pll_ddr0", 0, false},
+   {"pll_de", NULL, 43200, true},
+   {"de", "pll_de", 0, true},
 };
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367765 - head/sys/arm/allwinner/clkng

2020-11-17 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 17 14:57:34 2020
New Revision: 367765
URL: https://svnweb.freebsd.org/changeset/base/367765

Log:
  arm: allwinner: Add DE2 Clock support for H3 SoC
  
  While here also enable the clock and deassert the reset

Modified:
  head/sys/arm/allwinner/clkng/ccu_de2.c

Modified: head/sys/arm/allwinner/clkng/ccu_de2.c
==
--- head/sys/arm/allwinner/clkng/ccu_de2.c  Tue Nov 17 14:41:23 2020
(r367764)
+++ head/sys/arm/allwinner/clkng/ccu_de2.c  Tue Nov 17 14:57:34 2020
(r367765)
@@ -43,30 +43,52 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef __aarch64__
 #include "opt_soc.h"
+#endif
 
 #include 
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include 
 #include 
 
+enum CCU_DE2 {
+   H3_CCU = 1,
+   A64_CCU,
+};
+
 /* Non exported clocks */
 #defineCLK_MIXER0_DIV  3
 #defineCLK_MIXER1_DIV  4
 #defineCLK_WB_DIV  5
 
-static struct aw_ccung_reset de2_ccu_resets[] = {
+static struct aw_ccung_reset h3_de2_ccu_resets[] = {
CCU_RESET(RST_MIXER0, 0x08, 0)
+   CCU_RESET(RST_WB, 0x08, 2)
+};
+
+static struct aw_ccung_reset a64_de2_ccu_resets[] = {
+   CCU_RESET(RST_MIXER0, 0x08, 0)
CCU_RESET(RST_MIXER1, 0x08, 1)
CCU_RESET(RST_WB, 0x08, 2)
 };
 
-static struct aw_ccung_gate de2_ccu_gates[] = {
+static struct aw_ccung_gate h3_de2_ccu_gates[] = {
CCU_GATE(CLK_BUS_MIXER0, "mixer0", "mixer0-div", 0x00, 0)
+   CCU_GATE(CLK_BUS_WB, "wb", "wb-div", 0x00, 2)
+
+   CCU_GATE(CLK_MIXER0, "bus-mixer0", "bus-de", 0x04, 0)
+   CCU_GATE(CLK_WB, "bus-wb", "bus-de", 0x04, 2)
+};
+
+static struct aw_ccung_gate a64_de2_ccu_gates[] = {
+   CCU_GATE(CLK_BUS_MIXER0, "mixer0", "mixer0-div", 0x00, 0)
CCU_GATE(CLK_BUS_MIXER1, "mixer1", "mixer1-div", 0x00, 1)
CCU_GATE(CLK_BUS_WB, "wb", "wb-div", 0x00, 2)
 
@@ -95,7 +117,7 @@ NM_CLK(mixer1_div_clk,
 4, 4, 0, 0,/* M flags */
 0, 0,  /* mux */
 0, /* gate */
-AW_CLK_SCALE_CHANGE);  /* flags */
+AW_CLK_SCALE_CHANGE);  /* flags */
 
 NM_CLK(wb_div_clk,
 CLK_WB_DIV,/* id */
@@ -105,16 +127,22 @@ NM_CLK(wb_div_clk,
 8, 4, 0, 0,/* M flags */
 0, 0,  /* mux */
 0, /* gate */
-AW_CLK_SCALE_CHANGE);  /* flags */
+AW_CLK_SCALE_CHANGE);  /* flags */
 
-static struct aw_ccung_clk de2_ccu_clks[] = {
+static struct aw_ccung_clk h3_de2_ccu_clks[] = {
{ .type = AW_CLK_NM, .clk.nm = _div_clk},
+   { .type = AW_CLK_NM, .clk.nm = _div_clk},
+};
+
+static struct aw_ccung_clk a64_de2_ccu_clks[] = {
+   { .type = AW_CLK_NM, .clk.nm = _div_clk},
{ .type = AW_CLK_NM, .clk.nm = _div_clk},
{ .type = AW_CLK_NM, .clk.nm = _div_clk},
 };
 
 static struct ofw_compat_data compat_data[] = {
-   {"allwinner,sun50i-a64-de2-clk", 1},
+   {"allwinner,sun8i-h3-de2-clk", H3_CCU},
+   {"allwinner,sun50i-a64-de2-clk", A64_CCU},
{NULL, 0}
 };
 
@@ -136,15 +164,61 @@ static int
 ccu_de2_attach(device_t dev)
 {
struct aw_ccung_softc *sc;
+   phandle_t node;
+   clk_t mod, bus;
+   hwreset_t rst_de;
+   enum CCU_DE2 type;
 
sc = device_get_softc(dev);
+   node = ofw_bus_get_node(dev);
 
-   sc->resets = de2_ccu_resets;
-   sc->nresets = nitems(de2_ccu_resets);
-   sc->gates = de2_ccu_gates;
-   sc->ngates = nitems(de2_ccu_gates);
-   sc->clks = de2_ccu_clks;
-   sc->nclks = nitems(de2_ccu_clks);
+   type = (enum CCU_DE2)ofw_bus_search_compatible(dev, 
compat_data)->ocd_data;
+
+   switch (type) {
+   case H3_CCU:
+   sc->resets = h3_de2_ccu_resets;
+   sc->nresets = nitems(h3_de2_ccu_resets);
+   sc->gates = h3_de2_ccu_gates;
+   sc->ngates = nitems(h3_de2_ccu_gates);
+   sc->clks = h3_de2_ccu_clks;
+   sc->nclks = nitems(h3_de2_ccu_clks);
+   break;
+   case A64_CCU:
+   sc->resets = a64_de2_ccu_resets;
+   sc->nresets = nitems(a64_de2_ccu_resets);
+   sc->gates = a64_de2_ccu_gates;
+   sc->ngates = nitems(a64_de2_ccu_gates);
+   sc->clks = a64_de2_ccu_clks;
+   sc->nclks = nitems(a64_de2_ccu_clks);
+   break;
+   }
+
+   if (hwreset_get_by_ofw_idx(dev, node, 0, _de) != 0) {
+   device_printf(dev, "Cannot get de reset\n");
+   return (ENXIO);
+   }
+   if (hwreset_deassert(rst_de) != 0) {
+   device_printf(dev, "Cannot de-assert de reset\n");
+   return (ENXIO);
+   }
+
+   if (clk_get_by_ofw_name(dev, node, "mod", ) != 0) {
+   

svn commit: r367764 - in head/sys/contrib/vchiq/interface: compat vchiq_arm

2020-11-17 Thread Emmanuel Vadot
Author: manu
Date: Tue Nov 17 14:41:23 2020
New Revision: 367764
URL: https://svnweb.freebsd.org/changeset/base/367764

Log:
  vchiq: Rename timer func so they do not conflict with linuxkpi

Modified:
  head/sys/contrib/vchiq/interface/compat/vchi_bsd.c
  head/sys/contrib/vchiq/interface/compat/vchi_bsd.h
  head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c

Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.c
==
--- head/sys/contrib/vchiq/interface/compat/vchi_bsd.c  Tue Nov 17 14:07:27 
2020(r367763)
+++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.c  Tue Nov 17 14:41:23 
2020(r367764)
@@ -77,7 +77,7 @@ run_timer(void *arg)
 }
 
 void
-init_timer(struct timer_list *t)
+vchiq_init_timer(struct timer_list *t)
 {
mtx_init(>mtx, "dahdi timer lock", NULL, MTX_SPIN);
callout_init(>callout, 1);
@@ -89,15 +89,15 @@ init_timer(struct timer_list *t)
 }
 
 void
-setup_timer(struct timer_list *t, void (*function)(unsigned long), unsigned 
long data)
+vchiq_setup_timer(struct timer_list *t, void (*function)(unsigned long), 
unsigned long data)
 {
t->function = function;
t->data = data;
-   init_timer(t);
+   vchiq_init_timer(t);
 }
 
 void
-mod_timer(struct timer_list *t, unsigned long expires)
+vchiq_mod_timer(struct timer_list *t, unsigned long expires)
 {
mtx_lock_spin(>mtx);
callout_reset(>callout, expires - jiffies, run_timer, t);
@@ -105,13 +105,13 @@ mod_timer(struct timer_list *t, unsigned long expires)
 }
 
 void
-add_timer(struct timer_list *t)
+vchiq_add_timer(struct timer_list *t)
 {
-   mod_timer(t, t->expires);
+   vchiq_mod_timer(t, t->expires);
 }
 
 int
-del_timer_sync(struct timer_list *t)
+vchiq_del_timer_sync(struct timer_list *t)
 {
mtx_lock_spin(>mtx);
callout_stop(>callout);
@@ -122,9 +122,9 @@ del_timer_sync(struct timer_list *t)
 }
 
 int
-del_timer(struct timer_list *t)
+vchiq_del_timer(struct timer_list *t)
 {
-   del_timer_sync(t);
+   vchiq_del_timer_sync(t);
return 0;
 }
 

Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h
==
--- head/sys/contrib/vchiq/interface/compat/vchi_bsd.h  Tue Nov 17 14:07:27 
2020(r367763)
+++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.h  Tue Nov 17 14:41:23 
2020(r367764)
@@ -196,12 +196,12 @@ struct timer_list {
unsigned long data;
 };
 
-void init_timer(struct timer_list *t);
-void setup_timer(struct timer_list *t, void (*function)(unsigned long), 
unsigned long data);
-void mod_timer(struct timer_list *t, unsigned long expires);
-void add_timer(struct timer_list *t);
-int del_timer(struct timer_list *t);
-int del_timer_sync(struct timer_list *t);
+void vchiq_init_timer(struct timer_list *t);
+void vchiq_setup_timer(struct timer_list *t, void (*function)(unsigned long), 
unsigned long data);
+void vchiq_mod_timer(struct timer_list *t, unsigned long expires);
+void vchiq_add_timer(struct timer_list *t);
+int vchiq_del_timer(struct timer_list *t);
+int vchiq_del_timer_sync(struct timer_list *t);
 
 /*
  * Completion API

Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c
==
--- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c  Tue Nov 17 
14:07:27 2020(r367763)
+++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c  Tue Nov 17 
14:41:23 2020(r367764)
@@ -1754,7 +1754,7 @@ vchiq_arm_init_state(VCHIQ_STATE_T *state, VCHIQ_ARM_S
 
arm_state->suspend_timer_timeout = SUSPEND_TIMER_TIMEOUT_MS;
arm_state->suspend_timer_running = 0;
-   init_timer(_state->suspend_timer);
+   vchiq_init_timer(_state->suspend_timer);
arm_state->suspend_timer.data = (unsigned long)(state);
arm_state->suspend_timer.function = suspend_timer_callback;
 
@@ -1892,11 +1892,11 @@ set_resume_state(VCHIQ_ARM_STATE_T *arm_state,
 inline void
 start_suspend_timer(VCHIQ_ARM_STATE_T *arm_state)
 {
-   del_timer(_state->suspend_timer);
+   vchiq_del_timer(_state->suspend_timer);
arm_state->suspend_timer.expires = jiffies +
msecs_to_jiffies(arm_state->
suspend_timer_timeout);
-   add_timer(_state->suspend_timer);
+   vchiq_add_timer(_state->suspend_timer);
arm_state->suspend_timer_running = 1;
 }
 
@@ -1905,7 +1905,7 @@ static inline void
 stop_suspend_timer(VCHIQ_ARM_STATE_T *arm_state)
 {
if (arm_state->suspend_timer_running) {
-   del_timer(_state->suspend_timer);
+   vchiq_del_timer(_state->suspend_timer);
arm_state->suspend_timer_running = 0;
}
 }
___
svn-src-all@freebsd.org mailing list

svn commit: r367722 - head/sys/arm64/freescale/imx

2020-11-16 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov 16 11:54:38 2020
New Revision: 367722
URL: https://svnweb.freebsd.org/changeset/base/367722

Log:
  imx7gpc: Remove unused functions

Modified:
  head/sys/arm64/freescale/imx/imx7gpc.c

Modified: head/sys/arm64/freescale/imx/imx7gpc.c
==
--- head/sys/arm64/freescale/imx/imx7gpc.c  Mon Nov 16 11:53:36 2020
(r367721)
+++ head/sys/arm64/freescale/imx/imx7gpc.c  Mon Nov 16 11:54:38 2020
(r367722)
@@ -59,20 +59,6 @@ static struct ofw_compat_data compat_data[] = {
{ NULL, 0}
 };
 
-static inline uint32_t
-imx7gpc_read_4(struct imx7gpc_softc *sc, int reg)
-{
-
-   return (bus_read_4(sc->memres, reg));
-}
-
-static inline void
-imx7gpc_write_4(struct imx7gpc_softc *sc, int reg, uint32_t val)
-{
-
-bus_write_4(sc->memres, reg, val);
-}
-
 static int
 imx7gpc_activate_intr(device_t dev, struct intr_irqsrc *isrc,
 struct resource *res, struct intr_map_data *data)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367721 - head/sys/dev/mmc/host

2020-11-16 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov 16 11:53:36 2020
New Revision: 367721
URL: https://svnweb.freebsd.org/changeset/base/367721

Log:
  dwmmc: dwmmc_switch_vccq is only used in MMCCAM kernel
  
  Silence the build for non MMCCAM kernel

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Mon Nov 16 11:38:51 2020
(r367720)
+++ head/sys/dev/mmc/host/dwmmc.c   Mon Nov 16 11:53:36 2020
(r367721)
@@ -143,8 +143,8 @@ static int dma_stop(struct dwmmc_softc *);
 static void pio_read(struct dwmmc_softc *, struct mmc_command *);
 static void pio_write(struct dwmmc_softc *, struct mmc_command *);
 static void dwmmc_handle_card_present(struct dwmmc_softc *sc, bool is_present);
-static int dwmmc_switch_vccq(device_t, device_t);
 #ifdef MMCCAM
+static int dwmmc_switch_vccq(device_t, device_t);
 static void dwmmc_cam_action(struct cam_sim *, union ccb *);
 static void dwmmc_cam_poll(struct cam_sim *);
 static int dwmmc_cam_settran_settings(struct dwmmc_softc *, union ccb *);
@@ -1418,6 +1418,7 @@ dwmmc_write_ivar(device_t bus, device_t child, int whi
return (0);
 }
 
+#ifdef MMCCAM
 /* Note: this function likely belongs to the specific driver impl */
 static int
 dwmmc_switch_vccq(device_t dev, device_t child)
@@ -1426,7 +1427,6 @@ dwmmc_switch_vccq(device_t dev, device_t child)
return EINVAL;
 }
 
-#ifdef MMCCAM
 static void
 dwmmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367616 - head/lib/libzstd

2020-11-12 Thread Emmanuel Vadot
Author: manu
Date: Thu Nov 12 14:04:08 2020
New Revision: 367616
URL: https://svnweb.freebsd.org/changeset/base/367616

Log:
  pkgbase: Move libprivatezstd from utilities to runtime
  
  libarchive depends on it by default and tar uses libarchive.
  So on a update :
  1/ runtime contain tar
  2/ runtime have libarchive in shlibs_required
  3/ libarchive packages depends on utilities
  4/ utilities depends on runtime
  5/ kaboom
  
  All users of libprivatezstd (libarchive related stuff and objcopy/ar)
  are already in utilities.
  
  Discussed with: bapt

Modified:
  head/lib/libzstd/Makefile

Modified: head/lib/libzstd/Makefile
==
--- head/lib/libzstd/Makefile   Thu Nov 12 09:26:01 2020(r367615)
+++ head/lib/libzstd/Makefile   Thu Nov 12 14:04:08 2020(r367616)
@@ -40,6 +40,7 @@ CFLAGS+=  -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXX
 LIBADD=pthread
 
 PRIVATELIB=yes
+PACKAGE=   runtime
 
 ZSTDDIR=   ${SRCTOP}/sys/contrib/zstd
 .PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367522 - head/sys/sys

2020-11-09 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov  9 13:20:44 2020
New Revision: 367522
URL: https://svnweb.freebsd.org/changeset/base/367522

Log:
  Bump __FreeBSD_version after linuxkpi changes

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hMon Nov  9 13:20:14 2020(r367521)
+++ head/sys/sys/param.hMon Nov  9 13:20:44 2020(r367522)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300127  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300128  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367521 - in head/sys: compat/linuxkpi/common/include/acpi compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

2020-11-09 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov  9 13:20:14 2020
New Revision: 367521
URL: https://svnweb.freebsd.org/changeset/base/367521

Log:
  LinuxKPI: Implement ACPI bits required by drm-kmod in base system
  
  It includes:
  
  ACPI_HANDLE() implementation.
  AC and VIDEO ACPI events notification support.
  Replacement of hand-rolled GPLed _DSM method evaluation helpers
  with in-base ones.
  
  Submitted by: wulf
  Differential Revision:https://reviews.freebsd.org/D26603

Added:
  head/sys/compat/linuxkpi/common/include/acpi/
  head/sys/compat/linuxkpi/common/include/acpi/acpi.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/include/acpi/video.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/include/linux/acpi.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/src/linux_acpi.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/linuxkpi/Makefile

Added: head/sys/compat/linuxkpi/common/include/acpi/acpi.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/acpi/acpi.h Mon Nov  9 13:20:14 
2020(r367521)
@@ -0,0 +1,100 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2017 Mark Johnston 
+ * Copyright (c) 2020 Vladimir Kondratyev 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _ACPI_ACPI_H_
+#define _ACPI_ACPI_H_
+
+/*
+ * FreeBSD import of ACPICA has a typedef for BOOLEAN which conflicts with
+ * amdgpu driver. Workaround it on preprocessor level.
+ */
+#defineACPI_USE_SYSTEM_INTTYPES
+#defineBOOLEAN unsigned char
+typedef unsigned char  UINT8;
+typedef unsigned short UINT16;
+typedef short  INT16;
+typedef unsigned int   UINT32;
+typedef intINT32;
+typedef uint64_t   UINT64;
+typedef int64_tINT64;
+#include 
+#undef BOOLEAN
+
+typedef ACPI_HANDLEacpi_handle;
+typedef ACPI_OBJECTacpi_object;
+typedef ACPI_OBJECT_HANDLERacpi_object_handler;
+typedef ACPI_OBJECT_TYPE   acpi_object_type;
+typedef ACPI_STATUSacpi_status;
+typedef ACPI_STRINGacpi_string;
+typedef ACPI_SIZE  acpi_size;
+typedef ACPI_WALK_CALLBACK acpi_walk_callback;
+
+static inline ACPI_STATUS
+acpi_evaluate_object(ACPI_HANDLE Object, ACPI_STRING Pathname,
+ACPI_OBJECT_LIST *ParameterObjects, ACPI_BUFFER *ReturnObjectBuffer)
+{
+   return (AcpiEvaluateObject(
+   Object, Pathname, ParameterObjects, ReturnObjectBuffer));
+}
+
+static inline const char *
+acpi_format_exception(ACPI_STATUS Exception)
+{
+   return (AcpiFormatException(Exception));
+}
+
+static inline ACPI_STATUS
+acpi_get_handle(ACPI_HANDLE Parent, ACPI_STRING Pathname,
+ACPI_HANDLE *RetHandle)
+{
+   return (AcpiGetHandle(Parent, Pathname, RetHandle));
+}
+
+static inline ACPI_STATUS
+acpi_get_data(ACPI_HANDLE ObjHandle, ACPI_OBJECT_HANDLER Handler, void **Data)
+{
+   return (AcpiGetData(ObjHandle, Handler, Data));
+}
+
+static inline ACPI_STATUS
+acpi_get_name(ACPI_HANDLE Object, UINT32 NameType, ACPI_BUFFER *RetPathPtr)
+{
+   return (AcpiGetName(Object, NameType, RetPathPtr));
+}
+
+static inline ACPI_STATUS
+acpi_get_table(ACPI_STRING Signature, UINT32 Instance,
+ACPI_TABLE_HEADER **OutTable)
+{
+   return (AcpiGetTable(Signature, Instance, OutTable));
+}
+
+#endif /* _ACPI_ACPI_H_ */

Added: 

svn commit: r367418 - head/release/packages

2020-11-06 Thread Emmanuel Vadot
Author: manu
Date: Fri Nov  6 15:21:53 2020
New Revision: 367418
URL: https://svnweb.freebsd.org/changeset/base/367418

Log:
  pkgbase: Remove %VCS_REVISION% from utilities comments
  
  We don't do that on other packages so be consistent.
  It also don't work when building from git.

Modified:
  head/release/packages/utilities.ucl

Modified: head/release/packages/utilities.ucl
==
--- head/release/packages/utilities.ucl Fri Nov  6 14:12:45 2020
(r367417)
+++ head/release/packages/utilities.ucl Fri Nov  6 15:21:53 2020
(r367418)
@@ -5,7 +5,7 @@
 name = "%PKG_NAME_PREFIX%-%PKGNAME%"
 origin = "base"
 version = "%VERSION%"
-comment = "%COMMENT% %VCS_REVISION%"
+comment = "%COMMENT%"
 categories = [ base ]
 maintainer = "%PKG_MAINTAINER%"
 www = "%PKG_WWW%"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367340 - head/sys/modules/dtb/rockchip

2020-11-04 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov  4 20:15:14 2020
New Revision: 367340
URL: https://svnweb.freebsd.org/changeset/base/367340

Log:
  dtb/rockchip: Add rockpi-4 to the build
  
  We boot on this board to add the dtb to the build.
  
  Requested by: Daniel Engberg 

Modified:
  head/sys/modules/dtb/rockchip/Makefile

Modified: head/sys/modules/dtb/rockchip/Makefile
==
--- head/sys/modules/dtb/rockchip/Makefile  Wed Nov  4 19:54:18 2020
(r367339)
+++ head/sys/modules/dtb/rockchip/Makefile  Wed Nov  4 20:15:14 2020
(r367340)
@@ -4,6 +4,7 @@ DTS=\
rockchip/rk3399-khadas-edge-captain.dts \
rockchip/rk3399-khadas-edge.dts \
rockchip/rk3399-khadas-edge-v.dts \
+   rockchip/rk3399-rock-pi-4.dts \
rockchip/rk3328-rock64.dts \
rockchip/rk3399-firefly.dts \
rockchip/rk3399-rockpro64.dts
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367338 - head/sys/dev/usb/controller

2020-11-04 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov  4 18:23:59 2020
New Revision: 367338
URL: https://svnweb.freebsd.org/changeset/base/367338

Log:
  Plug minor memory leak in dwc3 USB2/USB3 controller.
  
  OF_getprop_alloc called earlier requires corresponding OF_prop_free to 
release allocated memory.
  
  Submitted by: kjo...@gmail.com
  Differential Revision:https://reviews.freebsd.org/D27085

Modified:
  head/sys/dev/usb/controller/dwc3.c

Modified: head/sys/dev/usb/controller/dwc3.c
==
--- head/sys/dev/usb/controller/dwc3.c  Wed Nov  4 17:51:09 2020
(r367337)
+++ head/sys/dev/usb/controller/dwc3.c  Wed Nov  4 18:23:59 2020
(r367338)
@@ -235,6 +235,7 @@ snps_dwc3_configure_phy(struct snps_dwc3_softc *sc)

DWC3_GUSB2PHYCFG0_USBTRDTIM(DWC3_GUSB2PHYCFG0_USBTRDTIM_8BITS);
}
DWC3_WRITE(sc, DWC3_GUSB2PHYCFG0, reg);
+   OF_prop_free(phy_type);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367328 - head/share/man/man4

2020-11-04 Thread Emmanuel Vadot
Author: manu
Date: Wed Nov  4 13:43:34 2020
New Revision: 367328
URL: https://svnweb.freebsd.org/changeset/base/367328

Log:
  acpi_video(4): mention that acpi_video should be loaded after any drm driver
  
  When not adhering to this order, brightness sysctl's do not show up on some
  laptop.
  
  Submitted by:  driesm.michi...@gmail.com
  Reviewed by:  uqs
  Differential Revision:https://reviews.freebsd.org/D26073

Modified:
  head/share/man/man4/acpi_video.4

Modified: head/share/man/man4/acpi_video.4
==
--- head/share/man/man4/acpi_video.4Wed Nov  4 12:11:50 2020
(r367327)
+++ head/share/man/man4/acpi_video.4Wed Nov  4 13:43:34 2020
(r367328)
@@ -63,6 +63,15 @@ Preset brightness level to be used in economy mode.
 Defaults for these variables can be set in
 .Xr sysctl.conf 5 ,
 which is parsed at boot-time.
+.Sh COMPATIBILITY
+In order for
+.Nm
+to attach correctly,
+.Nm
+should be loaded after any of the DRM kernel modules.
+This can be achieved by setting the correct order in
+.Xr rc.conf 5
+using the kld_list directive.
 .Sh SEE ALSO
 .Xr acpi 4 ,
 .Xr loader.conf 5 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r367280 - head/lib/libc/gen

2020-11-02 Thread Emmanuel Vadot
On Tue, 3 Nov 2020 00:32:14 +0200
Konstantin Belousov  wrote:

> On Mon, Nov 02, 2020 at 11:22:15PM +0100, Emmanuel Vadot wrote:
> > On Tue, 3 Nov 2020 00:10:39 +0200
> > Konstantin Belousov  wrote:
> > 
> > > On Mon, Nov 02, 2020 at 10:49:07PM +0100, Emmanuel Vadot wrote:
> > > >  I think that the first question we want to ask is : Do we want to
> > > > support LOCALBASE being different than /usr/local
> > > >  I honestly don't see any advantages of making it !=/usr/local/ and
> > > > before we start putting a lot of new/useless(for I guess 99% of our
> > > > user base) in the tree we should here why people are using /usr/pkg or
> > > > whatever weird location.
> > > >  If they have some good argument, then we should proceed further.
> > > 
> > > I would be delighted to be able to install _and use_ two independent
> > > set of packages from the same base system install.  Without recursing
> > > to jails, X forwarding, etc.
> > > 
> > > In fact I would like to use /usr/local and e.g /usr/local-i386 on amd64
> > > machine.  I am fine with me building both of them in my instance of
> > > poudriere.
> > > 
> > > But indeed I am not sure if this worth the effort of many people, for many
> > > hours.  If it puts too high burden on everybody, then it is not a good
> > > feature.  Otherwise, it is very convenient in some situations.
> > 
> >  I understand this situation but I think that the best way for you do
> > do that is to use pkg install -r /path/to/my/i386/packages
> > 
> >  Since you will need to tweak you PATH variable to start applications
> > installed in /usr/local-i386 anyway it's not too much to tweak that to
> > the pkg path for your i386 repo.
> > 
> >  The "downside" of using this method is that you will have
> > a /usr/local/ under the /path/to/my/i386/packages.
> >  The "upside" of using this method is that you would be able to use the
> > same i386 packages on a native i386 install and they would install
> > in /usr/local/ (so no tweaking here).
> If I can already use them from non-/usr/local prefix, then it is great
> news (for me).  But I have a reason to doubt.

 If you pkg -r packages you can use a lot of them.

> For instance, a lot of applications are configured at build time to look
> for /usr/local.  Like, gcc with /usr/local/lib/gcc/, and binutils,
> which are actually one of the main use case for me.  So I believe that
> pkg install -r requires chroot/jail for the result to work.

 Yes there is still some cases like that, or packages having
post-install script that don't handle -r.
 We've been working on that with bapt@ for a few months now and still
do. The main motivation of rewriting everything in lua is to be able to
do that but there is still a lot do to.
 Never the less we would appriciate some reports of people using
packages installed with -r.

-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r367280 - head/lib/libc/gen

2020-11-02 Thread Emmanuel Vadot
On Mon, 2 Nov 2020 23:24:34 +0100
Stefan Esser  wrote:

> Am 02.11.20 um 22:49 schrieb Emmanuel Vadot:
> > On Mon, 2 Nov 2020 22:41:38 +0100
> > Stefan Esser  wrote:
> > 
> >> Am 02.11.20 um 20:20 schrieb Oliver Pinter:> On Monday, November 2,
> >> 2020, Stefan Eßer  >>> <mailto:s...@freebsd.org>> wrote:
> >>>
> >>>  Author: se
> >>>  Date: Mon Nov  2 18:48:06 2020
> >>>  New Revision: 367280
> >>>  URL: https://svnweb.freebsd.org/changeset/base/367280
> >>>  <https://svnweb.freebsd.org/changeset/base/367280>
> >>>
> >>>  Log:
> >>>     Re-arrange some of the code to separate writable user tree
> >>>  variables from
> >>>     R/O variables.
> >>>
> >>>     While here fix some nearby style. No functional change intended.
> >>>
> >>>     MFC after:    1 month
> >>>
> >>>
> >>> Is there any phabricator reference for this / these commit(s) + reviewer
> >>> lists?
> >>
> >> The previous commit that has been refined in this one has been
> >> discussed in D27009.
> >>
> >> I had added the new R/W sysctl variable to a switch statement that
> >> contained one R/O string value, and excluded the OID from causing
> >> an error return when a new value had been passed.
> >>
> >> This was functionally OK, but I have decided to move handling of
> >> the new writable variable to before the check for a write attempt
> >> and thus need to test specifically for its OID.
> >>
> >> This sysctl variable is referenced in Scott Longs proposed
> >> getlocalbase() function (D27022), but also in the change to make
> >> it define defaults paths in /etc/defaults/rc.conf (D27014).
> >>
> >> I do not support to make LOCALBASE dynamic for a broad range of
> >> programs, since this could lead to severe security issues (e.g.
> >> when a program is restricted by policy settings LOCALBASE/etc and
> >> an user-defined LOCALBASE could be used to circumvent them.
> >>
> >> There are already programs that respect a LOCALBASE environment
> >> variable, e.g. the pkg program, to allow it to e.g. operate with
> >> a DESTDIR prefix other than "/". This is a program that could
> >> instead use getlocalbase(), IMHO.
> >>
> >> But for security reasons all files that determine policies and
> >> exist in LOCALBASE since they are not distributed as part of the
> >> base system, should be located in a secure way, and that is by
> >> referring to a compiled in trusted path, IMHO.
> >>
> >> Even if the sysctl variable "user.localbase" can only be written to
> >> by root, the use of getlocalbase() provided by a shared library could
> >> allow to perform a LD_PRELOAD attack (provide a getlocalbase() that
> >> leadsto a user provided policy file instead of the admin controlled
> >> one).
> >>
> >> Regards, STefan
> > 
> >   I think that the first question we want to ask is : Do we want to
> > support LOCALBASE being different than /usr/local
> 
> The big majority of users will keep the default value, and I do not
> see a good reason for a change, except if there is a large installed
> base that traditionally uses another prefix (I have seen /vol/local
> and /opt, but also OS and architecture-specific prefixes, for example).

 I'd still like to see some arguments for such installs.

> >   I honestly don't see any advantages of making it !=/usr/local/ and
> > before we start putting a lot of new/useless(for I guess 99% of our
> > user base) in the tree we should here why people are using /usr/pkg or
> > whatever weird location.
> 
> No, why should we [assess] (assuming that word is to be implied in
> your sentence) why people want to be able to easily use a different
> prefix? That would be a waste of time, IMHO.
> 
> I know that there are legitimate reasons to want a different prefix,
> and we had requests to make it easier to support it.

 What are thoses ?

> We have literal uses of /usr/local in a lot of files in the FreeBSD
> base system (more than 1700) and this is not going to change.
> 
> But it was easy to replace a number of such literal pathes in base
> system binaries, and we can make it easier for those that need a
> different prefix to get it consistently used.
> 
> >   If they have some good argument, then we should proceed further.
> 
> You do no

Re: svn commit: r367280 - head/lib/libc/gen

2020-11-02 Thread Emmanuel Vadot
On Tue, 3 Nov 2020 00:10:39 +0200
Konstantin Belousov  wrote:

> On Mon, Nov 02, 2020 at 10:49:07PM +0100, Emmanuel Vadot wrote:
> >  I think that the first question we want to ask is : Do we want to
> > support LOCALBASE being different than /usr/local
> >  I honestly don't see any advantages of making it !=/usr/local/ and
> > before we start putting a lot of new/useless(for I guess 99% of our
> > user base) in the tree we should here why people are using /usr/pkg or
> > whatever weird location.
> >  If they have some good argument, then we should proceed further.
> 
> I would be delighted to be able to install _and use_ two independent
> set of packages from the same base system install.  Without recursing
> to jails, X forwarding, etc.
> 
> In fact I would like to use /usr/local and e.g /usr/local-i386 on amd64
> machine.  I am fine with me building both of them in my instance of
> poudriere.
> 
> But indeed I am not sure if this worth the effort of many people, for many
> hours.  If it puts too high burden on everybody, then it is not a good
> feature.  Otherwise, it is very convenient in some situations.

 I understand this situation but I think that the best way for you do
do that is to use pkg install -r /path/to/my/i386/packages

 Since you will need to tweak you PATH variable to start applications
installed in /usr/local-i386 anyway it's not too much to tweak that to
the pkg path for your i386 repo.

 The "downside" of using this method is that you will have
a /usr/local/ under the /path/to/my/i386/packages.
 The "upside" of using this method is that you would be able to use the
same i386 packages on a native i386 install and they would install
in /usr/local/ (so no tweaking here).

-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r367280 - head/lib/libc/gen

2020-11-02 Thread Emmanuel Vadot
On Mon, 2 Nov 2020 22:41:38 +0100
Stefan Esser  wrote:

> Am 02.11.20 um 20:20 schrieb Oliver Pinter:> On Monday, November 2, 
> 2020, Stefan Eßer  > <mailto:s...@freebsd.org>> wrote:
> > 
> > Author: se
> > Date: Mon Nov  2 18:48:06 2020
> > New Revision: 367280
> > URL: https://svnweb.freebsd.org/changeset/base/367280
> > <https://svnweb.freebsd.org/changeset/base/367280>
> > 
> > Log:
> >    Re-arrange some of the code to separate writable user tree
> > variables from
> >    R/O variables.
> > 
> >    While here fix some nearby style. No functional change intended.
> > 
> >    MFC after:    1 month
> > 
> > 
> > Is there any phabricator reference for this / these commit(s) + reviewer 
> > lists?
> 
> The previous commit that has been refined in this one has been
> discussed in D27009.
> 
> I had added the new R/W sysctl variable to a switch statement that
> contained one R/O string value, and excluded the OID from causing
> an error return when a new value had been passed.
> 
> This was functionally OK, but I have decided to move handling of
> the new writable variable to before the check for a write attempt
> and thus need to test specifically for its OID.
> 
> This sysctl variable is referenced in Scott Longs proposed
> getlocalbase() function (D27022), but also in the change to make
> it define defaults paths in /etc/defaults/rc.conf (D27014).
> 
> I do not support to make LOCALBASE dynamic for a broad range of
> programs, since this could lead to severe security issues (e.g.
> when a program is restricted by policy settings LOCALBASE/etc and
> an user-defined LOCALBASE could be used to circumvent them.
> 
> There are already programs that respect a LOCALBASE environment
> variable, e.g. the pkg program, to allow it to e.g. operate with
> a DESTDIR prefix other than "/". This is a program that could
> instead use getlocalbase(), IMHO.
> 
> But for security reasons all files that determine policies and
> exist in LOCALBASE since they are not distributed as part of the
> base system, should be located in a secure way, and that is by
> referring to a compiled in trusted path, IMHO.
> 
> Even if the sysctl variable "user.localbase" can only be written to
> by root, the use of getlocalbase() provided by a shared library could
> allow to perform a LD_PRELOAD attack (provide a getlocalbase() that
> leadsto a user provided policy file instead of the admin controlled
> one).
> 
> Regards, STefan

 I think that the first question we want to ask is : Do we want to
support LOCALBASE being different than /usr/local
 I honestly don't see any advantages of making it !=/usr/local/ and
before we start putting a lot of new/useless(for I guess 99% of our
user base) in the tree we should here why people are using /usr/pkg or
whatever weird location.
 If they have some good argument, then we should proceed further.

-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367284 - in head/release: . tools

2020-11-02 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov  2 21:10:49 2020
New Revision: 367284
URL: https://svnweb.freebsd.org/changeset/base/367284

Log:
  release: Add an image for CI
  
  A lot of projects CI can't do FreeBSD tests currently.
  The main reason is that the project CI infrastructure is runned on Linux
  and that our images aren't modifiable from a Linux hosts.
  Add a basic image specific for this case (called BASIC-CI for a lack of a
  better name).
  The image have no package pre-installed.
  It only have a few modification to have dhcp client runned on the default
  interface and sshd started with option to be able to log on without a password
  as root.
  
  Sponsored by: The FreeBSD Foundation
  
  Reviewed by:  re (gjb@)
  Differential Revision:https://reviews.freebsd.org/D25598

Added:
  head/release/tools/basic-ci.conf   (contents, props changed)
Modified:
  head/release/Makefile.vm

Modified: head/release/Makefile.vm
==
--- head/release/Makefile.vmMon Nov  2 20:00:50 2020(r367283)
+++ head/release/Makefile.vmMon Nov  2 21:10:49 2020(r367284)
@@ -16,13 +16,17 @@ VMDK_DESC=  VMWare, VirtualBox disk image
 QCOW2_DESC=Qemu, KVM disk image
 RAW_DESC=  Unformatted raw disk image
 
-CLOUDWARE?=EC2 \
+CLOUDWARE?=BASIC-CI \
+   EC2 \
GCE \
VAGRANT-VIRTUALBOX \
VAGRANT-VMWARE
 AZURE_FORMAT=  vhdf
 AZURE_DESC=Microsoft Azure platform image
 AZURE_DISK=${OSRELEASE}.${AZURE_FORMAT}
+BASIC-CI_FORMAT=   raw
+BASIC-CI_DESC= Image for CI
+BASIC-CI_DISK= ${OSRELEASE}.${BASIC-CI_FORMAT}
 EC2_FORMAT=raw
 EC2_DESC=  Amazon EC2 image
 EC2_DISK=  ${OSRELEASE}.${EC2_FORMAT}

Added: head/release/tools/basic-ci.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/release/tools/basic-ci.confMon Nov  2 21:10:49 2020
(r367284)
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# Should be enough for base image, image can be resized in needed
+export VMSIZE=5G
+
+# Set to a list of third-party software to enable in rc.conf(5).
+export VM_RC_LIST="sshd growfs"
+
+vm_extra_pre_umount() {
+   cat << EOF >> ${DESTDIR}/etc/rc.conf
+dumpdev="AUTO"
+ifconfig_DEFAULT="DHCP"
+sshd_enable="YES"
+EOF
+
+   cat << EOF >> ${DESTDIR}/boot/loader.conf
+autoboot_delay="-1"
+beastie_disable="YES"
+loader_logo="none"
+console="comconsole,vidconsole"
+EOF
+cat <> ${DESTDIR}/etc/ssh/sshd_config
+PermitRootLogin yes
+PasswordAuthentication yes
+PermitEmptyPasswords yes
+UsePAM no
+EOF
+
+   touch ${DESTDIR}/firstboot
+
+   return 0
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r367277 - head

2020-11-02 Thread Emmanuel Vadot
Author: manu
Date: Mon Nov  2 18:23:50 2020
New Revision: 367277
URL: https://svnweb.freebsd.org/changeset/base/367277

Log:
  pkgbase: Add incremental packages
  
  This adds a new target update-packages which will create the new packages
  compared to the last run.
  
  This is how to use it:
  At this point we cut a release
  $ make buildworld ...
  $ make buildkernel
  $ make packages
  
  There is now a PKG_VERSION directory with latest link pointing to it
  Distribute the packages to server
  
  $ something something that update the source tree
  $ make buildworld ...
  $ make buildkernel
  $ make update-packages
  You know have a PKG_VERSION directory in the REPODIR and latest link pointing 
to it.
  In PKG_VERSION dir only the packages which differs from the latest run are
  named PKG_VERSION, otherwise the old packages are there.
  
  The process is :
  Build the new packages in the PKG_VERSION directory
  Compare the internal data with the PKG_VERSION_FROM version. The comparison 
is done
  by checking the internal hash of the packages.
  By default PKG_VERSION_FROM is set to what the latest link points to.
  If the old and new version matches, we rm the new package and cp the old one.
  
  Differential Revision:https://reviews.freebsd.org/D25984

Modified:
  head/Makefile
  head/Makefile.inc1

Modified: head/Makefile
==
--- head/Makefile   Mon Nov  2 17:39:59 2020(r367276)
+++ head/Makefile   Mon Nov  2 18:23:50 2020(r367277)
@@ -162,8 +162,8 @@ TGTS=   all all-man buildenv buildenvvars buildkernel bu
xdev-links native-xtools native-xtools-install stageworld stagekernel \
stage-packages stage-packages-kernel stage-packages-world \
create-packages-world create-packages-kernel create-packages \
-   packages installconfig real-packages sign-packages package-pkg \
-   print-dir test-system-compiler test-system-linker
+   update-packages packages installconfig real-packages 
real-update-packages \
+   sign-packages package-pkg print-dir test-system-compiler 
test-system-linker
 
 # These targets require a TARGET and TARGET_ARCH be defined.
 XTGTS= native-xtools native-xtools-install xdev xdev-build xdev-install \

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Mon Nov  2 17:39:59 2020(r367276)
+++ head/Makefile.inc1  Mon Nov  2 18:23:50 2020(r367277)
@@ -568,12 +568,12 @@ EXTRA_REVISION= _${_BRANCH:C/-PRERELEASE/.p/}
 .elif ${_BRANCH:M*-p*}
 EXTRA_REVISION=_${_BRANCH:C/.*-p([0-9]+$)/\1/}
 .endif
-PKG_VERSION=   ${_REVISION}${EXTRA_REVISION}
+PKG_VERSION:=  ${_REVISION}${EXTRA_REVISION}
 .endif
 .endif # !defined(PKG_VERSION)
 
 .if !defined(PKG_TIMESTAMP)
-TIMEEPOCHNOW=  %s
+TIMEEPOCHNOW=  %s
 SOURCE_DATE_EPOCH= ${TIMEEPOCHNOW:gmtime}
 .else
 SOURCE_DATE_EPOCH= ${PKG_TIMESTAMP}
@@ -1855,9 +1855,22 @@ _pkgbootstrap: .PHONY
@env ASSUME_ALWAYS_YES=YES pkg bootstrap
 .endif
 
+.if make(create-world-packages-jobs) || make(create-kernel-packages*) || 
make(real-update-packages)
+PKG_ABI!=${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI
+.endif
+
+.if !defined(PKG_VERSION_FROM)
+.if defined(PKG_ABI)
+PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest
+.endif
+.endif
+
 packages: .PHONY
${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages
 
+update-packages: .PHONY
+   ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} 
real-update-packages
+
 package-pkg: .PHONY
rm -rf /tmp/ports.${TARGET} || :
env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} 
REVISION=${_REVISION} \
@@ -1867,6 +1880,28 @@ package-pkg: .PHONY
 
 real-packages: stage-packages create-packages sign-packages .PHONY
 
+real-update-packages: stage-packages .PHONY
+   ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages
+   @echo "==> Checking for new packages (comparing ${PKG_VERSION} to 
${PKG_VERSION_FROM})"
+   @for pkg in 
${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM}/${PKG_NAME_PREFIX}-*; do \
+ pkgname=$$(pkg query -F $${pkg} '%n' | sed 
's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \
+ 
newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_FORMAT} ; \
+ oldsum=$$(pkg query -F $${pkg} '%X') ; \
+ if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then 
\
+   continue; \
+ fi ; \
+ newsum=$$(pkg query -F 
${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \
+ if [ "$${oldsum}" == "$${newsum}" ]; then \
+  echo "==> Keeping old 
${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_FORMAT}" ; \
+  rm ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ; \
+  cp $${pkg} ${REPODIR}/${PKG_ABI}/${PKG_VERSION} ; \
+ else \
+  

svn commit: r366628 - in head/sys: amd64/conf arm64/conf conf dev/axgbe modules modules/axgbe modules/axgbe/if_axa modules/axgbe/if_axp

2020-10-11 Thread Emmanuel Vadot
Author: manu
Date: Sun Oct 11 16:01:16 2020
New Revision: 366628
URL: https://svnweb.freebsd.org/changeset/base/366628

Log:
  10Gigabit Ethernet driver for AMD SoC
  
  This patch has the driver for 10Gigabit Ethernet controller in AMD
  SoC. This driver is written compatible to the Iflib framework. The
  existing driver is for the old version of hardware. The submitted
  driver here is for the recent versions of the hardware where the Ethernet
  controller is PCI-E based.
  
  Submitted by: Rajesh Kumar 
  MFC after:1 month
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D25793

Added:
  head/sys/dev/axgbe/if_axgbe_pci.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-dcb.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-i2c.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-phy-v1.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-phy-v2.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-ptp.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-sysctl.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe-txrx.c   (contents, props changed)
  head/sys/dev/axgbe/xgbe_osdep.c   (contents, props changed)
  head/sys/modules/axgbe/
  head/sys/modules/axgbe/Makefile   (contents, props changed)
  head/sys/modules/axgbe/if_axa/
  head/sys/modules/axgbe/if_axa/Makefile   (contents, props changed)
  head/sys/modules/axgbe/if_axp/
  head/sys/modules/axgbe/if_axp/Makefile   (contents, props changed)
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/arm64/conf/GENERIC
  head/sys/arm64/conf/NOTES
  head/sys/conf/files.amd64
  head/sys/conf/files.arm64
  head/sys/dev/axgbe/if_axgbe.c
  head/sys/dev/axgbe/xgbe-common.h
  head/sys/dev/axgbe/xgbe-desc.c
  head/sys/dev/axgbe/xgbe-dev.c
  head/sys/dev/axgbe/xgbe-drv.c
  head/sys/dev/axgbe/xgbe-mdio.c
  head/sys/dev/axgbe/xgbe.h
  head/sys/dev/axgbe/xgbe_osdep.h
  head/sys/modules/Makefile

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Sun Oct 11 13:39:04 2020(r366627)
+++ head/sys/amd64/conf/GENERIC Sun Oct 11 16:01:16 2020(r366628)
@@ -248,6 +248,7 @@ device  ixl # Intel 700 
Series Physical Function
 device iavf# Intel Adaptive Virtual Function
 device ice # Intel 800 Series Physical Function
 device vmx # VMware VMXNET3 Ethernet
+device axp # AMD EPYC integrated NIC
 
 # PCI Ethernet NICs.
 device bxe # Broadcom NetXtreme II 
BCM5771X/BCM578XX 10GbE

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Sun Oct 11 13:39:04 2020(r366627)
+++ head/sys/amd64/conf/NOTES   Sun Oct 11 16:01:16 2020(r366628)
@@ -328,6 +328,7 @@ device  nfe # nVidia nForce MCP 
on-board Ethernet
 device sfxge   # Solarflare SFC9000 10Gb Ethernet
 device vmx # VMware VMXNET3 Ethernet
 device wpi # Intel 3945ABG wireless NICs.
+device axp # AMD EPYC integrated NIC
 
 # IEEE 802.11 adapter firmware modules
 

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Sun Oct 11 13:39:04 2020(r366627)
+++ head/sys/arm64/conf/GENERIC Sun Oct 11 16:01:16 2020(r366628)
@@ -167,7 +167,7 @@ device  mdio
 device mii
 device miibus  # MII bus support
 device awg # Allwinner EMAC Gigabit Ethernet
-device axgbe   # AMD Opteron A1100 integrated NIC
+device axa # AMD Opteron A1100 integrated NIC
 device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
 device neta# Marvell Armada 370/38x/XP/3700 NIC
 device smc # SMSC LAN91C111

Modified: head/sys/arm64/conf/NOTES
==
--- head/sys/arm64/conf/NOTES   Sun Oct 11 13:39:04 2020(r366627)
+++ head/sys/arm64/conf/NOTES   Sun Oct 11 16:01:16 2020(r366628)
@@ -76,7 +76,7 @@ options   PCI_IOV # PCI SR-IOV support
 # Ethernet NICs
 device mdio
 device awg # Allwinner EMAC Gigabit Ethernet
-device axgbe   # AMD Opteron A1100 integrated NIC
+device axa # AMD Opteron A1100 integrated NIC
 device neta# Marvell Armada 370/38x/XP/3700 NIC
 device smc # SMSC LAN91C111
 device vnic# Cavium ThunderX NIC

Modified: head/sys/conf/files.amd64
==

svn commit: r366600 - head/sys/arm/arm

2020-10-10 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct 10 07:20:59 2020
New Revision: 366600
URL: https://svnweb.freebsd.org/changeset/base/366600

Log:
  arm: Check dtb version against the one we're expecting to find
  
  Reviewed by:  imp, emaste, mmel
  Differential Revision:https://reviews.freebsd.org/D26725

Modified:
  head/sys/arm/arm/machdep.c

Modified: head/sys/arm/arm/machdep.c
==
--- head/sys/arm/arm/machdep.c  Sat Oct 10 07:18:51 2020(r366599)
+++ head/sys/arm/arm/machdep.c  Sat Oct 10 07:20:59 2020(r366600)
@@ -,6 +,8 @@ initarm(struct arm_boot_params *abp)
char *env;
void *kmdp;
int err_devmap, mem_regions_sz;
+   phandle_t root;
+   char dts_version[255];
 #ifdef EFI
struct efi_map_header *efihdr;
 #endif
@@ -1272,6 +1274,18 @@ initarm(struct arm_boot_params *abp)
err_devmap);
 
platform_late_init();
+
+   root = OF_finddevice("/");
+   if (OF_getprop(root, "freebsd,dts-version", dts_version, 
sizeof(dts_version)) > 0) {
+   if (strcmp(LINUX_DTS_VERSION, dts_version) != 0)
+   printf("WARNING: DTB version is %s while kernel expects 
%s, "
+   "please update the DTB in the ESP\n",
+   dts_version,
+   LINUX_DTS_VERSION);
+   } else {
+   printf("WARNING: Cannot find freebsd,dts-version property, "
+   "cannot check DTB compliance\n");
+   }
 
/*
 * We must now clean the cache again
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366599 - in head/sys: conf dts gnu/dts tools/fdt

2020-10-10 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct 10 07:18:51 2020
New Revision: 366599
URL: https://svnweb.freebsd.org/changeset/base/366599

Log:
  Brand our DTS with the Linux version it was imported from
  
  DTS must be synced with the kernel, add a freebsd,dts-version string in
  the root node of each DTS that we compile so we can later in the kernel
  check that it contain a correct value.
  
  Reviewed by:  imp, mmel
  Differential Revision:https://reviews.freebsd.org/D26724

Added:
  head/sys/dts/freebsd-compatible.dts   (contents, props changed)
  head/sys/gnu/dts/Makefile   (contents, props changed)
Modified:
  head/sys/conf/Makefile.arm
  head/sys/tools/fdt/make_dtb.sh

Modified: head/sys/conf/Makefile.arm
==
--- head/sys/conf/Makefile.arm  Sat Oct 10 04:18:49 2020(r366598)
+++ head/sys/conf/Makefile.arm  Sat Oct 10 07:18:51 2020(r366599)
@@ -32,6 +32,9 @@ S=../../..
 
 INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include 
 
+LINUX_DTS_VERSION!=   make -C $S/gnu/dts/ -V LINUX_DTS_VERSION
+CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
+
 .if !defined(DEBUG) && !defined(PROFLEVEL)
 STRIP_FLAGS = -S
 .endif

Added: head/sys/dts/freebsd-compatible.dts
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/freebsd-compatible.dts Sat Oct 10 07:18:51 2020
(r366599)
@@ -0,0 +1,3 @@
+/ {
+   freebsd,dts-version = LINUX_DTS_VERSION;
+};

Added: head/sys/gnu/dts/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/gnu/dts/Makefile   Sat Oct 10 07:18:51 2020(r366599)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+LINUX_DTS_VERSION=5.8

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Sat Oct 10 04:18:49 2020
(r366598)
+++ head/sys/tools/fdt/make_dtb.sh  Sat Oct 10 07:18:51 2020
(r366599)
@@ -20,9 +20,11 @@ fi
 : "${ECHO:=echo}"
 : "${CPP:=cpp}"
 
+LINUX_DTS_VERSION=$(make -C $S/gnu/dts -V LINUX_DTS_VERSION)
+
 for d in ${dts}; do
 dtb="${dtb_path}/$(basename "$d" .dts).dtb"
 ${ECHO} "converting $d -> $dtb"
-${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I 
"$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" 
/dev/null |
+${CPP} -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" -P -x 
assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I 
"$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" -include 
"$S/dts/freebsd-compatible.dts" /dev/null |
${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i 
"$S/gnu/dts/${MACHINE}" -i "$S/gnu/dts/"
 done
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366479 - head/sys/compat/linuxkpi/common/include/linux

2020-10-06 Thread Emmanuel Vadot
Author: manu
Date: Tue Oct  6 10:41:00 2020
New Revision: 366479
URL: https://svnweb.freebsd.org/changeset/base/366479

Log:
  linuxkpi: Add pagemap.h
  
  Add release_pages needed by drm which simply calls put_page for
  all the pages provided
  
  Reviewed by:  bz
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26680

Added:
  head/sys/compat/linuxkpi/common/include/linux/pagemap.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/pagemap.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/pagemap.h Tue Oct  6 
10:41:00 2020(r366479)
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_PAGEMAP_H_
+#define _LINUX_PAGEMAP_H_
+
+#include 
+
+static inline void
+release_pages(struct page **pages, int nr)
+{
+   int i;
+
+   for (i = 0; i < nr; i++)
+   put_page(pages[i]);
+}
+
+#endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366478 - head/sys/compat/linuxkpi/common/include/linux

2020-10-06 Thread Emmanuel Vadot
Author: manu
Date: Tue Oct  6 10:39:40 2020
New Revision: 366478
URL: https://svnweb.freebsd.org/changeset/base/366478

Log:
  linuxkpi: Add power_supply.h
  
  Add power_supply_is_system_supplied which is needed by drm.
  
  Reviewed by:  bz
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26679

Added:
  head/sys/compat/linuxkpi/common/include/linux/power_supply.h   (contents, 
props changed)

Added: head/sys/compat/linuxkpi/common/include/linux/power_supply.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/power_supply.hTue Oct 
 6 10:39:40 2020(r366478)
@@ -0,0 +1,44 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_POWER_SUPPLY_H_
+#define _LINUX_POWER_SUPPLY_H_
+
+#include 
+#include 
+
+static inline int
+power_supply_is_system_supplied(void)
+{
+
+   return (power_profile_get_state() == POWER_PROFILE_PERFORMANCE);
+}
+
+#endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366477 - head/sys/compat/linuxkpi/common/include/linux

2020-10-06 Thread Emmanuel Vadot
Author: manu
Date: Tue Oct  6 10:37:21 2020
New Revision: 366477
URL: https://svnweb.freebsd.org/changeset/base/366477

Log:
  linuxkpi: Add prefetch.h
  
  Only add prefetchw as it is the only function used by drm.
  Simply use the __builtin_prefetch which is available in all
  compiler for a long time.
  
  Reviewed by:  bz
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26677

Added:
  head/sys/compat/linuxkpi/common/include/linux/prefetch.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/prefetch.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/prefetch.hTue Oct  6 
10:37:21 2020(r366477)
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_PREFETCH_H_
+#define_LINUX_PREFETCH_H_
+
+#define prefetchw(x) __builtin_prefetch(x,1)
+
+#endif /* _LINUX_PREFETCH_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366476 - head/sys/compat/linuxkpi/common/include/linux

2020-10-06 Thread Emmanuel Vadot
Author: manu
Date: Tue Oct  6 10:36:16 2020
New Revision: 366476
URL: https://svnweb.freebsd.org/changeset/base/366476

Log:
  linuxkpi: Add numa.h
  
  Only contain NUMA_NO_NODE needed by drm
  
  Reviewed by:  bz
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26676

Added:
  head/sys/compat/linuxkpi/common/include/linux/numa.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/numa.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/numa.hTue Oct  6 
10:36:16 2020(r366476)
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_NUMA_H_
+#define_LINUX_NUMA_H_
+
+#defineNUMA_NO_NODE-1
+
+#endif /* _LINUX_NUMA_H_ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366475 - head/sys/compat/linuxkpi/common/include/linux

2020-10-06 Thread Emmanuel Vadot
Author: manu
Date: Tue Oct  6 10:35:03 2020
New Revision: 366475
URL: https://svnweb.freebsd.org/changeset/base/366475

Log:
  linuxkpi: Add gcd function
  
  This compute the common greater divider
  Taken from OpenBSD
  
  Reviewed by:  bz, imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26674

Added:
  head/sys/compat/linuxkpi/common/include/linux/gcd.h   (contents, props 
changed)

Added: head/sys/compat/linuxkpi/common/include/linux/gcd.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/gcd.h Tue Oct  6 10:35:03 
2020(r366475)
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_GCD_H_
+#define _LINUX_GCD_H_
+
+static inline unsigned long
+gcd(unsigned long a, unsigned long b)
+{
+   unsigned long c;
+
+   c = a % b;
+   while (c != 0) {
+   a = b;
+   b = c;
+   c = a % b;
+   }
+
+   return (b);
+}
+
+#endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366397 - head/sys/modules/pwm/pwm_backlight

2020-10-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct  3 14:01:20 2020
New Revision: 366397
URL: https://svnweb.freebsd.org/changeset/base/366397

Log:
  pwm_backlight: Add regnode_if.h to SRCS
  
  If the kernel config doesn't have this pseudo device it will not be generated
  and then the module will fail to compile.
  
  Reported by:  mjg

Modified:
  head/sys/modules/pwm/pwm_backlight/Makefile

Modified: head/sys/modules/pwm/pwm_backlight/Makefile
==
--- head/sys/modules/pwm/pwm_backlight/Makefile Sat Oct  3 14:00:33 2020
(r366396)
+++ head/sys/modules/pwm/pwm_backlight/Makefile Sat Oct  3 14:01:20 2020
(r366397)
@@ -10,6 +10,7 @@ SRCS+=\
device_if.h \
opt_platform.h \
pwmbus_if.h \
+   regnode_if.h \
ofw_bus_if.h
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366396 - head/sys/conf

2020-10-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct  3 14:00:33 2020
New Revision: 366396
URL: https://svnweb.freebsd.org/changeset/base/366396

Log:
  pwm_backlight: Depend on ext_resources
  
  This driver cannot work without it.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Oct  3 13:27:57 2020(r366395)
+++ head/sys/conf/files Sat Oct  3 14:00:33 2020(r366396)
@@ -2755,7 +2755,7 @@ dev/pwm/pwmbus.c  optional pwm | pwmbus
 dev/pwm/pwmbus_if.moptional pwm | pwmbus
 dev/pwm/ofw_pwm.c  optional pwm fdt | pwmbus fdt
 dev/pwm/ofw_pwmbus.c   optional pwm fdt | pwmbus fdt
-dev/pwm/pwm_backlight.coptional pwm pwm_backlight fdt
+dev/pwm/pwm_backlight.coptional pwm pwm_backlight 
ext_resources fdt
 dev/quicc/quicc_core.c optional quicc
 dev/ral/rt2560.c   optional ral
 dev/ral/rt2661.c   optional ral
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366381 - head/sys/modules/pwm

2020-10-03 Thread Emmanuel Vadot
On Sat, 3 Oct 2020 05:47:22 +0200
Mateusz Guzik  wrote:

> On 10/2/20, Emmanuel Vadot  wrote:
> > Author: manu
> > Date: Fri Oct  2 19:56:54 2020
> > New Revision: 366381
> > URL: https://svnweb.freebsd.org/changeset/base/366381
> >
> > Log:
> >   pwm_backlight: Restrict module to armv7 and aarch64
> >
> >   Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES.
> >
> >   Reported by:  jenkins
> >
> > Modified:
> >   head/sys/modules/pwm/Makefile
> >
> > Modified: head/sys/modules/pwm/Makefile
> > ==
> > --- head/sys/modules/pwm/Makefile   Fri Oct  2 19:16:06 2020
> > (r366380)
> > +++ head/sys/modules/pwm/Makefile   Fri Oct  2 19:56:54 2020
> > (r366381)
> > @@ -6,8 +6,10 @@ SUBDIR = \
> > pwmbus \
> > pwmc \
> >
> > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64"
> >  .if !empty(OPT_FDT)
> >  SUBDIR += pwm_backlight
> > +.endif
> >  .endif
> >
> >  .include 
> 
> I don't know which commits are to blame, but the following is broken
> in tinderbox:
> arm GENERIC kernel failed, check _.arm.GENERIC for details
> arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details
> arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details
> arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details
> arm VYBRID kernel failed, check _.arm.VYBRID for details
> arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details
> arm LINT kernel failed, check _.arm.LINT for details
> arm IMX53 kernel failed, check _.arm.IMX53 for details
> arm IMX6 kernel failed, check _.arm.IMX6 for details
> arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details
> arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details
> 
> -- 
> Mateusz Guzik 

 This is fixed now, sorry.

-- 
Emmanuel Vadot  
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r366381 - head/sys/modules/pwm

2020-10-03 Thread Emmanuel Vadot
On Fri, 02 Oct 2020 21:12:01 -0700
Cy Schubert  wrote:

> In message  om>
> , Mateusz Guzik writes:
> > On 10/2/20, Emmanuel Vadot  wrote:
> > > Author: manu
> > > Date: Fri Oct  2 19:56:54 2020
> > > New Revision: 366381
> > > URL: https://svnweb.freebsd.org/changeset/base/366381
> > >
> > > Log:
> > >   pwm_backlight: Restrict module to armv7 and aarch64
> > >
> > >   Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES.
> > >
> > >   Reported by:jenkins
> > >
> > > Modified:
> > >   head/sys/modules/pwm/Makefile
> > >
> > > Modified: head/sys/modules/pwm/Makefile
> > > ===
> > ===
> > > --- head/sys/modules/pwm/Makefile Fri Oct  2 19:16:06 2020(r36638
> > 0)
> > > +++ head/sys/modules/pwm/Makefile Fri Oct  2 19:56:54 2020(r36638
> > 1)
> > > @@ -6,8 +6,10 @@ SUBDIR = \
> > >   pwmbus \
> > >   pwmc \
> > >
> > > +.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64"
> > >  .if !empty(OPT_FDT)
> > >  SUBDIR += pwm_backlight
> > > +.endif
> > >  .endif
> > >
> > >  .include 
> >
> > I don't know which commits are to blame, but the following is broken
> > in tinderbox:
> > arm GENERIC kernel failed, check _.arm.GENERIC for details
> > arm GENERIC-NODEBUG kernel failed, check _.arm.GENERIC-NODEBUG for details
> > arm TEGRA124 kernel failed, check _.arm.TEGRA124 for details
> > arm ARMADA38X kernel failed, check _.arm.ARMADA38X for details
> > arm VYBRID kernel failed, check _.arm.VYBRID for details
> > arm GENERIC-MMCCAM kernel failed, check _.arm.GENERIC-MMCCAM for details
> > arm LINT kernel failed, check _.arm.LINT for details
> > arm IMX53 kernel failed, check _.arm.IMX53 for details
> > arm IMX6 kernel failed, check _.arm.IMX6 for details
> > arm EFIKA_MX kernel failed, check _.arm.EFIKA_MX for details
> > arm ZEDBOARD kernel failed, check _.arm.ZEDBOARD for details
> 
> And on amd64 my laptop is useless now.
> 
> Oct  2 18:23:58 slippy kernel: link_elf_obj: symbol 
> acpi_video_get_backlight_type undefined
> Oct  2 18:23:58 slippy kernel: Warning: memory type debugfsint leaked 
> memory on destroy (2 allocations, 80 bytes leaked).
> Oct  2 18:23:59 slippy kernel: linker_load_file: /boot/modules/i915kms.ko - 
> unsupported file type
> 
> And this is also after updating drm-current-kmod.
> 
> 
> -- 
> Cheers,
> Cy Schubert 
> FreeBSD UNIX: Web:  https://FreeBSD.org
> NTP:   Web:  https://nwtime.org
> 
>   The need of the many outweighs the greed of the few.
> 
> 

 Fixed in ports r551266, sorry.

-- 
Emmanuel Vadot  
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366386 - head/sys/dev/pwm

2020-10-03 Thread Emmanuel Vadot
Author: manu
Date: Sat Oct  3 08:31:28 2020
New Revision: 366386
URL: https://svnweb.freebsd.org/changeset/base/366386

Log:
  pwm_backlight: Fix 32 bits build
  
  Reported by:  jenkins, mjg

Modified:
  head/sys/dev/pwm/pwm_backlight.c

Modified: head/sys/dev/pwm/pwm_backlight.c
==
--- head/sys/dev/pwm/pwm_backlight.cSat Oct  3 02:26:38 2020
(r366385)
+++ head/sys/dev/pwm/pwm_backlight.cSat Oct  3 08:31:28 2020
(r366386)
@@ -141,8 +141,8 @@ pwm_backlight_attach(device_t dev)
 
if (bootverbose) {
device_printf(dev, "Number of levels: %zd\n", 
sc->nlevels);
-   device_printf(dev, "Configured period time: %lu\n", 
sc->channel->period);
-   device_printf(dev, "Default duty cycle: %lu\n", 
sc->channel->duty);
+   device_printf(dev, "Configured period time: %ju\n", 
(uintmax_t)sc->channel->period);
+   device_printf(dev, "Default duty cycle: %ju\n", 
(uintmax_t)sc->channel->duty);
}
} else {
/* Get the current backlight level */
@@ -153,8 +153,8 @@ pwm_backlight_attach(device_t dev)
if (sc->channel->duty > sc->channel->period)
sc->channel->duty = sc->channel->period;
if (bootverbose) {
-   device_printf(dev, "Configured period time: %lu\n", 
sc->channel->period);
-   device_printf(dev, "Default duty cycle: %lu\n", 
sc->channel->duty);
+   device_printf(dev, "Configured period time: %ju\n", 
(uintmax_t)sc->channel->period);
+   device_printf(dev, "Default duty cycle: %ju\n", 
(uintmax_t)sc->channel->duty);
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366382 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf powerpc/conf

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 20:52:09 2020
New Revision: 366382
URL: https://svnweb.freebsd.org/changeset/base/366382

Log:
  Fix LINT: Add backlight to NOTES

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/arm/conf/NOTES
  head/sys/arm64/conf/NOTES
  head/sys/i386/conf/NOTES
  head/sys/powerpc/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Fri Oct  2 19:56:54 2020(r366381)
+++ head/sys/amd64/conf/NOTES   Fri Oct  2 20:52:09 2020(r366382)
@@ -538,6 +538,7 @@ device  ioat# Intel I/OAT DMA engine
 # Laptop/Notebook options:
 #
 
+device backlight
 
 #
 # I2C Bus

Modified: head/sys/arm/conf/NOTES
==
--- head/sys/arm/conf/NOTES Fri Oct  2 19:56:54 2020(r366381)
+++ head/sys/arm/conf/NOTES Fri Oct  2 20:52:09 2020(r366382)
@@ -45,6 +45,9 @@ devicenvmem
 device regulator
 device syscon
 
+# Backlight subsystem
+device backlight
+
 # Undo options from sys/conf/NOTES that we do not want...
 
 nooptions  COMPAT_FREEBSD4

Modified: head/sys/arm64/conf/NOTES
==
--- head/sys/arm64/conf/NOTES   Fri Oct  2 19:56:54 2020(r366381)
+++ head/sys/arm64/conf/NOTES   Fri Oct  2 20:52:09 2020(r366382)
@@ -191,6 +191,9 @@ device  regulator
 device syscon
 device aw_syscon
 
+# Backlight subsystem
+device backlight
+
 # Misc devices.
 device pl330   # ARM PL330 dma controller
 device xdma# xDMA framework for SoC on-chip dma controllers

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESFri Oct  2 19:56:54 2020(r366381)
+++ head/sys/i386/conf/NOTESFri Oct  2 20:52:09 2020(r366382)
@@ -784,6 +784,8 @@ device  aesni   # AES-NI OpenCrypto 
module
 #  apm under `Miscellaneous hardware'
 # above.
 
+device backlight
+
 # For older notebooks that signal a powerfail condition (external
 # power supply dropped, or battery state low) by issuing an NMI:
 

Modified: head/sys/powerpc/conf/NOTES
==
--- head/sys/powerpc/conf/NOTES Fri Oct  2 19:56:54 2020(r366381)
+++ head/sys/powerpc/conf/NOTES Fri Oct  2 20:52:09 2020(r366382)
@@ -68,6 +68,9 @@ devicesnd_ai2s# Apple I2S Audio
 device snd_davbus  # Apple Davbus Audio
 device adm1030 # Apple G4 MDD fan controller
 
+# Backlight subsystem
+device backlight
+
 
 #
 # Devices we don't want to deal with
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366381 - head/sys/modules/pwm

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 19:56:54 2020
New Revision: 366381
URL: https://svnweb.freebsd.org/changeset/base/366381

Log:
  pwm_backlight: Restrict module to armv7 and aarch64
  
  Both powerpc64 and riscv uses fdt but don't use EXT_RESOURCES.
  
  Reported by:  jenkins

Modified:
  head/sys/modules/pwm/Makefile

Modified: head/sys/modules/pwm/Makefile
==
--- head/sys/modules/pwm/Makefile   Fri Oct  2 19:16:06 2020
(r366380)
+++ head/sys/modules/pwm/Makefile   Fri Oct  2 19:56:54 2020
(r366381)
@@ -6,8 +6,10 @@ SUBDIR = \
pwmbus \
pwmc \
 
+.if ${MACHINE_ARCH} == "armv7" || ${MACHINE_ARCH} == "aarch64"
 .if !empty(OPT_FDT)
 SUBDIR += pwm_backlight
+.endif
 .endif
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366374 - head/sys/sys

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:29:25 2020
New Revision: 366374
URL: https://svnweb.freebsd.org/changeset/base/366374

Log:
  Bump __FreeBSD_version after latest linuxkpi changes

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hFri Oct  2 18:28:00 2020(r366373)
+++ head/sys/sys/param.hFri Oct  2 18:29:25 2020(r366374)
@@ -60,7 +60,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1300117  /* Master, propagated to newvers */
+#define __FreeBSD_version 1300118  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366373 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf modules/linuxkpi

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:28:00 2020
New Revision: 366373
URL: https://svnweb.freebsd.org/changeset/base/366373

Log:
  linuxkpi: Add dmi_* function
  
  dmi function are used to get smbios values.
  The DRM subsystem and drivers use it to enabled (or not) quirks.
  
  Reviewed by:  hselasky
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26046

Added:
  head/sys/compat/linuxkpi/common/include/linux/dmi.h   (contents, props 
changed)
  head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h   (contents, 
props changed)
  head/sys/compat/linuxkpi/common/src/linux_dmi.c   (contents, props changed)
Modified:
  head/sys/compat/linuxkpi/common/include/linux/fs.h
  head/sys/conf/files
  head/sys/modules/linuxkpi/Makefile

Added: head/sys/compat/linuxkpi/common/include/linux/dmi.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/dmi.h Fri Oct  2 18:28:00 
2020(r366373)
@@ -0,0 +1,46 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __LINUX_DMI_H__
+#define__LINUX_DMI_H__
+
+#include 
+
+int linux_dmi_check_system(const struct dmi_system_id *);
+bool linux_dmi_match(enum dmi_field, const char *);
+const struct dmi_system_id *linux_dmi_first_match(const struct dmi_system_id 
*);
+const char *linux_dmi_get_system_info(int);
+
+#definedmi_check_system(sysid) linux_dmi_check_system(sysid)
+#definedmi_match(f, str)   linux_dmi_match(f, str)
+#definedmi_first_match(sysid)  linux_dmi_first_match(sysid)
+#definedmi_get_system_info(sysid)  linux_dmi_get_system_info(sysid)
+
+#endif /* __LINUX_DMI_H__ */

Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h
==
--- head/sys/compat/linuxkpi/common/include/linux/fs.h  Fri Oct  2 18:26:41 
2020(r366372)
+++ head/sys/compat/linuxkpi/common/include/linux/fs.h  Fri Oct  2 18:28:00 
2020(r366373)
@@ -180,7 +180,7 @@ struct file_operations {
 #defineFMODE_READ  FREAD
 #defineFMODE_WRITE FWRITE
 #defineFMODE_EXEC  FEXEC
-
+#defineFMODE_UNSIGNED_OFFSET   0x2000
 int __register_chrdev(unsigned int major, unsigned int baseminor,
 unsigned int count, const char *name,
 const struct file_operations *fops);

Added: head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h Fri Oct 
 2 18:28:00 2020(r366373)
@@ -0,0 +1,72 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED

svn commit: r366372 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src conf

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:26:41 2020
New Revision: 366372
URL: https://svnweb.freebsd.org/changeset/base/366372

Log:
  linuxkpi: Add backlight support
  
  Add backlight function to linuxkpi.
  Graphics drivers expose the backlight of the panel directly so allow them to 
use the backlight subsystem so
  user can use backlight(8) to configure them.
  
  Reviewed by:  hselasky
  Relnotes: yes
  Differential Revision:The FreeBSD Foundation

Added:
  head/sys/compat/linuxkpi/common/include/linux/backlight.h   (contents, props 
changed)
Modified:
  head/sys/compat/linuxkpi/common/include/linux/device.h
  head/sys/compat/linuxkpi/common/src/linux_kmod.c
  head/sys/compat/linuxkpi/common/src/linux_pci.c
  head/sys/conf/kmod.mk

Added: head/sys/compat/linuxkpi/common/include/linux/backlight.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/compat/linuxkpi/common/include/linux/backlight.h   Fri Oct  2 
18:26:41 2020(r366372)
@@ -0,0 +1,94 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot under sponsorship
+ * from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _LINUX_BACKLIGHT_H_
+#define _LINUX_BACKLIGHT_H_
+
+#include 
+
+struct backlight_device;
+
+enum backlight_type {
+   BACKLIGHT_RAW = 0,
+};
+
+struct backlight_properties {
+   int type;
+   int max_brightness;
+   int brightness;
+   int power;
+};
+
+enum backlight_notification {
+   BACKLIGHT_REGISTERED,
+   BACKLIGHT_UNREGISTERED,
+};
+
+enum backlight_update_reason {
+   BACKLIGHT_UPDATE_HOTKEY = 0
+};
+
+struct backlight_ops {
+   int options;
+#defineBL_CORE_SUSPENDRESUME   1
+   int (*update_status)(struct backlight_device *);
+   int (*get_brightness)(struct backlight_device *);
+};
+
+struct backlight_device {
+   const struct backlight_ops *ops;
+   struct backlight_properties props;
+   void *data;
+   struct device *dev;
+   char *name;
+};
+
+#define bl_get_data(bd) (bd)->data
+
+struct backlight_device *linux_backlight_device_register(const char *name,
+struct device *dev, void *data, const struct backlight_ops *ops, struct 
backlight_properties *props);
+void linux_backlight_device_unregister(struct backlight_device *bd);
+#definebacklight_device_register(name, dev, data, ops, props)  \
+   linux_backlight_device_register(name, dev, data, ops, props)
+#definebacklight_device_unregister(bd) 
linux_backlight_device_unregister(bd)
+
+static inline void
+backlight_update_status(struct backlight_device *bd)
+{
+   bd->ops->update_status(bd);
+}
+
+static inline void
+backlight_force_update(struct backlight_device *bd, int reason)
+{
+   bd->props.brightness = bd->ops->get_brightness(bd);
+}
+
+#endif /* _LINUX_BACKLIGHT_H_ */

Modified: head/sys/compat/linuxkpi/common/include/linux/device.h
==
--- head/sys/compat/linuxkpi/common/include/linux/device.h  Fri Oct  2 
18:23:27 2020(r366371)
+++ head/sys/compat/linuxkpi/common/include/linux/device.h  Fri Oct  2 
18:26:41 2020(r366372)
@@ -41,9 +41,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
+#include 
 
 struct device;
 struct fwnode_handle;
@@ -114,6 +116,8 @@ struct device {
unsigned intirq_end;
const struct attribute_group **groups;
struct fwnode_handle *fwnode;
+   struct cdev *backlight_dev;
+   struct ba

svn commit: r366371 - in head/sys: conf dev/pwm modules/pwm modules/pwm/pwm_backlight

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:23:27 2020
New Revision: 366371
URL: https://svnweb.freebsd.org/changeset/base/366371

Log:
  Add pwm_backlight
  
  Driver for pwm-backlight compatible device.
  
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26252

Added:
  head/sys/dev/pwm/pwm_backlight.c   (contents, props changed)
  head/sys/modules/pwm/pwm_backlight/
  head/sys/modules/pwm/pwm_backlight/Makefile   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/pwm/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Oct  2 18:21:30 2020(r366370)
+++ head/sys/conf/files Fri Oct  2 18:23:27 2020(r366371)
@@ -2755,6 +2755,7 @@ dev/pwm/pwmbus.c  optional pwm | pwmbus
 dev/pwm/pwmbus_if.moptional pwm | pwmbus
 dev/pwm/ofw_pwm.c  optional pwm fdt | pwmbus fdt
 dev/pwm/ofw_pwmbus.c   optional pwm fdt | pwmbus fdt
+dev/pwm/pwm_backlight.coptional pwm pwm_backlight fdt
 dev/quicc/quicc_core.c optional quicc
 dev/ral/rt2560.c   optional ral
 dev/ral/rt2661.c   optional ral

Added: head/sys/dev/pwm/pwm_backlight.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/pwm/pwm_backlight.cFri Oct  2 18:23:27 2020
(r366371)
@@ -0,0 +1,311 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2020 Emmanuel Vadot 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+#include "backlight_if.h"
+#include "pwmbus_if.h"
+
+struct pwm_backlight_softc {
+   device_tpwmdev;
+   struct cdev *cdev;
+
+   pwm_channel_t   channel;
+   uint32_t*levels;
+   ssize_t nlevels;
+   int default_level;
+   ssize_t current_level;
+
+   regulator_t power_supply;
+   uint64_tperiod;
+   uint64_tduty;
+   boolenabled;
+};
+
+static int pwm_backlight_find_level_per_percent(struct pwm_backlight_softc 
*sc, int percent);
+
+static struct ofw_compat_data compat_data[] = {
+   { "pwm-backlight",  1 },
+   { NULL, 0 }
+};
+
+static int
+pwm_backlight_probe(device_t dev)
+{
+
+   if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
+   return (ENXIO);
+
+   device_set_desc(dev, "PWM Backlight");
+   return (BUS_PROBE_DEFAULT);
+}
+
+static int
+pwm_backlight_attach(device_t dev)
+{
+   struct pwm_backlight_softc *sc;
+   phandle_t node;
+   int rv;
+
+   sc = device_get_softc(dev);
+   node = ofw_bus_get_node(dev);
+
+   rv = pwm_get_by_ofw_propidx(dev, node, "pwms", 0, >channel);
+   if (rv != 0) {
+   device_printf(dev, "Cannot map pwm channel %d\n", rv);
+   return (ENXIO);
+   }
+
+   if (regulator_get_by_ofw_property(dev, 0, "power-supply",
+   >power_supply) != 0) {
+   device_printf(dev, "No power-supply property\n");
+   return (ENXIO);
+   }
+
+   if (OF_hasprop(node,

svn commit: r366370 - in head/usr.bin: . backlight

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:21:30 2020
New Revision: 366370
URL: https://svnweb.freebsd.org/changeset/base/366370

Log:
  Add backlight(8)
  
  This tool is used to configure registered backlights.
  It can incr/decr (default to 10%) or accept a percentage value directly.
  
  Reviewed by:  manpages (gbe@)
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26251

Added:
  head/usr.bin/backlight/
  head/usr.bin/backlight/Makefile   (contents, props changed)
  head/usr.bin/backlight/backlight.8   (contents, props changed)
  head/usr.bin/backlight/backlight.c   (contents, props changed)
Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Fri Oct  2 18:18:01 2020(r366369)
+++ head/usr.bin/Makefile   Fri Oct  2 18:21:30 2020(r366370)
@@ -7,6 +7,7 @@ SUBDIR= alias \
apply \
asa \
awk \
+   backlight \
banner \
basename \
brandelf \

Added: head/usr.bin/backlight/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/backlight/Makefile Fri Oct  2 18:21:30 2020
(r366370)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG=  backlight
+MAN=   backlight.8
+
+.include 

Added: head/usr.bin/backlight/backlight.8
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/backlight/backlight.8  Fri Oct  2 18:21:30 2020
(r366370)
@@ -0,0 +1,95 @@
+.\" Copyright (c) 2020 Emmanuel Vadot 
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 02, 2020
+.Dt BACKLIGHT 8
+.Os
+.Sh NAME
+.Nm backlight
+.Nd configure backlight hardware
+.Sh SYNOPSIS
+.Nm
+.Op Fl f Ar device
+.Op Fl q
+.Op Fl i
+.Op Ar value
+.Nm
+.Op Fl f Ar device
+incr | +
+.Op Ar value
+.Nm
+.Op Fl f Ar device
+decr | -
+.Op Ar value
+.Sh DESCRIPTION
+The
+.Nm
+utility can be used to configure brightness levels for registered backlights
+.Pp
+The options are as follows:
+.Bl -tag -width "-f device"
+.It Fl f Ar device
+Device to operate on.
+If not specified,
+.Pa /dev/backlight/backlight0
+is used.
+If an unqualified name is provided,
+.Pa /dev/backlight
+is automatically prepended.
+.It Fl q
+When querying the brightness level only print the value.
+.It Fl i
+Query information about the backlight (name, type).
+.It Ar value
+Set the brightness level to this value, must be between 0 and 100.
+.It Ar incr | +
+.Op Ar value
+Decrement the backlight level.
+If no value is specified a default of 10 percent is used.
+.It Ar decr | -
+.Op Ar value
+Increment the backlight level.
+If no value is specified a default of 10 percent is used.
+.El
+.Sh EXAMPLES
+.Bl -bullet
+.It
+Show the current brightness level
+.Bd -literal
+backlight -f /dev/backlight/backlight0
+.Ed
+.El
+.Sh SEE ALSO
+.Xr backlight 9
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Fx 13.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+utility and this manual page were written by
+.An Emmanuel Vadot Aq Mt m...@freebsd.org .

Added: head/usr.bin/backlight/backlight.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/backlight/backlight.c  Fri Oct  2 18:21:30 2020    
(r366370)
@@ -0,0 +1,220 @@
+/*-
+ * SPDX-Licen

svn commit: r366369 - in head: share/man/man9 sys/conf sys/dev/backlight sys/modules sys/modules/backlight sys/sys

2020-10-02 Thread Emmanuel Vadot
Author: manu
Date: Fri Oct  2 18:18:01 2020
New Revision: 366369
URL: https://svnweb.freebsd.org/changeset/base/366369

Log:
  Add backlight subsystem
  
  This is a simple subsystem that allow drivers to register as a backlight.
  Each backlight creates a device node under /dev/backlight/backlightX and
  an alias based on the name provided.
  
  Relnotes: yes
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D26250

Added:
  head/share/man/man9/backlight.9   (contents, props changed)
  head/sys/dev/backlight/
  head/sys/dev/backlight/backlight.c   (contents, props changed)
  head/sys/dev/backlight/backlight.h   (contents, props changed)
  head/sys/dev/backlight/backlight_if.m   (contents, props changed)
  head/sys/modules/backlight/
  head/sys/modules/backlight/Makefile   (contents, props changed)
  head/sys/sys/backlight.h   (contents, props changed)
Modified:
  head/share/man/man9/Makefile
  head/sys/conf/files
  head/sys/modules/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileFri Oct  2 17:50:22 2020
(r366368)
+++ head/share/man/man9/MakefileFri Oct  2 18:18:01 2020
(r366369)
@@ -10,6 +10,7 @@ MAN=  accept_filter.9 \
alq.9 \
altq.9 \
atomic.9 \
+   backlight.9 \
bhnd.9 \
bhnd_erom.9 \
bios.9 \

Added: head/share/man/man9/backlight.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/backlight.9 Fri Oct  2 18:18:01 2020
(r366369)
@@ -0,0 +1,77 @@
+.\" Copyright (c) 2020 Emmanuel Vadot 
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 02, 2020
+.Dt BACKLIGHT 9
+.Os
+.Sh NAME
+.Nm backlight ,
+.Nm backlight_register ,
+.Nm backlight_destroy ,
+.Nm BACKLIGHT_GET_STATUS ,
+.Nm BACKLIGHT_SET_STATUS ,
+.Nd BACKLIGHT methods
+.Sh SYNOPSIS
+.Cd "device backlight"
+.In "backlight_if.h"
+.In "sys/sys/backlight.h"
+.Ft int
+.Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props"
+.Ft int
+.Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props"
+.Ft struct cdev *
+.Fn backlight_register "const char *name" "device_t dev"
+.Ft int
+.Fn backlight_destroy "struct cdev *cdev"
+.Sh DESCRIPTION
+The backlight driver provides a generic way for handling a panel backlight.
+.Pp
+Drivers for backlight system register themselves globally using the
+.Fn backlight_register
+function.
+They must define two methods,
+.Fn BACKLIGHT_GET_STATUS
+which is used to query the current brightness level and
+.Fn BACKLIGHT_SET_STATUS
+which is used to update it.
+.Sh INTERFACE
+.Bl -tag -width indent
+.It Fn BACKLIGHT_GET_STATUS "device_t bus" "struct backlight_props *props"
+Driver fills the current brightless level and the optional supported levels.
+.It Fn BACKLIGHT_SET_STATUS "device_t bus" "struct backlight_props *props"
+Driver update the backlight level based on the brightness member of the props
+struct.
+.El
+.Sh FILES
+.Bl -tag -width "/dev/backlight/*"
+.It Pa /dev/backlight/*
+.Sh HISTORY
+The
+.Nm backlight
+interface first appear in
+.Fx 13.0 .
+The
+.Nm backlight
+driver and manual page was written by
+.An Emmanuel Vadot Aq Mt m...@freebsd.org .

Modified: head/sys/conf/files
=

svn commit: r366330 - head/sys/dev/ichsmb

2020-10-01 Thread Emmanuel Vadot
Author: manu
Date: Thu Oct  1 16:55:01 2020
New Revision: 366330
URL: https://svnweb.freebsd.org/changeset/base/366330

Log:
  ichsmb_pci: convert to pci_device_table / add PCI_PNP_INFO
  
  Submitted by: Greg V 
  Reviewed by:  mav
  Differential Revision:https://reviews.freebsd.org/D25260

Modified:
  head/sys/dev/ichsmb/ichsmb_pci.c

Modified: head/sys/dev/ichsmb/ichsmb_pci.c
==
--- head/sys/dev/ichsmb/ichsmb_pci.cThu Oct  1 16:53:16 2020
(r366329)
+++ head/sys/dev/ichsmb/ichsmb_pci.cThu Oct  1 16:55:01 2020
(r366330)
@@ -106,51 +106,87 @@ __FBSDID("$FreeBSD$");
 #defineID_KABYLAKE 0xa2a3
 #defineID_CANNONLAKE   0xa323
 
-static const struct ichsmb_device {
-   uint16_tid;
-   const char  *name;
-} ichsmb_devices[] = {
-   { ID_82801AA,   "Intel 82801AA (ICH) SMBus controller"  },
-   { ID_82801AB,   "Intel 82801AB (ICH0) SMBus controller" },
-   { ID_82801BA,   "Intel 82801BA (ICH2) SMBus controller" },
-   { ID_82801CA,   "Intel 82801CA (ICH3) SMBus controller" },
-   { ID_82801DC,   "Intel 82801DC (ICH4) SMBus controller" },
-   { ID_82801EB,   "Intel 82801EB (ICH5) SMBus controller" },
-   { ID_82801FB,   "Intel 82801FB (ICH6) SMBus controller" },
-   { ID_82801GB,   "Intel 82801GB (ICH7) SMBus controller" },
-   { ID_82801H,"Intel 82801H (ICH8) SMBus controller"  },
-   { ID_82801I,"Intel 82801I (ICH9) SMBus controller"  },
-   { ID_82801GB,   "Intel 82801GB (ICH7) SMBus controller" },
-   { ID_82801H,"Intel 82801H (ICH8) SMBus controller"  },
-   { ID_82801I,"Intel 82801I (ICH9) SMBus controller"  },
-   { ID_EP80579,   "Intel EP80579 SMBus controller"},
-   { ID_82801JI,   "Intel 82801JI (ICH10) SMBus controller"},
-   { ID_82801JD,   "Intel 82801JD (ICH10) SMBus controller"},
-   { ID_PCH,   "Intel PCH SMBus controller"},
-   { ID_6300ESB,   "Intel 6300ESB (ICH) SMBus controller"  },
-   { ID_631xESB,   "Intel 631xESB/6321ESB (ESB2) SMBus controller" },
-   { ID_DH89XXCC,  "Intel DH89xxCC SMBus controller"   },
-   { ID_PATSBURG,  "Intel Patsburg SMBus controller"   },
-   { ID_CPT,   "Intel Cougar Point SMBus controller"   },
-   { ID_PPT,   "Intel Panther Point SMBus controller"  },
-   { ID_AVOTON,"Intel Avoton SMBus controller" },
-   { ID_LPT,   "Intel Lynx Point SMBus controller" },
-   { ID_LPTLP, "Intel Lynx Point-LP SMBus controller"  },
-   { ID_WCPT,  "Intel Wildcat Point SMBus controller"  },
-   { ID_WCPTLP,"Intel Wildcat Point-LP SMBus controller"   },
-   { ID_BAYTRAIL,  "Intel Baytrail SMBus controller"   },
-   { ID_BRASWELL,  "Intel Braswell SMBus controller"   },
-   { ID_COLETOCRK, "Intel Coleto Creek SMBus controller"   },
-   { ID_WELLSBURG, "Intel Wellsburg SMBus controller"  },
-   { ID_SRPT,  "Intel Sunrise Point-H SMBus controller"},
-   { ID_SRPTLP,"Intel Sunrise Point-LP SMBus controller"   },
-   { ID_DENVERTON, "Intel Denverton SMBus controller"  },
-   { ID_BROXTON,   "Intel Broxton SMBus controller"},
-   { ID_LEWISBURG, "Intel Lewisburg SMBus controller"  },
-   { ID_LEWISBURG2,"Intel Lewisburg SMBus controller"  },
-   { ID_KABYLAKE,  "Intel Kaby Lake SMBus controller"  },
-   { ID_CANNONLAKE,"Intel Cannon Lake SMBus controller"},
-   { 0, NULL },
+static const struct pci_device_table ichsmb_devices[] = {
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AA),
+ PCI_DESCR("Intel 82801AA (ICH) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801AB),
+ PCI_DESCR("Intel 82801AB (ICH0) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801BA),
+ PCI_DESCR("Intel 82801BA (ICH2) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801CA),
+ PCI_DESCR("Intel 82801CA (ICH3) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801DC),
+ PCI_DESCR("Intel 82801DC (ICH4) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801EB),
+ PCI_DESCR("Intel 82801EB (ICH5) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801FB),
+ PCI_DESCR("Intel 82801FB (ICH6) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801GB),
+ PCI_DESCR("Intel 82801GB (ICH7) SMBus controller") },
+   { PCI_DEV(PCI_VENDOR_INTEL, ID_82801H),
+ PCI_DESCR("Intel 82801H (ICH8) SMBus 

svn commit: r366295 - head/sys/dev/ahci

2020-09-30 Thread Emmanuel Vadot
Author: manu
Date: Wed Sep 30 17:10:49 2020
New Revision: 366295
URL: https://svnweb.freebsd.org/changeset/base/366295

Log:
  ahci_generic: add quirk for NXP0004 (NXP Layerscape LX2160A)
  
  This fixes this error :
  (aprobe3:ahcich3:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 
00 00
  (aprobe3:ahcich3:0:15:0): CAM status: Command timeout
  (aprobe3:ahcich3:0:15:0): Error 5, Retries exhausted
  
  Submitted by: Greg V 
  Reviewed by:  imp, mav
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25157

Modified:
  head/sys/dev/ahci/ahci_generic.c

Modified: head/sys/dev/ahci/ahci_generic.c
==
--- head/sys/dev/ahci/ahci_generic.cWed Sep 30 17:09:17 2020
(r366294)
+++ head/sys/dev/ahci/ahci_generic.cWed Sep 30 17:10:49 2020
(r366295)
@@ -86,11 +86,22 @@ ahci_fdt_probe(device_t dev)
 #endif
 
 #ifdef DEV_ACPI
+
+static const struct ahci_acpi_quirk {
+   const char* hid;
+   u_int   quirks;
+} ahci_acpi_quirks[] = {
+   { "NXP0004", AHCI_Q_NOPMP },
+   { NULL, 0 }
+};
+
+
 static int
 ahci_acpi_probe(device_t dev)
 {
struct ahci_controller *ctlr = device_get_softc(dev);
ACPI_HANDLE h;
+   int i;
 
if ((h = acpi_get_handle(dev)) == NULL)
return (ENXIO);
@@ -105,6 +116,12 @@ ahci_acpi_probe(device_t dev)
if (bootverbose)
device_printf(dev, "Bus is%s cache-coherent\n",
  ctlr->dma_coherent ? "" : " not");
+   for (i = 0; ahci_acpi_quirks[i].hid != NULL; i++) {
+   if (acpi_MatchHid(h, ahci_acpi_quirks[i].hid) != 
ACPI_MATCHHID_NOMATCH) {
+   ctlr->quirks = ahci_acpi_quirks[i].quirks;
+   break;
+   }
+   }
return (BUS_PROBE_DEFAULT);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r366294 - head/sys/dev/acpica

2020-09-30 Thread Emmanuel Vadot
Author: manu
Date: Wed Sep 30 17:09:17 2020
New Revision: 366294
URL: https://svnweb.freebsd.org/changeset/base/366294

Log:
  acpi_resource: support multiple IRQs
  
  Some DSDT entries have multiple interrupts for one device.
  Add support for it.
  
  This fixes ahci on NXP LS2160 and genet on RPi4
  
  Submitted by: Greg V 
  Reviewed by:  jhb
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25145

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Wed Sep 30 17:08:34 2020
(r366293)
+++ head/sys/dev/acpica/acpi_resource.c Wed Sep 30 17:09:17 2020
(r366294)
@@ -643,17 +643,13 @@ acpi_res_set_irq(device_t dev, void *context, uint8_t 
 int trig, int pol)
 {
 struct acpi_res_context*cp = (struct acpi_res_context *)context;
-rman_res_t intr;
+int i;
 
 if (cp == NULL || irq == NULL)
return;
 
-/* This implements no resource relocation. */
-if (count != 1)
-   return;
-
-intr = *irq;
-bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1);
+for (i = 0; i < count; i++)
+bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1);
 }
 
 static void
@@ -661,17 +657,13 @@ acpi_res_set_ext_irq(device_t dev, void *context, uint
 int trig, int pol)
 {
 struct acpi_res_context*cp = (struct acpi_res_context *)context;
-rman_res_t intr;
+int i;
 
 if (cp == NULL || irq == NULL)
return;
 
-/* This implements no resource relocation. */
-if (count != 1)
-   return;
-
-intr = *irq;
-bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, intr, 1);
+for (i = 0; i < count; i++)
+bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r365927 - head/sys/arm/allwinner

2020-09-20 Thread Emmanuel Vadot
Author: manu
Date: Sun Sep 20 16:11:38 2020
New Revision: 365927
URL: https://svnweb.freebsd.org/changeset/base/365927

Log:
  arm: allwinner: aw_nmi: Fix wrong logic when we disable the nmi
  
  MFC after:1 week

Modified:
  head/sys/arm/allwinner/aw_nmi.c

Modified: head/sys/arm/allwinner/aw_nmi.c
==
--- head/sys/arm/allwinner/aw_nmi.c Sun Sep 20 15:11:52 2020
(r365926)
+++ head/sys/arm/allwinner/aw_nmi.c Sun Sep 20 16:11:38 2020
(r365927)
@@ -129,7 +129,7 @@ aw_nmi_intr(void *arg)
}
 
if (intr_isrc_dispatch(>intr.isrc, curthread->td_intr_frame) != 0) {
-   SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+   SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
device_printf(sc->dev, "Stray interrupt, NMI disabled\n");
}
 
@@ -153,7 +153,7 @@ aw_nmi_disable_intr(device_t dev, struct intr_irqsrc *
 
sc = device_get_softc(dev);
 
-   SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+   SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
 }
 
 static int
@@ -296,7 +296,7 @@ aw_nmi_teardown_intr(device_t dev, struct intr_irqsrc 
sc->intr.pol = INTR_POLARITY_CONFORM;
sc->intr.tri = INTR_TRIGGER_CONFORM;
 
-   SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+   SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
}
 
return (0);
@@ -367,7 +367,7 @@ aw_nmi_attach(device_t dev)
}
 
/* Disable and clear interrupts */
-   SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE);
+   SC_NMI_WRITE(sc, sc->cfg->enable_reg, ~NMI_IRQ_ENABLE);
SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK);
 
xref = OF_xref_from_node(ofw_bus_get_node(dev));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364737 - head/sys/dev/drm2

2020-09-01 Thread Emmanuel Vadot
On Tue, 1 Sep 2020 16:31:58 +0200
Niclas Zeising  wrote:

> On 2020-09-01 16:19, Emmanuel Vadot wrote:
> > On Tue, 1 Sep 2020 15:32:18 +0200
> > Niclas Zeising  wrote:
> > 
> >> On 2020-09-01 15:16, Emmanuel Vadot wrote:
> >>> On Tue, 1 Sep 2020 15:13:53 +0200
> >>> Michal Meloun  wrote:
> >>>
> >>>>
> >>>>
> >>>> On 25.08.2020 0:53, Niclas Zeising wrote:
> >>>>> Author: zeising (doc,ports committer)
> >>>>> Date: Mon Aug 24 22:53:23 2020
> >>>>> New Revision: 364737
> >>>>> URL: https://svnweb.freebsd.org/changeset/base/364737
> >>>>>
> >>>>> Log:
> >>>>> drm2: Update deprecation message
> >>>>> 
> >>>>> Update the deprecation message in the drm2 (aka legacy drm) drivers 
> >>>>> to point
> >>>>> towards the graphics/drm-kmod ports for all architectures, not just 
> >>>>> amd64.
> >>>> Only known user of drm2 is arm/tegra124 based boards. How
> >>>> graphics/drm-kmod can help for these?
> >>>> Or be more specific - drm2 allows me to hot-plug monitor to tegra based
> >>>> board an use 2 scaled overlay planes (which is exactly whats I want for
> >>>>my application). Which alternative can you offer me?
> >>>> Btw, as you can see, the maintenance cost of drm2 is close to zero and
> >>>> the dev/drm2 code does not inherit with any of the major architectures.
> >>>>
> >>>> Michal
> >>>
> >>>I think that the goal was only to mfc this to warn users before 12.2
> >>> is branched, maybe a direct commit to 12 would have been better.
> >>>
> >>
> >> No, the change is correct.
> >> drm-legacy-kmod (the port) is going away, especially on FreeBSD 13,
> >> since it is preventing updates to the FreeBSD VM subsystem.  I sent
> >> an-email about this to a variety of lists about a week ago.
> >> I do know that there are a few special users of drm2 in FreeBSD current,
> >> I do not know how those are affected.  Since, on FreeBSD current, most
> >> architectures can use drm-kmod, I believe it is good to point everyone
> >> towards that ports, instead of pointing everyone except amd64 users to
> >> drm-legacy-kmod.
> >> Regards
> >> -- 
> >> Niclas Zeising
> > 
> >   drm2 in src is only used for arm, so as Michal wrote in another email
> > the warning will be seen only for tegra users, the mfc'ed commit will
> > be seen by intel/amd ones though.
> > 
> 
> I still have to make a general change that can be MFCd. 

 I think that for this case a direct commit to 12 would have been ok.

> And pointing  arm tegra users to drm-legacy-kmod is equally wrong.

 True, pointing them to any port is wrong anyway, none of them will
work, it would be better to remove the warning now.

> Regards
> -- 
> Niclas Zeising


-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364737 - head/sys/dev/drm2

2020-09-01 Thread Emmanuel Vadot
On Tue, 1 Sep 2020 15:32:18 +0200
Niclas Zeising  wrote:

> On 2020-09-01 15:16, Emmanuel Vadot wrote:
> > On Tue, 1 Sep 2020 15:13:53 +0200
> > Michal Meloun  wrote:
> > 
> >>
> >>
> >> On 25.08.2020 0:53, Niclas Zeising wrote:
> >>> Author: zeising (doc,ports committer)
> >>> Date: Mon Aug 24 22:53:23 2020
> >>> New Revision: 364737
> >>> URL: https://svnweb.freebsd.org/changeset/base/364737
> >>>
> >>> Log:
> >>>drm2: Update deprecation message
> >>>
> >>>Update the deprecation message in the drm2 (aka legacy drm) drivers to 
> >>> point
> >>>towards the graphics/drm-kmod ports for all architectures, not just 
> >>> amd64.
> >> Only known user of drm2 is arm/tegra124 based boards. How
> >> graphics/drm-kmod can help for these?
> >> Or be more specific - drm2 allows me to hot-plug monitor to tegra based
> >> board an use 2 scaled overlay planes (which is exactly whats I want for
> >>   my application). Which alternative can you offer me?
> >> Btw, as you can see, the maintenance cost of drm2 is close to zero and
> >> the dev/drm2 code does not inherit with any of the major architectures.
> >>
> >> Michal
> > 
> >   I think that the goal was only to mfc this to warn users before 12.2
> > is branched, maybe a direct commit to 12 would have been better.
> > 
> 
> No, the change is correct.
> drm-legacy-kmod (the port) is going away, especially on FreeBSD 13, 
> since it is preventing updates to the FreeBSD VM subsystem.  I sent 
> an-email about this to a variety of lists about a week ago.
> I do know that there are a few special users of drm2 in FreeBSD current, 
> I do not know how those are affected.  Since, on FreeBSD current, most 
> architectures can use drm-kmod, I believe it is good to point everyone 
> towards that ports, instead of pointing everyone except amd64 users to 
> drm-legacy-kmod.
> Regards
> -- 
> Niclas Zeising

 drm2 in src is only used for arm, so as Michal wrote in another email
the warning will be seen only for tegra users, the mfc'ed commit will
be seen by intel/amd ones though.

-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364737 - head/sys/dev/drm2

2020-09-01 Thread Emmanuel Vadot
On Tue, 1 Sep 2020 15:13:53 +0200
Michal Meloun  wrote:

> 
> 
> On 25.08.2020 0:53, Niclas Zeising wrote:
> > Author: zeising (doc,ports committer)
> > Date: Mon Aug 24 22:53:23 2020
> > New Revision: 364737
> > URL: https://svnweb.freebsd.org/changeset/base/364737
> > 
> > Log:
> >   drm2: Update deprecation message
> >   
> >   Update the deprecation message in the drm2 (aka legacy drm) drivers to 
> > point
> >   towards the graphics/drm-kmod ports for all architectures, not just amd64.
> Only known user of drm2 is arm/tegra124 based boards. How
> graphics/drm-kmod can help for these?
> Or be more specific - drm2 allows me to hot-plug monitor to tegra based
> board an use 2 scaled overlay planes (which is exactly whats I want for
>  my application). Which alternative can you offer me?
> Btw, as you can see, the maintenance cost of drm2 is close to zero and
> the dev/drm2 code does not inherit with any of the major architectures.
> 
> Michal

 I think that the goal was only to mfc this to warn users before 12.2
is branched, maybe a direct commit to 12 would have been better.

> 
> >   drm-kmod has support for more architectures these days, and the
> >   graphics/drm-legacy-kmod port is being deprecated.
> 
> >   
> >   Approved by:  imp
> >   MFC after:1 week
> >   Differential Revision:https://reviews.freebsd.org/D26174
> > 
> > Modified:
> >   head/sys/dev/drm2/drm_os_freebsd.h
> > 
> > Modified: head/sys/dev/drm2/drm_os_freebsd.h
> > ==
> > --- head/sys/dev/drm2/drm_os_freebsd.h  Mon Aug 24 22:48:19 2020
> > (r364736)
> > +++ head/sys/dev/drm2/drm_os_freebsd.h  Mon Aug 24 22:53:23 2020
> > (r364737)
> > @@ -154,16 +154,12 @@ typedef void  irqreturn_t;
> > *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) +  \
> > (vm_offset_t)(offset)) = htole64(val)
> >  
> > -#ifdef amd64
> >  #define DRM_PORT "graphics/drm-kmod"
> > -#else
> > -#define DRM_PORT "graphics/drm-legacy-kmod"
> > -#endif
> >  
> >  #define DRM_OBSOLETE(dev)  
> > \
> >  do {   
> > \
> > device_printf(dev, 
> > "===\n"); \
> > -   device_printf(dev, "This code is obsolete abandonware. Install the " 
> > DRM_PORT " pkg\n"); \
> > +   device_printf(dev, "This code is deprecated.  Install the " DRM_PORT " 
> > pkg\n"); \
> > device_printf(dev, 
> > "===\n"); \
> > gone_in_dev(dev, 13, "drm2 drivers");   
> > \
> >  } while (0)
> > 


-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364952 - head/sys/arm/allwinner/clkng

2020-08-29 Thread Emmanuel Vadot
Author: manu
Date: Sat Aug 29 11:39:53 2020
New Revision: 364952
URL: https://svnweb.freebsd.org/changeset/base/364952

Log:
  Fix arm64 build after r364927
  
  Reported by:  jenkins, dch
  Pointy hat to:manu

Modified:
  head/sys/arm/allwinner/clkng/aw_clk_nm.c

Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c
==
--- head/sys/arm/allwinner/clkng/aw_clk_nm.cSat Aug 29 11:18:10 2020
(r364951)
+++ head/sys/arm/allwinner/clkng/aw_clk_nm.cSat Aug 29 11:39:53 2020
(r364952)
@@ -221,14 +221,14 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare
if ((best < *fout) &&
  ((flags & CLK_SET_ROUND_DOWN) == 0)) {
*stop = 1;
-   printf("best freq (%llu) < requested freq(%llu)\n",
+   printf("best freq (%ju) < requested freq(%ju)\n",
best, *fout);
return (ERANGE);
}
if ((best > *fout) &&
  ((flags & CLK_SET_ROUND_UP) == 0)) {
*stop = 1;
-   printf("best freq (%llu) > requested freq(%llu)\n",
+   printf("best freq (%ju) > requested freq(%ju)\n",
best, *fout);
return (ERANGE);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364927 - head/sys/arm/allwinner/clkng

2020-08-28 Thread Emmanuel Vadot
Author: manu
Date: Fri Aug 28 18:25:45 2020
New Revision: 364927
URL: https://svnweb.freebsd.org/changeset/base/364927

Log:
  arm: allwinner: clk: Add printfs when we cannot set the correct freq
  
  For some unknown reason this seems to fix this function when we printf
  the best variable. This isn't a delay problem as doing a printf without
  it doesn't solve this problem.
  This is way above my pay grade so add some printf that shouldn't be printed
  in 99% of the case anyway.
  Fix booting on most Allwinner boards as the mmc IP uses a NM clock.
  
  Reported by:  Alexander Mishin 
  MFC after:3 days
  X-MFC-With:   363887

Modified:
  head/sys/arm/allwinner/clkng/aw_clk_nm.c

Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c
==
--- head/sys/arm/allwinner/clkng/aw_clk_nm.cFri Aug 28 17:55:54 2020
(r364926)
+++ head/sys/arm/allwinner/clkng/aw_clk_nm.cFri Aug 28 18:25:45 2020
(r364927)
@@ -221,11 +221,15 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare
if ((best < *fout) &&
  ((flags & CLK_SET_ROUND_DOWN) == 0)) {
*stop = 1;
+   printf("best freq (%llu) < requested freq(%llu)\n",
+   best, *fout);
return (ERANGE);
}
if ((best > *fout) &&
  ((flags & CLK_SET_ROUND_UP) == 0)) {
*stop = 1;
+   printf("best freq (%llu) > requested freq(%llu)\n",
+   best, *fout);
return (ERANGE);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r364859 - head/sys/arm/ti

2020-08-27 Thread Emmanuel Vadot
On Thu, 27 Aug 2020 08:08:49 + (UTC)
Emmanuel Vadot  wrote:

> Author: manu
> Date: Thu Aug 27 08:08:49 2020
> New Revision: 364859
> URL: https://svnweb.freebsd.org/changeset/base/364859
> 
> Log:
>   arm: ti: Fix Beaglebone black MMC after DTS update
>   
>   After DTS sync with Linux kernel 5.8 this patch was included:
>   "ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver"
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2=0b4edf111870b83ea77b1d7e16b8ceac29f9f388
>   
>   Current will not load any driver for MMC and not mount the rootfs.
>   Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c
>   
>   Submitted by:   oskar.holml...@ohdata.se
>   Reported by:phk
>   X-MFC-With: 363853

 Differential Revision: https://reviews.freebsd.org/D26194

> 
> Modified:
>   head/sys/arm/ti/ti_sdhci.c
> 
> Modified: head/sys/arm/ti/ti_sdhci.c
> ==
> --- head/sys/arm/ti/ti_sdhci.cThu Aug 27 06:31:55 2020
> (r364858)
> +++ head/sys/arm/ti/ti_sdhci.cThu Aug 27 08:08:49 2020
> (r364859)
> @@ -93,6 +93,7 @@ struct ti_sdhci_softc {
>   * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the 
> am335x.
>   */
>  static struct ofw_compat_data compat_data[] = {
> + {"ti,am335-sdhci",  1},
>   {"ti,omap3-hsmmc",  1},
>   {"ti,omap4-hsmmc",  1},
>   {"ti,mmchs",1},


-- 
Emmanuel Vadot 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364859 - head/sys/arm/ti

2020-08-27 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 27 08:08:49 2020
New Revision: 364859
URL: https://svnweb.freebsd.org/changeset/base/364859

Log:
  arm: ti: Fix Beaglebone black MMC after DTS update
  
  After DTS sync with Linux kernel 5.8 this patch was included:
  "ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver"
  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am33xx-l4.dtsi?h=v5.9-rc2=0b4edf111870b83ea77b1d7e16b8ceac29f9f388
  
  Current will not load any driver for MMC and not mount the rootfs.
  Simple patch add "ti,am335-sdhci" to compability strings in ti_sdhci.c
  
  Submitted by: oskar.holml...@ohdata.se
  Reported by:  phk
  X-MFC-With:   363853

Modified:
  head/sys/arm/ti/ti_sdhci.c

Modified: head/sys/arm/ti/ti_sdhci.c
==
--- head/sys/arm/ti/ti_sdhci.c  Thu Aug 27 06:31:55 2020(r364858)
+++ head/sys/arm/ti/ti_sdhci.c  Thu Aug 27 08:08:49 2020(r364859)
@@ -93,6 +93,7 @@ struct ti_sdhci_softc {
  * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x.
  */
 static struct ofw_compat_data compat_data[] = {
+   {"ti,am335-sdhci",  1},
{"ti,omap3-hsmmc",  1},
{"ti,omap4-hsmmc",  1},
{"ti,mmchs",1},
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364674 - in stable/12/sys/compat/linuxkpi/common: include/linux src

2020-08-24 Thread Emmanuel Vadot
/sys/compat/linuxkpi/common/include/linux/hardirq.hMon Aug 
24 13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/hardirq.hMon Aug 
24 13:19:16 2020(r364674)
@@ -32,6 +32,7 @@
 #define_LINUX_HARDIRQ_H_
 
 #include 
+#include 
 
 #include 
 #include 

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/jiffies.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/jiffies.hMon Aug 
24 13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/jiffies.hMon Aug 
24 13:19:16 2020(r364674)
@@ -45,7 +45,9 @@
 #defineMAX_JIFFY_OFFSET((INT_MAX >> 1) - 1)
 
 #definetime_after(a, b)((int)((b) - (a)) < 0)
+#definetime_after32(a, b)  ((int32_t)((uint32_t)(b) - 
(uint32_t)(a)) < 0)
 #definetime_before(a, b)   time_after(b,a)
+#definetime_before32(a, b) time_after32(b, a)
 #definetime_after_eq(a, b) ((int)((a) - (b)) >= 0)
 #definetime_before_eq(a, b)time_after_eq(b, a)
 #definetime_in_range(a,b,c)\

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Aug 24 
13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/kernel.h Mon Aug 24 
13:19:16 2020(r364674)
@@ -593,4 +593,7 @@ linux_ratelimited(linux_ratelimit_t *rl)
(is_signed(datatype) ? INT8_MIN : 0) \
 )
 
+#defineTAINT_WARN  0
+#definetest_taint(x)   (0)
+
 #endif /* _LINUX_KERNEL_H_ */

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/kref.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/kref.h   Mon Aug 24 
13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/kref.h   Mon Aug 24 
13:19:16 2020(r364674)
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -76,6 +77,20 @@ kref_put(struct kref *kref, void (*rel)(struct kref *k
}
return 0;
 }
+
+static inline int
+kref_put_lock(struct kref *kref, void (*rel)(struct kref *kref),
+spinlock_t *lock)
+{
+
+   if (refcount_release(>refcount.counter)) {
+   spin_lock(lock);
+   rel(kref);
+   return (1);
+   }
+   return (0);
+}
+
 
 static inline int
 kref_sub(struct kref *kref, unsigned int count,

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.hMon Aug 
24 13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/lockdep.hMon Aug 
24 13:19:16 2020(r364674)
@@ -32,6 +32,8 @@
 #ifndef _LINUX_LOCKDEP_H_
 #define_LINUX_LOCKDEP_H_
 
+#include 
+
 struct lock_class_key {
 };
 

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h  Mon Aug 24 
13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h  Mon Aug 24 
13:19:16 2020(r364674)
@@ -67,6 +67,8 @@ typedef struct mutex {
linux_mutex_lock_interruptible(_m); \
 })
 
+#definemutex_lock_interruptible_nested(m, c)   
mutex_lock_interruptible(m)
+
 /*
  * Reuse the interruptable method since the SX
  * lock handles both signals and interrupts:

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/preempt.h
==
--- stable/12/sys/compat/linuxkpi/common/include/linux/preempt.hMon Aug 
24 13:15:08 2020(r364673)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/preempt.hMon Aug 
24 13:19:16 2020(r364674)
@@ -29,6 +29,7 @@
 #ifndef _LINUX_PREEMPT_H_
 #define_LINUX_PREEMPT_H_
 
+#include 
 #include 
 
 #definein_interrupt() \

Copied: stable/12/sys/compat/linuxkpi/common/include/linux/sizes.h (from 
r363837, head/sys/compat/linuxkpi/common/include/linux/sizes.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/sizes.h  Mon Aug 24 
13:19:16 2020(r364674, copy of r363837, 
head/sys/compat/linuxkpi/common/include/linux/sizes.h)
@@ -0,0 +1,51 @@
+/*-
+ * Copyright (c) 2020 The FreeBSD Foundation
+ *
+ * This software was developed by Emmanuel Vadot unde

  1   2   3   4   5   6   7   8   9   10   >