diff options
-rw-r--r-- | conf/machine/include/ixp4xx.conf | 153 | ||||
-rw-r--r-- | conf/machine/nas100d.conf | 144 | ||||
-rw-r--r-- | conf/machine/nslu2.conf | 155 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel.inc | 131 | ||||
-rw-r--r-- | packages/meta/slugos-image.bb | 97 |
5 files changed, 297 insertions, 383 deletions
diff --git a/conf/machine/include/ixp4xx.conf b/conf/machine/include/ixp4xx.conf new file mode 100644 index 0000000000..5005f581ff --- /dev/null +++ b/conf/machine/include/ixp4xx.conf @@ -0,0 +1,153 @@ +#@TYPE: Machine configuration +#@NAME: ixp4xx +#@DESCRIPTION: genric machine configuration for ixp4xx platforms + +#------------------------------------------------------------------------------- +# INPUTS +#------------------------------------------------------------------------------- +# conf/${DISTRO}.conf is included after this file and should be used to modify +# variables identified as 'INPUTS' to the required values for the DISTRO, this +# will cause the board specific settings (which depend for the most part on the +# exact CPU used) to be set correctly within this file. The results are the +# variables identifies here as 'OUTPUTS' +# +#variable = "default" +# <possible values> +# description + +ARCH_BYTE_SEX = "be" +# "be" "le" +# The memory byte sex and (on correctly implemented hardware - the IXP4XX is +# correct) the byte sex of the buses within the system. 'be' (big-endian) +# means that the first byte is the most significant byte on a bus, 'le' +# (little-endian) means that the first byte is the least significant byte. + +ARM_INSTRUCTION_SET = "arm" +# "arm" "thumb" +# The instruction set the compiler should use when generating application +# code. The kernel is always compiled with arm code at present. arm code +# is the original 32 bit ARM instruction set, thumb code is the 16 bit +# encoded RISC sub-set. Thumb code is smaller (maybe 70% of the ARM size) +# but requires more instructions (140% for 70% smaller code) so may be +# slower. + +THUMB_INTERWORK = "yes" +# "yes" "no" +# Whether to compile with code to allow interworking between the two +# instruction sets. This allows thumb code to be executed on a primarily +# arm system and vice versa. It is strongly recommended that DISTROs not +# turn this off - the actual cost is very small. + +DISTRO_BASE = "" +# "" ":<base>" +# If given this must be the name of a 'distro' to add to the bitbake OVERRIDES +# after ${DISTRO}, this allows different distros to share a common base of +# overrides. The value given must include a leading ':' or chaos will result. + +IXP4XX_SUFFIX = "${MACHINE_ARCH}" +# <string> +# Kernel suffix - 'ixp4xxb' or 'ixp4xxl' for a truely generic image, controls +# the suffix on the name of the generated zImage, override in the DISTRO +# configuration if patches or defconfig are changed for the DISTRO. + +#------------------------------------------------------------------------------- +# OUTPUTS +#------------------------------------------------------------------------------- + +#OVERRIDES +# The standard ':' separated list of overrides used by bitbake - see the +# basic setting in bitbake.conf. This list is based on that used for the +# standard setting however :<base>, :thumb and :thumb-interwork will be +# inserted at appropriate points if a base distro, default use of thumb or +# arm/thumb interworking are enabled in the inputs. +OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" +OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" +OVERRIDES = "local:${MACHINE}:ixp4xx:${DISTRO}${DISTRO_BASE}:${TARGET_OS}:${TARGET_ARCH}${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}:build-${BUILD_OS}" + +# TARGET_CC_ARCH +# TARGET_CC_KERNEL_ARCH +# TARGET_LD_ARCH +# TARGET_LD_KERNEL_ARCH +# Compiler and linker options for application code and kernel code. These +# options ensure that the compiler has the correct settings for the selected +# instruction set and interworking. +ARM_INTERWORK_M_OPT = "${@['-mno-thumb-interwork', '-mthumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" +ARM_THUMB_M_OPT = "${@['-mno-thumb', '-mthumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" +# +TARGET_CC_ARCH = "-march=armv5te -mtune=xscale ${ARM_INTERWORK_M_OPT} ${ARM_THUMB_M_OPT}" +TARGET_CC_KERNEL_ARCH = "-march=armv5te -mtune=xscale -mno-thumb-interwork -mno-thumb" +TARGET_LD_ARCH = "" +TARGET_LD_KERNEL_ARCH = "" + +# FULL_OPTIMIZATION +# Optimization settings. Os works fine and is significantly better than O2. +# The other settings are somewhat arbitrary. The optimisations chosen here +# include the ones which 'break' symbolic debugging (because the compiler does +# not include enough information to allow the debugger to know where given +# values are.) The -fno options are an attempt to cancel explicit use of space +# consuming options found in some packages (this isn't a complete list, this is +# just the ones which package writers seem to know about and abuse). +FULL_OPTIMIZATION = "-Os -fomit-frame-pointer -frename-registers \ + -fno-unroll-loops -fno-inline-functions \ + -fweb -funit-at-a-time" + +# TARGET_ARCH +# The correct setting for the system endianness (ARCH_BYTE_SEX). This will +# be arm (le) or armeb (be) - it is difficult to be more precise in the +# setting because of the large number of ways it is used within OpenEmbedded. +TARGET_ARCH = "${@['armeb', 'arm'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" + +# PACKAGE_ARCH +# The correct setting for the generated packages. This corresponds to the +# -march flag passed to the compiler because that limits the architectures +# on which the generated code will run. +BYTE_SEX_CHAR = "${@['b', 'l'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" +PACKAGE_ARCH_BASE = "${@['armv5te', 'thumbv5t'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" +PACKAGE_ARCH = "${PACKAGE_ARCH_BASE}${BYTE_SEX_CHAR}" + +# MACHINE_ARCH +# The correct setting for packages which are specific to the machine, this +# defaults to ${MACHINE} in bitbake.conf, however it is set to ixp4xx here +# because everything built here is no more specific than that. +MACHINE_ARCH = "ixp4xx${BYTE_SEX_CHAR}" + +# IPKG_ARCHS +# The full list of package architectures which should run on the system. +# This takes into account both the board level issues and the INPUTS set +# by the distro. The arm list is derived from the architecture settings +# known to gcc, the thumb list is then derived from that (only the 't' +# architectures of course). +ARM_ARCHITECTURES = "${TARGET_ARCH} armv2${BYTE_SEX_CHAR} armv2a${BYTE_SEX_CHAR} armv3${BYTE_SEX_CHAR} armv3m${BYTE_SEX_CHAR} armv4${BYTE_SEX_CHAR} armv4t${BYTE_SEX_CHAR} armv5${BYTE_SEX_CHAR} armv5t${BYTE_SEX_CHAR} armv5e${BYTE_SEX_CHAR} armv5te${BYTE_SEX_CHAR} xscale${BYTE_SEX_CHAR}" +THUMB_ARCHITECTURES = "thumbe${BYTE_SEX_CHAR} thumbv4t${BYTE_SEX_CHAR} thumbv5t${BYTE_SEX_CHAR}" + +# NOTE: this list contains just the things which rootfs_ipk.bbclass does +# not add, rootfs_ipk.bbclass evaluates: +# +# ipkgarchs="all any noarch ${TARGET_ARCH} ${IPKG_ARCHS} ${MACHINE}" +# +# This is a priority ordered list - most desireable architecture at the end, +# so put <ARM_INSTRUCTION_SET>_ARCHITECTURES at the end and, if +# THUMB_INTERWORK precede this with the other architectures. +IPKG_ARCHS = "${@(lambda arch_thumb, arch_arm, is_arm, interwork: \ + (interwork and (is_arm and arch_thumb or arch_arm) + ' ' or '') \ + + (is_arm and arch_arm or arch_thumb)) \ + (bb.data.getVar('THUMB_ARCHITECTURES', d, 1), \ + bb.data.getVar('ARM_ARCHITECTURES', d, 1), \ + bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) != 'thumb', \ + bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes')} ${MACHINE_ARCH}" + +#------------------------------------------------------------------------------- +# Package versions +#------------------------------------------------------------------------------- +# Warning: these are shared across the different machine and distro +# configurations but can be overridden therein if required. +SRCDATE_ipkg-utils ?= "20060106" +SRCDATE_ipkg-utils-native ?= "20060106" +SRCDATE_ipkg-link ?= "20060106" +SRCDATE_irssi ?= "20050930" + +CVS_TARBALL_STASH = "http://sources.nslu2-linux.org/sources/" +INHERIT += "nslu2-mirrors" + +PREFERRED_VERSION_ipkg ?= "0.99.155" +PREFERRED_VERSION_ipkg-native ?= "0.99.154" diff --git a/conf/machine/nas100d.conf b/conf/machine/nas100d.conf index 45df317bac..02a59d6045 100644 --- a/conf/machine/nas100d.conf +++ b/conf/machine/nas100d.conf @@ -2,148 +2,12 @@ #@NAME: Iomega NAS 100d #@DESCRIPTION: Machine configuration for the Iomega NAS 100d product -#------------------------------------------------------------------------------- -# INPUTS -#------------------------------------------------------------------------------- -# conf/${DISTRO}.conf is included after this file and should be used to modify -# variables identified as 'INPUTS' to the required values for the DISTRO, this -# will cause the board specific settings (which depend for the most part on the -# exact CPU used) to be set correctly within this file. The results are the -# variables identifies here as 'OUTPUTS' -# -#variable = "default" -# <possible values> -# description +include conf/machine/include/ixp4xx.conf -ARCH_BYTE_SEX = "be" -# "be" "le" -# The memory byte sex and (on correctly implemented hardware - the NAS100D is -# correct) the byte sex of the buses within the system. 'be' (big-endian) -# means that the first byte is the most significant byte on a bus, 'le' -# (little-endian) means that the first byte is the least significant byte. - -ARM_INSTRUCTION_SET = "arm" -# "arm" "thumb" -# The instruction set the compiler should use when generating application -# code. The kernel is always compiled with arm code at present. arm code -# is the original 32 bit ARM instruction set, thumb code is the 16 bit -# encoded RISC sub-set. Thumb code is smaller (maybe 70% of the ARM size) -# but requires more instructions (140% for 70% smaller code) so may be -# slower. - -THUMB_INTERWORK = "yes" -# "yes" "no" -# Whether to compile with code to allow interworking between the two -# instruction sets. This allows thumb code to be executed on a primarily -# arm system and vice versa. It is strongly recommended that DISTROs not -# turn this off - the actual cost is very small. - -DISTRO_BASE = "" -# "" ":<base>" -# If given this must be the name of a 'distro' to add to the bitbake OVERRIDES -# after ${DISTRO}, this allows different distros to share a common base of -# overrides. The value given must include a leading ':' or chaos will result. - -#------------------------------------------------------------------------------- -# OUTPUTS -#------------------------------------------------------------------------------- - -#OVERRIDES -# The standard ':' separated list of overrides used by bitbake - see the -# basic setting in bitbake.conf. This list is based on that used for the -# standard setting however :<base>, :thumb and :thumb-interwork will be -# inserted at appropriate points if a base distro, default use of thumb or -# arm/thumb interworking are enabled in the inputs. -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" -OVERRIDES = "local:${MACHINE}:${DISTRO}${DISTRO_BASE}:${TARGET_OS}:${TARGET_ARCH}${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}:build-${BUILD_OS}" - -# TARGET_CC_ARCH -# TARGET_CC_KERNEL_ARCH -# TARGET_LD_ARCH -# TARGET_LD_KERNEL_ARCH -# Compiler and linker options for application code and kernel code. These -# options ensure that the compiler has the correct settings for the selected -# instruction set and interworking. -ARM_INTERWORK_M_OPT = "${@['-mno-thumb-interwork', '-mthumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" -ARM_THUMB_M_OPT = "${@['-mno-thumb', '-mthumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -# -TARGET_CC_ARCH = "-march=armv5te -mtune=xscale ${ARM_INTERWORK_M_OPT} ${ARM_THUMB_M_OPT}" -TARGET_CC_KERNEL_ARCH = "-march=armv5te -mtune=xscale -mno-thumb-interwork -mno-thumb" -TARGET_LD_ARCH = "" -TARGET_LD_KERNEL_ARCH = "" - -# FULL_OPTIMIZATION -# Optimization settings. Os works fine and is significantly better than O2. -# The other settings are somewhat arbitrary. The optimisations chosen here -# include the ones which 'break' symbolic debugging (because the compiler does -# not include enough information to allow the debugger to know where given -# values are.) The -fno options are an attempt to cancel explicit use of space -# consuming options found in some packages (this isn't a complete list, this is -# just the ones which package writers seem to know about and abuse). -FULL_OPTIMIZATION = "-Os -fomit-frame-pointer -frename-registers \ - -fno-unroll-loops -fno-inline-functions \ - -fweb -funit-at-a-time" - -# TARGET_ARCH -# The correct setting for the system endianness (ARCH_BYTE_SEX). This will -# be arm (le) or armeb (be) - it is difficult to be more precise in the -# setting because of the large number of ways it is used within OpenEmbedded. -TARGET_ARCH = "${@['armeb', 'arm'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" - -# PACKAGE_ARCH -# The correct setting for the generated packages. This corresponds to the -# -march flag passed to the compiler because that limits the architectures -# on which the generated code will run. -BYTE_SEX_CHAR = "${@['b', 'l'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" -PACKAGE_ARCH_BASE = "${@['armv5te', 'thumbv5t'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -PACKAGE_ARCH = "${PACKAGE_ARCH_BASE}${BYTE_SEX_CHAR}" - -# IPKG_ARCHS -# The full list of package architectures which should run on the system. -# This takes into account both the board level issues and the INPUTS set -# by the distro. The arm list is derived from the architecture settings -# known to gcc, the thumb list is then derived from that (only the 't' -# architectures of course). -ARM_ARCHITECTURES = "${TARGET_ARCH} armv2${BYTE_SEX_CHAR} armv2a${BYTE_SEX_CHAR} armv3${BYTE_SEX_CHAR} armv3m${BYTE_SEX_CHAR} armv4${BYTE_SEX_CHAR} armv4t${BYTE_SEX_CHAR} armv5${BYTE_SEX_CHAR} armv5t${BYTE_SEX_CHAR} armv5e${BYTE_SEX_CHAR} armv5te${BYTE_SEX_CHAR} xscale${BYTE_SEX_CHAR}" -THUMB_ARCHITECTURES = "thumbe${BYTE_SEX_CHAR} thumbv4t${BYTE_SEX_CHAR} thumbv5t${BYTE_SEX_CHAR}" - -# NOTE: this list contains just the things which rootfs_ipk.bbclass does -# not add, rootfs_ipk.bbclass evaluates: -# -# ipkgarchs="all any noarch ${TARGET_ARCH} ${IPKG_ARCHS} ${MACHINE}" -# -# This is a priority ordered list - most desireable architecture at the end, -# so put <ARM_INSTRUCTION_SET>_ARCHITECTURES at the end and, if -# THUMB_INTERWORK precede this with the other architectures. -IPKG_ARCHS = "${@(lambda arch_thumb, arch_arm, is_arm, interwork: \ - (interwork and (is_arm and arch_thumb or arch_arm) + ' ' or '') \ - + (is_arm and arch_arm or arch_thumb)) \ - (bb.data.getVar('THUMB_ARCHITECTURES', d, 1), \ - bb.data.getVar('ARM_ARCHITECTURES', d, 1), \ - bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) != 'thumb', \ - bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes')}" - -#------------------------------------------------------------------------------- -# Miscellany -#------------------------------------------------------------------------------- # The correct settings for the NAS100D board: SERIAL_CONSOLE = "115200 ttyS0" KERNEL_CONSOLE = "ttyS0,115200n8" USE_VT = "0" - -#------------------------------------------------------------------------------- -# Package versions -#------------------------------------------------------------------------------- -SRCDATE_gnu-config ?= "20050713" -SRCDATE_gnu-config-native ?= "20050713" -SRCDATE_ipkg-utils ?= "20050713" -SRCDATE_ipkg-utils-native ?= "20050713" -SRCDATE_ipkg-link ?= "20050713" -SRCDATE_irssi ?= "20050930" - -CVS_TARBALL_STASH = "http://sources.nslu2-linux.org/sources/" -INHERIT += "nslu2-mirrors" - -PREFERRED_VERSION_ipkg ?= "0.99.152" -PREFERRED_VERSION_ipkg-native ?= "0.99.152" +CMDLINE_ROOT = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M@0x00000000 init=/linuxrc" +IXP4XX_SUFFIX = "nas100d${BYTE_SEX_CHAR}" +IXP4XX_MACHID = "865" diff --git a/conf/machine/nslu2.conf b/conf/machine/nslu2.conf index 49d47fd498..f5ee008204 100644 --- a/conf/machine/nslu2.conf +++ b/conf/machine/nslu2.conf @@ -2,158 +2,13 @@ #@NAME: Linksys NSLU2 #@DESCRIPTION: Machine configuration for the Linksys NSLU2 product -#------------------------------------------------------------------------------- -# INPUTS -#------------------------------------------------------------------------------- -# conf/${DISTRO}.conf is included after this file and should be used to modify -# variables identified as 'INPUTS' to the required values for the DISTRO, this -# will cause the board specific settings (which depend for the most part on the -# exact CPU used) to be set correctly within this file. The results are the -# variables identifies here as 'OUTPUTS' -# -#variable = "default" -# <possible values> -# description +include conf/machine/include/ixp4xx.conf -ARCH_BYTE_SEX = "be" -# "be" "le" -# The memory byte sex and (on correctly implemented hardware - the NSLU2 is -# correct) the byte sex of the buses within the system. 'be' (big-endian) -# means that the first byte is the most significant byte on a bus, 'le' -# (little-endian) means that the first byte is the least significant byte. - -ARM_INSTRUCTION_SET = "arm" -# "arm" "thumb" -# The instruction set the compiler should use when generating application -# code. The kernel is always compiled with arm code at present. arm code -# is the original 32 bit ARM instruction set, thumb code is the 16 bit -# encoded RISC sub-set. Thumb code is smaller (maybe 70% of the ARM size) -# but requires more instructions (140% for 70% smaller code) so may be -# slower. - -THUMB_INTERWORK = "yes" -# "yes" "no" -# Whether to compile with code to allow interworking between the two -# instruction sets. This allows thumb code to be executed on a primarily -# arm system and vice versa. It is strongly recommended that DISTROs not -# turn this off - the actual cost is very small. - -DISTRO_BASE = "" -# "" ":<base>" -# If given this must be the name of a 'distro' to add to the bitbake OVERRIDES -# after ${DISTRO}, this allows different distros to share a common base of -# overrides. The value given must include a leading ':' or chaos will result. - -N2K_SUFFIX = "nslu2${ARCH_BYTE_SEX}" -# <string> -# Kernel suffix - 'nslu2be' or 'nslu2le' for a truely generic image, controls -# the suffix on the name of the generated zImage, override in the DISTRO -# configuration if patches or defconfig are changed for the DISTRO. - -#------------------------------------------------------------------------------- -# OUTPUTS -#------------------------------------------------------------------------------- - -#OVERRIDES -# The standard ':' separated list of overrides used by bitbake - see the -# basic setting in bitbake.conf. This list is based on that used for the -# standard setting however :<base>, :thumb and :thumb-interwork will be -# inserted at appropriate points if a base distro, default use of thumb or -# arm/thumb interworking are enabled in the inputs. -OVERRIDE_THUMB = "${@['', ':thumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -OVERRIDE_INTERWORK = "${@['', ':thumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" -OVERRIDES = "local:${MACHINE}:${DISTRO}${DISTRO_BASE}:${TARGET_OS}:${TARGET_ARCH}${OVERRIDE_THUMB}${OVERRIDE_INTERWORK}:build-${BUILD_OS}" - -# TARGET_CC_ARCH -# TARGET_CC_KERNEL_ARCH -# TARGET_LD_ARCH -# TARGET_LD_KERNEL_ARCH -# Compiler and linker options for application code and kernel code. These -# options ensure that the compiler has the correct settings for the selected -# instruction set and interworking. -ARM_INTERWORK_M_OPT = "${@['-mno-thumb-interwork', '-mthumb-interwork'][bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes']}" -ARM_THUMB_M_OPT = "${@['-mno-thumb', '-mthumb'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -# -TARGET_CC_ARCH = "-march=armv5te -mtune=xscale ${ARM_INTERWORK_M_OPT} ${ARM_THUMB_M_OPT}" -TARGET_CC_KERNEL_ARCH = "-march=armv5te -mtune=xscale -mno-thumb-interwork -mno-thumb" -TARGET_LD_ARCH = "" -TARGET_LD_KERNEL_ARCH = "" - -# FULL_OPTIMIZATION -# Optimization settings. Os works fine and is significantly better than O2. -# The other settings are somewhat arbitrary. The optimisations chosen here -# include the ones which 'break' symbolic debugging (because the compiler does -# not include enough information to allow the debugger to know where given -# values are.) The -fno options are an attempt to cancel explicit use of space -# consuming options found in some packages (this isn't a complete list, this is -# just the ones which package writers seem to know about and abuse). -FULL_OPTIMIZATION = "-Os -fomit-frame-pointer -frename-registers \ - -fno-unroll-loops -fno-inline-functions \ - -fweb -funit-at-a-time" - -# TARGET_ARCH -# The correct setting for the system endianness (ARCH_BYTE_SEX). This will -# be arm (le) or armeb (be) - it is difficult to be more precise in the -# setting because of the large number of ways it is used within OpenEmbedded. -TARGET_ARCH = "${@['armeb', 'arm'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" - -# PACKAGE_ARCH -# The correct setting for the generated packages. This corresponds to the -# -march flag passed to the compiler because that limits the architectures -# on which the generated code will run. -BYTE_SEX_CHAR = "${@['b', 'l'][bb.data.getVar('ARCH_BYTE_SEX', d, 1) == 'le']}" -PACKAGE_ARCH_BASE = "${@['armv5te', 'thumbv5t'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}" -PACKAGE_ARCH = "${PACKAGE_ARCH_BASE}${BYTE_SEX_CHAR}" - -# IPKG_ARCHS -# The full list of package architectures which should run on the system. -# This takes into account both the board level issues and the INPUTS set -# by the distro. The arm list is derived from the architecture settings -# known to gcc, the thumb list is then derived from that (only the 't' -# architectures of course). -ARM_ARCHITECTURES = "${TARGET_ARCH} armv2${BYTE_SEX_CHAR} armv2a${BYTE_SEX_CHAR} armv3${BYTE_SEX_CHAR} armv3m${BYTE_SEX_CHAR} armv4${BYTE_SEX_CHAR} armv4t${BYTE_SEX_CHAR} armv5${BYTE_SEX_CHAR} armv5t${BYTE_SEX_CHAR} armv5e${BYTE_SEX_CHAR} armv5te${BYTE_SEX_CHAR} xscale${BYTE_SEX_CHAR}" -THUMB_ARCHITECTURES = "thumbe${BYTE_SEX_CHAR} thumbv4t${BYTE_SEX_CHAR} thumbv5t${BYTE_SEX_CHAR}" - -# NOTE: this list contains just the things which rootfs_ipk.bbclass does -# not add, rootfs_ipk.bbclass evaluates: -# -# ipkgarchs="all any noarch ${TARGET_ARCH} ${IPKG_ARCHS} ${MACHINE}" -# -# This is a priority ordered list - most desireable architecture at the end, -# so put <ARM_INSTRUCTION_SET>_ARCHITECTURES at the end and, if -# THUMB_INTERWORK precede this with the other architectures. -IPKG_ARCHS = "${@(lambda arch_thumb, arch_arm, is_arm, interwork: \ - (interwork and (is_arm and arch_thumb or arch_arm) + ' ' or '') \ - + (is_arm and arch_arm or arch_thumb)) \ - (bb.data.getVar('THUMB_ARCHITECTURES', d, 1), \ - bb.data.getVar('ARM_ARCHITECTURES', d, 1), \ - bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) != 'thumb', \ - bb.data.getVar('THUMB_INTERWORK', d, 1) == 'yes')}" - -#------------------------------------------------------------------------------- -# Miscellany -#------------------------------------------------------------------------------- # The correct settings for the NSLU2 board: SERIAL_CONSOLE = "115200 ttyS0" KERNEL_CONSOLE = "ttyS0,115200n8" USE_VT = "0" - -# These depends define native utilities - they do not get put in the flash and -# are not required to build the image. -# upslug2 (in tmp/work/upslug2-native-*) is the program to write the NSLU2 flash -# Override this as desired - it makes no difference to the final image. -EXTRA_IMAGEDEPENDS += "upslug2-native" - -#------------------------------------------------------------------------------- -# Package versions -#------------------------------------------------------------------------------- -SRCDATE_ipkg-utils ?= "20060106" -SRCDATE_ipkg-utils-native ?= "20060106" -SRCDATE_ipkg-link ?= "20060106" -SRCDATE_irssi ?= "20050930" - -CVS_TARBALL_STASH = "http://sources.nslu2-linux.org/sources/" -INHERIT += "nslu2-mirrors" - -PREFERRED_VERSION_ipkg ?= "0.99.155" -PREFERRED_VERSION_ipkg-native ?= "0.99.154" +CMDLINE_ROOT = "root=/dev/mtdblock4 rw rootfstype=jffs2 mem=32M@0x00000000 init=/linuxrc" +IXP4XX_SUFFIX = "nslu2${BYTE_SEX_CHAR}" +IXP4XX_MACHID = "597" +IXP4XX_LEFIXUP = "1" diff --git a/packages/linux/ixp4xx-kernel.inc b/packages/linux/ixp4xx-kernel.inc index e01ba7e511..dbf9c364bb 100644 --- a/packages/linux/ixp4xx-kernel.inc +++ b/packages/linux/ixp4xx-kernel.inc @@ -10,7 +10,19 @@ # IXP4XX_PATCHES - full list of patches to apply, to add files # generate a patch against /dev/null # IXP4XX_SUFFIX - the suffix to add after 'zImage-' in the -# deploy/images directory, should identify the image config +# deploy/images directory, should identify the machines the +# kernel will run on, ixp4xx[lb] for generic kernels (le or +# be). Controls the package architecture of the ipk. +# IXP4XX_MACHID - if set the kernel will be forced to use this +# machine id and be forced to LE on LE systems - please always +# remember to override IXP4XX_SUFFIX if this is done, the kernel +# will simply not work on other machines. +# IXP4XX_LEFIXUP - if set prepend the LE fixup code to the kernel +# and byte swap (quad word) the whole kernel image for a BE +# boot loader +# +# If you set CMDLINE_ROOT you should *also* change IXP4XX_SUFFIX +# because the resultant kernel may not work on other systems. # # DEFAULT_PREFERENCE is set automagically in this file as # follows: @@ -29,7 +41,13 @@ DESCRIPTION = "Linux kernel for the Intel IXP4xx device" LICENSE = "GPL" MAINTAINER = "NSLU2-Linux <www.nslu2-linux.org>" -DEPENDS += "devio-native" +# PACKAGE_ARCH must reliably identify what machines this kernel +# will run on +PACKAGE_ARCH = "${IXP4XX_SUFFIX}" + +# Defaults for the prefix flags +IXP4XX_MACHID ?= "" +IXP4XX_LEFIXUP ?= "" # Linux kernel source has the general form linux-X.Y.Z-patchP, # X.Y is the major version number, Z (which may have multiple @@ -147,11 +165,6 @@ S = "${WORKDIR}/linux-${IXP4XX_SRCVER}" # IXP4XX_PATCHES is the list of patches. IXP4XX_PATCHES ?= "" -# Image suffix - actually set in conf/machine/ixp4xx.conf as it is also -# used by anything which needs to know the name of the generated image. -# Should be overridden in the distro if patches or defconfig are changed. -IXP4XX_SUFFIX ?= "ixp4xx${ARCH_BYTE_SEX}" - SRC_URI = "${IXP4XX_SRCURI}" SRC_URI += "${IXP4XX_PATCHES}" SRC_URI += "file://defconfig" @@ -171,16 +184,17 @@ KERNEL_IMAGETYPE = "zImage" # in local.conf will still take precedence. # # CMDLINE_KERNEL_OPTIONS: overridable in local.conf -MACH_KERNEL_OPTIONS = "x1205.hctosys=1 x1205.probe=0,0x6f pcf8563.hctosys=1" -MACH_KERNEL_OPTIONS_nas100d = "pcf8563.hctosys=1" -MACH_KERNEL_OPTIONS_nslu2 = "rtc-x1205.hctosys=1 rtc-x1205.probe=0,0x6f" +# MACH_KERNEL_OPTIONS: the default, added to so additional stuff can be +# put in from local.conf etc. +MACH_KERNEL_OPTIONS += "rtc-x1205.hctosys=1 rtc-x1205.probe=0,0x6f" +MACH_KERNEL_OPTIONS += "rtc-ds1672.probe=0,0x68 rtc-ds1672.hctosys=1" +MACH_KERNEL_OPTIONS += "pcf8563.hctosys=1" +# CMDLINE_KERNEL_OPTIONS ?= "${MACH_KERNEL_OPTIONS}" -# CMDLINE_ROOT: machine specific, do not override -CMDLINE_ROOT = "init=/linuxrc" -CMDLINE_ROOT_loft = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M@0x00000000 init=/linuxrc" -CMDLINE_ROOT_nas100d = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M@0x00000000 init=/linuxrc" -CMDLINE_ROOT_nslu2 = "root=/dev/mtdblock4 rw rootfstype=jffs2 mem=32M@0x00000000 init=/linuxrc" +# CMDLINE_ROOT: machine specific boot options - should not be set on a +# generic kernel! +CMDLINE_ROOT ?= "init=/linuxrc" # CMDLINE_DEBUG: debug options such as noirqdebug, defaults to empty # override in local.conf etc @@ -230,56 +244,75 @@ do_configure_prepend() { ${S}/include/asm-arm/.proc ${S}/include/asm-arm/.arch } -# This function adds the required prefix to the image to deal with two -# problems on NSLU2. +# IXP4XX_MACHID and IXP4XX_LEFIXUP handling +# +# This mach_fixup function adds the required prefix to the image to +# force the machine id in the kernel to be a particular value. For +# LE builds it also forces the CPU into LE mode - this is actually +# harmless even if the CPU is already in LE mode. This deals with +# two known problems on some boards: # -# 1) The machine type set by RedBoot is wrong - the type for an ixdp425, not an IXP4XX -# e3a01c02 e3811055 -# 2) For LE kernels it is necessary to prefix change-to-le code to the kernel image: -# ee110f10 e3c00080 ee010f10 +# 1) The machine type set by the boot loader is wrong - e.g. the type +# for an ixdp425, not the actual board type. Prefix the code with +# two instructions: +# e3a01c<hh> e38110<ll> +# Where the machine ID is 0xhhll +# 2) For LE kernels it is necessary to prefix change-to-le code to +# the kernel image if the boot loader runs with the CPU in BE +# (which is normal for IXP4XX boards): +# ee110f10 e3c00080 ee010f10 # and to byte swap the (LE) image to match the BE flash layout # +# (2) is not required with an LE boot loader (neither the prefix +# nor the byte swapping) so this is controlled by a separate flag, +# however if the boot loader is LE it expects and LE image so the +# instructions written for the machine id must be LE. +# # The argument to the function is the destination directory -redboot_fixup_armeb() { - rm -f "$1".new - devio '<<arch/${ARCH}/boot/${KERNEL_IMAGETYPE}' >"$1".new \ - 'wb 0xe3a01c02,4' \ - 'wb 0xe3811055,4' \ - 'cp$' - mv "$1".new "$1" -} -redboot_fixup_arm() { +#SETMACH: set the machine id (register 1) to IXP4XX_MACHID +SETMACH = '${@["", ".= ${IXP4XX_MACHID} .256/ 255& 0xe3a01c00+; ${WRITE}; .= 255& 0xe3811000+; ${WRITE};"][bb.data.getVar("IXP4XX_MACHID", d, 1) and 1]}' + +#FIXUP: the correct instructions to copy the kernel prepended with the le fixup +FIXUP_armeb = 'cp$' +FIXUP_arm = '${@["cp$", "wb 0xee110f10,4;wb 0xe3c00080,4;wb 0xee010f10,4;xp $,4"][bb.data.getVar("IXP4XX_LEFIXUP", d, 1) and 1]}' + +#WRITE: the correct way to write a single ARM instruction (wb unless LE and !LEFIXUP). +WRITE_armeb = 'wb 4' +WRITE_arm = '${@["wl 4", "wb 4"][bb.data.getVar("IXP4XX_LEFIXUP", d, 1) and 1]}' + +DEPENDS += "devio-native" + +# ${SETMACH}${FIXUP} is a sequence of devio commands to copy the image, +# in the standard (generic) case it is just 'cp$' +copy_image() { rm -f "$1".new - devio '<<arch/${ARCH}/boot/${KERNEL_IMAGETYPE}' >"$1".new \ - 'wb 0xe3a01c02,4' \ - 'wb 0xe3811055,4' \ - 'wb 0xee110f10,4' \ - 'wb 0xe3c00080,4' \ - 'wb 0xee010f10,4' \ - 'xp $,4' || { - echo 'ERROR: arch/${ARCH}/boot/${KERNEL_IMAGETYPE}: failed to byteswap zImage' >&2 + devio '<<arch/${ARCH}/boot/${KERNEL_IMAGETYPE}' >"$1".new '${SETMACH}${FIXUP}' || { + echo 'ERROR: arch/${ARCH}/boot/${KERNEL_IMAGETYPE}: failed to copy zImage' >&2 return 1 } mv "$1".new "$1" } -do_install_append_nslu2() { - redboot_fixup '${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}' -} - -deploy_image_nslu2() { - redboot_fixup '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${IXP4XX_SUFFIX}' -} - -deploy_image() { - install -m 644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${IXP4XX_SUFFIX} +do_install_append() { + copy_image '${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}' } do_deploy[dirs] = "${S}" do_deploy() { install -d ${DEPLOY_DIR}/images - deploy_image + copy_image '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${IXP4XX_SUFFIX}' } addtask deploy before do_build after do_compile + +python () { + # check for IXP4XX_SUFFIX - if not set then we don't know what to build, + # also sanity check the SLUGOS_IMAGESEX + sex = bb.data.getVar("SLUGOS_IMAGESEX", d, 1) + if sex != 'little-endian' and sex != 'big-endian': + raise bb.parse.SkipPackage("slugos kernels require SLUGOS_IMAGESEX") + suffix = bb.data.getVar("IXP4XX_SUFFIX", d, 1) + if suffix == '': + raise bb.parse.SkipPackage("slugos kernels require IXP4XX_SUFFIX") +} diff --git a/packages/meta/slugos-image.bb b/packages/meta/slugos-image.bb index b80b6f7b3a..fec417af95 100644 --- a/packages/meta/slugos-image.bb +++ b/packages/meta/slugos-image.bb @@ -4,18 +4,19 @@ # conf/distro/slugos.conf to get the standard settings). # LICENSE = "MIT" -PR = "r18" +PR = "r19" PROVIDES += "${SLUGOS_IMAGENAME}-image" # SLUGOS_IMAGENAME defines the name of the image to be build, if it # is not set this package will be skipped! IMAGE_BASENAME = "${SLUGOS_IMAGENAME}" IMAGE_FSTYPES = "jffs2" +EXTRA_IMAGECMD_jffs2 = "--pad --${SLUGOS_IMAGESEX} --eraseblock=0x20000 -D ${SLUGOS_DEVICE_TABLE}" +IMAGE_LINGUAS = "" -# Kernel suffix - 'nslu2be' or 'nslu2le' for a truely generic image, -# override in the DISTRO configuration if patches or defconfig are -# changed for the DISTRO! -N2K_SUFFIX ?= "nslu2${ARCH_BYTE_SEX}" +# Setting USE_DEVFS prevents *any* entries being created initially +# in /dev +USE_DEVFS = "1" #FIXME: this is historical, there should be a minimal slugos device table and # this stuff shouldn't be in here at all (put it in slugos-image.bb!) @@ -23,7 +24,6 @@ N2K_SUFFIX ?= "nslu2${ARCH_BYTE_SEX}" # just select a different image .bb file (e.g. slugos-ramdisk-image.bb) to # build with different options. SLUGOS_DEVICE_TABLE = "${@bb.which(bb.data.getVar('BBPATH', d, 1), 'files/device_table-slugos.txt')}" -EXTRA_IMAGECMD_jffs2 = "--pad --${SLUGOS_IMAGESEX} --eraseblock=0x20000 -D ${SLUGOS_DEVICE_TABLE}" # IMAGE_PREPROCESS_COMMAND is run before making the image. In SlugOS the # kernel image is removed from the root file system to recover the space used - @@ -32,44 +32,16 @@ EXTRA_IMAGECMD_jffs2 = "--pad --${SLUGOS_IMAGESEX} --eraseblock=0x20000 -D ${SLU IMAGE_PREPROCESS_COMMAND = "rm ${IMAGE_ROOTFS}/boot/zImage*;" # Building a full image. If required do a post-process command which builds -# the full image using slugimage. -# -#NOTE: you do not actually need the boot loader in normal use because it is -# *not* overwritten by a standard upslug upgrade, so you can make an image with -# just non-LinkSys software which can be flashed into the NSLU2. Because -# LinkSys have made "EraseAll" available, however, (this does overwrite RedBoot) -# it is a bad idea to produce flash images without a valid RedBoot - that allows -# an innocent user upgrade attempt to instantly brick the NSLU2. -NSLU2_SLUGIMAGE_ARGS ?= "" +# the full flash image using slugimage. At present this only works for NSLU2 images. +PACK_IMAGE = "" +IMAGE_POSTPROCESS_COMMAND += "${PACK_IMAGE}" +PACK_IMAGE_DEPENDS = "" +EXTRA_IMAGEDEPENDS += "${PACK_IMAGE_DEPENDS}" -nslu2_pack_image() { - if test '${SLUGOS_FLASH_IMAGE}' = yes - then - install -d ${DEPLOY_DIR_IMAGE}/slug - install -m 0644 ${STAGING_LIBDIR}/nslu2-binaries/RedBoot \ - ${STAGING_LIBDIR}/nslu2-binaries/Trailer \ - ${STAGING_LIBDIR}/nslu2-binaries/SysConf \ - ${DEPLOY_DIR_IMAGE}/slug/ - install -m 0644 ${DEPLOY_DIR_IMAGE}/zImage-${N2K_SUFFIX} \ - ${DEPLOY_DIR_IMAGE}/slug/vmlinuz - install -m 0644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ - ${DEPLOY_DIR_IMAGE}/slug/flashdisk.jffs2 - cd ${DEPLOY_DIR_IMAGE}/slug - slugimage -p -b RedBoot -s SysConf -r Ramdisk:1,Flashdisk:flashdisk.jffs2 -t \ - Trailer -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flashdisk.img \ - ${NSLU2_SLUGIMAGE_ARGS} - rm -rf ${DEPLOY_DIR_IMAGE}/slug - fi -} - -IMAGE_POSTPROCESS_COMMAND += "nslu2_pack_image;" - -DEPENDS = "${@['', 'slugimage-native nslu2-linksys-firmware'][bb.data.getVar('SLUGOS_FLASH_IMAGE', d, 1) == 'yes']} virtual/kernel virtual/ixp-eth" - -IMAGE_LINGUAS = "" -# Setting USE_DEVFS prevents *any* entries being created initially -# in /dev -USE_DEVFS = "1" +# These depends define native utilities - they do not get put in the flash and +# are not required to build the image. +IMAGE_TOOLS = "" +EXTRA_IMAGEDEPENDS += "${IMAGE_TOOLS}" # CONFIG: # SLUGOS_EXTRA_RDEPENDS: set in conf, things to add to the image @@ -114,6 +86,43 @@ inherit image_ipk python () { # Don't build slugos images unless the configuration is set up # for an image build! - if bb.data.getVar("SLUGOS_IMAGENAME", d, 1) == '': + if bb.data.getVar("SLUGOS_IMAGENAME", d, 1) == '' or bb.data.getVar("SLUGOS_IMAGESEX", d, 1) == '': raise bb.parse.SkipPackage("absent or broken SlugOS configuration") } + +#-------------------------------------------------------------------------------- +# NSLU2 specific +# +#NOTE: you do not actually need the boot loader in normal use because it is +# *not* overwritten by a standard upslug upgrade, so you can make an image with +# just non-LinkSys software which can be flashed into the NSLU2. Because +# LinkSys have made "EraseAll" available, however, (this does overwrite RedBoot) +# it is a bad idea to produce flash images without a valid RedBoot - that allows +# an innocent user upgrade attempt to instantly brick the NSLU2. +PACK_IMAGE_nslu2 = "nslu2_pack_image;" +PACK_IMAGE_DEPENDS_nslu2 = "${@['', 'slugimage-native nslu2-linksys-firmware'][bb.data.getVar('SLUGOS_FLASH_IMAGE', d, 1) == 'yes']}" + +NSLU2_SLUGIMAGE_ARGS ?= "" + +nslu2_pack_image() { + if test '${SLUGOS_FLASH_IMAGE}' = yes + then + install -d ${DEPLOY_DIR_IMAGE}/slug + install -m 0644 ${STAGING_LIBDIR}/nslu2-binaries/RedBoot \ + ${STAGING_LIBDIR}/nslu2-binaries/Trailer \ + ${STAGING_LIBDIR}/nslu2-binaries/SysConf \ + ${DEPLOY_DIR_IMAGE}/slug/ + install -m 0644 ${DEPLOY_DIR_IMAGE}/zImage-${IXP4XX_SUFFIX} \ + ${DEPLOY_DIR_IMAGE}/slug/vmlinuz + install -m 0644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \ + ${DEPLOY_DIR_IMAGE}/slug/flashdisk.jffs2 + cd ${DEPLOY_DIR_IMAGE}/slug + slugimage -p -b RedBoot -s SysConf -r Ramdisk:1,Flashdisk:flashdisk.jffs2 -t \ + Trailer -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.flashdisk.img \ + ${NSLU2_SLUGIMAGE_ARGS} + rm -rf ${DEPLOY_DIR_IMAGE}/slug + fi +} + +# upslug2 (in tmp/work/upslug2-native-*) is the program to write the NSLU2 flash +IMAGE_TOOLS_nslu2 = "upslug2-native" |