openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

a72_access_test.c (1606B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  */
      7 
      8 #include <appl/diag/test.h>
      9 #include <appl/diag/system.h>
     10 #include <sal/appl/io.h>
     11 #include <sal/compiler.h>
     12 #include <sal/core/thread.h>
     13 #include <sal/core/libc.h>
     14 #include <shared/bsl.h>
     15 #include "testlist.h"
     16 #include <soc/drv.h>
     17 #include <soc/mem.h>
     18 #include <soc/error.h>
     19 
     20 #if defined(BCM_HELIX5_SUPPORT)
     21 
     22 /* initialize the test */
     23 int a72_access_test_init(int uint, args_t *a, void **p)
     24 {
     25     cli_out("a72_access_test_init...\n");
     26     return BCM_E_NONE;
     27 }
     28 
     29 /* run the test */
     30 int a72_access_test(int unit, args_t *a, void *p)
     31 {
     32     uint32      regval = 0;
     33     soc_reg_t   reg;
     34     int rv;
     35 
     36     reg = ICFG_IPROCPERIPH_COMMONr;
     37     SOC_IF_ERROR_RETURN(
     38         soc_reg32_get(unit, reg, REG_PORT_ANY, 0, &regval));
     39 
     40     /* For A72 to be up, both UART0_CLK_SELf/UART1_CLK_SELf
     41        should be 0 */
     42     if (soc_reg_field_get(unit, reg, regval, UART0_CLK_SELf) == 0) {
     43         if (soc_reg_field_get(unit, reg, regval, UART1_CLK_SELf) == 0) {
     44             rv = BCM_E_NONE;
     45             cli_out("A72 boot complete ...\n");
     46         } else {
     47             rv = BCM_E_INTERNAL;
     48             cli_out("A72 boot failed ...!! \n");
     49         }
     50     } else {
     51         rv = BCM_E_INTERNAL;
     52         cli_out("A72 boot failed ...!! \n");
     53     }
     54 
     55     return rv;
     56 }
     57 
     58 /* end the test */
     59 int a72_access_test_done(int uint, void *p)
     60 {
     61     cli_out("A72 access test done ...\n");
     62     return 0;
     63 }
     64 
     65 #endif /* BCM_HELIX5_SUPPORT */