diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2006-01-16 09:53:12 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-01-16 09:53:12 +0000 |
commit | f2cfb2628d56ad31d4fe97a08b1012c252109b90 (patch) | |
tree | 6a7f8709276df3782879b3b0f02ed6a1699c4882 | |
parent | 6d6f449a77592d066856c916b660cd52c54f5147 (diff) | |
parent | f99c03dff8ea114ab0bfe297a391a0fa90aa9922 (diff) |
merge of 5ea9ec229c4d406638d5639fade5d53798bc6556
and bc3350438c52d7c9d7d4f8eb5b38a213796269cb
-rw-r--r-- | conf/distro/preferred-gpe-versions-2.7.inc | 30 | ||||
-rw-r--r-- | conf/distro/slugos.conf | 8 | ||||
-rw-r--r-- | conf/machine/include/ixp4xx.conf | 4 | ||||
-rw-r--r-- | conf/machine/nas100d.conf | 5 | ||||
-rw-r--r-- | conf/machine/nslu2.conf | 6 | ||||
-rw-r--r-- | packages/gtk-webcore/files/KWIQ-mimetype-segfault.patch | 14 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel.inc | 121 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel/2.6.15/11-mtdpart-redboot-config-byteswap.patch | 74 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch | 253 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch | 184 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel/2.6.15/93-loft-maclist.patch | 96 | ||||
-rw-r--r-- | packages/linux/ixp4xx-kernel_2.6.15.bb | 5 | ||||
-rw-r--r-- | packages/meta/slugos-image.bb | 9 | ||||
-rw-r--r-- | packages/meta/slugos-imagename.bb | 1 |
14 files changed, 646 insertions, 164 deletions
diff --git a/conf/distro/preferred-gpe-versions-2.7.inc b/conf/distro/preferred-gpe-versions-2.7.inc index 59567312ad..5165078c40 100644 --- a/conf/distro/preferred-gpe-versions-2.7.inc +++ b/conf/distro/preferred-gpe-versions-2.7.inc @@ -10,29 +10,29 @@ PREFERRED_PROVIDER_gconf=gconf-dbus PREFERRED_PROVIDER_gnome-vfs=gnome-vfs-dbus #specify versions, as the header says :) -PREFERRED_VERSION_libmatchbox ?= "1.7" -PREFERRED_VERSION_matchbox ?= "0.9.1" +#PREFERRED_VERSION_libmatchbox ?= "1.7" +#PREFERRED_VERSION_matchbox ?= "0.9.1" PREFERRED_VERSION_matchbox-common ?= "0.9.1" PREFERRED_VERSION_matchbox-desktop ?= "0.9.1" PREFERRED_VERSION_matchbox-wm ?= "0.9.5+cvs${SRCDATE}" PREFERRED_VERSION_matchbox-panel ?= "0.9.2" PREFERRED_VERSION_matchbox-applet-inputmanager ?= "0.6" -PREFERRED_VERSION_atk ?= "1.9.0" -PREFERRED_VERSION_cairo ?= "0.5.2" -PREFERRED_VERSION_glib-2.0 ?= "2.6.4" -PREFERRED_VERSION_gtk+ ?= "2.6.7" -PREFERRED_VERSION_pango ?= "1.8.1" -PREFERRED_VERSION_librsvg ?= "2.6.5" -PREFERRED_VERSION_libgpewidget ?= "0.105" -PREFERRED_VERSION_libgpepimc ?= "0.5" -PREFERRED_VERSION_libgpevtype ?= "0.14" -PREFERRED_VERSION_libschedule ?= "0.15" -PREFERRED_VERSION_gpe-icons ?= "0.25" +#PREFERRED_VERSION_atk ?= "1.9.0" +#PREFERRED_VERSION_cairo ?= "0.5.2" +#PREFERRED_VERSION_glib-2.0 ?= "2.6.4" +#PREFERRED_VERSION_gtk+ ?= "2.6.7" +#PREFERRED_VERSION_pango ?= "1.8.1" +#PREFERRED_VERSION_librsvg ?= "2.6.5" +#PREFERRED_VERSION_libgpewidget ?= "0.107" +#PREFERRED_VERSION_libgpepimc ?= "0.5" +#PREFERRED_VERSION_libgpevtype ?= "0.14" +#PREFERRED_VERSION_libschedule ?= "0.15" +#PREFERRED_VERSION_gpe-icons ?= "0.25" PREFERRED_VERSION_libgsm ?= "1.0.10" PREFERRED_VERSION_diet-x11 ?= "6.2.1" PREFERRED_VERSION_xproto ?= "6.6.2" PREFERRED_VERSION_xcursor-transparent-theme ?= "0.1.1" -PREFERRED_VERSION_rxvt-unicode ?= "5.6" +#PREFERRED_VERSION_rxvt-unicode ?= "5.6" PREFERRED_VERSION_gtk2-theme-angelistic ?= "0.3" PREFERRED_VERSION_xst ?= "0.15" PREFERRED_VERSION_xextensions ?= "1.0.1" @@ -91,4 +91,4 @@ PREFERRED_VERSION_firefox ?= "1.0" PREFERRED_VERSION_gaim ?= "2.0.0+cvs20050904-mco1" PREFERRED_VERSION_poppler ?= "0.3.3" PREFERRED_VERSION_evince ?= "0.3.2" -PREFERRED_VERSION_gpe_mini_browser ?= "0.18" +PREFERRED_VERSION_gpe_mini_browser ?= "0.19" diff --git a/conf/distro/slugos.conf b/conf/distro/slugos.conf index 61e4d32d5f..58e2ab65c7 100644 --- a/conf/distro/slugos.conf +++ b/conf/distro/slugos.conf @@ -139,11 +139,15 @@ SLUGOS_EXTRA_RDEPENDS ?= "" #---------------------------------------------------------------------------------- # PACKAGE VERSION CONTROL #---------------------------------------------------------------------------------- -# Select the correct versions of the compiler tools (note that there -# is also some selection in machine/${MACHINE}.conf) +# Define how to bootstrap the system - we need cross compilers. It is also +# necessary to define which gets generated first, glibc or the kernel, and +# this is done by selecting the provider of libc (in this case it needs the +# kernel, so there has to be a non-libc gcc to build the kernel!) PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}gcc-initial:gcc-cross-initial" PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}gcc:gcc-cross" PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}g++:gcc-cross" +PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}libc-for-gcc:glibc" +# Select 2.6 versions of the depmod support PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}depmod:module-init-tools-cross" PREFERRED_PROVIDERS += "virtual/${TARGET_PREFIX}libc-for-gcc:glibc" diff --git a/conf/machine/include/ixp4xx.conf b/conf/machine/include/ixp4xx.conf index 19a2ee0141..7239d59076 100644 --- a/conf/machine/include/ixp4xx.conf +++ b/conf/machine/include/ixp4xx.conf @@ -172,7 +172,3 @@ PREFERRED_VERSION_ipkg-native ?= "0.99.154" SERIAL_CONSOLE = "115200 ttyS0" KERNEL_CONSOLE = "ttyS0,115200n8" USE_VT = "0" - -# Always add the LEFIXUP - if desired this can be removed for a specific board -# if that board has an LE boot loader and therefore does not require it. -IXP4XX_LEFIXUP = "1" diff --git a/conf/machine/nas100d.conf b/conf/machine/nas100d.conf index a628841878..41836c3272 100644 --- a/conf/machine/nas100d.conf +++ b/conf/machine/nas100d.conf @@ -4,8 +4,5 @@ include conf/machine/include/ixp4xx.conf -# The correct settings for the NAS100D board: +# TEMPORARY: fixup the command line for nas100d builds CMDLINE_ROOT = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M@0x00000000 init=/linuxrc" -# This following means the kernel will only run on a NAS100D board: -IXP4XX_SUFFIX = "${MACHINE}${ARCH_BYTE_SEX}" -IXP4XX_MACHID = "865" diff --git a/conf/machine/nslu2.conf b/conf/machine/nslu2.conf index 96b9e37ce0..b00f8a520c 100644 --- a/conf/machine/nslu2.conf +++ b/conf/machine/nslu2.conf @@ -3,9 +3,3 @@ #@DESCRIPTION: Machine configuration for the Linksys NSLU2 product include conf/machine/include/ixp4xx.conf - -# The correct settings for the NSLU2 board: -CMDLINE_ROOT = "root=/dev/mtdblock4 rw rootfstype=jffs2 mem=32M@0x00000000 init=/linuxrc" -IXP4XX_SUFFIX = "${MACHINE}${ARCH_BYTE_SEX}" -# This following means the kernel will only run on a NSLU2: -IXP4XX_MACHID = "597" diff --git a/packages/gtk-webcore/files/KWIQ-mimetype-segfault.patch b/packages/gtk-webcore/files/KWIQ-mimetype-segfault.patch new file mode 100644 index 0000000000..feee33c8fe --- /dev/null +++ b/packages/gtk-webcore/files/KWIQ-mimetype-segfault.patch @@ -0,0 +1,14 @@ +--- NRCore/kwiq/KWQLoader.cpp.orig 2006-01-10 19:20:34.000000000 +0200 ++++ NRCore/kwiq/KWQLoader.cpp 2006-01-10 19:20:50.000000000 +0200 +@@ -292,7 +292,10 @@ + QString KWQResponseMIMEType(KWIQResponse *r) + { + ASSERT(r); +- return r->mimeType(); ++ if (!r) ++ return 0; ++ else ++ return r->mimeType(); + } + + QString KWQResponseHeaderString(KWIQResponse *r) diff --git a/packages/linux/ixp4xx-kernel.inc b/packages/linux/ixp4xx-kernel.inc index 452c8c956b..0f3717c7d3 100644 --- a/packages/linux/ixp4xx-kernel.inc +++ b/packages/linux/ixp4xx-kernel.inc @@ -9,20 +9,6 @@ # # 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 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: @@ -41,10 +27,6 @@ DESCRIPTION = "Linux kernel for the Intel IXP4xx device" LICENSE = "GPL" MAINTAINER = "NSLU2-Linux <www.nslu2-linux.org>" -# 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 # parts) is a sub-version and 'patch' is something like 'mm' or @@ -169,12 +151,6 @@ COMPATIBLE_HOST = 'arm.*-linux' inherit kernel -# PACKAGE_ARCH must reliably identify what machines this kernel -# will run on -PACKAGE_ARCH_kernel-image = "${IXP4XX_SUFFIX}" -PACKAGE_ARCH_kernel-dev = "${IXP4XX_SUFFIX}" -PACKAGE_ARCH_kernel = "${IXP4XX_SUFFIX}" - ARCH = "arm" KERNEL_IMAGETYPE = "zImage" @@ -188,7 +164,7 @@ KERNEL_IMAGETYPE = "zImage" # CMDLINE_KERNEL_OPTIONS: overridable in local.conf # 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-x1205.probe=0,0x6f rtc-x1205.hctosys=1" MACH_KERNEL_OPTIONS += "rtc-ds1672.probe=0,0x68 rtc-ds1672.hctosys=1" MACH_KERNEL_OPTIONS += "pcf8563.hctosys=1" # @@ -196,7 +172,9 @@ CMDLINE_KERNEL_OPTIONS ?= "${MACH_KERNEL_OPTIONS}" # CMDLINE_ROOT: machine specific boot options - should not be set on a # generic kernel! -CMDLINE_ROOT ?= "" +#FIXME: this is to make NSLU2 work (temporary!) +CMDLINE_ROOT ?= "root=/dev/mtdblock4 rootfstype=jffs2 init=/linuxrc mem=32M" +#CMDLINE_ROOT ?= "mem=32M" # CMDLINE_DEBUG: debug options such as noirqdebug, defaults to empty # override in local.conf etc @@ -246,7 +224,7 @@ do_configure_prepend() { ${S}/include/asm-arm/.proc ${S}/include/asm-arm/.arch } -# IXP4XX_MACHID and IXP4XX_LEFIXUP handling +# MACHID and LE 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 @@ -272,38 +250,99 @@ do_configure_prepend() { # # The argument to the function is the destination directory -#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]}' +# The generic package only includes the generic image, the other +# packages are made below (they are kernel-image packages but +# with a different ARCH). +FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}-${IXP4XX_SUFFIX}-${KERNEL_RELEASE}" -#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]}' +# MACHINE DEFINITIONS: one block for each machine + +# The correct settings for the NSLU2 board: +nslu2_CMDLINE_ROOT = "root=/dev/mtdblock4 rw rootfstype=jffs2 mem=32M init=/linuxrc" +nslu2_MACHID = "597" +PACKAGES += "kernel-image-nslu2" +PKG_kernel-image-nslu2 = "kernel-image-${KERNEL_VERSION}" +PACKAGE_ARCH_kernel-image-nslu2 = "nslu2${ARCH_BYTE_SEX}" +DESCRIPTION_kernel-image-nas100d = "Linux kernel for the LinkSys NSLU2" +FILES_kernel-image-nslu2 = "/boot/${KERNEL_IMAGETYPE}-nslu2${ARCH_BYTE_SEX}-${KERNEL_RELEASE}" -#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]}' +# The correct settings for Loft: +loft_CMDLINE_ROOT = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M init=/linuxrc" +loft_MACHID = "849" +PACKAGES += "kernel-image-loft" +PKG_kernel-image-loft = "kernel-image-${KERNEL_VERSION}" +PACKAGE_ARCH_kernel-image-loft = "loft${ARCH_BYTE_SEX}" +DESCRIPTION_kernel-image-loft = "Linux kernel for the Giant Shoulder Inc. Loft board" +FILES_kernel-image-loft = "/boot/${KERNEL_IMAGETYPE}-loft${ARCH_BYTE_SEX}-${KERNEL_RELEASE}" + +# The correct settings for the NAS100D board: +nas100d_CMDLINE_ROOT = "root=/dev/mtdblock2 rw rootfstype=jffs2 mem=64M init=/linuxrc" +nas100d_MACHID = "865" +PACKAGES += "kernel-image-nas100d" +PKG_kernel-image-nas100d = "kernel-image-${KERNEL_VERSION}" +PACKAGE_ARCH_kernel-image-nas100d = "nas100d${ARCH_BYTE_SEX}" +DESCRIPTION_kernel-image-nas100d = "Linux kernel for the IOMega NAS100D" +FILES_kernel-image-nas100d = "/boot/${KERNEL_IMAGETYPE}-nas100d${ARCH_BYTE_SEX}-${KERNEL_RELEASE}" + +#FIXUP: the correct instructions to copy the kernel prepended with the le fixup +#FIXME: do a fixup for BE too... +FIXUP_armeb = "cp$" +FIXUP_arm = "wb 0xee110f10,4;wb 0xe3c00080,4;wb 0xee010f10,4;xp $,4" 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 <dest> <cmdline> <machine-id> +# copy the zImage and append the appropriate shim +# dest: where to copy to +# cmdline: command line to pass to image +# machine-id: decimal machine id to prepend, empty for none copy_image() { + local cmdline setmach + + cmdline="" + test -n "$2" && cmdline="$2"' ${CMDLINE_KERNEL_OPTIONS} ${CMDLINE_DEBUG} ${CMDLINE_CONSOLE}' + + setmach="" + test -n "$3" && setmach="wb $3 . 256/ 255& 0xe3a01c00+, 4; wb 255& 0xe3811000+, 4;" + rm -f "$1".new - devio '<<arch/${ARCH}/boot/${KERNEL_IMAGETYPE}' >"$1".new '${SETMACH}${FIXUP}' || { - echo 'ERROR: arch/${ARCH}/boot/${KERNEL_IMAGETYPE}: failed to copy zImage' >&2 + devio '<<${KERNEL_OUTPUT}' >"$1".new "$setmach"'${FIXUP}' || { + echo 'ERROR: ${KERNEL_OUTPUT}: failed to copy zImage' >&2 return 1 } mv "$1".new "$1" } +install_image() { + copy_image '${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-'"$1"'-${KERNEL_RELEASE}' "$2" "$3" +} + do_install_append() { - copy_image '${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE}' + # Overwrite the unshimmed generic image with a shimmed one (but without + # any command line or machine id override). + rm -f '${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_RELEASE}' + install_image '${IXP4XX_SUFFIX}' + + # Add the machine specific images, with appropriate suffixes + install_image 'nslu2${ARCH_BYTE_SEX}' '${nslu2_CMDLINE_ROOT}' '${nslu2_MACHID}' + install_image 'loft${ARCH_BYTE_SEX}' '${loft_CMDLINE_ROOT}' '${loft_MACHID}' + install_image 'nas100d${ARCH_BYTE_SEX}' '${nas100d_CMDLINE_ROOT}' '${nas100d_MACHID}' } do_deploy[dirs] = "${S}" + +deploy_image() { + copy_image '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-'"$1" "$2" "$3" +} + do_deploy() { install -d ${DEPLOY_DIR}/images - copy_image '${DEPLOY_DIR}/images/${KERNEL_IMAGETYPE}-${IXP4XX_SUFFIX}' + deploy_image '${IXP4XX_SUFFIX}' + + # And the machine specific images + deploy_image 'nslu2${ARCH_BYTE_SEX}' '${nslu2_CMDLINE_ROOT}' '${nslu2_MACHID}' + deploy_image 'loft${ARCH_BYTE_SEX}' '${loft_CMDLINE_ROOT}' '${loft_MACHID}' + deploy_image 'nas100d${ARCH_BYTE_SEX}' '${nas100d_CMDLINE_ROOT}' '${nas100d_MACHID}' } addtask deploy before do_build after do_compile diff --git a/packages/linux/ixp4xx-kernel/2.6.15/11-mtdpart-redboot-config-byteswap.patch b/packages/linux/ixp4xx-kernel/2.6.15/11-mtdpart-redboot-config-byteswap.patch new file mode 100644 index 0000000000..e258567462 --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.15/11-mtdpart-redboot-config-byteswap.patch @@ -0,0 +1,74 @@ +A more robust test for swapped RedBoot FIS directory partitions. This +changes the test to check the flash_base value for the FIS directory, +since we know where the FIS directory base is we can work out whether +the flash address stored in the directory itself is byte swapped under +most circumstances. If the value is 0 the directory is at the start +of the flash and the test fails. In this case the fallback is to use +the original test made slightly more robust. + +Signed-off-by: John Bowler <jbowler@acm.org> + +--- linux-2.6.15/drivers/mtd/redboot.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/drivers/mtd/redboot.c 1970-01-01 00:00:00.000000000 +0000 +@@ -91,14 +91,41 @@ static int parse_redboot_partitions(stru + } + if (!memcmp(buf[i].name, "FIS directory", 14)) { + /* This is apparently the FIS directory entry for the +- * FIS directory itself. The FIS directory size is +- * one erase block; if the buf[i].size field is +- * swab32(erasesize) then we know we are looking at +- * a byte swapped FIS directory - swap all the entries! +- * (NOTE: this is 'size' not 'data_length'; size is +- * the full size of the entry.) ++ * FIS directory itself. To discover whether the entries ++ * in this are native byte sex or byte swapped look at ++ * the flash_base field - we know the FIS directory is ++ * at 'offset' within the flash. + */ +- if (swab32(buf[i].size) == master->erasesize) { ++ int maybe_native, maybe_swapped; ++ if (fis_origin != 0) { ++ maybe_native = ++ buf[i].flash_base == fis_origin + offset; ++ maybe_swapped = ++ swab32(buf[i].flash_base) == fis_origin + offset; ++ } else if (offset != 0 || buf[i].flash_base != 0) { ++ maybe_native = ++ (buf[i].flash_base & (master->size-1)) == offset; ++ maybe_swapped = ++ (swab32(buf[i].flash_base) & (master->size-1)) == offset; ++ } else { ++ /* The FIS directory is at the start of the flash and ++ * the 'flash_base' field is 0. The critical case is when ++ * we are booting off this flash, but then we don't expect ++ * this because the boot loader is pretty much always at ++ * the start! Since the FIS directory is always less than ++ * or equal to one erase block do the following: ++ */ ++ maybe_native = buf[i].size <= master->erasesize; ++ maybe_swapped = swab32(buf[i].size) <= master->erasesize; ++ } ++ ++ if (maybe_native && maybe_swapped) ++ printk(KERN_WARNING "RedBoot directory 0x%lx(0x%lx) assumed native\n", ++ buf[i].flash_base, buf[i].size); ++ else if (!maybe_native && !maybe_swapped) ++ printk(KERN_ERR "RedBoot directory 0x%lx(0x%lx) forced native\n", ++ buf[i].flash_base, buf[i].size); ++ else if (maybe_swapped) { + int j; + for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) { + /* The unsigned long fields were written with the +@@ -112,7 +139,11 @@ static int parse_redboot_partitions(stru + swab32s(&buf[j].desc_cksum); + swab32s(&buf[j].file_cksum); + } +- } ++ printk(KERN_NOTICE "RedBoot directory 0x%lx(0x%lx) swapped\n", ++ buf[i].flash_base, buf[i].size); ++ } else ++ printk(KERN_NOTICE "RedBoot directory 0x%lx(0x%lx) native\n", ++ buf[i].flash_base, buf[i].size); + break; + } + } diff --git a/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch b/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch index 8e0380bfe5..e10998f8d2 100644 --- a/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch +++ b/packages/linux/ixp4xx-kernel/2.6.15/40-rtc-class.patch @@ -1,5 +1,5 @@ ---- linux-nslu2.orig/include/linux/rtc.h 2006-01-03 15:31:18.000000000 +0100 -+++ linux-nslu2/include/linux/rtc.h 2006-01-03 15:34:24.000000000 +0100 +--- linux-nslu2.orig/include/linux/rtc.h 2006-01-08 18:54:58.000000000 +0100 ++++ linux-nslu2/include/linux/rtc.h 2006-01-08 18:55:19.000000000 +0100 @@ -91,8 +91,81 @@ struct rtc_pll_info { #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ @@ -38,8 +38,8 @@ +{ + int id; + struct module *owner; -+ struct rw_semaphore lock; + struct class_device class_dev; ++ struct semaphore ops_lock; + struct rtc_class_ops *ops; + char name[RTC_DEVICE_NAME_SIZE]; + @@ -82,8 +82,8 @@ typedef struct rtc_task { void (*func)(void *private_data); void *private_data; ---- linux-nslu2.orig/drivers/Kconfig 2006-01-03 15:31:19.000000000 +0100 -+++ linux-nslu2/drivers/Kconfig 2006-01-04 01:27:31.000000000 +0100 +--- linux-nslu2.orig/drivers/Kconfig 2006-01-08 18:54:58.000000000 +0100 ++++ linux-nslu2/drivers/Kconfig 2006-01-08 18:55:19.000000000 +0100 @@ -66,4 +66,6 @@ source "drivers/infiniband/Kconfig" source "drivers/sn/Kconfig" @@ -91,8 +91,8 @@ +source "drivers/rtc/Kconfig" + endmenu ---- linux-nslu2.orig/drivers/Makefile 2006-01-03 15:33:32.000000000 +0100 -+++ linux-nslu2/drivers/Makefile 2006-01-04 01:27:31.000000000 +0100 +--- linux-nslu2.orig/drivers/Makefile 2006-01-08 18:54:58.000000000 +0100 ++++ linux-nslu2/drivers/Makefile 2006-01-08 18:55:19.000000000 +0100 @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_GADGET) += usb/gadget/ obj-$(CONFIG_GAMEPORT) += input/gameport/ obj-$(CONFIG_INPUT) += input/ @@ -102,8 +102,8 @@ obj-$(CONFIG_W1) += w1/ obj-$(CONFIG_HWMON) += hwmon/ --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/class.c 2006-01-03 15:45:19.000000000 +0100 -@@ -0,0 +1,141 @@ ++++ linux-nslu2/drivers/rtc/class.c 2006-01-08 18:55:19.000000000 +0100 +@@ -0,0 +1,143 @@ +/* + * RTC subsystem, base class + * @@ -178,7 +178,7 @@ + rtc->class_dev.class = rtc_class; + rtc->class_dev.release = rtc_device_release; + -+ init_rwsem(&rtc->lock); ++ init_MUTEX(&rtc->ops_lock); + spin_lock_init(&rtc->irq_lock); + spin_lock_init(&rtc->irq_task_lock); + @@ -212,7 +212,9 @@ + */ +void rtc_device_unregister(struct rtc_device *rtc) +{ -+ down_write(&rtc->lock); ++ down(&rtc->ops_lock); ++ rtc->ops = NULL; ++ up(&rtc->ops_lock); + class_device_unregister(&rtc->class_dev); +} +EXPORT_SYMBOL_GPL(rtc_device_unregister); @@ -246,7 +248,7 @@ +MODULE_DESCRIPTION("RTC class support"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Kconfig 2006-01-04 01:27:21.000000000 +0100 ++++ linux-nslu2/drivers/rtc/Kconfig 2006-01-09 04:17:02.000000000 +0100 @@ -0,0 +1,93 @@ +# +# RTC class/drivers configuration @@ -342,7 +344,7 @@ + +endmenu --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/Makefile 2006-01-04 01:27:21.000000000 +0100 ++++ linux-nslu2/drivers/rtc/Makefile 2006-01-09 04:17:02.000000000 +0100 @@ -0,0 +1,15 @@ +# +# Makefile for RTC class/drivers. @@ -360,8 +362,8 @@ +obj-$(CONFIG_RTC_DRV_DS1672) += rtc-ds1672.o + --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/interface.c 2006-01-03 15:34:24.000000000 +0100 -@@ -0,0 +1,189 @@ ++++ linux-nslu2/drivers/rtc/interface.c 2006-01-09 03:39:33.000000000 +0100 +@@ -0,0 +1,232 @@ +/* + * RTC subsystem, interface functions + * @@ -381,13 +383,22 @@ + +int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm) +{ -+ int err = -EINVAL; -+ struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops; ++ int err; ++ struct rtc_device *rtc = to_rtc_device(class_dev); ++ ++ if ((err = down_interruptible(&rtc->ops_lock))) ++ return err; + -+ if (ops->read_time) { ++ if (!rtc->ops) ++ err = -ENODEV; ++ else if (!rtc->ops->read_time) ++ err = -EINVAL; ++ else { + memset(tm, 0, sizeof(struct rtc_time)); -+ err = ops->read_time(class_dev->dev, tm); ++ err = rtc->ops->read_time(class_dev->dev, tm); + } ++ ++ up(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_read_time); @@ -395,36 +406,64 @@ +int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm) +{ + int err; -+ struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops; ++ struct rtc_device *rtc = to_rtc_device(class_dev); + -+ err = rtc_valid_tm(tm); -+ if (err == 0 && ops->set_time) -+ err = ops->set_time(class_dev->dev, tm); ++ if ((err = rtc_valid_tm(tm)) != 0) ++ return err; ++ ++ if ((err = down_interruptible(&rtc->ops_lock))) ++ return err; + ++ if (!rtc->ops) ++ err = -ENODEV; ++ else if (!rtc->ops->set_time) ++ err = -EINVAL; ++ else ++ err = rtc->ops->set_time(class_dev->dev, tm); ++ ++ up(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_set_time); + +int rtc_read_alarm(struct class_device *class_dev, struct rtc_wkalrm *alarm) +{ -+ struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops; -+ int err = -EINVAL; ++ int err; ++ struct rtc_device *rtc = to_rtc_device(class_dev); ++ ++ if ((err = down_interruptible(&rtc->ops_lock))) ++ return err; + -+ if (ops->read_alarm) { ++ if (rtc->ops == NULL) ++ err = -ENODEV; ++ else if (!rtc->ops->read_alarm) ++ err = -EINVAL; ++ else { + memset(alarm, 0, sizeof(struct rtc_wkalrm)); -+ err = ops->read_alarm(class_dev->dev, alarm); ++ err = rtc->ops->read_alarm(class_dev->dev, alarm); + } ++ ++ up(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_read_alarm); + +int rtc_set_alarm(struct class_device *class_dev, struct rtc_wkalrm *alarm) +{ -+ int err = -EINVAL; -+ struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops; ++ int err; ++ struct rtc_device *rtc = to_rtc_device(class_dev); + -+ if (ops->set_alarm) -+ err = ops->set_alarm(class_dev->dev, alarm); ++ if ((err = down_interruptible(&rtc->ops_lock))) ++ return err; ++ ++ if (!rtc->ops) ++ err = -ENODEV; ++ else if (!rtc->ops->set_alarm) ++ err = -EINVAL; ++ else ++ err = rtc->ops->set_alarm(class_dev->dev, alarm); ++ ++ up(&rtc->ops_lock); + return err; +} +EXPORT_SYMBOL(rtc_set_alarm); @@ -460,6 +499,11 @@ + break; + } + } ++ ++ if (class_dev) { ++ if (!try_module_get(to_rtc_device(class_dev)->owner)) ++ class_dev = NULL; ++ } + up(&rtc_class->sem); + + return class_dev; @@ -468,6 +512,7 @@ + +void rtc_close(struct class_device *class_dev) +{ ++ module_put(to_rtc_device(class_dev)->owner); +} +EXPORT_SYMBOL(rtc_close); + @@ -552,7 +597,7 @@ + +} --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/utils.c 2006-01-03 15:34:24.000000000 +0100 ++++ linux-nslu2/drivers/rtc/utils.c 2006-01-08 18:55:19.000000000 +0100 @@ -0,0 +1,97 @@ +/* + * RTC subsystem, utility functions @@ -651,8 +696,8 @@ + return 0; +} +EXPORT_SYMBOL(rtc_tm_to_time); ---- linux-nslu2.orig/arch/arm/Kconfig 2006-01-04 01:27:04.000000000 +0100 -+++ linux-nslu2/arch/arm/Kconfig 2006-01-04 01:27:31.000000000 +0100 +--- linux-nslu2.orig/arch/arm/Kconfig 2006-01-09 03:36:04.000000000 +0100 ++++ linux-nslu2/arch/arm/Kconfig 2006-01-09 03:39:50.000000000 +0100 @@ -748,6 +748,8 @@ source "drivers/usb/Kconfig" source "drivers/mmc/Kconfig" @@ -662,8 +707,8 @@ endmenu source "fs/Kconfig" ---- linux-nslu2.orig/arch/arm/common/rtctime.c 2006-01-04 01:27:04.000000000 +0100 -+++ linux-nslu2/arch/arm/common/rtctime.c 2006-01-04 01:27:09.000000000 +0100 +--- linux-nslu2.orig/arch/arm/common/rtctime.c 2006-01-09 03:36:04.000000000 +0100 ++++ linux-nslu2/arch/arm/common/rtctime.c 2006-01-09 03:39:50.000000000 +0100 @@ -40,89 +40,6 @@ static struct rtc_ops *rtc_ops; #define rtc_epoch 1900UL @@ -852,8 +897,8 @@ p += sprintf(p, "alrm_time\t: "); if ((unsigned int)alrm.time.tm_hour <= 24) p += sprintf(p, "%02d:", alrm.time.tm_hour); ---- linux-nslu2.orig/include/asm-arm/rtc.h 2006-01-04 01:27:04.000000000 +0100 -+++ linux-nslu2/include/asm-arm/rtc.h 2006-01-04 01:27:09.000000000 +0100 +--- linux-nslu2.orig/include/asm-arm/rtc.h 2006-01-09 03:36:04.000000000 +0100 ++++ linux-nslu2/include/asm-arm/rtc.h 2006-01-09 03:39:50.000000000 +0100 @@ -25,9 +25,6 @@ struct rtc_ops { int (*proc)(char *buf); }; @@ -865,8 +910,8 @@ void rtc_update(unsigned long, unsigned long); int register_rtc(struct rtc_ops *); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-sysfs.c 2006-01-04 01:27:12.000000000 +0100 -@@ -0,0 +1,125 @@ ++++ linux-nslu2/drivers/rtc/rtc-sysfs.c 2006-01-09 03:39:50.000000000 +0100 +@@ -0,0 +1,128 @@ +/* + * RTC subsystem, sysfs interface + * @@ -891,58 +936,61 @@ + +static ssize_t rtc_sysfs_show_date(struct class_device *dev, char *buf) +{ -+ ssize_t retval = 0; ++ ssize_t retval = -ENODEV; + struct rtc_device *rtc = to_rtc_device(dev); + struct rtc_time tm; + -+ if (down_read_trylock(&rtc->lock) == 0) -+ return -ENODEV; ++ if ((retval = down_interruptible(&rtc->ops_lock))) ++ return retval; + -+ if (rtc_read_time(dev, &tm) == 0) { ++ if (rtc->ops && ((retval = rtc_read_time(dev, &tm)) == 0)) { + retval = sprintf(buf, "%04d-%02d-%02d\n", + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday); + } + -+ up_read(&rtc->lock); ++ up(&rtc->ops_lock); ++ + return retval; +} +static CLASS_DEVICE_ATTR(date, S_IRUGO, rtc_sysfs_show_date, NULL); + +static ssize_t rtc_sysfs_show_time(struct class_device *dev, char *buf) +{ -+ ssize_t retval = 0; ++ ssize_t retval = -ENODEV; + struct rtc_device *rtc = to_rtc_device(dev); + struct rtc_time tm; + -+ if (down_read_trylock(&rtc->lock) == 0) -+ return -ENODEV; ++ if ((retval = down_interruptible(&rtc->ops_lock))) ++ return retval; + -+ if (rtc_read_time(dev, &tm) == 0) { ++ if (rtc->ops && ((retval = rtc_read_time(dev, &tm)) == 0)) { + retval = sprintf(buf, "%02d:%02d:%02d\n", + tm.tm_hour, tm.tm_min, tm.tm_sec); + } + -+ up_read(&rtc->lock); ++ up(&rtc->ops_lock); ++ + return retval; +} +static CLASS_DEVICE_ATTR(time, S_IRUGO, rtc_sysfs_show_time, NULL); + +static ssize_t rtc_sysfs_show_since_epoch(struct class_device *dev, char *buf) +{ -+ ssize_t retval = 0; ++ ssize_t retval = -ENODEV; + struct rtc_device *rtc = to_rtc_device(dev); + struct rtc_time tm; + -+ if (down_read_trylock(&rtc->lock) == 0) -+ return -ENODEV; ++ if ((retval = down_interruptible(&rtc->ops_lock))) ++ return retval; + -+ if (rtc_read_time(dev, &tm) == 0) { ++ if (rtc->ops && ((retval = rtc_read_time(dev, &tm)) == 0)) { + unsigned long time; + rtc_tm_to_time(&tm, &time); + retval = sprintf(buf, "%lu\n", time); + } + -+ up_read(&rtc->lock); ++ up(&rtc->ops_lock); ++ + return retval; +} +static CLASS_DEVICE_ATTR(since_epoch, S_IRUGO, rtc_sysfs_show_since_epoch, NULL); @@ -993,7 +1041,7 @@ +MODULE_DESCRIPTION("RTC class sysfs interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-proc.c 2006-01-04 01:27:14.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-proc.c 2006-01-09 03:39:50.000000000 +0100 @@ -0,0 +1,158 @@ +/* + * RTC subsystem, proc interface @@ -1154,7 +1202,7 @@ +MODULE_DESCRIPTION("RTC class proc interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-dev.c 2006-01-04 01:27:15.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-dev.c 2006-01-09 04:00:16.000000000 +0100 @@ -0,0 +1,372 @@ +/* + * RTC subsystem, dev interface @@ -1529,7 +1577,7 @@ +MODULE_DESCRIPTION("RTC class dev interface"); +MODULE_LICENSE("GPL"); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-x1205.c 2006-01-04 01:27:17.000000000 +0100 ++++ linux-nslu2/drivers/rtc/rtc-x1205.c 2006-01-09 04:17:02.000000000 +0100 @@ -0,0 +1,725 @@ +/* + * An i2c driver for the Xicor/Intersil X1205 RTC @@ -1906,7 +1954,7 @@ + do_settimeofday(&tv); + + dev_info(&client->dev, -+ "setting the system clock to %d-%d-%d %d:%d:%d\n", ++ "setting the system clock to %02d-%02d-%d %02d:%02d:%02d\n", + tm.tm_year + 1900, tm.tm_mon + 1, + tm.tm_mday, tm.tm_hour, tm.tm_min, + tm.tm_sec); @@ -2257,8 +2305,8 @@ +module_init(x1205_init); +module_exit(x1205_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-test.c 2006-01-04 01:27:19.000000000 +0100 -@@ -0,0 +1,189 @@ ++++ linux-nslu2/drivers/rtc/rtc-test.c 2006-01-09 04:17:02.000000000 +0100 +@@ -0,0 +1,206 @@ +/* + * An RTC test device/driver + * Copyright (C) 2005 Tower Technologies @@ -2275,6 +2323,9 @@ +#include <linux/rtc.h> +#include <linux/platform_device.h> + ++struct platform_device *test0 = NULL, *test1 = NULL; ++ ++ +static int test_rtc_read_alarm(struct device *dev, + struct rtc_wkalrm *alrm) +{ @@ -2391,7 +2442,7 @@ + return 0; +} + -+static int test_remove(struct platform_device *plat_dev) ++static int __devexit test_remove(struct platform_device *plat_dev) +{ + struct rtc_device *rtc = platform_get_drvdata(plat_dev); + @@ -2401,25 +2452,9 @@ + return 0; +} + -+static void test_release(struct device * dev) -+{ -+} -+ -+struct platform_device test_dev_zero = { -+ .name = "rtc-test", -+ .id = 0, -+ .dev.release = test_release, -+}; -+ -+struct platform_device test_dev_one = { -+ .name = "rtc-test", -+ .id = 1, -+ .dev.release = test_release, -+}; -+ -+struct platform_driver test_drv = { ++static struct platform_driver test_drv = { + .probe = test_probe, -+ .remove = test_remove, ++ .remove = __devexit_p(test_remove), + .driver = { + .name = "rtc-test", + .owner = THIS_MODULE, @@ -2428,18 +2463,48 @@ + +static int __init test_init(void) +{ -+ platform_device_register(&test_dev_zero); -+ platform_device_register(&test_dev_one); -+ platform_driver_register(&test_drv); ++ int err; ++ ++ if ((err = platform_driver_register(&test_drv))) ++ return err; ++ ++ if ((test0 = platform_device_alloc("rtc-test", 0)) == NULL) { ++ err = -ENOMEM; ++ goto exit_driver_unregister; ++ } ++ ++ if ((test1 = platform_device_alloc("rtc-test", 1)) == NULL) { ++ err = -ENOMEM; ++ goto exit_free_test0; ++ } ++ ++ if ((err = platform_device_add(test0))) ++ goto exit_free_test1; ++ ++ if ((err = platform_device_add(test1))) ++ goto exit_device_unregister; + + return 0; ++ ++exit_device_unregister: ++ platform_device_unregister(test0); ++ ++exit_free_test1: ++ platform_device_put(test1); ++ ++exit_free_test0: ++ platform_device_put(test0); ++ ++exit_driver_unregister: ++ platform_driver_unregister(&test_drv); ++ return err; +} + +static void __exit test_exit(void) +{ ++ platform_device_unregister(test0); ++ platform_device_unregister(test1); + platform_driver_unregister(&test_drv); -+ platform_device_unregister(&test_dev_zero); -+ platform_device_unregister(&test_dev_one); +} + +MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); @@ -2449,8 +2514,8 @@ +module_init(test_init); +module_exit(test_exit); --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-nslu2/drivers/rtc/rtc-ds1672.c 2006-01-04 01:27:21.000000000 +0100 -@@ -0,0 +1,266 @@ ++++ linux-nslu2/drivers/rtc/rtc-ds1672.c 2006-01-12 00:31:05.000000000 +0100 +@@ -0,0 +1,278 @@ +/* + * An rtc/i2c driver for the Dallas DS1672 + * Copyright 2005 Alessandro Zummo @@ -2465,7 +2530,7 @@ +#include <linux/i2c.h> +#include <linux/rtc.h> + -+#define DRV_VERSION "0.1" ++#define DRV_VERSION "0.2" + +/* Addresses to scan: none. This chip cannot be detected. */ +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; @@ -2493,8 +2558,20 @@ +static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) +{ + unsigned long time; ++ unsigned char addr = DS1672_REG_CNT_BASE; + unsigned char buf[4]; + ++ struct i2c_msg msgs[] = { ++ { client->addr, 0, 1, &addr }, /* setup read ptr */ ++ { client->addr, I2C_M_RD, 4, buf }, /* read date */ ++ }; ++ ++ /* read date registers */ ++ if ((i2c_transfer(client->adapter, &msgs[0], 2)) != 2) { ++ dev_err(&client->dev, "%s: read error\n", __FUNCTION__); ++ return -EIO; ++ } ++ + dev_dbg(&client->dev, + "%s: raw read data - counters=%02x,%02x,%02x,%02x\n" + __FUNCTION__, diff --git a/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch b/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch new file mode 100644 index 0000000000..a3597a9c3f --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.15/45-eeprom-notifier.patch @@ -0,0 +1,184 @@ +Add EEPROM notifiers + +These help board level code by allowing a callback when EEPROMs are +loaded, this permits system level configuration to be loaded from the +EEPROM. This is particularly useful when the ethernet MAC ids are +stored in EEPROM and when the ethernet hardware is generic (so it +has no board level knowledge), then the MACs can be loaded into +the 'maclist' code and read out by the ethernet config. + +Signed-off-by: John Bowler <jbowler@acm.org> + +--- linux-2.6.15/drivers/i2c/chips/eeprom.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/drivers/i2c/chips/eeprom.c 1970-01-01 00:00:00.000000000 +0000 +@@ -25,7 +25,6 @@ + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +- + #include <linux/kernel.h> + #include <linux/init.h> + #include <linux/module.h> +@@ -33,6 +32,9 @@ + #include <linux/sched.h> + #include <linux/jiffies.h> + #include <linux/i2c.h> ++#include <linux/notifier.h> ++ ++#include <linux/eeprom.h> + + /* Addresses to scan */ + static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, +@@ -41,6 +43,9 @@ static unsigned short normal_i2c[] = { 0 + /* Insmod parameters */ + I2C_CLIENT_INSMOD_1(eeprom); + ++/* Notifier list */ ++static DECLARE_MUTEX(eeprom_notifier_mutex); ++static LIST_HEAD(eeprom_notifiers); + + /* Size of EEPROM in bytes */ + #define EEPROM_SIZE 256 +@@ -160,6 +165,7 @@ static int eeprom_detect(struct i2c_adap + struct i2c_client *new_client; + struct eeprom_data *data; + int err = 0; ++ struct list_head *this; + + /* There are three ways we can read the EEPROM data: + (1) I2C block reads (faster, but unsupported by most adapters) +@@ -196,7 +202,7 @@ static int eeprom_detect(struct i2c_adap + + /* Detect the Vaio nature of EEPROMs. + We use the "PCG-" prefix as the signature. */ +- if (address == 0x57) { ++ if (list_empty(&eeprom_notifiers) && address == 0x57) { + if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' + && i2c_smbus_read_byte(new_client) == 'C' + && i2c_smbus_read_byte(new_client) == 'G' +@@ -210,6 +216,14 @@ static int eeprom_detect(struct i2c_adap + /* create the sysfs eeprom file */ + sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr); + ++ /* Call each notifier callback */ ++ down(&eeprom_notifier_mutex); ++ list_for_each(this, &eeprom_notifiers) { ++ struct eeprom_notifier *not = list_entry(this, struct eeprom_notifier, list); ++ not->add(address, kind, &new_client->dev.kobj, &eeprom_attr); ++ } ++ up(&eeprom_notifier_mutex); ++ + return 0; + + exit_kfree: +@@ -231,6 +245,51 @@ static int eeprom_detach_client(struct i + return 0; + } + ++/** ++ * register_eeprom_user - register a 'user' of EEPROM devices. ++ * @new: pointer to notifier info structure ++ * ++ * Registers a callback function to be called upon detection ++ * of an EEPROM device. Detection invokes the 'add' callback ++ * with the kobj of the mutex and a bin_attribute which allows ++ * read from the EEPROM. The intention is that the notifier ++ * will be able to read system configuration from the notifier. ++ * ++ * Only EEPROMs detected *after* the addition of the notifier ++ * are notified. I.e. EEPROMs already known to the system ++ * will not be notified - add the notifier from board level ++ * code! ++ */ ++void register_eeprom_user (struct eeprom_notifier *new) ++{ ++ down(&eeprom_notifier_mutex); ++ ++ list_add(&new->list, &eeprom_notifiers); ++ ++ up(&eeprom_notifier_mutex); ++} ++ ++/** ++ * unregister_eeprom_user - unregister a 'user' of EEPROM devices. ++ * @old: pointer to notifier info structure ++ * ++ * Removes a callback function from the list of 'users' to be ++ * notified upon detection of EEPROM devices. ++ */ ++void unregister_eeprom_user (struct eeprom_notifier *old) ++{ ++ down(&eeprom_notifier_mutex); ++ ++ list_del(&old->list); ++ ++ up(&eeprom_notifier_mutex); ++} ++ ++ ++EXPORT_SYMBOL(register_eeprom_user); ++EXPORT_SYMBOL(unregister_eeprom_user); ++ ++ + static int __init eeprom_init(void) + { + return i2c_add_driver(&eeprom_driver); +--- linux-2.6.15/include/linux/eeprom.h 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/include/linux/eeprom.h 1970-01-01 00:00:00.000000000 +0000 +@@ -0,0 +1,56 @@ ++#ifndef _LINUX_EEPROM_H ++#define _LINUX_EEPROM_H ++/* ++ * $Id$ ++ * ++ * Copyright (C) 2006 John Bowler ++ */ ++ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef __KERNEL__ ++#error This is a kernel header ++#endif ++ ++#include <linux/list.h> ++#include <linux/kobject.h> ++#include <linux/sysfs.h> ++ ++/* ++ * This is very basic. ++ * ++ * If an EEPROM is detected on the I2C bus (this only works for ++ * I2C EEPROMs) the eeprom_notifier::add method is called with ++ * both the I2C information and the kobject for the sysfs ++ * device which has been registers. It is then possible to ++ * read from the device via the bin_attribute::read method ++ * to extract configuration information. ++ * ++ * Register the notifier in the board level code, there is no ++ * need to unregister it but you can if you want (it will save ++ * a little bit or kernel memory to do so). ++ */ ++struct eeprom_notifier { ++ void (*add)(int address, int kind, struct kobject *kobj, ++ struct bin_attribute *eeprom_attr); ++ struct list_head list; ++}; ++ ++extern void register_eeprom_user (struct eeprom_notifier *new); ++extern void unregister_eeprom_user (struct eeprom_notifier *old); ++ ++#endif /* _LINUX_EEPROM_H */ diff --git a/packages/linux/ixp4xx-kernel/2.6.15/93-loft-maclist.patch b/packages/linux/ixp4xx-kernel/2.6.15/93-loft-maclist.patch new file mode 100644 index 0000000000..ffda1136ef --- /dev/null +++ b/packages/linux/ixp4xx-kernel/2.6.15/93-loft-maclist.patch @@ -0,0 +1,96 @@ +add loft support for setting the maclist from EEPROM + +Signed-off-by: John Bowler <jbowler@acm.org> + +--- linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.15/arch/arm/mach-ixp4xx/ixdp425-setup.c 1970-01-01 00:00:00.000000000 +0000 +@@ -14,6 +14,7 @@ + #include <linux/serial.h> + #include <linux/tty.h> + #include <linux/serial_8250.h> ++#include <linux/eeprom.h> + + #include <asm/types.h> + #include <asm/setup.h> +@@ -24,6 +25,8 @@ + #include <asm/mach/arch.h> + #include <asm/mach/flash.h> + ++#include <net/maclist.h> ++ + static struct flash_platform_data ixdp425_flash_data = { + .map_name = "cfi_probe", + .width = 2, +@@ -188,9 +191,62 @@ MACHINE_END + /* + * Loft is functionally equivalent to Avila except that it has a + * different number for the maximum PCI devices. The MACHINE +- * structure below is identical to Avila except for the comment. ++ * structure below is identical to Avila except for the and ++ * the use of a loft specific init. ++ * ++ * The loft init registers a notifier on the on-board EEPROM to ++ * detect the MAC addresses. ++ * NOTE: this probably works for all Gateworks Avila boards and ++ * maybe the ixdp425 too. + */ + #ifdef CONFIG_MACH_LOFT ++/* ++ * When the EEPROM is added the MAC address are read from it. ++ */ ++static void loft_eeprom_add(int address, int kind, struct kobject *kobj, ++ struct bin_attribute *eeprom_attr) { ++ /* The MACs are the first 12 bytes in the eeprom at address 0x51 */ ++ if (address == 0x51) { ++ ssize_t retlen; ++ char data[12]; ++ ++ /* Two Macs, one at 0, the other at 6, maclist_add will ++ * complain if the ID is not a valid MAC. ++ */ ++ retlen = eeprom_attr->read(kobj, data, 0, sizeof data); ++ if (retlen >= 6) { ++ u8 mac[6]; ++ memcpy(mac, data+0, sizeof mac); ++ printk(KERN_INFO "LOFT MAC[0]: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", ++ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); ++ maclist_add(mac); ++ } ++ if (retlen >= 12) { ++ u8 mac[6]; ++ memcpy(mac, data+6, sizeof mac); ++ printk(KERN_INFO "LOFT MAC[1]: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", ++ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); ++ maclist_add(mac); ++ } ++ } ++} ++ ++static struct eeprom_notifier loft_eeprom_notifier = { ++ .add = loft_eeprom_add ++}; ++ ++static void __init loft_init(void) ++{ ++ /* The EEPROM has two ethernet MACs embedded in it which we need, ++ * that is all this notifier does. ++ */ ++ register_eeprom_user(&loft_eeprom_notifier); ++ ++ ixp4xx_sys_init(); ++ ++ platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); ++} ++ + MACHINE_START(LOFT, "Giant Shoulder Inc Loft board") + /* Maintainer: Tom Billman <kernel@giantshoulderinc.com> */ + .phys_ram = PHYS_OFFSET, +@@ -200,7 +256,7 @@ MACHINE_START(LOFT, "Giant Shoulder Inc + .init_irq = ixp4xx_init_irq, + .timer = &ixp4xx_timer, + .boot_params = 0x0100, +- .init_machine = ixdp425_init, ++ .init_machine = loft_init, + MACHINE_END + #endif + diff --git a/packages/linux/ixp4xx-kernel_2.6.15.bb b/packages/linux/ixp4xx-kernel_2.6.15.bb index c2556b85f4..35164138f7 100644 --- a/packages/linux/ixp4xx-kernel_2.6.15.bb +++ b/packages/linux/ixp4xx-kernel_2.6.15.bb @@ -8,7 +8,7 @@ PR_CONFIG = "1" # Increment the number below (i.e. the digits after PR) when # making changes within this file or for changes to the patches # applied to the kernel. -PR = "r6.${PR_CONFIG}" +PR = "r7.${PR_CONFIG}" include ixp4xx-kernel.inc @@ -17,8 +17,10 @@ IXP4XX_PATCHES = "" IXP4XX_PATCHES += "file://00-memory-h-page-shift.patch;patch=1" IXP4XX_PATCHES += "file://10-mtdpart-redboot-fis-byteswap.patch;patch=1" +IXP4XX_PATCHES += "file://11-mtdpart-redboot-config-byteswap.patch;patch=1" IXP4XX_PATCHES += "file://15-jffs2-endian-config.patch;patch=1" IXP4XX_PATCHES += "file://40-rtc-class.patch;patch=1" +IXP4XX_PATCHES += "file://45-eeprom-notifier.patch;patch=1" IXP4XX_PATCHES += "file://50-nas100d-arch.patch;patch=1" IXP4XX_PATCHES += "file://55-rtc-pcf8563.patch;patch=1" IXP4XX_PATCHES += "file://60-nas100d-i2c.patch;patch=1" @@ -34,3 +36,4 @@ IXP4XX_PATCHES += "file://85-timer.patch;patch=1" IXP4XX_PATCHES += "file://91-maclist.patch;patch=1" IXP4XX_PATCHES += "file://92-nas100d-maclist.patch;patch=1" IXP4XX_PATCHES += "file://92-nslu2-maclist.patch;patch=1" +IXP4XX_PATCHES += "file://93-loft-maclist.patch;patch=1" diff --git a/packages/meta/slugos-image.bb b/packages/meta/slugos-image.bb index df3103fd79..0944089f12 100644 --- a/packages/meta/slugos-image.bb +++ b/packages/meta/slugos-image.bb @@ -1,10 +1,13 @@ -# This describes a generic NSLU2 image, even though the bb file is +# This describes a generic SlugOS image, even though the bb file is # called 'slugos-image.bb' the distro specific configuration is # done in conf/distro/${DISTRO}.conf (which should always include # conf/distro/slugos.conf to get the standard settings). # +DESCRIPTION = "Generic SlugOS image" +MAINTAINER = "NSLU2 Linux <nslu2-linux@yahoogroups.com>" +HOMEPAGE = "http://www.nslu2-linux.org" LICENSE = "MIT" -PR = "r19" +PR = "r20" # SLUGOS_IMAGENAME defines the name of the image to be build, if it # is not set this package will be skipped! @@ -40,7 +43,7 @@ EXTRA_IMAGEDEPENDS += "${PACK_IMAGE_DEPENDS}" # This hack removes '${MACHINE}' from the end of the arch.conf for ipk, # preventing _mach.ipk (with no byte sex) taking precedence over everything # else. -IMAGE_POSTPROCESS_COMMAND += "sed '$d' '${IMAGE_ROOTFS}/etc/ipkg/arch.conf';" +IMAGE_POSTPROCESS_COMMAND += "sed -i '$d' '${IMAGE_ROOTFS}/etc/ipkg/arch.conf';" # These depends define native utilities - they do not get put in the flash and # are not required to build the image. diff --git a/packages/meta/slugos-imagename.bb b/packages/meta/slugos-imagename.bb index a6967a6208..2637524407 100644 --- a/packages/meta/slugos-imagename.bb +++ b/packages/meta/slugos-imagename.bb @@ -1,6 +1,7 @@ # This is an inglorious hack to provide a package to match # ${SLUGOS_IMAGENAME}-image MAINTAINER = "John Bowler <jbowler@acm.org> +LICENSE = "MIT" PN = "${SLUGOS_IMAGENAME}-image" PV = "0" PR = "r0" |