diff options
author | Simon Glass <sjg@chromium.org> | 2011-06-14 15:00:25 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:35 -0700 |
commit | c2f963b424c0e1f7210489b5646d7862570ec8f5 (patch) | |
tree | 9b459dceac57ce7107d101f1f47736795a423c2b /include | |
parent | b994da09cbfa7cb94d5c9c6501770cfec3fa5b94 (diff) |
fdt: tegra2: Support SDMMC config through FDT
This adds FDT configuration of USB ports.
BUG=chromium-os:11623
TEST=Build and boot u-boot; run mmc_boot
Change-Id: I62c015c64e3c3d9996b7117136eb636333fdc0e1
Reviewed-on: http://gerrit.chromium.org/gerrit/2781
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/fdt_decode.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/fdt_decode.h b/include/fdt_decode.h index 4ecf402a092..7b478a8138e 100644 --- a/include/fdt_decode.h +++ b/include/fdt_decode.h @@ -52,6 +52,7 @@ enum fdt_compat_id { COMPAT_NVIDIA_SPI_UART_SWITCH, /* SPI / UART switch */ COMPAT_SERIAL_NS16550, /* NS16550 UART */ COMPAT_NVIDIA_TEGRA250_USB, /* Tegra 250 USB port */ + COMPAT_NVIDIA_TEGRA250_SDMMC, /* Tegra 250 SDMMC port */ COMPAT_COUNT, }; @@ -154,6 +155,17 @@ struct fdt_usb { enum periph_id periph_id;/* peripheral id */ }; +/* Information about an SDMMC port */ +struct fdt_sdmmc { + struct tegra2_mmc *reg; /* address of registers in physical memory */ + int width; /* port width in bits (normally 4) */ + int enabled; /* 1 to enable, 0 to disable */ + struct fdt_gpio_state cd_gpio; /* card detect GPIO */ + struct fdt_gpio_state wp_gpio; /* write protect GPIO */ + struct fdt_gpio_state power_gpio; /* power GPIO */ + enum periph_id periph_id; /* peripheral id */ +}; + /** * Return information from the FDT about the console UART. This looks for * an alias node called 'console' which must point to a UART. It then reads @@ -317,3 +329,22 @@ int fdt_decode_lcd(const void *blob, struct fdt_lcd *config); */ int fdt_decode_usb(const void *blob, int node, unsigned osc_frequency_mhz, struct fdt_usb *config); + +/** + * Returns information from the FDT about an SDMMC port. This function reads + * out the following attributes: + * + * reg + * width + * periph-id + * enabled + * + * @param blob FDT blob to use + * @param node Node to read from + * @param config structure to use to return information + * @returns 0 on success, -ve on error, in which case config may or may not be + * unchanged. If the node is present but expected data is + * missing then this will generally return + * -FDT_ERR_MISSING. + */ +int fdt_decode_sdmmc(const void *blob, int node, struct fdt_sdmmc *config); |