Hi,

> Hi Wojciech,
>
>>> Hi all,
>>>
>>> I am trying to switch from madwifi to ath5k on AR2315 WiSoC (Fon
>>> 2100A) using patches from Wojciech and Felix but at module loading
>>> the
>>> driver is not able to attach the HW. In particular it seems that
>>> ath5k
>>> is not capable to recognize the right mac/phy version/revision in the
>>> ath5k_hw_init()
>>>
>>> ath5k phy0: Couldn't identify radio revision.
>>> ar231x-wmac ar231x-wmac.0: failed to attach device, err=-19
>>>
>>> I am not sure about the right values for these fields and so I used
>>> the ones I obtained from madwifi-r3314
>>>
>>> ah_devid 0x86
>>> ah_subvendorid 0x168c
>>> ah_macVersion 0xb
>>> ah_macRev 0x0
>>> ah_phyRev 0x48
>>> ah_analog5GhzRev 0x70
>>>
>>> but now the driver hangs in ath5k_hw_post() because it seems it is
>>> not
>>> able to write correctly in the defined registers.
>>
>> Can you check what ath5k_hw_read_srev(ah) (or ath5k_bus_read_srev(ah))
>> reads from board configuration? It has be valid because we cannot read
>> registers until we reset and we need to know srev already before.
>>
>
> From ath5k_bus_read_srev() I obtain:
>
> ath5k_hw_init[143]: ah->ah_mac_srev 0x86        ah->ah_version 0x2
> ath5k_hw_init[159]: ah->ah_mac_version 0x8      ah->ah_mac_revision 0x6
> ath5k_hw_init[169]: ah->ah_phy_revision 0x1     ah->ah_phy 0x9800
> ah->ah_radio_5ghz_revision 0x0
>

obviously I printed these values before the switch statement in ath5k_hw_init()

> but if I do not overwrite these values with ones from madwifi the
> system hangs in ath5k_hw_init()
>
> "ath5k phy0: Couldn't identify radio revision.
> ar231x-wmac ar231x-wmac.0: failed to attach device, err=-19"
>
> However if I modify mac/phy version/revision in ath5k_hw_init the
> system is not able to write and read coherently in ath5k_hw_post()
> also with your latest patch.
>
>> For reset I have now checked with madwifi and there is a difference
>> in enabling wmac ahb. Can you try following change and see if it
>> helps?
>> I have just copied code for waking up WMAC.
>>
>> Br,
>> Wojtek
>>
>> ---
>> diff --git a/drivers/net/wireless/ath/ath5k/ahb.c 
>> b/drivers/net/wireless/ath/ath5k/ahb.c
>> index 707cde1..06c1b8b 100644
>> --- a/drivers/net/wireless/ath/ath5k/ahb.c
>> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
>> @@ -132,6 +132,21 @@ static int ath_ahb_probe(struct platform_device *pdev)
>>                reg = __raw_readl((void __iomem *) AR5K_AR2315_BYTESWAP);
>>                reg |= AR5K_AR2315_BYTESWAP_WMAC;
>>                __raw_writel(reg, (void __iomem *) AR5K_AR2315_BYTESWAP);
>> +
>> +
>> +               /* wake up the MAC */
>> +               /* NOTE: for the following write to succeed the
>> +                * RST_AHB_ARB_CTL should be set to 0. This driver
>> +                * assumes that the register has been set to 0 by boot loader
>> +                */
>> +               reg = __raw_readl((void __iomem *) AR5K_AR2315_PCI_MAC_SCR);
>> +               reg = (reg & ~AR5K_AR2315_PCI_MAC_SCR_SLMODE_M) |
>> +                   (AR5K_AR2315_PCI_MAC_SCR_SLM_FWAKE << 
>> AR5K_AR2315_PCI_MAC_SCR_SLMODE_S);
>> +               __raw_writel(reg, (void __iomem *) AR5K_AR2315_PCI_MAC_SCR);
>> +
>> +               /* wait for the MAC to wakeup */
>> +               while ( __raw_readl((void __iomem *) 
>> AR5K_AR2315_PCI_MAC_PCICFG) & AR5K_AR2315_PCI_MAC_PCICFG_SPWR_DN);
>> +
>>        } else {
>>                /* Enable WMAC DMA access (assuming 5312 or 231x*/
>>                /* TODO: check other platforms */
>> diff --git a/drivers/net/wireless/ath/ath5k/reg.h 
>> b/drivers/net/wireless/ath/ath5k/reg.h
>> index 7ad05d4..9fc63a5 100644
>> --- a/drivers/net/wireless/ath/ath5k/reg.h
>> +++ b/drivers/net/wireless/ath/ath5k/reg.h
>> @@ -2587,3 +2587,12 @@
>>
>>  #define AR5K_AR2315_BYTESWAP   0xb100000c
>>  #define AR5K_AR2315_BYTESWAP_WMAC      0x00000002
>> +
>> +#define AR5K_AR2315_PCI                                0xb0100000
>> +#define AR5K_AR2315_PCI_MAC_SCR        (AR5K_AR2315_PCI + 0x4004)
>> +#define AR5K_AR2315_PCI_MAC_SCR_SLMODE_M       0x00030000
>> +#define AR5K_AR2315_PCI_MAC_SCR_SLMODE_S       16
>> +#define AR5K_AR2315_PCI_MAC_SCR_SLM_FWAKE      0
>> +
>> +#define AR5K_AR2315_PCI_MAC_PCICFG     (AR5K_AR2315_PCI + 0x4010)
>> +#define AR5K_AR2315_PCI_MAC_PCICFG_SPWR_DN     0x00010000
>> ---
>>
>>
>>
>>>
>>> Any idea about  these issues? I am using OpenWrt trunk,
>>> compat-wireless-2010-11-20, kernel 2.6.32.26.
>>>
>>> Best regards
>>>
>>> Lorenzo
>>
>
> I am going to bisect the issue in more detail by next few days
>
> Best regards
>
> Lorenzo
>

Best regards

Lorenzo
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to