summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-20 11:12:40 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-20 13:36:34 +0100
commit2b2563da953978f63e3e707f758fd600dcd19a32 (patch)
treea207b096c10788192b56025e8187f14d1b5a978d /freebsd/sys/dev
parentfreebsd/if_cpsw: Port. (diff)
downloadrtems-libbsd-2b2563da953978f63e3e707f758fd600dcd19a32.tar.bz2
Update to FreeBSD head 2018-12-20
Git mirror commit 19a6ceb89dbacf74697d493e48c388767126d418. It includes an update of wpa_supplicant to version 2.7. It includes an update of the OpenSSL baseline to version 1.1.1a. Update #3472.
Diffstat (limited to 'freebsd/sys/dev')
-rw-r--r--freebsd/sys/dev/evdev/evdev_utils.c7
-rw-r--r--freebsd/sys/dev/fdt/simplebus.c9
-rw-r--r--freebsd/sys/dev/fdt/simplebus.h2
-rw-r--r--freebsd/sys/dev/fxp/if_fxp.c2
-rw-r--r--freebsd/sys/dev/fxp/if_fxpreg.h13
-rw-r--r--freebsd/sys/dev/mmc/mmc.c22
-rw-r--r--freebsd/sys/dev/nvme/nvme.h7
-rw-r--r--freebsd/sys/dev/pci/pci.c40
-rw-r--r--freebsd/sys/dev/pci/pci_pci.c3
-rw-r--r--freebsd/sys/dev/pci/pci_user.c6
-rw-r--r--freebsd/sys/dev/rtwn/usb/rtwn_usb_attach.h2
-rw-r--r--freebsd/sys/dev/sdhci/sdhci.c3
-rw-r--r--freebsd/sys/dev/sdhci/sdhci.h2
-rw-r--r--freebsd/sys/dev/usb/wlan/if_rsu.c1
14 files changed, 92 insertions, 27 deletions
diff --git a/freebsd/sys/dev/evdev/evdev_utils.c b/freebsd/sys/dev/evdev/evdev_utils.c
index 17a815fb..9bdc5a23 100644
--- a/freebsd/sys/dev/evdev/evdev_utils.c
+++ b/freebsd/sys/dev/evdev/evdev_utils.c
@@ -252,12 +252,15 @@ evdev_scancode2key(int *state, int scancode)
*/
*state = 0;
if ((scancode & 0x7f) == 0x1D)
- *state = 0x1D;
+ *state = scancode;
return (NONE);
/* NOT REACHED */
case 0x1D: /* pause / break */
+ case 0x9D:
+ if ((*state ^ scancode) & 0x80)
+ return (NONE);
*state = 0;
- if (scancode != 0x45)
+ if ((scancode & 0x7f) != 0x45)
return (NONE);
keycode = KEY_PAUSE;
break;
diff --git a/freebsd/sys/dev/fdt/simplebus.c b/freebsd/sys/dev/fdt/simplebus.c
index 54b17074..583590d4 100644
--- a/freebsd/sys/dev/fdt/simplebus.c
+++ b/freebsd/sys/dev/fdt/simplebus.c
@@ -64,13 +64,6 @@ static const struct ofw_bus_devinfo *simplebus_get_devinfo(device_t bus,
device_t child);
/*
- * local methods
- */
-
-static int simplebus_fill_ranges(phandle_t node,
- struct simplebus_softc *sc);
-
-/*
* Driver methods.
*/
static device_method_t simplebus_methods[] = {
@@ -186,7 +179,7 @@ simplebus_init(device_t dev, phandle_t node)
OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells));
}
-static int
+int
simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc)
{
int host_address_cells;
diff --git a/freebsd/sys/dev/fdt/simplebus.h b/freebsd/sys/dev/fdt/simplebus.h
index caccf162..bc695578 100644
--- a/freebsd/sys/dev/fdt/simplebus.h
+++ b/freebsd/sys/dev/fdt/simplebus.h
@@ -61,4 +61,6 @@ device_t simplebus_add_device(device_t dev, phandle_t node, u_int order,
const char *name, int unit, struct simplebus_devinfo *di);
struct simplebus_devinfo *simplebus_setup_dinfo(device_t dev, phandle_t node,
struct simplebus_devinfo *di);
+int simplebus_fill_ranges(phandle_t node,
+ struct simplebus_softc *sc);
#endif /* _FDT_SIMPLEBUS_H */
diff --git a/freebsd/sys/dev/fxp/if_fxp.c b/freebsd/sys/dev/fxp/if_fxp.c
index e9c8721e..b781905b 100644
--- a/freebsd/sys/dev/fxp/if_fxp.c
+++ b/freebsd/sys/dev/fxp/if_fxp.c
@@ -1629,7 +1629,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head)
cbp->tbd_number = nseg;
/* Configure TSO. */
if (m->m_pkthdr.csum_flags & CSUM_TSO) {
- cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
+ cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16);
cbp->tbd[1].tb_size |= htole32(tcp_payload << 16);
cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE |
FXP_IPCB_IP_CHECKSUM_ENABLE |
diff --git a/freebsd/sys/dev/fxp/if_fxpreg.h b/freebsd/sys/dev/fxp/if_fxpreg.h
index d1e6a45a..6b5f3d8b 100644
--- a/freebsd/sys/dev/fxp/if_fxpreg.h
+++ b/freebsd/sys/dev/fxp/if_fxpreg.h
@@ -281,10 +281,15 @@ struct fxp_cb_tx {
uint16_t cb_status;
uint16_t cb_command;
uint32_t link_addr;
- uint32_t tbd_array_addr;
- uint16_t byte_count;
- uint8_t tx_threshold;
- uint8_t tbd_number;
+ union {
+ struct {
+ uint32_t tbd_array_addr;
+ uint16_t byte_count;
+ uint8_t tx_threshold;
+ uint8_t tbd_number;
+ };
+ struct fxp_tbd tbdtso;
+ };
/*
* The following structure isn't actually part of the TxCB,
diff --git a/freebsd/sys/dev/mmc/mmc.c b/freebsd/sys/dev/mmc/mmc.c
index cfbce2a5..4c8aefcf 100644
--- a/freebsd/sys/dev/mmc/mmc.c
+++ b/freebsd/sys/dev/mmc/mmc.c
@@ -844,9 +844,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar)
const uint8_t *ext_csd;
uint32_t clock;
uint8_t value;
+ enum mmc_bus_timing timing;
+ enum mmc_bus_width bus_width;
dev = sc->dev;
- if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4)
+ timing = mmcbr_get_timing(dev);
+ bus_width = ivar->bus_width;
+ if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 ||
+ timing == bus_timing_normal || bus_width == bus_width_1)
return (MMC_ERR_NONE);
value = 0;
@@ -857,8 +862,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar)
if (clock <= MMC_TYPE_HS_26_MAX)
value = ext_csd[EXT_CSD_PWR_CL_26_195];
else if (clock <= MMC_TYPE_HS_52_MAX) {
- if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 &&
- ivar->bus_width >= bus_width_4)
+ if (timing >= bus_timing_mmc_ddr52 &&
+ bus_width >= bus_width_4)
value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR];
else
value = ext_csd[EXT_CSD_PWR_CL_52_195];
@@ -877,13 +882,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar)
if (clock <= MMC_TYPE_HS_26_MAX)
value = ext_csd[EXT_CSD_PWR_CL_26_360];
else if (clock <= MMC_TYPE_HS_52_MAX) {
- if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 &&
- ivar->bus_width >= bus_width_4)
+ if (timing == bus_timing_mmc_ddr52 &&
+ bus_width >= bus_width_4)
value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR];
else
value = ext_csd[EXT_CSD_PWR_CL_52_360];
} else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) {
- if (ivar->bus_width == bus_width_8)
+ if (bus_width == bus_width_8)
value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR];
else
value = ext_csd[EXT_CSD_PWR_CL_200_360];
@@ -895,7 +900,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_ivars *ivar)
return (MMC_ERR_INVALID);
}
- if (ivar->bus_width == bus_width_8)
+ if (bus_width == bus_width_8)
value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >>
EXT_CSD_POWER_CLASS_8BIT_SHIFT;
else
@@ -2178,7 +2183,7 @@ mmc_calculate_clock(struct mmc_softc *sc)
for (i = 0; i < sc->child_count; i++) {
ivar = device_get_ivars(sc->child_list[i]);
if ((ivar->timings & ~(1 << bus_timing_normal)) == 0)
- continue;
+ goto clock;
rca = ivar->rca;
if (mmc_select_card(sc, rca) != MMC_ERR_NONE) {
@@ -2244,6 +2249,7 @@ mmc_calculate_clock(struct mmc_softc *sc)
}
}
+clock:
/* Set clock (must be done before initial tuning). */
mmcbr_set_clock(dev, max_dtr);
mmcbr_update_ios(dev);
diff --git a/freebsd/sys/dev/nvme/nvme.h b/freebsd/sys/dev/nvme/nvme.h
index 747767ce..845ba75b 100644
--- a/freebsd/sys/dev/nvme/nvme.h
+++ b/freebsd/sys/dev/nvme/nvme.h
@@ -1259,6 +1259,13 @@ void nvme_unregister_consumer(struct nvme_consumer *consumer);
device_t nvme_ctrlr_get_device(struct nvme_controller *ctrlr);
const struct nvme_controller_data *
nvme_ctrlr_get_data(struct nvme_controller *ctrlr);
+static inline bool
+nvme_ctrlr_has_dataset_mgmt(const struct nvme_controller_data *cd)
+{
+ /* Assumes cd was byte swapped by nvme_controller_data_swapbytes() */
+ return ((cd->oncs >> NVME_CTRLR_DATA_ONCS_DSM_SHIFT) &
+ NVME_CTRLR_DATA_ONCS_DSM_MASK);
+}
/* Namespace helper functions */
uint32_t nvme_ns_get_max_io_xfer_size(struct nvme_namespace *ns);
diff --git a/freebsd/sys/dev/pci/pci.c b/freebsd/sys/dev/pci/pci.c
index 512e8636..2c977b85 100644
--- a/freebsd/sys/dev/pci/pci.c
+++ b/freebsd/sys/dev/pci/pci.c
@@ -216,7 +216,8 @@ static device_method_t pci_methods[] = {
DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc));
static devclass_t pci_devclass;
-DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL);
+EARLY_DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL,
+ BUS_PASS_BUS);
MODULE_VERSION(pci, 1);
static char *pci_vendordata;
@@ -231,6 +232,7 @@ struct pci_quirk {
#define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
#define PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */
#define PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */
+#define PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */
int arg1;
int arg2;
};
@@ -312,6 +314,12 @@ static const struct pci_quirk pci_quirks[] = {
{ 0x167814e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715 */
{ 0x167914e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715S */
+ /*
+ * HPE Gen 10 VGA has a memory range that can't be allocated in the
+ * expected place.
+ */
+ { 0x98741002, PCI_QUIRK_REALLOC_BAR, 0, 0 },
+
{ 0 }
};
@@ -3286,7 +3294,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl,
*/
res = resource_list_reserve(rl, bus, dev, type, &reg, start, end, count,
flags);
- if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) {
+ if ((pci_do_realloc_bars
+ || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR))
+ && res == NULL && (start != 0 || end != ~0)) {
/*
* If the allocation fails, try to allocate a resource for
* this BAR using any available range. The firmware felt
@@ -4467,6 +4477,7 @@ int
pci_suspend_child(device_t dev, device_t child)
{
struct pci_devinfo *dinfo;
+ struct resource_list_entry *rle;
int error;
dinfo = device_get_ivars(child);
@@ -4483,8 +4494,20 @@ pci_suspend_child(device_t dev, device_t child)
if (error)
return (error);
- if (pci_do_power_suspend)
+ if (pci_do_power_suspend) {
+ /*
+ * Make sure this device's interrupt handler is not invoked
+ * in the case the device uses a shared interrupt that can
+ * be raised by some other device.
+ * This is applicable only to regular (legacy) PCI interrupts
+ * as MSI/MSI-X interrupts are never shared.
+ */
+ rle = resource_list_find(&dinfo->resources,
+ SYS_RES_IRQ, 0);
+ if (rle != NULL && rle->res != NULL)
+ (void)bus_suspend_intr(child, rle->res);
pci_set_power_child(dev, child, PCI_POWERSTATE_D3);
+ }
return (0);
}
@@ -4493,6 +4516,7 @@ int
pci_resume_child(device_t dev, device_t child)
{
struct pci_devinfo *dinfo;
+ struct resource_list_entry *rle;
if (pci_do_power_resume)
pci_set_power_child(dev, child, PCI_POWERSTATE_D0);
@@ -4504,6 +4528,16 @@ pci_resume_child(device_t dev, device_t child)
bus_generic_resume_child(dev, child);
+ /*
+ * Allow interrupts only after fully resuming the driver and hardware.
+ */
+ if (pci_do_power_suspend) {
+ /* See pci_suspend_child for details. */
+ rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, 0);
+ if (rle != NULL && rle->res != NULL)
+ (void)bus_resume_intr(child, rle->res);
+ }
+
return (0);
}
diff --git a/freebsd/sys/dev/pci/pci_pci.c b/freebsd/sys/dev/pci/pci_pci.c
index ec52e1fb..607a0614 100644
--- a/freebsd/sys/dev/pci/pci_pci.c
+++ b/freebsd/sys/dev/pci/pci_pci.c
@@ -133,7 +133,8 @@ static device_method_t pcib_methods[] = {
static devclass_t pcib_devclass;
DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
-DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL);
+EARLY_DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL,
+ BUS_PASS_BUS);
#if defined(NEW_PCIB) || defined(PCI_HP)
SYSCTL_DECL(_hw_pci);
diff --git a/freebsd/sys/dev/pci/pci_user.c b/freebsd/sys/dev/pci/pci_user.c
index 27fb3475..3e2c3c7e 100644
--- a/freebsd/sys/dev/pci/pci_user.c
+++ b/freebsd/sys/dev/pci/pci_user.c
@@ -951,6 +951,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
if (!(flag & FWRITE)) {
switch (cmd) {
case PCIOCGETCONF:
+#ifdef COMPAT_FREEBSD32
+ case PCIOCGETCONF32:
+#endif
#ifdef PRE7_COMPAT
case PCIOCGETCONF_OLD:
#ifdef COMPAT_FREEBSD32
@@ -968,6 +971,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
switch (cmd) {
case PCIOCGETCONF:
+#ifdef COMPAT_FREEBSD32
+ case PCIOCGETCONF32:
+#endif
#ifdef PRE7_COMPAT
case PCIOCGETCONF_OLD:
#ifdef COMPAT_FREEBSD32
diff --git a/freebsd/sys/dev/rtwn/usb/rtwn_usb_attach.h b/freebsd/sys/dev/rtwn/usb/rtwn_usb_attach.h
index e30ae6be..432d7e97 100644
--- a/freebsd/sys/dev/rtwn/usb/rtwn_usb_attach.h
+++ b/freebsd/sys/dev/rtwn/usb/rtwn_usb_attach.h
@@ -118,6 +118,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8188EU_DEV(DLINK, DWA123D1),
RTWN_RTL8188EU_DEV(DLINK, DWA125D1),
RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M),
+ RTWN_RTL8188EU_DEV(TPLINK, WN722NV2),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV),
RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU),
#undef RTWN_RTL8188EU_DEV
@@ -139,6 +140,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = {
RTWN_RTL8812AU_DEV(SITECOMEU, WLA7100),
RTWN_RTL8812AU_DEV(TPLINK, T4U),
RTWN_RTL8812AU_DEV(TPLINK, T4UV2),
+ RTWN_RTL8812AU_DEV(TPLINK, T4UHV1),
RTWN_RTL8812AU_DEV(TPLINK, T4UHV2),
RTWN_RTL8812AU_DEV(TRENDNET, TEW805UB),
RTWN_RTL8812AU_DEV(ZYXEL, NWD6605),
diff --git a/freebsd/sys/dev/sdhci/sdhci.c b/freebsd/sys/dev/sdhci/sdhci.c
index ccbf5d85..0bb9edc7 100644
--- a/freebsd/sys/dev/sdhci/sdhci.c
+++ b/freebsd/sys/dev/sdhci/sdhci.c
@@ -900,6 +900,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num)
if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 &&
caps2 & SDHCI_CAN_MMC_HS400)
host_caps |= MMC_CAP_MMC_HS400;
+ if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 &&
+ caps2 & SDHCI_CAN_SDR104)
+ host_caps |= MMC_CAP_MMC_HS400;
/*
* Disable UHS-I and eMMC modes if the set_uhs_timing method is the
diff --git a/freebsd/sys/dev/sdhci/sdhci.h b/freebsd/sys/dev/sdhci/sdhci.h
index f2a7a9b1..a22e0235 100644
--- a/freebsd/sys/dev/sdhci/sdhci.h
+++ b/freebsd/sys/dev/sdhci/sdhci.h
@@ -93,6 +93,8 @@
#define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27)
/* Controller does not support or the support for ACMD12 is broken. */
#define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28)
+/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */
+#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29)
/*
* Controller registers
diff --git a/freebsd/sys/dev/usb/wlan/if_rsu.c b/freebsd/sys/dev/usb/wlan/if_rsu.c
index 1cb504cc..b730ce59 100644
--- a/freebsd/sys/dev/usb/wlan/if_rsu.c
+++ b/freebsd/sys/dev/usb/wlan/if_rsu.c
@@ -119,6 +119,7 @@ static const STRUCT_USB_HOST_ID rsu_devs[] = {
RSU_HT_NOT_SUPPORTED) }
RSU_DEV(ASUS, RTL8192SU),
RSU_DEV(AZUREWAVE, RTL8192SU_4),
+ RSU_DEV(SITECOMEU, WLA1000),
RSU_DEV_HT(ACCTON, RTL8192SU),
RSU_DEV_HT(ASUS, USBN10),
RSU_DEV_HT(AZUREWAVE, RTL8192SU_1),