index 0eca68dfce21da66297b5c3ce2a7816c150cf494..1fe5f145b7479e0f930339c6dba94b2757180a63 100644 (file)
} /* chipPllExternalMult */
+/**
+ * @brief return the PSC module number for SPI
+ */
+int32 deviceSpiPscNum (void)
+{
+ uint32 v;
+
+ /* SPI is module number 3 only on the c6618. On the c6616 the SPI is in the
+ * always on domain */
+ v = *((Uint32 *)DEVICE_JTAG_ID_REG);
+ if (v == DEVICE_C6618_JTAG_ID_VAL)
+ return (3);
+
+ return (-1); /* A negative number indicates the always on domain */
+}
+
+/**
+ * @brief Power up a peripheral
+ *
+ * @details
+ * Boot peripherals are powered up
+ */
+int32 devicePowerPeriph (int32 modNum)
+{
+ int32 ret;
+
+ /* If the input value is < 0 there is nothing to power up */
+ if (modNum < 0)
+ return (0);
+
+
+ if (modNum >= TARGET_PWR_MAX_MOD)
+ return (-1);
+
+
+ /* Note that if the sgmii power enable is requested the PA must be
+ * powered up first */
+ if (modNum == TARGET_PWR_ETH(x)) {
+ ret = (int32)pscEnableModule (TARGET_PWR_PA);
+ if (ret != 0)
+ return (ret);
+ }
+
+ return ((int32)pscEnableModule(modNum));
+
+}
+