@@ -43,21 +43,44 @@ static void isp_ctrr_init_t8020(u64 base, const struct dart_tunables *config, u3
4343 write32 (base + 0x13c , 0x20000 );
4444}
4545
46+ static void isp_ctrr_init_t6000 (u64 base , const struct dart_tunables * config , u32 length )
47+ {
48+ write32 (base + DART_T8020_ENABLED_STREAMS , 0x1 );
49+ write32 (base + 0x2f0 , 0x0 );
50+ write32 (base + DART_T8020_STREAM_SELECT , 0xffff ); // diff from t8020
51+ write32 (base + DART_T8020_STREAM_COMMAND , 0x0 );
52+
53+ int count = length / sizeof (* config );
54+ for (int i = 0 ; i < count ; i ++ ) {
55+ u64 offset = config -> offset & 0xffff ;
56+ u32 set = config -> set & 0xffffffff ;
57+ mask32 (base + offset , read32 (base + offset ), set );
58+ config ++ ;
59+ }
60+
61+ write32 (base + DART_T8020_TCR_OFF , DART_T8020_TCR_TRANSLATE_ENABLE );
62+ write32 (base + 0x13c , 0x20000 );
63+ }
64+
4665int isp_init (void )
4766{
4867 int err = 0 ;
49- const char * path = "/arm-io/isp" ;
50- const char * dart_path = "/arm-io/dart-isp" ;
5168
52- if ( pmgr_adt_power_enable ( path ) < 0 )
53- return -1 ;
69+ const char * isp_path = "/arm-io/isp" ;
70+ const char * dart_path = "/arm-io/dart-isp" ;
5471
5572 int adt_path [8 ];
5673 int node = adt_path_offset_trace (adt , dart_path , adt_path );
5774 if (node < 0 ) {
58- printf ("isp: Error getting node %s\n" , dart_path );
59- return -1 ;
75+ isp_path = "/arm-io/isp0" ;
76+ dart_path = "/arm-io/dart-isp0" ;
77+ node = adt_path_offset_trace (adt , dart_path , adt_path );
6078 }
79+ if (node < 0 )
80+ return 0 ;
81+
82+ if (pmgr_adt_power_enable (isp_path ) < 0 )
83+ return -1 ;
6184
6285 enum dart_type_t type ;
6386 const char * type_s ;
@@ -74,7 +97,6 @@ int isp_init(void)
7497 printf ("isp: dart %s is of an unknown type\n" , dart_path );
7598 return -1 ;
7699 }
77- printf ("isp: found dart type: %s\n" , type_s );
78100
79101 int dart_domain_count = 3 ; // TODO get from dt
80102 for (int index = 0 ; index < dart_domain_count ; index ++ ) {
@@ -88,7 +110,7 @@ int isp_init(void)
88110 snprintf (prop , sizeof (prop ), "dart-tunables-instance-%u" , index );
89111 const struct dart_tunables * config = adt_getprop (adt , node , prop , & length );
90112 if (!config || !length ) {
91- printf ("isp: Error getting ADT node %s property %s.\n" , path , prop );
113+ printf ("isp: Error getting ADT node %s property %s.\n" , isp_path , prop );
92114 err = -1 ;
93115 goto out ;
94116 }
@@ -101,14 +123,17 @@ int isp_init(void)
101123 case DART_T8020 :
102124 isp_ctrr_init_t8020 (base , config , length );
103125 break ;
104- case DART_T8110 :
105- break ;
106126 case DART_T6000 :
127+ isp_ctrr_init_t6000 (base , config , length );
128+ break ;
129+ case DART_T8110 :
130+ printf ("isp: warning: dart type %s not tested yet!\n" , type_s );
131+ isp_ctrr_init_t8020 (base , config , length );
107132 break ;
108133 }
109134 }
110135
111136out :
112- pmgr_adt_power_disable (path );
137+ pmgr_adt_power_disable (isp_path );
113138 return err ;
114139}
0 commit comments