2 # Copyright (c) 2011 The Chromium OS Authors.
4 # See file CREDITS for list of people who contributed to this
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
33 class TestPatch(unittest.TestCase):
36 TODO: Write tests for the rest of the functionality
40 """Test basic filter operation"""
43 From 656c9a8c31fa65859d924cd21da920d6ba537fad Mon Sep 17 00:00:00 2001
44 From: Simon Glass <sjg@chromium.org>
45 Date: Thu, 28 Apr 2011 09:58:51 -0700
46 Subject: [PATCH (resend) 3/7] Tegra2: Add more clock support
48 This adds functions to enable/disable clocks and reset to on-chip peripherals.
51 TEST=build U-Boot for Seaboard, boot
53 Change-Id: I80fe1d0c0b7dd10aa58ce5bb1d9290b6664d5413
55 Review URL: http://codereview.chromium.org/6900006
57 Signed-off-by: Simon Glass <sjg@chromium.org>
59 arch/arm/cpu/armv7/tegra2/Makefile | 2 +-
60 arch/arm/cpu/armv7/tegra2/ap20.c | 57 ++----
61 arch/arm/cpu/armv7/tegra2/clock.c | 163 +++++++++++++++++
65 From 656c9a8c31fa65859d924cd21da920d6ba537fad Mon Sep 17 00:00:00 2001
66 From: Simon Glass <sjg@chromium.org>
67 Date: Thu, 28 Apr 2011 09:58:51 -0700
68 Subject: [PATCH (resend) 3/7] Tegra2: Add more clock support
70 This adds functions to enable/disable clocks and reset to on-chip peripherals.
72 Signed-off-by: Simon Glass <sjg@chromium.org>
74 arch/arm/cpu/armv7/tegra2/Makefile | 2 +-
75 arch/arm/cpu/armv7/tegra2/ap20.c | 57 ++----
76 arch/arm/cpu/armv7/tegra2/clock.c | 163 +++++++++++++++++
79 inhandle, inname = tempfile.mkstemp()
80 infd = os.fdopen(inhandle, 'w')
84 exphandle, expname = tempfile.mkstemp()
85 expfd = os.fdopen(exphandle, 'w')
89 patchstream.FixPatch(None, inname, series.Series(), None)
90 rc = os.system('diff -u %s %s' % (inname, expname))
91 self.assertEqual(rc, 0)
96 def GetData(self, data_type):
98 From 4924887af52713cabea78420eff03badea8f0035 Mon Sep 17 00:00:00 2001
99 From: Simon Glass <sjg@chromium.org>
100 Date: Thu, 7 Apr 2011 10:14:41 -0700
101 Subject: [PATCH 1/4] Add microsecond boot time measurement
103 This defines the basics of a new boot time measurement feature. This allows
104 logging of very accurate time measurements as the boot proceeds, by using
105 an available microsecond counter.
110 common/bootstage.c | 50 ++++++++++++++++++++++++++++++++++++
111 include/bootstage.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++
112 include/common.h | 8 ++++++
113 5 files changed, 141 insertions(+), 0 deletions(-)
114 create mode 100644 common/bootstage.c
115 create mode 100644 include/bootstage.h
117 diff --git a/README b/README
118 index 6f3748d..f9e4e65 100644
121 @@ -2026,6 +2026,17 @@ The following options need to be configured:
122 example, some LED's) on your board. At the moment,
123 the following checkpoints are implemented:
125 +- Time boot progress
128 + Define this option to enable microsecond boot stage timing
129 + on supported platforms. For this to work your platform
130 + needs to define a function timer_get_us() which returns the
131 + number of microseconds since reset. This would normally
132 + be done in your SOC or board timer.c file.
134 + You can add calls to bootstage_mark() to set time markers.
136 - Standalone program support:
137 CONFIG_STANDALONE_LOAD_ADDR
139 diff --git a/common/bootstage.c b/common/bootstage.c
141 index 0000000..2234c87
143 +++ b/common/bootstage.c
146 + * Copyright (c) 2011, Google Inc. All rights reserved.
148 + * See file CREDITS for list of people who contributed to this
151 + * This program is free software; you can redistribute it and/or
152 + * modify it under the terms of the GNU General Public License as
153 + * published by the Free Software Foundation; either version 2 of
154 + * the License, or (at your option) any later version.
156 + * This program is distributed in the hope that it will be useful,
157 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
158 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
159 + * GNU General Public License for more details.
161 + * You should have received a copy of the GNU General Public License
162 + * along with this program; if not, write to the Free Software
163 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
164 + * MA 02111-1307 USA
169 + * This module records the progress of boot and arbitrary commands, and
170 + * permits accurate timestamping of each. The records can optionally be
171 + * passed to kernel in the ATAGs
177 +struct bootstage_record {
182 +static struct bootstage_record record[BOOTSTAGE_COUNT];
184 +uint32_t bootstage_mark(enum bootstage_id id, const char *name)
186 + struct bootstage_record *rec = &record[id];
188 + /* Only record the first event for each */
190 + rec->time_us = (uint32_t)timer_get_us();
194 + %ssomething_else) {
195 + rec->time_us = (uint32_t)timer_get_us();
198 +%sreturn rec->time_us;
203 signoff = 'Signed-off-by: Simon Glass <sjg@chromium.org>\n'
206 if data_type == 'good':
208 elif data_type == 'no-signoff':
210 elif data_type == 'spaces':
212 elif data_type == 'indent':
215 print 'not implemented'
216 return data % (signoff, tab, indent, tab)
218 def SetupData(self, data_type):
219 inhandle, inname = tempfile.mkstemp()
220 infd = os.fdopen(inhandle, 'w')
221 data = self.GetData(data_type)
227 """Test checkpatch operation"""
228 inf = self.SetupData('good')
229 result = checkpatch.CheckPatch(inf)
230 self.assertEqual(result.ok, True)
231 self.assertEqual(result.problems, [])
232 self.assertEqual(result.errors, 0)
233 self.assertEqual(result.warnings, 0)
234 self.assertEqual(result.checks, 0)
235 self.assertEqual(result.lines, 67)
238 def testNoSignoff(self):
239 inf = self.SetupData('no-signoff')
240 result = checkpatch.CheckPatch(inf)
241 self.assertEqual(result.ok, False)
242 self.assertEqual(len(result.problems), 1)
243 self.assertEqual(result.errors, 1)
244 self.assertEqual(result.warnings, 0)
245 self.assertEqual(result.checks, 0)
246 self.assertEqual(result.lines, 67)
249 def testSpaces(self):
250 inf = self.SetupData('spaces')
251 result = checkpatch.CheckPatch(inf)
252 self.assertEqual(result.ok, False)
253 self.assertEqual(len(result.problems), 1)
254 self.assertEqual(result.errors, 0)
255 self.assertEqual(result.warnings, 1)
256 self.assertEqual(result.checks, 0)
257 self.assertEqual(result.lines, 67)
260 def testIndent(self):
261 inf = self.SetupData('indent')
262 result = checkpatch.CheckPatch(inf)
263 self.assertEqual(result.ok, False)
264 self.assertEqual(len(result.problems), 1)
265 self.assertEqual(result.errors, 0)
266 self.assertEqual(result.warnings, 0)
267 self.assertEqual(result.checks, 1)
268 self.assertEqual(result.lines, 67)
272 if __name__ == "__main__":