From: Yang, Wenyou Date: Mon, 31 Jul 2017 13:39:13 +0800 Subject: [U-Boot] [PATCH 2/6] ARM: at91: spl: Add mck function to lower rate while switching In-Reply-To: References: <20170720081303.9002-1-wenyou.yang@microchip.com> <20170720081303.9002-3-wenyou.yang@microchip.com> Message-ID: <019b591e-1e8c-9ea7-8235-31b6ae55c836@Microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On 2017/7/28 12:20, Simon Glass wrote: > Hi Wenyou, > > On 20 July 2017 at 02:12, Wenyou Yang wrote: >> Refer to the commit 70f8c8316ad(PMC: add new mck function to lower >> rate while switching) from AT91Bootstrap. >> >> While switching to a lower clock source, we must switch the clock >> source first instead of last. Otherwise, we could end up with >> too high frequency on internal bus and peripherals. >> This happen on SAMA5D2 as we exit from ROM code @396MHz. >> >> Add a function pmc_mck_init_down() to allow this sequence. >> >> Signed-off-by: Wenyou Yang >> --- >> >> arch/arm/mach-at91/armv7/clock.c | 36 +++++++++++++++++++++++++++ >> arch/arm/mach-at91/include/mach/at91_common.h | 1 + >> 2 files changed, 37 insertions(+) > Can this move into a clock driver instead? This is used for SPL, due to the limitation of the size of SRAM, it is not easy to move to the clock driver. > > Regards, > Simon Best Regards, Wenyou Yang