]> git.wh0rd.org - patches.git/blame - u-boot-revid.patch
scummvm random work
[patches.git] / u-boot-revid.patch
CommitLineData
b77ff2bc
MF
1Index: include/asm-blackfin/processor.h
2===================================================================
3--- include/asm-blackfin/processor.h (revision 1283)
4+++ include/asm-blackfin/processor.h (working copy)
5@@ -30,6 +30,37 @@
6 #ifndef __ASM_BLACKFIN_PROCESSOR_H
7 #define __ASM_BLACKFIN_PROCESSOR_H
8
9-/* Stub to make stupid common code happy */
10+#include <linux/types.h>
11
12+/* Get the Silicon Revision of the chip */
13+static inline uint32_t __pure bfin_revid(void)
14+{
15+ /* stored in the upper 4 bits */
16+ uint32_t revid = bfin_read_CHIPID() >> 28;
17+
18+#ifdef __ADSPBF52x__
19+ /* ANOMALY_05000357
20+ * Incorrect Revision Number in DSPID Register
21+ */
22+ if (revid == 0)
23+ switch (bfin_read16(_BOOTROM_GET_DXE_ADDRESS_TWI)) {
24+ case 0x0010:
25+ revid = 0;
26+ break;
27+ case 0x2796:
28+ revid = 1;
29+ break;
30+ default:
31+ revid = 0xFFFF;
32+ break;
33+ }
34 #endif
35+ return revid;
36+}
37+
38+static inline uint32_t __pure bfin_compiled_revid(void)
39+{
40+ return __SILICON_REVISION__;
41+}
42+
43+#endif
44Index: include/asm-blackfin/blackfin_local.h
45===================================================================
46--- include/asm-blackfin/blackfin_local.h (revision 1283)
47+++ include/asm-blackfin/blackfin_local.h (working copy)
48@@ -54,8 +54,6 @@
49
50 extern u_long get_sclk(void);
51
52-# define bfin_revid() (*pCHIPID >> 28)
53-
54 extern void blackfin_icache_flush_range(const void *, const void *);
55 extern void blackfin_dcache_flush_range(const void *, const void *);
56 extern void blackfin_dcache_invalidate_range(const void *, const void *);