Paul Wang

i.MX25 security and other questions

Discussion created by Paul Wang on Sep 2, 2013
Latest reply on Jun 12, 2014 by Erhan Yigitbasi
Branched from an earlier discussion

we are using imx258 as the main processor for a project.  when tried to build modules in drivers/mxc/security, we met a lot of troubles.  since could not find any resources in google, sincerely hope someone can give us answers to the following questions in this forum

 

1. should we use rng/shw_driver(.c) as our main tool to bridge user and kernel spaces programs?

 

2. scc2_driver can be used for imx258?

    if the answer to this question is "NO", please, ignore the following 3 questions and jump to question 6 directly

 

3. if so, it is easy to see that some important functions such as shw_handle_scc_encrypt() and shw_handle_scc_decrypt() in shw_driver.c are totally useless if flag FSL_HAVE_SCC2 is not defined.  since turning the FSL_HAVE_SCC2 on will call functions in scc2_driver.c, does this mean we must use scc2_driver.c?

 

4. there is an "old" version driver for scc (mxc_scc.c) having a lot functions also defined scc2_driver.c and this implies that they are mutually exclusive, doesn't it?

 

5. when we disabled FSL_HAVE_SCC and enabled FSL_HAVE_SCC2 we got trouble with "keystore" in fsl_shw_keystore.c.  in mxc_scc.c key storage struct key_slot which is only applied in mxc_scc

 

6. finally, is the following function in dryice.c  implemented correctly?   it seems endless.

 

    static void try_to_clear_wef(void)

    {

        int cnt;

        while (1) {

            di_write(DSR_WEF, DSR);

            for (cnt = 0; cnt < DI_WRITE_LOOP_CNT; cnt++) {

                if ((di_read(DSR) & DSR_WEF) == 0)

                    break;

            }

            di_warn("WARNING: DryIce cannot clear DSR_WEF "

                "(Write Error Flag)!\n");

        }

    }

Outcomes