فهرست منبع

waterDataPreprocessing levelDataPreprocessingThread.c 袁明明 commit at 2020-11-10

袁明明 4 سال پیش
والد
کامیت
d9658ad40e
1فایلهای تغییر یافته به همراه84 افزوده شده و 0 حذف شده
  1. 84 0
      waterDataPreprocessing/dataProcessing/levelDataPreprocessingThread.c

+ 84 - 0
waterDataPreprocessing/dataProcessing/levelDataPreprocessingThread.c

@@ -285,3 +285,87 @@ void __init omap4xxx_check_features(void)
 
 void __init ti81xx_check_features(void)
 {
+	omap_features = OMAP3_HAS_NEON;
+	omap3_cpuinfo();
+}
+
+void __init omap3xxx_check_revision(void)
+{
+	u32 cpuid, idcode;
+	u16 hawkeye;
+	u8 rev;
+
+	/*
+	 * We cannot access revision registers on ES1.0.
+	 * If the processor type is Cortex-A8 and the revision is 0x0
+	 * it means its Cortex r0p0 which is 3430 ES1.0.
+	 */
+	cpuid = read_cpuid(CPUID_ID);
+	if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
+		omap_revision = OMAP3430_REV_ES1_0;
+		cpu_rev = "1.0";
+		return;
+	}
+
+	/*
+	 * Detection for 34xx ES2.0 and above can be done with just
+	 * hawkeye and rev. See TRM 1.5.2 Device Identification.
+	 * Note that rev does not map directly to our defined processor
+	 * revision numbers as ES1.0 uses value 0.
+	 */
+	idcode = read_tap_reg(OMAP_TAP_IDCODE);
+	hawkeye = (idcode >> 12) & 0xffff;
+	rev = (idcode >> 28) & 0xff;
+
+	switch (hawkeye) {
+	case 0xb7ae:
+		/* Handle 34xx/35xx devices */
+		switch (rev) {
+		case 0: /* Take care of early samples */
+		case 1:
+			omap_revision = OMAP3430_REV_ES2_0;
+			cpu_rev = "2.0";
+			break;
+		case 2:
+			omap_revision = OMAP3430_REV_ES2_1;
+			cpu_rev = "2.1";
+			break;
+		case 3:
+			omap_revision = OMAP3430_REV_ES3_0;
+			cpu_rev = "3.0";
+			break;
+		case 4:
+			omap_revision = OMAP3430_REV_ES3_1;
+			cpu_rev = "3.1";
+			break;
+		case 7:
+		/* FALLTHROUGH */
+		default:
+			/* Use the latest known revision as default */
+			omap_revision = OMAP3430_REV_ES3_1_2;
+			cpu_rev = "3.1.2";
+		}
+		break;
+	case 0xb868:
+		/*
+		 * Handle OMAP/AM 3505/3517 devices
+		 *
+		 * Set the device to be OMAP3517 here. Actual device
+		 * is identified later based on the features.
+		 */
+		switch (rev) {
+		case 0:
+			omap_revision = AM35XX_REV_ES1_0;
+			cpu_rev = "1.0";
+			break;
+		case 1:
+		/* FALLTHROUGH */
+		default:
+			omap_revision = AM35XX_REV_ES1_1;
+			cpu_rev = "1.1";
+		}
+		break;
+	case 0xb891:
+		/* Handle 36xx devices */
+
+		switch(rev) {