nbhw18: only enable pcie clock, if wifi module is in slot
This commit is contained in:
parent
100330b244
commit
6c46f896a1
|
|
@ -161,6 +161,25 @@ static int add_pcie_slot(ofnode fdt)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int has_slot_wlan(int slot)
|
||||||
|
{
|
||||||
|
int module;
|
||||||
|
char slotDescr[20];
|
||||||
|
char pdValue[200];
|
||||||
|
|
||||||
|
sprintf(slotDescr, "slot=%d", slot);
|
||||||
|
for (module=0; module<4; module++) {
|
||||||
|
strcpy(pdValue, "" ); /*init with an empty string*/
|
||||||
|
if (bd_get_pd_module(module, pdValue, sizeof(pdValue))==0) {
|
||||||
|
/* Wifi module needs PCIe */
|
||||||
|
if ((strstr(pdValue, slotDescr)) && (strstr(pdValue, "wlan-")))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int configure_pcie_slots(void)
|
static int configure_pcie_slots(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -190,8 +209,11 @@ static int configure_pcie_slots(void)
|
||||||
|
|
||||||
/* Enable PCIe clock Note: Slot 1 has always clock. Slot 0 & extension
|
/* Enable PCIe clock Note: Slot 1 has always clock. Slot 0 & extension
|
||||||
slot cannot have clock at same time. */
|
slot cannot have clock at same time. */
|
||||||
for (i = 0; i < 1; i ++) {
|
for (i = 0; i < 2; i ++) {
|
||||||
dm_gpio_set_value(&pcie_slots[i].clk, 1);
|
if (has_slot_wlan(i)) {
|
||||||
|
/* Only enable PCIe clock on WiFi modules as it confuses some LTE modems */
|
||||||
|
dm_gpio_set_value(&pcie_slots[i].clk, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pcie_slot_count;i ++) {
|
for (i = 0; i < pcie_slot_count;i ++) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue