Commit aae1760a authored by Paul Mundt's avatar Paul Mundt Committed by Linus Torvalds

[PATCH] Add mach-type generation for SH

This adds the missing arch/sh/tools directory, which includes mach-type
generation scripts for building include/asm-sh/machtypes.h.
parent 445ff66d
#
# arch/sh/tools/Makefile
#
# Copyright (C) 2003 Paul Mundt
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Shamelessly cloned from ARM.
#
include/asm-sh/machtypes.h: $(obj)/machgen.sh $(obj)/mach-types
@echo ' Generating $@'
@$(CONFIG_SHELL) $(obj)/machgen.sh $(obj)/mach-types > $@
#
# List of boards.
#
#
# MACH_<xxx> CONFIG_<xxx>
#
SE SH_SOLUTION_ENGINE
7751SE SH_7751_SOLUTION_ENGINE
HP600 SH_HP600
HP620 SH_HP620
HP680 SH_HP680
HP690 SH_HP690
HD64461 HD64461
HD64465 HD64465
SH2000 SH_SH2000
SATURN SH_SATURN
DREAMCAST SH_DREAMCAST
BIGSUR SH_BIGSUR
ADX SH_ADX
MPC1211 SH_MPC1211
#!/bin/sh
#
# include/asm-sh/machtype.h header generation script for SuperH
#
# Copyright (C) 2003 Paul Mundt
#
# This is pretty much a quick and dirty hack based off of the awk
# script written by rmk that ARM uses to achieve the same sort of
# thing.
#
# Unfortunately this script has a dependance on bash/sed/cut/tr,
# though they should be prevalent enough for this dependancy not
# to matter overly much.
#
# As a note for anyone attempting to manually invoke this script,
# it expects to be run straight out of the arch/sh/tools/ directory
# as it doesn't look at TOPDIR to figure out where asm-sh is
# located.
#
# See the note at the top of the generated header for additional
# information.
#
# Released under the terms of the GNU GPL v2.0.
#
[ $# -ne 1 ] && echo "Usage: $0 <mach defs>" && exit 1
cat << EOF > tmp.h
/*
* Automagically generated, don't touch.
*/
#ifndef __ASM_SH_MACHTYPES_H
#define __ASM_SH_MACHTYPES_H
#include <linux/config.h>
/*
* We'll use the following MACH_xxx defs for placeholders for the time
* being .. these will all go away once sh_machtype is assigned per-board.
*
* For now we leave things the way they are for backwards compatibility.
*/
/* Mach types */
EOF
newline='
'
IFS=$newline
rm -f tmp2.h
for entry in `cat $1 | sed -e 's/\#.*$//g;/^$/d' | tr '\t' ' ' | tr -s ' '`; do
board=`echo $entry | cut -f1 -d' '`
printf "#ifdef CONFIG_`echo $entry | cut -f2 -d' '`\n" >> tmp.h
printf " #define MACH_$board\t\t1\n#else\n #define MACH_$board\t\t0\n#endif\n" >> tmp.h
printf "#define mach_is_`echo $board | tr '[A-Z]' '[a-z]'`()\t\t\t(MACH_$board)\n" >> tmp2.h
done
printf "\n/* Machtype checks */\n" >> tmp.h
cat tmp2.h >> tmp.h && rm -f tmp2.h
cat << EOF >> tmp.h
#endif /* __ASM_SH_MACHTYPES_H */
EOF
cat tmp.h
rm -f tmp.h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment