Add compatible strings used in upstream dts files

This commit is contained in:
Oleksandr Tymoshenko 2016-10-12 03:00:42 +00:00
parent 511bc527ff
commit 9d6eb8bb3d
4 changed files with 29 additions and 4 deletions

View File

@ -52,6 +52,12 @@ __FBSDID("$FreeBSD$");
#include "iicbus_if.h"
static struct ofw_compat_data compat_data[] = {
{"broadcom,bcm2835-bsc", 1},
{"brcm,bcm2708-i2c", 1},
{NULL, 0}
};
static void bcm_bsc_intr(void *);
static int bcm_bsc_detach(device_t);
@ -214,7 +220,7 @@ bcm_bsc_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-bsc"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "BCM2708/2835 BSC controller");

View File

@ -152,6 +152,12 @@ struct bcm_dma_softc {
static struct bcm_dma_softc *bcm_dma_sc = NULL;
static uint32_t bcm_dma_channel_mask;
static struct ofw_compat_data compat_data[] = {
{"broadcom,bcm2835-dma", 1},
{"brcm,bcm2835-dma", 1},
{NULL, 0}
};
static void
bcm_dmamap_cb(void *arg, bus_dma_segment_t *segs,
int nseg, int err)
@ -656,7 +662,7 @@ bcm_dma_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-dma"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "BCM2835 DMA Controller");

View File

@ -71,6 +71,12 @@ __FBSDID("$FreeBSD$");
static int bcm2835_sdhci_hs = 1;
static int bcm2835_sdhci_pio_mode = 0;
static struct ofw_compat_data compat_data[] = {
{"broadcom,bcm2835-sdhci", 1},
{"brcm,bcm2835-mmc", 1},
{NULL, 0}
};
TUNABLE_INT("hw.bcm2835.sdhci.hs", &bcm2835_sdhci_hs);
TUNABLE_INT("hw.bcm2835.sdhci.pio_mode", &bcm2835_sdhci_pio_mode);
@ -126,10 +132,11 @@ bcm_sdhci_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "Broadcom 2708 SDHCI controller");
return (BUS_PROBE_DEFAULT);
}

View File

@ -56,6 +56,12 @@ __FBSDID("$FreeBSD$");
#include "spibus_if.h"
static struct ofw_compat_data compat_data[] = {
{"broadcom,bcm2835-spi", 1},
{"brcm,bcm2835-spi", 1},
{NULL, 0}
};
static void bcm_spi_intr(void *);
#ifdef BCM_SPI_DEBUG
@ -231,7 +237,7 @@ bcm_spi_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi"))
if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
device_set_desc(dev, "BCM2708/2835 SPI controller");