コード例 #1
0
ファイル: exynos5.c プロジェクト: CPFL/xen
static int exynos5_get_pmu_baseandsize(u64 *power_base_addr, u64 *size)
{
    struct dt_device_node *node;
    int rc;
    static const struct dt_device_match exynos_dt_pmu_matches[] =
    {
        DT_MATCH_COMPATIBLE("samsung,exynos5250-pmu"),
        DT_MATCH_COMPATIBLE("samsung,exynos5410-pmu"),
        DT_MATCH_COMPATIBLE("samsung,exynos5420-pmu"),
        { /*sentinel*/ },
    };

    node = dt_find_matching_node(NULL, exynos_dt_pmu_matches);
    if ( !node )
    {
        dprintk(XENLOG_ERR, "samsung,exynos5XXX-pmu missing in DT\n");
        return -ENXIO;
    }

    rc = dt_device_get_address(node, 0, power_base_addr, size);
    if ( rc )
    {
        dprintk(XENLOG_ERR, "Error in \"samsung,exynos5XXX-pmu\"\n");
        return -ENXIO;
    }

    dprintk(XENLOG_DEBUG, "power_base_addr: %016llx size: %016llx\n",
            *power_base_addr, *size);

    return 0;
}
コード例 #2
0
ファイル: xgene-storm.c プロジェクト: robhoes/xen
static void __init xgene_check_pirq_eoi(void)
{
    const struct dt_device_node *node;
    int res;
    paddr_t dbase;
    const struct dt_device_match xgene_dt_int_ctrl_match[] =
    {
        DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"),
        { /*sentinel*/ },
    };

    node = dt_find_interrupt_controller(xgene_dt_int_ctrl_match);
    if ( !node )
        panic("%s: Can not find interrupt controller node", __func__);

    res = dt_device_get_address(node, 0, &dbase, NULL);
    if ( !dbase )
        panic("%s: Cannot find a valid address for the distributor", __func__);

    /*
     * In old X-Gene Storm firmware and DT, secure mode addresses have
     * been mentioned in GICv2 node. We have to use maintenance interrupt
     * instead of EOI HW in this case. We check the GIC Distributor Base
     * Address to maintain compatibility with older firmware.
     */
    if ( dbase == XGENE_SEC_GICV2_DIST_ADDR )
    {
        xgene_quirks |= PLATFORM_QUIRK_GUEST_PIRQ_NEED_EOI;
        printk("Xen: WARNING: OLD X-Gene Firmware, disabling PIRQ EOI mode\n");
    }
}
コード例 #3
0
ファイル: xgene-storm.c プロジェクト: 0day-ci/xen
static void __init xgene_check_pirq_eoi(void)
{
    const struct dt_device_node *node;
    int res;
    paddr_t dbase;
    const struct dt_device_match xgene_dt_int_ctrl_match[] =
    {
        DT_MATCH_COMPATIBLE("arm,cortex-a15-gic"),
        { /*sentinel*/ },
    };

    node = dt_find_interrupt_controller(xgene_dt_int_ctrl_match);
    if ( !node )
        panic("%s: Can not find interrupt controller node", __func__);

    res = dt_device_get_address(node, 0, &dbase, NULL);
    if ( !dbase )
        panic("%s: Cannot find a valid address for the distributor", __func__);

    /*
     * In old X-Gene Storm firmware and DT, secure mode addresses have
     * been mentioned in GICv2 node. EOI HW won't work in this case.
     * We check the GIC Distributor Base Address to deny Xen booting
     * with older firmware.
     */
    if ( dbase == XGENE_SEC_GICV2_DIST_ADDR )
        panic("OLD X-Gene Firmware is not supported by Xen.\n"
              "Please upgrade your firmware to the latest version");
}
コード例 #4
0
ファイル: psci.c プロジェクト: doniexun/xen
int __init psci_init_0_2(void)
{
    static const struct dt_device_match psci_ids[] __initconst =
    {
        DT_MATCH_COMPATIBLE("arm,psci-0.2"),
        DT_MATCH_COMPATIBLE("arm,psci-1.0"),
        { /* sentinel */ },
    };
    int ret;
    const struct dt_device_node *psci;

    psci = dt_find_matching_node(NULL, psci_ids);
    if ( !psci )
        return -EOPNOTSUPP;

    ret = psci_is_smc_method(psci);
    if ( ret )
        return -EINVAL;

    psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0);

    /* For the moment, we only support PSCI 0.2 and PSCI 1.x */
    if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver != 1) )
    {
        printk("Error: Unrecognized PSCI version %u.%u\n",
               PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));
        return -EOPNOTSUPP;
    }

    psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);

    printk(XENLOG_INFO "Using PSCI-%u.%u for SMP bringup\n",
           PSCI_VERSION_MAJOR(psci_ver), PSCI_VERSION_MINOR(psci_ver));

    return 0;
}
コード例 #5
0
ファイル: omap-uart.c プロジェクト: 0day-ci/xen
    uart->vuart.size = size;
    uart->vuart.data_off = UART_THR;
    uart->vuart.status_off = UART_LSR << REG_SHIFT;
    uart->vuart.status = UART_LSR_THRE;

    /* Register with generic serial driver */
    serial_register_uart(SERHND_DTUART, &omap_uart_driver, uart);

    dt_device_set_used_by(dev, DOMID_XEN);

    return 0;
}

static const struct dt_device_match omap_uart_dt_match[] __initconst =
{
    DT_MATCH_COMPATIBLE("ti,omap4-uart"),
    { /* sentinel */ },
};

DT_DEVICE_START(omap_uart, "OMAP UART", DEVICE_SERIAL)
    .dt_match = omap_uart_dt_match,
    .init = omap_uart_init,
DT_DEVICE_END

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
コード例 #6
0
ファイル: exynos5.c プロジェクト: cosmoecho/xenvnuma
    return PLATFORM_QUIRK_DOM0_MAPPING_11;
}

static const char * const exynos5_dt_compat[] __initconst =
{
    "samsung,exynos5250",
    NULL
};

static const struct dt_device_match exynos5_blacklist_dev[] __initconst =
{
    /* Multi core Timer
     * TODO: this device set up IRQ to CPU 1 which is not yet handled by Xen.
     * This is result to random freeze.
     */
    DT_MATCH_COMPATIBLE("samsung,exynos4210-mct"),
    { /* sentinel */ },
};

PLATFORM_START(exynos5, "SAMSUNG EXYNOS5")
    .compatible = exynos5_dt_compat,
    .init_time = exynos5_init_time,
    .specific_mapping = exynos5_specific_mapping,
    .smp_init = exynos5_smp_init,
    .cpu_up = exynos5_cpu_up,
    .reset = exynos5_reset,
    .quirks = exynos5_quirks,
    .blacklist_dev = exynos5_blacklist_dev,
PLATFORM_END

/*
コード例 #7
0
ファイル: exynos5.c プロジェクト: CPFL/xen
        dprintk(XENLOG_ERR, "Unable to map PMU\n");
        return;
    }

    writel(1, pmu + EXYNOS5_SWRESET);

    iounmap(pmu);
}

static const struct dt_device_match exynos5_blacklist_dev[] __initconst =
{
    /* Multi core Timer
     * TODO: this device set up IRQ to CPU 1 which is not yet handled by Xen.
     * This is result to random freeze.
     */
    DT_MATCH_COMPATIBLE("samsung,exynos4210-mct"),
    DT_MATCH_COMPATIBLE("samsung,secure-firmware"),
    { /* sentinel */ },
};

static const char * const exynos5250_dt_compat[] __initconst =
{
    "samsung,exynos5250",
    NULL
};

static const char * const exynos5_dt_compat[] __initconst =
{
    "samsung,exynos5410",
    NULL
};
コード例 #8
0
ファイル: sunxi.c プロジェクト: HPSI/xen-v4v
#include <asm/platform.h>

static const char * const sunxi_dt_compat[] __initconst =
{
    "allwinner,sun7i-a20",
    NULL
};

static const struct dt_device_match sunxi_blacklist_dev[] __initconst =
{
    /*
     * The UARTs share a page which runs the risk of mapping the Xen console
     * UART to dom0, so don't map any of them.
     */
    DT_MATCH_COMPATIBLE("snps,dw-apb-uart"),
    { /* sentinel */ },
};

PLATFORM_START(sunxi, "Allwinner A20")
    .compatible = sunxi_dt_compat,
    .blacklist_dev = sunxi_blacklist_dev,

    .dom0_gnttab_start = 0x01d00000,
    .dom0_gnttab_size = 0x20000,
PLATFORM_END

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
コード例 #9
0
ファイル: xilinx-zynqmp.c プロジェクト: 0day-ci/xen
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <asm/platform.h>

static const char * const zynqmp_dt_compat[] __initconst =
{
    "xlnx,zynqmp",
    NULL
};

static const struct dt_device_match zynqmp_blacklist_dev[] __initconst =
{
    /* Power management is not yet supported.  */
    DT_MATCH_COMPATIBLE("xlnx,zynqmp-pm"),
    { /* sentinel */ },
};

PLATFORM_START(xgene_storm, "Xilinx ZynqMP")
    .compatible = zynqmp_dt_compat,
    .blacklist_dev = zynqmp_blacklist_dev,
PLATFORM_END

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End: