index 225ab7c0494848a683cc6b2c1a726bd4d3bce71f..df69c3d20f1072994bc9c94491792267d9cabf3f 100644 (file)
--- a/src/device/c6457/c6457.c
+++ b/src/device/c6457/c6457.c
+/*
+ *
+ * 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: C6457 Device Specific functions
************************************************************************************
#include "emif31api.h"
#include "pscapi.h"
#include "gpio.h"
+#include "nandhwapi.h"
#include <string.h>
extern cregister unsigned int DNUM;
bool address_is_local (Uint32 addr)
{
/* L2 */
- if ((addr >= 0x00800000) && (addr < 0x00898000))
+ if ((addr >= 0x00800000) && (addr < 0x00a00000))
return (TRUE);
/* L1P */
Uint32 deviceLocalAddrToGlobal (Uint32 addr)
{
- if (address_is_local (addr))
- addr = (1 << 28) | (DNUM << 24) | addr;
-
return (addr);
}
-/**
- * @brief Configure the PLLs
- *
- * @details
- * Only the main PLL can be configured here. The DDR pll is enabled by default,
- * and the network PLL is enabled through serdes configuration.
- * the multiplier and dividers.
- */
-void devicePllConfig (void)
-{
- if (ibl.pllConfig[ibl_MAIN_PLL].doEnable == TRUE)
- hwPllSetPll (MAIN_PLL,
- ibl.pllConfig[ibl_MAIN_PLL].prediv,
- ibl.pllConfig[ibl_MAIN_PLL].mult,
- ibl.pllConfig[ibl_MAIN_PLL].postdiv);
-
-}
-
/**
* @brief
* Enable the DDR
}
+unsigned int get_device_switch_setting()
+{
+ volatile unsigned int w;
+ unsigned int v;
+
+ w = *((uint32 *)0x02880820);
+ v = w & 0x200;
+ v = v >> 9;
+
+ return(v);
+}
/**
* @brief Enable the pass through version of the nand controller
* @details On the evm the nand controller is enabled by setting
* gpio 14 high
*/
-#if 0
+#ifndef EXCLUDE_NAND_GPIO
int32 deviceConfigureForNand(void)
{
hwGpioSetDirection(NAND_MODE_GPIO, GPIO_OUT);
}
+/**
+ * @brief Return the NAND interface call table. Only GPIO is supported on c6457
+ */
+
+#ifndef EXCLUDE_NAND_GPIO
+nandCtbl_t nandCtbl = {
+
+ nandHwGpioDriverInit,
+ nandHwGpioDriverReadBytes,
+ nandHwGpioDriverReadPage,
+ nandHwGpioDriverClose
+
+};
+
+nandCtbl_t *deviceGetNandCtbl (int32 interface)
+{
+ return (&nandCtbl);
+}
+#endif
+