Gentoo Archives: gentoo-embedded

From: meino.cramer@×××.de
To: gentoo-embedded <gentoo-embedded@l.g.o>
Subject: [gentoo-embedded] Additional informations about the clock drifting problem on the Arietta G25
Date: Sun, 07 Dec 2014 05:36:34
Message-Id: 20141207053628.GA6232@solfire
1 Hi,
2
3 when dmesg is called right after logging into an Arietta G25,
4 which was freshly rebooted you will find either this line
5 lines:
6
7
8 [ 0.054687] Calibrating delay loop... 198.76 BogoMIPS (lpj=775168)
9
10 or these lines:
11
12
13 [ 0.000000] Main crystal frequency not set, using approximate value
14 [ 0.000000] master clk is overclocked
15
16
17 If you experience heavy clock drifts AND you find the second group of
18 lines in dmesgs output...then the clocks are not defined properly in
19 the dts file for your Arietta.
20
21 Up to kernel 3.16.1, which is used by Acmesystem another clock setting
22 mechanism was valid and choosen while compiling the kernel. So the dts
23 file provided by Acmesystems for the Arietta dont need to define all
24 clock settings and works well with that kernel.
25
26 For kernels after that (dont know, when the switch happened exactly),
27 you need to define all clock settings in the dts file.
28
29 A posting in the google groups for the Arietta board by dpvgi shows
30 the correct settings.
31
32 The settings in the original dts file by Acmesystems for the clock
33 settings are:
34
35 clocks {
36 #address-cells = <1>;
37 #size-cells = <1>;
38 ranges;
39
40 main_clock: clock@0 {
41 compatible = "atmel,osc", "fixed-clock";
42 clock-frequency = <12000000>;
43 };
44 };
45
46 and should be replaced by
47
48 clocks {
49 #address-cells = <1>;
50 #size-cells = <1>;
51 ranges;
52
53 main_clock: clock@0 {
54 compatible = "atmel,osc", "fixed-clock";
55 clock-frequency = <12000000>;
56 };
57
58 slow_xtal {
59 clock-frequency = <32768>;
60 };
61
62 main_xtal {
63 clock-frequency = <12000000>;
64 };
65
66 };
67
68
69
70 for kernel newer than version 3.16.1
71
72 The file to patch is located here
73
74 <root of your kernel source tree>/arch/arm/boot/dts/acme-arietta.dts
75
76 in the kernel tree (linux 3.18.rc7 as mentioned in my previous post)
77
78 Dont rename that file, since otherwise the kernel compilation process
79 will not find and or create the correct dtb.
80
81 You dont need to recompile the whole kernel to create a new dtb file.
82
83 Just setup your cross compiling prefix. For that I choose (using zsh,
84 any other ksh like shell will do):
85
86 export CCC=<insert path to your toolchain here>/gcc-linaro-arm-none-eabi-4.9-2014.09_linux/bin/arm-none-eabi-
87
88 and then (after changing the above lines) call
89
90 make ARCH=arm CROSS_COMPILE=${CCC} acme-arietta.dtb
91
92 . scp the resulting dtb file (same place as the according dts file) to
93 the /boot/. directory of your Arietta and reboot.
94
95 A dmesg should show the above Bogomips output and the clock
96 does not drift anymore (that much...RTCs of that kind are no
97 chronometers...)
98
99 HTH!
100
101 Best regards
102 Meino