[PATCH v4 07/11] net: ethernet: stmmac: add management of stm32mp13 for stm32
Marek Vasut
marex at denx.de
Thu Jun 6 08:47:11 PDT 2024
On 6/6/24 4:19 PM, Christophe ROULLIER wrote:
Hi,
>>> @@ -348,8 +360,15 @@ static int stm32_dwmac_parse_data(struct
>>> stm32_dwmac *dwmac,
>>> return PTR_ERR(dwmac->regmap);
>>> err = of_property_read_u32_index(np, "st,syscon", 1,
>>> &dwmac->mode_reg);
>>> - if (err)
>>> + if (err) {
>>> dev_err(dev, "Can't get sysconfig mode offset (%d)\n", err);
>>> + return err;
>>> + }
>>> +
>>> + dwmac->mode_mask = SYSCFG_MP1_ETH_MASK;
>>> + err = of_property_read_u32_index(np, "st,syscon", 2,
>>> &dwmac->mode_mask);
>>> + if (err)
>>> + pr_debug("Warning sysconfig register mask not set\n");
>>
>> I _think_ you need to left-shift the mode mask by 8 for STM32MP13xx
>> second GMAC somewhere in here, right ?
>>
> The shift is performed in function stm32mp1_configure_pmcr:
>
> /* Shift value at correct ethernet MAC offset in SYSCFG_PMCSETR */
> val <<= ffs(dwmac->mode_mask) - ffs(SYSCFG_MP1_ETH_MASK);
>
> In case of MP13 Ethernet1 or MP15, shift equal 0
>
> In case of MP13 Ethernet2 , shift equal 8 ;-)
Oh, good, thanks !
More information about the linux-arm-kernel
mailing list