From d49f8563fb0cf00a305e5defb015727577793640 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 2 Dec 2015 19:30:07 +0100 Subject: [PATCH] Fix SPI clock calculation in setclk command, use new QC/A clocks calculation function --- u-boot/common/cmd_custom.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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; -- 2.25.1