2005-08-31 10:45:47 +00:00
|
|
|
#
|
|
|
|
# set the ARCH environment variable for kernel compilation (including
|
|
|
|
# modules). return value must match one of the architecture directories
|
|
|
|
# in the kernel source "arch" directory
|
|
|
|
#
|
|
|
|
|
2007-08-08 20:41:55 +00:00
|
|
|
valid_archs = "alpha cris ia64 \
|
2010-08-13 14:16:58 +00:00
|
|
|
i386 x86 \
|
2011-07-22 09:24:54 +00:00
|
|
|
m68knommu m68k ppc powerpc powerpc64 ppc64 \
|
2007-08-08 20:41:55 +00:00
|
|
|
sparc sparc64 \
|
|
|
|
arm arm26 \
|
|
|
|
m32r mips \
|
|
|
|
sh sh64 um h8300 \
|
|
|
|
parisc s390 v850 \
|
2011-05-05 16:27:55 +00:00
|
|
|
avr32 blackfin \
|
|
|
|
microblaze"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
|
|
|
def map_kernel_arch(a, d):
|
2009-11-08 22:32:43 +00:00
|
|
|
import re
|
2005-08-31 10:45:47 +00:00
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
valid_archs = d.getVar('valid_archs', 1).split()
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2010-08-13 14:16:58 +00:00
|
|
|
if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
|
|
|
|
elif re.match('arm26$', a): return 'arm26'
|
|
|
|
elif re.match('armeb$', a): return 'arm'
|
|
|
|
elif re.match('mipsel$', a): return 'mips'
|
2011-07-22 09:24:54 +00:00
|
|
|
elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc'
|
2010-08-13 14:16:58 +00:00
|
|
|
elif re.match('sh(3|4)$', a): return 'sh'
|
|
|
|
elif re.match('bfin', a): return 'blackfin'
|
2011-07-05 19:38:10 +00:00
|
|
|
elif re.match('microblazeel', a): return 'microblaze'
|
2010-08-13 14:16:58 +00:00
|
|
|
elif a in valid_archs: return a
|
2005-08-31 10:45:47 +00:00
|
|
|
else:
|
|
|
|
bb.error("cannot map '%s' to a linux kernel architecture" % a)
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH', 1), d)}"
|
2008-04-08 15:37:41 +00:00
|
|
|
|
|
|
|
def map_uboot_arch(a, d):
|
2010-05-20 14:15:55 +00:00
|
|
|
import re
|
|
|
|
|
2011-07-22 09:24:54 +00:00
|
|
|
if re.match('p(pc|owerpc)(|64)', a): return 'ppc'
|
2010-05-20 14:15:55 +00:00
|
|
|
elif re.match('i.86$', a): return 'x86'
|
2008-04-08 15:37:41 +00:00
|
|
|
return a
|
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', 1), d)}"
|
2008-04-08 15:37:41 +00:00
|
|
|
|