Commit 929a213830612579e2413297ead6353615a64dc2

Authored by Kim Phillips
Committed by Kumar Gala
1 parent 5d0c3b57b2

powerpc/8xxx: Distinguish between incompatible SEC h/w types

CONFIG_SYS_FSL_SEC_COMPAT is set to 2 for the SEC 2.x and SEC 3.x.
Parts with newer SEC h/w versions will increment the number to
accomodate incompatible code changes.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

Showing 3 changed files with 11 additions and 4 deletions Side-by-side Diff

arch/powerpc/cpu/mpc8xxx/fdt.c
... ... @@ -97,11 +97,11 @@
97 97 }
98 98 #endif /* CONFIG_HAS_FSL_DR_USB */
99 99  
100   -#if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx)
101 100 /*
102 101 * update crypto node properties to a specified revision of the SEC
103   - * called with sec_rev == 0 if not on an mpc8xxxE processor
  102 + * called with sec_rev == 0 if not on an E processor
104 103 */
  104 +#if CONFIG_SYS_FSL_SEC_COMPAT == 2 /* SEC 2.x/3.x */
105 105 void fdt_fixup_crypto_node(void *blob, int sec_rev)
106 106 {
107 107 const struct sec_rev_prop {
... ... @@ -183,5 +183,5 @@
183 183 printf("WARNING: could not set crypto property: %s\n",
184 184 fdt_strerror(err));
185 185 }
186   -#endif /* defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) */
  186 +#endif
arch/powerpc/include/asm/config.h
... ... @@ -66,6 +66,13 @@
66 66 #define CONFIG_TSECV2
67 67 #endif
68 68  
  69 +/*
  70 + * SEC (crypto unit) major compatible version determination
  71 + */
  72 +#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC83xx)
  73 +#define CONFIG_SYS_FSL_SEC_COMPAT 2
  74 +#endif
  75 +
69 76 /* Number of TLB CAM entries we have on FSL Book-E chips */
70 77 #if defined(CONFIG_E500MC)
71 78 #define CONFIG_SYS_NUM_TLBCAMS 64
include/fdt_support.h
... ... @@ -59,7 +59,7 @@
59 59 static inline void fdt_fixup_dr_usb(void *blob, bd_t *bd) {}
60 60 #endif /* CONFIG_HAS_FSL_DR_USB */
61 61  
62   -#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC83xx)
  62 +#if defined(CONFIG_SYS_FSL_SEC_COMPAT)
63 63 void fdt_fixup_crypto_node(void *blob, int sec_rev);
64 64 #else
65 65 static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {}