sync with OpenBSD -current
This commit is contained in:
parent
991d31b9d0
commit
99745de747
62 changed files with 774 additions and 285 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ahci_pci.c,v 1.17 2024/05/24 06:02:53 jsg Exp $ */
|
||||
/* $OpenBSD: ahci_pci.c,v 1.18 2024/06/16 18:00:08 kn Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -71,6 +71,8 @@ int ahci_intel_attach(struct ahci_softc *,
|
|||
struct pci_attach_args *);
|
||||
int ahci_samsung_attach(struct ahci_softc *,
|
||||
struct pci_attach_args *);
|
||||
int ahci_storx_attach(struct ahci_softc *,
|
||||
struct pci_attach_args *);
|
||||
|
||||
static const struct ahci_device ahci_devices[] = {
|
||||
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_HUDSON2_SATA_1,
|
||||
|
@ -148,7 +150,10 @@ static const struct ahci_device ahci_devices[] = {
|
|||
NULL, ahci_samsung_attach },
|
||||
|
||||
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8251_SATA,
|
||||
ahci_no_match, ahci_vt8251_attach }
|
||||
ahci_no_match, ahci_vt8251_attach },
|
||||
|
||||
{ PCI_VENDOR_ZHAOXIN, PCI_PRODUCT_ZHAOXIN_STORX_AHCI,
|
||||
NULL, ahci_storx_attach },
|
||||
};
|
||||
|
||||
int ahci_pci_match(struct device *, void *, void *);
|
||||
|
@ -285,6 +290,19 @@ ahci_samsung_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
|
|||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ahci_storx_attach(struct ahci_softc *sc, struct pci_attach_args *pa)
|
||||
{
|
||||
/*
|
||||
* Disable MSI with the ZX-100/ZX-200/ZX-E StorX AHCI Controller
|
||||
* in the Unchartevice 6640MA notebook, otherwise ahci(4) hangs
|
||||
* with SATA speed set to "Gen3" in BIOS.
|
||||
*/
|
||||
sc->sc_flags |= AHCI_F_NO_MSI;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ahci_pci_match(struct device *parent, void *match, void *aux)
|
||||
{
|
||||
|
|
|
@ -1135,7 +1135,8 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
|
|||
int ret;
|
||||
|
||||
ctx->sync = &mem->sync;
|
||||
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT);
|
||||
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT |
|
||||
DRM_EXEC_IGNORE_DUPLICATES);
|
||||
drm_exec_until_all_locked(&ctx->exec) {
|
||||
ctx->n_vms = 0;
|
||||
list_for_each_entry(entry, &mem->attachments, list) {
|
||||
|
|
|
@ -211,6 +211,7 @@ union igp_info {
|
|||
struct atom_integrated_system_info_v1_11 v11;
|
||||
struct atom_integrated_system_info_v1_12 v12;
|
||||
struct atom_integrated_system_info_v2_1 v21;
|
||||
struct atom_integrated_system_info_v2_3 v23;
|
||||
};
|
||||
|
||||
union umc_info {
|
||||
|
@ -359,6 +360,20 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
|
|||
if (vram_type)
|
||||
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
|
||||
break;
|
||||
case 3:
|
||||
mem_channel_number = igp_info->v23.umachannelnumber;
|
||||
if (!mem_channel_number)
|
||||
mem_channel_number = 1;
|
||||
mem_type = igp_info->v23.memorytype;
|
||||
if (mem_type == LpDdr5MemType)
|
||||
mem_channel_width = 32;
|
||||
else
|
||||
mem_channel_width = 64;
|
||||
if (vram_width)
|
||||
*vram_width = mem_channel_number * mem_channel_width;
|
||||
if (vram_type)
|
||||
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
@ -2031,6 +2031,9 @@ static int sdma_v4_0_process_trap_irq(struct amdgpu_device *adev,
|
|||
|
||||
DRM_DEBUG("IH: SDMA trap\n");
|
||||
instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
|
||||
if (instance < 0)
|
||||
return instance;
|
||||
|
||||
switch (entry->ring_id) {
|
||||
case 0:
|
||||
amdgpu_fence_process(&adev->sdma.instance[instance].ring);
|
||||
|
|
|
@ -402,15 +402,8 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
|
|||
f2g = &gfx_v11_kfd2kgd;
|
||||
break;
|
||||
case IP_VERSION(11, 0, 3):
|
||||
if ((adev->pdev->device == 0x7460 &&
|
||||
adev->pdev->revision == 0x00) ||
|
||||
(adev->pdev->device == 0x7461 &&
|
||||
adev->pdev->revision == 0x00))
|
||||
/* Note: Compiler version is 11.0.5 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110005;
|
||||
else
|
||||
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110001;
|
||||
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
|
||||
gfx_target_version = 110001;
|
||||
f2g = &gfx_v11_kfd2kgd;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -1625,6 +1625,49 @@ struct atom_integrated_system_info_v2_2
|
|||
uint32_t reserved4[189];
|
||||
};
|
||||
|
||||
struct uma_carveout_option {
|
||||
char optionName[29]; //max length of string is 28chars + '\0'. Current design is for "minimum", "Medium", "High". This makes entire struct size 64bits
|
||||
uint8_t memoryCarvedGb; //memory carved out with setting
|
||||
uint8_t memoryRemainingGb; //memory remaining on system
|
||||
union {
|
||||
struct _flags {
|
||||
uint8_t Auto : 1;
|
||||
uint8_t Custom : 1;
|
||||
uint8_t Reserved : 6;
|
||||
} flags;
|
||||
uint8_t all8;
|
||||
} uma_carveout_option_flags;
|
||||
};
|
||||
|
||||
struct atom_integrated_system_info_v2_3 {
|
||||
struct atom_common_table_header table_header;
|
||||
uint32_t vbios_misc; // enum of atom_system_vbiosmisc_def
|
||||
uint32_t gpucapinfo; // enum of atom_system_gpucapinf_def
|
||||
uint32_t system_config;
|
||||
uint32_t cpucapinfo;
|
||||
uint16_t gpuclk_ss_percentage; // unit of 0.001%, 1000 mean 1%
|
||||
uint16_t gpuclk_ss_type;
|
||||
uint16_t dpphy_override; // bit vector, enum of atom_sysinfo_dpphy_override_def
|
||||
uint8_t memorytype; // enum of atom_dmi_t17_mem_type_def, APU memory type indication.
|
||||
uint8_t umachannelnumber; // number of memory channels
|
||||
uint8_t htc_hyst_limit;
|
||||
uint8_t htc_tmp_limit;
|
||||
uint8_t reserved1; // dp_ss_control
|
||||
uint8_t gpu_package_id;
|
||||
struct edp_info_table edp1_info;
|
||||
struct edp_info_table edp2_info;
|
||||
uint32_t reserved2[8];
|
||||
struct atom_external_display_connection_info extdispconninfo;
|
||||
uint8_t UMACarveoutVersion;
|
||||
uint8_t UMACarveoutIndexMax;
|
||||
uint8_t UMACarveoutTypeDefault;
|
||||
uint8_t UMACarveoutIndexDefault;
|
||||
uint8_t UMACarveoutType; //Auto or Custom
|
||||
uint8_t UMACarveoutIndex;
|
||||
struct uma_carveout_option UMASizeControlOption[20];
|
||||
uint8_t reserved3[110];
|
||||
};
|
||||
|
||||
// system_config
|
||||
enum atom_system_vbiosmisc_def{
|
||||
INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT = 0x01,
|
||||
|
|
|
@ -226,15 +226,17 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en)
|
|||
struct amdgpu_device *adev = smu->adev;
|
||||
int ret = 0;
|
||||
|
||||
if (!en && adev->in_s4) {
|
||||
/* Adds a GFX reset as workaround just before sending the
|
||||
* MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
|
||||
* an invalid state.
|
||||
*/
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
|
||||
SMU_RESET_MODE_2, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!en && !adev->in_s0ix) {
|
||||
if (adev->in_s4) {
|
||||
/* Adds a GFX reset as workaround just before sending the
|
||||
* MP1_UNLOAD message to prevent GC/RLC/PMFW from entering
|
||||
* an invalid state.
|
||||
*/
|
||||
ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_GfxDeviceDriverReset,
|
||||
SMU_RESET_MODE_2, NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = smu_cmn_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@ static int drm_fbdev_generic_helper_fb_probe(struct drm_fb_helper *fb_helper,
|
|||
/* screen */
|
||||
info->flags |= FBINFO_VIRTFB | FBINFO_READS_FAST;
|
||||
info->screen_buffer = screen_buffer;
|
||||
info->fix.smem_start = page_to_phys(vmalloc_to_page(info->screen_buffer));
|
||||
info->fix.smem_len = screen_size;
|
||||
|
||||
#ifdef notyet
|
||||
|
|
|
@ -793,7 +793,7 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
if (!IS_DGFX(i915))
|
||||
return;
|
||||
|
||||
hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL);
|
||||
hwmon = kzalloc(sizeof(*hwmon), GFP_KERNEL);
|
||||
if (!hwmon)
|
||||
return;
|
||||
|
||||
|
@ -819,14 +819,12 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
hwm_get_preregistration_info(i915);
|
||||
|
||||
/* hwmon_dev points to device hwmon<i> */
|
||||
hwmon_dev = devm_hwmon_device_register_with_info(dev, ddat->name,
|
||||
ddat,
|
||||
&hwm_chip_info,
|
||||
hwm_groups);
|
||||
if (IS_ERR(hwmon_dev)) {
|
||||
i915->hwmon = NULL;
|
||||
return;
|
||||
}
|
||||
hwmon_dev = hwmon_device_register_with_info(dev, ddat->name,
|
||||
ddat,
|
||||
&hwm_chip_info,
|
||||
hwm_groups);
|
||||
if (IS_ERR(hwmon_dev))
|
||||
goto err;
|
||||
|
||||
ddat->hwmon_dev = hwmon_dev;
|
||||
|
||||
|
@ -839,16 +837,36 @@ void i915_hwmon_register(struct drm_i915_private *i915)
|
|||
if (!hwm_gt_is_visible(ddat_gt, hwmon_energy, hwmon_energy_input, 0))
|
||||
continue;
|
||||
|
||||
hwmon_dev = devm_hwmon_device_register_with_info(dev, ddat_gt->name,
|
||||
ddat_gt,
|
||||
&hwm_gt_chip_info,
|
||||
NULL);
|
||||
hwmon_dev = hwmon_device_register_with_info(dev, ddat_gt->name,
|
||||
ddat_gt,
|
||||
&hwm_gt_chip_info,
|
||||
NULL);
|
||||
if (!IS_ERR(hwmon_dev))
|
||||
ddat_gt->hwmon_dev = hwmon_dev;
|
||||
}
|
||||
return;
|
||||
err:
|
||||
i915_hwmon_unregister(i915);
|
||||
}
|
||||
|
||||
void i915_hwmon_unregister(struct drm_i915_private *i915)
|
||||
{
|
||||
fetch_and_zero(&i915->hwmon);
|
||||
struct i915_hwmon *hwmon = i915->hwmon;
|
||||
struct intel_gt *gt;
|
||||
int i;
|
||||
|
||||
if (!hwmon)
|
||||
return;
|
||||
|
||||
for_each_gt(gt, i915, i)
|
||||
if (hwmon->ddat_gt[i].hwmon_dev)
|
||||
hwmon_device_unregister(hwmon->ddat_gt[i].hwmon_dev);
|
||||
|
||||
if (hwmon->ddat.hwmon_dev)
|
||||
hwmon_device_unregister(hwmon->ddat.hwmon_dev);
|
||||
|
||||
mutex_destroy(&hwmon->hwmon_lock);
|
||||
|
||||
kfree(i915->hwmon);
|
||||
i915->hwmon = NULL;
|
||||
}
|
||||
|
|
|
@ -93,5 +93,5 @@
|
|||
#endif
|
||||
|
||||
#if defined(SUSPEND) || defined(HIBERNATE)
|
||||
#define CONFIG_PM_SLEEP
|
||||
#define CONFIG_PM_SLEEP 1
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_vmx.c,v 1.87 2024/06/07 08:44:25 jan Exp $ */
|
||||
/* $OpenBSD: if_vmx.c,v 1.88 2024/06/17 11:13:43 bluhm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2013 Tsubai Masanari
|
||||
|
@ -1619,6 +1619,8 @@ vmxnet3_start(struct ifqueue *ifq)
|
|||
rgen = ring->gen;
|
||||
|
||||
for (;;) {
|
||||
int hdrlen;
|
||||
|
||||
if (free <= NTXSEGS) {
|
||||
ifq_set_oactive(ifq);
|
||||
break;
|
||||
|
@ -1628,6 +1630,30 @@ vmxnet3_start(struct ifqueue *ifq)
|
|||
if (m == NULL)
|
||||
break;
|
||||
|
||||
/*
|
||||
* Headers for Ether, IP, TCP including options must lay in
|
||||
* first mbuf to support TSO. Usually our stack gets that
|
||||
* right. To avoid packet parsing here, make a rough estimate
|
||||
* for simple IPv4. Cases seen in the wild contain only ether
|
||||
* header in separate mbuf. To support IPv6 with TCP options,
|
||||
* move as much as possible into first mbuf. Realloc mbuf
|
||||
* before bus dma load.
|
||||
*/
|
||||
hdrlen = sizeof(struct ether_header) + sizeof(struct ip) +
|
||||
sizeof(struct tcphdr);
|
||||
if (ISSET(m->m_pkthdr.csum_flags, M_TCP_TSO) &&
|
||||
m->m_len < hdrlen && hdrlen <= m->m_pkthdr.len) {
|
||||
hdrlen = MHLEN;
|
||||
/* m_pullup preserves alignment, reserve space */
|
||||
hdrlen -= mtod(m, unsigned long) & (sizeof(long) - 1);
|
||||
if (hdrlen > m->m_pkthdr.len)
|
||||
hdrlen = m->m_pkthdr.len;
|
||||
if ((m = m_pullup(m, hdrlen)) == NULL) {
|
||||
ifq->ifq_errors++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
map = ring->dmap[prod];
|
||||
|
||||
if (vmx_load_mbuf(sc->sc_dmat, map, m) != 0) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$OpenBSD: pcidevs,v 1.2076 2024/05/22 16:24:59 martijn Exp $
|
||||
$OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp $
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -346,6 +346,7 @@ vendor SYMPHONY2 0x1c1c Symphony Labs
|
|||
vendor SKHYNIX 0x1c5c SK hynix
|
||||
vendor ADATA 0x1cc1 ADATA Technology
|
||||
vendor UMIS 0x1cc4 Union Memory
|
||||
vendor ZHAOXIN 0x1d17 Zhaoxin
|
||||
vendor BAIKAL 0x1d39 Baikal Electronics
|
||||
vendor AQUANTIA 0x1d6a Aquantia
|
||||
vendor ROCKCHIP 0x1d87 Rockchip
|
||||
|
@ -10039,6 +10040,9 @@ product YMTC PC005 0x1001 PC005
|
|||
/* Zeinet products */
|
||||
product ZEINET 1221 0x0001 1221
|
||||
|
||||
/* Zhaoxin products */
|
||||
product ZHAOXIN STORX_AHCI 0x9083 StorX AHCI
|
||||
|
||||
/* Ziatech products */
|
||||
product ZIATECH ZT8905 0x8905 PCI-ST32
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2075 2024/05/21 07:03:55 jsg Exp
|
||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
||||
*/
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
||||
|
@ -351,6 +351,7 @@
|
|||
#define PCI_VENDOR_SKHYNIX 0x1c5c /* SK hynix */
|
||||
#define PCI_VENDOR_ADATA 0x1cc1 /* ADATA Technology */
|
||||
#define PCI_VENDOR_UMIS 0x1cc4 /* Union Memory */
|
||||
#define PCI_VENDOR_ZHAOXIN 0x1d17 /* Zhaoxin */
|
||||
#define PCI_VENDOR_BAIKAL 0x1d39 /* Baikal Electronics */
|
||||
#define PCI_VENDOR_AQUANTIA 0x1d6a /* Aquantia */
|
||||
#define PCI_VENDOR_ROCKCHIP 0x1d87 /* Rockchip */
|
||||
|
@ -10044,6 +10045,9 @@
|
|||
/* Zeinet products */
|
||||
#define PCI_PRODUCT_ZEINET_1221 0x0001 /* 1221 */
|
||||
|
||||
/* Zhaoxin products */
|
||||
#define PCI_PRODUCT_ZHAOXIN_STORX_AHCI 0x9083 /* StorX AHCI */
|
||||
|
||||
/* Ziatech products */
|
||||
#define PCI_PRODUCT_ZIATECH_ZT8905 0x8905 /* PCI-ST32 */
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
*
|
||||
* generated from:
|
||||
* OpenBSD: pcidevs,v 1.2075 2024/05/21 07:03:55 jsg Exp
|
||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
||||
*/
|
||||
|
||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||
|
@ -36047,6 +36047,10 @@ static const struct pci_known_product pci_known_products[] = {
|
|||
PCI_VENDOR_ZEINET, PCI_PRODUCT_ZEINET_1221,
|
||||
"1221",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZHAOXIN, PCI_PRODUCT_ZHAOXIN_STORX_AHCI,
|
||||
"StorX AHCI",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZIATECH, PCI_PRODUCT_ZIATECH_ZT8905,
|
||||
"PCI-ST32",
|
||||
|
@ -37279,6 +37283,10 @@ static const struct pci_known_vendor pci_known_vendors[] = {
|
|||
PCI_VENDOR_UMIS,
|
||||
"Union Memory",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_ZHAOXIN,
|
||||
"Zhaoxin",
|
||||
},
|
||||
{
|
||||
PCI_VENDOR_BAIKAL,
|
||||
"Baikal Electronics",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue