From 32267c1094a1961ad8acd180f3220faed51794d0 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Fri, 20 Nov 2015 10:26:13 -0800 Subject: cr50: rename hw generated register definitions file This common for all g based boards file should not be associated with a single board. BRANCH=none BUG=none TEST=the device still builds and boots. Change-Id: I34c49a095abd8e49b492c318823dd8f56609fdc8 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/313631 Reviewed-by: Bill Richardson --- util/cr50_regs | 77 ---------------------------------------------------------- util/g_regs | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100755 util/cr50_regs create mode 100755 util/g_regs (limited to 'util') diff --git a/util/cr50_regs b/util/cr50_regs deleted file mode 100755 index 1351abb60b..0000000000 --- a/util/cr50_regs +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/perl -# Copyright 2015 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -use strict; -our $opt_D; - -use File::Basename; -my $progdir = dirname($0); -my $prog = basename($0); - -use Getopt::Std; -my $usage = " -Usage: $prog [HEADER] - -This converts the FPGA release's generated C header file into the -cr50_fpga_regdefs.h file that is included by chip/g/registers.h. -Mostly it just prefaces the macros with GC_ to avoid name collision. - -"; -getopts('D') or die $usage; - - -print "/* - * Copyright 2015 The Chromium OS Authors. All rights reserved. - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -/* This file is autogenerated by the $prog utility. Do not edit. */ - -"; - -while(<>) -{ - if ( s/\b\w+_REGDEFS_H/__EC_CHIP_G_CR50_FPGA_REGDEFS_H/g ) - { - print; - next; - } - - if ( s/__ENABLE_FLASH_DFT_DEFINITIONS__/GC__ENABLE_FLASH_DFT_DEFINITIONS__/g ) - { - print; - next; - } - - if ( s/\bFLASH_DFT/GC_FLASH_DFT/g ) - { - print; - next; - } - - if ( m/^#define\s+(\S+)\s+(\S+)\s*$/ ) - { - my ($k,$v) = ($1,$2); - - if ($k =~ m/^IRQNUM/) { - # irqnums must be decimal - $v = 0 + hex($v); - } - $k = "GC_$k"; - printf("#define %-40s %s\n", $k, $v); - if ( $k =~ m/0_BASE_ADDR$/ ) { - $k =~ s/0_BASE_ADDR/_BASE_ADDR/; - printf("#define %-40s %s\n", $k, $v); - } - next; - } - - next if m!//!; - next if m!/\*! .. m!\*/!; - - print; -} - diff --git a/util/g_regs b/util/g_regs new file mode 100755 index 0000000000..28e6f4a53d --- /dev/null +++ b/util/g_regs @@ -0,0 +1,77 @@ +#!/usr/bin/perl +# Copyright 2015 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +use strict; +our $opt_D; + +use File::Basename; +my $progdir = dirname($0); +my $prog = basename($0); + +use Getopt::Std; +my $usage = " +Usage: $prog [HEADER] + +This converts the FPGA release's generated C header file into the +hw_regdefs.h file that is included by chip/g/registers.h. +Mostly it just prefaces the macros with GC_ to avoid name collision. + +"; +getopts('D') or die $usage; + + +print "/* + * Copyright 2015 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* This file is autogenerated by the $prog utility. Do not edit. */ + +"; + +while(<>) +{ + if ( s/\b\w+_REGDEFS_H/__EC_CHIP_G_CR50_FPGA_REGDEFS_H/g ) + { + print; + next; + } + + if ( s/__ENABLE_FLASH_DFT_DEFINITIONS__/GC__ENABLE_FLASH_DFT_DEFINITIONS__/g ) + { + print; + next; + } + + if ( s/\bFLASH_DFT/GC_FLASH_DFT/g ) + { + print; + next; + } + + if ( m/^#define\s+(\S+)\s+(\S+)\s*$/ ) + { + my ($k,$v) = ($1,$2); + + if ($k =~ m/^IRQNUM/) { + # irqnums must be decimal + $v = 0 + hex($v); + } + $k = "GC_$k"; + printf("#define %-40s %s\n", $k, $v); + if ( $k =~ m/0_BASE_ADDR$/ ) { + $k =~ s/0_BASE_ADDR/_BASE_ADDR/; + printf("#define %-40s %s\n", $k, $v); + } + next; + } + + next if m!//!; + next if m!/\*! .. m!\*/!; + + print; +} + -- cgit v1.2.1