sync with OpenBSD -current
This commit is contained in:
parent
25f7188861
commit
8ff00f10fc
2137 changed files with 177389 additions and 104447 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ehci_fdt.c,v 1.10 2023/04/03 01:57:41 dlg Exp $ */
|
||||
/* $OpenBSD: ehci_fdt.c,v 1.11 2024/01/26 17:11:50 kettenis Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
|
||||
|
@ -205,6 +205,7 @@ struct ehci_phy ehci_phys[] = {
|
|||
{ "allwinner,sun8i-h3-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun8i-r40-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun8i-v3s-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun20i-d1-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun50i-h6-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun50i-a64-usb-phy", sun4i_phy_init },
|
||||
{ "allwinner,sun9i-a80-usb-phy", sun9i_phy_init },
|
||||
|
@ -305,7 +306,7 @@ sun4i_phy_init(struct ehci_fdt_softc *sc, uint32_t *cells)
|
|||
|
||||
/*
|
||||
* We need to poke an undocumented register to make the PHY
|
||||
* work on Allwinner A64/H3/H5/R40.
|
||||
* work on Allwinner A64/D1/H3/H5/R40.
|
||||
*/
|
||||
if (OF_is_compatible(node, "allwinner,sun8i-h3-usb-phy") ||
|
||||
OF_is_compatible(node, "allwinner,sun8i-r40-usb-phy") ||
|
||||
|
@ -314,6 +315,10 @@ sun4i_phy_init(struct ehci_fdt_softc *sc, uint32_t *cells)
|
|||
val = bus_space_read_4(sc->sc.iot, sc->sc.ioh, 0x810);
|
||||
val &= ~(1 << 1);
|
||||
bus_space_write_4(sc->sc.iot, sc->sc.ioh, 0x810, val);
|
||||
} else if (OF_is_compatible(node, "allwinner,sun20i-d1-usb-phy")) {
|
||||
val = bus_space_read_4(sc->sc.iot, sc->sc.ioh, 0x810);
|
||||
val &= ~(1 << 3);
|
||||
bus_space_write_4(sc->sc.iot, sc->sc.ioh, 0x810, val);
|
||||
}
|
||||
|
||||
pinctrl_byname(node, "default");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: sxiccmu.c,v 1.32 2023/08/15 08:27:30 miod Exp $ */
|
||||
/* $OpenBSD: sxiccmu.c,v 1.33 2024/01/26 17:50:00 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
|
||||
* Copyright (c) 2013 Artturi Alm
|
||||
|
@ -98,6 +98,8 @@ uint32_t sxiccmu_a64_get_frequency(struct sxiccmu_softc *, uint32_t);
|
|||
int sxiccmu_a64_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
|
||||
uint32_t sxiccmu_a80_get_frequency(struct sxiccmu_softc *, uint32_t);
|
||||
int sxiccmu_a80_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
|
||||
uint32_t sxiccmu_d1_get_frequency(struct sxiccmu_softc *, uint32_t);
|
||||
int sxiccmu_d1_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
|
||||
uint32_t sxiccmu_h3_get_frequency(struct sxiccmu_softc *, uint32_t);
|
||||
int sxiccmu_h3_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
|
||||
uint32_t sxiccmu_h3_r_get_frequency(struct sxiccmu_softc *, uint32_t);
|
||||
|
@ -145,6 +147,7 @@ sxiccmu_match(struct device *parent, void *match, void *aux)
|
|||
OF_is_compatible(node, "allwinner,sun9i-a80-ccu") ||
|
||||
OF_is_compatible(node, "allwinner,sun9i-a80-usb-clks") ||
|
||||
OF_is_compatible(node, "allwinner,sun9i-a80-mmc-config-clk") ||
|
||||
OF_is_compatible(node, "allwinner,sun20i-d1-ccu") ||
|
||||
OF_is_compatible(node, "allwinner,sun50i-a64-ccu") ||
|
||||
OF_is_compatible(node, "allwinner,sun50i-a64-r-ccu") ||
|
||||
OF_is_compatible(node, "allwinner,sun50i-h5-ccu") ||
|
||||
|
@ -252,6 +255,14 @@ sxiccmu_attach(struct device *parent, struct device *self, void *aux)
|
|||
sc->sc_nresets = nitems(sun9i_a80_mmc_resets);
|
||||
sc->sc_get_frequency = sxiccmu_nop_get_frequency;
|
||||
sc->sc_set_frequency = sxiccmu_nop_set_frequency;
|
||||
} else if (OF_is_compatible(node, "allwinner,sun20i-d1-ccu")) {
|
||||
KASSERT(faa->fa_nreg > 0);
|
||||
sc->sc_gates = sun20i_d1_gates;
|
||||
sc->sc_ngates = nitems(sun20i_d1_gates);
|
||||
sc->sc_resets = sun20i_d1_resets;
|
||||
sc->sc_nresets = nitems(sun20i_d1_resets);
|
||||
sc->sc_get_frequency = sxiccmu_d1_get_frequency;
|
||||
sc->sc_set_frequency = sxiccmu_d1_set_frequency;
|
||||
} else if (OF_is_compatible(node, "allwinner,sun50i-a64-ccu")) {
|
||||
KASSERT(faa->fa_nreg > 0);
|
||||
sc->sc_gates = sun50i_a64_gates;
|
||||
|
@ -1156,6 +1167,21 @@ sxiccmu_a80_get_frequency(struct sxiccmu_softc *sc, uint32_t idx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Allwinner D1 */
|
||||
|
||||
uint32_t
|
||||
sxiccmu_d1_get_frequency(struct sxiccmu_softc *sc, uint32_t idx)
|
||||
{
|
||||
switch (idx) {
|
||||
case D1_CLK_APB1:
|
||||
/* XXX Controlled by a MUX. */
|
||||
return 24000000;
|
||||
}
|
||||
|
||||
printf("%s: 0x%08x\n", __func__, idx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allwinner H3/H5 */
|
||||
#define H3_PLL_CPUX_CTRL_REG 0x0000
|
||||
#define H3_PLL_CPUX_ENABLE (1U << 31)
|
||||
|
@ -1645,6 +1671,13 @@ sxiccmu_a80_set_frequency(struct sxiccmu_softc *sc, uint32_t idx, uint32_t freq)
|
|||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
sxiccmu_d1_set_frequency(struct sxiccmu_softc *sc, uint32_t idx, uint32_t freq)
|
||||
{
|
||||
printf("%s: 0x%08x\n", __func__, idx);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
sxiccmu_h3_set_frequency(struct sxiccmu_softc *sc, uint32_t idx, uint32_t freq)
|
||||
{
|
||||
|
|
|
@ -302,6 +302,37 @@ const struct sxiccmu_ccu_bit sun9i_a80_mmc_gates[] = {
|
|||
{ 0x000c, 16 },
|
||||
};
|
||||
|
||||
/* D1 */
|
||||
|
||||
#define D1_CLK_APB1 25
|
||||
#define D1_CLK_BUS_UART0 62
|
||||
#define D1_CLK_BUS_UART1 63
|
||||
#define D1_CLK_BUS_UART2 64
|
||||
#define D1_CLK_BUS_UART3 65
|
||||
#define D1_CLK_BUS_UART4 66
|
||||
#define D1_CLK_BUS_UART5 67
|
||||
#define D1_CLK_USB_OHCI0 97
|
||||
#define D1_CLK_USB_OHCI1 98
|
||||
#define D1_CLK_BUS_OHCI0 99
|
||||
#define D1_CLK_BUS_OHCI1 100
|
||||
#define D1_CLK_BUS_EHCI0 101
|
||||
#define D1_CLK_BUS_EHCI1 102
|
||||
|
||||
const struct sxiccmu_ccu_bit sun20i_d1_gates[] = {
|
||||
[D1_CLK_BUS_UART0] = { 0x090c, 0, D1_CLK_APB1 },
|
||||
[D1_CLK_BUS_UART1] = { 0x090c, 1, D1_CLK_APB1 },
|
||||
[D1_CLK_BUS_UART2] = { 0x090c, 2, D1_CLK_APB1 },
|
||||
[D1_CLK_BUS_UART3] = { 0x090c, 3, D1_CLK_APB1 },
|
||||
[D1_CLK_BUS_UART4] = { 0x090c, 4, D1_CLK_APB1 },
|
||||
[D1_CLK_BUS_UART5] = { 0x090c, 5, D1_CLK_APB1 },
|
||||
[D1_CLK_USB_OHCI0] = { 0x0a70, 31 },
|
||||
[D1_CLK_USB_OHCI1] = { 0x0a74, 31 },
|
||||
[D1_CLK_BUS_OHCI0] = { 0x0a8c, 0 },
|
||||
[D1_CLK_BUS_OHCI1] = { 0x0a8c, 1 },
|
||||
[D1_CLK_BUS_EHCI0] = { 0x0a8c, 4 },
|
||||
[D1_CLK_BUS_EHCI1] = { 0x0a8c, 5 },
|
||||
};
|
||||
|
||||
/* H3/H5 */
|
||||
|
||||
#define H3_CLK_PLL_CPUX 0
|
||||
|
@ -768,6 +799,36 @@ const struct sxiccmu_ccu_bit sun9i_a80_mmc_resets[] = {
|
|||
{ 0x000c, 18 },
|
||||
};
|
||||
|
||||
/* D1 */
|
||||
|
||||
#define D1_RST_BUS_UART0 18
|
||||
#define D1_RST_BUS_UART1 19
|
||||
#define D1_RST_BUS_UART2 20
|
||||
#define D1_RST_BUS_UART3 21
|
||||
#define D1_RST_BUS_UART4 22
|
||||
#define D1_RST_BUS_UART5 23
|
||||
#define D1_RST_USB_PHY0 40
|
||||
#define D1_RST_USB_PHY1 41
|
||||
#define D1_RST_BUS_OHCI0 42
|
||||
#define D1_RST_BUS_OHCI1 43
|
||||
#define D1_RST_BUS_EHCI0 44
|
||||
#define D1_RST_BUS_EHCI1 45
|
||||
|
||||
const struct sxiccmu_ccu_bit sun20i_d1_resets[] = {
|
||||
[D1_RST_BUS_UART0] = { 0x090c, 16 },
|
||||
[D1_RST_BUS_UART1] = { 0x090c, 17 },
|
||||
[D1_RST_BUS_UART2] = { 0x090c, 18 },
|
||||
[D1_RST_BUS_UART3] = { 0x090c, 19 },
|
||||
[D1_RST_BUS_UART4] = { 0x090c, 20 },
|
||||
[D1_RST_BUS_UART5] = { 0x090c, 21 },
|
||||
[D1_RST_USB_PHY0] = { 0x0a70, 30 },
|
||||
[D1_RST_USB_PHY1] = { 0x0a74, 30 },
|
||||
[D1_RST_BUS_OHCI0] = { 0x0a8c, 16 },
|
||||
[D1_RST_BUS_OHCI1] = { 0x0a8c, 17 },
|
||||
[D1_RST_BUS_EHCI0] = { 0x0a8c, 20 },
|
||||
[D1_RST_BUS_EHCI1] = { 0x0a8c, 21 },
|
||||
};
|
||||
|
||||
/* H3/H5 */
|
||||
|
||||
#define H3_RST_USB_PHY0 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: sxidog.c,v 1.3 2021/10/24 17:52:27 mpi Exp $ */
|
||||
/* $OpenBSD: sxidog.c,v 1.4 2024/01/26 17:03:45 kettenis Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
|
||||
*
|
||||
|
@ -55,6 +55,7 @@ struct sxidog_softc {
|
|||
int sc_type;
|
||||
#define SXIDOG_A10 0
|
||||
#define SXIDOG_A31 1
|
||||
uint32_t sc_key;
|
||||
};
|
||||
|
||||
struct sxidog_softc *sxidog_sc = NULL; /* for sxidog_reset() */
|
||||
|
@ -80,7 +81,8 @@ sxidog_match(struct device *parent, void *match, void *aux)
|
|||
struct fdt_attach_args *faa = aux;
|
||||
|
||||
return (OF_is_compatible(faa->fa_node, "allwinner,sun4i-a10-wdt") ||
|
||||
OF_is_compatible(faa->fa_node, "allwinner,sun6i-a31-wdt"));
|
||||
OF_is_compatible(faa->fa_node, "allwinner,sun6i-a31-wdt") ||
|
||||
OF_is_compatible(faa->fa_node, "allwinner,sun20i-d1-wdt"));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -97,11 +99,18 @@ sxidog_attach(struct device *parent, struct device *self, void *aux)
|
|||
faa->fa_reg[0].size, 0, &sc->sc_ioh))
|
||||
panic("sxidog_attach: bus_space_map failed!");
|
||||
|
||||
if (OF_is_compatible(faa->fa_node, "allwinner,sun6i-a31-wdt")) {
|
||||
SXIWRITE4(sc, WDOG0_CFG_REG, WDOG0_RST_EN);
|
||||
if (OF_is_compatible(faa->fa_node, "allwinner,sun20i-d1-wdt"))
|
||||
sc->sc_key = 0x16aa0000;
|
||||
|
||||
if (OF_is_compatible(faa->fa_node, "allwinner,sun6i-a31-wdt") ||
|
||||
OF_is_compatible(faa->fa_node, "allwinner,sun20i-d1-wdt")) {
|
||||
SXIWRITE4(sc, WDOG0_MODE_REG, sc->sc_key);
|
||||
SXIWRITE4(sc, WDOG0_CFG_REG, WDOG0_RST_EN | sc->sc_key);
|
||||
sc->sc_type = SXIDOG_A31;
|
||||
} else
|
||||
} else {
|
||||
SXIWRITE4(sc, WDOG_MODE_REG, 0);
|
||||
sc->sc_type = SXIDOG_A10;
|
||||
}
|
||||
|
||||
sxidog_sc = sc;
|
||||
cpuresetfn = sxidog_reset;
|
||||
|
@ -152,7 +161,7 @@ sxidog_callback(void *arg, int period)
|
|||
case SXIDOG_A31:
|
||||
enable = (period > 0) ? WDOG0_EN : 0;
|
||||
SXIWRITE4(sc, WDOG0_MODE_REG,
|
||||
enable | WDOG0_INTV_VALUE(period));
|
||||
enable | WDOG0_INTV_VALUE(period) | sc->sc_key);
|
||||
SXIWRITE4(sc, WDOG0_CTRL_REG, WDOG0_KEY | WDOG0_RSTART);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1085,9 +1085,6 @@ out:
|
|||
|
||||
static int amdgpu_acpi_enumerate_xcc(void)
|
||||
{
|
||||
STUB();
|
||||
return -ENOSYS;
|
||||
#ifdef notyet
|
||||
struct amdgpu_acpi_dev_info *dev_info = NULL;
|
||||
struct amdgpu_acpi_xcc_info *xcc_info;
|
||||
struct acpi_device *acpi_dev;
|
||||
|
@ -1098,6 +1095,7 @@ static int amdgpu_acpi_enumerate_xcc(void)
|
|||
INIT_LIST_HEAD(&amdgpu_acpi_dev_list);
|
||||
xa_init(&numa_info_xa);
|
||||
|
||||
#ifdef notyet
|
||||
for (id = 0; id < AMD_XCC_MAX_HID; id++) {
|
||||
snprintf(hid, sizeof(hid), "%s%d", "AMD", AMD_XCC_HID_START + id);
|
||||
acpi_dev = acpi_dev_get_first_match_dev(hid, NULL, -1);
|
||||
|
@ -1142,9 +1140,9 @@ static int amdgpu_acpi_enumerate_xcc(void)
|
|||
|
||||
list_add_tail(&xcc_info->list, &dev_info->xcc_list);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int amdgpu_acpi_get_tmr_info(struct amdgpu_device *adev, u64 *tmr_offset,
|
||||
|
|
|
@ -51,4 +51,6 @@ struct pci_device_id {
|
|||
unsigned long driver_data;
|
||||
};
|
||||
|
||||
#define ACPI_ID_LEN 16
|
||||
|
||||
#endif
|
||||
|
|
|
@ -176,4 +176,10 @@ xa_empty(const struct xarray *xa)
|
|||
return SPLAY_EMPTY(&xa->xa_tree);
|
||||
}
|
||||
|
||||
static inline void
|
||||
xa_init(struct xarray *xa)
|
||||
{
|
||||
xa_init_flags(xa, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue