@@ -159,6 +159,8 @@ struct tegra_xusb_soc {
159
159
unsigned int count ;
160
160
} usb2 , ulpi , hsic , usb3 ;
161
161
} ports ;
162
+
163
+ bool scale_ss_clock ;
162
164
};
163
165
164
166
struct tegra_xusb {
@@ -497,13 +499,19 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
497
499
498
500
case MBOX_CMD_INC_SSPI_CLOCK :
499
501
case MBOX_CMD_DEC_SSPI_CLOCK :
500
- err = tegra_xusb_set_ss_clk (tegra , msg -> data * 1000 );
501
- if (err < 0 )
502
- rsp .cmd = MBOX_CMD_NAK ;
503
- else
502
+ if (tegra -> soc -> scale_ss_clock ) {
503
+ err = tegra_xusb_set_ss_clk (tegra , msg -> data * 1000 );
504
+ if (err < 0 )
505
+ rsp .cmd = MBOX_CMD_NAK ;
506
+ else
507
+ rsp .cmd = MBOX_CMD_ACK ;
508
+
509
+ rsp .data = clk_get_rate (tegra -> ss_src_clk ) / 1000 ;
510
+ } else {
504
511
rsp .cmd = MBOX_CMD_ACK ;
512
+ rsp .data = msg -> data ;
513
+ }
505
514
506
- rsp .data = clk_get_rate (tegra -> ss_src_clk ) / 1000 ;
507
515
break ;
508
516
509
517
case MBOX_CMD_SET_BW :
@@ -685,9 +693,11 @@ static int tegra_xusb_clk_enable(struct tegra_xusb *tegra)
685
693
if (err < 0 )
686
694
goto disable_fs_src ;
687
695
688
- err = tegra_xusb_set_ss_clk (tegra , TEGRA_XHCI_SS_HIGH_SPEED );
689
- if (err < 0 )
690
- goto disable_hs_src ;
696
+ if (tegra -> soc -> scale_ss_clock ) {
697
+ err = tegra_xusb_set_ss_clk (tegra , TEGRA_XHCI_SS_HIGH_SPEED );
698
+ if (err < 0 )
699
+ goto disable_hs_src ;
700
+ }
691
701
692
702
return 0 ;
693
703
@@ -1235,11 +1245,44 @@ static const struct tegra_xusb_soc tegra124_soc = {
1235
1245
.hsic = { .offset = 6 , .count = 2 , },
1236
1246
.usb3 = { .offset = 0 , .count = 2 , },
1237
1247
},
1248
+ .scale_ss_clock = true,
1238
1249
};
1239
1250
MODULE_FIRMWARE ("nvidia/tegra124/xusb.bin" );
1240
1251
1252
+ static const char * const tegra210_supply_names [] = {
1253
+ "dvddio-pex" ,
1254
+ "hvddio-pex" ,
1255
+ "avdd-usb" ,
1256
+ "avdd-pll-utmip" ,
1257
+ "avdd-pll-uerefe" ,
1258
+ "dvdd-pex-pll" ,
1259
+ "hvdd-pex-pll-e" ,
1260
+ };
1261
+
1262
+ static const struct tegra_xusb_phy_type tegra210_phy_types [] = {
1263
+ { .name = "usb3" , .num = 4 , },
1264
+ { .name = "usb2" , .num = 4 , },
1265
+ { .name = "hsic" , .num = 1 , },
1266
+ };
1267
+
1268
+ static const struct tegra_xusb_soc tegra210_soc = {
1269
+ .firmware = "nvidia/tegra210/xusb.bin" ,
1270
+ .supply_names = tegra210_supply_names ,
1271
+ .num_supplies = ARRAY_SIZE (tegra210_supply_names ),
1272
+ .phy_types = tegra210_phy_types ,
1273
+ .num_types = ARRAY_SIZE (tegra210_phy_types ),
1274
+ .ports = {
1275
+ .usb2 = { .offset = 4 , .count = 4 , },
1276
+ .hsic = { .offset = 8 , .count = 1 , },
1277
+ .usb3 = { .offset = 0 , .count = 4 , },
1278
+ },
1279
+ .scale_ss_clock = false,
1280
+ };
1281
+ MODULE_FIRMWARE ("nvidia/tegra210/xusb.bin" );
1282
+
1241
1283
static const struct of_device_id tegra_xusb_of_match [] = {
1242
1284
{ .compatible = "nvidia,tegra124-xusb" , .data = & tegra124_soc },
1285
+ { .compatible = "nvidia,tegra210-xusb" , .data = & tegra210_soc },
1243
1286
{ },
1244
1287
};
1245
1288
MODULE_DEVICE_TABLE (of , tegra_xusb_of_match );
0 commit comments