File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2082,6 +2082,41 @@ static int dt_set_sep(void)
20822082 return 0 ;
20832083}
20842084
2085+ static int dt_set_smc (void )
2086+ {
2087+ const char * region ;
2088+ int reboot_node ;
2089+ char smc_reboot [32 ];
2090+ int ret ;
2091+
2092+ const char * path = fdt_get_alias (dt , "smc" );
2093+ if (path == NULL )
2094+ return 0 ;
2095+
2096+ snprintf (smc_reboot , 32 , "%s/reboot" , path );
2097+
2098+ if ((reboot_node = fdt_path_offset (dt , smc_reboot )) < 0 )
2099+ return 0 ;
2100+
2101+ if (fdt_node_check_compatible (dt , reboot_node , "apple,t8015-smc-reboot" ))
2102+ return 0 ;
2103+
2104+ if (!(region = adt_getprop (adt , 0 , "region-info" , NULL ))) {
2105+ printf ("ADT: could not get region-info\n" );
2106+ return 0 ;
2107+ }
2108+
2109+ if (strcmp (region , "CH/A" )) // PRC
2110+ return 0 ;
2111+
2112+ ret = fdt_setprop_empty (dt , reboot_node , "prc-poweroff" );
2113+
2114+ if (ret )
2115+ bail ("FDT: could not set %s.prc-poweroff\n" , smc_reboot );
2116+
2117+ return 0 ;
2118+ }
2119+
20852120static int dt_set_sio_fwdata (const char * adt_path , const char * fdt_alias )
20862121{
20872122 int node = fdt_path_offset (dt , fdt_alias );
@@ -2740,6 +2775,8 @@ int kboot_prepare_dt(void *fdt)
27402775 return -1 ;
27412776 if (dt_set_sep ())
27422777 return -1 ;
2778+ if (dt_set_smc ())
2779+ return -1 ;
27432780 if (dt_set_nvram ())
27442781 return -1 ;
27452782 if (dt_set_ipd ())
You can’t perform that action at this time.
0 commit comments