[U-Boot] [PATCH] arm: mx5: Add LDB clock config code

Marek Vasut marex at denx.de
Wed Oct 10 09:13:00 UTC 2018


On 10/09/2018 10:27 PM, Stefano Babic wrote:
> Hi Marek,
> 
> On 04/10/2018 21:17, Marek Vasut wrote:
>> Add code to configure PLL4, from which the LDB clock are directly
>> derived.
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Cc: Stefano Babic <sbabic at denx.de>
>> ---
>>  arch/arm/include/asm/arch-mx5/clock.h |  1 +
>>  arch/arm/mach-imx/mx5/clock.c         | 21 +++++++++++++++++++++
>>  2 files changed, 22 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/arch-mx5/clock.h b/arch/arm/include/asm/arch-mx5/clock.h
>> index 0ecbdeede5..6f5ca5888a 100644
>> --- a/arch/arm/include/asm/arch-mx5/clock.h
>> +++ b/arch/arm/include/asm/arch-mx5/clock.h
>> @@ -38,6 +38,7 @@ enum mxc_clock {
>>  	MXC_NFC_CLK,
>>  	MXC_PERIPH_CLK,
>>  	MXC_I2C_CLK,
>> +	MXC_LDB_CLK,
>>  };
>>  
>>  u32 imx_get_uartclk(void);
>> diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
>> index 427cb12415..dcefc4276a 100644
>> --- a/arch/arm/mach-imx/mx5/clock.c
>> +++ b/arch/arm/mach-imx/mx5/clock.c
>> @@ -838,6 +838,23 @@ static int config_ddr_clk(u32 emi_clk)
>>  	return 0;
>>  }
>>  
>> +static int config_ldb_clk(u32 ref, u32 freq)
>> +{
>> +	int ret = 0;
>> +	struct pll_param pll_param;
>> +
>> +	memset(&pll_param, 0, sizeof(struct pll_param));
>> +
>> +	ret = calc_pll_params(ref, freq, &pll_param);
>> +	if (ret != 0) {
>> +		printf("Error:Can't find pll parameters: %d\n",
>> +			ret);
>> +		return ret;
>> +	}
>> +
>> +	return config_pll_clk(PLL4_CLOCK, &pll_param);
> 
> This patch breaks the ts4800 board because this is not defined. Can you
> take a look please ?

V2 is out.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list