child = of_get_next_available_child(gmi->dev->of_node, NULL); if (!child) {
dev_err(gmi->dev, "no child nodes found\n"); return -ENODEV;
}
/* * We currently only support one child device due to lack of * chip-select address decoding. Which means that we only have one * chip-select line from the GMI controller.
*/ if (of_get_child_count(gmi->dev->of_node) > 1)
dev_warn(gmi->dev, "only one child device is supported.");
if (of_property_read_bool(child, "nvidia,snor-data-width-32bit"))
gmi->snor_config |= TEGRA_GMI_BUS_WIDTH_32BIT;
if (of_property_read_bool(child, "nvidia,snor-mux-mode"))
gmi->snor_config |= TEGRA_GMI_MUX_MODE;
if (of_property_read_bool(child, "nvidia,snor-rdy-active-before-data"))
gmi->snor_config |= TEGRA_GMI_RDY_BEFORE_DATA;
if (of_property_read_bool(child, "nvidia,snor-rdy-active-high"))
gmi->snor_config |= TEGRA_GMI_RDY_ACTIVE_HIGH;
if (of_property_read_bool(child, "nvidia,snor-adv-active-high"))
gmi->snor_config |= TEGRA_GMI_ADV_ACTIVE_HIGH;
if (of_property_read_bool(child, "nvidia,snor-oe-active-high"))
gmi->snor_config |= TEGRA_GMI_OE_ACTIVE_HIGH;
if (of_property_read_bool(child, "nvidia,snor-cs-active-high"))
gmi->snor_config |= TEGRA_GMI_CS_ACTIVE_HIGH;
/* Decode the CS# */
err = of_property_read_u32_array(child, "ranges", ranges, 4); if (err < 0) { /* Invalid binding */ if (err == -EOVERFLOW) {
dev_err(gmi->dev, "failed to decode CS: invalid ranges length\n"); goto error_cs;
}
/* * If we reach here it means that the child node has an empty * ranges or it does not exist at all. Attempt to decode the * CS# from the reg property instead.
*/
err = of_property_read_u32(child, "reg", &property); if (err < 0) {
dev_err(gmi->dev, "failed to decode CS: no reg property found\n"); goto error_cs;
}
} else {
property = ranges[1];
}
/* The default values that are provided below are reset values */ if (!of_property_read_u32(child, "nvidia,snor-muxed-width", &property))
gmi->snor_timing0 |= TEGRA_GMI_MUXED_WIDTH(property); else
gmi->snor_timing0 |= TEGRA_GMI_MUXED_WIDTH(1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.