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();
193 +%sreturn rec->time_us;
198 signoff = 'Signed-off-by: Simon Glass <sjg@chromium.org>\n'
200 if data_type == 'good':
202 elif data_type == 'no-signoff':
204 elif data_type == 'spaces':
207 print 'not implemented'
208 return data % (signoff, tab, tab)
210 def SetupData(self, data_type):
211 inhandle, inname = tempfile.mkstemp()
212 infd = os.fdopen(inhandle, 'w')
213 data = self.GetData(data_type)
218 def testCheckpatch(self):
219 """Test checkpatch operation"""
220 inf = self.SetupData('good')
221 result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
222 self.assertEqual(result, True)
223 self.assertEqual(problems, [])
224 self.assertEqual(err, 0)
225 self.assertEqual(warn, 0)
226 self.assertEqual(lines, 67)
229 inf = self.SetupData('no-signoff')
230 result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
231 self.assertEqual(result, False)
232 self.assertEqual(len(problems), 1)
233 self.assertEqual(err, 1)
234 self.assertEqual(warn, 0)
235 self.assertEqual(lines, 67)
238 inf = self.SetupData('spaces')
239 result, problems, err, warn, lines, stdout = checkpatch.CheckPatch(inf)
240 self.assertEqual(result, False)
241 self.assertEqual(len(problems), 2)
242 self.assertEqual(err, 0)
243 self.assertEqual(warn, 2)
244 self.assertEqual(lines, 67)
248 if __name__ == "__main__":