From: Piotr Dymacz Date: Wed, 2 Dec 2015 18:30:07 +0000 (+0100) Subject: Fix SPI clock calculation in setclk command, use new QC/A clocks calculation function X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d49f8563fb0cf00a305e5defb015727577793640;p=oweals%2Fu-boot_mod.git Fix SPI clock calculation in setclk command, use new QC/A clocks calculation function --- diff --git a/u-boot/common/cmd_custom.c b/u-boot/common/cmd_custom.c index ad97d9f..c85c20f 100755 --- a/u-boot/common/cmd_custom.c +++ b/u-boot/common/cmd_custom.c @@ -559,12 +559,7 @@ int do_set_clocks(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){ if(argc == 1){ // read clocks - qca_sys_clocks(&cpu_freq, &ddr_freq, &ahb_freq, NULL, NULL); - - // calculate SPI clock (we need to set bit 0 to 1 in SPI_FUNC_SELECT to access SPI registers) - ar7240_reg_wr(AR7240_SPI_FS, 0x01); - spi_freq = ahb_freq / (((ar7240_reg_rd(AR7240_SPI_CLOCK) & 0x3F) + 1) * 2); - ar7240_reg_wr(AR7240_SPI_FS, 0x0); + qca_sys_clocks(&cpu_freq, &ddr_freq, &ahb_freq, &spi_freq, NULL); // make MHz from Hz cpu_freq /= 1000000;