diff --git a/src/device/device.h b/src/device/device.h
index 0d54a011812a3f1016185fdbdbb0aa6af45312bf..5d698fc5119c2be093768113f37f86f1cb35010b 100644 (file)
--- a/src/device/device.h
+++ b/src/device/device.h
+/*
+ *
+ * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+
+
/**********************************************************************************
* FILE PURPOSE: Define the device interface
**********************************************************************************
void deviceDdrConfig (void);
+/* Function to get the endian setting of a device */
+unsigned int get_device_endian();
+
+/* Function to get the switch setting of a device */
+unsigned int get_device_switch_setting();
+
/**
* @brief
* Perform device level configuration for nand boot
*/
bool deviceIsLittleEndian(void);
-#endif
+/**
+ * @brief
+ * Provide an approximate delay, in cpu cycles
+ *
+ * @details
+ * A delay loop
+ */
+void chipDelay32 (uint32 nCycles);
+
+
+
+
+/**
+ * @brief
+ * Return the NAND interface function table
+ *
+ * @details
+ * Some devices support multiple NAND interface at once (EMIF25 and SPI).
+ * This function returns a pointer to the lower level function
+ * table to use. The table is selected in the ibl configuration.
+ */
+typedef struct nandCtbl_s {
+
+ Int32 (*nct_driverInit) (int32 cs, void *nandDevInfo);
+ Int32 (*nct_driverReadBytes) (Uint32 block, Uint32 page, Uint32 byte, Uint32 nbytes, Uint8 *data);
+ Int32 (*nct_driverReadPage) (Uint32 block, Uint32 page, Uint8 *data);
+ Int32 (*nct_driverClose) (void);
+
+} nandCtbl_t;
+
+nandCtbl_t *deviceGetNandCtbl (int32 interface);
+
+
+/**
+ * @brief
+ * Return the NOR interface function table
+ *
+ * @details
+ * NOR is supported through both SPI and EMIF. This function returns a pointer
+ * to the lower level function table to use during boot.
+ */
+typedef struct norCtbl_s {
+
+ Int32 (*nct_driverInit) (int32 cs);
+ Int32 (*nct_driverReadBytes) (Uint8 *data, Uint32 nbytes, Uint32 address);
+ Int32 (*nct_driverClose) (void);
+
+} norCtbl_t;
+
+norCtbl_t *deviceGetNorCtbl (int32 interface);
+
+
+
+/**
+ * @brief
+ * Return the default SPI device configuration
+ */
+void deviceLoadInitSpiConfig (void *cfg);
+
+#endif