android_kernel_xiaomi_sdm845/arch/powerpc/platforms
Anton Vorontsov 5053037816 [POWERPC] 8xx: Timebase frequency should not depend on bus-frequency
m8xx_setup.c says:
   /* Force all 8xx processors to use divide by 16 processor clock. */

And at the same time it is using bus-frequency for calculating
timebase.  It is okay for most setups because bus-frequency is
equal to clock-frequency.

The problem emerges when cpu frequency is > 66MHz, quoting
u-boot/cpu/mpc8xx/speed.c:

        if (gd->cpu_clk <= 66000000) {
                sccr_reg |= SCCR_EBDF00;        /* bus division factor = 1 */
                gd->bus_clk = gd->cpu_clk;
        } else {
                sccr_reg |= SCCR_EBDF01;        /* bus division factor = 2 */
                gd->bus_clk = gd->cpu_clk / 2;
        }

So in case of cpu clock > 66MHz, bus_clk = cpu_clk / 2. An then, from
Linux, we calculate timebase frequency as tb_freq = bus_clk / 16,
that is cpu_clk / 2 / 16, which is wrong.

This fixes the system time drifting problem on the EP885C board
running at 133MHz.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-26 22:17:03 +11:00
..
8xx [POWERPC] 8xx: Timebase frequency should not depend on bus-frequency 2008-02-26 22:17:03 +11:00
40x Merge branch 'virtex-for-2.6.25' of git://git.secretlab.ca/git/linux-2.6-virtex into for-2.6.25 2008-02-06 21:06:45 -06:00
44x [POWERPC] 44x: Fix Kconfig formatting 2008-02-15 22:05:03 -06:00
52xx [POWERPC] Remove unused CONFIG_WANT_DEVICE_TREE 2008-02-14 22:11:03 +11:00
82xx [POWERPC] arch/powerpc/platforms/82xx: Add missing of_node_put 2008-02-06 22:06:59 +11:00
83xx [POWERPC] 83xx: mpc832x_rdb: fix compiler warning 2008-02-05 23:38:10 -06:00
85xx [POWERPC] 85xx: convert sbc85* boards to use machine_device_initcall 2008-01-28 13:15:26 -06:00
86xx [POWERPC] 86xx: MPC8641 HPCN - call of_platform_bus_probe() 2008-01-23 19:35:02 -06:00
512x [POWERPC] Remove unused CONFIG_WANT_DEVICE_TREE 2008-02-14 22:11:03 +11:00
cell Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/lmb-2.6 2008-02-26 21:08:45 +11:00
celleb [POWERPC] Have celleb use its own dma_direct_offset variable 2008-01-25 22:52:54 +11:00
chrp [POWERPC] Autodetect serial console on pegasos2 2008-01-25 22:52:55 +11:00
embedded6xx [POWERPC] Remove unused CONFIG_WANT_DEVICE_TREE 2008-02-14 22:11:03 +11:00
iseries [POWERPC] free_property() must not be __init 2008-02-14 22:11:02 +11:00
maple [LIB]: Make PowerPC LMB code generic so sparc64 can use it too. 2008-02-13 16:56:49 -08:00
pasemi [POWERPC] pasemi: Register i2c devices at boot 2008-02-21 21:08:35 +11:00
powermac [LIB]: Make PowerPC LMB code generic so sparc64 can use it too. 2008-02-13 16:56:49 -08:00
prep
ps3 [LIB]: Make PowerPC LMB code generic so sparc64 can use it too. 2008-02-13 16:56:49 -08:00
pseries [POWERPC] Add code for removing HPTEs for parts of the linear mapping 2008-02-26 22:17:03 +11:00
fsl_uli1575.c [POWERPC] Fix interrupt routing and setup of ULI M1575 on FSL boards 2007-08-17 13:22:16 -05:00
Kconfig [POWERPC] Remove unused CONFIG_WANT_DEVICE_TREE 2008-02-14 22:11:03 +11:00
Kconfig.cputype [POWERPC] Remove unused CONFIG_WANT_DEVICE_TREE 2008-02-14 22:11:03 +11:00
Makefile [POWERPC] mpc512x: Basic platform support 2008-02-06 14:03:10 -07:00